summaryrefslogtreecommitdiff
path: root/sys/dev/ipw
AgeCommit message (Collapse)Author
2025-09-19net80211: convert the rest of the native net80211 drivers to SEQNO_OFFLOADAdrian Chadd
* Convert the rest of the drivers to implement driver/offloaded sequence number handling. * For drivers that implement their own sequence number space handling for A-MPDU, only call ieee80211_output_seqno_assign() if the frame isn't tagged with M_AMPDU_MPDU, which mirrors the original net80211 sequence number behaviour. (Except of course, the assignment is now happening during final encap/transmit, not early in encap.) Locally tested (sta mode): * ath * iwn * bwi * bwn * iwm * otus * ral Differential Revision: https://reviews.freebsd.org/D50772 Okayed by: bz
2025-02-26sys: convert ni->ni_txrate references use to the new net80211 APIAdrian Chadd
This just mechanically converts things. * For linuxkpi, it was just used for display. * For uath, it was just used for display, as firmware doesn't report it up. Differential Revision: https://reviews.freebsd.org/D48602 Reviewed by: bz, thj
2024-11-17net80211: migrate FC0_TYPE_MASK / FC0_SUBTYPE_MASK frame type checks to macrosAdrian Chadd
* Add macros for the management and control frame type checks that I've come across in the drivers. * Delete some now old code (eg ath's ieee80211_is_action()) as there's now a macro for it. Local testing: * not yet, I have a lot of wifi devices to find and test against Differential Revision: https://reviews.freebsd.org/D47500
2023-12-01Revert "Widen EPOCH(9) usage in PCI WLAN drivers."Bjoern A. Zeeb
This reverts commit b65f813c1ab99448278961c5ca80dc422b1eae29. As a side effect this also seems to fix wtap which seems to have lost the epoch over the input path in between. Sponsored by: The FreeBSD Foundation MFC after: 3 days
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: one-line .c comment patternWarner Losh
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
2022-12-21DrvAPI: Trivial mechanical conversions for various driversJustin Hibbits
Mechanically convert the following drivers, with trivial changes: * ipw(4) * igc(4) * enetc(4) * malo(4) * nfe(4) * bxe(4) * awg(4) * otus(4) * rtwn(4) * bnxt(4) * ath(4) Sponsored by: Juniper Networks, Inc.
2022-05-06ipw: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
2020-01-30Widen EPOCH(9) usage in PCI WLAN drivers.Hans Petter Selasky
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
2019-03-11Fix ieee80211_radiotap(9) usage in wireless drivers:Andriy Voskoboinyk
- 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
2019-01-31ipw(4): reuse ieee80211_tx_complete functionAndriy Voskoboinyk
This should partially fix 'netstat -b -I wlan0' output MFC after: 1 week Notes: svn path=/head/; revision=343603
2018-10-23Fix ipw_start(), where logic was reverted in r287197.Gleb Smirnoff
PR: 232554 Submitted by: gl00my@mail.ru Notes: svn path=/head/; revision=339643
2018-09-26Reapply, with minor tweaks, r338025, from the original commit:Warner Losh
Remove unused and easy to misuse PNP macro parameter Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Approved by: re (glen) Notes: svn path=/head/; revision=338948
2018-08-19Back out r338035 until Warner is finished churning GSoC PNP patchesConrad Meyer
I was not aware Warner was making or planning to make forward progress in this area and have since been informed of that. It's easy to apply/reapply when churn dies down. Notes: svn path=/head/; revision=338037
2018-08-19Remove unused and easy to misuse PNP macro parameterConrad Meyer
Inspired by r338025, just remove the element size parameter to the MODULE_PNP_INFO macro entirely. The 'table' parameter is now required to have correct pointer (or array) type. Since all invocations of the macro already had this property and the emitted PNP data continues to include the element size, there is no functional change. Mostly done with the coccinelle 'spatch' tool: $ cat modpnpsize0.cocci @normaltables@ identifier b,c; expression a,d,e; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,d, -sizeof(d[0]), e); @singletons@ identifier b,c,d; expression a; declarer MODULE_PNP_INFO; @@ MODULE_PNP_INFO(a,b,c,&d, -sizeof(d), 1); $ rg -l MODULE_PNP_INFO -- sys | \ xargs spatch --in-place --sp-file modpnpsize0.cocci (Note that coccinelle invokes diff(1) via a PATH search and expects diff to tolerate the -B flag, which BSD diff does not. So I had to link gdiff into PATH as diff to use spatch.) Tinderbox'd (-DMAKE_JUST_KERNELS). Notes: svn path=/head/; revision=338035
2018-07-08Add PNP info to PCI attachment of ipw driverWarner Losh
Reviewed by: imp, chuck Submitted by: Lakhan Shiva Kamireddy <lakhanshiva@gmail.com> Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15979 Notes: svn path=/head/; revision=336109
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
2016-05-19ipw: switch to ieee80211_add_channel()Andriy Voskoboinyk
- Convert to ieee80211_add_channel(). - Add ic_getradiocaps() method. Differential Revision: https://reviews.freebsd.org/D6236 Notes: svn path=/head/; revision=300239
2015-09-22net80211 & wireless drivers: remove duplicate defines (noop)Adrian Chadd
* IEEE80211_DIR_DSTODS(wh) -> IEEE80211_IS_DSTODS(wh). * N(a) -> nitems(a). * Remove LE_READ_2(p)/LE_READ_4(p) definitions (and include ieee80211_input.h instead). * <drvname>_TXOP_TO_US(txop) -> IEEE80211_TXOP_TO_US(txop). * Put IEEE80211_RV(v) into ieee80211_proto.h and remove local RV(v) definitions. Submitted by: Andriy Voskoboinyk <s3erios@gmail.com> Differential Revision: https://reviews.freebsd.org/D3705 Notes: svn path=/head/; revision=288087
2015-08-27Replay r286410. Change KPI of how device drivers that provide wirelessGleb Smirnoff
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
2015-08-17Convert more ifp->if_softc -> ic->ic_softc.Adrian Chadd
These should be a big no-op. Tested: * make universe Notes: svn path=/head/; revision=286865
2015-08-08Revert the wifi ifnet changes until things are more baked and tested.Adrian Chadd
* 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
2015-08-07Change KPI of how device drivers that provide wireless connectivity interactGleb Smirnoff
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
2015-05-25Set ic_softc in all 802.11 drivers. Not required right now, but will beGleb Smirnoff
used quite soon. Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=283537
2015-05-25Don't compare array to NULL.Gleb Smirnoff
Found by: clang Notes: svn path=/head/; revision=283528
2015-05-25Make net80211 drivers supply their device name to the net80211 layer, soGleb Smirnoff
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
2014-09-19Mechanically convert to if_inc_counter().Gleb Smirnoff
Notes: svn path=/head/; revision=271849
2014-01-08Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.Kevin Lo
The origin of WEP comes from IEEE Std 802.11-1997 where it defines whether the frame body of MAC frame has been encrypted using WEP algorithm or not. IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates whether the frame is protected by a cryptographic encapsulation algorithm. Reviewed by: adrian, rpaulo Notes: svn path=/head/; revision=260444
2013-12-29- Probe with BUS_PROBE_DEFAULT instead of 0.Marius Strobl
- Nuke code setting PCI_POWERSTATE_D0; pci(4) already does that for type 0 devices. - Use PCIR_BAR instead of a homegrown macro. - There's no need to keep track of resource IDs. - Quiesce the interrupt before actually detaching. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Nuke dupe $FreeBSD$. MFC after: 1 week Notes: svn path=/head/; revision=260062
2013-10-26The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff
to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h Sponsored by: Netflix Sponsored by: Nginx, Inc. Notes: svn path=/head/; revision=257176
2012-12-04Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff
malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
2012-03-23Use suspend/resume methods provided by net80211. This ensures that theBernhard Schmidt
appropriate state handling takes place, not doing so results in the device doing nothing until manual intervention. Reviewed by: iwasaki Tested by: iwasaki (iwi) MFC after: 4 weeks Notes: svn path=/head/; revision=233387
2012-03-12More conversions of drivers to use the PCI parent DMA tag.Scott Long
Notes: svn path=/head/; revision=232874
2011-12-17Fix some net80211 enum nits:Bernhard Schmidt
- ic_vap_create() uses an ieee80211_opmode argument - ieee80211_rate2media() takes an ieee80211_phymode argument - ieee80211_plcp2rate() takes an ieee80211_phytype argument - cast to enum ieee80211_protmode and ieee80211_roamingmode to silence compiler warnings Submitted by: arundel@ Notes: svn path=/head/; revision=228621
2011-05-31Add module version to iwi/ipw/wpi and iwn.Bernhard Schmidt
The version is used to check if a module is already preset, not setting it results in: can't re-use a leaf (ipw)! module_register: module pci/ipw already exists! Module pci/ipw failed to register: 17 while trying to load the module due to an entry in loader.conf. With this commit we get the expected: module ipw already present! Reported by: Dru Lavigne, bz Tested by: bz MFC after: 1 week Notes: svn path=/head/; revision=222543
2010-05-11Enable 5.5 and 11Mbit TX rates.Bernhard Schmidt
Reviewed by: sam Approved by: rpaulo (mentor) MFC after: 3 days Notes: svn path=/head/; revision=207926
2010-05-03Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev
queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month Notes: svn path=/head/; revision=207554
2010-04-17Remove IPW_LOCK_DECL and fix various LORs.Bernhard Schmidt
Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206767
2010-04-17Use iv_appie_wpa, with this commit WPA works again.Bernhard Schmidt
Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206766
2010-04-17- Make ipw usable again by moving directly into ASSOC state.Bernhard Schmidt
- No need to manually switch to RUN state, assoc response takes care of that. Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206765
2010-04-17Pass correct RSSI to ieee80211_input*().Bernhard Schmidt
Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206764
2010-04-17Fix comment about ipw_assoc and remove some whitespaces; no functionalBernhard Schmidt
changes. Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206763
2009-07-10For ic_opmode switch cases, provide a default label with a printf sayingRui Paulo
this opmode is not supported. Approved by: re (kib) Notes: svn path=/head/; revision=195562
2009-05-20Overhaul monitor mode handling:Sam Leffler
o replace DLT_IEEE802_11 support in net80211 with DLT_IEEE802_11_RADIO and remove explicit bpf support from wireless drivers; drivers now use ieee80211_radiotap_attach to setup shared data structures that hold the radiotap header for each packet tx/rx o remove rx timestamp from the rx path; it was used only by the tdma support for debugging and was mostly useless due to it being 32-bits and mostly unavailable o track DLT_IEEE80211_RADIO bpf attachments and maintain per-vap and per-com state when there are active taps o track the number of monitor mode vaps o use bpf tap and monitor mode vap state to decide when to collect radiotap state and dispatch frames; drivers no longer explicitly directly check bpf state or use bpf calls to tap frames o handle radiotap state updates on channel change in net80211; drivers should not do this (unless they bypass net80211 which is almost always a mistake) o update various drivers to be more consistent/correct in handling radiotap o update ral to include TSF in radiotap'd frames o add promisc mode callback to wi Reviewed by: cbzimmer, rpaulo, thompsa Notes: svn path=/head/; revision=192468
2009-05-10Abort any scan on a fatal firmware. ic_scan_curchan is overridden to performAndrew Thompson
the scan in firmware and this relies on the firmware to wake up the scan task on completion. Notes: svn path=/head/; revision=191956
2009-05-08Drain the tasks before the interface stop call in case a restart was queued.Andrew Thompson
Notes: svn path=/head/; revision=191912
2009-05-02Create a taskqueue for each wireless interface which provides a serialisedAndrew Thompson
sleepable context for net80211 driver callbacks. This removes the need for USB and firmware based drivers to roll their own code to defer the chip programming for state changes, scan requests, channel changes and mcast/promisc updates. When a driver callback completes the hardware state is now guaranteed to have been updated and is in sync with net80211 layer. This nukes around 1300 lines of code from the wireless device drivers making them more readable and less race prone. The net80211 layer has been updated as follows - all state/channel changes are serialised on the taskqueue. - ieee80211_new_state() always queues and can now be called from any context - scanning runs from a single taskq function and executes to completion. driver callbacks are synchronous so the channel, phy mode and rx filters are guaranteed to be set in hardware before probe request frames are transmitted. Help and contributions from Sam Leffler. Reviewed by: sam Notes: svn path=/head/; revision=191746
2009-04-17Drain the driver tasks on the same taskqueue in which they were enqueued.Andrew Thompson
Notes: svn path=/head/; revision=191207