1 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
2 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
3 @@ -195,7 +195,6 @@ enum ATH_AGGR_STATUS {
5 #define ATH_TXFIFO_DEPTH 8
10 struct list_head axq_q;
11 @@ -208,11 +207,12 @@ struct ath_txq {
12 struct list_head txq_fifo_pending;
19 + struct ath_txq *txq;
22 struct list_head list;
23 struct list_head tid_q;
25 @@ -290,12 +290,11 @@ struct ath_tx_control {
29 - int hwq_map[WME_NUM_AC];
31 struct list_head txbuf;
32 struct ath_txq txq[ATH9K_NUM_TX_QUEUES];
33 struct ath_descdma txdma;
34 - int pending_frames[WME_NUM_AC];
35 + struct ath_txq *txq_map[WME_NUM_AC];
39 @@ -325,7 +324,6 @@ void ath_rx_cleanup(struct ath_softc *sc
40 int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp);
41 struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype);
42 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq);
43 -int ath_tx_setup(struct ath_softc *sc, int haltype);
44 void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx);
45 void ath_draintxq(struct ath_softc *sc,
46 struct ath_txq *txq, bool retry_tx);
47 @@ -665,7 +663,6 @@ struct ath_wiphy {
49 void ath9k_tasklet(unsigned long data);
50 int ath_reset(struct ath_softc *sc, bool retry_tx);
51 -int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
52 int ath_cabq_update(struct ath_softc *);
54 static inline void ath_read_cachesize(struct ath_common *common, int *csz)
55 --- a/drivers/net/wireless/ath/ath9k/beacon.c
56 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
57 @@ -28,7 +28,7 @@ int ath_beaconq_config(struct ath_softc
58 struct ath_hw *ah = sc->sc_ah;
59 struct ath_common *common = ath9k_hw_common(ah);
60 struct ath9k_tx_queue_info qi, qi_be;
62 + struct ath_txq *txq;
64 ath9k_hw_get_txq_props(ah, sc->beacon.beaconq, &qi);
65 if (sc->sc_ah->opmode == NL80211_IFTYPE_AP) {
66 @@ -38,8 +38,8 @@ int ath_beaconq_config(struct ath_softc
69 /* Adhoc mode; important thing is to use 2x cwmin. */
70 - qnum = sc->tx.hwq_map[WME_AC_BE];
71 - ath9k_hw_get_txq_props(ah, qnum, &qi_be);
72 + txq = sc->tx.txq_map[WME_AC_BE];
73 + ath9k_hw_get_txq_props(ah, txq->axq_qnum, &qi_be);
74 qi.tqi_aifs = qi_be.tqi_aifs;
75 qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
76 qi.tqi_cwmax = qi_be.tqi_cwmax;
77 --- a/drivers/net/wireless/ath/ath9k/common.h
78 +++ b/drivers/net/wireless/ath/ath9k/common.h
80 #define WME_MAX_BA WME_BA_BMP_SIZE
81 #define ATH_TID_MAX_BUFS (2 * WME_MAX_BA)
87 +/* These must match mac80211 skb queue mapping numbers */
94 #define ATH_RSSI_DUMMY_MARKER 0x127
95 --- a/drivers/net/wireless/ath/ath9k/main.c
96 +++ b/drivers/net/wireless/ath/ath9k/main.c
97 @@ -331,7 +331,7 @@ void ath_paprd_calibrate(struct work_str
98 struct ath_tx_control txctl;
99 struct ath9k_hw_cal_data *caldata = ah->caldata;
100 struct ath_common *common = ath9k_hw_common(ah);
106 @@ -358,8 +358,7 @@ void ath_paprd_calibrate(struct work_str
107 memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
109 memset(&txctl, 0, sizeof(txctl));
110 - qnum = sc->tx.hwq_map[WME_AC_BE];
111 - txctl.txq = &sc->tx.txq[qnum];
112 + txctl.txq = sc->tx.txq_map[WME_AC_BE];
115 ar9003_paprd_init_table(ah);
116 @@ -1025,56 +1024,6 @@ int ath_reset(struct ath_softc *sc, bool
120 -static int ath_get_hal_qnum(u16 queue, struct ath_softc *sc)
126 - qnum = sc->tx.hwq_map[WME_AC_VO];
129 - qnum = sc->tx.hwq_map[WME_AC_VI];
132 - qnum = sc->tx.hwq_map[WME_AC_BE];
135 - qnum = sc->tx.hwq_map[WME_AC_BK];
138 - qnum = sc->tx.hwq_map[WME_AC_BE];
145 -int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc)
170 /* XXX: Remove me once we don't depend on ath9k_channel for all
171 * this redundant data */
172 void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
173 @@ -1244,7 +1193,6 @@ static int ath9k_tx(struct ieee80211_hw
174 struct ath_tx_control txctl;
176 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
179 if (aphy->state != ATH_WIPHY_ACTIVE && aphy->state != ATH_WIPHY_SCAN) {
180 ath_print(common, ATH_DBG_XMIT,
181 @@ -1317,8 +1265,7 @@ static int ath9k_tx(struct ieee80211_hw
182 memmove(skb->data, skb->data + padsize, padpos);
185 - qnum = ath_get_hal_qnum(skb_get_queue_mapping(skb), sc);
186 - txctl.txq = &sc->tx.txq[qnum];
187 + txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)];
189 ath_print(common, ATH_DBG_XMIT, "transmitting packet, skb: %p\n", skb);
191 @@ -1802,12 +1749,15 @@ static int ath9k_conf_tx(struct ieee8021
192 struct ath_wiphy *aphy = hw->priv;
193 struct ath_softc *sc = aphy->sc;
194 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
195 + struct ath_txq *txq;
196 struct ath9k_tx_queue_info qi;
200 if (queue >= WME_NUM_AC)
203 + txq = sc->tx.txq_map[queue];
205 mutex_lock(&sc->mutex);
207 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
208 @@ -1816,20 +1766,19 @@ static int ath9k_conf_tx(struct ieee8021
209 qi.tqi_cwmin = params->cw_min;
210 qi.tqi_cwmax = params->cw_max;
211 qi.tqi_burstTime = params->txop;
212 - qnum = ath_get_hal_qnum(queue, sc);
214 ath_print(common, ATH_DBG_CONFIG,
215 "Configure tx [queue/halq] [%d/%d], "
216 "aifs: %d, cw_min: %d, cw_max: %d, txop: %d\n",
217 - queue, qnum, params->aifs, params->cw_min,
218 + queue, txq->axq_qnum, params->aifs, params->cw_min,
219 params->cw_max, params->txop);
221 - ret = ath_txq_update(sc, qnum, &qi);
222 + ret = ath_txq_update(sc, txq->axq_qnum, &qi);
224 ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n");
226 if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC)
227 - if ((qnum == sc->tx.hwq_map[WME_AC_BE]) && !ret)
228 + if (queue == WME_AC_BE && !ret)
229 ath_beaconq_config(sc);
231 mutex_unlock(&sc->mutex);
232 --- a/drivers/net/wireless/ath/ath9k/xmit.c
233 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
234 @@ -124,7 +124,7 @@ static void ath_tx_queue_tid(struct ath_
236 static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
238 - struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
239 + struct ath_txq *txq = tid->ac->txq;
241 WARN_ON(!tid->paused);
243 @@ -142,7 +142,7 @@ unlock:
245 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
247 - struct ath_txq *txq = &sc->tx.txq[tid->ac->qnum];
248 + struct ath_txq *txq = tid->ac->txq;
250 struct list_head bf_head;
251 struct ath_tx_status ts;
252 @@ -817,7 +817,7 @@ void ath_tx_aggr_stop(struct ath_softc *
254 struct ath_node *an = (struct ath_node *)sta->drv_priv;
255 struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid);
256 - struct ath_txq *txq = &sc->tx.txq[txtid->ac->qnum];
257 + struct ath_txq *txq = txtid->ac->txq;
259 if (txtid->state & AGGR_CLEANUP)
261 @@ -888,10 +888,16 @@ struct ath_txq *ath_txq_setup(struct ath
262 struct ath_hw *ah = sc->sc_ah;
263 struct ath_common *common = ath9k_hw_common(ah);
264 struct ath9k_tx_queue_info qi;
265 + static const int subtype_txq_to_hwq[] = {
266 + [WME_AC_BE] = ATH_TXQ_AC_BE,
267 + [WME_AC_BK] = ATH_TXQ_AC_BK,
268 + [WME_AC_VI] = ATH_TXQ_AC_VI,
269 + [WME_AC_VO] = ATH_TXQ_AC_VO,
273 memset(&qi, 0, sizeof(qi));
274 - qi.tqi_subtype = subtype;
275 + qi.tqi_subtype = subtype_txq_to_hwq[subtype];
276 qi.tqi_aifs = ATH9K_TXQ_USEDEFAULT;
277 qi.tqi_cwmin = ATH9K_TXQ_USEDEFAULT;
278 qi.tqi_cwmax = ATH9K_TXQ_USEDEFAULT;
279 @@ -940,7 +946,6 @@ struct ath_txq *ath_txq_setup(struct ath
280 if (!ATH_TXQ_SETUP(sc, qnum)) {
281 struct ath_txq *txq = &sc->tx.txq[qnum];
283 - txq->axq_class = subtype;
284 txq->axq_qnum = qnum;
285 txq->axq_link = NULL;
286 INIT_LIST_HEAD(&txq->axq_q);
287 @@ -1210,24 +1215,6 @@ void ath_txq_schedule(struct ath_softc *
291 -int ath_tx_setup(struct ath_softc *sc, int haltype)
293 - struct ath_txq *txq;
295 - if (haltype >= ARRAY_SIZE(sc->tx.hwq_map)) {
296 - ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
297 - "HAL AC %u out of range, max %zu!\n",
298 - haltype, ARRAY_SIZE(sc->tx.hwq_map));
301 - txq = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, haltype);
303 - sc->tx.hwq_map[haltype] = txq->axq_qnum;
312 @@ -1747,6 +1734,7 @@ int ath_tx_start(struct ieee80211_hw *hw
316 + q = skb_get_queue_mapping(skb);
317 r = ath_tx_setup_buffer(hw, bf, skb, txctl);
319 ath_print(common, ATH_DBG_FATAL, "TX mem alloc failure\n");
320 @@ -1756,8 +1744,9 @@ int ath_tx_start(struct ieee80211_hw *hw
321 * we will at least have to run TX completionon one buffer
323 spin_lock_bh(&txq->axq_lock);
324 - if (!txq->stopped && txq->axq_depth > 1) {
325 - ath_mac80211_stop_queue(sc, skb_get_queue_mapping(skb));
326 + if (txq == sc->tx.txq_map[q] && !txq->stopped &&
327 + txq->axq_depth > 1) {
328 + ath_mac80211_stop_queue(sc, q);
331 spin_unlock_bh(&txq->axq_lock);
332 @@ -1767,13 +1756,10 @@ int ath_tx_start(struct ieee80211_hw *hw
336 - q = skb_get_queue_mapping(skb);
340 spin_lock_bh(&txq->axq_lock);
341 - if (++sc->tx.pending_frames[q] > ATH_MAX_QDEPTH && !txq->stopped) {
342 - ath_mac80211_stop_queue(sc, skb_get_queue_mapping(skb));
343 + if (txq == sc->tx.txq_map[q] &&
344 + ++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
345 + ath_mac80211_stop_queue(sc, q);
348 spin_unlock_bh(&txq->axq_lock);
349 @@ -1887,12 +1873,12 @@ static void ath_tx_complete(struct ath_s
350 if (unlikely(tx_info->pad[0] & ATH_TX_INFO_FRAME_TYPE_INTERNAL))
351 ath9k_tx_status(hw, skb);
353 - q = skb_get_queue_mapping(skb);
356 + struct ath_txq *txq;
358 - if (--sc->tx.pending_frames[q] < 0)
359 - sc->tx.pending_frames[q] = 0;
360 + q = skb_get_queue_mapping(skb);
361 + txq = sc->tx.txq_map[q];
362 + if (--txq->pending_frames < 0)
363 + txq->pending_frames = 0;
365 ieee80211_tx_status(hw, skb);
367 @@ -1927,7 +1913,7 @@ static void ath_tx_complete_buf(struct a
369 complete(&sc->paprd_complete);
371 - ath_debug_stat_tx(sc, txq, bf, ts);
372 + ath_debug_stat_tx(sc, bf, ts);
373 ath_tx_complete(sc, skb, bf->aphy, tx_flags);
375 /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
376 @@ -2018,16 +2004,13 @@ static void ath_tx_rc_status(struct ath_
377 tx_info->status.rates[tx_rateindex].count = ts->ts_longretry + 1;
380 -static void ath_wake_mac80211_queue(struct ath_softc *sc, struct ath_txq *txq)
381 +static void ath_wake_mac80211_queue(struct ath_softc *sc, int qnum)
385 - qnum = ath_get_mac80211_qnum(txq->axq_class, sc);
388 + struct ath_txq *txq;
390 + txq = sc->tx.txq_map[qnum];
391 spin_lock_bh(&txq->axq_lock);
392 - if (txq->stopped && sc->tx.pending_frames[qnum] < ATH_MAX_QDEPTH) {
393 + if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
394 if (ath_mac80211_start_queue(sc, qnum))
397 @@ -2044,6 +2027,7 @@ static void ath_tx_processq(struct ath_s
398 struct ath_tx_status ts;
403 ath_print(common, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n",
404 txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum),
405 @@ -2119,12 +2103,15 @@ static void ath_tx_processq(struct ath_s
406 ath_tx_rc_status(bf, &ts, txok ? 0 : 1, txok, true);
409 + qnum = skb_get_queue_mapping(bf->bf_mpdu);
412 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, txok);
414 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, txok, 0);
416 - ath_wake_mac80211_queue(sc, txq);
417 + if (txq == sc->tx.txq_map[qnum])
418 + ath_wake_mac80211_queue(sc, qnum);
420 spin_lock_bh(&txq->axq_lock);
421 if (sc->sc_flags & SC_OP_TXAGGR)
422 @@ -2194,6 +2181,7 @@ void ath_tx_edma_tasklet(struct ath_soft
423 struct list_head bf_head;
429 status = ath9k_hw_txprocdesc(ah, NULL, (void *)&txs);
430 @@ -2237,13 +2225,16 @@ void ath_tx_edma_tasklet(struct ath_soft
431 ath_tx_rc_status(bf, &txs, txok ? 0 : 1, txok, true);
434 + qnum = skb_get_queue_mapping(bf->bf_mpdu);
437 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &txs, txok);
439 ath_tx_complete_buf(sc, bf, txq, &bf_head,
442 - ath_wake_mac80211_queue(sc, txq);
443 + if (txq == sc->tx.txq_map[qnum])
444 + ath_wake_mac80211_queue(sc, qnum);
446 spin_lock_bh(&txq->axq_lock);
447 if (!list_empty(&txq->txq_fifo_pending)) {
448 @@ -2375,7 +2366,7 @@ void ath_tx_node_init(struct ath_softc *
449 for (acno = 0, ac = &an->ac[acno];
450 acno < WME_NUM_AC; acno++, ac++) {
452 - ac->qnum = sc->tx.hwq_map[acno];
453 + ac->txq = sc->tx.txq_map[acno];
454 INIT_LIST_HEAD(&ac->tid_q);
457 @@ -2385,17 +2376,13 @@ void ath_tx_node_cleanup(struct ath_soft
458 struct ath_atx_ac *ac;
459 struct ath_atx_tid *tid;
464 for (tidno = 0, tid = &an->tid[tidno];
465 tidno < WME_NUM_TID; tidno++, tid++) {
468 - if (!ATH_TXQ_SETUP(sc, i))
471 - txq = &sc->tx.txq[i];
475 spin_lock_bh(&txq->axq_lock);
477 --- a/drivers/net/wireless/ath/ath9k/hw.h
478 +++ b/drivers/net/wireless/ath/ath9k/hw.h
480 #define PAPRD_GAIN_TABLE_ENTRIES 32
481 #define PAPRD_TABLE_SZ 24
483 +enum ath_hw_txq_subtype {
490 enum ath_ini_subsys {
493 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
494 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
499 +static const int subtype_txq_to_hwq[] = {
500 + [WME_AC_BE] = ATH_TXQ_AC_BE,
501 + [WME_AC_BK] = ATH_TXQ_AC_BK,
502 + [WME_AC_VI] = ATH_TXQ_AC_VI,
503 + [WME_AC_VO] = ATH_TXQ_AC_VO,
506 #define ATH9K_HTC_INIT_TXQ(subtype) do { \
507 - qi.tqi_subtype = subtype; \
508 + qi.tqi_subtype = subtype_txq_to_hwq[subtype]; \
509 qi.tqi_aifs = ATH9K_TXQ_USEDEFAULT; \
510 qi.tqi_cwmin = ATH9K_TXQ_USEDEFAULT; \
511 qi.tqi_cwmax = ATH9K_TXQ_USEDEFAULT; \
512 --- a/drivers/net/wireless/ath/ath9k/init.c
513 +++ b/drivers/net/wireless/ath/ath9k/init.c
514 @@ -396,7 +396,8 @@ static void ath9k_init_crypto(struct ath
516 static int ath9k_init_btcoex(struct ath_softc *sc)
519 + struct ath_txq *txq;
522 switch (sc->sc_ah->btcoex_hw.scheme) {
523 case ATH_BTCOEX_CFG_NONE:
524 @@ -409,8 +410,8 @@ static int ath9k_init_btcoex(struct ath_
525 r = ath_init_btcoex_timer(sc);
528 - qnum = sc->tx.hwq_map[WME_AC_BE];
529 - ath9k_hw_init_btcoex_hw(sc->sc_ah, qnum);
530 + txq = sc->tx.txq_map[WME_AC_BE];
531 + ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum);
532 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
535 @@ -423,59 +424,18 @@ static int ath9k_init_btcoex(struct ath_
537 static int ath9k_init_queues(struct ath_softc *sc)
539 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
542 - for (i = 0; i < ARRAY_SIZE(sc->tx.hwq_map); i++)
543 - sc->tx.hwq_map[i] = -1;
545 sc->beacon.beaconq = ath9k_hw_beaconq_setup(sc->sc_ah);
546 - if (sc->beacon.beaconq == -1) {
547 - ath_print(common, ATH_DBG_FATAL,
548 - "Unable to setup a beacon xmit queue\n");
552 sc->beacon.cabq = ath_txq_setup(sc, ATH9K_TX_QUEUE_CAB, 0);
553 - if (sc->beacon.cabq == NULL) {
554 - ath_print(common, ATH_DBG_FATAL,
555 - "Unable to setup CAB xmit queue\n");
559 sc->config.cabqReadytime = ATH_CABQ_READY_TIME;
562 - if (!ath_tx_setup(sc, WME_AC_BK)) {
563 - ath_print(common, ATH_DBG_FATAL,
564 - "Unable to setup xmit queue for BK traffic\n");
568 - if (!ath_tx_setup(sc, WME_AC_BE)) {
569 - ath_print(common, ATH_DBG_FATAL,
570 - "Unable to setup xmit queue for BE traffic\n");
573 - if (!ath_tx_setup(sc, WME_AC_VI)) {
574 - ath_print(common, ATH_DBG_FATAL,
575 - "Unable to setup xmit queue for VI traffic\n");
578 - if (!ath_tx_setup(sc, WME_AC_VO)) {
579 - ath_print(common, ATH_DBG_FATAL,
580 - "Unable to setup xmit queue for VO traffic\n");
583 + for (i = 0; i < WME_NUM_AC; i++)
584 + sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i);
589 - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
590 - if (ATH_TXQ_SETUP(sc, i))
591 - ath_tx_cleanupq(sc, &sc->tx.txq[i]);
596 static int ath9k_init_channels_rates(struct ath_softc *sc)
597 --- a/drivers/net/wireless/ath/ath9k/virtual.c
598 +++ b/drivers/net/wireless/ath/ath9k/virtual.c
599 @@ -187,7 +187,7 @@ static int ath9k_send_nullfunc(struct at
600 info->control.rates[1].idx = -1;
602 memset(&txctl, 0, sizeof(struct ath_tx_control));
603 - txctl.txq = &sc->tx.txq[sc->tx.hwq_map[WME_AC_VO]];
604 + txctl.txq = sc->tx.txq_map[WME_AC_VO];
605 txctl.frame_type = ps ? ATH9K_IFT_PAUSE : ATH9K_IFT_UNPAUSE;
607 if (ath_tx_start(aphy->hw, skb, &txctl) != 0)
608 --- a/drivers/net/wireless/ath/ath9k/debug.c
609 +++ b/drivers/net/wireless/ath/ath9k/debug.c
610 @@ -579,10 +579,10 @@ static const struct file_operations fops
612 len += snprintf(buf + len, size - len, \
613 "%s%13u%11u%10u%10u\n", str, \
614 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BE]].elem, \
615 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BK]].elem, \
616 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VI]].elem, \
617 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VO]].elem); \
618 + sc->debug.stats.txstats[WME_AC_BE].elem, \
619 + sc->debug.stats.txstats[WME_AC_BK].elem, \
620 + sc->debug.stats.txstats[WME_AC_VI].elem, \
621 + sc->debug.stats.txstats[WME_AC_VO].elem); \
624 static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
625 @@ -624,33 +624,35 @@ static ssize_t read_file_xmit(struct fil
629 -void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
630 - struct ath_buf *bf, struct ath_tx_status *ts)
631 +void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
632 + struct ath_tx_status *ts)
634 - TX_STAT_INC(txq->axq_qnum, tx_pkts_all);
635 - sc->debug.stats.txstats[txq->axq_qnum].tx_bytes_all += bf->bf_mpdu->len;
636 + int qnum = skb_get_queue_mapping(bf->bf_mpdu);
638 + TX_STAT_INC(qnum, tx_pkts_all);
639 + sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len;
641 if (bf_isampdu(bf)) {
642 if (bf_isxretried(bf))
643 - TX_STAT_INC(txq->axq_qnum, a_xretries);
644 + TX_STAT_INC(qnum, a_xretries);
646 - TX_STAT_INC(txq->axq_qnum, a_completed);
647 + TX_STAT_INC(qnum, a_completed);
649 - TX_STAT_INC(txq->axq_qnum, completed);
650 + TX_STAT_INC(qnum, completed);
653 if (ts->ts_status & ATH9K_TXERR_FIFO)
654 - TX_STAT_INC(txq->axq_qnum, fifo_underrun);
655 + TX_STAT_INC(qnum, fifo_underrun);
656 if (ts->ts_status & ATH9K_TXERR_XTXOP)
657 - TX_STAT_INC(txq->axq_qnum, xtxop);
658 + TX_STAT_INC(qnum, xtxop);
659 if (ts->ts_status & ATH9K_TXERR_TIMER_EXPIRED)
660 - TX_STAT_INC(txq->axq_qnum, timer_exp);
661 + TX_STAT_INC(qnum, timer_exp);
662 if (ts->ts_flags & ATH9K_TX_DESC_CFG_ERR)
663 - TX_STAT_INC(txq->axq_qnum, desc_cfg_err);
664 + TX_STAT_INC(qnum, desc_cfg_err);
665 if (ts->ts_flags & ATH9K_TX_DATA_UNDERRUN)
666 - TX_STAT_INC(txq->axq_qnum, data_underrun);
667 + TX_STAT_INC(qnum, data_underrun);
668 if (ts->ts_flags & ATH9K_TX_DELIM_UNDERRUN)
669 - TX_STAT_INC(txq->axq_qnum, delim_underrun);
670 + TX_STAT_INC(qnum, delim_underrun);
673 static const struct file_operations fops_xmit = {
674 --- a/drivers/net/wireless/ath/ath9k/debug.h
675 +++ b/drivers/net/wireless/ath/ath9k/debug.h
676 @@ -169,8 +169,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
677 int ath9k_debug_create_root(void);
678 void ath9k_debug_remove_root(void);
679 void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
680 -void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
681 - struct ath_buf *bf, struct ath_tx_status *ts);
682 +void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
683 + struct ath_tx_status *ts);
684 void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs);