aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2010-11-23 13:52:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-30 13:52:32 -0500
commite8325ed87457e07b9ceeb1e7a31df787dd7ee106 (patch)
treef41b8ea9c3a12fa8fe3ed881fba74e06890b6d39 /drivers/net
parentf7317ba2d669c1b54fb31ed7834361a700a79217 (diff)
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')
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/dma.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 629a5eebe30..b36d3a53025 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1168,7 +1168,7 @@ void ath5k_hw_set_clockrate(struct ath5k_hw *ah);
1168void ath5k_hw_start_rx_dma(struct ath5k_hw *ah); 1168void ath5k_hw_start_rx_dma(struct ath5k_hw *ah);
1169int ath5k_hw_stop_rx_dma(struct ath5k_hw *ah); 1169int ath5k_hw_stop_rx_dma(struct ath5k_hw *ah);
1170u32 ath5k_hw_get_rxdp(struct ath5k_hw *ah); 1170u32 ath5k_hw_get_rxdp(struct ath5k_hw *ah);
1171void ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr); 1171int ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr);
1172int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue); 1172int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue);
1173int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue); 1173int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue);
1174u32 ath5k_hw_get_txdp(struct ath5k_hw *ah, unsigned int queue); 1174u32 ath5k_hw_get_txdp(struct ath5k_hw *ah, unsigned int queue);
diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c
index bfdfcff42a1..3fe634f588c 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)
95 * @ah: The &struct ath5k_hw 95 * @ah: The &struct ath5k_hw
96 * @phys_addr: RX descriptor address 96 * @phys_addr: RX descriptor address
97 * 97 *
98 * XXX: Should we check if rx is enabled before setting rxdp ? 98 * Returns -EIO if rx is active
99 */ 99 */
100void ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr) 100int ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr)
101{ 101{
102 if (ath5k_hw_reg_read(ah, AR5K_CR) & AR5K_CR_RXE) {
103 ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_DMA,
104 "tried to set RXDP while rx was active !\n");
105 return -EIO;
106 }
107
102 ath5k_hw_reg_write(ah, phys_addr, AR5K_RXDP); 108 ath5k_hw_reg_write(ah, phys_addr, AR5K_RXDP);
109 return 0;
103} 110}
104 111
105 112