Revision tags: release/14.2.0-p2, release/14.1.0-p8, release/13.4.0-p4, release/14.1.0-p7, release/14.2.0-p1, release/13.4.0-p3 |
|
#
17e8437e |
| 17-Jan-2025 |
Adrian Chadd <adrian@FreeBSD.org> |
net80211: update get_sta_info() to only populate isi_txrate for legacy rates
The isi_txrate field is 8 bits and only represents legacy/HT rates. So to avoid logging a warning, only populate if it's
net80211: update get_sta_info() to only populate isi_txrate for legacy rates
The isi_txrate field is 8 bits and only represents legacy/HT rates. So to avoid logging a warning, only populate if it's a legacy/HT rate.
Differential Revision: https://reviews.freebsd.org/D48616
show more ...
|
#
38075f7d |
| 02-Jan-2025 |
Adrian Chadd <adrian@FreeBSD.org> |
net80211: remove direct use of ni->ni_txrate, add indirection methods
The summary:
* Refactor ni_txrate access into ieee80211_node_get_txrate_dot11rate() and ieee80211_node_set_txrate_dot11rate()
net80211: remove direct use of ni->ni_txrate, add indirection methods
The summary:
* Refactor ni_txrate access into ieee80211_node_get_txrate_dot11rate() and ieee80211_node_set_txrate_dot11rate(). These wrap the ni->ni_txrate access and will eventually be able to do runtime sanity checks and fallback where necessary.
* Refactor ieee80211_node_get_txrate_kbit() from the ioctl code which sets isi_txmbps (which is in 0.5Mbit/s units.) This new routine returns the TX rate in kbit/s units.
* Also use ieee80211_node_get_txrate_kbit() in various places in the code where the dot11rate was turned into a Mbit/sec value, which was very wrong for HT (but also only used for logging, so it didn't have an effect on normal runtime.)
* Mb -> Mbit/s
The long version:
The current ni->ni_txrate value is what net80211's phy code calls a 'dot11rate'. Inside the ieee80211_phy.c tables you'll find a bunch of tables which represent:
* for legacy rates its in 1/2 mbit units. * for turbo (Atheros 40MHz OFDM) it's the non-turbo rates, but the turbo rate speed in kbit/sec. * for 802.11n rates its the MCS, starting at 0x80.
However there are a couple of catches with this:
* Basic rates are represented in the pre-11n rates using the high bit (IEEE80211_RATE_BASIC) * 11n rates are also represented using the high bit (IEEE80211_RATE_MCS)
Now, ni->ni_txrate will clear the IEEE80211_RATE_BASIC flag before storing it, so if the high bit exists it must be an 802.11n rate. However, there's still a bunch of code everywhere that purposefully filters that out.
The goals of this commit:
* Provide an easy API to migrate existing drivers and other consumers to - ieee80211_node_get_txrate_dot11rate() is defined as "will return the normal legacy or HT rate" so all the existing code can work. * Lay the ground work for extending ni_txrate (and a rate representation in general) that can represent legacy, HT, VHT, EHT, HE, etc rates. * Create a central place where ni_txrate is updated from rate control, drivers that will update ni_txrate itself, and consumers, so we can provide some basic runtime checks / logging as VHT, EHT, HE, etc rates are eventually added.
For example, a VHT driver will eventually receive VHT rates, but an existing HT driver will not, so the API should log and return a sensible default when something like a VHT rate shows up on a HT only device.
The rate control code currently returns a rix, and sets ni_txrate to the dot11rate. Drivers can choose either. However, choosing the rix is risky because you need to know if it's the ni_rates or ni_htrates, which requires a lot of duplicate work that lines up consistently at all layers (see the AMRR code for an example.)
Differential Revision: https://reviews.freebsd.org/D48601 Reviewed by: bz, thj
show more ...
|
Revision tags: release/14.2.0 |
|
#
243f6925 |
| 29-Nov-2024 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: 11ac: add options to manage VHT STBC
Add IEEE80211_FVHT_STBC_(TX|RX) flags to allow userspace to manage if STBC will be allowed for VHT RX/TX. For RX this will only allow us to turn it off
net80211: 11ac: add options to manage VHT STBC
Add IEEE80211_FVHT_STBC_(TX|RX) flags to allow userspace to manage if STBC will be allowed for VHT RX/TX. For RX this will only allow us to turn it off but no fine grained control of the number of supported spatial streams.
Introduce IEEE80211_FVHT_CHANWIDTH_MASK as a helper to make the spelling out of the IEEE80211_FVHT_MASK more readable.
Update ifconfig to allow setting of these flags.
Sponsored by: The FreeBSD Foundation MFC atfer: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D47838
show more ...
|
Revision tags: release/13.4.0, release/14.1.0 |
|
#
1116e8b9 |
| 17-Apr-2024 |
Adrian Chadd <adrian@FreeBSD.org> |
net80211: add a new field specifically for announcing specific ciphers
This dates way, way back with the original net80211 support w/ atheros chips.
The earliest chip (AR5210) had limitations suppo
net80211: add a new field specifically for announcing specific ciphers
This dates way, way back with the original net80211 support w/ atheros chips.
The earliest chip (AR5210) had limitations supporting software encryption. It only had the four WEP slots, and not any keycache entries. So when trying to do CCMP/TKIP encryption would be enabled and the key slots would have nothing useful in them, resulting in garbage encryption/decryption.
I changed this back in 2012 to disable supporting hardware WEP for AR5210 so if_ath(4) / net80211 crypto is all done in software and yes, I could do CCMP/TKIP on AR5210 in software.
Fast-forward to newer-ish hardware - the Qualcomm 11ac hardware. Those also don't support pass-through keycache slots! Well, the hardware does at that layer, but then there's a whole offload data path encap/decap layer that's turning the frames from raw wifi into ethernet frames (for "dumb" AP behaviours) or "wifi direct" frames (ie, "windows".) This hides a bunch of header frame contents required for doing the software encryption / decryption path.
But then if you enable the raw transmit/receive frame format it ALSO bypasses the hardware encryption/decryption engine!
So for those NICs:
* If you want to do encryption, you can only use the firmware supported ciphers w/ wifi direct or ethernet; * If you want to use software encrypt/decrypt, you MUST disable all encryption and instead use 100% software encryption.
The wpa_supplicant bsd driver code has a specific comment about this and flips on supporting WEP/TKIP/CCMP, which is understandable but it doesn't fix the ACTUAL intention of all of this stuff.
So:
* create a new field, ic_sw_cryptocaps * populate it with the default supported set of ciphers for net80211 (right now wep, tkip, ccmp) * Communicate the combination of both ic_sw_cryptocaps and ic_cryptocaps to wpa_supplicant via the relevant devcap ioctl. * Update manpage.
I'll follow this up with a driver_bsd.c change in wpa_supplicant to trust this again, and then start adding the other cipher support there.
Differential Revision: https://reviews.freebsd.org/D44820
show more ...
|
Revision tags: release/13.3.0 |
|
#
d760d74d |
| 19-Dec-2023 |
Mark Johnston <markj@FreeBSD.org> |
ieee80211: Check for copyout() errors in the SIOCG80211STATS handler
In preparation for annotating copyin() and related functions with __result_use_check.
Reviewed by: bz, emaste MFC after: 1 week
ieee80211: Check for copyout() errors in the SIOCG80211STATS handler
In preparation for annotating copyin() and related functions with __result_use_check.
Reviewed by: bz, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D43095
show more ...
|
Revision tags: release/14.0.0 |
|
#
562adbe1 |
| 27-Oct-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: migrate ic_vhtcaps, ic_vht_mcsinfo, ic_flags_vht
Like for the VAP rename ic_flags_vht to ic_vht_flags for consistency to keep "VHT" fields together and merge ic_vhtcaps and ic_vht_mcsinfo
net80211: migrate ic_vhtcaps, ic_vht_mcsinfo, ic_flags_vht
Like for the VAP rename ic_flags_vht to ic_vht_flags for consistency to keep "VHT" fields together and merge ic_vhtcaps and ic_vht_mcsinfo into struct ieee80211_vht_cap ic_vht_cap.
While the structure layout changes no other functional changes intended.
Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian, cc Differential Revision: https://reviews.freebsd.org/D42421
show more ...
|
#
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 ...
|
#
33396ec2 |
| 14-Sep-2023 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: improve scan debugging
While debugging other problems I ran into the case where net80211 was thinking a scan was ongoing and new scans could not be started but given other logging there wa
net80211: improve scan debugging
While debugging other problems I ran into the case where net80211 was thinking a scan was ongoing and new scans could not be started but given other logging there was clearly no more scan running. It was hard after the fact to quickly determine enough state to reconstruct or validate assumptions.
Improve a MSG_SCAN debug logging and implement _db_show_scan() ddb output which can be printed along with show com /S or /a.
Sponsored by: The FreeBSD Foundation MFC after: 3 days
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 |
|
#
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 ...
|
Revision tags: release/13.1.0, release/12.3.0 |
|
#
0525ece3 |
| 08-Oct-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: fix build for 526370fb85db4b659cff4625eb2f379acaa4a1a8
In 526370fb85db4b659cff4625eb2f379acaa4a1a8 "net80211: proper ssid length check in setmlme_assoc_adhoc()" we are checking the sizeof
net80211: fix build for 526370fb85db4b659cff4625eb2f379acaa4a1a8
In 526370fb85db4b659cff4625eb2f379acaa4a1a8 "net80211: proper ssid length check in setmlme_assoc_adhoc()" we are checking the sizeof on an array function parameter which leads to a warning that it will resturn the size of the type of the array rather than the array size itself. Use the defined length used both in the ioctl and the sizing of the array function parameter instead.
Reported by: CI MFC after: 3 days X-MFC with: 526370fb85db4b659cff4625eb2f379acaa4a1a8
show more ...
|
#
526370fb |
| 06-Oct-2021 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: proper ssid length check in setmlme_assoc_adhoc()
A user supplied SSID length is used without proper checks in setmlme_assoc_adhoc() which can lead to copies beyond the end of the user sup
net80211: proper ssid length check in setmlme_assoc_adhoc()
A user supplied SSID length is used without proper checks in setmlme_assoc_adhoc() which can lead to copies beyond the end of the user supplied buffer. The ssid is a fixed size array for the ioctl and the argument to setmlme_assoc_adhoc(). In addition to an ssid_len check of 0 also error in case the ssid_len is larger than the size of the ssid array to prevent problems.
PR: 254737 Reported by: Tommaso (cutesmilee.research protonmail.com) MFC after: 3 days Reviewed by: emaste, adrian Differential Revision: https://reviews.freebsd.org/D32341
show more ...
|
Revision tags: release/13.0.0, release/12.2.0 |
|
#
01e57940 |
| 18-Oct-2020 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: factor out the priv(9) checks into OS specifc code.
Factor out the priv(9) checks into OS specifc code so other OSes can equally implement them. This sorts out those XXX in the net80211 c
net80211: factor out the priv(9) checks into OS specifc code.
Factor out the priv(9) checks into OS specifc code so other OSes can equally implement them. This sorts out those XXX in the net80211 code. We provide 3 arguments (cmd, vap, ifp) where available to the functions, in order to allow other OSes to use that data but also in case we'd add auditing to these check to have the information available. For now the arguments are marked __unused.
PR: 249403 Reported by: martin(NetBSD) Reviewed by: adrian, martin(NetBSD) MFC after: 10 days Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26541
show more ...
|
#
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
|
#
e2515283 |
| 27-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
372c7b95 |
| 17-Aug-2020 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211: remove vertical whitespace
No functional changes.
MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate")
|
#
96811be2 |
| 17-Aug-2020 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211 / ifconfig: cleanup the use of IEEE80211_FVHT_USEVHT*
Rather then using magic numbers duplicate IEEE80211_FVHT_VHT* in ifconfig (cleanup of these and other flags used and not exposed by net
net80211 / ifconfig: cleanup the use of IEEE80211_FVHT_USEVHT*
Rather then using magic numbers duplicate IEEE80211_FVHT_VHT* in ifconfig (cleanup of these and other flags used and not exposed by net80211 should happen later) and use those. In the kernel this simplifies one ioctl path (the other one currently relies on individual bit flags being passed in). We also re-order the 80P80 and 160 flag for 160 to come before 80+80 and more clearly leave the flags as TODO in one of the 160/80+80 cases.
Reviewed by: adrian MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential Revision: https://reviews.freebsd.org/D26000
show more ...
|
#
440cec3f |
| 12-Aug-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
e53daa1d |
| 07-Aug-2020 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r363989 through r364034.
|
#
7d1d4407 |
| 07-Aug-2020 |
Bjoern A. Zeeb <bz@FreeBSD.org> |
net80211/ifconfig: print hardware device name for wlan interfaces
Add IEEE80211_IOC_IC_NAME to query the ic_name field and in ifconfig to print the parent interface again. This functionality was los
net80211/ifconfig: print hardware device name for wlan interfaces
Add IEEE80211_IOC_IC_NAME to query the ic_name field and in ifconfig to print the parent interface again. This functionality was lost around r287197. It helps in case of multiple wlan interfaces and multiple underlying hardware devices to keep track which wlan interface belongs to which physical device.
Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Reviewed by: adrian, Idwer Vollering MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25832
show more ...
|
#
c7aa572c |
| 31-Jul-2020 |
Glen Barber <gjb@FreeBSD.org> |
MFH
Sponsored by: Rubicon Communications, LLC (netgate.com)
|
#
f7d38a13 |
| 19-Jul-2020 |
Adrian Chadd <adrian@FreeBSD.org> |
[net80211] Add new privileges; restrict what can be done in a jail.
Split the MANAGE privilege into MANAGE, SETMAC and CREATE_VAP.
+ VAP_MANAGE is everything but setting the MAC and creating a VAP.
[net80211] Add new privileges; restrict what can be done in a jail.
Split the MANAGE privilege into MANAGE, SETMAC and CREATE_VAP.
+ VAP_MANAGE is everything but setting the MAC and creating a VAP. + VAP_SETMAC is setting the MAC address of the VAP. Typically you wouldn't want the jail to be able to modify this. + CREATE_VAP is to create a new VAP. Again, you don't want to be doing this in a jail, but this DOES stop being able to run some corner cases like Dynamic WDS (DWDS) AP in a jail/vnet. We can figure this bit out later.
This allows me to run wpa_supplicant in a jail after transferring a STA VAP into it. I unfortunately can't currently set the wlan debugging inside the jail; that would be super useful!
Reviewed by: bz Differential Revision: https://reviews.freebsd.org/D25630
show more ...
|