ath5k: Use DCU early termination correctly
authorNick Kossifidis <mickflemm@gmail.com>
Tue, 23 Nov 2010 18:50:16 +0000 (20:50 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 30 Nov 2010 18:52:32 +0000 (13:52 -0500)
 * DCU early termination should be used to quickly flush QCU
 according to docs so don't enable it for all queues, enable
 it only when stopping each queue and disable it when we are
 done.

Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath5k/dma.c
drivers/net/wireless/ath/ath5k/qcu.c

index e39c95340841d428097bcba24724c422decfba1b..bfdfcff42a1e95270bd730fad047bae4b77c240d 100644 (file)
@@ -216,6 +216,14 @@ int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
                ath5k_hw_reg_write(ah, tx_queue, AR5K_CR);
                ath5k_hw_reg_read(ah, AR5K_CR);
        } else {
+
+               /*
+                * Enable DCU early termination to quickly
+                * flush any pending frames from QCU
+                */
+               AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
+                                       AR5K_QCU_MISC_DCU_EARLY);
+
                /*
                 * Schedule TX disable and wait until queue is empty
                 */
@@ -285,6 +293,12 @@ int ath5k_hw_stop_tx_dma(struct ath5k_hw *ah, unsigned int queue)
                                        queue);
                }
 
+               /*
+                * Disable DCU early termination
+                */
+               AR5K_REG_DISABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
+                                       AR5K_QCU_MISC_DCU_EARLY);
+
                /* Clear register */
                ath5k_hw_reg_write(ah, 0, AR5K_QCU_TXD);
                if (pending) {
index 52eee34fd54d5d491c26044b84b8d1738d000907..ed62273cdf01b13951a7fa55b6ada8885491e946 100644 (file)
@@ -340,9 +340,6 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
                /*
                 * Set misc registers
                 */
-               /* Enable DCU early termination for this queue */
-               AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_MISC(queue),
-                                       AR5K_QCU_MISC_DCU_EARLY);
 
                /* Enable DCU to wait for next fragment from QCU */
                AR5K_REG_ENABLE_BITS(ah, AR5K_QUEUE_DFS_MISC(queue),