1 From 1eab0e62920f443f8814bad846f6439843223b69 Mon Sep 17 00:00:00 2001
2 From: Markus Theil <markus.theil@tu-ilmenau.de>
3 Date: Tue, 30 Jun 2020 14:19:06 +0200
4 Subject: [PATCH 18/19] mesh: move mesh freq setting to own function
6 Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
8 wpa_supplicant/mesh.c | 59 ++++++++++++++++++++++++++-----------------
9 1 file changed, 36 insertions(+), 23 deletions(-)
11 --- a/wpa_supplicant/mesh.c
12 +++ b/wpa_supplicant/mesh.c
13 @@ -201,6 +201,40 @@ static int wpas_mesh_init_rsn(struct wpa
14 return !wpa_s->mesh_rsn ? -1 : 0;
18 +static int wpas_mesh_update_freq_params(struct wpa_supplicant *wpa_s)
20 + struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params;
21 + struct hostapd_iface *ifmsh = wpa_s->ifmsh;
22 + struct he_capabilities *he_capab = NULL;
24 + if (ifmsh->current_mode)
25 + he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH];
27 + if (hostapd_set_freq_params(¶ms->freq,
28 + ifmsh->conf->hw_mode,
30 + ifmsh->conf->channel,
31 + ifmsh->conf->enable_edmg,
32 + ifmsh->conf->edmg_channel,
33 + ifmsh->conf->ieee80211n,
34 + ifmsh->conf->ieee80211ac,
35 + ifmsh->conf->ieee80211ax,
36 + ifmsh->conf->secondary_channel,
37 + hostapd_get_oper_chwidth(ifmsh->conf),
38 + hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),
39 + hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),
40 + ifmsh->conf->vht_capab,
42 + wpa_printf(MSG_ERROR, "Error updating mesh frequency params.");
43 + wpa_supplicant_mesh_deinit(wpa_s, true);
51 static int wpas_mesh_complete(struct wpa_supplicant *wpa_s)
53 struct hostapd_iface *ifmsh = wpa_s->ifmsh;
54 @@ -221,30 +255,8 @@ static int wpas_mesh_complete(struct wpa
55 if (ifmsh->freq > 0 && ifmsh->freq != params->freq.freq) {
56 wpa_s->assoc_freq = ifmsh->freq;
57 ssid->frequency = ifmsh->freq;
58 - struct he_capabilities *he_capab = NULL;
60 - if (ifmsh->current_mode)
61 - he_capab = &ifmsh->current_mode->he_capab[IEEE80211_MODE_MESH];
63 - if (hostapd_set_freq_params(¶ms->freq,
64 - ifmsh->conf->hw_mode,
66 - ifmsh->conf->channel,
67 - ifmsh->conf->enable_edmg,
68 - ifmsh->conf->edmg_channel,
69 - ifmsh->conf->ieee80211n,
70 - ifmsh->conf->ieee80211ac,
71 - ifmsh->conf->ieee80211ax,
72 - ifmsh->conf->secondary_channel,
73 - hostapd_get_oper_chwidth(ifmsh->conf),
74 - hostapd_get_oper_centr_freq_seg0_idx(ifmsh->conf),
75 - hostapd_get_oper_centr_freq_seg1_idx(ifmsh->conf),
76 - ifmsh->conf->vht_capab,
78 - wpa_printf(MSG_ERROR, "Error updating mesh frequency params.");
79 - wpa_supplicant_mesh_deinit(wpa_s, true);
80 + if (wpas_mesh_update_freq_params(wpa_s) != 0)
85 if (ifmsh->mconf->security != MESH_CONF_SEC_NONE &&
86 @@ -518,6 +530,7 @@ static int wpa_supplicant_mesh_init(stru
92 wpa_supplicant_mesh_deinit(wpa_s, true);