hostapd: update mesh DFS patches and add mesh HE support
[openwrt/openwrt.git] / package / network / services / hostapd / patches / 012-mesh-fix-channel-switch-error-during-CAC.patch
1 From ab6995f15aae17af93507dd2344615f91672a31a Mon Sep 17 00:00:00 2001
2 From: Peter Oh <peter.oh@bowerswilkins.com>
3 Date: Tue, 30 Jun 2020 14:19:00 +0200
4 Subject: [PATCH 12/19] mesh: fix channel switch error during CAC
5
6 Mesh interface has used its channel parameters that configured
7 during its initialization even after channel switched due to
8 DFS radar detection during CAC which caused channel switch error.
9 This change fixes the error by updating its channel parameters
10 when channel's been changed from initial one.
11
12 Signed-off-by: Peter Oh <peter.oh@bowerswilkins.com>
13 ---
14 wpa_supplicant/mesh.c | 34 ++++++++++++++++++++++++++++++++++
15 1 file changed, 34 insertions(+)
16
17 --- a/wpa_supplicant/mesh.c
18 +++ b/wpa_supplicant/mesh.c
19 @@ -13,6 +13,7 @@
20 #include "utils/uuid.h"
21 #include "common/ieee802_11_defs.h"
22 #include "common/wpa_ctrl.h"
23 +#include "common/hw_features_common.h"
24 #include "ap/sta_info.h"
25 #include "ap/hostapd.h"
26 #include "ap/ieee802_11.h"
27 @@ -206,6 +207,39 @@ static int wpas_mesh_complete(struct wpa
28 return -1;
29 }
30
31 + /*
32 + * inspect if channel's been changed since initialized.
33 + * i.e. DFS radar detection
34 + */
35 + if (ifmsh->freq != params->freq.freq) {
36 + wpa_s->assoc_freq = ifmsh->freq;
37 + ssid->frequency = ifmsh->freq;
38 + struct he_capabilities *he_capab = NULL;
39 +
40 + if (ifmsh->current_mode)
41 + he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH];
42 +
43 + if (hostapd_set_freq_params(&params->freq,
44 + ifmsh->conf->hw_mode,
45 + ifmsh->freq,
46 + ifmsh->conf->channel,
47 + ifmsh->conf->enable_edmg,
48 + ifmsh->conf->edmg_channel,
49 + ifmsh->conf->ieee80211n,
50 + ifmsh->conf->ieee80211ac,
51 + ifmsh->conf->ieee80211ax,
52 + ifmsh->conf->secondary_channel,
53 + hostapd_get_oper_chwidth(ifmsh->conf),
54 + hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),
55 + hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),
56 + ifmsh->conf->vht_capab,
57 + he_capab)) {
58 + wpa_printf(MSG_ERROR, "Error updating mesh frequency params.");
59 + wpa_supplicant_mesh_deinit(wpa_s);
60 + return -1;
61 + }
62 + }
63 +
64 if (ifmsh->mconf->security != MESH_CONF_SEC_NONE &&
65 wpas_mesh_init_rsn(wpa_s)) {
66 wpa_printf(MSG_ERROR,