Page MenuHomeFreeBSD

net80211: adjust more VHT structures/fields
ClosedPublic

Authored by bz on Dec 4 2023, 8:21 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 14, 5:54 PM
Unknown Object (File)
Jan 28 2024, 10:21 AM
Unknown Object (File)
Jan 28 2024, 10:20 AM
Unknown Object (File)
Jan 28 2024, 10:20 AM
Unknown Object (File)
Jan 28 2024, 10:20 AM
Unknown Object (File)
Jan 27 2024, 9:16 AM
Unknown Object (File)
Jan 18 2024, 1:23 PM
Unknown Object (File)
Jan 5 2024, 10:39 PM

Details

Summary

Replace ieee80211_ie_vhtcap with ieee80211_vht_cap and
ieee80211_ie_vht_operation with ieee80211_vht_operation.
The "ie" version has the two bytes type/length at the beginning which
we did not actually use as such (the one place doing did just as unused
extra work).

Using the non-"ie" versions allows us to re-use them on shared code.
Using an enum helps us to not accidentally get unsuppored or unhandled
values.

ieee80211_vht_operation is guarded by _KERNEL/WANT_NET80211. While the
header is supposed to be exported to user land historically, software
such as wpa bring their own structure definitions. For in-tree usage
it is only ifconfig which really cares (at least for now).

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bz requested review of this revision.Dec 4 2023, 8:21 PM
adrian added a subscriber: adrian.

sorry! looks good, I was sick the last couple weeks and missed that. :(

This revision is now accepted and ready to land.Dec 14 2023, 12:28 AM

Sorry, not sure how this is missing in my radar. Please allow one day or two to finish my review.

cc requested changes to this revision.Dec 15 2023, 8:49 PM
cc added inline comments.
sbin/ifconfig/ifieee80211.c
2784

Because "struct ieee80211_ie_vhtcap" is removed, can we add a comment that explains why this "+2" offset is used?

2816

Same here. Because "struct ieee80211_ie_vht_operation" is removed, can we add a comment that explains why this "+2" offset is used?

sys/net80211/ieee80211.h
885

Why not use the matching enum data type for this "chan_width" variable? Like this illustration:

typedef enum ieee80211_vht_chanwidth {...} ieee80211_vht_chanwidth;

struct ieee80211_vht_operation {
	ieee80211_vht_chanwidth			chan_width;
...
}
This revision now requires changes to proceed.Dec 15 2023, 8:49 PM
bz marked 2 inline comments as done.Dec 19 2023, 12:13 AM
bz added inline comments.
sbin/ifconfig/ifieee80211.c
2784

You find ie+2, 2+X, x[2], .. in other places; e.g., printssid(), printies(), ... for data and/or length.
I think it is generally understood that an ie (information element) is a TLV and we skip the TL (elemid, length) in those cases.

What we probably should do is make sure that ie[1] is the proper length.
Something the already existing vht prints do not seem to have (no one passes in size_t ielen = 2 + ie[1] as was done for others; not that we need that length as ie[1] is avail).

I'll add the assertion which then can probably make this more explanatory or can get a comment.

sys/net80211/ieee80211.h
885

Because we need something 8bit wide. While enums are integers their size if compiler dependent. Doesn't work.

bz marked an inline comment as done.

Check length in ifoccnfig for the Element information and print error/return
if not matching. With that initialize variables later and add the requested
comment from cc@ to explain the +2.

Looks good to me now. Thanks for the update.

This revision is now accepted and ready to land.Dec 19 2023, 8:07 PM
This revision was automatically updated to reflect the committed changes.