On Sun, 13 Apr 2025 at 12:17, Farhan Khan <farhan@farhan.codes> wrote:
> Hi all, > > I am doing some research on how channels work on net80211 with a focus on > how OpenBSD (and NetBSD/Illumos) differ from FreeBSD's stack. Keeping the > question simple, I'm having trouble understanding how channel members in > the ieee80211com structure map to each other: > > FreeBSD has: > * ieee80211com -> ic_curchan > * ieee80211com -> ic_bsschan > > OpenBSD has: > * ieee80211com -> ic_ibss_chan > > Three Questions: > > 1) Is FreeBSD's ic_bsschan the same as OpenBSD's ic_ibss_chan? > I don't know what ic_ibsschan is. ic_bsschan can be viewed as "this is channel I'd like the BSS to operate on." it can be _ANYC. > > * Is there an equivalent in OpenBSD to FreeBSD's ic_curchan? Or is the > "current state" tracked different in OpenBSD? (ie, optional, in the softc). I've no idea. FreeBSD's ic_curchan is the current channel for the NIC when it's a software driven NIC. I added support a few years ago to start supporting the idea of a different channel per VAP, since some firmware NICs let you set different channels per VAP and the firmware time slices. For now, just use ic_curchan for "the current channel we're operating on". > > 2) What level of maintenance of ic_curchan does the driver do? Is it upon a > channel change? Or do we let net80211 handle that? OpenBSD's code seems to > do this idiom a lot, which I understand as updating the current state > (could be wrong): > c = ic->ic_bss->ni_chan = ic->ic_ibss_chan; > > In FreeBSD - the driver shouldn't ever be updating ic_curchan. net80211 takes care of updating ic_curchan, ic_bsschan, vap->iv_des_chan (the VAP version of ic_bsschan), it makes decisions about what channel(s) to choose during scanning, monitor mode, association, operation, etc. It takes care of updating vap->iv_bss node, and the ni->ni_chan (channel config for the given node.) Drivers never set the channel config themselves, they only consume them. > 3) Were any channel members or mechanisms migrated to the VAP layer? If > so, which? I'm migrating increasing numbers of them from global to per VAP, because as I said, plenty of firmware NICs now support different configs and channels per VAP and the firmware sorts it out. Eg, the slot time config, the WME/QoS config are both now per-VAP, but there's a global set maintained of the intersection of them all, for NICs that don't have firmware APIs taking care of them for you. I think you'll need to look in ieee80211.c and ieee80211_node.c for some more of them, I don't remember off hand and I'm not on a FreeBSD device right now to look them up. > > (I apologize for a semi-OpenBSD question, but I figured it was close enough > on topic) > > It's ok, I'm sorry I missed this! -adrian > Thank you, > -- > Farhan Khan > PGP Fingerprint: 1312 89CE 663E 1EB2 179C 1C83 C41D 2281 F8DA C0DE > > >