From 7f52919a2f2894125b4dca611eb2d30181af7e0b Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 20 Apr 2018 07:41:03 +0200 Subject: hostapd: fix encrypted mesh channel settings Import two patches from Peter Oh to allow setting channel bandwidth in the way it already works for managed interfaces. This fixes mesh interfaces on 802.11ac devices always coming up in VHT80 mode. Add a patch to allow HT40 also on 2.4GHz if noscan option is set, which also skips secondary channel scan just like noscan works in AP mode. Signed-off-by: Daniel Golle --- ...mplement-use-of-VHT20-config-in-mesh-mode.patch | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch (limited to 'package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch') diff --git a/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch new file mode 100644 index 0000000000..3bd6eaf340 --- /dev/null +++ b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch @@ -0,0 +1,87 @@ +From 24fc73b2470ff79cd8c92e029ca785c8e95a204c Mon Sep 17 00:00:00 2001 +From: Peter Oh +Date: Wed, 18 Apr 2018 14:14:19 -0700 +Subject: [PATCH 2/2] mesh: implement use of VHT20 config in mesh mode + +mesh in VHT mode is supposed to be able to use any bandwidth +that 11ac supports, but we don't have a way to set VHT20 +although there are parameters that are supposed to be used. +This patch along with the patch of +"mesh: add VHT_CHANWIDTH_USE_HT to max_oper_chwidth" makes mesh +available to use of any bandwidth using combination of +existing parameters like below shown. + +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, 13 insertions(+), 5 deletions(-) + +diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c +index ca893f942..8429cfd43 100644 +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -2132,9 +2132,15 @@ 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; ++ else ++ goto skip_ht40; ++ } + #endif /* CONFIG_HT_OVERRIDES */ + + /* Check/setup HT40+/HT40- */ +@@ -2159,8 +2165,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; +@@ -2204,6 +2208,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s, + wpa_scan_results_free(scan_res); + } + ++skip_ht40: + wpa_printf(MSG_DEBUG, + "IBSS/mesh: setup freq channel %d, sec_channel_offset %d", + freq->channel, freq->sec_channel_offset); +@@ -2295,7 +2300,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; ++ if (ssid->disable_ht40) ++ seg0 = 0; ++ else ++ seg0 = vht80[j] + 2; + } + + if (hostapd_set_freq_params(&vht_freq, mode->mode, freq->freq, +-- +2.17.0 + -- cgit v1.2.3