ath9k: optimize ath_drain_all_txq
authorFelix Fietkau <nbd@openwrt.org>
Mon, 11 Nov 2013 21:23:34 +0000 (22:23 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 2 Dec 2013 19:24:59 +0000 (14:24 -0500)
If the software has processed all packets, checking the hardware queue
is unnecessary.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/xmit.c

index 95f6c5a8ee124da52ef259a6e071cc5aa059e937..24846d91554b98f56fb07caed59a4ccfb5ff8684 100644 (file)
@@ -1786,6 +1786,9 @@ bool ath_drain_all_txq(struct ath_softc *sc)
                if (!ATH_TXQ_SETUP(sc, i))
                        continue;
 
+               if (!sc->tx.txq[i].axq_depth)
+                       continue;
+
                if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum))
                        npend |= BIT(i);
        }