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

From: Arend van Spriel

Date: Thu Dec 03 2026 - 04:16:25 EST


On Fri, 27 Nov 2026 14:11:35 +0800, Ragul Balaji <ragulbaby@xxxxxxxxx> wrote:
> 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(-)

[...]

> @@ -7114,9 +7114,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 =
> @@ -7129,6 +7128,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);
> /*

Please make the commit message more clear with a numeric example, such as
MCS7, 20 MHz, short GI and a 1500-byte MPDU: 47 HT symbols require 43 L-SIG
units, while the old calculation can produce 42.

As this changes the L-SIG length placed in every HT short-GI mixed-mode TX
header and A-MPDU, it should not be part of the shared-code refactor.
Please send it as a standalone fix targeting wireless, with an appropriate
Fixes tag.

This change better be tested on brcmsmac hardware. Do you have any devices
to verify this. I can have a look what I have lying around here and give it
a spin. Capturing a sniff would be ideal, but my setup lacks it.

Regards,
Arend