aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/wlan
Commit message (Collapse)AuthorAgeFilesLines
* uath(4): Fix a typo in a source code commentGordon Bergling2024-02-221-1/+1
| | | | | | - s/parmeter/parameter/ MFC after: 3 days
* net80211: deal with lost state transitionsBjoern A. Zeeb2024-02-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 5efea30f039c4 we can possibly lose a state transition which can cause trouble further down the road. The reproducer from 643d6dce6c1e can trigger these for example. Drivers for firmware based wireless cards have worked around some of this (and other) problems in the past. Add an array of tasks rather than a single one as we would simply get npending > 1 and lose order with other tasks. Try to keep state changes updated as queued in case we end up with more than one at a time. While this is not ideal either (call it a hack) it will sort the problem for now. We will queue in ieee80211_new_state_locked() and do checks there and dequeue in ieee80211_newstate_cb(). If we still overrun the (currently) 8 slots we will drop the state change rather than overwrite the last one. When dequeing we will update iv_nstate and keep it around for historic reasons for the moment. The longer term we should make the callers of ieee80211_new_state[_locked]() actually use the returned errors and act appropriately but that will touch a lot more places and drivers (possibly incl. changed behaviour for ioctls). rtwn(4) and rum(4) should probably be revisted and net80211 internals removed (for rum(4) at least the current logic still seems prone to races). PR: 271979, 271988, 275255, 263613, 274003 Sponsored by: The FreeBSD Foundation (in 2023) MFC after: 3 days Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D43389
* Revert "Enter the network epoch in USB WiFi drivers when processing input"Bjoern A. Zeeb2023-12-011-3/+0
| | | | | | | This reverts commit 17c328b6aebfa03cd1c2cbfbbc617e3b341bf1e4. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* Revert "Widen EPOCH(9) usage in USB WLAN drivers."Bjoern A. Zeeb2023-12-017-21/+0
| | | | | | | This reverts commit 21c4082de9e2cf9a0fd81a9a981ab06022956847. Sponsored by: The FreeBSD Foundation MFC after: 3 days
* net80211 / drivers: remove public use of ieee80211_node_incref()Bjoern A. Zeeb2023-10-021-1/+1
| | | | | | | | | | | | | | | ieee80211_node_incref() is the FreeBSD implementation of ieee80211_ref_node(). Not being interested in the node returned it was used as a shortcut in 3 drivers (ath, uath, wpi). Replace the call with the public KPI of ieee80211_ref_node() and ignore the result. This leaves us with the single internal call going ieee80211_ref_node() -> ieee80211_node_incref() and that should help increasing portability but also limiting the places to trace for node reference operations. Sponsored by: The FreeBSD Foundation MFC after: 4 weeks
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-167-14/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1616-16/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* sys: Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | 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
* Mechanically convert usb ethernet drivers to DrvAPIJustin Hibbits2023-03-063-13/+13
| | | | | | Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37812
* if_rsu: Fix mismatches in array bounds.John Baldwin2022-12-071-3/+4
| | | | | | Reported by: GCC -Warray-parameter Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D37551
* usb(4): Substitute "unsigned int" using the equivalent and shorter ↵Hans Petter Selasky2022-10-076-12/+12
| | | | | | | "unsigned" keyword. MFC after: 1 week Sponsored by: NVIDIA Networking
* upgt(4): Adjust all pause calls to use milliseconds instead of ticks.Hans Petter Selasky2022-06-091-2/+2
| | | | | MFC after: 1 week Sponsored by: NVIDIA Networking
* urtw(4): Adjust all pause calls to use milliseconds instead of ticks.Hans Petter Selasky2022-06-091-55/+61
| | | | | MFC after: 1 week Sponsored by: NVIDIA Networking
* usb: Remove unused devclass arguments to DRIVER_MODULE.John Baldwin2022-05-068-22/+10
|
* uath(4): Fix incorrect byte-swapping and a buffer length check.Hans Petter Selasky2022-04-301-4/+3
| | | | | | | PR: 263638 Reported by: Jeff Gibbons <jgibbons@protogate.com> MFC after: 1 week Sponsored by: NVIDIA Networking
* if_urtw: Remove unused variables.John Baldwin2022-04-081-8/+6
|
* if_upgt: Remove unused variables.John Baldwin2022-04-081-6/+2
|
* net80211/drivers: improve ieee80211_rx_stats for bandBjoern A. Zeeb2021-10-221-0/+2
| | | | | | | | | | | | | While IEEE80211_R_BAND was defined, there was no place to store the band. Add a field for that, adjust ieee80211_lookup_channel_rxstatus() to require it, and update drivers passing "R_{FREQ|IEEE}" in already to provide the band as well. For the moment keep the fall-back code requiring all three fields. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D30662
* run(4): add support for DLINK DWA-130 rev F1 wireless adaptor.Dmitry Chagin2021-05-231-0/+1
| | | | | | PR: 256092 Submitted by: Francois Briere <purplefiasco at gmail.com> MFC After: 2 weeks
* run(4): add support for ASUS USB-N14 wireless adaptor.Dmitry Chagin2021-05-221-0/+1
| | | | | | PR: 255759 Submitted by: john.lmurdoch at gmail.com MFC After: 1 week
* rsu: add KASSERT to document maximum mbuf size in rsu_tx_startEd Maste2021-03-221-0/+1
| | | | | | PR: 254479 Reviewed by: markj Sponsored by: The FreeBSD Foundation
* rsu: Don't modify read-only firmware block.John Baldwin2020-12-301-19/+18
| | | | | | | | | | | | | | | | | | | | | | The firmware header loaded into an rsu(4) device has to be customized to reflect device settings. The driver was overwriting the header from the shared firmware image before sending it to the device. If two devices attached at the same time with different settings, one device could potentially get a corrupted header. The recent changes in a095390344fb1795c1b118a2f84da8f6a7f254ab exposed this bug in the form of a panic as the firmware blobs are now marked read-only in object files and mapped read-only by the kernel. To avoid the bug, change the driver to allocate a copy of the firmware header on the stack that is initialized before writing it to the device. PR: 252163 Reported by: vidwer+fbsdbugs@gmail.com Tested by: vidwer+fbsdbugs@gmail.com Reviewed by: hselasky, bz, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27850
* WiFi: fix ieee80211_media_change() callersBjoern A. Zeeb2020-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | In r178354 with the introduction of multi-bss ("vap") support factoring out started and with r193340 ieee80211_media_change() no longer returned ENETRESET but only 0 or error. As ieee80211(9) tells the ieee80211_media_change() function should not be called directly but is registered with ieee80211_vap_attach() instead. Some drivers have not been fully converted. After fixing the return checking some of these functions were simply wrappers between ieee80211_vap_attach() and ieee80211_media_change(), so remove the extra function, where possible as well. PR: 248955 Submitted by: Tong Zhang (ztong0001 gmail.com) (original) MFC after: 3 days Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=365419
* usb: clean up empty lines in .c and .h filesMateusz Guzik2020-09-0111-27/+9
| | | | Notes: svn path=/head/; revision=365084
* net80211: enhance getflags*() and ieee80211_add_channel*()Bjoern A. Zeeb2020-08-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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) which 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: adrian, gnn Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") Differential revision: https://reviews.freebsd.org/D26091 Notes: svn path=/head/; revision=364673
* [rsu] Update wme ie API use.Adrian Chadd2020-06-161-1/+1
| | | | | | | Whoops, forgot to land this one too! Notes: svn path=/head/; revision=362213
* [run] Fix up tx/rx frame size.Adrian Chadd2020-06-032-4/+6
| | | | | | | | | | | | | This specifically fixes that TX frames are large enough now to hold a 3900 odd byte AMSDU (the little ones); me flipping it on earlier messed up transmit! Tested: * if_run, STA mode, TX/RX TCP/UDP iperf. TCP is now back to normal and correctly does ~ 3200 byte AMSDU/fast frames (2x1600ish byte MSDUs). Notes: svn path=/head/; revision=361778
* [run] note that PHY_HT is for mixed mode.Adrian Chadd2020-06-022-2/+2
| | | | | | | | Submitted by: Ashish Gupta <ashishgu@andrew.cmu.edu> Differential Revision: https://reviews.freebsd.org/D25108 Notes: svn path=/head/; revision=361738
* [run] Set the number of HT chains.Adrian Chadd2020-06-021-7/+14
| | | | | | | | | | | | | * Set the tx/rx chains based on the existing MIMO eeprom reads * Add 3-chain rates Tested: * MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), 2g/5g STA * MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R), 2g/5g STA Notes: svn path=/head/; revision=361737
* [run] Add 11NA flags for 5G NICs that support HT.Adrian Chadd2020-06-021-0/+2
| | | | | | | | | | | | | | | | | | | Now that I'm a proud owner of an ASUS USB-N66, I can test 2G/5G and 3-stream configurations. For now, just flip on 5G HT rates. I've tested this in both 5G HT20 and 5G 11a modes. It's still one stream for now until we verify that the number of streams reported (ie the MIMO below) is actually the number of 11n streams, NOT the number of antennas. (They don't have to match! You can have more antennas than MIMO streams!) Tested: * run0: MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R) Notes: svn path=/head/; revision=361726
* [run] Don't add 11ng channels (2GHz) for RF2020Adrian Chadd2020-05-301-2/+2
| | | | | | | | Don't also add the 11ng channels if we're not in 11n mode or net80211 will get super weird. Notes: svn path=/head/; revision=361637
* [run] Set ampdu rxmax same as linux; RF2020 isn't an 11n NICAdrian Chadd2020-05-301-13/+26
| | | | | | | | | | | This is from the linux driver: * set the ampdu rx max to 32k for 1 stream devics like mine, and 64k for larger ones * Don't enable 11n bits for RF2020 Notes: svn path=/head/; revision=361636
* [run] Add initial 802.11n support.Adrian Chadd2020-05-293-41/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Enable self-generated 11n frames * add MCS rates for 1-stream and 2-stream rates; will do 3-stream once the rest of this tests out OK with other people. * Hard-code 1 stream for now * Add A-MPDU RX mbuf tagging * RTS/CTS if doing RTSCTS in HT protmode as well as legacy; they're separate configuration flags * Update the amrr rate index stuff - walk the rates array like others to find the right one - this now works for MCS and CCK/OFDM rates * Add support for atheros fast frames/AMSDU support as we can generate those in net80211. TODO: * HT40 isn't enabled yet * No A-MPDU support just yet; that requires some more firmware research and maybe porting some ath(4) A-MPDU support/tracking into net80211 * Short preamble flags aren't set yet for MCS; need to check the linux driver and see what's going on there * Add 3x3 rates and set tx/rx stream configuration appropriately * More 5GHz testing; I have a 3x3 dual band USB NIC coming soon that'll let me test this. * Figure out why the RX path isn't performing as fast as it could - there's only a single buffer loaded at a time for the receive path in the USB bulk handler and this may not be super useful. Tested: * RT5390 usb, 1x1, RF5370 (2GHz radio), STA mode - A-MSDU TX, A-MPDU RX Submitted by: Ashish Gupta <ashishgu@andrew.cmu.edu> Differential Revision: https://reviews.freebsd.org/D22840 Notes: svn path=/head/; revision=361626
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (2 of many)Pawel Biernacki2020-02-158-16/+23
| | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Reviewed by: hselasky, kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D23632 Notes: svn path=/head/; revision=357972
* Widen EPOCH(9) usage in USB WLAN drivers.Hans Petter Selasky2020-01-307-0/+21
| | | | | | | | | | This patch should unbreak the USB WLAN drivers after r357004. Pointy hat: glebius@ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=357288
* Enter the network epoch in USB WiFi drivers when processing inputGleb Smirnoff2020-01-241-0/+3
| | | | | | | | | mbuf queues. Submitted by: Idwer Vollering <vidwer gmail.com> Notes: svn path=/head/; revision=357093
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-141-17/+14
| | | | | | | Reviewed by: hselasky Notes: svn path=/head/; revision=353507
* Convert to if_foreach_llmaddr() KPI.Gleb Smirnoff2019-10-141-26/+25
| | | | | | | Reviewed by: hselasky Notes: svn path=/head/; revision=353506
* Extract eventfilter declarations to sys/_eventfilter.hConrad Meyer2019-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially. EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h). As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files. LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change). No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped. Notes: svn path=/head/; revision=347984
* urtw(4), otus(4), iwi(4): allow to set non-default MAC address via ifconfig(8)Andriy Voskoboinyk2019-04-101-4/+26
| | | | | | | | | Tested with Netgear WG111 v3 (RTL8187B, urtw(4)), STA mode. MFC after: 1 week Notes: svn path=/head/; revision=346073
* run(4): properly set F_DATAPAD radiotap flag if frame has padding betweenAndriy Voskoboinyk2019-03-311-4/+11
| | | | | | | | | | | | | | | | | | frame header and data. This will fix 'Mysterious OLPC stuff' for received frames and wrong CCMP / TKIP / data decoding for transmitted frames in net/wireshark dissector. While here, drop unneeded comment - net80211 handles padding requirements for Tx & Rx without driver adjustment. Tested with D-Link DWA-140 rev B3, STA mode. MFC after: 1 week Notes: svn path=/head/; revision=345754
* run(4): do not clear PROTECTED bit if frame was not decrypted by NIC.Andriy Voskoboinyk2019-03-311-2/+2
| | | | | | | | | Tested with D-Link DWA-140 rev B3, STA / MONITOR modes. MFC after: 1 week Notes: svn path=/head/; revision=345753
* uath(4), urtw(4): restart driver if device does not respond after Tx requestAndriy Voskoboinyk2019-03-312-2/+4
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=345751
* urtw(4): export TSF timestamp for received frames via radiotapAndriy Voskoboinyk2019-03-302-1/+11
| | | | | | | | | Tested with Netgear WG111 v3 (RTL8187B), STA mode. MFC after: 1 week Notes: svn path=/head/; revision=345729
* run(4): merge some common TSF-related code into run_disable_tsf()Andriy Voskoboinyk2019-03-251-16/+17
| | | | | | | | | No functional change intended. MFC after: 5 days Notes: svn path=/head/; revision=345493
* urtw(4): add promiscuous mode callbackAndriy Voskoboinyk2019-03-111-9/+23
| | | | | | | | | | | | Also, pass control frames to the host while in MONITOR mode and / or when promiscuous mode is enabled. Tested with Netgear WG111 v3 (RTL8187B), STA / MONITOR modes. MFC after: 2 weeks Notes: svn path=/head/; revision=344994
* Fix ieee80211_radiotap(9) usage in wireless drivers:Andriy Voskoboinyk2019-03-1111-24/+13
| | | | | | | | | | | | | | | | | | | | | | | - Alignment issues: * Add missing __packed attributes + padding across all drivers; in most places there was an assumption that padding will be always minimally suitable; in few places - e.g., in urtw(4) / rtwn(4) - padding was just missing. * Add __aligned(8) attribute for all Rx radiotap headers since they can contain 64-bit TSF timestamp; it cannot appear in Tx radiotap headers, so just drop the attribute here. Refresh ieee80211_radiotap(9) man page accordingly. - Since net80211 automatically updates channel frequency / flags in ieee80211_radiotap_chan_change() drop duplicate setup for these fields in drivers. Tested with Netgear WG111 v3 (urtw(4)), STA mode. MFC after: 2 weeks Notes: svn path=/head/; revision=344990
* net80211(4): hide casts for 'i_seq' field offset calculation insideAndriy Voskoboinyk2019-02-101-5/+1
| | | | | | | | | | | ieee80211_getqos() and reuse it in various places. Checked with RTL8188EE, HOSTAP mode + RTL8188CUS, STA mode. MFC after: 2 weeks Notes: svn path=/head/; revision=343990