aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/mac.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-01-30ath9k: reorder error codes for spectralSimon Wunderlich1-4/+4
When using the spectral scan feature, frames with phy errors are returned for further processing to the driver. However, if the frames also have an invalid CRC (which seems to happen quite often), the frame is marked with bad CRC and not with the PHY error bit. The FFT processing function will thus miss the frames. Fix this by changing the precedence in error marking. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: fix interrupt storms on queued hardware resetFelix Fietkau1-6/+12
commit b74713d04effbacd3d126ce94cec18742187b6ce "ath9k: Handle fatal interrupts properly" introduced a race condition, where IRQs are being left enabled, however the irq handler returns IRQ_HANDLED while the reset is still queued without addressing the IRQ cause. This leads to an IRQ storm that prevents the system from even getting to the reset code. Fix this by disabling IRQs in the handler without touching intr_ref_cnt. Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09ath9k: disable SYNC_HOST1_FATAL interrupts for AR9550Gabor Juhos1-1/+1
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-23ath9k_hw: increase tx abort timeout for half/quarter channelsFelix Fietkau1-1/+9
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k_hw: remove ath9k_hw_gettxintrtxqsFelix Fietkau1-7/+0
The driver can just check the mask directly Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k_hw: clean up tx completion interrupt handlingFelix Fietkau1-4/+3
TXQ_FLAG_TXOKINT_ENABLE and TXQ_FLAG_TXERRINT_ENABLE are always set and used together, and they share the same bitmask in enum ath9k_tx_queue_flags. Simplify the code that tests for these flags. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k_hw: simplify tx queue interrupt mask handlingFelix Fietkau1-15/+11
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-05ath9k_hw: enable interrupts for beacon tx completion eventsFelix Fietkau1-1/+5
Not doing so could cause the tx status queue to overflow during longer periods of time without non-beacon tx. These events are also required for proper drv_tx_last_beacon handling. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-16ath9k_hw: fix interpretation of the rx KeyMiss flagFelix Fietkau1-2/+3
Documentation states that the KeyMiss flag is only valid if RxFrameOK is unset, however empirical evidence has shown that this is false. When KeyMiss is set (and RxFrameOK is 1), the hardware passes a valid frame which has not been decrypted. The driver then falsely marks the frame as decrypted, and when using CCMP this corrupts the rx CCMP PN, leading to connection hangs. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-19ath: Convert ath_dbg(bar, ATH_DBG_<FOO>, to ath_dbg(bar, FOOJoe Perches1-20/+16
Add ATH_DBG_ to macros to shorten the uses and reduce the line count. Coalesce ath_dbg formats. Add missing spaces to coalesced formats. Add missing newline terminations to ath_dbg formats. Align ath_dbg arguments where appropriate. Standardize ath_dbg formats without periods. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-30ath9k_hw: check for asynchronous MCI interrupt pendingMohammed Shafi Shajakhan1-1/+4
MCI interrupt is an asynchronous one, so take care of it by having a check in ath9k_hw_intrpend, which actually decides whether the interrupt is really for the driver from ath_isr Cc: Wilson Tsao <wtsao@qca.qualcomm.com> Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-30ath9k_hw: take care of enabling MCI interruptsMohammed Shafi Shajakhan1-4/+8
enable MCI interrupt when ath9k_hw_enable_interrupts is called, like during the completion of chip_reset before which the interrupts are disabled Cc: Wilson Tsao <wtsao@qca.qualcomm.com> Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-31drivers/net: Add export.h to files using EXPORT_SYMBOL/THIS_MODULEPaul Gortmaker1-0/+1
These were getting the macros from an implicit module.h include via device.h, but we are planning to clean that up. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> drivers/net: Add export.h to wireless/brcm80211/brcmfmac/bcmsdh.c This relatively recently added file uses EXPORT_SYMBOL and hence needs export.h included so that it is compatible with the module.h split up work. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-11ath9k_hw: fix a regression in key miss handlingFelix Fietkau1-2/+2
The commit "ath9k_hw: Fix incorrect key_miss handling" changed the code to only report key miss errors if a MIC error wasn't reported. When checking the flags in that order in the MAC code, it might miss some real events, because the value of the MIC error flag is undefined under some conditions. The primary issue addressed by the previous commit is making sure that MIC errors are properly reported on the STA side. This can be fixed in a better way by adding a separate rx status flag for key miss and ignoring it for multicast frames. This fix slightly improves stability in AP mode on some older hardware, like AR9132. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-11ath9k_hw: make ath9k_hw_set_interrupts use ah->imask by defaultFelix Fietkau1-3/+3
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-19ath9k_hw: clean up hardware revision checksFelix Fietkau1-1/+1
- AR_SREV_5416_20_OR_LATER is always true, remove it - AR_SREV_9280_20_OR_LATER is always true within eeprom_4k.c and eeprom_9287.c - (AR_SREV_9271 || AR_SREV_9285) is always true in eeprom_4k.c Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-16ath9k_hw: remove the old tx descriptor APIFelix Fietkau1-12/+0
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24ath9k: qinfo never be NULL in setuptxqueueRajkumar Manoharan1-15/+2
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24ath9k: Remove unused argument tsf from ath9k_hw_rxprocdescRajkumar Manoharan1-1/+1
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-09ath9k: Use atomic reference count for interrupt opsRajkumar Manoharan1-1/+12
Let us enable/disable interrupts based on reference count. By doing this we can ensure that interrupts are never be enabled in the middle of tasklet processing. Instead of addressing corner cases like "ath9k: avoid enabling interrupts while processing rx", this approach handles it in generic manner. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-09ath9k: do not enable interrupt on set interrupt maskRajkumar Manoharan1-3/+0
At preset set_interrupt also enables interrupt after changing mask. This is not necessary in all cases and also sometime it breaks the assumption that interrupt was disabled. So let us enable the interrupt explicity if it was disabled earlier. This could also avoid unnecessary register ops and also helps the follow up patch to have global ref count for interrupts ops. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-13ath9k_hw: Fix incorrect key_miss handlingSenthil Balasubramanian1-2/+1
Decryping frames on key_miss handling shouldn't be done for Michael MIC failed frames as h/w would have already decrypted such frames successfully anyway. Also leaving CRC and PHY error(where the frame is going to be dropped anyway), we are left to prcoess Decrypt error for which s/w decrypt is selected anway and so having key_miss as a separate check doesn't serve anything. So making key_miss handling mutually exlusive with other RX status handling makes much more sense. This patch addresses an issue with STA not reporting MIC failure events resulting in STA being disconnected immediately. Cc: stable@kernel.org Signed-off-by: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19ath9k: Drag the driver to the year 2011Sujith Manoharan1-1/+1
The Times They Are a-Changin'. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-10ath9k_hw: Change DCU backoff thresh for AR9340Rajkumar Manoharan1-2/+7
By changing DCU backoff threshold for AR9340 to 1, helps to reduce rx overrurns seen while running bidirectional traffic. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-28ath9k_hw: Enable generic timer interrupt.Vivek Natarajan1-0/+3
Generic timer interrupt was not triggered unless autosleep was disabled. Since autosleep is enabled in the newer chipsets, enable generic timer for using with bt coex logic. Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-26Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6John W. Linville1-3/+22
2011-04-25ath9k_hw: Disable INTR_HOST1_FATAL to avoid interrupt strom with ar9430Vasanthakumar Thiagarajan1-4/+6
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-12ath9k_hw: fix stopping rx DMA during resetsFelix Fietkau1-3/+22
During PHY errors, the MAC can sometimes fail to enter an idle state on older hardware (before AR9380) after an rx stop has been requested. This typically shows up in the kernel log with messages like these: ath: Could not stop RX, we could be confusing the DMA engine when we start RX up ------------[ cut here ]------------ WARNING: at drivers/net/wireless/ath/ath9k/recv.c:504 ath_stoprecv+0xcc/0xf0 [ath9k]() Call Trace: [<8023f0e8>] dump_stack+0x8/0x34 [<80075050>] warn_slowpath_common+0x78/0xa4 [<80075094>] warn_slowpath_null+0x18/0x24 [<80d66d60>] ath_stoprecv+0xcc/0xf0 [ath9k] [<80d642cc>] ath_set_channel+0xbc/0x270 [ath9k] [<80d65254>] ath_radio_disable+0x4a4/0x7fc [ath9k] When this happens, the state that the MAC enters is easy to identify and does not result in bogus DMA traffic, however to ensure a working state after a channel change, the hardware should still be reset. This patch adds detection for this specific MAC state, after which the above warnings completely disappear in my tests. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Cc: Kyungwan Nam <Kyungwan.Nam@Atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-04ath9k: cleanup few redundant macrosMohammed Shafi Shajakhan1-2/+0
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-30ath9k_hw: remove pCap->total_queuesFelix Fietkau1-33/+5
The EEPROM contains a field that can restrict the number of hardware queues, however this is not only useless (all the known chips contain the same number of hardware queues), but also potentially dangerous in case of a misprogrammed EEPROM (could trigger driver crashes), so let's just ignore it completely. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-30ath9k_hw: replace REG_READ+REG_WRITE with REG_RMWFelix Fietkau1-43/+30
It's easier to read and it slightly decreases code size Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-15Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davemJohn W. Linville1-57/+32
2011-03-14ath9k: improve reliability of beacon transmission and stuck beacon handlingFelix Fietkau1-62/+9
ath9k calls ath9k_hw_stoptxdma every time it sends a beacon, however there is not much point in doing that if the previous beacon and mcast traffic went out properly. On AR9380, calling that function too often can result in an increase of stuck beacons due to differences in the handling of the queue enable/disable functionality. With this patch, the queue will only be explicitly stopped if the previous data frames were not sent successfully. With the beacon code being the only remaining user of ath9k_hw_stoptxdma, this function can be simplified in order to remove the now pointless attempts at waiting for transmission completion, which would never happen at this point due to the different method of tx scheduling of the beacon queue. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-14ath9k: fix stopping tx dma on resetFelix Fietkau1-0/+28
In some situations, stopping Tx DMA frequently fails, leading to messages like this: ath: Failed to stop TX DMA in 100 msec after killing last frame ath: Failed to stop TX DMA! This patch uses a few MAC features to abort DMA globally instead of iterating over all hardware queues and attempting to stop them individually. Not only is that faster and works with a shorter timeout, it also makes the process much more reliable. With this change, I can no longer trigger these messages on AR9380, and on AR9280 they become much more rare. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-03Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-2/+3
Conflicts: drivers/net/bnx2x/bnx2x.h
2011-02-25ath9k: correct ath9k_hw_set_interruptsStanislaw Gruszka1-2/+3
Commit 4df3071ebd92ef7115b409da64d0eb405d24a631 "ath9k_hw: optimize interrupt mask changes", changed ath9k_hw_set_interrupts function to enable interrupts regardless of function argument, what could possibly be wrong. Correct that behaviour and check "ints" arguments before enabling interrupts, also disable interrupts if ints do not have ATH9K_INT_GLOBAL flag set. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-27ath9k: fix misplaced debug codeFelix Fietkau1-8/+0
The commit 'ath9k: Add more information to debugfs xmit file.' added more debug counters to ath9k and also added some lines of code to ath9k_hw. Since ath9k_hw is also used by ath9k_htc, its code must not depend on ath9k data structures. In this case it was not fatal, but it's still wrong, so the code needs to be moved back to ath9k. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-21ath9k: Add more information to debugfs xmit file.Ben Greear1-0/+8
Should help debug strange tx lockup type issues. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-19ath9k_hw: partially revert "fix dma descriptor rx error bit parsing"Felix Fietkau1-4/+10
The rx error bit parsing was changed to consider PHY errors and various decryption errors separately. While correct according to the documentation, this is causing spurious decryption error reports in some situations. Fix this by restoring the original order of the checks in those places, where the errors are meant to be mutually exclusive. If a CRC error is reported, then MIC failure and decryption errors are irrelevant, and a PHY error is unlikely. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-04ath9k_hw: fix dma descriptor rx error bit parsingFelix Fietkau1-4/+5
An Rx DMA descriptor can have multiple error bits set, and some error bits (e.g. MIC failure) are filtered by the driver based on other criteria. Remove the 'else' in various error bit checks so that all error information is properly passed to the driver. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-08Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6John W. Linville1-2/+1
Conflicts: drivers/net/wireless/ath/ath9k/ath9k.h drivers/net/wireless/ath/ath9k/main.c drivers/net/wireless/ath/ath9k/xmit.c
2010-12-07ath: Convert ath_print to ath_dbgJoe Perches1-43/+43
Remove ath/debug.h and the includes of these files. Coalesce long formats. Correct a few misspellings and missing "\n"s from these logging messages. Remove unnecessary trailing space before a newline. Remove ARRAY_SIZE casts, use printf type %zu Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07ath: Convert ath_print(.., ATH_DBG_FATAL to ath_errJoe Perches1-18/+13
So these errors are always emitted at KERN_ERR level. Remove ARRAY_SIZE casts, use printf type %zu Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-07ath9k: Fix STA disconnect issue due to received MIC failed bcast framesSenthil Balasubramanian1-2/+1
AR_RxKeyIdxValid will not be set for bcast/mcast frames and so relying this status for MIC failed frames is buggy. Due to this, MIC failure events for broadcast frames are not sent to supplicant resulted in AP disconnecting the STA. Able to pass Wifi Test case 5.2.18 with this fix. Cc: Stable <stable@kernel.org> (2.6.36+) Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-12-02Revert "ath9k: Fix STA disconnect issue due to received MIC failed bcast frames"John W. Linville1-1/+2
This reverts commit 916448e77f6bcaaa7f13c3de0c3851783ae2bfd0. "As far as I can tell, either of these patches breaks multiple VIF scenarios. I'm not sure exactly why, but I had to revert this to get any of my interfaces to associate." -- Ben Greear <greearb@candelatech.com> http://marc.info/?l=linux-wireless&m=129123368719339&w=2 Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-30ath9k: Fix STA disconnect issue due to received MIC failed bcast framesSenthil Balasubramanian1-2/+1
AR_RxKeyIdxValid will not be set for bcast/mcast frames and so relying this status for MIC failed frames is buggy. Due to this, MIC failure events for broadcast frames are not sent to supplicant resulted in AP disconnecting the STA. Able to pass Wifi Test case 5.2.18 with this fix. Cc: Stable <stable@kernel.org> (2.6.36+) Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-24ath9k_hw: remove ath9k_hw_stoppcurecvFelix Fietkau1-8/+0
It is no longer used anywhere Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-11-09ath9k_hw: optimize interrupt mask changesFelix Fietkau1-36/+50
OProfile showed that ath9k was spending way too much time in ath9k_hw_set_interrupts. Since most of the interrupt mask changes only need to globally enable/disable interrupts, it makes sense to split this part into separate functions, replacing all calls to ath9k_hw_set_interrupts(ah, 0) with ath9k_hw_disable_interrupts(ah). ath9k_hw_set_interrupts(ah, ah->imask) only gets changed to ath9k_hw_enable_interrupts(ah), whenever ah->imask was not changed since the point where interrupts were disabled. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-07ath9k_hw: Fix hw reset failure with HTC driverRajkumar Manoharan1-4/+0
The following commit removed DISABLE_REGWRITE_BUFFER ops. The unnecessary REGWRITE_BUFFER_FLUSH was not removed properly which is causing failure on hw reset. Author: Felix Fietkau <nbd@openwrt.org> Date: Tue Oct 5 12:03:42 2010 +0200 ath9k_hw: clean up register write buffering Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-06ath9k_hw: clean up register write bufferingFelix Fietkau1-4/+0
Throughout the code, DISABLE_REGWRITE_BUFFER is always called right after REGWRITE_BUFFER_FLUSH. Since that's unlikely to change any time soon, that makes keeping those ops separate rather pointless, as it only increases code size and line number counts. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>