Re: [PATCH wireless-next v2 09/11] wifi: brcm80211: move the rate helpers of brcmsmac to brcmutil

From: Arend van Spriel

Date: Thu Dec 03 2026 - 04:15:58 EST


On Fri, 27 Nov 2026 14:11:39 +0800, Ragul Balaji <ragulbaby@xxxxxxxxx> wrote:
> Move rate.c to brcmutil in preparation for the new driver.
>
> PHYTYPE_IS() depends on the PHY configuration of brcmsmac, so
> brcmu_rateset_default() compares the PHY types directly, which is the
> same for the N and LCN PHYs that brcmsmac attaches. brcmu_ofdm_rates
> is only used in rate.c and becomes static.
>
> Signed-off-by: Ragul Balaji <ragulbaby@xxxxxxxxx>
> Signed-off-by: Ho Jie Feng <hjf3108@xxxxxxxxx>
> ---
> .../broadcom/brcm80211/brcmsmac/Makefile | 1 -
> .../broadcom/brcm80211/brcmsmac/ampdu.c | 2 +-
> .../broadcom/brcm80211/brcmsmac/main.c | 2 +-
> .../broadcom/brcm80211/brcmsmac/pub.h | 25 +--
> .../broadcom/brcm80211/brcmsmac/stf.c | 2 +-
> .../broadcom/brcm80211/brcmutil/Makefile | 2 +-
> .../brcm80211/{brcmsmac => brcmutil}/rate.c | 142 +++++++++++-------
> .../{brcmsmac/rate.h => include/brcmu_rate.h} | 38 +++--
> 8 files changed, 118 insertions(+), 96 deletions(-)
> rename drivers/net/wireless/broadcom/brcm80211/{brcmsmac => brcmutil}/rate.c (85%)
> rename drivers/net/wireless/broadcom/brcm80211/{brcmsmac/rate.h => include/brcmu_rate.h} (89%)

Besides the move this patch converts CEIL() to DIV_ROUND_UP(), changes
several conditions, makes symbols static and adds exports. Please do the
conversions in brcmsmac before the move so the move is easier to review,
or at least list all of them in the commit message.

The shared header also retains names such as struct brcms_c_rateset,
struct brcms_mcs_info and BRCMS_* rate macros. Please complete the
brcms-to-brcmu naming conversion for the shared API.

[...]

> @@ -7,4 +7,4 @@
> ccflags-y := -I $(src)/../include
>
> obj-$(CONFIG_BRCMUTIL) += brcmutil.o
> -brcmutil-objs = utils.o d11.o
> +brcmutil-objs = utils.o d11.o rate.o

brcmfmac also selects BRCMUTIL, so brcmfmac-only configurations now carry
rate.o and, after patch 10, band.o without using them. Please make these
objects conditional on a driver that needs the shared helpers.

Regards,
Arend