aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2009-01-16 11:08:49 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 16:00:41 -0500
commit059d806cdcad3848582519f0546cf8b3bfede7a3 (patch)
tree04e91a5eb4edeaf03e990e6c5290adec2115aebe
parent043a040503b0d0c21bf3fba971813eba3322267d (diff)
ath9k: Add a helper function to wake mac80211 queues
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath9k/xmit.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index a29b998fac63..841bd9c54108 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -2031,6 +2031,22 @@ static void ath_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds, int nbad)
2031 } 2031 }
2032} 2032}
2033 2033
2034static void ath_wake_mac80211_queue(struct ath_softc *sc, struct ath_txq *txq)
2035{
2036 int qnum;
2037
2038 spin_lock_bh(&txq->axq_lock);
2039 if (txq->stopped &&
2040 ath_txq_depth(sc, txq->axq_qnum) <= (ATH_TXBUF - 20)) {
2041 qnum = ath_get_mac80211_qnum(txq->axq_qnum, sc);
2042 if (qnum != -1) {
2043 ieee80211_wake_queue(sc->hw, qnum);
2044 txq->stopped = 0;
2045 }
2046 }
2047 spin_unlock_bh(&txq->axq_lock);
2048}
2049
2034static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) 2050static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2035{ 2051{
2036 struct ath_hal *ah = sc->sc_ah; 2052 struct ath_hal *ah = sc->sc_ah;
@@ -2140,18 +2156,9 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2140 else 2156 else
2141 ath_tx_complete_buf(sc, bf, &bf_head, txok, 0); 2157 ath_tx_complete_buf(sc, bf, &bf_head, txok, 0);
2142 2158
2143 spin_lock_bh(&txq->axq_lock); 2159 ath_wake_mac80211_queue(sc, txq);
2144 if (txq->stopped && ath_txq_depth(sc, txq->axq_qnum) <=
2145 (ATH_TXBUF - 20)) {
2146 int qnum;
2147 qnum = ath_get_mac80211_qnum(txq->axq_qnum, sc);
2148 if (qnum != -1) {
2149 ieee80211_wake_queue(sc->hw, qnum);
2150 txq->stopped = 0;
2151 }
2152
2153 }
2154 2160
2161 spin_lock_bh(&txq->axq_lock);
2155 if (sc->sc_flags & SC_OP_TXAGGR) 2162 if (sc->sc_flags & SC_OP_TXAGGR)
2156 ath_txq_schedule(sc, txq); 2163 ath_txq_schedule(sc, txq);
2157 spin_unlock_bh(&txq->axq_lock); 2164 spin_unlock_bh(&txq->axq_lock);