summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi
Commit message (Collapse)AuthorAgeFilesLines
* Fix an off-by-one error in iwi_init_fw_dma(). It didn't reuse the existingjhb2007-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
* allow net80211 to fillin rate setssam2007-03-111-19/+0
| | | | MFC after: 2 weeks
* change ic_modecaps to a bit vector and use setbit, et. al.sam2007-03-111-6/+2
|
* o break newbus api: add a new argument of type driver_filter_t topiso2007-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@
* Rename IWI_LOCK_ASSERT to IWI_LOCK_CHECK per Sam's suggestion,luigi2007-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
* Address a few issues with the iwi driver, namely:luigi2007-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
* Document the endiannes of firmware headersluigi2007-02-201-1/+9
| | | | (in preparation for changes in the C code).
* Cleanup and document the implementation of firmware(9) based onluigi2007-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
* Use bus_get_dma_tag() so iwi(4) works on platforms requiring it.kevlo2007-02-021-15/+18
| | | | Approved by: cognet
* Add header files <sys/lock.h> and <sys/mutex.h> for mtx_init() and friends.kevlo2006-12-071-0/+2
| | | | Approved by: cognet
* Drop the iwi softc lock when calling back into net80211 on rx. This fixes amlaier2006-12-061-0/+3
| | | | | | | | LOR with direct dispatch in the netisr. Reported and tested by: Munehiro Matsuda Submitted by: jhb LOR id: 194
* Fix some edge cases in detach (including attach failures):jhb2006-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
* net80211 seems to give us more rates than specified via ic_sup_rates undermlaier2006-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
* Remind firmware of the ESSID to use in a directed scan. This fixes scanningmlaier2006-10-101-3/+17
| | | | | | | for hidden APs when we are not comming from iwi_config. Reported by: Andrew N. Below MFC after: 3 days
* set default beacon miss threshold to 10 beaconssam2006-07-261-0/+1
| | | | | Submitted by: Henrik Brix Andersen <henrik@brixandersen.dk> MFC after: 2 weeks
* add missed calls to bpf_peers_presentsam2006-06-021-1/+1
|
* Fix the following bpf(4) race condition which can result in a panic:csjp2006-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
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* MFp4: reworked iwi-drivermlaier2006-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
* o don't use '-' characters in firmware namesdamien2006-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
* add dependency with firmware module.damien2006-03-111-0/+1
| | | | pointed out by Martin Wilke.
* Fix build.ru2006-03-111-2/+2
|
* o acknowledge interrupts early in the interrupt handlerdamien2006-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.
* make use of the firmware(9) subsystem.damien2006-03-102-158/+73
| | | | use intel's firmware version 3.0 layout.
* fix the locking.damien2006-03-102-28/+73
|
* correct check for whether wpa is enabledsam2006-02-201-1/+1
| | | | MFC after: 3 days
* o Re-enable scatter/gatherdamien2006-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
* Don't use /etc/firmware. /etc is for configuration files only.damien2005-11-201-1/+1
| | | | | | Use /boot to store firmware files instead. Requested by: Daniel O'Connor, Scott Long
* Fix compile on 64-bit platforms.scottl2005-11-201-2/+4
|
* Load firmware images directly from the filesystem (looks into /etc/firmwaredamien2005-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
* Fix endianness issues. iwi now works on big endian architectures too.damien2005-11-131-10/+10
| | | | | Obtained from: NetBSD (scw@) MFC after: 2 weeks
* Be more robust when handling Rx interrupts. If we can't allocate and DMA mapdamien2005-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
* Fixes my previous commit (rev 1.20)damien2005-10-071-3/+3
| | | | MFC after: 1 day
* o Use firmware extended scan command; this one doesn't crash when scanningdamien2005-10-062-21/+29
| | | | | | | | | | the 5GHz band. o Enable 802.11a channels scanning for 2915ABG adapters. o Fix a typo (negociated->negotiated). With hints from NetBSD. MFC after: 2 days
* Use phk's kernel unit number allocator to associate unique ids to neighborsdamien2005-09-193-45/+76
| | | | | | | | in an IBSS. Store ids directly into ieee80211_node's instead of managing our own private association table. Idea and code by Sam Leffler. Submitted by: sam MFC after: 5 days
* It's safe to wait for command completion in iwi_config().damien2005-09-191-1/+2
| | | | MFC after: 5 days
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weimp2005-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.
* o Add initial bits for IBSS support.damien2005-09-173-25/+110
| | | | | | | | | | o Allow association with APs that do not broadcast SSID (with hints from Nick Hudson and Hajimu Umemoto). o IFQ_DRV_PREPEND mbuf when h/w ring is full so it can be sent later. o Increment if_oerrors when appropriate. o Did some cleanup while I'm here. MFC after: 1 day
* Enhanced WME (802.11e) support.damien2005-08-212-5/+65
|
* Add some necessary bits for upcoming 802.11e support:damien2005-08-203-64/+183
| | | | | | | | o management of multiple tx rings (up to 4) o setting of WME IE in association requests Some features are still missing though, like the possibility to override the default cwmin/cwmax/asfn values of each tx queues.
* Export adapter's internal statistics sysctl even if IWI_DEBUG is not defined.damien2005-08-201-6/+0
| | | | MFC after: 1 week
* Don't automatically start scanning in if_init() if IEEE80211_ROAMING_MANUALdamien2005-08-201-4/+6
| | | | | | flag is set. MFC after: 1 week
* Catch up to ic_curchan changes by making the same change here that was madejhb2005-08-171-1/+1
| | | | | | | in ipw(4) in the earlier ic_curchan mega commit. Submitted by: Øyvind Kolbu oyvind at kolbu dot ws Tested by: Stefan Ehmann shoesoft at gmx dot net
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-11/+11
| | | | | | | | | | | | | | IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field. Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so. Reviewed by: pjd, bz MFC after: 7 days
* simplify ieee80211_node_authorize and ieee80211_node_unauthorize api'ssam2005-07-221-1/+1
| | | | MFC after: 3 days
* remove driver-private key allocators; use the default one insteadsam2005-07-101-12/+0
| | | | | | | so wpa keys are handled properly Reviewed by: avatar Approved by: re (scottl)
* reclaim node reference when ieee80211_encap failssam2005-07-081-1/+3
| | | | | Reviewed by: avatar Approved by: re (scottl)
* reclaim mbuf when ieee80211_crypto_encap failssam2005-07-071-1/+3
| | | | | Approved by: re (scottl) Obtained from: netbsd
* Fix a read mbuf-after-free error in the iwi driver that was provoked bysilby2005-06-231-9/+6
| | | | | | | the trash allocator being used on mbufs. Reviewed by: damien Approved by: re (scottl)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-102-3/+12
| | | | | | | | | | | | | | | | | | | | struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com. This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go. Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr. Reviewed by: sobomax, sam
OpenPOWER on IntegriCloud