diff mbox series

mac80211: do not set IEEE80211_STA_DISABLE_HE for NL80211_BAND_2GHZ

Message ID 010101747cb617f2-593c5410-1648-4a42-97a0-f3646a5a6dd1-000000@us-west-2.amazonses.com (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series mac80211: do not set IEEE80211_STA_DISABLE_HE for NL80211_BAND_2GHZ | expand

Commit Message

Wen Gong Sept. 11, 2020, 10:29 a.m. UTC
VHT is not support for NL80211_BAND_2GHZ, but HE is support for it, so
it should not set IEEE80211_STA_DISABLE_HE for NL80211_BAND_2GHZ if it
does not support VHT.

When connec to AP with NL80211_BAND_2GHZ, it does not support VHT, then
it failed for HE and connected with HT mode. After this patch, it connected
with HE mode for NL80211_BAND_2GHZ with a HE mode 11AX AP.

Fixes: 57fa5e85d53ce51 ("mac80211: determine chandef from HE 6 GHz operation")

Signed-off-by: Wen Gong <wgong@codeaurora.org>
---
 net/mac80211/mlme.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b2a9d47cf86d..c85186799d05 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -4853,6 +4853,7 @@  static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_supported_band *sband;
 	struct cfg80211_chan_def chandef;
 	bool is_6ghz = cbss->channel->band == NL80211_BAND_6GHZ;
+	bool is_5ghz = cbss->channel->band == NL80211_BAND_5GHZ;
 	struct ieee80211_bss *bss = (void *)cbss->priv;
 	int ret;
 	u32 i;
@@ -4871,7 +4872,7 @@  static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
 		ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
 	}
 
-	if (!sband->vht_cap.vht_supported && !is_6ghz) {
+	if (!sband->vht_cap.vht_supported && is_5ghz) {
 		ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
 		ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
 	}