dfe536ca006ecb33d3f3f39a0551270f541466c6
[openwrt-10.03/.git] / package / mac80211 / patches / 562-ath9k_tx_status.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -50,10 +50,12 @@ static u16 bits_per_symbol[][2] = {
4  static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
5                                struct ath_atx_tid *tid, struct sk_buff *skb);
6  static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
7 -                           int tx_flags, struct ath_txq *txq);
8 +                           int tx_flags, struct ath_txq *txq,
9 +                           struct ieee80211_sta *sta);
10  static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
11                                 struct ath_txq *txq, struct list_head *bf_q,
12 -                               struct ath_tx_status *ts, int txok, int sendbar);
13 +                               struct ath_tx_status *ts, int txok, int sendbar,
14 +                               struct ieee80211_sta *sta);
15  static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
16                              struct list_head *head, bool internal);
17  static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
18 @@ -172,7 +174,8 @@ static void ath_tx_flush_tid(struct ath_
19                 if (bf && fi->retries) {
20                         list_add_tail(&bf->list, &bf_head);
21                         ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
22 -                       ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 1);
23 +                       ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0,
24 +                               1, NULL);
25                 } else {
26                         ath_tx_send_normal(sc, txq, NULL, skb);
27                 }
28 @@ -239,7 +242,7 @@ static void ath_tid_drain(struct ath_sof
29  
30                 if (!bf) {
31                         spin_unlock(&txq->axq_lock);
32 -                       ath_tx_complete(sc, skb, ATH_TX_ERROR, txq);
33 +                       ath_tx_complete(sc, skb, ATH_TX_ERROR, txq, NULL);
34                         spin_lock(&txq->axq_lock);
35                         continue;
36                 }
37 @@ -250,7 +253,7 @@ static void ath_tid_drain(struct ath_sof
38                         ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
39  
40                 spin_unlock(&txq->axq_lock);
41 -               ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
42 +               ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0, NULL);
43                 spin_lock(&txq->axq_lock);
44         }
45  
46 @@ -412,7 +415,7 @@ static void ath_tx_complete_aggr(struct 
47                                 list_move_tail(&bf->list, &bf_head);
48  
49                         ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
50 -                               0, 0);
51 +                               0, 0, NULL);
52  
53                         bf = bf_next;
54                 }
55 @@ -520,7 +523,7 @@ static void ath_tx_complete_aggr(struct 
56                         }
57  
58                         ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
59 -                               !txfail, sendbar);
60 +                               !txfail, sendbar, sta);
61                 } else {
62                         /* retry the un-acked ones */
63                         if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) {
64 @@ -540,7 +543,8 @@ static void ath_tx_complete_aggr(struct 
65  
66                                                 ath_tx_complete_buf(sc, bf, txq,
67                                                                     &bf_head,
68 -                                                                   ts, 0, 1);
69 +                                                                   ts, 0, 1,
70 +                                                                   sta);
71                                                 break;
72                                         }
73  
74 @@ -1465,7 +1469,8 @@ static void ath_drain_txq_list(struct at
75                         ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, 0,
76                                              retry_tx);
77                 else
78 -                       ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
79 +                       ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0,
80 +                               NULL);
81                 spin_lock_bh(&txq->axq_lock);
82         }
83  }
84 @@ -1970,7 +1975,8 @@ int ath_tx_start(struct ieee80211_hw *hw
85  /*****************/
86  
87  static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
88 -                           int tx_flags, struct ath_txq *txq)
89 +                           int tx_flags, struct ath_txq *txq,
90 +                           struct ieee80211_sta *sta)
91  {
92         struct ieee80211_hw *hw = sc->hw;
93         struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
94 @@ -2028,7 +2034,8 @@ static void ath_tx_complete(struct ath_s
95  
96  static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
97                                 struct ath_txq *txq, struct list_head *bf_q,
98 -                               struct ath_tx_status *ts, int txok, int sendbar)
99 +                               struct ath_tx_status *ts, int txok, int sendbar,
100 +                               struct ieee80211_sta *sta)
101  {
102         struct sk_buff *skb = bf->bf_mpdu;
103         struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
104 @@ -2056,7 +2063,7 @@ static void ath_tx_complete_buf(struct a
105                         complete(&sc->paprd_complete);
106         } else {
107                 ath_debug_stat_tx(sc, bf, ts, txq, tx_flags);
108 -               ath_tx_complete(sc, skb, tx_flags, txq);
109 +               ath_tx_complete(sc, skb, tx_flags, txq, sta);
110         }
111         /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
112          * accidentally reference it later.
113 @@ -2145,7 +2152,7 @@ static void ath_tx_process_buffer(struct
114  
115         if (!bf_isampdu(bf)) {
116                 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok);
117 -               ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok, 0);
118 +               ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok, 0, NULL);
119         } else
120                 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true);
121