aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/wpi
Commit message (Collapse)AuthorAgeFilesLines
* wpi: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-5/+0
| | | | Notes: svn path=/head/; revision=365130
* Widen EPOCH(9) usage in PCI WLAN drivers.Hans Petter Selasky2020-01-301-0/+3
| | | | | | | | | | | | | | 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
* Fix ieee80211_radiotap(9) usage in wireless drivers:Andriy Voskoboinyk2019-03-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | - 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] 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
* net80211 drivers: fix rate setup for EAPOL frames, obtain Tx parametersAndriy Voskoboinyk2017-02-261-9/+4
| | | | | | | | | | | | | | | | | | | | | | directly from the node. - Use ni_txparms directly instead of calculating them manually every time - Move M_EAPOL flag check upper; otherwise it may be skipped due to 'ucastrate' / 'mcastrate' check - Use 'mgtrate' for control frames too (see ifconfig(8), mgtrate parameter) - Add few more M_EAPOL checks where it was missing (zyd(4), ural(4), urtw(4)) - Few unrelated cleanups Tested with: - Intel 6205 (iwn(4)), STA mode; - WUSB54GC (rum(4)), HOSTAP mode + RTL8188EU (rtwn(4)), STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D9811 Notes: svn path=/head/; revision=314315
* wpi: restore frame header before submitting an mbuf toAndriy Voskoboinyk2016-10-082-1/+10
| | | | | | | | | | | | ieee80211_tx_complete() This change allows to pass packet length to rate control modules and fixes IFCOUNTER_OBYTES calculation. Tested with Intel 3945BG, STA mode. Notes: svn path=/head/; revision=306878
* net80211: ieee80211_ratectl*: switch to reusable KPIAndriy Voskoboinyk2016-10-022-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace various void * / int argument combinations with common structures: - ieee80211_ratectl_tx_status for *_tx_complete(); - ieee80211_ratectl_tx_stats for *_tx_update(); While here, improve amrr_tx_update() for a bit: 1. In case, if receiver is not known (typical for Ralink USB drivers), refresh Tx rate for all nodes on the interface. 2. There was a misuse: - otus(4) sends non-decreasing counters (as originally intended); - but ural(4), rum(4) and run(4) are using 'read & clear' registers to obtain statistics for some period of time (and those 'last period' values are used as arguments for tx_update()). If arguments are not big enough, they are just discarded after the next call. Fix: move counting into *_tx_update() (now otus(4) will zero out all node counters after every tx_update() call) Tested with: - Intel 3945BG (wpi(4)), STA mode. - WUSB54GC (rum(4)), STA / HOSTAP mode. - RTL8188EU (urtwn(4)), STA mode. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D8037 Notes: svn path=/head/; revision=306591
* sys: Make use of our rounddown() macro when sys/param.h is available.Pedro F. Giffuni2016-04-301-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298848
* wpi: convert to ieee80211_add_channel() (mostly noop).Andriy Voskoboinyk2016-04-291-33/+16
| | | | | | | Tested with Intel 3945BG, STA / HOSTAP modes. Notes: svn path=/head/; revision=298822
* wpi: remove unused variable.Andriy Voskoboinyk2016-04-291-2/+0
| | | | Notes: svn path=/head/; revision=298815
* wpi, iwn: fix check in find_eeprom_channel()Andriy Voskoboinyk2016-04-031-1/+2
| | | | | | | | Return correct eeprom_chan structure pointer for 7, 8, 11 and 12 5Ghz channels. Notes: svn path=/head/; revision=297524
* wpi: remove internal taskqueueAndriy Voskoboinyk2016-03-212-44/+10
| | | | | | | | | | | | - Replace sc_reinittask() by ieee80211_restart_all() (mostly the same). - Revert r282377 (seems to be unneeded now). Tested with Intel 3945BG, STA mode. Differential Revision: https://reviews.freebsd.org/D5056 Notes: svn path=/head/; revision=297173
* wpi, iwn: implement ic_getradiocaps methodAndriy Voskoboinyk2016-01-121-7/+31
| | | | | | | | | | | | | This will allow to restore channel list after switching interface to more restrictive regdomain. Tested with Intel 3945BG (wpi) only. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4863 Notes: svn path=/head/; revision=293716
* wpi, rum and urtwn: update copyright headersAndriy Voskoboinyk2015-12-132-0/+2
| | | | | | | | Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4489 Notes: svn path=/head/; revision=292176
* wpi: ignore ic_update_promisc() call when device is not runningAndriy Voskoboinyk2015-11-301-0/+7
| | | | | | | | | | | | | This change will fix kernel panic with uninitialized (zeroed) RXON structure. Tested with Intel 3945BG, IBSS mode. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4304 Notes: svn path=/head/; revision=291493
* wpi(4): import r289674Andriy Voskoboinyk2015-11-161-4/+4
| | | | | | | | | | | Switch PCI register reads from using magic numbers to using the names defined in pcireg.h Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4185 Notes: svn path=/head/; revision=290950
* Remove BUS_DMA_NOWAIT from bus_dma_tag_create() invocations as it'sKevin Lo2015-10-211-5/+3
| | | | | | | no valid flag there. Notes: svn path=/head/; revision=289679
* net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ↵Adrian Chadd2015-10-121-1/+0
| | | | | | | | | | | | | ieee80211_raw_output(). This doesn't free the mbuf upon error; the driver ic_raw_xmit method is still doing that. Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3774 Notes: svn path=/head/; revision=289165
* wpi(4): add support for TX fragmentation.Adrian Chadd2015-10-123-28/+96
| | | | | | | | | | | Tested: * Tested with Intel 3945BG, HOSTAP and STA modes Differential Revision: https://reviews.freebsd.org/D3770 Notes: svn path=/head/; revision=289163
* wpi(4): do not count failures twice for ic_raw_xmit().Adrian Chadd2015-10-111-10/+3
| | | | | | | | | | | | Tested: * Tested with Intel 3945BG, STA mode Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3768 Notes: svn path=/head/; revision=289129
* wpi(4): move error handling upper (wpi_tx_data()/wpi_cmd2() -> ↵Adrian Chadd2015-10-111-30/+31
| | | | | | | | | | | | | | wpi_raw_xmit()/wpi_transmit()). Tested: * Tested with Intel 3945BG, STA mode Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3767 Notes: svn path=/head/; revision=289128
* wpi(4): fix possible race between TX/RX threads.Adrian Chadd2015-10-111-0/+2
| | | | | | | | | | | | Tested: * Tested with Intel 3945BG, STA mode Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3766 Notes: svn path=/head/; revision=289127
* wpi(4): do not allocate space for unused rings.Adrian Chadd2015-10-112-14/+4
| | | | | | | | | | | | Tested: * Tested with Intel 3945BG, STA mode Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3765 Notes: svn path=/head/; revision=289126
* wpi(4): do not override iv_recv_mgmt() in non-adhoc modes.Adrian Chadd2015-10-111-6/+7
| | | | | | | | | | | | Tested: * Tested with Intel 3945BG, IBSS and STA modes Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3764 Notes: svn path=/head/; revision=289125
* wpi(4): use more correct types.Adrian Chadd2015-10-113-55/+67
| | | | | | | | | | | | This change fixes some amount of -Wsign-conversion and -Wconversion warnings and sets correct sizes for some variables (as a result, some loop counters were touched too). Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3763 Notes: svn path=/head/; revision=289124
* wpi(4): check size before transmitting framesAdrian Chadd2015-10-081-0/+5
| | | | | | | | | | | | | | | In addition to https://bz-attachments.freebsd.org/attachment.cgi?id=156112; fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=144987. Tested: * Tested with Intel 3945BG, STA mode Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3762 Notes: svn path=/head/; revision=289012
* wpi(4): fix some byteorder conversionsAdrian Chadd2015-10-081-2/+3
| | | | | | | | Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3761 Notes: svn path=/head/; revision=289011
* wpi(4): fix 'maybe uninitialized' warningsAdrian Chadd2015-10-081-2/+4
| | | | | | | | Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3760 Notes: svn path=/head/; revision=289010
* wpi(4): add some branch predictions.Adrian Chadd2015-10-081-11/+12
| | | | | | | | Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3759 Notes: svn path=/head/; revision=289008
* wpi(4): drop unnecessary locking in wpi_set_pslevel().Adrian Chadd2015-10-082-10/+10
| | | | | | | | Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3758 Notes: svn path=/head/; revision=289006
* wpi(4): remove software queuesAdrian Chadd2015-10-082-65/+5
| | | | | | | | | | | Use direct dispatch into the destination hardware ring instead of using a staging queue. Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3757 Notes: svn path=/head/; revision=288999
* net80211: drop ieee80211_beacon_offsets parameter from ↵Adrian Chadd2015-10-031-4/+3
| | | | | | | | | | ieee80211_beacon_alloc() and ieee80211_beacon_update() Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3659 Notes: svn path=/head/; revision=288636
* net80211: drop redundant 3rd parameter from iv_key_set().Adrian Chadd2015-10-031-4/+2
| | | | | | | | | | | | The MAC can be fetched from the key struct. I added the ndis updates to make it compile. Submitted by: <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3657 Notes: svn path=/head/; revision=288635
* Don't duplicate checks; net80211 now does this for us.Adrian Chadd2015-09-261-8/+0
| | | | | | | Submitted by: s3erios@gmail.com Notes: svn path=/head/; revision=288263
* net80211: include one copy of struct ieee80211_beacon_offsets into ieee80211vapAdrian Chadd2015-09-222-6/+7
| | | | | | | | Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3658 Notes: svn path=/head/; revision=288095
* Replay r286410. Change KPI of how device drivers that provide wirelessGleb Smirnoff2015-08-272-235/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connectivity interact with the net80211 stack. Historical background: originally wireless devices created an interface, just like Ethernet devices do. Name of an interface matched the name of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI between a device driver and net80211. Details: - The struct ieee80211com is embedded into drivers softc. - Packets are sent via new ic_transmit method, which is very much like the previous if_transmit. - Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state. - Device specific ioctls (if any) are received on new ic_ioctl method. - Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters. Details on interface configuration with new world order: - A sequence of commands needed to bring up wireless DOESN"T change. - /etc/rc.conf parameters DON'T change. - List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl. Most drivers in this change were converted by me, except of wpi(4), that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing changes to at least 8 drivers. Thanks to pluknet@, Oliver Hartmann, Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in testing. Reviewed by: adrian Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=287197
* Convert more ifp->if_softc -> ic->ic_softc.Adrian Chadd2015-08-171-22/+18
| | | | | | | | | | | These should be a big no-op. Tested: * make universe Notes: svn path=/head/; revision=286865
* Revert the wifi ifnet changes until things are more baked and tested.Adrian Chadd2015-08-082-232/+256
| | | | | | | | | | | | * 286410 * 286413 * 286416 The initial commit broke a variety of debug and features that aren't in the GENERIC kernels but are enabled in other platforms. Notes: svn path=/head/; revision=286437
* Change KPI of how device drivers that provide wireless connectivity interactGleb Smirnoff2015-08-072-256/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the net80211 stack. Historical background: originally wireless devices created an interface, just like Ethernet devices do. Name of an interface matched the name of the driver that created. Later, wlan(4) layer was introduced, and the wlanX interfaces become the actual interface, leaving original ones as "a parent interface" of wlanX. Kernelwise, the KPI between net80211 layer and a driver became a mix of methods that pass a pointer to struct ifnet as identifier and methods that pass pointer to struct ieee80211com. From user point of view, the parent interface just hangs on in the ifconfig list, and user can't do anything useful with it. Now, the struct ifnet goes away. The struct ieee80211com is the only KPI between a device driver and net80211. Details: - The struct ieee80211com is embedded into drivers softc. - Packets are sent via new ic_transmit method, which is very much like the previous if_transmit. - Bringing parent up/down is done via new ic_parent method, which notifies driver about any changes: number of wlan(4) interfaces, number of them in promisc or allmulti state. - Device specific ioctls (if any) are received on new ic_ioctl method. - Packets/errors accounting are done by the stack. In certain cases, when driver experiences errors and can not attribute them to any specific interface, driver updates ic_oerrors or ic_ierrors counters. Details on interface configuration with new world order: - A sequence of commands needed to bring up wireless DOESN"T change. - /etc/rc.conf parameters DON'T change. - List of devices that can be used to create wlan(4) interfaces is now provided by net.wlan.devices sysctl. Most drivers in this change were converted by me, except of wpi(4), that was done by Andriy Voskoboinyk. Big thanks to Kevin Lo for testing changes to at least 8 drivers. Thanks to Olivier Cochard, gjb@, mmoll@, op@ and lev@, who also participated in testing. Details here: https://wiki.freebsd.org/projects/ifnet/net80211 Still, drivers: ndis, wtap, mwl, ipw, bwn, wi, upgt, uath were not tested. Changes to mwl, ipw, bwn, wi, upgt are trivial and chances of problems are low. The wtap wasn't compilable even before this change. But the ndis driver is complex, and it is likely to be broken with this commit. Help with testing and debugging it is appreciated. Differential Revision: D2655, D2740 Sponsored by: Nginx, Inc. Sponsored by: Netflix Notes: svn path=/head/; revision=286410
* Change three methods in struct ieee80211com, namely ic_updateslot,Gleb Smirnoff2015-05-251-5/+5
| | | | | | | | | | | ic_update_mcast and ic_update_promisc, to pass pointer to the ieee80211com, not to the ifnet. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=283540
* Set ic_softc in all 802.11 drivers. Not required right now, but will beGleb Smirnoff2015-05-251-0/+1
| | | | | | | | | | used quite soon. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=283537
* Update wpi(4) to use the new mgmt RX API.Adrian Chadd2015-05-252-6/+10
| | | | Notes: svn path=/head/; revision=283536
* Make net80211 drivers supply their device name to the net80211 layer, soGleb Smirnoff2015-05-251-0/+1
| | | | | | | | | | that the latter doesn't need to go through struct ifnet to get their name. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=283527
* [iwn] Do not filter control frames in monitor mode.Adrian Chadd2015-05-031-2/+6
| | | | | | | | PR: kern/197143 Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Notes: svn path=/head/; revision=282402
* Handle properly IBSS merges (works with patch from bug 199632).Adrian Chadd2015-05-032-14/+107
| | | | | | | | PR: kern/197143 Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Notes: svn path=/head/; revision=282401
* Fix various powersave races + optimize tx/rx pointer update when powersave ↵Adrian Chadd2015-05-032-16/+59
| | | | | | | | | | is off. PR: kern/197143 Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Notes: svn path=/head/; revision=282400
* [iwn?] Use correct sequence numbers with non-QoS STAs.Adrian Chadd2015-05-031-0/+4
| | | | | | | | PR: kern/197143 Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Notes: svn path=/head/; revision=282399
* Fix warning about comparison of integers of different signs.Adrian Chadd2015-05-032-4/+4
| | | | | | | | PR: kern/197143 Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Notes: svn path=/head/; revision=282398
* [iwn?] Fix memory leak in wpi_reset_tx_ring().Adrian Chadd2015-05-031-0/+4
| | | | | | | | PR: kern/197143 Differential Revision: Andriy Voskoboinyk <s3erios@gmail.com> Notes: svn path=/head/; revision=282397
* Use nitems() for counting elements in arrays.Adrian Chadd2015-05-031-7/+3
| | | | | | | | PR: kern/197143 Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Notes: svn path=/head/; revision=282396