aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath9k/main.c
AgeCommit message (Collapse)Author
2009-01-12ath9k: Fix chainmask handling bugSujith
The chainmasks have to be updated before setting the channel, since the HW reset routine uses them to set the appropriate registers. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19ath9k: Fixed RX decryption status reportingJouni Malinen
The RX code in ath9k uses sc_keymap to figure out whether a default key was used. However, the default key entries in sc_keymap were always set and as such, frames could have been claimed to be decrypted by hardware when they were not. This can cause problems especially with TKIP since mac80211 is validating the Michael MIC in the frame and this will result in MIC failure and potentially TKIP countermeasures if the frame was not decrypted correctly. Change key cache slot allocation to mark only the keys that really have been used in sc_keymap to avoid the issue. The key cache slot selection routines are now internally avoiding the slots that may be needed for TKIP group keys. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19ath9k: Fix key cache slot selection for splitmicJouni Malinen
ath_reserve_key_cache_slot() was obviously supposed to return an index to a free slot, not reserved one. This could have caused problems with hardware revisions that use splitmic. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19ath9k: Protect config() callback with a mutexSujith
This should fix the timeout issues seen when using wpa_supplicant. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19ath9k: Key cache allocation for AP modeJouni Malinen
Enhance allocation of key cache entries to support multiple pairwise keys to fix AP mode with more than one associated STA. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19ath9k: Move rate control alg register/unregister to appropriate placeVasanthakumar Thiagarajan
This patch makes sure the rate control alg is registered/unregistered only once for this module. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19ath9k: Do not use association state to update rate tableSujith
Now that HT information is made available to the driver through config() callback, the channel type can be calculated whenever setting the channel. Update the rate table accordingly with the new channel type. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-19mac80211: Fix HT channel selectionSujith
HT management is done differently for AP and STA modes, unify to just the ->config() callback since HT is fundamentally a PHY property and cannot be per-BSS. Rename enum nl80211_sec_chan_offset as nl80211_channel_type to denote the channel type ( NO_HT, HT20, HT40+, HT40- ). Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12ath9k: Refactor struct ath_softcSujith
Split ath_softc into smaller structures for rx, tx and beacon handling. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12ath9k: remove fragmentation workaround againJohannes Berg
Looking at the RC algorithm this is no longer necessary. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12ath9k: Adding support for Atheros AR9285 chipset.Senthil Balasubramanian
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12ath9k: Remove remaining occurrences of CONFIG_SLOW_ANT_DIVSujith
Slow Antenna Diversity has been removed, these are remnants of the old code. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12ath9k: Add a debugfs file to show interrupt statisticsSujith
Location: ath9k/<phy>/interrupt Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-12ath9k: Maintain rate table choice after associationSujith
A scan run after association would change sc_curmode which is used to get the current rate table. This patch fixes it by removing sc_curmode and setting the rate table in usage in cur_rate_table on association. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05ath9k: Choose correct ANI calibration periodSujith
ANI can't be turned on/off dynamically yet, but the calculation of the calibration period is wrong anyway. This patch fixes it. Reported-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05ath9k: Replace ath9k_opmode with nl80211_iftypeColin McCabe
This patch kills ath9k's ath9k_opmode enum by replacing it with nl80211_iftype. Signed-off-by: Colin McCabe <colin@cozybit.com> Signed-off-by: Andrey Yurovsky <andrey@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05ath9k: Add a debugfs file for dumping DMA statusSujith
Debugfs file location: ath9k/<wiphy>/dma Contains values in DMA debug registers. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05ath9k: Add initial layout for an ath9k specific debugfs mechanismSujith
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05ath9k: Add ATH9K_DEBUG configuration optionSujith
Make debugging configurable, and add a module parameter to give the debug mask. Add debug.c to hold all debug specific code. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05ath9k: Use cleaner debug masksSujith
Remove all the useless __func__ prefixes in debug messages, and replace the DPRINTF macro with a function. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-12-05ath9k: Handle channel initialization for AP modeSujith
Hostapd now passes the HT parameters through the config() callback, use these to set the appropriate channel in AP mode. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Use proper TX channel width for setting channelsSujith
The TX channel width of the BSS can be obtained only after association. In all cases, default to HT20 if HT is enabled, and set chan width to HT40 only if the BSS supports it. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Code scrubSujith
Merge core.c and base.c Remove Antenna Diversity (unused now). Remove unused chainmask handling code. Comment, indentation scrub. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Move TX completion routine to xmit.cSujith
Also, use a helper function to setup RC status data when processing completed TX descriptors. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: General code scrubSujith
Replace TRUE/FALSE macros with VALID/INVALID macros. Follow a consistent variable convention. Remove unnecessary comments. Add all RC phy macros into a single enum. Merge functions into reasonably sized entities. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Remove ath9k_rate_tableSujith
Maintaining two sets of rate tables is redundant, remove one and use struct ath_rate_table exclusively. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Use rate_driver_dataSujith
Remove the hack using vif, and use rate_driver_data within skb->cb to hold driver specific rate information. Setup the rate series in the skb's tx control area and remove all references to ath9k specific rate series ( using struct ath_rc_series ). Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Remove ath_rate_softcSujith
Move the hw rate tables to ath_softc, and access them directly. tx_triglevel_max is global, move it to ath_rate_node. Now that ath_rate_softc is gone, rate control attach becomes simpler. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Remove rate control reference in VAPSujith
Rate control init is now confined to itself, using the HT capabilites of the STA from rate_init(). Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Revamp RX handlingSujith
Remove a lot of old, crufty code and make RX status reporting a bit sane and clean. Do not do anything to the RX skb before unmapping. So in ath_rx_tasklet(), move the skb_put() after PCI unmap. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Nuke fixed rate handling in driverSujith
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-26ath9k: Fix panic while unregistering rfkillVasanthakumar Thiagarajan
[ 6133.670329] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010 [ 6133.672802] IP: [<ffffffffa030fcf6>] ieee80211_stop_queues+0x26/0x40 [mac80211] [ 6133.672802] PGD 759dc067 PUD 74f1d067 PMD 0 [ 6133.672802] Oops: 0002 [#1] PREEMPT SMP [ 6133.672802] last sysfs file: /sys/class/backlight/acpi_video0/brightness [ 6133.672802] CPU 0 [ 6133.672802] Modules linked in: ath9k(-) mac80211 pciehp pci_hotplug arc4 ecb joydev pcmcia ppdev lp ppp_generic psmouse sg pcspkr s] [ 6133.735830] Pid: 4445, comm: rmmod Tainted: G W 2.6.28-rc5-wl #1 [ 6133.735830] RIP: 0010:[<ffffffffa030fcf6>] [<ffffffffa030fcf6>] ieee80211_stop_queues+0x26/0x40 [mac80211] [ 6133.735830] RSP: 0018:ffff88007d1efd10 EFLAGS: 00010246 [ 6133.735830] RAX: 0000000000000000 RBX: ffff880074f41aa0 RCX: 0000000000000000 [ 6133.735830] RDX: 0000000000000010 RSI: 0000000000000000 RDI: ffff880074f40340 [ 6133.735830] RBP: ffff880074990000 R08: 0000000000000000 R09: 000000000000224d [ 6133.735830] R10: 0000000000000000 R11: ffffffff8031dc70 R12: 0000000000000000 [ 6133.735830] R13: 0000000000000001 R14: ffff880074f46c9c R15: 0000000000000000 [ 6133.735830] FS: 00007f1e2e0bc6f0(0000) GS:ffffffff805e0b80(0000) knlGS:0000000000000000 [ 6133.735830] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 6133.735830] CR2: 0000000000000010 CR3: 0000000075593000 CR4: 00000000000006e0 [ 6133.735830] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 6133.735830] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 6133.735830] Process rmmod (pid: 4445, threadinfo ffff88007d1ee000, task ffff88007c0c8000) [ 6133.735830] Stack: [ 6133.735830] ffffffffa034d583 ffff88007c7d9410 ffff88007c7d9410 ffff88007c7d9410 [ 6133.735830] ffffffff80481dab ffff880074f41aa0 00000000fffffff0 0000000000000000 [ 6133.735830] 0000000000000001 0000000000000001 ffffffffa034d8a5 ffff88007c7d9400 [ 6133.735830] Call Trace: [ 6133.735830] [<ffffffffa034d583>] ? ath_radio_disable+0x33/0x150 [ath9k] [ 6133.735830] [<ffffffff80481dab>] ? __mutex_lock_slowpath+0x20b/0x2a0 [ 6133.735830] [<ffffffffa034d8a5>] ? ath_sw_toggle_radio+0x65/0xa0 [ath9k] [ 6133.735830] [<ffffffffa019d1f4>] ? rfkill_toggle_radio+0x74/0x140 [rfkill] [ 6133.735830] [<ffffffffa019d597>] ? rfkill_remove_switch+0x67/0x80 [rfkill] [ 6133.735830] [<ffffffffa019d955>] ? rfkill_unregister+0x25/0x50 [rfkill] [ 6133.735830] [<ffffffffa034bf75>] ? ath_detach+0xf5/0x140 [ath9k] [ 6133.735830] [<ffffffffa034bfe9>] ? ath_pci_remove+0x29/0x80 [ath9k] [ 6133.735830] [<ffffffff8035263c>] ? pci_device_remove+0x2c/0x60 [ 6133.735830] [<ffffffff803c3829>] ? __device_release_driver+0x99/0x100 [ 6133.735830] [<ffffffff803c3950>] ? driver_detach+0xc0/0xd0 [ 6133.735830] [<ffffffff803c296e>] ? bus_remove_driver+0x8e/0xd0 [ 6133.735830] [<ffffffff80352916>] ? pci_unregister_driver+0x36/0xa0 [ 6133.735830] [<ffffffffa0356ad4>] ? exit_ath_pci+0x10/0x29 [ath9k] [ 6133.735830] [<ffffffff8026bb1b>] ? sys_delete_module+0x1cb/0x2d0 [ 6133.735830] [<ffffffff802960d9>] ? do_munmap+0x349/0x390 [ 6133.735830] [<ffffffff80342d01>] ? __up_write+0x21/0x150 [ 6133.735830] [<ffffffff8020c45b>] ? system_call_fastpath+0x16/0x1b [ 6133.735830] Code: c3 0f 1f 40 00 0f b7 57 5e 0f b7 47 5c 01 c2 74 30 31 c9 66 90 48 8b 57 78 0f b7 c1 48 c1 e0 07 48 03 82 00 03 00 [ 6133.735830] RIP [<ffffffffa030fcf6>] ieee80211_stop_queues+0x26/0x40 [mac80211] Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-25ath9k: make DMA memory consistentLuis R. Rodriguez
Make the DMAable mameory consistent with pci_set_consistent_dma_mask(). The DMA-mapping.txt Documentation recommends this but for PCI-X considerations and on strange architecture like SGI SN2, not sure why it would fix an issue but lets see if it does, just in case. Before this, this driver was tested with x86_64 with about 7 GB of RAM, not sure if this is really needed. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-25ath9k: Clarify we only want 32-bit DMALuis R. Rodriguez
Use DMA_32BIT_MASK to clarify we only want 32-bit DMA memory. What was there before is also 32-bit but this makes it clearer Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-25ath9k: Race condition in accessing TX and RX buffers.Senthil Balasubramanian
Race condition causes RX buffers to be accessed even before it is initialized. The RX and TX buffers are initialized immediately after the hardware is registered with mac80211. The mac80211 start callback is ready to be fired once the device is registered for a case when the wpa_supplicant is also running at the same time. The same race condition is also possible for RKFILL registration as RFKILL init happens after the device registration with mac80211 and it is possible that rfkill_register would be called even before it is initialized. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-25ath9k: IRQ should be disabled before calling free_irq()Senthil Balasubramanian
ath9k frees irq even before IRQs are disabled and existing IRQs are flushed when rfkill_register() fails. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-25ath9k: Build RFKILL feature even when RFKILL subsystem is a MODULESenthil Balasubramanian
Currently, ath9k builds RFKILL feature only when the RFKILL subsystem is built part of the kernel. Build RFKILL feature regardless of whether RFKILL subsystem is built as a MODULE or part of the kernel. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-21ath9k : Display MAC/BB and RF version at startup (v2)Benoit PAPILLAULT
This patch decodes the MAC/BB version (for instance: AR5416) and the RF part version (for instance: AR5133). It has been tested on AR5416/AR5133 which is a 2.4/5GHz 11n device. It also makes the differences between AR5416 (PCI) and AR5418 (PCI Express). Both are named AR5416 in the register definitions. Signed-off-by: Benoit Papillault <benoit.papillault@free.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-11ath9k: Fix compilation failure when RFKILL is enabledSujith
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10mac80211: Add a new event in ieee80211_ampdu_mlme_actionSujith
Send a notification to the driver on succesful reception of an ADDBA response, add IEEE80211_AMPDU_TX_RESUME for this purpose. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Remove internal RX A-MPDU processingSujith
mac80211 has RX A-MPDU reordering support. Use that and remove redundant RX processing within the driver. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Clear HT info on starting the driverSujith
Doing an interface down/up leaves the old HT assoc information, clear it. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Enable interrupts at the proper placeSujith
config_interface() was the wrong place to enable interrupts when bringing up an interface, move it to ath_open(). Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Remove unnecessary TSF resetSujith
The TSF is already reset properly via mac80211's callback. Resetting it in config_interface() is not needed. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Streamline attach/detachSujith
Simplify attach and detach routines by consolidating the stop and suspend functions. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Revamp VAP managementSujith
Remove the internal VAP management routines and embed ath_vap in mac80211's driver private area provided in ieee80211_vif. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Ensure ath_node is not NULL when updating tx chainmaskSujith
Also, random indentation and whitespace cleanup. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Revamp transmit control blockSujith
Use the ath_buf instance associated with each tx frame directly and remove all redundant information in ath_tx_control. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: Node cleanupSujith
Start removing the internal node list in ath9k, in preparation for using mac80211's STA list. Remove lists, locks, routines, flags, functions managing nodes in ath9k. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-11-10ath9k: remove useless NULL initialisersJohannes Berg
When I added .set_frag_threshold I didn't realise it was already there which now generated a sparse warning. Therefore, remove the .set_frag_threshold NULL initialiser, and while at it all the other useless ones. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>