From 0807cd0dbc4ee3c371f992019a877fc92ec8a949 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 7 Jul 2026 22:25:42 +0200 Subject: [PATCH] wifi: mac80211: allow advertising 20 MHz-only non-AP STA 802.11 Clause 27 (HE) already defined a 20 MHz-only non-AP HE STA in the 5 GHz band, where VHT is required, although VHT in Clause 21 requires 20, 40 and 80 MHz support. The VHT requirement is implemented in mac80211, but the later allowance for 20 MHz-only since HE wasn't. Allow a device to be a 20 MHz-only non-AP STA and require that it support VHT, but not that it has 80 MHz support, if it's HE as well. type=feature ticket=none Change-Id: I628aed79ec7f9bf2f8e770b4866ed98cf1ddbe60 Signed-off-by: Johannes Berg Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/307235 automatic-review: iil_jenkins iil_jenkins Tested-by: iil_jenkins iil_jenkins tested: iil_jenkins iil_jenkins Reviewed-by: Miriam Rachel Korenblit AI-Code-Review: Miriam Rachel Korenblit --- net/mac80211/mlme.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index f4388d441ce2..5177bddcde13 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -6573,7 +6573,7 @@ ieee80211_determine_our_sta_mode(struct ieee80211_sub_if_data *sdata, struct ieee80211_sta_ht_cap sta_ht_cap = sband->ht_cap; bool is_5ghz = sband->band == NL80211_BAND_5GHZ; bool is_6ghz = sband->band == NL80211_BAND_6GHZ; - const struct ieee80211_sta_he_cap *he_cap; + const struct ieee80211_sta_he_cap *he_cap = NULL; const struct ieee80211_sta_eht_cap *eht_cap; const struct ieee80211_sta_uhr_cap *uhr_cap; struct ieee80211_sta_vht_cap vht_cap; @@ -6637,7 +6637,15 @@ ieee80211_determine_our_sta_mode(struct ieee80211_sub_if_data *sdata, goto out; } - if (vht_cap.vht_supported && is_5ghz) { + if (req && req->flags & ASSOC_REQ_DISABLE_HE && !is_6ghz) + mlme_link_id_dbg(sdata, link_id, + "HE disabled by flag, limiting to HT/VHT\n"); + else + he_cap = ieee80211_get_he_iftype_cap_vif(sband, &sdata->vif); + + if (vht_cap.vht_supported && is_5ghz && he_cap) { + /* nothing - since HE we can be 20 MHz-only non-AP STA */ + } else if (vht_cap.vht_supported && is_5ghz) { bool have_80mhz = false; unsigned int i; @@ -6683,17 +6691,11 @@ ieee80211_determine_our_sta_mode(struct ieee80211_sub_if_data *sdata, "no VHT 160 MHz capability on 5 GHz, limiting to 80 MHz"); } - if (req && req->flags & ASSOC_REQ_DISABLE_HE) { - mlme_link_id_dbg(sdata, link_id, - "HE disabled by flag, limiting to HT/VHT\n"); - goto out; - } - - he_cap = ieee80211_get_he_iftype_cap_vif(sband, &sdata->vif); if (!he_cap) { WARN_ON(is_6ghz); - mlme_link_id_dbg(sdata, link_id, - "no HE support, limiting to HT/VHT\n"); + if (!req || !(req->flags & ASSOC_REQ_DISABLE_HE)) + mlme_link_id_dbg(sdata, link_id, + "no HE support, limiting to HT/VHT\n"); goto out; } -- 2.55.0