[PATCH wireless] wifi: mac80211: use HT CCFS2 when computing the AP's HE and lower bandwidth

From: John Macias

Date: Mon Oct 26 2026 - 00:02:32 EST


If the driver advertises VHT extended NSS BW support, hostapd announces
a 160 MHz BSS the way IEEE 802.11-2020 allows for that case: the VHT
Operation element has channel width 1, CCFS0 is the 80 MHz segment and
CCFS1 is 0, and the 160 MHz centre is in the CCFS2 field of the HT
Operation element.

ieee80211_calc_ap_he_and_lower() only looks at the VHT CCFS1, so it
sets bss_bw.he_and_lower to 80 MHz and ieee80211_sta_usable_bw() then
limits every HE and VHT station to 80 MHz. Stations parse CCFS2 and use
160 MHz towards the AP, but the AP never transmits wider than 80 MHz.

Take CCFS2 from the HT Operation element when the VHT CCFS1 is 0, as
the station side already does in ieee80211_chandef_vht_oper().

Seen with ath11k on IPQ8074 (it advertises extended NSS BW when the
firmware reports an NSS ratio) with an HE160 BSS on channel 36: peers
were created as 11ax-he80 and no frames were sent at 160 MHz. With this
change the peers are 11ax-he160, nearly all downlink data goes out at
160 MHz and an MT7925 client's download went from 810 to 1645 Mb/s.

Fixes: c9b62ab79133 ("wifi: mac80211: fix per-station PHY capability bandwidth")
Cc: stable@xxxxxxxxxxxxxxx
Assisted-by: LLM
Signed-off-by: John Macias <dencity7@xxxxxxxxx>
---
net/mac80211/cfg.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index a1753335e..e6fd83cb7 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1366,6 +1366,13 @@ ieee80211_calc_ap_he_and_lower(struct cfg80211_beacon_data *params)
*/
ccfs0 = vht_oper->center_freq_seg0_idx;
ccfs1 = vht_oper->center_freq_seg1_idx;
+ /*
+ * With extended NSS BW support the second segment
+ * can be in the HT Operation CCFS2 field instead.
+ */
+ if (!ccfs1 && params->ht_oper)
+ ccfs1 = le16_get_bits(params->ht_oper->operation_mode,
+ IEEE80211_HT_OP_MODE_CCFS2_MASK);
if (!ccfs0)
return IEEE80211_STA_RX_BW_80;
if (ccfs1 && abs(ccfs1 - ccfs0) == 8)
--
2.47.3