diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b4dfefd482a6..9115dc9c7d78 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -163,6 +163,9 @@ ieee80211_determine_chantype(struct
ieee80211_sub_if_data *sdata,
chandef->width = NL80211_CHAN_WIDTH_20_NOHT;
chandef->center_freq1 = channel->center_freq;
+ if (channel->band == NL80211_BAND_6GHZ)
+ goto skip_ht_vht_oper;
+
if (!ht_oper || !sta_ht_cap.ht_supported) {
ret = IEEE80211_STA_DISABLE_HT |
IEEE80211_STA_DISABLE_VHT |
@@ -263,6 +266,15 @@ ieee80211_determine_chantype(struct
ieee80211_sub_if_data *sdata,
*chandef = vht_chandef;
+skip_ht_vht_oper:
+ if (!ieee80211_chandef_he_oper(sdata, he_oper, chandef)) {
+ if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
+ sdata_info(sdata,
+ "AP HE information is invalid, disable HE\n");
+ ret = IEEE80211_STA_DISABLE_HE;
+ goto out;
+ }
+
Hi Rajkumar,
Above is causing to disable HE in STA mode even when AP supports HE.
Shouldn't this be done only for 6GHz band?
something like below?
if (channel->band == NL80211_BAND_6GHZ &&
!ieee80211_chandef_he_oper(sdata, he_oper, chandef))
ret = 0;
out:
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 90b8c42b1aa8..660cf52913f1 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -3170,6 +3170,98 @@ bool ieee80211_chandef_vht_oper(struct
ieee80211_hw *hw,
return true;
}
+bool ieee80211_chandef_he_oper(struct ieee80211_sub_if_data *sdata,
+ const struct ieee80211_he_operation *heop,
+ struct cfg80211_chan_def *chandef)
+{
+ struct ieee80211_he_oper_6ghz_op_info info;
+ const struct ieee80211_sta_he_cap *he_cap;
+ struct ieee80211_supported_band *sband;
+ struct cfg80211_chan_def new = *chandef;
+ int cf0, cf1;
+ int ccf0, ccf1;
+ bool support_80_80;
+ bool support_160;
+ u8 he_phy_cap;
+ u8 pos = 0;
+
+ if (!heop)
+ return false;
+
+ sband = ieee80211_get_sband(sdata);
+ if (!sband)
+ return false;
+
+ he_cap = ieee80211_get_he_iftype_cap(sband, sdata->vif.type);
+ if (!he_cap)
+ return false;
+
or return true here if band is not NL80211_BAND_6GHZ?
+ if (!(le32_to_cpu(heop->he_oper_params) &
+ IEEE80211_HE_OPERATION_6GHZ_OP_INFO))
+ return false;
+