1 From 89fa0d75fb1be82330258082ed3d7fd452eb6076 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Mon, 27 Aug 2018 14:28:45 -0700
4 Subject: [PATCH 3/7] mesh: Allow DFS channels to be selected if dfs is enabled
6 Note: DFS is assumed to be usable if a country code has been set
8 Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
9 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
11 wpa_supplicant/wpa_supplicant.c | 24 ++++++++++++++++++------
12 1 file changed, 18 insertions(+), 6 deletions(-)
14 --- a/wpa_supplicant/wpa_supplicant.c
15 +++ b/wpa_supplicant/wpa_supplicant.c
16 @@ -2345,6 +2345,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
17 int chwidth, seg0, seg1;
20 + int dfs_enabled = wpa_s->conf->country[0] &&
21 + (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
23 freq->freq = ssid->frequency;
25 @@ -2432,8 +2434,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
28 /* Check primary channel flags */
29 - if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
30 + if (pri_chan->flag & HOSTAPD_CHAN_DISABLED)
32 + if (pri_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
36 freq->channel = pri_chan->chan;
38 @@ -2466,8 +2471,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
41 /* Check secondary channel flags */
42 - if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
43 + if (sec_chan->flag & HOSTAPD_CHAN_DISABLED)
45 + if (sec_chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
50 if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
51 @@ -2560,8 +2568,11 @@ skip_ht40:
54 /* Back to HT configuration if channel not usable */
55 - if (chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
56 + if (chan->flag & HOSTAPD_CHAN_DISABLED)
58 + if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
63 chwidth = CHANWIDTH_80MHZ;
64 @@ -2581,10 +2592,11 @@ skip_ht40:
68 - if (chan->flag & (HOSTAPD_CHAN_DISABLED |
69 - HOSTAPD_CHAN_NO_IR |
70 - HOSTAPD_CHAN_RADAR))
71 + if (chan->flag & HOSTAPD_CHAN_DISABLED)
73 + if (chan->flag & (HOSTAPD_CHAN_RADAR | HOSTAPD_CHAN_NO_IR))
77 /* Found a suitable second segment for 80+80 */
78 chwidth = CHANWIDTH_80P80MHZ;