ath9k: add initial tx queueing rework patches
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 562-ath9k_get_skb_tid.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -168,6 +168,20 @@ static void ath_txq_skb_done(struct ath_
4 }
5 }
6
7 +static struct ath_atx_tid *
8 +ath_get_skb_tid(struct ath_softc *sc, struct ath_node *an, struct sk_buff *skb)
9 +{
10 + struct ieee80211_hdr *hdr;
11 + u8 tidno = 0;
12 +
13 + hdr = (struct ieee80211_hdr *) skb->data;
14 + if (ieee80211_is_data_qos(hdr->frame_control))
15 + tidno = ieee80211_get_qos_ctl(hdr)[0];
16 +
17 + tidno &= IEEE80211_QOS_CTL_TID_MASK;
18 + return ATH_AN_2_TID(an, tidno);
19 +}
20 +
21 static bool ath_tid_has_buffered(struct ath_atx_tid *tid)
22 {
23 return !skb_queue_empty(&tid->buf_q) || !skb_queue_empty(&tid->retry_q);
24 @@ -419,7 +433,6 @@ static void ath_tx_complete_aggr(struct
25 struct ieee80211_tx_rate rates[4];
26 struct ath_frame_info *fi;
27 int nframes;
28 - u8 tidno;
29 bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
30 int i, retries;
31 int bar_index = -1;
32 @@ -456,8 +469,7 @@ static void ath_tx_complete_aggr(struct
33 }
34
35 an = (struct ath_node *)sta->drv_priv;
36 - tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK;
37 - tid = ATH_AN_2_TID(an, tidno);
38 + tid = ath_get_skb_tid(sc, an, skb);
39 seq_first = tid->seq_start;
40 isba = ts->ts_flags & ATH9K_TX_BA;
41
42 @@ -469,7 +481,7 @@ static void ath_tx_complete_aggr(struct
43 * Only BlockAcks have a TID and therefore normal Acks cannot be
44 * checked
45 */
46 - if (isba && tidno != ts->tid)
47 + if (isba && tid->tidno != ts->tid)
48 txok = false;
49
50 isaggr = bf_isaggr(bf);
51 @@ -2088,7 +2100,6 @@ int ath_tx_start(struct ieee80211_hw *hw
52 struct ath_txq *txq = txctl->txq;
53 struct ath_atx_tid *tid = NULL;
54 struct ath_buf *bf;
55 - u8 tidno;
56 int q;
57 int ret;
58
59 @@ -2119,9 +2130,7 @@ int ath_tx_start(struct ieee80211_hw *hw
60 }
61
62 if (txctl->an && ieee80211_is_data_qos(hdr->frame_control)) {
63 - tidno = ieee80211_get_qos_ctl(hdr)[0] &
64 - IEEE80211_QOS_CTL_TID_MASK;
65 - tid = ATH_AN_2_TID(txctl->an, tidno);
66 + tid = ath_get_skb_tid(sc, txctl->an, skb);
67
68 WARN_ON(tid->ac->txq != txctl->txq);
69 }