1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -146,6 +146,28 @@ static void ath_set_rates(struct ieee802
4 ARRAY_SIZE(bf->rates));
7 +static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
12 + q = skb_get_queue_mapping(skb);
13 + if (txq == sc->tx.uapsdq)
14 + txq = sc->tx.txq_map[q];
16 + if (txq != sc->tx.txq_map[q])
19 + if (WARN_ON(--txq->pending_frames < 0))
20 + txq->pending_frames = 0;
23 + txq->pending_frames < sc->tx.txq_max_pending[q]) {
24 + ieee80211_wake_queue(sc->hw, q);
25 + txq->stopped = false;
29 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
31 struct ath_txq *txq = tid->ac->txq;
32 @@ -167,6 +189,7 @@ static void ath_tx_flush_tid(struct ath_
34 bf = ath_tx_setup_buffer(sc, txq, tid, skb);
36 + ath_txq_skb_done(sc, txq, skb);
37 ieee80211_free_txskb(sc->hw, skb);
40 @@ -811,6 +834,7 @@ ath_tx_get_tid_subframe(struct ath_softc
43 __skb_unlink(skb, &tid->buf_q);
44 + ath_txq_skb_done(sc, txq, skb);
45 ieee80211_free_txskb(sc->hw, skb);
48 @@ -1824,6 +1848,7 @@ static void ath_tx_send_ampdu(struct ath
50 bf = ath_tx_setup_buffer(sc, txq, tid, skb);
52 + ath_txq_skb_done(sc, txq, skb);
53 ieee80211_free_txskb(sc->hw, skb);
56 @@ -2090,6 +2115,7 @@ int ath_tx_start(struct ieee80211_hw *hw
58 bf = ath_tx_setup_buffer(sc, txq, tid, skb);
60 + ath_txq_skb_done(sc, txq, skb);
62 dev_kfree_skb_any(skb);
64 @@ -2189,7 +2215,7 @@ static void ath_tx_complete(struct ath_s
65 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
66 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
67 struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data;
68 - int q, padpos, padsize;
69 + int padpos, padsize;
72 ath_dbg(common, XMIT, "TX complete: skb: %p\n", skb);
73 @@ -2225,21 +2251,7 @@ static void ath_tx_complete(struct ath_s
74 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
76 __skb_queue_tail(&txq->complete_q, skb);
78 - q = skb_get_queue_mapping(skb);
79 - if (txq == sc->tx.uapsdq)
80 - txq = sc->tx.txq_map[q];
82 - if (txq == sc->tx.txq_map[q]) {
83 - if (WARN_ON(--txq->pending_frames < 0))
84 - txq->pending_frames = 0;
87 - txq->pending_frames < sc->tx.txq_max_pending[q]) {
88 - ieee80211_wake_queue(sc->hw, q);
89 - txq->stopped = false;
92 + ath_txq_skb_done(sc, txq, skb);
95 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,