mac80211: refresh a patch that was using the wrong patch style
[openwrt.git] / package / kernel / mac80211 / patches / 565-ath9k_baw_tracking_fix.patch
1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -211,8 +211,9 @@ struct ath_frame_info {
4         int framelen;
5         enum ath9k_key_type keytype;
6         u8 keyix;
7 -       u8 retries;
8         u8 rtscts_rate;
9 +       u8 retries : 7;
10 +       u8 baw_tracked : 1;
11  };
12  
13  struct ath_buf_state {
14 --- a/drivers/net/wireless/ath/ath9k/xmit.c
15 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
16 @@ -225,7 +225,7 @@ static void ath_tx_flush_tid(struct ath_
17                         }
18                 }
19  
20 -               if (fi->retries) {
21 +               if (fi->baw_tracked) {
22                         list_add_tail(&bf->list, &bf_head);
23                         ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
24                         ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
25 @@ -262,13 +262,16 @@ static void ath_tx_update_baw(struct ath
26  }
27  
28  static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
29 -                            u16 seqno)
30 +                            struct ath_buf *bf)
31  {
32 +       struct ath_frame_info *fi = get_frame_info(bf->bf_mpdu);
33 +       u16 seqno = bf->bf_state.seqno;
34         int index, cindex;
35  
36         index  = ATH_BA_INDEX(tid->seq_start, seqno);
37         cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1);
38         __set_bit(cindex, tid->tx_buf);
39 +       fi->baw_tracked = 1;
40  
41         if (index >= ((tid->baw_tail - tid->baw_head) &
42                 (ATH_TID_MAX_BUFS - 1))) {
43 @@ -960,8 +963,8 @@ static enum ATH_AGGR_STATUS ath_tx_form_
44                 bf->bf_next = NULL;
45  
46                 /* link buffers of this frame to the aggregate */
47 -               if (!fi->retries)
48 -                       ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
49 +               if (!fi->baw_tracked)
50 +                       ath_tx_addto_baw(sc, tid, bf);
51                 bf->bf_state.ndelim = ndelim;
52  
53                 __skb_unlink(skb, tid_q);
54 @@ -1451,7 +1454,7 @@ void ath9k_release_buffered_frames(struc
55                         __skb_unlink(bf->bf_mpdu, tid_q);
56                         list_add_tail(&bf->list, &bf_q);
57                         ath_set_rates(tid->an->vif, tid->an->sta, bf);
58 -                       ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
59 +                       ath_tx_addto_baw(sc, tid, bf);
60                         bf->bf_state.bf_type &= ~BUF_AGGR;
61                         if (bf_tail)
62                                 bf_tail->bf_next = bf;
63 @@ -1884,7 +1887,7 @@ static void ath_tx_send_ampdu(struct ath
64         list_add(&bf->list, &bf_head);
65  
66         /* Add sub-frame to BAW */
67 -       ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
68 +       ath_tx_addto_baw(sc, tid, bf);
69  
70         /* Queue to h/w without aggregation */
71         TX_STAT_INC(txq->axq_qnum, a_queued_hw);