[PATCH] mesh: HE: Don't enable HE on 5GHz without VHT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sven Eckelmann <seckelmann@xxxxxxxxx>

The commit ad9a1bfe788e ("nl80211: Share VHT channel configuration for HE")
always enforced that VHT is enabled when HE was enabled. This broke the
mesh functionality on 2.4GHz with HE because ibss_mesh_setup_freq() isn't
setting up the VHT parameters for 2.4GHz.

This problem was resolved for 2.4GHz by commit df4f959988b6 ("nl80211:
Don't force VHT channel definition with HE"). But it is still possible to
disable VHT during the mesh/IBSS freq setup on 5GHz - which would result in
the same problem as seen on 2.4GHz.

The code enabling HE for IBSS/mesh must now make sure that it doesn't
enable HE when VHT could be enforced by the nl80211 driver code but
disabled by the user.

Fixes: 3459c54ac78b ("mesh: Add support for HE mode")
Signed-off-by: Sven Eckelmann <seckelmann@xxxxxxxxx>
---
This is a compromise between the original patch [1] (which removed the
enforcing of VHT when HE is enabled) and the orginal implementation (which
enforced VHT when HE is enabled).

This fixes following test cases:

* mesh_secure_ocv_mix_legacy
* wpas_mesh_open_ht40
* mesh_secure_ocv_mix_ht

When the mac8011_hwsim HE patch [2] is applied on the kernel.

[1] https://patchwork.ozlabs.org/patch/1125305/
[2] https://patchwork.kernel.org/patch/11091267/
---
 wpa_supplicant/wpa_supplicant.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 21ef6fad1..8fcf6e535 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2155,6 +2155,7 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
 	struct hostapd_freq_params vht_freq;
 	int chwidth, seg0, seg1;
 	u32 vht_caps = 0;
+	int is_24ghz;
 
 	freq->freq = ssid->frequency;
 
@@ -2206,8 +2207,8 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
 	if (!mode)
 		return;
 
-	/* HE can work without HT + VHT */
-	freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported;
+	is_24ghz = hw_mode == HOSTAPD_MODE_IEEE80211G ||
+		   hw_mode == HOSTAPD_MODE_IEEE80211B;
 
 #ifdef CONFIG_HT_OVERRIDES
 	if (ssid->disable_ht) {
@@ -2220,6 +2221,10 @@ void ibss_mesh_setup_freq(struct wpa_supplicant *wpa_s,
 	if (!freq->ht_enabled)
 		return;
 
+	/* allow HE on 2.4GHz without VHT: see nl80211_put_freq_params() */
+	if (is_24ghz)
+		freq->he_enabled = mode->he_capab[ieee80211_mode].he_supported;
+
 	/* Setup higher BW only for 5 GHz */
 	if (mode->mode != HOSTAPD_MODE_IEEE80211A)
 		return;
@@ -2340,6 +2345,9 @@ skip_ht40:
 	if (!vht_freq.vht_enabled)
 		return;
 
+	/* enable HE for VHT */
+	vht_freq.he_enabled = mode->he_capab[ieee80211_mode].he_supported;
+
 	/* setup center_freq1, bandwidth */
 	for (j = 0; j < ARRAY_SIZE(vht80); j++) {
 		if (freq->channel >= vht80[j] &&
-- 
2.20.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux