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_
7 +static struct ath_atx_tid *
8 +ath_get_skb_tid(struct ath_softc *sc, struct ath_node *an, struct sk_buff *skb)
10 + struct ieee80211_hdr *hdr;
13 + hdr = (struct ieee80211_hdr *) skb->data;
14 + if (ieee80211_is_data_qos(hdr->frame_control))
15 + tidno = ieee80211_get_qos_ctl(hdr)[0];
17 + tidno &= IEEE80211_QOS_CTL_TID_MASK;
18 + return ATH_AN_2_TID(an, tidno);
21 static bool ath_tid_has_buffered(struct ath_atx_tid *tid)
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;
29 bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
32 @@ -456,8 +469,7 @@ static void ath_tx_complete_aggr(struct
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;
42 @@ -469,7 +481,7 @@ static void ath_tx_complete_aggr(struct
43 * Only BlockAcks have a TID and therefore normal Acks cannot be
46 - if (isba && tidno != ts->tid)
47 + if (isba && tid->tidno != ts->tid)
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;
59 @@ -2119,9 +2130,7 @@ int ath_tx_start(struct ieee80211_hw *hw
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);
68 WARN_ON(tid->ac->txq != txctl->txq);