2020-07-23 17:34:00 +00:00
|
|
|
From 8de8cd8380af0c43d4fde67a668d79ef73b26b26 Mon Sep 17 00:00:00 2001
|
2020-05-21 09:15:46 +00:00
|
|
|
From: Peter Oh <peter.oh@bowerswilkins.com>
|
2020-07-23 17:34:00 +00:00
|
|
|
Date: Tue, 30 Jun 2020 14:18:58 +0200
|
|
|
|
Subject: [PATCH 10/19] mesh: Allow DFS channels to be selected if dfs is
|
|
|
|
enabled
|
2020-05-21 09:15:46 +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>
|
|
|
|
---
|
2020-07-23 17:34:00 +00:00
|
|
|
wpa_supplicant/wpa_supplicant.c | 25 +++++++++++++++++++------
|
|
|
|
1 file changed, 19 insertions(+), 6 deletions(-)
|
2020-05-21 09:15:46 +00:00
|
|
|
|
|
|
|
--- a/wpa_supplicant/wpa_supplicant.c
|
|
|
|
+++ b/wpa_supplicant/wpa_supplicant.c
|
2020-06-08 15:35:32 +00:00
|
|
|
@@ -2349,6 +2349,8 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
2020-05-21 09:15:46 +00:00
|
|
|
int chwidth, seg0, seg1;
|
|
|
|
u32 vht_caps = 0;
|
|
|
|
int is_24ghz;
|
|
|
|
+ int dfs_enabled = wpa_s->conf->country[0] &&
|
2020-07-23 17:34:00 +00:00
|
|
|
+ (wpa_s->drv_flags & WPA_DRIVER_FLAGS_RADAR);
|
2020-05-21 09:15:46 +00:00
|
|
|
|
|
|
|
freq->freq = ssid->frequency;
|
|
|
|
|
2020-06-08 15:35:32 +00:00
|
|
|
@@ -2436,8 +2438,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
2020-05-21 09:15:46 +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;
|
|
|
|
|
|
|
|
freq->channel = pri_chan->chan;
|
|
|
|
|
2020-06-08 15:35:32 +00:00
|
|
|
@@ -2470,8 +2475,11 @@ void ibss_mesh_setup_freq(struct wpa_sup
|
2020-05-21 09:15:46 +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;
|
|
|
|
|
|
|
|
if (ht40 == -1) {
|
|
|
|
if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS))
|
2020-06-08 15:35:32 +00:00
|
|
|
@@ -2564,8 +2572,11 @@ skip_ht40:
|
2020-05-21 09:15:46 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
chwidth = CHANWIDTH_80MHZ;
|
2020-07-23 17:34:00 +00:00
|
|
|
@@ -2585,10 +2596,12 @@ skip_ht40:
|
2020-05-21 09:15:46 +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;
|
2020-07-23 17:34:00 +00:00
|
|
|
+ if (chan->flag & (HOSTAPD_CHAN_RADAR |
|
|
|
|
+ HOSTAPD_CHAN_NO_IR))
|
2020-05-21 09:15:46 +00:00
|
|
|
+ if (!dfs_enabled)
|
|
|
|
+ continue;
|
|
|
|
|
|
|
|
/* Found a suitable second segment for 80+80 */
|
|
|
|
chwidth = CHANWIDTH_80P80MHZ;
|