aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ipw
Commit message (Collapse)AuthorAgeFilesLines
* Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.Kevin Lo2014-01-081-2/+2
| | | | | | | | | | | | | | 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
* - Probe with BUS_PROBE_DEFAULT instead of 0.Marius Strobl2013-12-292-25/+15
| | | | | | | | | | | | | | | | - 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
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | 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
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-3/+3
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* Use suspend/resume methods provided by net80211. This ensures that theBernhard Schmidt2012-03-231-6/+4
| | | | | | | | | | | | 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
* More conversions of drivers to use the PCI parent DMA tag.Scott Long2012-03-122-7/+24
| | | | Notes: svn path=/head/; revision=232874
* Fix some net80211 enum nits:Bernhard Schmidt2011-12-171-7/+7
| | | | | | | | | | | | | - 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
* Add module version to iwi/ipw/wpi and iwn.Bernhard Schmidt2011-05-311-0/+2
| | | | | | | | | | | | | | | | | | | | | 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
* Enable 5.5 and 11Mbit TX rates.Bernhard Schmidt2010-05-111-3/+3
| | | | | | | | | Reviewed by: sam Approved by: rpaulo (mentor) MFC after: 3 days Notes: svn path=/head/; revision=207926
* Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev2010-05-031-2/+2
| | | | | | | | | | | | | 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
* Remove IPW_LOCK_DECL and fix various LORs.Bernhard Schmidt2010-04-172-22/+16
| | | | | | | Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206767
* Use iv_appie_wpa, with this commit WPA works again.Bernhard Schmidt2010-04-171-2/+2
| | | | | | | Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206766
* - Make ipw usable again by moving directly into ASSOC state.Bernhard Schmidt2010-04-171-1/+7
| | | | | | | | | | - No need to manually switch to RUN state, assoc response takes care of that. Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206765
* Pass correct RSSI to ieee80211_input*().Bernhard Schmidt2010-04-171-2/+2
| | | | | | | Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206764
* Fix comment about ipw_assoc and remove some whitespaces; no functionalBernhard Schmidt2010-04-171-6/+6
| | | | | | | | | changes. Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=206763
* For ic_opmode switch cases, provide a default label with a printf sayingRui Paulo2009-07-101-0/+3
| | | | | | | | | this opmode is not supported. Approved by: re (kib) Notes: svn path=/head/; revision=195562
* Overhaul monitor mode handling:Sam Leffler2009-05-202-32/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Abort any scan on a fatal firmware. ic_scan_curchan is overridden to performAndrew Thompson2009-05-101-0/+3
| | | | | | | | the scan in firmware and this relies on the firmware to wake up the scan task on completion. Notes: svn path=/head/; revision=191956
* Drain the tasks before the interface stop call in case a restart was queued.Andrew Thompson2009-05-081-1/+1
| | | | Notes: svn path=/head/; revision=191912
* Create a taskqueue for each wireless interface which provides a serialisedAndrew Thompson2009-05-022-108/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Drain the driver tasks on the same taskqueue in which they were enqueued.Andrew Thompson2009-04-171-3/+3
| | | | Notes: svn path=/head/; revision=191207
* Hoist 802.11 encapsulation up into net80211:Sam Leffler2009-03-301-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | o call ieee80211_encap in ieee80211_start so frames passed down to drivers are already encapsulated o remove ieee80211_encap calls in drivers o fixup wi so it recreates the 802.3 head it requires from the 802.11 header contents o move fast-frame aggregation from ath to net80211 (conditional on IEEE80211_SUPPORT_SUPERG): - aggregation is now done in ieee80211_start; it is enabled when the packets/sec exceeds ieee80211_ffppsmin (net.wlan.ffppsmin) and frames are held on a staging queue according to ieee80211_ffagemax (net.wlan.ffagemax) to wait for a frame to combine with - drivers must call back to age/flush the staging queue (ath does this on tx done, at swba, and on rx according to the state of the tx queues and/or the contents of the staging queue) - remove fast-frame-related data structures from ath - add ieee80211_ff_node_init and ieee80211_ff_node_cleanup to handle per-node fast-frames state (we reuse 11n tx ampdu state) o change ieee80211_encap calling convention to include an explicit vap so frames coming through a WDS vap are recognized w/o setting M_WDS With these changes any device able to tx/rx 3Kbyte+ frames can use fast-frames. Reviewed by: thompsa, rpaulo, avatar, imp, sephe Notes: svn path=/head/; revision=190579
* Eliminate ic_myaddr so changing the mac address of a device works correctly:Sam Leffler2009-03-291-7/+8
| | | | | | | | | | | | | | o remove ic_myaddr from ieee80211com o change ieee80211_ifattach to take the mac address of the physical device and use that to setup the lladdr. o replace all references to ic_myaddr in drivers by IF_LLADDR o related cleanups (e.g. kill dead code) PR: kern/133178 Reviewed by: thompsa, rpaulo Notes: svn path=/head/; revision=190526
* remove now-redunant cardbus attachment.Warner Losh2009-03-091-1/+0
| | | | Notes: svn path=/head/; revision=189575
* Minor cleanup of vap create work:Sam Leffler2008-05-121-1/+3
| | | | | | | | | | | | | | | | o add IEEE80211_C_STA capability to indicate sta mode is supported (was previously assumed) and mark drivers as capable o add ieee80211_opcap array to map an opmode to the equivalent capability bit o move IEEE80211_C_OPMODE definition to where capabilities are defined so it's clear it should be kept in sync (on future additions) o check device capabilities in clone create before trying to create a vap; this makes driver checks unneeded o make error codes return on failed clone request unique o temporarily add console printfs on clone request failures to aid in debugging; these will move under DIAGNOSTIC or similar before release Notes: svn path=/head/; revision=178957
* Only start the vaps if the init routine completed.Andrew Thompson2008-05-101-1/+2
| | | | Notes: svn path=/head/; revision=178931
* Unify all the wifi *_ioctl routinesAndrew Thompson2008-05-011-7/+9
| | | | | | | | | | | | | | | | | - Limit grabbing the lock to SIOCSIFFLAGS. - Move ieee80211_start_all() to SIOCSIFFLAGS. - Remove SIOCSIFMEDIA as it is not useful. - Limit ether_ioctl to only SIOCGIFADDR. SIOCSIFADDR and SIOCSIFMTU have no affect as there is no input/output path in the vap parent. The vap code will handle the reinit of the mac address changes. - Split off ndis_ioctl_80211 as it was getting too different to wired devices. This fixes a copyout while locked and a lock recursion. Reviewed by: sam Notes: svn path=/head/; revision=178704
* Multi-bss (aka vap) support for 802.11 devices.Sam Leffler2008-04-202-574/+507
| | | | | | | | | | | | | | Note this includes changes to all drivers and moves some device firmware loading to use firmware(9) and a separate module (e.g. ral). Also there no longer are separate wlan_scan* modules; this functionality is now bundled into the wlan module. Supported by: Hobnob and Marvell Reviewed by: many Obtained from: Atheros (some bits) Notes: svn path=/head/; revision=178354
* Plug two potential (root-only, local) information leaks. buf is notPhilip Paeps2007-12-051-4/+4
| | | | | | | | | | | initialized before use and returned integrally instead of up to size. Submitted by: Ilja van Sprundel <ilja -at- netric.org> Reviewed by: secteam MFC after: 1 day Notes: svn path=/head/; revision=174317
* Cast 'data' to 'u_char', as printf() requires this type to be unsigned. ThisWojciech A. Koszek2007-12-041-1/+1
| | | | | | | | | | | | is what gcc3 complains about. Without this change, it's impossible to build the kernel with gcc3. Tested by: cognet@ (mentor) Approved by: cognet@ (mentor) Notes: svn path=/head/; revision=174269
* Remove unneeded debug printf that is broken on 64bit arches.Andrew Thompson2007-10-121-1/+1
| | | | Notes: svn path=/head/; revision=172574
* Update ipw to work with the new net80211 stack, plus other driver improvements.Andrew Thompson2007-10-123-219/+868
| | | | | | | | | | | | | | | | - Add proper scanning support rather than letting the firmware grab the first access point - Overhaul state changes - Use macros for locking and provide _locked() versions of some functions - Increase debugging output - Use a callout rather than the old watchdog interface - Improve style, function names and defines - Add WPA (TKIP) support Based heavily on a patchset provided by Sam Leffler. Notes: svn path=/head/; revision=172567
* o add 802.11 state machine states for DFS and client-side power saveSam Leffler2007-09-051-0/+1
| | | | | | | | | | o fixup drivers to ignore new states Reviewed by: avatar (?) Approved by: re (blanket wireless) Notes: svn path=/head/; revision=172058
* MFp4: Fixing IPW_DEBUG enabled builds by converting the last piece ofTai-hwa Liang2007-07-051-1/+2
| | | | | | | | | | ic->ic_des_essid to ic->ic_des_ssid[0]. Reviewed by: sam Approved by: re (kensmith) Notes: svn path=/head/; revision=171255
* Don't use 64-byte header on each packet in radiotap.Kevin Lo2007-06-291-3/+4
| | | | | | | | Reviewed by: sam Approved by: re(bmah) Notes: svn path=/head/; revision=171086
* Update 802.11 wireless support:Sam Leffler2007-06-111-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o major overhaul of the way channels are handled: channels are now fully enumerated and uniquely identify the operating characteristics; these changes are visible to user applications which require changes o make scanning support independent of the state machine to enable background scanning and roaming o move scanning support into loadable modules based on the operating mode to enable different policies and reduce the memory footprint on systems w/ constrained resources o add background scanning in station mode (no support for adhoc/ibss mode yet) o significantly speedup sta mode scanning with a variety of techniques o add roaming support when background scanning is supported; for now we use a simple algorithm to trigger a roam: we threshold the rssi and tx rate, if either drops too low we try to roam to a new ap o add tx fragmentation support o add first cut at 802.11n support: this code works with forthcoming drivers but is incomplete; it's included now to establish a baseline for other drivers to be developed and for user applications o adjust max_linkhdr et. al. to reflect 802.11 requirements; this eliminates prepending mbufs for traffic generated locally o add support for Atheros protocol extensions; mainly the fast frames encapsulation (note this can be used with any card that can tx+rx large frames correctly) o add sta support for ap's that beacon both WPA1+2 support o change all data types from bsd-style to posix-style o propagate noise floor data from drivers to net80211 and on to user apps o correct various issues in the sta mode state machine related to handling authentication and association failures o enable the addition of sta mode power save support for drivers that need net80211 support (not in this commit) o remove old WI compatibility ioctls (wicontrol is officially dead) o change the data structures returned for get sta info and get scan results so future additions will not break user apps o fixed tx rate is now maintained internally as an ieee rate and not an index into the rate set; this needs to be extended to deal with multi-mode operation o add extended channel specifications to radiotap to enable 11n sniffing Drivers: o ath: add support for bg scanning, tx fragmentation, fast frames, dynamic turbo (lightly tested), 11n (sniffing only and needs new hal) o awi: compile tested only o ndis: lightly tested o ipw: lightly tested o iwi: add support for bg scanning (well tested but may have some rough edges) o ral, ural, rum: add suppoort for bg scanning, calibrate rssi data o wi: lightly tested This work is based on contributions by Atheros, kmacy, sephe, thompsa, mlaier, kevlo, and others. Much of the scanning work was supported by Atheros. The 11n work was supported by Marvell. Notes: svn path=/head/; revision=170530
* Drop the ipw softc lock before calling back into net80211, fixing aLukas Ertl2007-03-241-0/+2
| | | | | | | | | | | LOR/deadlock. Tested by: Denis Shaposhnikov <dsh_AT_vlink.ru>, le@ LOR id: 205 MFC in: 3 days Notes: svn path=/head/; revision=167868
* allow net80211 to fillin rate setsSam Leffler2007-03-111-9/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=167470
* o break newbus api: add a new argument of type driver_filter_t toPaolo Pisati2007-02-231-1/+1
| | | | | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@ Notes: svn path=/head/; revision=166901
* Cleanup and document the implementation of firmware(9) based onLuigi Rizzo2007-02-152-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a version that i posted earlier on the -current mailing list, and subsequent feedback received. The core of the change is just in sys/firmware.h and kern/subr_firmware.c, while other files are just adaptation of the clients to the ABI change (const-ification of some parameters and hiding of internal info, so this is fully compatible at the binary level). In detail: - reduce the amount of information exported to clients in struct firmware, and constify the pointer; - internally, document and simplify the implementation of the various functions, and make sure error conditions are dealt with properly. The diffs are large, but the code is really straightforward now (i hope). Note also that there is a subtle issue with the implementation of firmware_register(): currently, as in the previous version, we just store a reference to the 'imagename' argument, but we should rather copy it because there is no guarantee that this is a static string. I realised this while testing this code, but i prefer to fix it in a later commit -- there is no regression with respect to the past. Note, too, that the version in RELENG_6 has various bugs including missing locks around the module release calls, mishandling of modules loaded by /boot/loader, and so on, so an MFC is absolutely necessary there. I was just postponing it until this cleanup to avoid doing things twice. MFC after: 1 week Notes: svn path=/head/; revision=166756
* Hold on to firmware images until the interface detaches sinceIan Dowse2006-06-102-5/+17
| | | | | | | | | | | | firmware_get() will not work while resuming. Note that we can't simply drop the FIRMWARE_UNLOAD flag, because that will result in a firmware image that can never be unloaded by the user since the firmware subsystem will hold a linker reference to it (it's not clear that firmware_put() without FIRMWARE_UNLOAD ever does quite what you'd want). Notes: svn path=/head/; revision=159487
* add missed calls to bpf_peers_presentSam Leffler2006-06-021-1/+1
| | | | Notes: svn path=/head/; revision=159183
* Fix the following bpf(4) race condition which can result in a panic:Christian S.J. Peron2006-06-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) bpf peer attaches to interface netif0 (2) Packet is received by netif0 (3) ifp->if_bpf pointer is checked and handed off to bpf (4) bpf peer detaches from netif0 resulting in ifp->if_bpf being initialized to NULL. (5) ifp->if_bpf is dereferenced by bpf machinery (6) Kaboom This race condition likely explains the various different kernel panics reported around sending SIGINT to tcpdump or dhclient processes. But really this race can result in kernel panics anywhere you have frequent bpf attach and detach operations with high packet per second load. Summary of changes: - Remove the bpf interface's "driverp" member - When we attach bpf interfaces, we now set the ifp->if_bpf member to the bpf interface structure. Once this is done, ifp->if_bpf should never be NULL. [1] - Introduce bpf_peers_present function, an inline operation which will do a lockless read bpf peer list associated with the interface. It should be noted that the bpf code will pickup the bpf_interface lock before adding or removing bpf peers. This should serialize the access to the bpf descriptor list, removing the race. - Expose the bpf_if structure in bpf.h so that the bpf_peers_present function can use it. This also removes the struct bpf_if; hack that was there. - Adjust all consumers of the raw if_bpf structure to use bpf_peers_present Now what happens is: (1) Packet is received by netif0 (2) Check to see if bpf descriptor list is empty (3) Pickup the bpf interface lock (4) Hand packet off to process From the attach/detach side: (1) Pickup the bpf interface lock (2) Add/remove from bpf descriptor list Now that we are storing the bpf interface structure with the ifnet, there is is no need to walk the bpf interface list to locate the correct bpf interface. We now simply look up the interface, and initialize the pointer. This has a nice side effect of changing a bpf interface attach operation from O(N) (where N is the number of bpf interfaces), to O(1). [1] From now on, we can no longer check ifp->if_bpf to tell us whether or not we have any bpf peers that might be interested in receiving packets. In collaboration with: sam@ MFC after: 1 month Notes: svn path=/head/; revision=159180
* Since DELAY() was moved, most <machine/clock.h> #includes have beenPoul-Henning Kamp2006-05-161-1/+0
| | | | | | | unnecessary. Notes: svn path=/head/; revision=158651
* Don't read channel list from EEPROM since we were already scanning allDamien Bergamini2006-03-131-10/+5
| | | | | | | 802.11b channels (1-14) regardless of what EEPROM says. Notes: svn path=/head/; revision=156687
* sync w/ iwi:Damien Bergamini2006-03-123-267/+252
| | | | | | | | | o fix locking o use firmware(9) o cosmetic Notes: svn path=/head/; revision=156599
* Use memcpy/memset consistently accross ipw and iwi instead of bcopy/bzero.Damien Bergamini2005-11-201-6/+6
| | | | Notes: svn path=/head/; revision=152637
* Be more robust when handling Rx interrupts. If we can't allocate and DMA mapDamien Bergamini2005-11-131-24/+42
| | | | | | | | | | a new mbuf, just discard the received frame and reuse the old mbuf. This should fix kernel panics on high network traffic. MFC after: 2 weeks Notes: svn path=/head/; revision=152385
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weWarner Losh2005-09-191-1/+2
| | | | | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call. Notes: svn path=/head/; revision=150306
* Remove IEEE80211_C_WPA from capabilities flags. WPA support is not fullyDamien Bergamini2005-08-201-2/+1
| | | | | | | | | implemented in ipw. MFC after: 1 week Notes: svn path=/head/; revision=149336