Browse Source

ath9k: optimize ath_drain_all_txq

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>
Felix Fietkau 11 years ago
parent
commit
10ffb6a77e
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/net/wireless/ath/ath9k/xmit.c

+ 3 - 0
drivers/net/wireless/ath/ath9k/xmit.c

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