[RFC PATCH wireless-next 05/17] wifi: brcmsmac: round short-GI L-SIG lengths up to whole symbols

From: Ragul Balaji

Date: Mon Oct 26 2026 - 01:40:30 EST


The L-SIG length of a mixed-mode frame covers its HT part in 4 us
legacy symbols. For a short guard interval, the HT PHY's TXTIME counts
the data symbols at the guard-independent bits per symbol, then rounds
their 3.6 us each up to 4 us units.

brcms_c_calc_lsig_len() instead divides the bits by the short-GI rate,
which rounds the symbols down before scaling them and uses the rounded-
up rates of the MCS table, so it can count one symbol less than the
frame takes. Count the symbols at the long-GI rate and scale them.

Signed-off-by: Ragul Balaji <ragulbaby@xxxxxxxxx>
Signed-off-by: Ho Jie Feng <hjf3108@xxxxxxxxx>
---
drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
index 3a383b0d1..c9a5877c1 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
@@ -7119,9 +7119,8 @@ brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec,
* the payload duration calculation matches that
* of regular ofdm
*/
- /* 1000Ndbps = kbps * 4 */
- kNdps = mcs_2_rate(mcs, rspec_is40mhz(ratespec),
- rspec_issgi(ratespec)) * 4;
+ /* 1000Ndbps = kbps * 4, at the long-GI rate */
+ kNdps = mcs_2_rate(mcs, rspec_is40mhz(ratespec), false) * 4;

if (rspec_stc(ratespec) == 0)
nsyms =
@@ -7134,6 +7133,9 @@ brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec,
CEIL((APHY_SERVICE_NBITS + 8 * mac_len +
APHY_TAIL_NBITS) * 1000, 2 * kNdps);

+ /* short-GI symbols (3.6 us) in 4 us units, rounded up */
+ if (rspec_issgi(ratespec))
+ nsyms = CEIL(nsyms * 9, 10);
/* (+3) account for HT-SIG(2) and HT-STF(1) */
nsyms += (tot_streams + 3);
/*
--
2.53.0