aboutsummaryrefslogtreecommitdiff
path: root/sys/net80211
Commit message (Collapse)AuthorAgeFilesLines
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-2340-67/+0
| | | | | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/ Similar commit in current: (cherry picked from commit 685dc743dc3b)
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-234-4/+0
| | | | | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/ Similar commit in current: (cherry picked from commit 71625ec9ad2a)
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-231-1/+0
| | | | | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/ Similar commit in current: (cherry picked from commit 2ff63af9b88c)
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-2329-58/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in current: (cherry picked from commit 95ee2897e98f)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-2565-65/+65
| | | | | | | | | | | 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 (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* net80211: fail for unicast traffic without unicast keydomienschepers2023-06-261-5/+11
| | | | | | | | | | | | | Falling back to the multicast key may cause unicast traffic to leak. Instead fail when no key is found. For more information see the 'Framing Frames: Bypassing Wi-Fi Encryption by Manipulating Transmit Queues' paper. [ I updated the commit message to reference the paper and the code comment to record historic behaviour as discussed in private email. ] (cherry picked from commit 61605e0ae5d8f34b89b8e71e393f3006f511e86a)
* net80211: Radiotap: update for newer standards (add EHT, U-SIG)Bjoern A. Zeeb2023-06-261-9/+136
| | | | | | | | | | | | | | | iwlwifi already uses suggested EHT and U-SIG bits as well as some more TLV bits. Update radiotap to know of those even if they might get updated again in the future in order to get newer versions of the driver to compile. ath1xk drivers require further HE defines. Some of those we had already predicted as comments in the past. Sponsored by: The FreeBSD Foundation (cherry picked from commit 7232e6dcc89b978825b30a537bca2e7d3a9b71bb) (cherry picked from commit 63231f4d5bae5fbdb2ebbca4860416557c397059)
* net80211: define mask for ss_flags rather than using hardcoded 0xfffBjoern A. Zeeb2023-06-262-3/+3
| | | | | | | | | | | | | | | | scan state ss_flags in two places cut off the "internal" GOTPICK options. Replace the hardcoded 0xfff with a defined mask. Note that "internal" flags is confusing as we also supplement the the 16bit by another 16bit of "internal flags" passed around but comaparing to GOTPICK never stored to my understanding. No functional change. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D38832 (cherry picked from commit 3346164ce844f8995311c3988ab193bd6ddda0c9)
* net80211: make ieee80211_scan_dump_channels privateBjoern A. Zeeb2023-06-262-4/+2
| | | | | | | | | | | | ieee80211_scan_dump_channels() is only used locally and only when IEEE80211_DEBUG is compiled. Stop exporting it, make it file local and hide under the #ifdef to reduce the footprint for production kernels a tiny bit. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D38833 (cherry picked from commit d7fb679dc96b07c38eedfa8c91817b44b214c799)
* net80211: Fix mismatches in array bounds.John Baldwin2023-05-033-5/+6
| | | | | | | | Reported by: GCC -Warray-parameter Reviewed by: imp, emaste (earlier version) Differential Revision: https://reviews.freebsd.org/D37546 (cherry picked from commit 1f078120955947c85c54a8c088782ea5e4451eb5)
* iee80211_hwmp: Don't dereference NULL ni in debug printf.John Baldwin2023-05-031-2/+2
| | | | | | | | | | | | | | In this call to IEEE80211_NOTE, ni is always NULL due to the assignment a few lines earlier at the start of the function. If debug traces are enabled, then this will pass an invalid pointer as the 'mac' pointer to ieee80211_note_mac. Use IEEE80211_DPRINTF which doesn't take a 'ni' argument instead. Reported by: GCC -Wstringop-overread Reviewed by: bz, emaste Differential Revision: https://reviews.freebsd.org/D37626 (cherry picked from commit 95d146592f5ee3fa998496713f28475e65996ff9)
* net80211: Remove double words in source code commentsGordon Bergling2023-04-232-3/+3
| | | | | | - s/we we/we/ (cherry picked from commit 93e491481686bb392b36a01e1569069846cf5f7e)
* net8021: Fix a typo in a kernel error messageGordon Bergling2022-11-011-1/+1
| | | | | | - s/missmatch/mismatch/ (cherry picked from commit 156ce1e51ce9c092dcc8cc4d7f80a8c63974beea)
* net80211: move IEEE80211_F_WME check to vap for consistencyBjoern A. Zeeb2022-10-171-1/+1
| | | | | | | | | | | | | 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 Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36733 (cherry picked from commit f82316f67883b53ee0f79bf28be32dfa7d64d5e3)
* LinuxKPI: 80211 (+net80211): update and cleanup headersBjoern A. Zeeb2022-10-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Fix types for various struct fields (initially added as int). Move structs and inline functions logically together, e.g., for wowlan. Add more skeleton functions and #defines needed for iwlwifi d3.c in the future. Add struct ieee80211_vht_cap (without "_ie") to net80211 and remove duplicate definitions in LinuxKPI headers now using net80211 structs. For now leave ieee80211_ie_vhtcap in net80211. I am not sure yet if we actually need it as such. That'll be cleaned up with more VHT updates in net80211 in the future. No functional changes in currently compiled code intended. Try to implement ieee80211_action_contains_tpc() as I ran into it with an older iwlwifi chipset. This depends on c994352a8841eb453. Sponsored by: The FreeBSD Foundation (cherry picked from commit 800aa9cd3d8050c1d873a1db02d9a546dca8c42e)
* net80211: update (parts of) Action field categoriesBjoern A. Zeeb2022-09-211-10/+59
| | | | | | | | | | | | | | | Update to the full list of action field category values based on 802.11-2020 with 11ax extensions and remove one value Reserved nowadays. While here annotate them with descriptions. Also add Spectrum Management and Radio Measurement action field values needed in LinuxKPI. No functional changes. Sponsored by: The FreeBSD Foundation (cherry picked from commit c994352a8841eb4533c587bc524f2d1de659a20a)
* net80211: update (parts of) frame types and subtypes and annotateBjoern A. Zeeb2022-09-211-43/+74
| | | | | | | | | | | | | | | | | Update to the full list of frame type and subtype values based on 802.11-2020 with 11ax and 11ay extensions. This includes the 4th type "Extension" (IEEE80211_FC0_TYPE_EXT). While here annotate them with descriptions which should help matching names (as at times things get confusing with LinuxKPI). Also remove some 802.11-1997 values Reserved nowadays. No functional changes. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36410 (cherry picked from commit fb47649ebc5a667739e8bd834b993af3c8d1b89f)
* net80211: simplify an #ifdef INET/INET6 blockBjoern A. Zeeb2022-09-211-10/+17
| | | | | | | | | | | | | | 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) Differential Revision: https://reviews.freebsd.org/D36411 (cherry picked from commit 8def06d5afdcd8020a039b1de994cfe6ad18229e)
* net80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATABjoern A. Zeeb2022-09-217-17/+17
| | | | | | | | | | | | | | | 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 Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D36409 (cherry picked from commit c9b7e9df18e413a27bbddd776315a595255453f1)
* net80211: consistently use the IEEE80211_M_ memory related optionsBjoern A. Zeeb2022-09-2114-41/+43
| | | | | | | | | | | | | | | 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 Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36249 (cherry picked from commit bd29f81763aa9cac74c75b663c2cf46723f05528)
* net80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*Bjoern A. Zeeb2022-09-211-4/+8
| | | | | | | | | | | | | Rather than defining the same values in two places and having to do conflict resulution on the name in LKPI, change the defines to an enum in net80211. In addition to de-duplication this also gives us value checks in certain cases. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36250 (cherry picked from commit 8d371164898141673ad3bfe6ee771931569e07d2)
* net80211: ieee80211_ies_expand() add extra length checkBjoern A. Zeeb2022-09-211-0/+8
| | | | | | | | | | | | | Make sure the given IE length fits into the total length left when parsing through the information elements. In theory I would say discard everything if there is an error but that proves hard with the current code. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D36245 (cherry picked from commit 9d2ba51806c32e7ea8ad83439cb48df91575b5bf)
* net80211: change order in ieee80211_vhtchanflags()Bjoern A. Zeeb2022-09-211-2/+2
| | | | | | | | | | | While 80P80 is less likely to be used, VHT160 (a single contiguous width) is harder to acquire but also preferable so return that first. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35977 (cherry picked from commit 195733401f431622df3185897cd04c1aeb113e0d)
* net80211: add VHT5G and VHT2G checks/return to media_statusBjoern A. Zeeb2022-09-211-1/+5
| | | | | | | | | | | Add the fields for VHT (2Ghz and 5Ghz) to report back by media_status so we actually have a chance to get the right information. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35977 (cherry picked from commit 656d0e8fa92ad72626808479d0935814425ee78d)
* net80211: correct IEEE80211_FEXT_BITSBjoern A. Zeeb2022-09-211-1/+2
| | | | | | | | | | | Correct IEEE80211_FEXT_BITS adding the missed one and move the later one further. This will actually make VHT to show. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35977 (cherry picked from commit 463d6125e7bff6504099f34e4fe7aa0a68166e6e)
* net80211: radiotap: add one more define for HEBjoern A. Zeeb2022-09-211-0/+1
| | | | | | | | | Add one more define for HE radiotap used by a driver. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35977 (cherry picked from commit c7a8db6a8556b1a99e94f010bdf3485a5f3fdd32)
* net80211: improve DDB output.Bjoern A. Zeeb2022-09-211-3/+24
| | | | | | | | | | | | Start adding more fields to DDB output related to VHT (11ac) and mark COM, VAP, and STA more explicitly to make show all vaps /.. more readable. Sponsored by: The FreeBSD Foundaton Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35977 (cherry picked from commit 5c9f992919eee6771dd15da278228e5f3bcee7b6)
* net80211: add more 802.11ac Element IDsBjoern A. Zeeb2022-09-211-1/+7
| | | | | | | | | | | Add more Element IDs for VHT (11ac) to complete the current list and we can use them if/as needed. Sposnored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35977 (cherry picked from commit a78be09e4d1aa8a2117f71d96093d4884c211903)
* net80211: VHT correct check/option in ieee80211_vht_adjust_channel()Bjoern A. Zeeb2022-09-211-3/+2
| | | | | | | | | | | | | | | | | | In ieee80211_vht_adjust_channel() we have to check for all possible IEEE80211_FVHT_VHT* options using the mask rather than just checking for IEEE80211_FVHT_VHT; ieee80211_vhtchanflags() (contrary to its HT counterpart) only returns the "highest" flag nor or-ing them together with the base flag. For the moment this seems to make sense as with more width options we'd add a pyramid. Later on, in the same function when we get VHT160 actually go and look for VHT160 and not VHT80. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35977 (cherry picked from commit dc32c7133921a34f3144a4b5fc4f7c1f6cddbd1f)
* net80211(4): Fix a few common typos in source code commentsGordon Bergling2022-09-123-3/+3
| | | | | | | - s/annoucement/announcement/ - s/setings/settings/ (cherry picked from commit 2ec4c3c7f3ef7bae1d3efd314b64f493acd51642)
* net80211(4): Correct a grammar mistake in a source code commentGordon Bergling2022-09-101-1/+1
| | | | | | | | | | - s/the/be the/ - s/Mhz/MHz/ - s/it'll/it will/ Reported by: bz, danfe (cherry picked from commit d78a9076652a3ad7c93e674284b08911f9c42582)
* net80211(4): Remove a double word in a source code commentGordon Bergling2022-09-071-1/+1
| | | | | | - s/the the/the/ (cherry picked from commit 8f538e27663a86c26f39c34ebf9fd59e180800dd)
* net80211: Remove tautological state displayCy Schubert2022-08-131-2/+2
| | | | | | | | | | | 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 Differential Revision: https://reviews.freebsd.org/D35849 (cherry picked from commit 4f158a444ee7365454cc3ea1547b1b5c323dae55)
* net80211(4): Fix a typo in a source code commentGordon Bergling2022-08-101-1/+1
| | | | | | - s/paramaters/parameters/ (cherry picked from commit 044169efe0b7f8a3c30f33ae081054def91acc7d)
* Fix unused variable warning in ieee80211_proto.cDimitry Andric2022-07-291-4/+1
| | | | | | | | | | | | | | | | With clang 15, the following -Werror warning is produced: sys/net80211/ieee80211_proto.c:1070:34: error: variable 'num_mixed' set but not used [-Werror,-Wunused-but-set-variable] int num_vaps = 0, num_pure = 0, num_mixed = 0; ^ The 'num_mixed' variable was in ieee80211_proto.c when the function vap_update_ht_protmode() was added, but it was never used for anything, so remove it. MFC after: 3 days (cherry picked from commit 9319211f96c6f11959c76f1d565a744ab37b0031)
* net80211 / LinuxKPI: 802.11: add Control Trigger Subframe informationBjoern A. Zeeb2022-07-011-0/+1
| | | | | | | Add definitions related to 802.11ax Control Trigger frame format needed for rtw89. (cherry picked from commit 4c3684ef5cf239efeae8675787ac30247e70be8a)
* net80211: remove (optional) RSN from preobereqBjoern A. Zeeb2022-06-031-4/+0
| | | | | | | | | | | | | 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 Okayed by: adrian Differential Revision: https://reviews.freebsd.org/D34893 (cherry picked from commit 892b1874ace0245a08b0764a45622fbdee3668a9)
* net80211: simplify code after STA/AP VAPs traffic hang fixBjoern A. Zeeb2022-06-031-12/+16
| | | | | | | | | | | | | | | Combine the comment and double-unsetting of OACTIVE into a single case after e8de31caceaa36caf5d7b4355072f148e2433b82. This saves the question of why we do it twice--once right before and one more time right after the state change check. Also move the XXX comment about kicking the queue up to where it seems better suited now. Sponsored by: The FreeBSD Foundation Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35135 (cherry picked from commit 464907ce1cf931091fa48999ea64480a6d2ef52c)
* net80211: Fix traffic hang on STA/AP VAPs on a multi-VAP interfaceAdrian Chadd2022-06-031-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This took an embarrasingly long time to find. The state changes for a radio with a STA /and/ AP VAP gets a bit messy. The AP maps are marked as waiting, waiting for the STA AP to find a channel to use before the AP VAPs become active. However, the code path that clears the OACTIVE flag on a VAP only runs during a successful run of ieee80211_newstate_cb(). So here is how it goes: * the STA VAP goes down and needs to scan; * the AP vap goes RUN->INIT; but it doesn't YET call ieee80211_newstate_cb(); * meanwhile - a send on the AP VAP causes the VAP to set the OACTIVE flag here; * then the STA VAP finishes scan and goes to RUN; * which will call wakeupwaiting() as part of the STA VAP transition to RUN; * .. then the AP VAP goes INIT->RUN directly via a call to hostap_newstate in wakeupwaiting rather than it being through the deferred path; * /then/ the ieee80211_newstate_cb() is called, but it sees the state go RUN->RUN; * .. which results in the OACTIVE flag never being cleared. This clears the OACTIVE flag when a VAP transitions RUN->RUN; the driver layer or net80211 layer can set it if required in a subsequent transmit. Differential Revision: https://reviews.freebsd.org/D34920 (cherry picked from commit e8de31caceaa36caf5d7b4355072f148e2433b82)
* net80211(4): Fix a typo in a source code commentGordon Bergling2022-04-141-1/+1
| | | | | | - s/is is/is/ (cherry picked from commit fb5a5026924ca9ba759ef01774615ea98cf587ec)
* net80211: validate Mesh ID length in ieee80211_parse_beaconBjoern A. Zeeb2022-04-051-0/+6
| | | | | | Reported by: m00nbsd working with Trend Micro Zero Day Initiative (cherry picked from commit fb8c87b4f3bfdfac014f9d894fe75fbad0391b24)
* net80211: correct types for nf and rssiBjoern A. Zeeb2022-04-051-2/+2
| | | | | | | | | NF and RSSI should be signed and not unsigned to avoid problems. Change the type accordingly. Sponsored by: The FreeBSD Foundation (cherry picked from commit 4a22cd6c4e5f4fc4a38aa7400742d4005c5ae3de)
* net80211: introduce (*iv_update_bss)()Bjoern A. Zeeb2022-03-274-10/+26
| | | | | | | | | | | | | | | | | | Introduce (*iv_update_bss)() with a default implementation to allow drivers to overload/intercept the time when we swap iv_bss. This helps firmware based drivers to synchronize state with firmware. Otherwise, for some state changes, we begin with one ni (and in LinuxKPI lsta) and try to finish with another ni (and a new lsta in different state) and may no longer have access to the previous state. This also saves us from constantly checking for ni changes complicating code. No functional changes intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit 91b4225aa1d81155668db6deed22084abf2ce23c)
* net80211: improve one debug loggingBjoern A. Zeeb2022-03-271-2/+4
| | | | | | | | | | | | When forcing DEUATH in ieee80211_sta_join1() log the current state we are coming from as well. Note this isn't always the state we are expecting as iv_state was updated already, so contrary to the comment we usually do not see RUN there. Leave a comment earlier with regards to this as well. Sponsored by: The FreeBSD Foundation (cherry picked from commit 453d1a90f8f46637404adc0278d6f3f068542733)
* net80211: enhance (disabled) debuggingBjoern A. Zeeb2022-02-201-4/+4
| | | | | | | | | | Add maxchans to the disabled debugging in addchan() and copychan_prev() to aid debugging possible errors rreturned due to reaching maxchans limits. Sponsored by: The FreeBSD Foundation (cherry picked from commit 32cf376a01d42710ccbb1d6664ebd0a85c9e0064)
* Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrightsEd Maste2022-02-083-3/+0
| | | | | | | | | These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation (cherry picked from commit 9feff969a01044c3083b552f06f7eb6416bc0524)
* net80211: ieee80211_dump_node() cosmeticsBjoern A. Zeeb2022-01-201-2/+3
| | | | | | | | | | Printing %p does not need the 0x prefix and while here mark the ieee80211_node_table argument unused given we do not need it in the current incarnation of the function. Sponsored by: The FreeBSD Foundation (cherry picked from commit c3db9d4a1439e0144415e007599a94dde4bee01b)
* net80211: adjust a printf to toeee80211_noteBjoern A. Zeeb2021-12-301-1/+1
| | | | | | | | | | | | 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 (cherry picked from commit 2e59c9c7f01e9e8878664f59438d1ed6c27d0e2b)
* net80211: add debugging informationBjoern A. Zeeb2021-12-303-3/+22
| | | | | | | | | | | 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 (cherry picked from commit 04efa18f83d12dca2b69dd4cdb626f92e5ce64f0)
* net80211: format debug functions as single lineBjoern A. Zeeb2021-12-301-27/+49
| | | | | | | | | | | | | | | | | | Making use of the debug output was hard given debug lines were run in parts through vlog (if_printf) and in (multiple) parts through printf(s). Like some of the functions alreay have, use a local buffer to format the string and then use a single if_printf; in addition given these functions are debug-only, add an extra printf in case we find our buffers still to be too small so we can adjust for the future. We already found that 128 characters are to short for some log messages. Bump the buffer sizes collectively to 256 characters which also is the maximum of if_vlog() so getting longer would need further changes elsewhere. Sponsored by: The FreeBSD Foundation (cherry picked from commit 04435a1b145b310f8be62dd453e2f0c69d764cca)