summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/an.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* we don't have to cast to caddr_t when calling m_copydata anymore.dlg2021-02-251-3/+3
| | | | | | | | | | | | | | | | the first cut of this diff was made with coccinelle using this spatch: @rule@ type caddr_t; expression m, off, len, cp; @@ -m_copydata(m, off, len, (caddr_t)cp) +m_copydata(m, off, len, cp) i had fix it's opinionated idea of formatting by hand though, so i'm not sure it was worth it. ok deraadt@ bluhm@
* an(4): tsleep(9) -> tsleep_nsec(9)cheloha2020-12-081-3/+3
| | | | | | | | | | | | | | In an_wait() we spin for up to (3 * hz) iterations awaiting AN_EV_CMD. If we don't see it in a given iteration we block for up to 1 tick and spin again. jsg@ suggests instead blocking for 100ms at a time for up to 30 iterations. Discussed with mpi@. Idea from jsg@. Murmurs of agreement from claudio@ and kettenis@. probably ok jsg@
* Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.patrick2020-07-101-2/+2
| | | | ok dlg@ tobhe@
* Showing kernel WEP keys to userland has been disabled in genericbluhm2019-11-071-17/+5
| | | | | | ieee80211 ioctl(2) implementation. Do the same for the driver specific code of ac(4) and wi(4) wireless network devices. OK mpi@
* Only root is allowed to set the WEP key. Add an suser() check tobluhm2019-11-071-1/+3
| | | | | enforce this for the an(4) wireless network device. found by Ilja Van Sprundel; OK dlg@ deraadt@ mpi@
* Remove almost unused `flags' argument of suser().mpi2018-02-191-2/+2
| | | | | | | The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
* move counting if_opackets next to counting if_obytes in if_enqueue.dlg2017-01-221-4/+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
|
* replace IFF_OACTIVE manipulation with mpsafe operations.dlg2015-11-251-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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@
* You only need <net/if_dl.h> if you're using LLADDR() or a sockaddr_dl.mpi2015-11-241-2/+1
|
* 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-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@
* arp_ifinit() is no longer needed.mpi2015-10-251-11/+2
|
* Don't use uninitialized data as a return value.krw2015-06-211-5/+5
| | | | | | From Brainy via Maxime Villard via tech@. ok kettenis@
* 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
|
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* Fewer <netinet/in_systm.h>mpi2014-07-221-3/+1
|
* 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@
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-051-3/+1
| | | | ok guenther millert kettenis
* remove the unused if_init callback in struct ifnetjsg2010-08-271-2/+1
| | | | ok deraadt@ henning@ claudio@
* More cases of shutdown hooks not needed after card is already stopped. Inderaadt2009-08-101-14/+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
* introduce new IEEE80211_STA_ONLY kernel option that can be set todamien2008-08-271-6/+18
| | | | | | | | | 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.
* instead of passing rx tstamp and rssi to the ieee80211_input function,damien2008-07-211-3/+8
| | | | | | | 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.
* s/NPBFILTER/NBPFILTER/ in #endif comment. No functional change.kettenis2007-09-301-2/+2
|
* 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@
* put the 1.32 change back; tested by manymickey2006-06-251-18/+14
|
* Attach routines can fail before calling *hook_establish(), and theykrw2006-05-221-2/+3
| | | | | | | | often rely on the detach routine for cleanup. So be consistant and careful by checking for a NULL hook before calling *hook_disestablish in detach routines. ok mickey@ brad@ dlg@
* Add support for big endian archs. tested by jaredy@ and ok jsg@kurt2006-04-051-77/+79
|
* allow bpf(4) to ignore packets based on their direction (inbound ordjm2006-03-251-5/+5
| | | | | outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
* remove the colon between "address" and the MAC address.brad2006-03-041-2/+2
|
* Be sure to call shutdownhook_disestablish() as this is a removeable device.jsg2006-02-201-2/+3
| | | | ok mickey@
* Add basic radiotap support. Modelled somewhat afterjsg2006-01-301-1/+56
| | | | | ral and NetBSD wi radiotap. "looks ok" damien@
* Move an(4) to a driver based on the NetBSD one.jsg2006-01-091-1159/+1183
| | | | | | | | | | This brings net80211 support and support for newer hardware. In addition ancontrol is no longer needed. This driver does not yet work on big endian archs like the previous one did. "do it" deraadt@
* splimp -> splnetbrad2005-11-091-4/+4
|
* dont' -> don't in comments;jmc2005-10-251-2/+2
| | | | from ray lai;
* Replace arpcom in the softc with ieee80211com in preparation forjsg2005-06-201-31/+28
| | | | further net80211 changes. ok mickey@
* - fix and update commentsbrad2005-04-241-12/+9
| | | | | | | | | - use ETHERTYPE_IP instead of magic value - saanp -> type_ipv4 From FreeBSD ok mickey@
* fix setting 128bit WEP keys on BIG_ENDIAN arches.kurt2005-02-041-3/+3
|
* don't need to set ifp->if_mtu or ifp->if_output in each driver,brad2004-09-231-2/+1
| | | | | | {ether,atm,fddi}_ifattach already does this. ok mcbride@ markus@ henning@
* use ETHER_MAX_LEN.brad2004-08-051-2/+2
| | | | ok mickey@
* Remove forgotten debug code which does not compile on alpha.miod2004-08-051-2/+1
|
* allocate a cluster on rx after all possible failures had been checked for; repair sigcache misalignmentmickey2004-08-051-35/+27
|
* provide proper ip header alignment (and repair big endian archs again from after ether_input_mbuf conversion); also kill some stupid spacesmickey2004-07-241-13/+12
|
* typos from Tom Cosgrove;jmc2003-10-211-2/+2
| | | | | | | | Tom: I did not commit a couple of your changes. i did not include some punctuation fixes (full stops, etc.) mnemorable -> mnemonic: i decided memorable was probably better instrunctions -> instruction: i kept the plural
* from freebsd: read one word less (for type) and take care of odd sized recordsmickey2003-10-051-4/+7
|
* reading the record skip the remainder of data we do not need. we are still screwed on writes thoughmickey2003-09-261-12/+10
|
* make sure to not overflow when initializing {node,net}name (truncation does not matter)mickey2003-09-251-6/+6
|
* revert safety checks; requested by mickey@avsm2003-09-231-7/+1
|
* Put in a couple of sanity checks to ensure that the AN_DEFAULT_*avsm2003-09-191-1/+7
| | | | | variables arent defined too large. itojun@ ok