]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Use EHT params for punct_update_legacy_bw()
authorAloka Dixit <quic_alokad@quicinc.com>
Thu, 6 Mar 2025 21:09:49 +0000 (13:09 -0800)
committerJouni Malinen <j@w1.fi>
Tue, 25 Mar 2025 21:03:29 +0000 (23:03 +0200)
Puncturing is supported from EHT onwards hence legacy bandwidths need to
be downgraded in case of a non-zero puncturing bitmap.
hostapd_eid_vht_operation() passes VHT bandwidth, seg0, and seg1 while
calling punct_update_legacy_bw() but puncturing bitmap is from EHT. This
may result in incorrect calculations.

Issue is more obvious in case of 320 MHz where starting VHT bandwidth
can be 160 MHz as 320 MHz is not supported. Value for EHT 'bitmap' can
have 16 valid bits but punct_update_legacy_bw() considers only lower 8
bits as VHT 'width' is passed which is is 160 MHz. It may still work if
the primary channel is in the lower 160 MHz because then VHT bandwidth
spans only lower 8 bits of the bitmap. But if the primary channel is in
higher 160 MHz, and if the bitmap has any of the higher 8 bits set to 1,
expectation is VHT bandwidth should be downgraded even further to 80
MHz. But punct_update_legacy_bw() returns without taking any action as
the higher 8 bits of the bitmap get completely ignored.

Use all EHT parameters instead of VHT to calculate legacy bandwidths.

Signed-off-by: Aloka Dixit <quic_alokad@quicinc.com>
src/ap/ieee802_11_vht.c

index 4dc325ce89bb731e92f9102201dfc8601e564841..df5f8cf765c1947caa14d29b1dc7469bfefae633 100644 (file)
@@ -95,6 +95,9 @@ u8 * hostapd_eid_vht_operation(struct hostapd_data *hapd, u8 *eid)
 
 #ifdef CONFIG_IEEE80211BE
        if (punct_bitmap) {
+               oper_chwidth = hostapd_get_oper_chwidth(hapd->iconf);
+               seg0 = hostapd_get_oper_centr_freq_seg0_idx(hapd->iconf);
+               seg1 = hostapd_get_oper_centr_freq_seg1_idx(hapd->iconf);
                punct_update_legacy_bw(punct_bitmap,
                                       hapd->iconf->channel,
                                       &oper_chwidth, &seg0, &seg1);