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 @@ -1708,6 +1695,7 @@ static void ath_tx_start_dma(struct ath_
316 + WARN_ON(tid->ac->txq != txctl->txq);
317 if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
319 * Try aggregation if it's a unicast data frame
320 @@ -1747,6 +1735,7 @@ int ath_tx_start(struct ieee80211_hw *hw
324 + q = skb_get_queue_mapping(skb);
325 r = ath_tx_setup_buffer(hw, bf, skb, txctl);
327 ath_print(common, ATH_DBG_FATAL, "TX mem alloc failure\n");
328 @@ -1756,8 +1745,9 @@ int ath_tx_start(struct ieee80211_hw *hw
329 * we will at least have to run TX completionon one buffer
331 spin_lock_bh(&txq->axq_lock);
332 - if (!txq->stopped && txq->axq_depth > 1) {
333 - ath_mac80211_stop_queue(sc, skb_get_queue_mapping(skb));
334 + if (txq == sc->tx.txq_map[q] && !txq->stopped &&
335 + txq->axq_depth > 1) {
336 + ath_mac80211_stop_queue(sc, q);
339 spin_unlock_bh(&txq->axq_lock);
340 @@ -1767,13 +1757,10 @@ int ath_tx_start(struct ieee80211_hw *hw
344 - q = skb_get_queue_mapping(skb);
348 spin_lock_bh(&txq->axq_lock);
349 - if (++sc->tx.pending_frames[q] > ATH_MAX_QDEPTH && !txq->stopped) {
350 - ath_mac80211_stop_queue(sc, skb_get_queue_mapping(skb));
351 + if (txq == sc->tx.txq_map[q] &&
352 + ++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
353 + ath_mac80211_stop_queue(sc, q);
356 spin_unlock_bh(&txq->axq_lock);
357 @@ -1841,7 +1828,8 @@ exit:
360 static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
361 - struct ath_wiphy *aphy, int tx_flags)
362 + struct ath_wiphy *aphy, int tx_flags,
363 + struct ath_txq *txq)
365 struct ieee80211_hw *hw = sc->hw;
366 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
367 @@ -1888,11 +1876,12 @@ static void ath_tx_complete(struct ath_s
368 ath9k_tx_status(hw, skb);
370 q = skb_get_queue_mapping(skb);
374 - if (--sc->tx.pending_frames[q] < 0)
375 - sc->tx.pending_frames[q] = 0;
376 + if (txq == sc->tx.txq_map[q]) {
377 + spin_lock_bh(&txq->axq_lock);
378 + if (WARN_ON(--txq->pending_frames < 0))
379 + txq->pending_frames = 0;
380 + spin_unlock_bh(&txq->axq_lock);
383 ieee80211_tx_status(hw, skb);
385 @@ -1927,8 +1916,8 @@ static void ath_tx_complete_buf(struct a
387 complete(&sc->paprd_complete);
389 - ath_debug_stat_tx(sc, txq, bf, ts);
390 - ath_tx_complete(sc, skb, bf->aphy, tx_flags);
391 + ath_debug_stat_tx(sc, bf, ts);
392 + ath_tx_complete(sc, skb, bf->aphy, tx_flags, txq);
394 /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
395 * accidentally reference it later.
396 @@ -2018,16 +2007,13 @@ static void ath_tx_rc_status(struct ath_
397 tx_info->status.rates[tx_rateindex].count = ts->ts_longretry + 1;
400 -static void ath_wake_mac80211_queue(struct ath_softc *sc, struct ath_txq *txq)
401 +static void ath_wake_mac80211_queue(struct ath_softc *sc, int qnum)
405 - qnum = ath_get_mac80211_qnum(txq->axq_class, sc);
408 + struct ath_txq *txq;
410 + txq = sc->tx.txq_map[qnum];
411 spin_lock_bh(&txq->axq_lock);
412 - if (txq->stopped && sc->tx.pending_frames[qnum] < ATH_MAX_QDEPTH) {
413 + if (txq->stopped && txq->pending_frames < ATH_MAX_QDEPTH) {
414 if (ath_mac80211_start_queue(sc, qnum))
417 @@ -2044,6 +2030,7 @@ static void ath_tx_processq(struct ath_s
418 struct ath_tx_status ts;
423 ath_print(common, ATH_DBG_QUEUE, "tx queue %d (%x), link %p\n",
424 txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum),
425 @@ -2119,12 +2106,15 @@ static void ath_tx_processq(struct ath_s
426 ath_tx_rc_status(bf, &ts, txok ? 0 : 1, txok, true);
429 + qnum = skb_get_queue_mapping(bf->bf_mpdu);
432 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, txok);
434 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, txok, 0);
436 - ath_wake_mac80211_queue(sc, txq);
437 + if (txq == sc->tx.txq_map[qnum])
438 + ath_wake_mac80211_queue(sc, qnum);
440 spin_lock_bh(&txq->axq_lock);
441 if (sc->sc_flags & SC_OP_TXAGGR)
442 @@ -2194,6 +2184,7 @@ void ath_tx_edma_tasklet(struct ath_soft
443 struct list_head bf_head;
449 status = ath9k_hw_txprocdesc(ah, NULL, (void *)&txs);
450 @@ -2237,13 +2228,16 @@ void ath_tx_edma_tasklet(struct ath_soft
451 ath_tx_rc_status(bf, &txs, txok ? 0 : 1, txok, true);
454 + qnum = skb_get_queue_mapping(bf->bf_mpdu);
457 ath_tx_complete_aggr(sc, txq, bf, &bf_head, &txs, txok);
459 ath_tx_complete_buf(sc, bf, txq, &bf_head,
462 - ath_wake_mac80211_queue(sc, txq);
463 + if (txq == sc->tx.txq_map[qnum])
464 + ath_wake_mac80211_queue(sc, qnum);
466 spin_lock_bh(&txq->axq_lock);
467 if (!list_empty(&txq->txq_fifo_pending)) {
468 @@ -2375,7 +2369,7 @@ void ath_tx_node_init(struct ath_softc *
469 for (acno = 0, ac = &an->ac[acno];
470 acno < WME_NUM_AC; acno++, ac++) {
472 - ac->qnum = sc->tx.hwq_map[acno];
473 + ac->txq = sc->tx.txq_map[acno];
474 INIT_LIST_HEAD(&ac->tid_q);
477 @@ -2385,17 +2379,13 @@ void ath_tx_node_cleanup(struct ath_soft
478 struct ath_atx_ac *ac;
479 struct ath_atx_tid *tid;
484 for (tidno = 0, tid = &an->tid[tidno];
485 tidno < WME_NUM_TID; tidno++, tid++) {
488 - if (!ATH_TXQ_SETUP(sc, i))
491 - txq = &sc->tx.txq[i];
495 spin_lock_bh(&txq->axq_lock);
497 --- a/drivers/net/wireless/ath/ath9k/hw.h
498 +++ b/drivers/net/wireless/ath/ath9k/hw.h
500 #define PAPRD_GAIN_TABLE_ENTRIES 32
501 #define PAPRD_TABLE_SZ 24
503 +enum ath_hw_txq_subtype {
510 enum ath_ini_subsys {
513 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
514 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
519 +static const int subtype_txq_to_hwq[] = {
520 + [WME_AC_BE] = ATH_TXQ_AC_BE,
521 + [WME_AC_BK] = ATH_TXQ_AC_BK,
522 + [WME_AC_VI] = ATH_TXQ_AC_VI,
523 + [WME_AC_VO] = ATH_TXQ_AC_VO,
526 #define ATH9K_HTC_INIT_TXQ(subtype) do { \
527 - qi.tqi_subtype = subtype; \
528 + qi.tqi_subtype = subtype_txq_to_hwq[subtype]; \
529 qi.tqi_aifs = ATH9K_TXQ_USEDEFAULT; \
530 qi.tqi_cwmin = ATH9K_TXQ_USEDEFAULT; \
531 qi.tqi_cwmax = ATH9K_TXQ_USEDEFAULT; \
532 --- a/drivers/net/wireless/ath/ath9k/init.c
533 +++ b/drivers/net/wireless/ath/ath9k/init.c
534 @@ -396,7 +396,8 @@ static void ath9k_init_crypto(struct ath
536 static int ath9k_init_btcoex(struct ath_softc *sc)
539 + struct ath_txq *txq;
542 switch (sc->sc_ah->btcoex_hw.scheme) {
543 case ATH_BTCOEX_CFG_NONE:
544 @@ -409,8 +410,8 @@ static int ath9k_init_btcoex(struct ath_
545 r = ath_init_btcoex_timer(sc);
548 - qnum = sc->tx.hwq_map[WME_AC_BE];
549 - ath9k_hw_init_btcoex_hw(sc->sc_ah, qnum);
550 + txq = sc->tx.txq_map[WME_AC_BE];
551 + ath9k_hw_init_btcoex_hw(sc->sc_ah, txq->axq_qnum);
552 sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
555 @@ -423,59 +424,18 @@ static int ath9k_init_btcoex(struct ath_
557 static int ath9k_init_queues(struct ath_softc *sc)
559 - struct ath_common *common = ath9k_hw_common(sc->sc_ah);
562 - for (i = 0; i < ARRAY_SIZE(sc->tx.hwq_map); i++)
563 - sc->tx.hwq_map[i] = -1;
565 sc->beacon.beaconq = ath9k_hw_beaconq_setup(sc->sc_ah);
566 - if (sc->beacon.beaconq == -1) {
567 - ath_print(common, ATH_DBG_FATAL,
568 - "Unable to setup a beacon xmit queue\n");
572 sc->beacon.cabq = ath_txq_setup(sc, ATH9K_TX_QUEUE_CAB, 0);
573 - if (sc->beacon.cabq == NULL) {
574 - ath_print(common, ATH_DBG_FATAL,
575 - "Unable to setup CAB xmit queue\n");
579 sc->config.cabqReadytime = ATH_CABQ_READY_TIME;
582 - if (!ath_tx_setup(sc, WME_AC_BK)) {
583 - ath_print(common, ATH_DBG_FATAL,
584 - "Unable to setup xmit queue for BK traffic\n");
588 - if (!ath_tx_setup(sc, WME_AC_BE)) {
589 - ath_print(common, ATH_DBG_FATAL,
590 - "Unable to setup xmit queue for BE traffic\n");
593 - if (!ath_tx_setup(sc, WME_AC_VI)) {
594 - ath_print(common, ATH_DBG_FATAL,
595 - "Unable to setup xmit queue for VI traffic\n");
598 - if (!ath_tx_setup(sc, WME_AC_VO)) {
599 - ath_print(common, ATH_DBG_FATAL,
600 - "Unable to setup xmit queue for VO traffic\n");
603 + for (i = 0; i < WME_NUM_AC; i++)
604 + sc->tx.txq_map[i] = ath_txq_setup(sc, ATH9K_TX_QUEUE_DATA, i);
609 - for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
610 - if (ATH_TXQ_SETUP(sc, i))
611 - ath_tx_cleanupq(sc, &sc->tx.txq[i]);
616 static int ath9k_init_channels_rates(struct ath_softc *sc)
617 --- a/drivers/net/wireless/ath/ath9k/virtual.c
618 +++ b/drivers/net/wireless/ath/ath9k/virtual.c
619 @@ -187,7 +187,7 @@ static int ath9k_send_nullfunc(struct at
620 info->control.rates[1].idx = -1;
622 memset(&txctl, 0, sizeof(struct ath_tx_control));
623 - txctl.txq = &sc->tx.txq[sc->tx.hwq_map[WME_AC_VO]];
624 + txctl.txq = sc->tx.txq_map[WME_AC_VO];
625 txctl.frame_type = ps ? ATH9K_IFT_PAUSE : ATH9K_IFT_UNPAUSE;
627 if (ath_tx_start(aphy->hw, skb, &txctl) != 0)
628 --- a/drivers/net/wireless/ath/ath9k/debug.c
629 +++ b/drivers/net/wireless/ath/ath9k/debug.c
630 @@ -579,10 +579,10 @@ static const struct file_operations fops
632 len += snprintf(buf + len, size - len, \
633 "%s%13u%11u%10u%10u\n", str, \
634 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BE]].elem, \
635 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BK]].elem, \
636 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VI]].elem, \
637 - sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VO]].elem); \
638 + sc->debug.stats.txstats[WME_AC_BE].elem, \
639 + sc->debug.stats.txstats[WME_AC_BK].elem, \
640 + sc->debug.stats.txstats[WME_AC_VI].elem, \
641 + sc->debug.stats.txstats[WME_AC_VO].elem); \
644 static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
645 @@ -624,33 +624,35 @@ static ssize_t read_file_xmit(struct fil
649 -void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
650 - struct ath_buf *bf, struct ath_tx_status *ts)
651 +void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
652 + struct ath_tx_status *ts)
654 - TX_STAT_INC(txq->axq_qnum, tx_pkts_all);
655 - sc->debug.stats.txstats[txq->axq_qnum].tx_bytes_all += bf->bf_mpdu->len;
656 + int qnum = skb_get_queue_mapping(bf->bf_mpdu);
658 + TX_STAT_INC(qnum, tx_pkts_all);
659 + sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len;
661 if (bf_isampdu(bf)) {
662 if (bf_isxretried(bf))
663 - TX_STAT_INC(txq->axq_qnum, a_xretries);
664 + TX_STAT_INC(qnum, a_xretries);
666 - TX_STAT_INC(txq->axq_qnum, a_completed);
667 + TX_STAT_INC(qnum, a_completed);
669 - TX_STAT_INC(txq->axq_qnum, completed);
670 + TX_STAT_INC(qnum, completed);
673 if (ts->ts_status & ATH9K_TXERR_FIFO)
674 - TX_STAT_INC(txq->axq_qnum, fifo_underrun);
675 + TX_STAT_INC(qnum, fifo_underrun);
676 if (ts->ts_status & ATH9K_TXERR_XTXOP)
677 - TX_STAT_INC(txq->axq_qnum, xtxop);
678 + TX_STAT_INC(qnum, xtxop);
679 if (ts->ts_status & ATH9K_TXERR_TIMER_EXPIRED)
680 - TX_STAT_INC(txq->axq_qnum, timer_exp);
681 + TX_STAT_INC(qnum, timer_exp);
682 if (ts->ts_flags & ATH9K_TX_DESC_CFG_ERR)
683 - TX_STAT_INC(txq->axq_qnum, desc_cfg_err);
684 + TX_STAT_INC(qnum, desc_cfg_err);
685 if (ts->ts_flags & ATH9K_TX_DATA_UNDERRUN)
686 - TX_STAT_INC(txq->axq_qnum, data_underrun);
687 + TX_STAT_INC(qnum, data_underrun);
688 if (ts->ts_flags & ATH9K_TX_DELIM_UNDERRUN)
689 - TX_STAT_INC(txq->axq_qnum, delim_underrun);
690 + TX_STAT_INC(qnum, delim_underrun);
693 static const struct file_operations fops_xmit = {
694 --- a/drivers/net/wireless/ath/ath9k/debug.h
695 +++ b/drivers/net/wireless/ath/ath9k/debug.h
696 @@ -169,8 +169,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
697 int ath9k_debug_create_root(void);
698 void ath9k_debug_remove_root(void);
699 void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
700 -void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
701 - struct ath_buf *bf, struct ath_tx_status *ts);
702 +void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf,
703 + struct ath_tx_status *ts);
704 void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs);