[LEDE-DEV] [PATCH] wpa_supplicant: fix forced HT20/HT40 selection in IBSS and MESH mode
Koen Vandeputte
koen.vandeputte at ncentric.com
Wed Jul 27 00:43:23 PDT 2016
Signed-off-by: Masashi Honma <masashi.honma at gmail.com>
Tested-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
wpa_supplicant/wpa_supplicant.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1955,20 +1955,27 @@ void ibss_mesh_setup_freq(struct wpa_sup
break;
}
}
+#ifdef CONFIG_HT_OVERRIDES
+ if (ssid->disable_ht40)
+ ht40 = 0;
+#endif /* CONFIG_HT_OVERRIDES */
- /* Find secondary channel */
- for (i = 0; i < mode->num_channels; i++) {
- sec_chan = &mode->channels[i];
- if (sec_chan->chan == channel + ht40 * 4)
- break;
- sec_chan = NULL;
- }
- if (!sec_chan)
- return;
+ if (ht40) {
+ /* Find secondary channel */
+ for (i = 0; i < mode->num_channels; i++) {
+ sec_chan = &mode->channels[i];
+ if (sec_chan->chan == channel + ht40 * 4)
+ break;
+ sec_chan = NULL;
+ }
+ if (!sec_chan)
+ return;
- /* Check secondary channel flags */
- if (sec_chan->flag & (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
- return;
+ /* Check secondary channel flags */
+ if (sec_chan->flag &
+ (HOSTAPD_CHAN_DISABLED | HOSTAPD_CHAN_NO_IR))
+ return;
+ }
freq->channel = pri_chan->chan;
@@ -1984,6 +1991,7 @@ void ibss_mesh_setup_freq(struct wpa_sup
freq->sec_channel_offset = 1;
break;
default:
+ freq->sec_channel_offset = 0;
break;
}
More information about the Lede-dev
mailing list