summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/dma.c
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2010-11-23 20:52:24 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-11-30 13:52:32 -0500
commite8325ed87457e07b9ceeb1e7a31df787dd7ee106 (patch)
treef41b8ea9c3a12fa8fe3ed881fba74e06890b6d39 /drivers/net/wireless/ath/ath5k/dma.c
parentf7317ba2d669c1b54fb31ed7834361a700a79217 (diff)
downloadop-kernel-dev-e8325ed87457e07b9ceeb1e7a31df787dd7ee106.zip
op-kernel-dev-e8325ed87457e07b9ceeb1e7a31df787dd7ee106.tar.gz
ath5k: Check RXE when setting RXDP
* Make sure we are not trying to set RXDP while RX is active, for now ignore the return value. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/dma.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/dma.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c
index bfdfcff..3fe634f 100644
--- a/drivers/net/wireless/ath/ath5k/dma.c
+++ b/drivers/net/wireless/ath/ath5k/dma.c
@@ -95,11 +95,18 @@ u32 ath5k_hw_get_rxdp(struct ath5k_hw *ah)
* @ah: The &struct ath5k_hw
* @phys_addr: RX descriptor address
*
- * XXX: Should we check if rx is enabled before setting rxdp ?
+ * Returns -EIO if rx is active
*/
-void ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr)
+int ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr)
{
+ if (ath5k_hw_reg_read(ah, AR5K_CR) & AR5K_CR_RXE) {
+ ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_DMA,
+ "tried to set RXDP while rx was active !\n");
+ return -EIO;
+ }
+
ath5k_hw_reg_write(ah, phys_addr, AR5K_RXDP);
+ return 0;
}
OpenPOWER on IntegriCloud