aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Kossifidis <mickflemm@gmail.com>2010-11-23 13:55:17 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-30 13:52:32 -0500
commit14fae2d4b61b890cea58d63091406b86ec9bafcd (patch)
treea76280e0c2c307384390c36f95b807987dd9c81a
parente8325ed87457e07b9ceeb1e7a31df787dd7ee106 (diff)
ath5k: Use new function to stop beacon queue
* Since we only use ath5k_hw_stop_tx_dma to stop the beacon queue, introduce a new function ath5k_hw_stop_beacon_queue so that we can use that instead and have better control. In the future we can add more beacon queue specific stuff there (maybe tweak beacon timers or something), for now just call ath5k_hw_stop_tx_dma. * Also since we don't call ath5k_hw_stop_rx/tx_dma from outside dma.c, make them static. Signed-off-by: Nick Kossifidis <mickflemm@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h3
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c4
-rw-r--r--drivers/net/wireless/ath/ath5k/dma.c24
3 files changed, 25 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index b36d3a530258..66359dca3224 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1166,11 +1166,10 @@ void ath5k_hw_set_clockrate(struct ath5k_hw *ah);
1166 1166
1167/* DMA Related Functions */ 1167/* DMA Related Functions */
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);
1170u32 ath5k_hw_get_rxdp(struct ath5k_hw *ah); 1169u32 ath5k_hw_get_rxdp(struct ath5k_hw *ah);
1171int ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr); 1170int ath5k_hw_set_rxdp(struct ath5k_hw *ah, u32 phys_addr);
1172int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue); 1171int 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); 1172int ath5k_hw_stop_beacon_queue(struct ath5k_hw *ah, unsigned int queue);
1174u32 ath5k_hw_get_txdp(struct ath5k_hw *ah, unsigned int queue); 1173u32 ath5k_hw_get_txdp(struct ath5k_hw *ah, unsigned int queue);
1175int ath5k_hw_set_txdp(struct ath5k_hw *ah, unsigned int queue, 1174int ath5k_hw_set_txdp(struct ath5k_hw *ah, unsigned int queue,
1176 u32 phys_addr); 1175 u32 phys_addr);
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index eea5879575ba..9af7e461a236 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1922,7 +1922,7 @@ ath5k_beacon_send(struct ath5k_softc *sc)
1922 * This should never fail since we check above that no frames 1922 * This should never fail since we check above that no frames
1923 * are still pending on the queue. 1923 * are still pending on the queue.
1924 */ 1924 */
1925 if (unlikely(ath5k_hw_stop_tx_dma(ah, sc->bhalq))) { 1925 if (unlikely(ath5k_hw_stop_beacon_queue(ah, sc->bhalq))) {
1926 ATH5K_WARN(sc, "beacon queue %u didn't start/stop ?\n", sc->bhalq); 1926 ATH5K_WARN(sc, "beacon queue %u didn't start/stop ?\n", sc->bhalq);
1927 /* NB: hw still stops DMA, so proceed */ 1927 /* NB: hw still stops DMA, so proceed */
1928 } 1928 }
@@ -2091,7 +2091,7 @@ ath5k_beacon_config(struct ath5k_softc *sc)
2091 } else 2091 } else
2092 ath5k_beacon_update_timers(sc, -1); 2092 ath5k_beacon_update_timers(sc, -1);
2093 } else { 2093 } else {
2094 ath5k_hw_stop_tx_dma(sc->ah, sc->bhalq); 2094 ath5k_hw_stop_beacon_queue(sc->ah, sc->bhalq);
2095 } 2095 }
2096 2096
2097 ath5k_hw_set_imr(ah, sc->imask); 2097 ath5k_hw_set_imr(ah, sc->imask);
diff --git a/drivers/net/wireless/ath/ath5k/dma.c b/drivers/net/wireless/ath/ath5k/dma.c
index 3fe634f588c2..82541fec9f0e 100644
--- a/drivers/net/wireless/ath/ath5k/dma.c
+++ b/drivers/net/wireless/ath/ath5k/dma.c
@@ -58,7 +58,7 @@ void ath5k_hw_start_rx_dma(struct ath5k_hw *ah)
58 * 58 *
59 * @ah: The &struct ath5k_hw 59 * @ah: The &struct ath5k_hw
60 */ 60 */
61int ath5k_hw_stop_rx_dma(struct ath5k_hw *ah) 61static int ath5k_hw_stop_rx_dma(struct ath5k_hw *ah)
62{ 62{
63 unsigned int i; 63 unsigned int i;
64 64
@@ -188,7 +188,7 @@ int ath5k_hw_start_tx_dma(struct ath5k_hw *ah, unsigned int queue)
188 * -EINVAL if queue number is out of range or inactive. 188 * -EINVAL if queue number is out of range or inactive.
189 * 189 *
190 */ 190 */
191int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue) 191static int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
192{ 192{
193 unsigned int i = 40; 193 unsigned int i = 40;
194 u32 tx_queue, pending; 194 u32 tx_queue, pending;
@@ -321,6 +321,26 @@ int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
321} 321}
322 322
323/** 323/**
324 * ath5k_hw_stop_beacon_queue - Stop beacon queue
325 *
326 * @ah The &struct ath5k_hw
327 * @queue The queue number
328 *
329 * Returns -EIO if queue didn't stop
330 */
331int ath5k_hw_stop_beacon_queue(struct ath5k_hw *ah, unsigned int queue)
332{
333 int ret;
334 ret = ath5k_hw_stop_tx_dma(ah, queue);
335 if (ret) {
336 ATH5K_DBG(ah->ah_sc, ATH5K_DEBUG_DMA,
337 "beacon queue didn't stop !\n");
338 return -EIO;
339 }
340 return 0;
341}
342
343/**
324 * ath5k_hw_get_txdp - Get TX Descriptor's address for a specific queue 344 * ath5k_hw_get_txdp - Get TX Descriptor's address for a specific queue
325 * 345 *
326 * @ah: The &struct ath5k_hw 346 * @ah: The &struct ath5k_hw