2020-09-11 10:29:45

by Wen Gong

[permalink] [raw]
Subject: [PATCH] mac80211: do not set IEEE80211_STA_DISABLE_HE for NL80211_BAND_2GHZ

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 <[email protected]>
---
net/mac80211/mlme.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

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;
}
--
2.23.0