aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/rtwn
Commit message (Collapse)AuthorAgeFilesLines
* rtwn: narrow the epoch areaBjoern A. Zeeb2020-09-291-6/+12
| | | | | | | | | | | | | | | | | | Rather than placing the epoch around the entire receive loop which might call into rtwn_rx_frame() and USB and sleep, split the loop into two[1] and leave us with one unlock/lock cycle as well. PR: 249925 Reported by: thj, (rkoberman gmail.com) Tested by: thj Suggested by: adrian [1] Reviewed by: adrian MFC after: 3 days Sponsored by: The FreeBSD Foundation (initially, paniced my iwl lab host) Differential Revision: https://reviews.freebsd.org/D26554 Notes: svn path=/head/; revision=366268
* rtwn: clean up empty lines in .c and .h filesMateusz Guzik2020-09-01113-147/+1
| | | | Notes: svn path=/head/; revision=365097
* rtwn(4): Add support for the Belkin N300.Mark Johnston2020-08-311-0/+1
| | | | | | | | | PR: 249034 Submitted by: Salvador Martínez Mármol <salvica@kapj.net> MFC after: 1 week Notes: svn path=/head/; revision=364993
* net80211: enhance getflags*() and ieee80211_add_channel*()Bjoern A. Zeeb2020-08-241-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add new USB ID.Hans Petter Selasky2020-08-061-0/+1
| | | | | | | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=363950
* rtwn: Add a USB ID for Buffalo WI-U2-433DHPLi-Wen Hsu2020-06-271-0/+1
| | | | | | | | | PR: 247573 Submitted by: HATANO Tomomi <hatanou@infolab.ne.jp> MFC after: 1 week Notes: svn path=/head/; revision=362672
* rtwn: Add a USB ID for the TP-Link TL-WN727N.Mark Johnston2020-05-121-0/+1
| | | | | | | | | PR: 246417 Submitted by: Viktor G. <viktor@netgate.com> MFC after: 1 week Notes: svn path=/head/; revision=360966
* rtwn: Add a new USB ID.Mark Johnston2020-05-091-1/+2
| | | | | | | | | PR: 246315 Submitted by: Idwer Vollering <vidwer+fbsdbugs@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=360848
* Add new USB ID.Hans Petter Selasky2020-03-221-1/+2
| | | | | | | | | | Submitted by: Konrad Jopek <kjopek@gmail.com> Differential Revision: https://reviews.freebsd.org/D24142 MFC after: 1 week Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=359209
* Add new USB device ID for Elecom 802.11ac USB device.Gavin Atkinson2020-03-201-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=359158
* Add MODULE_PNP_INFO() to autoload the rtwn_pci(4) kernel module.Hiroki Sato2020-02-272-6/+8
| | | | | | | | | Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D23807 Notes: svn path=/head/; revision=358402
* Widen EPOCH(9) usage in PCI WLAN drivers.Hans Petter Selasky2020-01-301-0/+5
| | | | | | | | | | | | | | Make sure all occurrences of ieee80211_input_xxx() in sys/dev are covered by a network epoch section. Do not depend on the interrupt handler nor any taskqueues being in a network epoch section. This patch should unbreak the PCI WLAN drivers after r357004. Pointy hat: glebius@ Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=357291
* 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-211-17/+14
| | | | Notes: svn path=/head/; revision=353858
* Add support for TP-Link Archer T2U Nano.Jung-uk Kim2019-09-011-1/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=351653
* rtwn_pci: add device ID for RTL8192CE.Andriy Voskoboinyk2019-08-121-0/+1
| | | | | | | | | | PR: 239795 Submitted by: James Parsons <james.m.parsons@protonmail.com> MFC after: 1 week Relnotes: yes Notes: svn path=/head/; revision=350885
* Fix ieee80211_radiotap(9) usage in wireless drivers:Andriy Voskoboinyk2019-03-112-5/+2
| | | | | | | | | | | | | | | | | | | | | | | - 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
* rtwn_usb(4): fix Tx instability with RTL8192CU chipsetsAndriy Voskoboinyk2019-03-043-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix data frames transmission via POWER_STATUS register setup - it seems to be set by MACID_CONFIG firmware command, which was broken* in r290439 and later disabled in r307529. We can re-enable it later if / when firmware rate adaptation will be ready; however, this step will be required anyway - for firmware-less builds. - Force RTS / CTS protection frame rate to CCK1 (this rate works fine without any additional setup; no better workaround is known yet). The problem was not observed on the channel 1 or with CCK1 rate enforced ('ifconfig wlan0 ucastrate 1' for 11 b/g; not possible for 11n networks due to ifconfig(8) bug). * I'm not sure if it works before r290439 because - AFAIR - I never seen firmware rate adaptation working for 10-STABLE urtwn(4) (It needs EN_BCN bit set and RSSI updates at least). Tested with RTL8188CUS in STA mode (in regular mode and with disabled MRR - DARFRC*8 is set to 0) PR: 233949 MFC after: 2 weeks Notes: svn path=/head/; revision=344745
* rtwn_usb(4): fix LED blinking for RTL8192CU during scanningAndriy Voskoboinyk2019-03-041-0/+1
| | | | | | | | | Tested with RTL8188CUS, STA mode. MFC after: 5 days Notes: svn path=/head/; revision=344744
* rtwn_usb(4): add new USB id.Andriy Voskoboinyk2019-01-281-1/+2
| | | | | | | | | Submitted by: <yklaxds@gmail.com> Github issue: https://github.com/s3erios/rtwn/issues/4 MFC after: 5 days Notes: svn path=/head/; revision=343518
* Remove 2GHz channel list copies from wireless drivers.Andriy Voskoboinyk2019-01-261-6/+2
| | | | | | | | | | | | | Wrap ieee80211_add_channel_list_2ghz into another function which supplies default (1-14) channel list to it and drop its copies from drivers. Checked with RTL8188EE, country US / JP / KR / UA. MFC after: 2 weeks Notes: svn path=/head/; revision=343474
* net80211: reuse TICKS_2_MSEC / MSEC_2_TICKS macros from sys/time.hAndriy Voskoboinyk2019-01-252-5/+3
| | | | | | | | | | | Replace in-place implementation with system-wide one; since it guarantees non-zero result drop all less-than-one checks from drivers and net80211. MFC after: 2 weeks Notes: svn path=/head/; revision=343417
* rtwn(4): clear 'basic' rate bit before calculating RTS/CTS rate.Andriy Voskoboinyk2019-01-162-2/+2
| | | | | | | | | | | | | | | | Rate tables have this bit set to indicate minimal set of basic rates; however, it overlappes with MCS bit, so rate2ridx() will treat them as an 11n rate. Due to the current rates setup the issue can be reproduced only in 5GHz band with 11n / protection enabled. Tested with RTL8821AU, HOSTAP mode. MFC after: 5 days Notes: svn path=/head/; revision=343092
* rtwn_usb(4): add new USB id for RTL8821AUAndriy Voskoboinyk2019-01-161-1/+2
| | | | | | | | | Reported by: Mike Tancsa <mike@sentex.net> Tested by: Mike Tancsa <mike@sentex.net> MFC after: 3 days Notes: svn path=/head/; revision=343088
* rtwn_usb(4): add IQ calibration support for RTL8192CUAndriy Voskoboinyk2019-01-102-2/+352
| | | | | | | | | | | | The code is similar to the one for RTL8188E* and probably should be shared with RTL8188CE (needs to be tested). Checked with RTL8188CUS, STA mode. MFC after: 5 days Notes: svn path=/head/; revision=342912
* rtwn_pci(4): sync r88ee_power_on() with OpenBSDAndriy Voskoboinyk2019-01-043-5/+22
| | | | | | | | | | | Tested with RTL8188EE, STA mode Submitted by: Farhan Khan <khanzf@gmail.com> MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18727 Notes: svn path=/head/; revision=342759
* rtwn_usb(4): add USB id for TP-LINK TL-WN821N v5.Andriy Voskoboinyk2019-01-021-0/+1
| | | | | | | | | It is already mentioned in manpage, but was missing from the driver. MFC after: 4 days Notes: svn path=/head/; revision=342703
* rtwn_pci(4): fix panic with INVARIANTS (due to inverted assertion logic)Andriy Voskoboinyk2019-01-021-1/+1
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342700
* rtwn_pci(4): add support for RTL8188EE chipset.Andriy Voskoboinyk2019-01-029-15/+805
| | | | | | | | | | | | | Initially based on https://reviews.freebsd.org/D15692; later deduplicated and improved a bit (Tx reports, IQ calibration support). Submitted by: Farhan Khan <khanzf@gmail.com> MFC after: 4 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D15692 Notes: svn path=/head/; revision=342682
* rtwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E*Andriy Voskoboinyk2019-01-026-10/+20
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342681
* rtwn(4): rename common RTL8188E* structures.Andriy Voskoboinyk2019-01-022-24/+24
| | | | | | | | | No functional change intended. MFC after: 4 days Notes: svn path=/head/; revision=342680
* rtwn(4): do not try to start RTL8188E* MCU during device shutdown.Andriy Voskoboinyk2019-01-021-1/+5
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342679
* Move USB-specific parts from rtwn(4) to rtwn_usb(4)Andriy Voskoboinyk2019-01-025-84/+96
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342678
* rtwn_pci(4): add support for event-based Tx reports.Andriy Voskoboinyk2019-01-0215-109/+149
| | | | | | | | | It will be used for RTL8188EE (and, probably, others). MFC after: 4 days Notes: svn path=/head/; revision=342677
* rtwn_pci(4): use proper bus_dmamap_sync flags after Tx (sync with r342672)Andriy Voskoboinyk2019-01-021-1/+2
| | | | | | | MFC after: 4 days Notes: svn path=/head/; revision=342676
* rtwn(4): drop obsolete comment + use 'nop' function for 92eu calibrationAndriy Voskoboinyk2019-01-022-2/+2
| | | | | | | | | RTL8192EU was not tested with previously added code. MFC after: 4 days Notes: svn path=/head/; revision=342675
* rtwn(4): add IQ calibration support for RTL8188E*Andriy Voskoboinyk2019-01-022-2/+330
| | | | | | | | | | | Tested with: * RTL8188EE, STA mode. * RTL8188EU, STA mode. MFC after: 4 days Notes: svn path=/head/; revision=342674
* rtwn(4): provide register definitions for RTL8188CE calibration routines.Andriy Voskoboinyk2019-01-022-26/+48
| | | | | | | | | No functional change intended. MFC after: 4 days Notes: svn path=/head/; revision=342673
* rtwn_pci: fix excessive packet loss on Tx with RTL8188EE.Andriy Voskoboinyk2019-01-011-2/+2
| | | | | | | | | | | Use proper flags for bus_dmamap_sync() in Tx path. Tested with: RTL8188EE, STA mode MFC after: 4 days Notes: svn path=/head/; revision=342672
* Add revision number for TP-Link TL-WN722N to prevent ambiguity betweenAndriy Voskoboinyk2018-12-171-1/+1
| | | | | | | | | | different chipsets. MFC after: 3 days X-MFC with: 341786 Notes: svn path=/head/; revision=342156
* Add new USB id in rtwn_usb(4) (RTL8812AU)Andriy Voskoboinyk2018-12-151-0/+1
| | | | | | | | | PR: 234029 Submitted by: <hakotani000@gmail.com> MFC after: 4 days Notes: svn path=/head/; revision=342124
* rtwn, rsu: add more USB ids.Andriy Voskoboinyk2018-12-101-0/+1
| | | | | | | | | PR: 233638 Submitted by: cezary.sliwa@gmail.com MFC after: 3 days Notes: svn path=/head/; revision=341786
* rtwn(4): decode some bit fields + merge duplicate code.Andriy Voskoboinyk2018-06-196-23/+35
| | | | | | | | | | Add macros for R12A_RXDMA_PRO register (descriptions were seen in the RTL8822B vendor driver) and merge 2 r21au_init_burstlen() copies. No functional change intended. Notes: svn path=/head/; revision=335351
* ifnet: Replace if_addr_lock rwlock with epoch + mutexMatt Macy2018-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Run on LLNW canaries and tested by pho@ gallatin: Using a 14-core, 28-HTT single socket E5-2697 v3 with a 40GbE MLX5 based ConnectX 4-LX NIC, I see an almost 12% improvement in received packet rate, and a larger improvement in bytes delivered all the way to userspace. When the host receiving 64 streams of netperf -H $DUT -t UDP_STREAM -- -m 1, I see, using nstat -I mce0 1 before the patch: InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 4.98 0.00 4.42 0.00 4235592 33 83.80 4720653 2149771 1235 247.32 4.73 0.00 4.20 0.00 4025260 33 82.99 4724900 2139833 1204 247.32 4.72 0.00 4.20 0.00 4035252 33 82.14 4719162 2132023 1264 247.32 4.71 0.00 4.21 0.00 4073206 33 83.68 4744973 2123317 1347 247.32 4.72 0.00 4.21 0.00 4061118 33 80.82 4713615 2188091 1490 247.32 4.72 0.00 4.21 0.00 4051675 33 85.29 4727399 2109011 1205 247.32 4.73 0.00 4.21 0.00 4039056 33 84.65 4724735 2102603 1053 247.32 After the patch InMpps OMpps InGbs OGbs err TCP Est %CPU syscalls csw irq GBfree 5.43 0.00 4.20 0.00 3313143 33 84.96 5434214 1900162 2656 245.51 5.43 0.00 4.20 0.00 3308527 33 85.24 5439695 1809382 2521 245.51 5.42 0.00 4.19 0.00 3316778 33 87.54 5416028 1805835 2256 245.51 5.42 0.00 4.19 0.00 3317673 33 90.44 5426044 1763056 2332 245.51 5.42 0.00 4.19 0.00 3314839 33 88.11 5435732 1792218 2499 245.52 5.44 0.00 4.19 0.00 3293228 33 91.84 5426301 1668597 2121 245.52 Similarly, netperf reports 230Mb/s before the patch, and 270Mb/s after the patch Reviewed by: gallatin Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15366 Notes: svn path=/head/; revision=333813
* rtwn(4): de-hardcode ('h/w rate index' - 'corresponding MCS index') constantAndriy Voskoboinyk2018-03-164-7/+12
| | | | Notes: svn path=/head/; revision=331043
* rtwn(4): reset Tx power values before calling get_txpower()Andriy Voskoboinyk2018-03-102-3/+1
| | | | | | | for RTL8192C / RTL8188E (like it is done for other chipsets). Notes: svn path=/head/; revision=330750
* [net80211] convert all of the WME use over to a temporary copy of WME info.Adrian Chadd2018-01-021-2/+4
| | | | | | | | | | | | | | | | | | | | This removes the direct WME info access in the ieee80211com struct and instead provides a method of fetching the data. Right now it's a no-op but eventually it'll turn into a per-VAP method for drivers that support it (eg iwn, iwm, upcoming ath10k work) as things like p2p support require this kind of behaviour. Tested: * ath(4), STA and AP mode TODO: * yes, this is slightly stack size-y, but it is an important first step to get drivers migrated over to a sensible WME API. A lot of per-phy things need to be converted to per-VAP before P2P, 11ac firmware, etc stuff shows up. Notes: svn path=/head/; revision=327479
* Add support for RealTek 8812 over USBGeorge V. Neville-Neil2017-12-031-0/+1
| | | | | | | | | Tested with ALFA AWUS036ACH MFC after: 1 week Notes: svn path=/head/; revision=326503
* rtwn_usb(4): add few USB IDs.Andriy Voskoboinyk2017-10-301-0/+2
| | | | | | | Submitted by: wfpower@yandex.ru (via github). Notes: svn path=/head/; revision=325137
* rtwn(4): some initial preparations for (basic) VHT support.Andriy Voskoboinyk2017-08-2812-58/+58
| | | | | | | | | | Rename RTWN_RIDX_MCS to RTWN_RIDX_HT_MCS before adding 802.11ac MCS rate indexes (they have different offset). No functional change intended. Notes: svn path=/head/; revision=322988