Commit 1803d02d authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: add function for getting the tx tid for a packet

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent bb195ff6
...@@ -168,6 +168,20 @@ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, ...@@ -168,6 +168,20 @@ static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq,
} }
} }
static struct ath_atx_tid *
ath_get_skb_tid(struct ath_softc *sc, struct ath_node *an, struct sk_buff *skb)
{
struct ieee80211_hdr *hdr;
u8 tidno = 0;
hdr = (struct ieee80211_hdr *) skb->data;
if (ieee80211_is_data_qos(hdr->frame_control))
tidno = ieee80211_get_qos_ctl(hdr)[0];
tidno &= IEEE80211_QOS_CTL_TID_MASK;
return ATH_AN_2_TID(an, tidno);
}
static bool ath_tid_has_buffered(struct ath_atx_tid *tid) static bool ath_tid_has_buffered(struct ath_atx_tid *tid)
{ {
return !skb_queue_empty(&tid->buf_q) || !skb_queue_empty(&tid->retry_q); return !skb_queue_empty(&tid->buf_q) || !skb_queue_empty(&tid->retry_q);
...@@ -419,7 +433,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, ...@@ -419,7 +433,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
struct ieee80211_tx_rate rates[4]; struct ieee80211_tx_rate rates[4];
struct ath_frame_info *fi; struct ath_frame_info *fi;
int nframes; int nframes;
u8 tidno;
bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH); bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
int i, retries; int i, retries;
int bar_index = -1; int bar_index = -1;
...@@ -456,8 +469,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, ...@@ -456,8 +469,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
} }
an = (struct ath_node *)sta->drv_priv; an = (struct ath_node *)sta->drv_priv;
tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK; tid = ath_get_skb_tid(sc, an, skb);
tid = ATH_AN_2_TID(an, tidno);
seq_first = tid->seq_start; seq_first = tid->seq_start;
isba = ts->ts_flags & ATH9K_TX_BA; isba = ts->ts_flags & ATH9K_TX_BA;
...@@ -469,7 +481,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, ...@@ -469,7 +481,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
* Only BlockAcks have a TID and therefore normal Acks cannot be * Only BlockAcks have a TID and therefore normal Acks cannot be
* checked * checked
*/ */
if (isba && tidno != ts->tid) if (isba && tid->tidno != ts->tid)
txok = false; txok = false;
isaggr = bf_isaggr(bf); isaggr = bf_isaggr(bf);
...@@ -2116,7 +2128,6 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -2116,7 +2128,6 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ath_txq *txq = txctl->txq; struct ath_txq *txq = txctl->txq;
struct ath_atx_tid *tid = NULL; struct ath_atx_tid *tid = NULL;
struct ath_buf *bf; struct ath_buf *bf;
u8 tidno;
int q; int q;
int ret; int ret;
...@@ -2147,9 +2158,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb, ...@@ -2147,9 +2158,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
} }
if (txctl->an && ieee80211_is_data_qos(hdr->frame_control)) { if (txctl->an && ieee80211_is_data_qos(hdr->frame_control)) {
tidno = ieee80211_get_qos_ctl(hdr)[0] & tid = ath_get_skb_tid(sc, txctl->an, skb);
IEEE80211_QOS_CTL_TID_MASK;
tid = ATH_AN_2_TID(txctl->an, tidno);
WARN_ON(tid->ac->txq != txctl->txq); WARN_ON(tid->ac->txq != txctl->txq);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment