aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-01-10 02:11:45 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-21 15:32:22 -0500
commit2dac4fb97a41af1e6b7ab9f59c837d20838e92da (patch)
tree3c127ad35b4a269b0c3cce375298c315c7850413 /drivers/net/wireless/ath
parent233536e126056f65a8aac7ff38788d19dbb53299 (diff)
ath9k: Add more information to debugfs xmit file.
Should help debug strange tx lockup type issues. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.c29
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h6
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c8
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c1
4 files changed, 42 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 5075faa618d3..577bc5a9835b 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -599,13 +599,25 @@ do { \
599 (unsigned int)(sc->tx.txq[WME_AC_VO].elem)); \ 599 (unsigned int)(sc->tx.txq[WME_AC_VO].elem)); \
600} while(0) 600} while(0)
601 601
602#define PRQLE(str, elem) \
603do { \
604 len += snprintf(buf + len, size - len, \
605 "%s%13i%11i%10i%10i\n", str, \
606 list_empty(&sc->tx.txq[WME_AC_BE].elem), \
607 list_empty(&sc->tx.txq[WME_AC_BK].elem), \
608 list_empty(&sc->tx.txq[WME_AC_VI].elem), \
609 list_empty(&sc->tx.txq[WME_AC_VO].elem)); \
610} while (0)
611
602static ssize_t read_file_xmit(struct file *file, char __user *user_buf, 612static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
603 size_t count, loff_t *ppos) 613 size_t count, loff_t *ppos)
604{ 614{
605 struct ath_softc *sc = file->private_data; 615 struct ath_softc *sc = file->private_data;
606 char *buf; 616 char *buf;
607 unsigned int len = 0, size = 2048; 617 unsigned int len = 0, size = 4000;
618 int i;
608 ssize_t retval = 0; 619 ssize_t retval = 0;
620 char tmp[32];
609 621
610 buf = kzalloc(size, GFP_KERNEL); 622 buf = kzalloc(size, GFP_KERNEL);
611 if (buf == NULL) 623 if (buf == NULL)
@@ -628,13 +640,26 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
628 PR("DELIM Underrun: ", delim_underrun); 640 PR("DELIM Underrun: ", delim_underrun);
629 PR("TX-Pkts-All: ", tx_pkts_all); 641 PR("TX-Pkts-All: ", tx_pkts_all);
630 PR("TX-Bytes-All: ", tx_bytes_all); 642 PR("TX-Bytes-All: ", tx_bytes_all);
643 PR("hw-put-tx-buf: ", puttxbuf);
644 PR("hw-tx-start: ", txstart);
645 PR("hw-tx-proc-desc: ", txprocdesc);
631 646
632 PRX("axq-qnum: ", axq_qnum); 647 PRX("axq-qnum: ", axq_qnum);
633 PRX("axq-depth: ", axq_depth); 648 PRX("axq-depth: ", axq_depth);
649 PRX("axq-ampdu_depth: ", axq_ampdu_depth);
634 PRX("axq-stopped ", stopped); 650 PRX("axq-stopped ", stopped);
635 PRX("tx-in-progress ", axq_tx_inprogress); 651 PRX("tx-in-progress ", axq_tx_inprogress);
636 PRX("pending-frames ", pending_frames); 652 PRX("pending-frames ", pending_frames);
637 653 PRX("txq_headidx: ", txq_headidx);
654 PRX("txq_tailidx: ", txq_headidx);
655
656 PRQLE("axq_q empty: ", axq_q);
657 PRQLE("axq_acq empty: ", axq_acq);
658 PRQLE("txq_fifo_pending: ", txq_fifo_pending);
659 for (i = 0; i < ATH_TXFIFO_DEPTH; i++) {
660 snprintf(tmp, sizeof(tmp) - 1, "txq_fifo[%i] empty: ", i);
661 PRQLE(tmp, txq_fifo[i]);
662 }
638 if (len > size) 663 if (len > size)
639 len = size; 664 len = size;
640 665
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 1e5078bd0344..cd2db3fd7b7e 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -102,6 +102,9 @@ struct ath_interrupt_stats {
102 * @desc_cfg_err: Descriptor configuration errors 102 * @desc_cfg_err: Descriptor configuration errors
103 * @data_urn: TX data underrun errors 103 * @data_urn: TX data underrun errors
104 * @delim_urn: TX delimiter underrun errors 104 * @delim_urn: TX delimiter underrun errors
105 * @puttxbuf: Number of times hardware was given txbuf to write.
106 * @txstart: Number of times hardware was told to start tx.
107 * @txprocdesc: Number of times tx descriptor was processed
105 */ 108 */
106struct ath_tx_stats { 109struct ath_tx_stats {
107 u32 tx_pkts_all; 110 u32 tx_pkts_all;
@@ -119,6 +122,9 @@ struct ath_tx_stats {
119 u32 desc_cfg_err; 122 u32 desc_cfg_err;
120 u32 data_underrun; 123 u32 data_underrun;
121 u32 delim_underrun; 124 u32 delim_underrun;
125 u32 puttxbuf;
126 u32 txstart;
127 u32 txprocdesc;
122}; 128};
123 129
124/** 130/**
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index c75d40fb86f1..5f2b93441e5c 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -16,6 +16,8 @@
16 16
17#include "hw.h" 17#include "hw.h"
18#include "hw-ops.h" 18#include "hw-ops.h"
19#include "debug.h"
20#include "ath9k.h"
19 21
20static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah, 22static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah,
21 struct ath9k_tx_queue_info *qi) 23 struct ath9k_tx_queue_info *qi)
@@ -50,12 +52,18 @@ EXPORT_SYMBOL(ath9k_hw_gettxbuf);
50 52
51void ath9k_hw_puttxbuf(struct ath_hw *ah, u32 q, u32 txdp) 53void ath9k_hw_puttxbuf(struct ath_hw *ah, u32 q, u32 txdp)
52{ 54{
55 struct ath_wiphy *aphy = ah->hw->priv;
56 struct ath_softc *sc = aphy->sc;
57 TX_STAT_INC(q, puttxbuf);
53 REG_WRITE(ah, AR_QTXDP(q), txdp); 58 REG_WRITE(ah, AR_QTXDP(q), txdp);
54} 59}
55EXPORT_SYMBOL(ath9k_hw_puttxbuf); 60EXPORT_SYMBOL(ath9k_hw_puttxbuf);
56 61
57void ath9k_hw_txstart(struct ath_hw *ah, u32 q) 62void ath9k_hw_txstart(struct ath_hw *ah, u32 q)
58{ 63{
64 struct ath_wiphy *aphy = ah->hw->priv;
65 struct ath_softc *sc = aphy->sc;
66 TX_STAT_INC(q, txstart);
59 ath_dbg(ath9k_hw_common(ah), ATH_DBG_QUEUE, 67 ath_dbg(ath9k_hw_common(ah), ATH_DBG_QUEUE,
60 "Enable TXE on queue: %u\n", q); 68 "Enable TXE on queue: %u\n", q);
61 REG_WRITE(ah, AR_Q_TXE, 1 << q); 69 REG_WRITE(ah, AR_Q_TXE, 1 << q);
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index ad569e152d78..aa67d641f140 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2039,6 +2039,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2039 spin_unlock_bh(&txq->axq_lock); 2039 spin_unlock_bh(&txq->axq_lock);
2040 break; 2040 break;
2041 } 2041 }
2042 TX_STAT_INC(txq->axq_qnum, txprocdesc);
2042 2043
2043 /* 2044 /*
2044 * Remove ath_buf's of the same transmit unit from txq, 2045 * Remove ath_buf's of the same transmit unit from txq,