diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-01-24 15:29:25 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-01-28 15:42:00 -0500 |
commit | 5bec3e5ade813ee4bdbab03af1bb6f85859272ea (patch) | |
tree | 510d7bfd529dcee596a8ce6df56c35063e5f0557 /drivers | |
parent | 9ac58615d93c8a28b1c649a90a5e2ede4dfd368a (diff) |
ath9k: fix tx queue index confusion in debugfs code
Various places printing tx queue information used various different ways to
get a tx queue index for printing statistics. Most of these ways were wrong.
ATH_TXQ_AC_* cannot be used as an index for sc->tx.txq, because it is only
used internally for queue assignment.
One place used WME_AC_* as a queue index for sc->debug.stats.txstats, however
this array uses the ath9k_hw queue number as well.
Fix all of this by always using the ath9k_hw queue number as an index, and
always looking it up by going through sc->tx.txq_map.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 37 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 2 |
3 files changed, 21 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index f517c0cd5517..9cdc41b0ec44 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -450,14 +450,15 @@ static const struct file_operations fops_wiphy = { | |||
450 | .llseek = default_llseek, | 450 | .llseek = default_llseek, |
451 | }; | 451 | }; |
452 | 452 | ||
453 | #define PR_QNUM(_n) sc->tx.txq_map[_n]->axq_qnum | ||
453 | #define PR(str, elem) \ | 454 | #define PR(str, elem) \ |
454 | do { \ | 455 | do { \ |
455 | len += snprintf(buf + len, size - len, \ | 456 | len += snprintf(buf + len, size - len, \ |
456 | "%s%13u%11u%10u%10u\n", str, \ | 457 | "%s%13u%11u%10u%10u\n", str, \ |
457 | sc->debug.stats.txstats[WME_AC_BE].elem, \ | 458 | sc->debug.stats.txstats[PR_QNUM(WME_AC_BE)].elem, \ |
458 | sc->debug.stats.txstats[WME_AC_BK].elem, \ | 459 | sc->debug.stats.txstats[PR_QNUM(WME_AC_BK)].elem, \ |
459 | sc->debug.stats.txstats[WME_AC_VI].elem, \ | 460 | sc->debug.stats.txstats[PR_QNUM(WME_AC_VI)].elem, \ |
460 | sc->debug.stats.txstats[WME_AC_VO].elem); \ | 461 | sc->debug.stats.txstats[PR_QNUM(WME_AC_VO)].elem); \ |
461 | if (len >= size) \ | 462 | if (len >= size) \ |
462 | goto done; \ | 463 | goto done; \ |
463 | } while(0) | 464 | } while(0) |
@@ -466,10 +467,10 @@ static const struct file_operations fops_wiphy = { | |||
466 | do { \ | 467 | do { \ |
467 | len += snprintf(buf + len, size - len, \ | 468 | len += snprintf(buf + len, size - len, \ |
468 | "%s%13u%11u%10u%10u\n", str, \ | 469 | "%s%13u%11u%10u%10u\n", str, \ |
469 | (unsigned int)(sc->tx.txq[ATH_TXQ_AC_BE].elem), \ | 470 | (unsigned int)(sc->tx.txq_map[WME_AC_BE]->elem), \ |
470 | (unsigned int)(sc->tx.txq[ATH_TXQ_AC_BK].elem), \ | 471 | (unsigned int)(sc->tx.txq_map[WME_AC_BK]->elem), \ |
471 | (unsigned int)(sc->tx.txq[ATH_TXQ_AC_VI].elem), \ | 472 | (unsigned int)(sc->tx.txq_map[WME_AC_VI]->elem), \ |
472 | (unsigned int)(sc->tx.txq[ATH_TXQ_AC_VO].elem)); \ | 473 | (unsigned int)(sc->tx.txq_map[WME_AC_VO]->elem)); \ |
473 | if (len >= size) \ | 474 | if (len >= size) \ |
474 | goto done; \ | 475 | goto done; \ |
475 | } while(0) | 476 | } while(0) |
@@ -478,10 +479,10 @@ do { \ | |||
478 | do { \ | 479 | do { \ |
479 | len += snprintf(buf + len, size - len, \ | 480 | len += snprintf(buf + len, size - len, \ |
480 | "%s%13i%11i%10i%10i\n", str, \ | 481 | "%s%13i%11i%10i%10i\n", str, \ |
481 | list_empty(&sc->tx.txq[ATH_TXQ_AC_BE].elem), \ | 482 | list_empty(&sc->tx.txq_map[WME_AC_BE]->elem), \ |
482 | list_empty(&sc->tx.txq[ATH_TXQ_AC_BK].elem), \ | 483 | list_empty(&sc->tx.txq_map[WME_AC_BK]->elem), \ |
483 | list_empty(&sc->tx.txq[ATH_TXQ_AC_VI].elem), \ | 484 | list_empty(&sc->tx.txq_map[WME_AC_VI]->elem), \ |
484 | list_empty(&sc->tx.txq[ATH_TXQ_AC_VO].elem)); \ | 485 | list_empty(&sc->tx.txq_map[WME_AC_VO]->elem)); \ |
485 | if (len >= size) \ | 486 | if (len >= size) \ |
486 | goto done; \ | 487 | goto done; \ |
487 | } while (0) | 488 | } while (0) |
@@ -528,10 +529,10 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf, | |||
528 | PR("hw-tx-proc-desc: ", txprocdesc); | 529 | PR("hw-tx-proc-desc: ", txprocdesc); |
529 | len += snprintf(buf + len, size - len, | 530 | len += snprintf(buf + len, size - len, |
530 | "%s%11p%11p%10p%10p\n", "txq-memory-address:", | 531 | "%s%11p%11p%10p%10p\n", "txq-memory-address:", |
531 | &(sc->tx.txq[ATH_TXQ_AC_BE]), | 532 | &(sc->tx.txq_map[WME_AC_BE]), |
532 | &(sc->tx.txq[ATH_TXQ_AC_BK]), | 533 | &(sc->tx.txq_map[WME_AC_BK]), |
533 | &(sc->tx.txq[ATH_TXQ_AC_VI]), | 534 | &(sc->tx.txq_map[WME_AC_VI]), |
534 | &(sc->tx.txq[ATH_TXQ_AC_VO])); | 535 | &(sc->tx.txq_map[WME_AC_VO])); |
535 | if (len >= size) | 536 | if (len >= size) |
536 | goto done; | 537 | goto done; |
537 | 538 | ||
@@ -751,9 +752,9 @@ static ssize_t read_file_misc(struct file *file, char __user *user_buf, | |||
751 | } | 752 | } |
752 | 753 | ||
753 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, | 754 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, |
754 | struct ath_tx_status *ts) | 755 | struct ath_tx_status *ts, struct ath_txq *txq) |
755 | { | 756 | { |
756 | int qnum = skb_get_queue_mapping(bf->bf_mpdu); | 757 | int qnum = txq->axq_qnum; |
757 | 758 | ||
758 | TX_STAT_INC(qnum, tx_pkts_all); | 759 | TX_STAT_INC(qnum, tx_pkts_all); |
759 | sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len; | 760 | sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len; |
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h index 980c9fa194b9..1bdc6d4ceb17 100644 --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h | |||
@@ -175,7 +175,7 @@ int ath9k_init_debug(struct ath_hw *ah); | |||
175 | 175 | ||
176 | void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); | 176 | void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); |
177 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, | 177 | void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, |
178 | struct ath_tx_status *ts); | 178 | struct ath_tx_status *ts, struct ath_txq *txq); |
179 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs); | 179 | void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs); |
180 | 180 | ||
181 | #else | 181 | #else |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index dd919488077d..879365e9b1c9 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1911,7 +1911,7 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, | |||
1911 | else | 1911 | else |
1912 | complete(&sc->paprd_complete); | 1912 | complete(&sc->paprd_complete); |
1913 | } else { | 1913 | } else { |
1914 | ath_debug_stat_tx(sc, bf, ts); | 1914 | ath_debug_stat_tx(sc, bf, ts, txq); |
1915 | ath_tx_complete(sc, skb, tx_flags, | 1915 | ath_tx_complete(sc, skb, tx_flags, |
1916 | bf->bf_state.bfs_ftype, txq); | 1916 | bf->bf_state.bfs_ftype, txq); |
1917 | } | 1917 | } |