d491f7c4bc7472d45cb42b5c87e9d600e0518b1f
[openwrt/staging/neocturne.git] /
1 From af8dcbc87466ed6472850a4f1cfe252652cb3d26 Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Tue, 30 Jun 2020 14:18:59 +0200
4 Subject: [PATCH 11/19] mesh: do not set offchanok on DFS channels in non-ETSI
5
6 mac80211 does not allow mgmt tx to use off channel on
7 DFS channels in non-ETSI domain, because it will invalidate
8 CAC result on current operating channel.
9 (mac80211 commit: 34373d12f3cbb74960a73431138ef619d857996f)
10 Hence don't set offchanok for mgmt tx in case of DFS channels
11 in non-ETSI.
12
13 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
14 ---
15 src/drivers/driver_nl80211.c | 19 +++++++++++++++++++
16 1 file changed, 19 insertions(+)
17
18 --- a/src/drivers/driver_nl80211.c
19 +++ b/src/drivers/driver_nl80211.c
20 @@ -7788,7 +7788,11 @@ static int wpa_driver_nl80211_send_actio
21 int ret = -1;
22 u8 *buf;
23 struct ieee80211_hdr *hdr;
24 + struct hostapd_hw_modes *modes;
25 int offchanok = 1;
26 + u16 num_modes, flags;
27 + u8 dfs_domain;
28 + int i;
29
30 if (is_ap_interface(drv->nlmode) && (int) freq == bss->freq &&
31 bss->beacon_set)
32 @@ -7817,6 +7821,21 @@ static int wpa_driver_nl80211_send_actio
33 os_memset(bss->rand_addr, 0, ETH_ALEN);
34 }
35
36 + if (is_mesh_interface(drv->nlmode)) {
37 + modes = nl80211_get_hw_feature_data(bss, &num_modes,
38 + &flags, &dfs_domain);
39 + if (dfs_domain != HOSTAPD_DFS_REGION_ETSI &&
40 + ieee80211_is_dfs(bss->freq, modes, num_modes))
41 + offchanok = 0;
42 + if (modes) {
43 + for (i = 0; i < num_modes; i++) {
44 + os_free(modes[i].channels);
45 + os_free(modes[i].rates);
46 + }
47 + os_free(modes);
48 + }
49 + }
50 +
51 if (is_ap_interface(drv->nlmode) &&
52 (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) ||
53 (int) freq == bss->freq || drv->device_ap_sme ||