2023-06-27 08:41:09

by Dmitry Antipov

[permalink] [raw]
Subject: On CORDIC arithmetic in b43

To everyone still interested in b43 driver:

In 'lpphy_start_tx_tone()', how 'CORDIC_FLOAT((sample.i * max) & 0xFF)' may
be non-zero? Basically it is (<32-bit> & 0xff) shifted right by 15 bits.

Dmitry


2023-06-27 09:51:04

by Jonas Gorski

[permalink] [raw]
Subject: Re: On CORDIC arithmetic in b43

On Tue, 27 Jun 2023 at 10:40, Dmitry Antipov <[email protected]> wrote:
>
> To everyone still interested in b43 driver:
>
> In 'lpphy_start_tx_tone()', how 'CORDIC_FLOAT((sample.i * max) & 0xFF)' may
> be non-zero? Basically it is (<32-bit> & 0xff) shifted right by 15 bits.

Looking at other users like e.g.
https://elixir.bootlin.com/linux/latest/source/drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c#L3377
the the result should be masked, and not the argument to
CORDIC_FLOAT().

So that very much looks like a bug and likely should be
'CORDIC_FLOAT(sample.i * max) & 0xFF' or so. Good catch!

Can you send a patch?

Best regards,
Jonas