1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -200,6 +200,7 @@ struct ath_atx_ac {
6 struct ath_frame_info {
10 enum ath9k_key_type keytype;
11 @@ -230,7 +231,7 @@ struct ath_buf {
14 struct list_head list;
15 - struct list_head buf_q;
16 + struct sk_buff_head buf_q;
18 struct ath_atx_ac *ac;
19 unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)];
20 --- a/drivers/net/wireless/ath/ath9k/debug.c
21 +++ b/drivers/net/wireless/ath/ath9k/debug.c
22 @@ -711,7 +711,7 @@ static ssize_t read_file_stations(struct
23 " tid: %p %s %s %i %p %p\n",
24 tid, tid->sched ? "sched" : "idle",
25 tid->paused ? "paused" : "running",
26 - list_empty(&tid->buf_q),
27 + skb_queue_empty(&tid->buf_q),
31 --- a/drivers/net/wireless/ath/ath9k/xmit.c
32 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
33 @@ -128,7 +128,7 @@ static void ath_tx_resume_tid(struct ath
34 spin_lock_bh(&txq->axq_lock);
37 - if (list_empty(&tid->buf_q))
38 + if (skb_queue_empty(&tid->buf_q))
41 ath_tx_queue_tid(txq, tid);
42 @@ -148,6 +148,7 @@ static struct ath_frame_info *get_frame_
43 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
45 struct ath_txq *txq = tid->ac->txq;
46 + struct sk_buff *skb;
48 struct list_head bf_head;
49 struct ath_tx_status ts;
50 @@ -158,12 +159,13 @@ static void ath_tx_flush_tid(struct ath_
51 memset(&ts, 0, sizeof(ts));
52 spin_lock_bh(&txq->axq_lock);
54 - while (!list_empty(&tid->buf_q)) {
55 - bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
56 - list_move_tail(&bf->list, &bf_head);
57 + while ((skb = __skb_dequeue(&tid->buf_q))) {
58 + fi = get_frame_info(skb);
61 + list_add_tail(&bf->list, &bf_head);
63 spin_unlock_bh(&txq->axq_lock);
64 - fi = get_frame_info(bf->bf_mpdu);
66 ath_tx_update_baw(sc, tid, fi->seqno);
67 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
68 @@ -218,6 +220,7 @@ static void ath_tid_drain(struct ath_sof
69 struct ath_atx_tid *tid)
72 + struct sk_buff *skb;
74 struct list_head bf_head;
75 struct ath_tx_status ts;
76 @@ -226,14 +229,12 @@ static void ath_tid_drain(struct ath_sof
77 memset(&ts, 0, sizeof(ts));
78 INIT_LIST_HEAD(&bf_head);
81 - if (list_empty(&tid->buf_q))
83 + while ((skb = __skb_dequeue(&tid->buf_q))) {
84 + fi = get_frame_info(skb);
87 - bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
88 - list_move_tail(&bf->list, &bf_head);
89 + list_add_tail(&bf->list, &bf_head);
91 - fi = get_frame_info(bf->bf_mpdu);
93 ath_tx_update_baw(sc, tid, fi->seqno);
95 @@ -351,7 +352,8 @@ static void ath_tx_complete_aggr(struct
96 struct ieee80211_tx_info *tx_info;
97 struct ath_atx_tid *tid = NULL;
98 struct ath_buf *bf_next, *bf_last = bf->bf_lastbf;
99 - struct list_head bf_head, bf_pending;
100 + struct list_head bf_head;
101 + struct sk_buff_head bf_pending;
102 u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0;
103 u32 ba[WME_BA_BMP_SIZE >> 5];
104 int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
105 @@ -428,8 +430,7 @@ static void ath_tx_complete_aggr(struct
109 - INIT_LIST_HEAD(&bf_pending);
110 - INIT_LIST_HEAD(&bf_head);
111 + __skb_queue_head_init(&bf_pending);
113 ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad);
115 @@ -474,10 +475,10 @@ static void ath_tx_complete_aggr(struct
116 * Make sure the last desc is reclaimed if it
117 * not a holding desc.
119 - if (!bf_last->bf_stale || bf_next != NULL)
120 + INIT_LIST_HEAD(&bf_head);
121 + if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) ||
122 + bf_next != NULL || !bf_last->bf_stale)
123 list_move_tail(&bf->list, &bf_head);
125 - INIT_LIST_HEAD(&bf_head);
127 if (!txpending || (tid->state & AGGR_CLEANUP)) {
129 @@ -528,7 +529,7 @@ static void ath_tx_complete_aggr(struct
131 ath9k_hw_cleartxdesc(sc->sc_ah,
133 - list_add_tail(&tbf->list, &bf_head);
137 * Clear descriptor status words for
138 @@ -543,21 +544,21 @@ static void ath_tx_complete_aggr(struct
139 * Put this buffer to the temporary pending
140 * queue to retain ordering
142 - list_splice_tail_init(&bf_head, &bf_pending);
143 + __skb_queue_tail(&bf_pending, skb);
149 /* prepend un-acked frames to the beginning of the pending frame queue */
150 - if (!list_empty(&bf_pending)) {
151 + if (!skb_queue_empty(&bf_pending)) {
153 ieee80211_sta_set_tim(sta);
155 spin_lock_bh(&txq->axq_lock);
157 tid->ac->clear_ps_filter = true;
158 - list_splice(&bf_pending, &tid->buf_q);
159 + skb_queue_splice(&bf_pending, &tid->buf_q);
161 ath_tx_queue_tid(txq, tid);
162 spin_unlock_bh(&txq->axq_lock);
163 @@ -722,19 +723,22 @@ static enum ATH_AGGR_STATUS ath_tx_form_
166 #define PADBYTES(_len) ((4 - ((_len) % 4)) % 4)
167 - struct ath_buf *bf, *bf_first, *bf_prev = NULL;
168 + struct ath_buf *bf, *bf_first = NULL, *bf_prev = NULL;
169 int rl = 0, nframes = 0, ndelim, prev_al = 0;
170 u16 aggr_limit = 0, al = 0, bpad = 0,
171 al_delta, h_baw = tid->baw_size / 2;
172 enum ATH_AGGR_STATUS status = ATH_AGGR_DONE;
173 struct ieee80211_tx_info *tx_info;
174 struct ath_frame_info *fi;
176 - bf_first = list_first_entry(&tid->buf_q, struct ath_buf, list);
177 + struct sk_buff *skb;
180 - bf = list_first_entry(&tid->buf_q, struct ath_buf, list);
181 - fi = get_frame_info(bf->bf_mpdu);
182 + skb = skb_peek(&tid->buf_q);
183 + fi = get_frame_info(skb);
189 /* do not step over block-ack window */
190 if (!BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno)) {
191 @@ -785,7 +789,9 @@ static enum ATH_AGGR_STATUS ath_tx_form_
193 ath_tx_addto_baw(sc, tid, fi->seqno);
194 ath9k_hw_set11n_aggr_middle(sc->sc_ah, bf->bf_desc, ndelim);
195 - list_move_tail(&bf->list, bf_q);
197 + __skb_unlink(skb, &tid->buf_q);
198 + list_add_tail(&bf->list, bf_q);
200 bf_prev->bf_next = bf;
201 ath9k_hw_set_desc_link(sc->sc_ah, bf_prev->bf_desc,
202 @@ -793,7 +799,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_
206 - } while (!list_empty(&tid->buf_q));
207 + } while (!skb_queue_empty(&tid->buf_q));
211 @@ -811,7 +817,7 @@ static void ath_tx_sched_aggr(struct ath
215 - if (list_empty(&tid->buf_q))
216 + if (skb_queue_empty(&tid->buf_q))
219 INIT_LIST_HEAD(&bf_q);
220 @@ -933,7 +939,7 @@ bool ath_tx_aggr_sleep(struct ath_softc
222 spin_lock_bh(&txq->axq_lock);
224 - if (!list_empty(&tid->buf_q))
225 + if (!skb_queue_empty(&tid->buf_q))
229 @@ -966,7 +972,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
230 spin_lock_bh(&txq->axq_lock);
231 ac->clear_ps_filter = true;
233 - if (!list_empty(&tid->buf_q) && !tid->paused) {
234 + if (!skb_queue_empty(&tid->buf_q) && !tid->paused) {
235 ath_tx_queue_tid(txq, tid);
236 ath_txq_schedule(sc, txq);
238 @@ -1308,7 +1314,7 @@ void ath_txq_schedule(struct ath_softc *
239 * add tid to round-robin queue if more frames
240 * are pending for the tid
242 - if (!list_empty(&tid->buf_q))
243 + if (!skb_queue_empty(&tid->buf_q))
244 ath_tx_queue_tid(txq, tid);
246 if (tid == last_tid ||
247 @@ -1414,7 +1420,7 @@ static void ath_tx_send_ampdu(struct ath
248 * - seqno is not within block-ack window
249 * - h/w queue depth exceeds low water mark
251 - if (!list_empty(&tid->buf_q) || tid->paused ||
252 + if (!skb_queue_empty(&tid->buf_q) || tid->paused ||
253 !BAW_WITHIN(tid->seq_start, tid->baw_size, fi->seqno) ||
254 txctl->txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) {
256 @@ -1422,7 +1428,7 @@ static void ath_tx_send_ampdu(struct ath
259 TX_STAT_INC(txctl->txq->axq_qnum, a_queued_sw);
260 - list_add_tail(&bf->list, &tid->buf_q);
261 + __skb_queue_tail(&tid->buf_q, bf->bf_mpdu);
262 if (!txctl->an || !txctl->an->sleeping)
263 ath_tx_queue_tid(txctl->txq, tid);
265 @@ -1753,6 +1759,7 @@ static struct ath_buf *ath_tx_setup_buff
273 @@ -2364,7 +2371,7 @@ void ath_tx_node_init(struct ath_softc *
276 tid->state &= ~AGGR_CLEANUP;
277 - INIT_LIST_HEAD(&tid->buf_q);
278 + __skb_queue_head_init(&tid->buf_q);
279 acno = TID_TO_WME_AC(tidno);
280 tid->ac = &an->ac[acno];
281 tid->state &= ~AGGR_ADDBA_COMPLETE;