summaryrefslogtreecommitdiff
path: root/sys/dev/ic/an.c
AgeCommit message (Collapse)Author
2024-04-13correct indentationJonathan Gray
no functional change, found by smatch warnings ok miod@ bluhm@
2022-04-21Use memset() to initialize struct ieee80211_rxinfo properly.Stefan Sperling
Sven Wolf noticed that scans on ral(4) are buggy ever since I added a new field to this struct. Turns out a lot of drivers were initializing fields one-by-one, leaving any newly added fields uninitialized by default. Affected drivers may report wrong channel numbers for received beacons. The net80211 stack will discard such beacons, assuming they were received on the wrong channel due to signal leakage. Scanning is broken as result. ok miod@
2021-02-25we don't have to cast to caddr_t when calling m_copydata anymore.David Gwynne
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@
2020-12-08an(4): tsleep(9) -> tsleep_nsec(9)cheloha
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@
2020-07-10Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.Patrick Wildt
ok dlg@ tobhe@
2019-11-07Showing kernel WEP keys to userland has been disabled in genericAlexander Bluhm
ieee80211 ioctl(2) implementation. Do the same for the driver specific code of ac(4) and wi(4) wireless network devices. OK mpi@
2019-11-07Only root is allowed to set the WEP key. Add an suser() check toAlexander Bluhm
enforce this for the an(4) wireless network device. found by Ilja Van Sprundel; OK dlg@ deraadt@ mpi@
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
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@
2017-01-22move counting if_opackets next to counting if_obytes in if_enqueue.David Gwynne
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@
2016-04-13G/C IFQ_SET_READY().Martin Pieuchot
2015-11-25replace IFF_OACTIVE manipulation with mpsafe operations.David Gwynne
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@
2015-11-24You only need <net/if_dl.h> if you're using LLADDR() or a sockaddr_dl.Martin Pieuchot
2015-11-24The only network driver needing <net/if_types.h> is upl(4) for IFT_OTHER.Martin Pieuchot
2015-11-20shuffle struct ifqueue so in flight mbufs are protected by a mutex.David Gwynne
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@
2015-10-25arp_ifinit() is no longer needed.Martin Pieuchot
2015-06-21Don't use uninitialized data as a return value.Kenneth R Westerback
From Brainy via Maxime Villard via tech@. ok kettenis@
2015-02-10Wireless drivers call if_input() via ieee80211_input() which set `rcvif'Martin Pieuchot
on every received mbuf, so there's no need to initialize this pointer in the drivers. Tested by and ok phessler@
2014-12-22unifdef INETTed Unangst
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-07-22Fewer <netinet/in_systm.h>Martin Pieuchot
2013-08-07Most network drivers include netinet/in_var.h, but apparently theyAlexander Bluhm
don't have to. Just remove these include lines. Compiled on amd64 i386 sparc64; OK henning@ mikeb@
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2010-08-27remove the unused if_init callback in struct ifnetJonathan Gray
ok deraadt@ henning@ claudio@
2009-08-10More cases of shutdown hooks not needed after card is already stopped. InTheo de Raadt
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
2008-08-27introduce new IEEE80211_STA_ONLY kernel option that can be set toDamien Bergamini
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.
2008-07-21instead of passing rx tstamp and rssi to the ieee80211_input function,Damien Bergamini
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.
2007-09-30s/NPBFILTER/NBPFILTER/ in #endif comment. No functional change.Mark Kettenis
2007-01-03M_DUP_PKTHDR() cleanup. On static buffers M_DUP_PKTHDR() will leak mbuf tags.Claudio Jeker
See similar rum(4) commit for more info. OK mglocker@
2006-06-25put the 1.32 change back; tested by manyMichael Shalayeff
2006-05-22Attach routines can fail before calling *hook_establish(), and theyKenneth R Westerback
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@
2006-04-05Add support for big endian archs. tested by jaredy@ and ok jsg@Kurt Miller
2006-03-25allow bpf(4) to ignore packets based on their direction (inbound orDamien Miller
outbound), using a new BIOCSDIRFILT ioctl; guidance, feedback and ok canacar@
2006-03-04remove the colon between "address" and the MAC address.Brad Smith
2006-02-20Be sure to call shutdownhook_disestablish() as this is a removeable device.Jonathan Gray
ok mickey@
2006-01-30Add basic radiotap support. Modelled somewhat afterJonathan Gray
ral and NetBSD wi radiotap. "looks ok" damien@
2006-01-09Move an(4) to a driver based on the NetBSD one.Jonathan Gray
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@
2005-11-09splimp -> splnetBrad Smith
2005-10-25dont' -> don't in comments;Jason McIntyre
from ray lai;
2005-06-20Replace arpcom in the softc with ieee80211com in preparation forJonathan Gray
further net80211 changes. ok mickey@
2005-04-24- fix and update commentsBrad Smith
- use ETHERTYPE_IP instead of magic value - saanp -> type_ipv4 From FreeBSD ok mickey@
2005-02-04fix setting 128bit WEP keys on BIG_ENDIAN arches.Kurt Miller
2004-09-23don't need to set ifp->if_mtu or ifp->if_output in each driver,Brad Smith
{ether,atm,fddi}_ifattach already does this. ok mcbride@ markus@ henning@
2004-08-05use ETHER_MAX_LEN.Brad Smith
ok mickey@
2004-08-05Remove forgotten debug code which does not compile on alpha.Miod Vallat
2004-08-05allocate a cluster on rx after all possible failures had been checked for; ↵Michael Shalayeff
repair sigcache misalignment
2004-07-24provide proper ip header alignment (and repair big endian archs again from ↵Michael Shalayeff
after ether_input_mbuf conversion); also kill some stupid spaces
2003-10-21typos from Tom Cosgrove;Jason McIntyre
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
2003-10-05from freebsd: read one word less (for type) and take care of odd sized recordsMichael Shalayeff
2003-09-26reading the record skip the remainder of data we do not need. we are still ↵Michael Shalayeff
screwed on writes though
2003-09-25make sure to not overflow when initializing {node,net}name (truncation does ↵Michael Shalayeff
not matter)