#
37e54466 |
| 09-Nov-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
net80211: clean up / add more macros to check the frame types
* Add new macros to check the version+type and version+type+subtype of a frame. * Use these for existing frame checks. * Convert the fla
net80211: clean up / add more macros to check the frame types
* Add new macros to check the version+type and version+type+subtype of a frame. * Use these for existing frame checks. * Convert the flag checks in net80211 to use the macros, rather than direct header poking.
Notably I'm callign out things like QOS any versus QOS data, the kind of NULL frames, etc. Eg, in the TKIP code it's checking whether a frame is ANY kind of QOS frame, not just QOS data.
These macros should hopefully make the header checks clearer and less error prone. They're also useful in drivers that are doing their own header parsing.
Locally:
* ath(4), AP, STA, AP+STA modes * local ath10k/athp - AP, STA modes * rtwn - STA mode
Differential Revision: https://reviews.freebsd.org/D36615
show more ...
|
Revision tags: release/13.4.0, release/14.1.0, release/13.3.0 |
|
#
e85eb4c8 |
| 02-Dec-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: adjust more VHT structures/fields
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/le
net80211: adjust more VHT structures/fields
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 tough we cannot use it in the struct as we need to ensure the field width.
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 Reviewed by: adrian (earlier), cc Differential Revision: https://reviews.freebsd.org/D42901
show more ...
|
Revision tags: release/14.0.0 |
|
#
ef48d4fa |
| 27-Oct-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: rename iv_flags_vht to iv_vht_flags
While the flag field is internal start naming it as well as "iv_vht*" so we keep all "VHT" fields together. This breaks with what was done done for HT
net80211: rename iv_flags_vht to iv_vht_flags
While the flag field is internal start naming it as well as "iv_vht*" so we keep all "VHT" fields together. This breaks with what was done done for HT but with HE, EHT, .. coming one day seems the more logic choice.
No functional changes intended.
Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian, cc Differential Revision: https://reviews.freebsd.org/D42419
show more ...
|
#
1137943b |
| 02-Oct-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: remove ieee80211_unref_node()
ieee80211_unref_node() was only used in two error cases in ieee80211_send_nulldata(). There we do not need to guard against ni pointer reuse after decrementi
net80211: remove ieee80211_unref_node()
ieee80211_unref_node() was only used in two error cases in ieee80211_send_nulldata(). There we do not need to guard against ni pointer reuse after decrementing the refcount of the ni as we only update the stats and return.
Update the man page and remove the link for the now gone function.
Sponsored by: The FreeBSD Foundation X-MFC: never Reviewed by: adrian, emaste Differential Revision: https://reviews.freebsd.org/D42035
show more ...
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
Revision tags: release/13.2.0 |
|
#
3d0d5b21 |
| 23-Jan-2023 |
Justin Hibbits <jhibbits@FreeBSD.org> |
IfAPI: Explicitly include <net/if_private.h> in netstack
Summary: In preparation of making if_t completely opaque outside of the netstack, explicitly include the header. <net/if_var.h> will stop in
IfAPI: Explicitly include <net/if_private.h> in netstack
Summary: In preparation of making if_t completely opaque outside of the netstack, explicitly include the header. <net/if_var.h> will stop including the header in the future.
Sponsored by: Juniper Networks, Inc. Reviewed by: glebius, melifaro Differential Revision: https://reviews.freebsd.org/D38200
show more ...
|
Revision tags: release/12.4.0 |
|
#
f82316f6 |
| 26-Sep-2022 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: move IEEE80211_F_WME check to vap for consistency
The IEEE80211_F_WME checks done on the ic were changed to be per-vap back in the time when multi-bss was introduced or earlier in 2008. Th
net80211: move IEEE80211_F_WME check to vap for consistency
The IEEE80211_F_WME checks done on the ic were changed to be per-vap back in the time when multi-bss was introduced or earlier in 2008. This one was left out but given it is a (re-)accos-req case I see no reason not to use the vap value here for consistency too.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36733
show more ...
|
#
c9b7e9df |
| 01-Sep-2022 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA
Going through the Frame (Sub)types the "QOS Data" being called "QOS" scheme leads to a naming conflict for QOS_CFPOLL and QOS_CFACKPOLL (
net80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA
Going through the Frame (Sub)types the "QOS Data" being called "QOS" scheme leads to a naming conflict for QOS_CFPOLL and QOS_CFACKPOLL (if added). Rename QOS* to QOS_DATA* to avoid the conflict and to also better match the standards name.
No functional changes intended.
Sponsored by: The FreeBSD Foundation MFC after: 5 days Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36409
show more ...
|
#
8def06d5 |
| 01-Sep-2022 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: simplify an #ifdef INET/INET6 block
I got lost in the #ifdef #endif here so I changed the code to a switch block with two non-overlapping #ifdef parts and a default which makes it a lot ea
net80211: simplify an #ifdef INET/INET6 block
I got lost in the #ifdef #endif here so I changed the code to a switch block with two non-overlapping #ifdef parts and a default which makes it a lot easier to read.
No functional changes.
Sponsored by: The FreeBSD Foundation Reviewed by: (zlei.huang gmail.com) MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D36411
show more ...
|
#
bd29f817 |
| 17-Aug-2022 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: consistently use the IEEE80211_M_ memory related options
Replace a malloc() by IEEE80211_MALLOC(). For malloc flags even in the local ieee80211_freebsd.c there was a mix of both versions M
net80211: consistently use the IEEE80211_M_ memory related options
Replace a malloc() by IEEE80211_MALLOC(). For malloc flags even in the local ieee80211_freebsd.c there was a mix of both versions M_ and IEEE80211_M_. Consistently use the IEEE80211_M_ malloc options everywhere. If the field is changed for malloc, it'll also be changed for the other accessor functions taking a "how" field to avoid any confusion.
Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36249
show more ...
|
#
2889cbe2 |
| 12-Aug-2022 |
Adrian Chadd <adrian@FreeBSD.org> |
net80211: add an IEEE80211_IS_PROTECTED() macro
Summary: This returns whether the given 802.11 frame has the protected bit set.
Test Plan: * tested in AP/STA mode * STA mode - local athp/ath10k dri
net80211: add an IEEE80211_IS_PROTECTED() macro
Summary: This returns whether the given 802.11 frame has the protected bit set.
Test Plan: * tested in AP/STA mode * STA mode - local athp/ath10k driver * AP mode - in tree ath driver
Subscribers: imp, melifaro, glebius Reviewed by: bz Approved by: bz
Differential Revision: https://reviews.freebsd.org/D36183
show more ...
|
#
4f158a44 |
| 19-Jul-2022 |
Cy Schubert <cy@FreeBSD.org> |
net80211: Remove tautological state display
When printing the current state name and the old state numeric value, both are always the same. Remove the redundant ostate. It is always the same as iv_s
net80211: Remove tautological state display
When printing the current state name and the old state numeric value, both are always the same. Remove the redundant ostate. It is always the same as iv_state.
Reviewed by: bz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35849
show more ...
|
Revision tags: release/13.1.0 |
|
#
892b1874 |
| 13-Apr-2022 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: remove (optional) RSN from preobereq
802.11i-2004 did not specify that RSN can be added to the probereq, only to the proberesp (and others) yet it was added in what seems was b032f27c365b9
net80211: remove (optional) RSN from preobereq
802.11i-2004 did not specify that RSN can be added to the probereq, only to the proberesp (and others) yet it was added in what seems was b032f27c365b992e9d8e42214183b39acfb8c6ac (multi-BSS support). 802.11-2020 does not list the IE either for probereq so remove it.
Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Okayed by: adrian Differential Revision: https://reviews.freebsd.org/D34893
show more ...
|
#
2e59c9c7 |
| 26-Dec-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: adjust a printf to toeee80211_note
Throughout net80211 there are multiple ways to log (debugging) information. Start to clenaup one as I kept hitting it to harmonize the output. The more
net80211: adjust a printf to toeee80211_note
Throughout net80211 there are multiple ways to log (debugging) information. Start to clenaup one as I kept hitting it to harmonize the output. The more we get away from printfs into either wrapper functions or macros the more likely we can use holistic systematic tracing in the future.
Sponsored by: The FreeBSD Foundation MFC after: 3 days
show more ...
|
#
04efa18f |
| 26-Dec-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: add debugging information
Add more STATE / DEBUG probes and enhance the output of one in order to track state changes triggered by "ack" (or not). This helped to narrow down causes from dr
net80211: add debugging information
Add more STATE / DEBUG probes and enhance the output of one in order to track state changes triggered by "ack" (or not). This helped to narrow down causes from drivers or the LinuxKPI 802.11 compat framework which kept us in a scan -> auth -> scan loop.
Sponsored by: The FreeBSD Foundation MFC after: 3 days
show more ...
|
Revision tags: release/12.3.0 |
|
#
05ea7a3e |
| 24-Nov-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: fix -Wunused-but-set-variable warnings
Put the offending variables under the appropriate #ifdefs (mostly IEEE80211_DEBUG, in one case IEEE80211_SUPPORT_SUPERG, and in two cases under __not
net80211: fix -Wunused-but-set-variable warnings
Put the offending variables under the appropriate #ifdefs (mostly IEEE80211_DEBUG, in one case IEEE80211_SUPPORT_SUPERG, and in two cases under __notyet__ to revisit why these had been left there but not used).
Sponsored by: The FreeBSD Foundation MFC after: 10 days
show more ...
|
#
49c220b0 |
| 04-Sep-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: comments and whitespace
Add a missing '.', fix spelling of "failed" and unwrap a closing ); No functional changes.
Sponsored by: The FreeBSD Foundation MFC after: 3 days
|
#
243b9597 |
| 18-Jun-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: ieee80211_probereq_ie fix length calculation for hw scans
c338cf2c6d5eacdee813191d5976aa531d450ee7 split up ieee80211_probereq_ie(). For HW scans we usually do not want to add a SSID to th
net80211: ieee80211_probereq_ie fix length calculation for hw scans
c338cf2c6d5eacdee813191d5976aa531d450ee7 split up ieee80211_probereq_ie(). For HW scans we usually do not want to add a SSID to the IEs. During that split we allocate memory based on the length which will always include the length of the SSID and only later we reduced the length but never updated the value passed back to the caller. Split the SSID handling up and reduce the length before malloc(). This not only makes us not over-allocate in these situatoins but also fixes the length returned to the caller and with that usually directly passed to firmware.
Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D30813
show more ...
|
Revision tags: release/13.0.0 |
|
#
c338cf2c |
| 06-Mar-2021 |
Bjoern A. Zeeb <bz@FreeBSD.ORG> |
net80211: split up ieee80211_probereq()
Factor out ieee80211_probereq_ie() and ieee80211_probereq_ie_len() and make the length dynamic rather than static max. The latter is needed as our current fi
net80211: split up ieee80211_probereq()
Factor out ieee80211_probereq_ie() and ieee80211_probereq_ie_len() and make the length dynamic rather than static max. The latter is needed as our current fixed length was longer than some "hw scan", e.g. that of ath10k, will take. This way we can pass what we have. Should this not be sufficient in the future we might have to deal with filtering and much more error handling.
This also removes a duplicate calculation for ieee80211_ie_wpa [1].
Repoprted-by: Martin Husemann <martin NetBSD.org> [1] Sponsored-by: Rubicon Communications, LLC ("Netgate") Sponsored-by: The FreeBSD Foundation (update for alloc) Reviewed-by: adrian, martin NetBSD.org (earlier version) Reviewed-by: philip MFC-after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26545
show more ...
|
Revision tags: release/12.2.0 |
|
#
fe5ebb23 |
| 24-Sep-2020 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
Provide MS() and SM() macros for 80211 and wireless drivers.
We have (two versions) of MS() and SM() macros which we use throughout the wireless code. Change all but three places (ath_hal, rtwn, an
Provide MS() and SM() macros for 80211 and wireless drivers.
We have (two versions) of MS() and SM() macros which we use throughout the wireless code. Change all but three places (ath_hal, rtwn, and rsu) to the newly provided _IEEE80211_MASKSHIFT() and _IEEE80211_SHIFTMASK() macros. Also change one internal case using both _S and _M instead of just _S away from _M (one of the reasons rtwn and rsu were not changed).
This was done semi-mechanically. No functional changes intended.
Requested by: gnn (D26091) Reviewed by: adrian (pre line wrap) MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26539
show more ...
|
#
662c1305 |
| 01-Sep-2020 |
Mateusz Guzik <mjg@FreeBSD.org> |
net: clean up empty lines in .c and .h files
|
#
f1481c8d |
| 01-Jul-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[net80211] Migrate HT/legacy protection mode and preamble calculation to per-VAP flags
The later firmware devices (including iwn!) support multiple configuration contexts for a lot of things, leavin
[net80211] Migrate HT/legacy protection mode and preamble calculation to per-VAP flags
The later firmware devices (including iwn!) support multiple configuration contexts for a lot of things, leaving it up to the firmware to decide which channel and vap is active. This allows for things like off-channel p2p sta/ap operation and other weird things.
However, net80211 is still focused on a "net80211 drives all" when it comes to driving the NIC, and as part of this history a lot of these options are global and not per-VAP. This is fine when net80211 drives things and all VAPs share a single channel - these parameters importantly really reflect the state of the channel! - but it will increasingly be not fine when we start supporting more weird configurations and more recent NICs. Yeah, recent like iwn/iwm.
Anyway - so, migrate all of the HT protection, legacy protection and preamble stuff to be per-VAP. The global flags are still there; they're now calculated in a deferred taskqueue that mirrors the old behaviour. Firmware based drivers which have per-VAP configuration of these parameters can now just listen to the per-VAP options.
What do I mean by per-channel? Well, the above configuration parameters really are about interoperation with other devices on the same channel. Eg, HT protection mode will flip to legacy/mixed if it hears ANY BSS that supports non-HT stations or indicates it has non-HT stations associated. So, these flags really should be per-channel rather than per-VAP, and then for things like "do i need short preamble or long preamble?" turn into a "do I need it for this current operating channel". Then any VAP using it can query the channel that it's on, reflecting the real required state.
This patch does none of the above paragraph just yet.
I'm also cheating a bit - I'm currently not using separate taskqueues for the beacon updates and the per-VAP configuration updates. I can always further split it later if I need to but I didn't think it was SUPER important here.
So:
* Create vap taskqueue entries for ERP/protection, HT protection and short/long preamble; * Migrate the HT station count, short/long slot station count, etc - into per-VAP variables rather than global; * Fix a bug with my WME work from a while ago which made it per-VAP - do the WME beacon update /after/ the WME update taskqueue runs, not before; * Any time the HT protmode configuration changes or the ERP protection mode config changes - schedule the task, which will call the driver without the net80211 lock held and all correctly serialised; * Use the global flags for beacon IEs and VAP flags for probe responses and other IE situations.
The primary consumer of this is ath10k. iwn could use it when sending RXON, but we don't support IBSS or AP modes on it yet, and I'm not yet sure whether it's required in STA mode (ie whether the firmware parses beacons to change protection mode or whether we need to.)
Tested:
* AR9280, STA/AP * AR9380, DWDS STA+STA/AP * ath10k work, STA/AP * Intel 6235, STA * Various rtwn / run NICs, DWDS STA and STA configurations
show more ...
|
#
8379e8db |
| 16-Jun-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[net80211] Add initial U-APSD negotiation support.
U-APSD (unscheduled automatic power save delivery) is a power save method that's a bit better than legacy PS-POLL - stations can mark frames with a
[net80211] Add initial U-APSD negotiation support.
U-APSD (unscheduled automatic power save delivery) is a power save method that's a bit better than legacy PS-POLL - stations can mark frames with an extra flag that tells the AP to leak out more frames after it sends its own frames rather than needing to send a PS-POLL to get another frame from the AP.
Now, this code just handles the negotiation bits; it doesn't actually implement U-APSD. That's up to drivers, and nothing in the tree yet implements this. I /may/ implement this for ath(4) if I eventually care enough but right now I plan on just implementing it for firmware offload based NICs that handle this in the NIC.
I'll commit the ifconfig bit after this and I may have some follow-up commits as this gets used more by me in local testing.
This should be a glorious no-op for everyone else. If things change for anyone that isn't fixed by a complete recompile then please reach out to me.
show more ...
|
Revision tags: release/11.4.0 |
|
#
b3d0e274 |
| 07-Jun-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[net80211] Flip on A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options.
This updates the logic to allow:
* A-MPDU if available; * A-MSDU if available and A-MPDU is off/NACKed; * A-MPDU+A-MSDU if
[net80211] Flip on A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options.
This updates the logic to allow:
* A-MPDU if available; * A-MSDU if available and A-MPDU is off/NACKed; * A-MPDU+A-MSDU if it's available and negotiated; * Fast frames if the node is 11abg (and not HT/VHT.)
This allows for things to fail back to A-MSDU or fast frames if A-MPDU isn't available rather than needing to be non-HT/non-VHT. It also allows A-MPDU+A-MSDU to work if it's negotiated.
Tested:
* AR9380, STA + AP mode (A-MPDU, A-MSDU, FF, A-MPDU+A-MSDU) * RT5350, STA mode (A-MSDU, FF) * AR9170, STA mode (A-MSDU, FF)
show more ...
|