aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/iwi
Commit message (Collapse)AuthorAgeFilesLines
* 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
* push wme parameter setting to the taskq thread; the update callback fromSam Leffler2009-05-092-7/+21
| | | | | | | | net80211 can happen from the ithread and submitting the fw cmd requires a sleepable context Notes: svn path=/head/; revision=191951
* Drain the tasks before the interface stop call in case a restart was queued.Andrew Thompson2009-05-081-5/+5
| | | | Notes: svn path=/head/; revision=191912
* Create a taskqueue for each wireless interface which provides a serialisedAndrew Thompson2009-05-022-259/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Hoist 802.11 encapsulation up into net80211:Sam Leffler2009-03-301-7/+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-10/+10
| | | | | | | | | | | | | | 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
* Change the calling convention for ic_node_alloc to deal withSam Leffler2008-06-071-3/+4
| | | | | | | | | | | | | | | some longstanding issues: o pass the vap since it's now the "coin of the realm" and required to do things like set initial tx parameters in private node state for use prior to association o pass the mac address as cards that maintain outboard station tables require this to create an entry (e.g. in ibss mode) o remove the node table reference, we only have one node table and it's unlikely this will change so this is not needed to find the com structure Notes: svn path=/head/; revision=179643
* Minor cleanup of vap create work:Sam Leffler2008-05-121-1/+2
| | | | | | | | | | | | | | | | 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
* Unify all the wifi *_ioctl routinesAndrew Thompson2008-05-011-7/+8
| | | | | | | | | | | | | | | | | - 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-584/+553
| | | | | | | | | | | | | | 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
* Rename the kthread_xxx (e.g. kthread_create()) callsJulian Elischer2007-10-201-2/+2
| | | | | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls. Notes: svn path=/head/; revision=172836
* Add missing bits that made bg scanning lame:Sam Leffler2007-09-051-0/+6
| | | | | | | | | | | | | o update ic_lastdata to reflect time of last outbound frame o outbound traffic must preempt/cancel bg scanning to avoid delays This stuff was somehow missed in the initial import. Reviewed by: thompsa, avatar, sephe (earlier version) Approved by: re (blanket wireless) Notes: svn path=/head/; revision=172060
* Remove the lock assert from iwi_newstate, this function does not need the lockAndrew Thompson2007-08-291-1/+0
| | | | | | | | | | | to be held and this will falsely trigger if called from net80211. Reported by: Munehiro (haro) Matsuda Reviewed by: sam Approved by: re (kensmith) Notes: svn path=/head/; revision=172012
* The config.use_protection option can not be used in 802.11b mode and causes aAndrew Thompson2007-06-251-16/+17
| | | | | | | | | | | | firmware reset. Also zero out struct iwi_rateset although its not strictly necessary. Reported by: Maxim Konovalov Reviewed by: sam Approved by: re (bmah) Notes: svn path=/head/; revision=171034
* MFp4 (missed in net80211 megaupdate)Andrew Thompson2007-06-112-7/+25
| | | | | | | | | | | - Use a seperate taskqueue+thread for reset tasks since iwi_ops will block. - Return from iwi_ops if the interface has been downed - The firmware will fail if we are already associated - Add myself to the copyright Notes: svn path=/head/; revision=170554
* Update 802.11 wireless support:Sam Leffler2007-06-113-385/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix an off-by-one error in iwi_init_fw_dma(). It didn't reuse the existingJohn Baldwin2007-03-211-1/+1
| | | | | | | | | | | | | DMA memory for a firmware load if it was the exact size needed, thus in the common case the driver was constantly free'ing and reallocating the DMA buffer and it would eventually begin to fail. With this fix, iwi0 reuses the same buffer the entire time and no longer fails to load the firmware after the machine has been up for a while. MFC after: 1 week Notes: svn path=/head/; revision=167776
* allow net80211 to fillin rate setsSam Leffler2007-03-111-19/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=167470
* change ic_modecaps to a bit vector and use setbit, et. al.Sam Leffler2007-03-111-6/+2
| | | | Notes: svn path=/head/; revision=167468
* 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
* Rename IWI_LOCK_ASSERT to IWI_LOCK_CHECK per Sam's suggestion,Luigi Rizzo2007-02-202-25/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | and make it print under debug.iwi control same as other debugging stuff. Remove the device_printf() in iwi_ioctl() and replace with this: /* * wait until pending iwi_cmd() are completed, to avoid races * that could cause problems. */ while (sc->flags & IWI_FLAG_BUSY) msleep(sc, &sc->sc_mtx, 0, "iwiioctl", hz); This at least prevents what has become an almost systematic failure for my system, presumably due to a previous iwi_cmd() not complete yet by the time iwi_ioctl() is called. It has been pointed to my attention that the real problem could be calling ieee80211_ioctl() with the lock held. If that is true, there might still be a possibility for a race condition e.g. an interrupt coming while the ioctl is sleeping. Need to investigate further on what changes are required to release the lock before calling ieee80211_ioctl Notes: svn path=/head/; revision=166849
* Address a few issues with the iwi driver, namely:Luigi Rizzo2007-02-202-78/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + do not release the dma-ble region used for downloading firmware. This should fix the problems that some people were seeing, due to memory becoming too fragmented which prevented subsequent allocations of a suitable contiguous region of memory; + document the firmware format and usage in if_iwivar.h + use a loop to allocate the four tx rings, instead of replicating the body of the loop. + add debugging code IWI_LOCK_ASSERT() to detect missing locks. These only do a printf, and should go away once we figure out why the driver sometimes freezes the system due to a (yet unidentified) race condition. + add a device_printf() in iwi_ioctl() in certain conditions (see comment in the code). This helps preventing the race condition mentioned above, and makes the system survive. This printf will also go away once fixing this bug is completed. + change iwi_getfw() to return 0 on success, 1 on error, consistently with other functions. + fix the argument of a sizeof() in iwi_get_firmware() + use le32toh() to access little-endian fields + simplify error handling in iwi_load_firmware() and iwi_init_locked() The bugs fixed by this commit (the freezing one especially) are serious enough to call for a quick MFC MFC after: 3 days Notes: svn path=/head/; revision=166848
* Document the endiannes of firmware headersLuigi Rizzo2007-02-201-1/+9
| | | | | | | (in preparation for changes in the C code). Notes: svn path=/head/; revision=166846
* Cleanup and document the implementation of firmware(9) based onLuigi Rizzo2007-02-152-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Use bus_get_dma_tag() so iwi(4) works on platforms requiring it.Kevin Lo2007-02-021-15/+18
| | | | | | | Approved by: cognet Notes: svn path=/head/; revision=166416
* Add header files <sys/lock.h> and <sys/mutex.h> for mtx_init() and friends.Kevin Lo2006-12-071-0/+2
| | | | | | | Approved by: cognet Notes: svn path=/head/; revision=164982
* Drop the iwi softc lock when calling back into net80211 on rx. This fixes aMax Laier2006-12-061-0/+3
| | | | | | | | | | | LOR with direct dispatch in the netisr. Reported and tested by: Munehiro Matsuda Submitted by: jhb LOR id: 194 Notes: svn path=/head/; revision=164964
* Fix some edge cases in detach (including attach failures):John Baldwin2006-11-071-3/+2
| | | | | | | | | | | | | - Only call iwi_stop() if we got far enough along in iwi_attach() to alloc an ifnet. - Release the firmware after stopping the interface and detaching the ifnet. MFC after: 1 month Reviewed by: sam Notes: svn path=/head/; revision=164069
* net80211 seems to give us more rates than specified via ic_sup_rates underMax Laier2006-10-232-1/+7
| | | | | | | | | | | | yet to be investigated circumstances. If that happens truncate to the number of rates that the firmware supports. Found by: Jeremie Le Hen Obtained from: OpenBSD (w/ changes) MFC after: 3 days Notes: svn path=/head/; revision=163618
* Remind firmware of the ESSID to use in a directed scan. This fixes scanningMax Laier2006-10-101-3/+17
| | | | | | | | | | for hidden APs when we are not comming from iwi_config. Reported by: Andrew N. Below MFC after: 3 days Notes: svn path=/head/; revision=163209
* set default beacon miss threshold to 10 beaconsSam Leffler2006-07-261-0/+1
| | | | | | | | Submitted by: Henrik Brix Andersen <henrik@brixandersen.dk> MFC after: 2 weeks Notes: svn path=/head/; revision=160688
* 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
* MFp4: reworked iwi-driverMax Laier2006-04-273-702/+1729
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changelog towards if_iwi.c 1.26 (some changes have been committed separately in the mean time): - add led support - add firmware loading on demand - auto-restart firmware when it crashes - serialize operations sent to the firmware to reduce firmware crashes - add power save operation support - remove incorrect specification of tx power control capability - add radio on/off switch support - improve net80211 state machine operation - recognize and handle beacon miss - handle authentication and association failures better - add shared key authentication - fix ibss mode (many changes) - fix wme (many changes) - correct radiotap support (many changes) - correct bus dma setup of s/g - correct various locking issues - fix monitor mode - fix scanning (many changes) - recover from wedged scan requests - respect active channel list - eliminate cases where interface was marked down on error - don't treat parity errors as fatal - reclaim mgt frames immediately from tx queue - correct interrupt handling, ack early (from NetBSD) - fix short/long preamble handling Committed with RELENG_6 compat #if's, should compile in RELENG_6. Requires net/iwi-firmware-kmod to function. Much work done by: sam Tested by: many (freebsd-net), ume, luigi MFC after: 4 weeks Notes: svn path=/head/; revision=158089
* o don't use '-' characters in firmware namesDamien Bergamini2006-03-122-18/+34
| | | | | | | | | | o call firmware_put() early to release the firmware module o on firmware panics or watchdog timeouts, schedule a task to reinitialize the interface (we may sleep in iwi_init()) o discard oversized rx frames Notes: svn path=/head/; revision=156598
* add dependency with firmware module.Damien Bergamini2006-03-111-0/+1
| | | | | | | pointed out by Martin Wilke. Notes: svn path=/head/; revision=156571
* Fix build.Ruslan Ermilov2006-03-111-2/+2
| | | | Notes: svn path=/head/; revision=156565
* o acknowledge interrupts early in the interrupt handlerDamien Bergamini2006-03-102-10/+13
| | | | | | | | | | | o stop processing interrupts after a firmware fatal error or a radio kill o clarify the possible values for the 'antenna' sysctl. o by default, let the firmware do antenna diversity. the firmware will periodically switch to another antenna to evaluate the signal quality. Notes: svn path=/head/; revision=156547
* make use of the firmware(9) subsystem.Damien Bergamini2006-03-102-158/+73
| | | | | | | use intel's firmware version 3.0 layout. Notes: svn path=/head/; revision=156546
* fix the locking.Damien Bergamini2006-03-102-28/+73
| | | | Notes: svn path=/head/; revision=156539
* correct check for whether wpa is enabledSam Leffler2006-02-201-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=155864
* o Re-enable scatter/gatherDamien Bergamini2006-01-292-37/+45
| | | | | | | | | | | o Change MEM_READ_1/MEM_READ_4 into macros (move them to if_iwireg.h) o Add support for association LED o Silently discard f/w notifications that are unknown (fixes spurious "unknown notification 15" in logs with latest firmware) o Fix scanning of 5GHz channels Notes: svn path=/head/; revision=154992
* Don't use /etc/firmware. /etc is for configuration files only.Damien Bergamini2005-11-201-1/+1
| | | | | | | | | Use /boot to store firmware files instead. Requested by: Daniel O'Connor, Scott Long Notes: svn path=/head/; revision=152636
* Fix compile on 64-bit platforms.Scott Long2005-11-201-2/+4
| | | | Notes: svn path=/head/; revision=152629
* Load firmware images directly from the filesystem (looks into /etc/firmwareDamien Bergamini2005-11-193-153/+165
| | | | | | | | | | | directory by default) without requiring the user to load them by hand using e.g iwicontrol. Get rid of the old ioctl crud. Updated iwi-firmware port coming soon. Obtained from: OpenBSD Notes: svn path=/head/; revision=152611
* Fix endianness issues. iwi now works on big endian architectures too.Damien Bergamini2005-11-131-10/+10
| | | | | | | | Obtained from: NetBSD (scw@) MFC after: 2 weeks Notes: svn path=/head/; revision=152389
* Be more robust when handling Rx interrupts. If we can't allocate and DMA mapDamien Bergamini2005-11-131-20/+40
| | | | | | | | | | | a new mbuf, just discard the received frame and reuse the old mbuf. This should fix kernel panics on high network traffic. Obtained from: NetBSD (joerg@) MFC after: 2 weeks Notes: svn path=/head/; revision=152384
* Fixes my previous commit (rev 1.20)Damien Bergamini2005-10-071-3/+3
| | | | | | | MFC after: 1 day Notes: svn path=/head/; revision=151068