Page MenuHomeFreeBSD

net80211: enhance getflags*() and ieee80211_add_channel*()

Authored by bz on Aug 17 2020, 8:00 PM.



For ieee80211_add_channel+*() we are passing in an int flag for
ht40 and in some cases another int flag for vht80 where we'd only
need two bits really.
Convert these variables to a bitflag and fold them together into one.
This also allows for VHT160 and VHT80P80 and whatever may come to
be considered. Define the various options currently needed.

Change the drivers (rtwn and rsu) who actually set this bit to non-0.
For convenience the "1" currently used for HT40 is preserved.

Enahnce getflags_5ghz() to handle the full set of VHT flags based
on the input flags from the the driver.

Update the regdomain implementation as well to make use of the new
flags and deal with higher [V]HT bandwidths.

ieee80211_add_channel() specifically did not take flags so it will
not support naything beyond 20Mhz channels.

Note: I am not entirely happy with the "cbw_flag[s]" name, but we
do use chan_flags elsewhere already.

MFC After: 2 weeks
Reviewed by: ...
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")

Note2: I also have the athp change along with this and will put that
out the next days.
Note3: how does ath(4) do this as I could not figure it out unless
the ath_regdomain code populates it all by itself bypassing the
net80211 logic?

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

bz requested review of this revision.Aug 17 2020, 8:00 PM
1544 ↗(On Diff #75904)

Unrelated whitespace change to be removed before commit.

gnn requested changes to this revision.Aug 18 2020, 9:17 PM
gnn added inline comments.
154 ↗(On Diff #75904)

What is this and why is it defined mid code?

This revision now requires changes to proceed.Aug 18 2020, 9:17 PM

The MS-SM stuff being defined half way through the code is left over from sam-days.

It'd be nice to tidy it up by naming it something net80211-y and using that rather than MS/SM everywhere.

(ath also uses MS/SM, but it's a global thing; it comes from the ath hal)

154 ↗(On Diff #75904)

See @adrian 's reply above.
I'll be happy to follow his advise and renamed the macros and provide them in a general place (possibly even beyond net80211) after some research as a follow-up change if that's alright?

Any further comments? I'd love to commit this Monday morning UTC.

This revision is now accepted and ready to land.Aug 20 2020, 11:13 PM
158 ↗(On Diff #75904)

This needs to be 80P80 after the previous changes in the tree now.

158 ↗(On Diff #75904)

I guess I had just missed it when I manually converted them all from 80_80 to 80P80 in various trees. Fixed in the local tree.