brcmf_setup_ifmodes(9)
π brcmf_setup_ifmodes β a Kernel API Manual moment
okay so bestie, we're in the kernel API manual today and the star of the show is brcmf_setup_ifmodes(9). yes it's a mouthful, no you don't have to say it out loud at parties. it lives in the kernel docs, it's giving driver-internals realness, and honestly? it ate. let's get into it π
β¨ NAME β¨
brcmf_setup_ifmodes β figure out which interface modes you get, and which combos of them are allowed. that's the whole job. slay π«Ά
πΈ SYNOPSIS πΈ
int brcmf_setup_ifmodes (struct wiphy *wiphy , struct brcmf_if *ifp );
π¦ ARGUMENTS π¦
wiphyβ the wiphy object. yes, that one. the wireless phy dude.ifpβ the interface object, and it's needed specifically for the feat module api. don't forget it, bestie, it's kind of the whole point π
π DESCRIPTION π
so the interface modes AND their combinations get determined dynamically right here, based on what the firmware can actually do. no hardcoded little list, nope, it's a vibe check against the firmware's feature set. iconic behavior honestly β¨
here's how the combos shake out, depending on what the firmware's got going on:
π no p2p and no mbss
#STA <= 1, #AP <= 1, channels = 1, 2 total
that's it. that's the whole menu. one STA max, one AP max, one channel, two total. minimal. cozy. π
π₯ no p2p and mbss
#STA <= 1, #AP <= 1, channels = 1, 2 total #AP <= 4, matching BI, channels = 1, 4 total
okay so we've got the #STA <= 1, #AP <= 1, channels = 1, 2 total situation, and then #AP <= 4, matching BI, channels = 1, 4 total on top of that. matching BI, bestie. matching. BI. π€
π no p2p and rsdb
#STA <= 1, #AP <= 2, channels = 2, 4 total
one STA, up to two APs, two channels, four total. rsdb said "let me give you range" fr fr π
β p2p, no mchan, and mbss
#STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 1, 3 total
#STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total
#AP <= 4, matching BI, channels = 1, 4 total
three whole combos, and yes the third one is that matching BI legend again. we love consistency π
π§ p2p, mchan, and mbss
#STA <= 2, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 1, channels = 2, 3 total
#STA <= 1, #P2P-DEV <= 1, #AP <= 1, #P2P-CL <= 1, channels = 1, 4 total
#AP <= 4, matching BI, channels = 1, 4 total
mchan enters the chat and suddenly #STA <= 2 and channels = 2 are on the table. glow up π
πΈ p2p, rsdb, and no mbss
#STA <= 1, #P2P-DEV <= 1, #{P2P-CL, P2P-GO} <= 2, AP <= 2, channels = 2, 4 total
note that it's AP <= 2 here and not #AP β that's literally how it's written, so that's literally how we're writing it. no cap, character for character π«Ά
π RETURN π
0 on success, negative errno on failure. so like, if you get a negative back, something went sideways and it's telling you why in errno form. read it. it's trying to communicate π
π SEE ALSO π
- Kernel file:
./drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c brcmf_apsta_add_vif(9)brcmf_mon_add_vif(9)
heads up bestie: the source line at the bottom of the original got truncated mid-path (./drivers/net/wireless/broadco...), and the date on it is October 2026. that's the version/date stamp, not a typo on my end π
k that's the whole page!! go read cfg80211.c, it's right there, i believe in you. mwah π β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms