Skip to content

wifi: brcmsmac: embed fixed-size allocations in brcms_c_info

Rosen Penev brcm80211 linux-wireless lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7wifi: brcmsmac: embed bandstate arrays instead of separate allocationdrivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c +2 more+44 -760 replies
2/7wifi: brcmsmac: embed modulecb array instead of separate allocationdrivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h+1 -90 replies
3/7wifi: brcmsmac: embed macstat_snapshot in brcms_coredrivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h+4 -130 replies
4/7wifi: brcmsmac: embed default_bss in brcms_c_infodrivers/net/wireless/broadcom/brcm80211/brcmsmac/ampdu.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h+16 -230 replies
5/7wifi: brcmsmac: embed brcms_protection in brcms_c_infodrivers/net/wireless/broadcom/brcm80211/brcmsmac/channel.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h+16 -230 replies
6/7wifi: brcmsmac: embed brcms_core in brcms_c_infodrivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h+2 -90 replies
7/7wifi: brcmsmac: embed brcms_bss_cfg in brcms_c_infodrivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.h+55 -610 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH wireless-next 0/7] wifi: brcmsmac: embed fixed-size allocations in brcms_c_info

brcms_c_attach_malloc() allocates struct brcms_c_info and then a number of fixed-size structures that live exactly as long as it does, each with its own kzalloc(GFP_ATOMIC), error code and kfree(). This series embeds seven of them in their parent structures. That removes the allocations and their OOM error paths and, for the per-band state, the open-coded pointer arithmetic that carved two arrays out of one allocation.

Patch 1 embeds the per-band state arrays of brcms_c_info and brcms_hardware. Patches 2-7 embed the module callback array, the MAC statistics snapshot, the default BSS info, the protection settings, the core state and the BSS configuration. Patch 7 moves the definition of struct brcms_bss_cfg, unchanged, above struct brcms_c_info.

There is no functional change. The pub, hw and stf allocations are left
alone: embedding them would touch most of the driver for little gain.

Each patch builds with W=1 (arm64, clang) and passes checkpatch. Compile-tested only.

An AI coding assistant (Claude Code, Claude Opus 5.5) was used to review the series, resolve rebase conflicts, write patches 5-7, and draft the commit messages and this cover letter.

Rosen Penev (7):
wifi: brcmsmac: embed bandstate arrays instead of separate allocation
wifi: brcmsmac: embed modulecb array instead of separate allocation
wifi: brcmsmac: embed macstat_snapshot in brcms_core
wifi: brcmsmac: embed default_bss in brcms_c_info
wifi: brcmsmac: embed brcms_protection in brcms_c_info
wifi: brcmsmac: embed brcms_core in brcms_c_info
wifi: brcmsmac: embed brcms_bss_cfg in brcms_c_info

 .../broadcom/brcm80211/brcmsmac/ampdu.c       |   2 +-
 .../broadcom/brcm80211/brcmsmac/channel.c     |  14 +-
 .../broadcom/brcm80211/brcmsmac/debug.c       |   2 +-
 .../broadcom/brcm80211/brcmsmac/mac80211_if.c |   4 +-
 .../broadcom/brcm80211/brcmsmac/main.c        | 226 ++++++------------
 .../broadcom/brcm80211/brcmsmac/main.h        |  82 +++----
 .../broadcom/brcm80211/brcmsmac/stf.c         |  22 +-
 7 files changed, 138 insertions(+), 214 deletions(-)

base-commit: 793807ca13bf3072fc6d16ce6d90e9ab9beff2a5

Signature · 1 line
2.56.0