mac80211: merge changes from latest trunk into backfire
[10.03/openwrt.git] / package / mac80211 / patches / 530-ath9k_aggr_state_fix.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -120,26 +120,14 @@ static void ath_tx_queue_tid(struct ath_
4         list_add_tail(&ac->list, &txq->axq_acq);
5  }
6  
7 -static void ath_tx_pause_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
8 -{
9 -       struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
10 -
11 -       spin_lock_bh(&txq->axq_lock);
12 -       tid->paused++;
13 -       spin_unlock_bh(&txq->axq_lock);
14 -}
15 -
16  static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
17  {
18         struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
19  
20 -       BUG_ON(tid->paused <= 0);
21 -       spin_lock_bh(&txq->axq_lock);
22 -
23 -       tid->paused--;
24 +       WARN_ON(!tid->paused);
25  
26 -       if (tid->paused > 0)
27 -               goto unlock;
28 +       spin_lock_bh(&txq->axq_lock);
29 +       tid->paused = false;
30  
31         if (list_empty(&tid->buf_q))
32                 goto unlock;
33 @@ -157,15 +145,10 @@ static void ath_tx_flush_tid(struct ath_
34         struct list_head bf_head;
35         INIT_LIST_HEAD(&bf_head);
36  
37 -       BUG_ON(tid->paused <= 0);
38 -       spin_lock_bh(&txq->axq_lock);
39 +       WARN_ON(!tid->paused);
40  
41 -       tid->paused--;
42 -
43 -       if (tid->paused > 0) {
44 -               spin_unlock_bh(&txq->axq_lock);
45 -               return;
46 -       }
47 +       spin_lock_bh(&txq->axq_lock);
48 +       tid->paused = false;
49  
50         while (!list_empty(&tid->buf_q)) {
51                 bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
52 @@ -811,7 +794,7 @@ void ath_tx_aggr_start(struct ath_softc 
53         an = (struct ath_node *)sta->drv_priv;
54         txtid = ATH_AN_2_TID(an, tid);
55         txtid->state |= AGGR_ADDBA_PROGRESS;
56 -       ath_tx_pause_tid(sc, txtid);
57 +       txtid->paused = true;
58         *ssn = txtid->seq_start;
59  }
60  
61 @@ -835,10 +818,9 @@ void ath_tx_aggr_stop(struct ath_softc *
62                 return;
63         }
64  
65 -       ath_tx_pause_tid(sc, txtid);
66 -
67         /* drop all software retried frames and mark this TID */
68         spin_lock_bh(&txq->axq_lock);
69 +       txtid->paused = true;
70         while (!list_empty(&txtid->buf_q)) {
71                 bf = list_first_entry(&txtid->buf_q, struct ath_buf, list);
72                 if (!bf_isretried(bf)) {