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

From: Jie Feng

Date: Sat Dec 05 2026 - 11:27:46 EST


On Thu, 3 Dec 2026 at 17:15, Arend van Spriel
<arend.vanspriel@xxxxxxxxxxxx> wrote:
>
> 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.
This was tested by me in a quite roundabout way, I managed to add
BCM43227 support to brcmsmac and tested the changes there. Some other
bugs were found, but only this one affects bcm4323x series adapters,
so was added in. I can send some of these in as a patch series.

About the BCM43227 port:
Most of it was adding register accesses here and there, and totalled
+422/-27, with about ~350 of them being lists of register access, the
rest being quite simple new logic being added. I can also send this in
as an RFC if anyone wishes to see it.

> Regards,
> Arend

Best regards,
Jie Feng