2019-05-03 23:52:25 +00:00
|
|
|
From 89fa0d75fb1be82330258082ed3d7fd452eb6076 Mon Sep 17 00:00:00 2001
|
2018-04-12 11:07:22 +00:00
|
|
|
From: Peter Oh <peter.oh@bowerswilkins.com>
|
2019-05-03 23:52:25 +00:00
|
|
|
Date: Mon, 27 Aug 2018 14:28:45 -0700
|
|
|
|
Subject: [PATCH 3/7] mesh: Allow DFS channels to be selected if dfs is enabled
|
2018-04-12 11:07:22 +00:00
|
|
|
|
|
|
|
Note: DFS is assumed to be usable if a country code has been set
|
|
|
|
|
|
|
|
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
|
|
|
|
Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
|
|
|
|
---
|
|
|
|
wpa_supplicant/wpa_supplicant.c | 24 ++++++++++++++++++------
|
|
|
|
1 file changed, 18 insertions(+), 6 deletions(-)
|
|
|
|
|
|
|
|
--- a/wpa_supplicant/wpa_supplicant.c
|
|
|
|
+++ b/wpa_supplicant/wpa_supplicant.c
|
2019-08-10 14:49:34 +00:00
|
|
|
@@ -2153,6 +2153,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
2018-04-12 11:07:22 +00:00
|
|
|
struct hostapd_freq_params vht_freq;
|
|
|
|
int chwidth, seg0, seg1;
|
|
|
|
u32 vht_caps = 0;
|
|
|
|
+ int dfs_enabled = wpa_s->conf->country[0] &&
|
|
|
|
+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
|
|
|
|
|
|
|
|
freq->freq = ssid->frequency;
|
|
|
|
|
2019-08-10 14:49:34 +00:00
|
|
|
@@ -2232,8 +2234,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
2018-04-12 11:07:22 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Check primary channel flags */
|
|
|
|
- if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
|
|
|
+ if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
|
|
|
|
return;
|
|
|
|
+ if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
|
|
|
+ if (!dfs_enabled)
|
|
|
|
+ return;
|
|
|
|
|
2019-05-03 23:52:25 +00:00
|
|
|
freq->channel = pri_chan->chan;
|
|
|
|
|
2019-08-10 14:49:34 +00:00
|
|
|
@@ -2264,8 +2269,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
2018-04-12 11:07:22 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Check secondary channel flags */
|
|
|
|
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
|
|
|
+ if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
|
|
|
|
return;
|
|
|
|
+ if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
|
|
|
+ if (!dfs_enabled)
|
|
|
|
+ return;
|
|
|
|
|
2019-05-03 23:52:25 +00:00
|
|
|
if (ht40 == -1) {
|
|
|
|
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
|
2019-08-10 14:49:34 +00:00
|
|
|
@@ -2356,8 +2364,11 @@ skip_ht40:
|
2018-04-12 11:07:22 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
/* Back to HT configuration if channel not usable */
|
|
|
|
- if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
|
|
|
|
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
|
|
|
return;
|
|
|
|
+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
|
|
|
+ if (!dfs_enabled)
|
|
|
|
+ return;
|
|
|
|
}
|
|
|
|
|
2019-08-10 14:49:34 +00:00
|
|
|
chwidth = CHANWIDTH_80MHZ;
|
|
|
|
@@ -2377,10 +2388,11 @@ skip_ht40:
|
2018-04-12 11:07:22 +00:00
|
|
|
if (!chan)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
- if (chan->flag & (HOSTAPD_CHAN_DISABLED |
|
|
|
|
- HOSTAPD_CHAN_NO_IR |
|
|
|
|
- HOSTAPD_CHAN_RADAR))
|
|
|
|
+ if (chan->flag & HOSTAPD_CHAN_DISABLED)
|
|
|
|
continue;
|
|
|
|
+ if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
|
|
|
|
+ if (!dfs_enabled)
|
|
|
|
+ continue;
|
|
|
|
|
|
|
|
/* Found a suitable second segment for 80+80 */
|
2019-08-10 14:49:34 +00:00
|
|
|
chwidth = CHANWIDTH_80P80MHZ;
|