1 From bbaa6142eadf229334436fdbf51aa65bb819f771 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Tue, 29 May 2018 14:39:15 -0700
4 Subject: [PATCH 11/18] mesh: Allow DFS channels to be selected if dfs is
7 Note: DFS is assumed to be usable if a country code has been set
9 Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
10 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
12 wpa_supplicant/wpa_supplicant.c | 24 ++++++++++++++++++------
13 1 file changed, 18 insertions(+), 6 deletions(-)
15 --- a/wpa_supplicant/wpa_supplicant.c
16 +++ b/wpa_supplicant/wpa_supplicant.c
17 @@ -2060,6 +2060,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
18 struct hostapd_freq_params vht_freq;
19 int chwidth, seg0, seg1;
21 + int dfs_enabled = wpa_s->conf->country[0] &&
22 + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
24 freq->freq = ssid->frequency;
26 @@ -2136,8 +2138,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
29 /* Check primary channel flags */
30 - if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
31 + if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
33 + if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
37 #ifdef CONFIG_HT_OVERRIDES
38 if (ssid->disable_ht40)
39 @@ -2163,8 +2168,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
42 /* Check secondary channel flags */
43 - if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
44 + if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
46 + if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
50 freq->channel = pri_chan->chan;
52 @@ -2254,8 +2262,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
55 /* Back to HT configuration if channel not usable */
56 - if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
57 + if (chan->flag & HOSTAPD_CHAN_DISABLED)
59 + if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
64 chwidth = VHT_CHANWIDTH_80MHZ;
65 @@ -2275,10 +2286,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
69 - if (chan->flag & (HOSTAPD_CHAN_DISABLED |
70 - HOSTAPD_CHAN_NO_IR |
71 - HOSTAPD_CHAN_RADAR))
72 + if (chan->flag & HOSTAPD_CHAN_DISABLED)
74 + if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
78 /* Found a suitable second segment for 80+80 */
79 chwidth = VHT_CHANWIDTH_80P80MHZ;