1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -490,27 +490,25 @@ static void ath_tx_complete_aggr(struct
4 } else if (!isaggr && txok) {
5 /* transmit completion */
7 + } else if ((tid->state & AGGR_CLEANUP) || !retry) {
9 + * cleanup in progress, just fail
10 + * the un-acked sub-frames
15 + } else if (fi->retries < ATH_MAX_SW_RETRIES) {
16 + if (txok || !an->sleeping)
17 + ath_tx_set_retry(sc, txq, bf->bf_mpdu,
22 - if ((tid->state & AGGR_CLEANUP) || !retry) {
24 - * cleanup in progress, just fail
25 - * the un-acked sub-frames
30 - } else if (fi->retries < ATH_MAX_SW_RETRIES) {
31 - if (txok || !an->sleeping)
32 - ath_tx_set_retry(sc, txq, bf->bf_mpdu,
39 - bar_index = max_t(int, bar_index,
40 - ATH_BA_INDEX(seq_first, seqno));
44 + bar_index = max_t(int, bar_index,
45 + ATH_BA_INDEX(seq_first, seqno));
49 @@ -541,32 +539,29 @@ static void ath_tx_complete_aggr(struct
52 /* retry the un-acked ones */
53 - if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) {
54 - if (bf->bf_next == NULL && bf_last->bf_stale) {
55 - struct ath_buf *tbf;
57 - tbf = ath_clone_txbuf(sc, bf_last);
59 - * Update tx baw and complete the
60 - * frame with failed status if we
61 - * run out of tx buf.
64 - spin_lock_bh(&txq->axq_lock);
65 - ath_tx_update_baw(sc, tid, seqno);
66 - spin_unlock_bh(&txq->axq_lock);
68 - ath_tx_complete_buf(sc, bf, txq,
71 - bar_index = max_t(int, bar_index,
72 - ATH_BA_INDEX(seq_first,
76 + if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
77 + bf->bf_next == NULL && bf_last->bf_stale) {
78 + struct ath_buf *tbf;
81 + tbf = ath_clone_txbuf(sc, bf_last);
83 + * Update tx baw and complete the
84 + * frame with failed status if we
85 + * run out of tx buf.
88 + spin_lock_bh(&txq->axq_lock);
89 + ath_tx_update_baw(sc, tid, seqno);
90 + spin_unlock_bh(&txq->axq_lock);
92 + ath_tx_complete_buf(sc, bf, txq,
94 + bar_index = max_t(int, bar_index,
95 + ATH_BA_INDEX(seq_first, seqno));
103 @@ -654,24 +649,26 @@ static u32 ath_lookup_rate(struct ath_so
104 max_4ms_framelen = ATH_AMPDU_LIMIT_MAX;
106 for (i = 0; i < 4; i++) {
107 - if (rates[i].count) {
109 - if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) {
114 - if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
115 - modeidx = MCS_HT40;
117 - modeidx = MCS_HT20;
120 - if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
122 + if (!rates[i].count)
125 - frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
126 - max_4ms_framelen = min(max_4ms_framelen, frmlen);
127 + if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) {
132 + if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
133 + modeidx = MCS_HT40;
135 + modeidx = MCS_HT20;
137 + if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
140 + frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
141 + max_4ms_framelen = min(max_4ms_framelen, frmlen);
145 @@ -1598,11 +1595,9 @@ void ath_txq_schedule(struct ath_softc *
149 - if (!list_empty(&ac->tid_q)) {
152 - list_add_tail(&ac->list, &txq->axq_acq);
154 + if (!list_empty(&ac->tid_q) && !ac->sched) {
156 + list_add_tail(&ac->list, &txq->axq_acq);