aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/recv.c
Commit message (Collapse)AuthorAgeFilesLines
* Backport ath from 3.4 kernelWolfgang Wiedmeyer2017-01-211-174/+284
| | | | | | | net/wireless and mac80211 are already backported from a 3.4 kernel, so it makes sense to also get ath from 3.4 (3.4.113). Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de>
* ath9k: fix decrypt_error initialization in ath_rx_tasklet()Lorenzo Bianconi2012-09-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | commit e1352fde5682ab1bdd2a9e5d75c22d1fe210ef77 upstream. ath_rx_tasklet() calls ath9k_rx_skb_preprocess() and ath9k_rx_skb_postprocess() in a loop over the received frames. The decrypt_error flag is initialized to false just outside ath_rx_tasklet() loop. ath9k_rx_accept(), called by ath9k_rx_skb_preprocess(), only sets decrypt_error to true and never to false. Then ath_rx_tasklet() calls ath9k_rx_skb_postprocess() and passes decrypt_error to it. So, after a decryption error, in ath9k_rx_skb_postprocess(), we can have a leftover value from another processed frame. In that case, the frame will not be marked with RX_FLAG_DECRYPTED even if it is decrypted correctly. When using CCMP encryption this issue can lead to connection stuck because of CCMP PN corruption and a waste of CPU time since mac80211 tries to decrypt an already deciphered frame with ieee80211_aes_ccm_decrypt. Fix the issue initializing decrypt_error flag at the begging of the ath_rx_tasklet() loop. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* ath9k: disable unnecessary PHY error reportingFelix Fietkau2011-11-111-4/+1
| | | | | | | | | | | | | | commit ac06697c79bad09e44a8b1d52104014016fb90de upstream. PHY errors relevant for ANI are always tracked by hardware counters, the bits that allow them to pass through the rx filter are independent of that. Enabling PHY errors in the rx filter often creates lots of useless DMA traffic and might be responsible for some of the rx dma stop failure warnings. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ath9k: Drag the driver to the year 2011Sujith Manoharan2011-05-191-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>
* ath9k: make sure main_rssi is positiveMohammed Shafi Shajakhan2011-05-161-2/+2
| | | | | | | | | | | | | some times the rssi control descriptor for the main antenna may be negative like that of alternate antenna, hence before incrementing packet counts/rssi of main/alternate antenna make sure both main_rssi and alt_rssi are positive only. this avoids wrong selection of antenna due to diversity Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com> Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: configure fast_div_bias based on diversity groupMohammed Shafi Shajakhan2011-05-161-43/+131
| | | | | | | | | | | configure fast diversity bias based on the antenna diversity group and based on main/alt LNA configurations. also configure main antenna and alternate antenna to gain-table 0 for diversity group 2(AR9485) Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com> Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Implement an API to swap main/ALT LNA'sMohammed Shafi Shajakhan2011-05-161-1/+30
| | | | | | | | | | | | | for the diversity group 2(AR9485) we swap the LNA's of main/ALT antenna based on alternate antenna's rssi average in comparision with main antenna's rssi, while for AR9285(antenna diversity group 0)we still follow the older method of looking at the packet count in alternate antenna Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com> Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: define antenna diversity groupMohammed Shafi Shajakhan2011-05-161-1/+1
| | | | | | | | | | | | | AR9285 belongs to diversity group 0 and AR9485 belongs to diversity group 2. Based on the diversity group we configure certain antenna diversity paramaters such as lna1_lna2_delta and fast diversity bias values. For AR9485 we have some gain table parameter which selects the gain table 0/1 for main and alternate antenna Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com> Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com> Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix rssi update in ad-hoc modeRajkumar Manoharan2011-05-101-1/+2
| | | | | | | | The average beacon rssi which will be used by ani is not updated in adhoc mode. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: avoid enabling interrupts while processing rxRajkumar Manoharan2011-05-101-0/+1
| | | | | | | | | | | | The assumsion is that while processing ath9k tasklet, interrupts were already disabled and it will be enabled at the completion of ath9k tasklet. But whenever TSFOOR is raised, the driver configures the beacon timers after having received a beacon frame from the AP which inturn enables the interrupts. Cc: stable@kernel.org Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2011-04-261-3/+3
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
| * ath9k: fix the return value of ath_stoprecvFelix Fietkau2011-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The patch 'ath9k_hw: fix stopping rx DMA during resets' added code to detect a condition where rx DMA was stopped, but the MAC failed to enter the idle state. This condition requires a hardware reset, however the return value of ath_stoprecv was 'true' in that case, which allowed it to skip the reset when issuing a fast channel change. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Reported-by: Paul Stewart <pstew@google.com> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k_hw: fix stopping rx DMA during resetsFelix Fietkau2011-04-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ath9k: remove the unlikely check for autosleepMohammed Shafi Shajakhan2011-04-251-1/+1
| | | | | | | | | | | | | | | | newer chipsets support auto sleep feature, so remove the unlikely check which does not seems to help anything Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: Fix warnings from -Wunused-but-set-variableSujith Manoharan2011-04-251-2/+1
| | | | | | | | | | Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: fix too early enabling of rx during ath_startrecv()Felix Fietkau2011-04-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | rx should only be enabled after enough rx buffers have been given to the hardware, however ath_rx_buf_link was calling ath9k_hw_rxena after every single added buffer. Fix this by calling ath9k_hw_rxena directly from the rx tasklet after completion instead. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: fix PS-Poll reception on AR9160 and earlierFelix Fietkau2011-04-121-3/+1
| | | | | | | | | | | | | | | | | | I can't find any valid reason for not setting the ATH9K_RX_FILTER_PSPOLL flag on older hardware and neither the documentation nor the reference code mention any reason for excluding older hardware here. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: configure beacons based on hw opmodeRajkumar Manoharan2011-04-071-1/+1
|/ | | | | | | | | | | | | | | | Current ath9k code does not handle beacon timers on opmode specific. One such example is that a STA beacon config overwrites already configured AP vif's beacon timers during scan. On multi station vif case, configure beacon timers beased on primary vif selected. This also helps while moving back to single STA vif from multi STA vifs, where the power save is enabled and hw has to be reconfigured with proper beacon and bssid/aid. Otherwise connection poll will be triggered so frequently due to beacon loss. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: remove support for the FIF_PROMISC_IN_BSS filter flagFelix Fietkau2011-03-111-3/+1
| | | | | | | | | | | | | | | | | | | | The hardware rx filter flag triggered by FIF_PROMISC_IN_BSS is overly broad and covers even frames with PHY errors. When this flag is enabled, this message shows up frequently during scanning or hardware resets: ath: Could not stop RX, we could be confusing the DMA engine when we start RX up Since promiscuous mode is usually not particularly useful, yet enabled by default by bridging (either used normally in 4-addr mode, or with hacks for various virtualization software), we should sacrifice it for better reliability during normal operation. This patch leaves it enabled if there are active monitor mode interfaces, since it's very useful for debugging. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: rename RX_FLAG_TSFTJohannes Berg2011-02-231-1/+1
| | | | | | | | | | The flag isn't very descriptive -- the intention is that the driver provides a TSF timestamp at the beginning of the MPDU -- make that clearer by renaming the flag to RX_FLAG_MACTIME_MPDU. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: use split rx buffers to get rid of order-1 skb allocationsFelix Fietkau2011-01-281-24/+64
| | | | | | | | | | | | | With this change, less CPU time is spent trying to look for consecutive pages for rx skbs. This also reduces the socket memory required for IP/UDP reassembly. Only two buffers per frame are supported. Frames spanning more buffers will be dropped, but the buffer size is enough to handle the required AMSDU size. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: fold struct ath_wiphy into struct ath_softcFelix Fietkau2011-01-281-3/+3
| | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: remove support for virtual wiphysFelix Fietkau2011-01-281-59/+4
| | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix up hardware mode and beacons with multiple vifs.Ben Greear2011-01-191-2/+14
| | | | | | | | | | | | | | | | | | When using a mixture of AP and Station interfaces, the hardware mode was using the type of the last VIF registered. Instead, we should keep track of the number of different types of vifs and set the mode accordingly. In addtion, use the vif type instead of hardware opmode when dealing with beacons. Attempt to move some of the common setup code into smaller methods so we can re-use it when changing vif mode as well as adding/deleting vifs. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Fix warnings on card removalRajkumar Manoharan2010-12-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The recently added warning message on power change failure is not needed on device removal. ath: Failed to wakeup in 500us ------------[ cut here ]------------ WARNING: at drivers/net/wireless/ath/ath9k/hw.c:1618 ath9k_hw_setpower+0x61f/0x630 [ath9k_hw]() Hardware name: 64756D6 Pid: 540, comm: kworker/u:3 Not tainted 2.6.37-rc6-wl #37 Call Trace: [<ffffffff810501aa>] warn_slowpath_common+0x7a/0xb0 [<ffffffffa056e280>] ? ath9k_iowrite32+0x0/0x90 [ath9k] [<ffffffff810501f5>] warn_slowpath_null+0x15/0x20 [<ffffffffa05226ef>] ath9k_hw_setpower+0x61f/0x630 [ath9k_hw] [<ffffffffa05700e5>] ath9k_ps_wakeup+0x85/0xd0 [ath9k] [<ffffffffa0570685>] ath9k_configure_filter+0x25/0x80 [ath9k] [<ffffffffa04dde43>] ieee80211_configure_filter+0x133/0x190 [mac80211] [<ffffffffa04ee502>] ieee80211_do_stop+0x132/0x540 [mac80211] [<ffffffff813466ff>] ? _raw_spin_unlock_bh+0x1f/0x30 [<ffffffff812b6923>] ? dev_deactivate+0x1c3/0x1e0 [<ffffffffa04ee925>] ieee80211_stop+0x15/0x20 [mac80211] [<ffffffff8129d1b6>] __dev_close+0x56/0x90 Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2010-12-081-1/+8
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6 Conflicts: drivers/net/wireless/ath/ath9k/ath9k.h drivers/net/wireless/ath/ath9k/main.c drivers/net/wireless/ath/ath9k/xmit.c
| * ath9k: Fix STA disconnect issue due to received MIC failed bcast framesSenthil Balasubramanian2010-12-071-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Revert "ath9k: Fix STA disconnect issue due to received MIC failed bcast frames"John W. Linville2010-12-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ath9k: Fix STA disconnect issue due to received MIC failed bcast framesSenthil Balasubramanian2010-11-301-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ath9k: Remove dead code in recv.cMohammed Shafi Shajakhan2010-12-071-5/+4
| | | | | | | | | | | | | | | | The structure struct ieee80211_rx_status *rxs is no longer needed to be passed to ath_rx_send_to_mac80211 function Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: Properly use unlikely check macroMohammed Shafi Shajakhan2010-12-071-3/+4
| | | | | | | | | | | | | | | | | | AUTOSLEEP feature is enabled only for AR9271 and AR9003 version chipsets.So unlikely macro should be used only to check whether auto-sleep feature is enabled Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: Make DMA warning in ath_stoprecv WARN_ON_ONCE.Ben Greear2010-12-071-2/+6
| | | | | | | | | | | | | | | | | | | | This decreases spammage in the log. A single line message will still be printed, so users can be aware that problem exists. Signed-off-by: Ben Greear <greearb@candelatech.com> Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath: Convert ath_print to ath_dbgJoe Perches2010-12-071-17/+16
| | | | | | | | | | | | | | | | | | | | | | 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>
* | ath: Convert ath_print(.., ATH_DBG_FATAL to ath_errJoe Perches2010-12-071-8/+7
| | | | | | | | | | | | | | | | 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>
* | Merge branch 'master' of ↵John W. Linville2010-11-241-3/+3
|\ \ | |/ | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
| * ath9k: fix timeout on stopping rx dmaFelix Fietkau2010-11-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It seems that using ath9k_hw_stoppcurecv to stop rx dma is not enough. When it's time to stop DMA, the PCU is still busy, so the rx enable bit never clears. Using ath9k_hw_abortpcurecv helps with getting rx stopped much faster, with this change, I cannot reproduce the rx stop related WARN_ON anymore. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * ath9k: Avoid HW opmode overridden on monitor mode changesRajkumar Manoharan2010-11-081-2/+2
| | | | | | | | | | | | | | | | | | | | The HW opmode is blindly set to monitor type on monitor mode change notification. This overrides the opmode when one of the interfaces is still running as non-monitor iftype. So the monitoring information needs to be maintained seperately. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: move the PCU lock to the sc structureLuis R. Rodriguez2010-11-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PCU lock should be used to contend TX DMA as well, this will be done next. This is part of a series of patches which fix stopping TX DMA completley when requested on the driver. For more details about this issue refer to this thread: http://marc.info/?l=linux-wireless&m=128629803703756&w=2 Tested-by: Ben Greear <greearb@candelatech.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Cc: stable@kernel.org Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: add a debug warning when we cannot stop RXLuis R. Rodriguez2010-11-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have seen several DMA races when we race against stopping and starting the PCU. I suspect that when we cannot stop the PCU we may hit some of these same races so warn against them for now but only when debugging (CONFIG_ATH_DEBUG) is enabled. If you run into this warning and are a developer, please fix the cause of the warning. The potential here, although I cannot prove yet, is that the DMA engine can be confused and start writing to a buffer that was already DMA'd before and at least the kernel assumes is not being accessed by hardware anymore. Cc: Ben Greear <greearb@candelatech.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | ath9k: optimize/fix ANI RSSI processingFelix Fietkau2010-11-091-26/+12
|/ | | | | | | | | | | | ANI needs the RSSI average only in station mode, and only for tracking the signal strength of beacons of the AP that it is connected to. Adjust the code to track on the beacon RSSI, and store the average of that in the ath_wiphy struct. With these changes, we can get rid of this extra station lookup in the rx path, which saves precious CPU cycles. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: lock reset and PCU start/stoppingLuis R. Rodriguez2010-10-271-2/+0
| | | | | | | | | | | | | | | | | | | | | Apart from locking the start and stop PCU we need to ensure we also content starting and stopping the PCU between hardware resets. This is part of a series that will help resolve the bug: https://bugzilla.kernel.org/show_bug.cgi?id=14624 For more details about this issue refer to: http://marc.info/?l=linux-wireless&m=128629803703756&w=2 Cc: stable@kernel.org Cc: Ben Greear <greearb@candelatech.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: rename rxflushlock to pcu_lockLuis R. Rodriguez2010-10-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | The real way to lock RX is to contend on the PCU and reset, this will be fixed in the next patch but for now just do the renames so that the next patch which changes the locking order is crystal clear. This is part of a series that will help resolve the bug: https://bugzilla.kernel.org/show_bug.cgi?id=14624 For more details about this issue refer to: http://marc.info/?l=linux-wireless&m=128629803703756&w=2 Cc: stable@kernel.org Cc: Ben Greear <greearb@candelatech.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: add locking for starting the PCU on RXLuis R. Rodriguez2010-10-271-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | There was some locking for starting some parts of RX but not for starting the PCU. Include this otherwise we can content against stopping the PCU. This can potentially lead to races against different buffers on the PCU which can lead to to the DMA RX engine writing to buffers which are already freed. This is part of a series that will help resolve the bug: https://bugzilla.kernel.org/show_bug.cgi?id=14624 For more details about this issue refer to: http://marc.info/?l=linux-wireless&m=128629803703756&w=2 Cc: stable@kernel.org Cc: Ben Greear <greearb@candelatech.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: add locking for stopping RXLuis R. Rodriguez2010-10-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | ath9k locks for starting RX but not for stopping RX. We could potentially run into a situation where tried to stop RX but immediately started RX. This allows for races on the the RX engine deciding what buffer we last left off on and could potentially cause ath9k to DMA into already free'd memory or in the worst case at a later time to already given memory to other drivers. Fix this by locking stopping RX. This is part of a series that will help resolve the bug: https://bugzilla.kernel.org/show_bug.cgi?id=14624 For more details about this issue refer to: http://marc.info/?l=linux-wireless&m=128629803703756&w=2 Cc: stable@kernel.org Cc: Ben Greear <greearb@candelatech.com> Cc: Kyungwan Nam <kyungwan.nam@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Null out references to stale pointers.Ben Greear2010-10-151-0/+5
| | | | | | | | | This doesn't fix any problem that I'm aware of, but should make it harder to add use-after-free type bugs in the future. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Remove bf_dmacontext.Ben Greear2010-10-151-2/+0
| | | | | | | | | The bf_dmacontext seems to be totally useless and duplicated by bf_buf_addr. Remove it entirely, use bf_buf_addr in its place. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k: Set RX filter for Probe Request based on filter flagJouni Malinen2010-10-131-2/+1
| | | | | | | | This allows mac80211 to enable receiving of Probe Request frames in station mode which is needed for P2P. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211/ath9k: Support AMPDU with multiple VIFs.Ben Greear2010-09-271-1/+5
| | | | | | | | | | | | | | | | The old ieee80211_find_sta_by_hw method didn't properly find VIFS when there was more than one per AP. This caused AMPDU logic in ath9k to get the wrong VIF when trying to account for transmitted SKBs. This patch changes ieee80211_find_sta_by_hw to take a localaddr argument to distinguish between VIFs with the same AP but different local addresses. The method name is changed to ieee80211_find_sta_by_ifaddr. Signed-off-by: Ben Greear <greearb@candelatech.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: simplify revision checks for AR9285Felix Fietkau2010-09-271-1/+1
| | | | | | | | Since AR9285 v1.0 and v1.1 were never sold (and the initvals removed), its revision checks can be simplified similar to AR9280 Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* ath9k_hw: simplify revision checks for AR9280Felix Fietkau2010-09-271-1/+1
| | | | | | | | | Since AR9280 v1.0 was never sold (and the initvals removed), v1.0 specific revision checks can be removed and the 'v2.0 or later' check can be simplified to a check for AR9280 or later. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>