1 From 8de8cd8380af0c43d4fde67a668d79ef73b26b26 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Tue, 30 Jun 2020 14:18:58 +0200
4 Subject: [PATCH 10/19] 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 | 25 +++++++++++++++++++------
13 1 file changed, 19 insertions(+), 6 deletions(-)
15 --- a/wpa_supplicant/wpa_supplicant.c
16 +++ b/wpa_supplicant/wpa_supplicant.c
17 @@ -2349,6 +2349,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
18 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 @@ -2436,8 +2438,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 freq->channel = pri_chan->chan;
39 @@ -2470,8 +2475,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))
51 if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
52 @@ -2564,8 +2572,11 @@ skip_ht40:
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 = CHANWIDTH_80MHZ;
65 @@ -2585,10 +2596,12 @@ skip_ht40:
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 |
75 + HOSTAPD_CHAN_NO_IR))
79 /* Found a suitable second segment for 80+80 */
80 chwidth = CHANWIDTH_80P80MHZ;