summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_iwi.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Follow up on jmatthew's suggestion:kevlo2019-04-251-3/+3
| | | | | | | in x_media_change(), return the errno from ieee80211_media_change() and do the error check from x_init(). ok stsp@, jmatthew@, phessler@
* net80211: stub SIOCS80211SCAN, make ifconfig scan instant.pirofti2018-04-261-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following removes the functionality of the SIOCS80211SCAN ioctl. After long discussions with stps@, mpi@, and deraadt@ we decided that this was the correct way of fixing ifconfig scan from blocking the network stack. The kernel will continue scanning in the background and filling the nodes array, but ifconfig scan commands will now basically do just a SIOCG80211ALLNODES and pretty print the array. So the output stays the same but is instant. In fact, when the interface is freshly brought up, if you type fast enough, you can see the array being filled by running multiple ifconfig scans in sequence. The SIOCS80211SCAN ioctl stays for now as wi(4), pgt(4) and malo(4) still need it around. But not for long... Another change that this introduces is the fact that ifconfig scan no longer plays with UP and DOWN. If the interface is down it complains and exits. This is needed in order to maintain the nodes list. Works on iwm(4), iwn(4), urtwn(4), run(4) and athn(4). Tested by mpi@, landry@, florian@, thanks! OK mpi@.
* Move common code to add/remove multicast filters to ieee80211_ioctl(9).mpi2017-10-261-14/+1
| | | | ok jsg@, stsp@
* Fix iwi(4) regressions. WPA was broken since 6.0 errata 018.stsp2017-03-291-1/+5
| | | | | | | Also, the firmware was rejecting RTS frames so iwi(4) didn't work against an OpenBSD athn(4) hostap anymore; fix the config sent to firmware. Prompted by report from bg2200 at jamesjerkinscomputer on misc@ ok deraadt@
* Do not clear IFF_UP, even in the error path, clearing IFF_RUNNINGmpi2017-03-081-3/+1
| | | | | | | | | is enough. This flag should only be set by the stack, drivers shouldn't mess with it. Discussed with dlg@ and mikeb@, ok mikeb@, stsp@
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-3/+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@
* convert busy flag and tsleep to rwlock as in iwmtedu2016-09-051-22/+9
|
* G/C IFQ_SET_READY().mpi2016-04-131-2/+1
|
* replace IFF_OACTIVE manipulation with mpsafe operations.dlg2015-11-251-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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@
* No need to include <net/if_arp.h>mpi2015-11-241-2/+1
| | | | | | | | | This header is only needed because <netinet/if_ether.h> declares a structure that needs it. But it turns out that <net/if.h> already includes it as workaround. A proper solution would be to stop declarting "struct ether_arp" there. But no driver should need this header.
* The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.mpi2015-11-241-2/+1
|
* shuffle struct ifqueue so in flight mbufs are protected by a mutex.dlg2015-11-201-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@
* arp_ifinit() is no longer needed.mpi2015-10-251-5/+1
|
* sizes for free(), mostly related to firmwares.deraadt2015-09-011-3/+3
| | | | ok dlg
* Use m_defrag(9) instead of rolling our own inlined version.kettenis2015-05-271-17/+2
| | | | ok mikeb@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-3/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* 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@
* remove the second void * argument on tasks.dlg2015-01-271-5/+5
| | | | | | | | | | | | | | | | | | | | | when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
* unifdef INETtedu2014-12-221-3/+1
|
* Use <sys/endian.h> instead of <machine/endian.h>guenther2014-12-191-2/+2
| | | | ok dlg@ mpi@ bcook@ millert@ miod@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-2/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* Fewer <netinet/in_systm.h>mpi2014-07-221-3/+1
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-061-6/+6
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* Seems we simply have to live with fatal firmware errors. Even Linux, with itskettenis2013-12-031-11/+18
| | | | | | | | | driver written by Intel engineers occasionally gets them. So when we get one, simply reset the chip, reload the firware and bring the interface up again. Tested by naddy@, who unfortunately is experiencing the quantum zeno effect making his iwi(4) not crap out. ok stsp@
* replace workqs with tasks for handling resumedlg2013-11-141-4/+5
| | | | from kimberley manning
* Use %z* for size_tsf2013-10-011-3/+3
| | | | while there, fix a few %d into %u
* Most network drivers include netinet/in_var.h, but apparently theybluhm2013-08-071-2/+1
| | | | | don't have to. Just remove these include lines. Compiled on amd64 i386 sparc64; OK henning@ mikeb@
* Reset ic_scan_lock in {ipw,iwi}_stop similarly to {wpi,iwn}_stop.damien2010-11-151-1/+4
| | | | From Jeremy Chase.
* remove the powerhook code. All architectures now use the ca_activate treederaadt2010-09-071-10/+1
| | | | | traversal code to suspend/resume ok oga kettenis blambert
* Move the guts of the powerhook function into the activate function and makederaadt2010-08-271-15/+10
| | | | | | it stop calling the powerhook function; then make the powerhook function call activate. This basically inverts the whole goop. ok kettenis
* remove the unused if_init callback in struct ifnetjsg2010-08-271-2/+1
| | | | ok deraadt@ henning@ claudio@
* homogeneous style.damien2010-08-121-4/+4
| | | | no binary change.
* Instead of returning EBUSY when the busy flag is set in the ioctl, sleepoga2010-08-121-3/+9
| | | | | | | | | | | until whoever has it is done with it. This is kept as flag/sleep condvars instead of a rwlock because later we may want to quiesce the handler before suspend to make sure nothing is sleeping on a chip that is about to be whacked (doing so will change the proc so rwlocks won't work). ok damien@
* Bring the suspend/resume code of all the Intel wireless drivers in line withkettenis2010-08-031-3/+17
| | | | | | iwn(4) again. ok deraadt@
* Make legacy xxpower() functions call xxstop() on suspend, and simplify theirderaadt2010-07-281-10/+38
| | | | | | resume paths. For new-style suspend/resume, add a ca_activate function where it is missing, and use a workq to resume because these drivers like to sleep. ok damien
* BUS_DMA_ZERO instead of alloc, map, bzero.oga2010-05-191-6/+3
| | | | ok krw@
* remove proc.h include from uvm_map.h. This has far reaching effects, astedu2010-04-201-2/+1
| | | | | | sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt
* sync setting of the capinfo field of assoc req frames w/ net80211.damien2009-05-111-2/+2
| | | | fixes association with APs that refuse non short slot time capable STAs.
* make various strings ("can't map mem space" and similar) more consistentsthen2009-03-291-9/+9
| | | | | | | between instances, saving space in the kernel. feedback from many (some incorporated, some left for future work). ok deraadt, kettenis, "why not" miod.
* Add some initial HT bits (not enabled yet) based on 802.11n Draft 7.01:damien2009-01-261-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - implement A-MPDU frames buffering and reordering - implement A-MSDU decapsulation - process/send ADDBA Request, ADDBA Response and DELBA action frames - process Block Ack Request control frames (including MTBAR) - implement PBAC support (Protected Block Ack) - add some incomplete HT Capabilities and HT Operation IEs parsing Add more Management Frame Protection bits based on 802.11w Draft 7.0: - implement SA Query procedure (both AP and STA) - cleanup BIP Fix some bugs: - fix check for WEP key length that otherwise caused a stack smash in ieee80211_wep_encrypt (pointed out by Xavier Santolaria on macppc) - properly stop EAPOL timeout: fixes a panic that occured in HostAP mode when turning the interface down while a 4-way handshake is in progress (pointed out by Doughertys) Did some code cleanup too. The HT bits are currently not compiled in (IEEE80211_NO_HT is defined) because they won't be ready until after the next release and I didn't want to grow the kernel or to inadvertently introduce new bugs. They are here such that other people can look at the code. Notice that I had to add an extra parameter to ic_send_mgmt() for action frames, that is why there are small changes in drivers defining their own ic_send_mgmt() handler. Sorry for the not very incremental diff but this has been sitting in my tree for too long now.
* I swapped MGETHDR arguments in my m_defrag removal commit.damien2008-12-221-2/+2
|
* Undo m_defrag().damien2008-12-211-3/+18
| | | | | | | | | | | | | m_defrag() does not work. It seems to assume that if the length of the mbuf passed as parameter is less than MHLEN, then it is an mbuf header and not a cluster (or something like that.) It thus fails miserably in the bcopy path. I don't have the time to investigate further into this. Thanks to Okan Demirmen for reporting the issue on a ral(4) RT2560. The RT2560 chipset does not support TX scatter and thus m_defrag() was called much more often than in other drivers using m_defrag() where it was less noticeable.
* more sizeof->nitemsdamien2008-11-251-2/+2
|
* use shiny new m_defrag() and nitems() instead of rolling our own.damien2008-11-251-20/+2
|
* mostly cosmetic.damien2008-09-041-88/+56
| | | | | also, do not set the privacy bit in the capinfo field of (re)assoc requests, even for RSNA.
* (Re)Association requests should contain a QoS Capability element,damien2008-09-031-4/+4
| | | | not an EDCA Parameter Set element (spotted by IEEE80211_STA_ONLY).
* redefine ic_send_mgmt() as a no-op instead of calling IF_PURGE indamien2008-09-031-6/+15
| | | | | {ipw,iwi}_start which is wrong (node reference is not released). from pgt(4).
* 80 cols.damien2008-08-281-2/+3
| | | | no binary changes.
* WPA support for iwi(4).damien2008-08-281-87/+124
| | | | | some initial WMM bits too. use license.template while i'm here.