From e5a9b1e8a3a50098af3e0caed0c9327037c8ec5e Mon Sep 17 00:00:00 2001 From: Peter Oh Date: Wed, 18 Apr 2018 14:14:19 -0700 Subject: [PATCH] mesh: Implement use of VHT20 config in mesh mode Mesh in VHT mode is supposed to be able to use any bandwidth that VHT supports, but there was no way to set VHT20 although there are parameters that are supposed to be used. This commit along then previous commit for VHT_CHANWIDTH_USE_HT makes mesh configuration available to use any bandwidth with combinations of existing parameters like shown below. VHT80: default do not set any parameters VHT40: max_oper_chwidth = 0 VHT20: max_oper_chwidth = 0 disable_ht40 = 1 HT40: disable_vht = 1 HT20: disable_ht40 = 1 disable HT: disable_ht = 1 Signed-off-by: Peter Oh --- wpa_supplicant/wpa_supplicant.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index feeafc620..1132df269 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2191,9 +2191,14 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, if (pri_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR)) return; + freq->channel = pri_chan->chan; + #ifdef CONFIG_HT_OVERRIDES - if (ssid->disable_ht40) - return; + if (ssid->disable_ht40) { + if (ssid->disable_vht) + return; + goto skip_ht40; + } #endif /* CONFIG_HT_OVERRIDES */ /* Check/setup HT40+/HT40- */ @@ -2218,8 +2223,6 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR)) return; - freq->channel = pri_chan->chan; - if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) return; @@ -2263,6 +2266,9 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, wpa_scan_results_free(scan_res); } +#ifdef CONFIG_HT_OVERRIDES +skip_ht40: +#endif /* CONFIG_HT_OVERRIDES */ wpa_printf(MSG_DEBUG, "IBSS/mesh: setup freq channel %d, sec_channel_offset %d", freq->channel, freq->sec_channel_offset); @@ -2355,6 +2361,10 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, } else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_USE_HT) { chwidth = VHT_CHANWIDTH_USE_HT; seg0 = vht80[j] + 2; +#ifdef CONFIG_HT_OVERRIDES + if (ssid->disable_ht40) + seg0 = 0; +#endif /* CONFIG_HT_OVERRIDES */ } if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq,