summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/rtw.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Make wireless drivers call if_input() only once per interrupt.stsp2019-09-121-2/+4
| | | | | | | | | | | | | | This reduces drops caused by the ifq pressure drop mechanism and hence increases throughput. Such drops are visible with e.g. 'netstat -dnI iwm0'. Not all affected drivers have been tested yet but these changes are largely mechanical and should be safe. As usual, please report any regressions. With help from dlg@ and mpi@ Problem found by robert@ Tested by robert, jmc, Tracey Emer, Matthias Schmidt, florian, Björn Ketelaars ok mpi@
* Use ieee80211_has_addr4() inline function where possible.kevlo2017-09-221-2/+2
| | | | ok stsp@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-081-2/+1
|
* A pile of sizes to free(9). In test for a few days in snapshots.deraadt2017-04-081-3/+3
| | | | | Errors will result in nice clean panic messages so we know what's wrong. Reviewed by dhill visa natano jsg.
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-2/+1
| | | | | | | this means packets are consistently counted in one place, unlike the many and various ways that drivers thought they should do it. ok mpi@ deraadt@
* G/C IFQ_SET_READY().mpi2016-04-131-2/+1
|
* No trailers has been the default and only option for 20 years, yet sometedu2015-12-081-3/+2
| | | | | | | drivers still set IFF_NOTRAILERS while others do not. Remove all usage of the flag from the drivers which in ancient times used it (and the modern drivers which blindly copied it from those drivers of yore). suggested by guenther. ok mpi
* replace IFF_OACTIVE manipulation with mpsafe operations.dlg2015-11-251-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | there are two things shared between the network stack and drivers in the send path: the send queue and the IFF_OACTIVE flag. the send queue is now protected by a mutex. this diff makes the oactive functionality mpsafe too. IFF_OACTIVE is part of if_flags. there are two problems with that. firstly, if_flags is a short and we dont have any MI atomic operations to manipulate a short. secondly, while we could make the IFF_OACTIVE operates mpsafe, all changes to other flags would have to be made safe at the same time, otherwise a read-modify-write cycle on their updates could clobber the oactive change. instead, this moves the oactive mark into struct ifqueue and provides an API for changing it. there's ifq_set_oactive, ifq_clr_oactive, and ifq_is_oactive. these are modelled on ifsq_set_oactive, ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd. this diff includes changes to all the drivers manipulating IFF_OACTIVE to now use the ifsq_{set,clr_is}_oactive API too. ok kettenis@ mpi@ jmatthew@ deraadt@
* shuffle struct ifqueue so in flight mbufs are protected by a mutex.dlg2015-11-201-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the code is refactored so the IFQ macros call newly implemented ifq functions. the ifq code is split so each discipline (priq and hfsc in our case) is an opaque set of operations that the common ifq code can call. the common code does the locking, accounting (ifq_len manipulation), and freeing of the mbuf if the disciplines enqueue function rejects it. theyre kind of like bufqs in the block layer with their fifo and nscan disciplines. the new api also supports atomic switching of disciplines at runtime. the hfsc setup in pf_ioctl.c has been tweaked to build a complete hfsc_if structure which it attaches to the send queue in a single operation, rather than attaching to the interface up front and building up a list of queues. the send queue is now mutexed, which raises the expectation that packets can be enqueued or purged on one cpu while another cpu is dequeueing them in a driver for transmission. a lot of drivers use IFQ_POLL to peek at an mbuf and attempt to fit it on the ring before committing to it with a later IFQ_DEQUEUE operation. if the mbuf gets freed in between the POLL and DEQUEUE operations, fireworks will ensue. to avoid this, the ifq api introduces ifq_deq_begin, ifq_deq_rollback, and ifq_deq_commit. ifq_deq_begin allows a driver to take the ifq mutex and get a reference to the mbuf they wish to try and tx. if there's space, they can ifq_deq_commit it to remove the mbuf and release the mutex. if there's no space, ifq_deq_rollback simply releases the mutex. this api was developed to make updating the drivers using IFQ_POLL easy, instead of having to do significant semantic changes to avoid POLL that we cannot test on all the hardware. the common code has been tested pretty hard, and all the driver modifications are straightforward except for de(4). if that breaks it can be dealt with later. ok mpi@ jmatthew@
* replace the ifqueues in net80211 with mbuf_queues.dlg2015-11-041-6/+6
| | | | | | | | the specific queues are ic_mgtq, ic_pwrsaveq, and ni_savedq. rtw had its own queue for beacons. tested by mpi@ and jmc@ ok mpi@
* arp_ifinit() is no longer needed.mpi2015-10-251-6/+1
|
* Wireless drivers call if_input() via ieee80211_input() which set `rcvif'mpi2015-02-101-2/+1
| | | | | | | on every received mbuf, so there's no need to initialize this pointer in the drivers. Tested by and ok phessler@
* unifdef INETtedu2014-12-221-5/+1
|
* Use <sys/endian.h> instead of <machine/endian.h>guenther2014-12-191-2/+2
| | | | ok dlg@ mpi@ bcook@ millert@ miod@
* Some reallocarray() use; review Jean-Philippe Ouellet, patrick keshishianderaadt2014-07-131-2/+2
| | | | ok tedu
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-4/+4
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-3/+1
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Stop abusing the rcvif pointer to pass wireless nodes down to thempi2014-03-191-4/+3
| | | | | | | | | | driver start routines. Instead add & use a pointer in the pkthdr since we don't want the overhead of using a mbuf_tags(9). claudio@ pointed out that other subsystems might want to use this pointer too, so here's a new cookie! ok claudio@, mikeb@, deraadt@
* Instead of comparing the lower and higher addresses of all the multicastmpi2013-11-261-10/+6
| | | | | | | | | | | entries to decide if the IFF_ALLMULTI flag should be set, check if there is at least one real range between them. This should not change the behavior of any driver but if you encounter any problem, feel free to revert the offending chunk and ping me about it. ok naddy@, dlg@
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-051-2/+1
| | | | ok guenther millert kettenis
* remove the powerhook code. All architectures now use the ca_activate treederaadt2010-09-071-36/+1
| | | | | traversal code to suspend/resume ok oga kettenis blambert
* Massage the powerhook functions into activate functions, and then callderaadt2010-08-291-18/+21
| | | | | | them from the powerhook. Fix a few quibbles about the things done for the IFF_RUNNING and IFF_UP cases ok kettenis
* kill PWR_STANDBY (apm can use PWR_SUSPEND instead). While here, renumberderaadt2010-08-271-4/+1
| | | | | | | PWR_{SUSPEND,RESUME} so that they match the values of DAVCT_{SUSPEND,RESUME} so that we can eventually (many more steps...) kill the powerhook garbage and use the activate mechanism. no objections
* kill hooks and timeouts before calling complex sleeping code from detach; ok jsgderaadt2009-11-241-3/+4
|
* remove use of BITS and BIT macrosjsg2009-08-161-7/+7
|
* tweak a switch statement to appease lintjsg2009-08-161-2/+2
|
* More cases of shutdown hooks not needed after card is already stopped. Inderaadt2009-08-101-21/+1
| | | | | | these cases the xxstop function is a bit more complicated and has a flag of some sort, but the use of that flag does not matter; DMA is already ceased ok dlg
* timeout_add -> timeout_add_msecblambert2009-07-281-5/+5
| | | | ok jsg@
* make various strings ("can't map mem space" and similar) more consistentsthen2009-03-291-2/+2
| | | | | | | between instances, saving space in the kernel. feedback from many (some incorporated, some left for future work). ok deraadt, kettenis, "why not" miod.
* Replace timeout_add(msecs * hz / 1000) with timeout_add_msec(msecs).grange2009-01-211-2/+2
| | | | | | No functional changes. ok krw@ miod@
* Eliminate the redundant bits of code for MTU and multicast handlingbrad2008-11-281-10/+7
| | | | | | | | | | | | | | from the individual drivers now that ether_ioctl() handles this. Shrinks the i386 kernels by.. RAMDISK - 2176 bytes RAMDISKB - 1504 bytes RAMDISKC - 736 bytes Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users. Build tested on almost all archs by todd@/brad@ ok naddy@
* fix IEEE80211_RADIOTAP_F_SHORTPREdamien2008-08-271-3/+3
|
* introduce new IEEE80211_STA_ONLY kernel option that can be set todamien2008-08-271-5/+28
| | | | | | | | | remove IBSS and HostAP support from net80211 and 802.11 drivers. it can be used to shrink RAMDISK kernels for instance (like what was done for wi(4)). it also has the benefit of highlighting what is specific to IBSS and HostAP modes in the code. the cost is that we now have two code paths to maintain.
* in ieee80211_input(), call if_start() after enqueuing frames in if_snddamien2008-08-141-9/+1
| | | | | | | when acting as an access point instead of having each driver doing the job. tested by krw@ (ral AP) and me with several drivers.
* instead of passing rx tstamp and rssi to the ieee80211_input function,damien2008-07-211-7/+10
| | | | | | | pass a pointer to an ieee80211_rxinfo structure containing those two fields plus an extra flags field that indicates whether the frame was decrypted by hardware or not. required for a future fix.
* Kernel implementation of the 4-way handshake and group-keydamien2008-04-161-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | handshake protocols (both supplicant and authenticator state machines) as defined in the IEEE 802.11i standard. Software implementation of the TKIP (Temporal Key Integrity Protocol) and CCMP (CTR with CBC-MAC Protocol) protocols. This diff doesn't implement any of the 802.1X authentication protocols and thus only PSK authentication (using pre-shared keys) is currently supported. In concrete terms, this adds support for WPA-PSK and WPA2-PSK protocols, both in station and hostap modes. The following drivers are marked as WPA-capable and should work: bwi(4), malo(4), ral(4), iwn(4), wpi(4), ural(4), rum(4), upgt(4), and zyd(4) The following options have been added to ifconfig(8): wpa, wpapsk, wpaprotos, wpaakms, wpaciphers, wpagroupcipher wpa-psk(8) can be used to generate keys from passphrases. tested by many@ ok deraadt@
* Remove superfluous function declarationblambert2007-11-211-2/+1
| | | | ok jsg@
* Unconditionally initialize all channels, regardless of locale.blambert2007-10-241-49/+7
| | | | | | Shaves 258 bytes from i386 kernel. Feedback, guidance, testing, and ok jsg@
* s/NPBFILTER/NBPFILTER/ in #endif comment. No functional change.kettenis2007-09-301-3/+3
|
* Only the most obvious bzero() -> M_ZERO changes. No cast changes, nokrw2007-09-171-4/+2
| | | | | MALLOC/FREE, etc. Just adding M_ZERO to malloc() and deleting an immediately adjacent bzero().
* move ieee80211_compute_duration() and ieee80211_compute_duration1()damien2007-06-071-3/+172
| | | | | | | | | | functions into the two drivers that use them (atw and rtw.) this code is not generic enough to be used by other drivers and there is no chance that it will ever be used in newer driver since it supports 802.11b only. plus, it hurts my eyes each time i look into ieee80211_output.c. "fine with me as long as the logic doesn't change in the functions" jsg@
* Correct order of bus_space_barrier() parameters.jsg2007-04-061-2/+2
| | | | From brad
* Similar to other drivers call if_start() at the end of the rx interrupt becauseclaudio2007-04-021-1/+9
| | | | | ieee80211_input() may enqueue packets. OK jsg@
* remove some unused goopjsg2007-02-141-18/+3
|
* M_DUP_PKTHDR() cleanup. On static buffers M_DUP_PKTHDR() will leak mbuf tags.claudio2007-01-031-5/+7
| | | | See similar rum(4) commit for more info. OK mglocker@
* Make use of ieee80211_std_ratesetjsg2006-11-261-10/+3
|
* Return from channel tuning code if we get IEEE80211_CHAN_ANYjsg2006-08-301-3/+3
| | | | | | | | | | as per other drivers instead of doing panics. Should workaround PR 5206 which I could never manage to reproduce, though we really shouldn't be getting IEEE80211_CHAN_ANY here. ok deraadt@
* allow bpf(4) to ignore packets based on their direction (inbound ordjm2006-03-251-5/+6
| | | | | outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
* Add a fix from David Young to not set the ring indexes to somethingjsg2006-02-051-3/+3
| | | | obviously invalid, which can occur when ejecting a CardBus rtw.
* rev 1.59 & 1.60 of rtw.c commited by David Young to NetBSD:jsg2006-01-051-5/+4
| | | | | | | | On a transmit FIFO overflow (err, actually an underflow...) reset both the transmit & receive sections of the MAC. Fix comments and debug printfs: Tx FIFOs underflow, they don't overflow.