ath9k: add initial tx queueing rework patches
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 561-ath9k_split_tid_queue.patch
1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -241,6 +241,7 @@ struct ath_buf {
4 struct ath_atx_tid {
5 struct list_head list;
6 struct sk_buff_head buf_q;
7 + struct sk_buff_head retry_q;
8 struct ath_node *an;
9 struct ath_atx_ac *ac;
10 unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)];
11 --- a/drivers/net/wireless/ath/ath9k/xmit.c
12 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
13 @@ -170,12 +170,18 @@ static void ath_txq_skb_done(struct ath_
14
15 static bool ath_tid_has_buffered(struct ath_atx_tid *tid)
16 {
17 - return !skb_queue_empty(&tid->buf_q);
18 + return !skb_queue_empty(&tid->buf_q) || !skb_queue_empty(&tid->retry_q);
19 }
20
21 static struct sk_buff *ath_tid_dequeue(struct ath_atx_tid *tid)
22 {
23 - return __skb_dequeue(&tid->buf_q);
24 + struct sk_buff *skb;
25 +
26 + skb = __skb_dequeue(&tid->retry_q);
27 + if (!skb)
28 + skb = __skb_dequeue(&tid->buf_q);
29 +
30 + return skb;
31 }
32
33 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
34 @@ -593,7 +599,7 @@ static void ath_tx_complete_aggr(struct
35 if (an->sleeping)
36 ieee80211_sta_set_buffered(sta, tid->tidno, true);
37
38 - skb_queue_splice(&bf_pending, &tid->buf_q);
39 + skb_queue_splice_tail(&bf_pending, &tid->retry_q);
40 if (!an->sleeping) {
41 ath_tx_queue_tid(txq, tid);
42
43 @@ -833,7 +839,10 @@ ath_tx_get_tid_subframe(struct ath_softc
44 u16 seqno;
45
46 while (1) {
47 - *q = &tid->buf_q;
48 + *q = &tid->retry_q;
49 + if (skb_queue_empty(*q))
50 + *q = &tid->buf_q;
51 +
52 skb = skb_peek(*q);
53 if (!skb)
54 break;
55 @@ -2608,6 +2617,7 @@ void ath_tx_node_init(struct ath_softc *
56 tid->paused = false;
57 tid->active = false;
58 __skb_queue_head_init(&tid->buf_q);
59 + __skb_queue_head_init(&tid->retry_q);
60 acno = TID_TO_WME_AC(tidno);
61 tid->ac = &an->ac[acno];
62 }