brcmf_setup_ifmodes(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 πŸ“


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