Page MenuHomeFreeBSD

net80211 / LinuxKPI 802.11: use enum ieee80211_sta_rx_bw for ni_chw
ClosedPublic

Authored by bz on Dec 3 2024, 10:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 10, 12:05 AM
Unknown Object (File)
Wed, Jan 8, 10:38 PM
Unknown Object (File)
Wed, Jan 8, 10:30 PM
Unknown Object (File)
Wed, Jan 8, 5:05 PM
Unknown Object (File)
Wed, Jan 8, 8:52 AM
Unknown Object (File)
Tue, Jan 7, 10:46 PM
Unknown Object (File)
Tue, Jan 7, 10:43 PM
Unknown Object (File)
Dec 8 2024, 8:59 PM

Details

Summary

net80211 node ni_chw currently encodes the channel width as Mhz number.
LinuxKPI 802.11 uses enum ieee80211_sta_rx_bw for the same.

Rather than keeping the "20" and "40" throughout the code (eventually
expanded to 80/160/320) switch them over to use the enum throughout
and add a print mask for debug output.
Once we get to 320Mhz channel widths we would otherwise also need to
extend the uint8_t in struct ieee80211_node; making
enum ieee80211_sta_rx_bw __packed allows us for three more channel
widths without breaking the KBI (if we were not to use %b with a
print_mask we could extend it for a long time).

Sponsored by: The FreeBSD Foundation
MFC after: 14 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 60938
Build 57822: arc lint + arc unit

Event Timeline

bz requested review of this revision.Dec 3 2024, 10:22 PM
This revision is now accepted and ready to land.Dec 3 2024, 10:32 PM

is the intent to use it as a bitmask (eg ni_chw would be a combination of all currently supported bandwidths) ? Or just "only one width is set at once" ?

is the intent to use it as a bitmask (eg ni_chw would be a combination of all currently supported bandwidths) ? Or just "only one width is set at once" ?

As indicated the only reason I made it a bitmask was to be able to use %b with the print mask. If I give up on that and we use a macron/inline function from mapping from flag to text it could be a plain enum.
I also considered making 20 = 20, 40 = 40 to keep compat with the current assignments but given it was only ath and mwl now I decided against it.