aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2010-10-01 15:26:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-05 13:35:25 -0400
commit99c15bf575b18e12c9373304a6a09a78f9c8a017 (patch)
tree5268ca72416466718968d850c20d78a6c12394b1 /drivers
parentb72acddbbe521d1372e7e9106e9d72e1cbab3010 (diff)
ath9k: Report total tx/rx bytes and packets in debugfs.
Includes pkts/bytes that may have had errors, and includes wireless headers when counting bytes. Signed-off-by: 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.c15
-rw-r--r--drivers/net/wireless/ath/ath9k/debug.h12
2 files changed, 27 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 7a5932a6691..74a4570dc87 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -701,6 +701,8 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
701 PR("DESC CFG Error: ", desc_cfg_err); 701 PR("DESC CFG Error: ", desc_cfg_err);
702 PR("DATA Underrun: ", data_underrun); 702 PR("DATA Underrun: ", data_underrun);
703 PR("DELIM Underrun: ", delim_underrun); 703 PR("DELIM Underrun: ", delim_underrun);
704 PR("TX-Pkts-All: ", tx_pkts_all);
705 PR("TX-Bytes-All: ", tx_bytes_all);
704 706
705 if (len > size) 707 if (len > size)
706 len = size; 708 len = size;
@@ -714,6 +716,9 @@ static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
714void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq, 716void ath_debug_stat_tx(struct ath_softc *sc, struct ath_txq *txq,
715 struct ath_buf *bf, struct ath_tx_status *ts) 717 struct ath_buf *bf, struct ath_tx_status *ts)
716{ 718{
719 TX_STAT_INC(txq->axq_qnum, tx_pkts_all);
720 sc->debug.stats.txstats[txq->axq_qnum].tx_bytes_all += bf->bf_mpdu->len;
721
717 if (bf_isampdu(bf)) { 722 if (bf_isampdu(bf)) {
718 if (bf_isxretried(bf)) 723 if (bf_isxretried(bf))
719 TX_STAT_INC(txq->axq_qnum, a_xretries); 724 TX_STAT_INC(txq->axq_qnum, a_xretries);
@@ -808,6 +813,13 @@ static ssize_t read_file_recv(struct file *file, char __user *user_buf,
808 PHY_ERR("HT-LENGTH", ATH9K_PHYERR_HT_LENGTH_ILLEGAL); 813 PHY_ERR("HT-LENGTH", ATH9K_PHYERR_HT_LENGTH_ILLEGAL);
809 PHY_ERR("HT-RATE", ATH9K_PHYERR_HT_RATE_ILLEGAL); 814 PHY_ERR("HT-RATE", ATH9K_PHYERR_HT_RATE_ILLEGAL);
810 815
816 len += snprintf(buf + len, size - len,
817 "%18s : %10u\n", "RX-Pkts-All",
818 sc->debug.stats.rxstats.rx_pkts_all);
819 len += snprintf(buf + len, size - len,
820 "%18s : %10u\n", "RX-Bytes-All",
821 sc->debug.stats.rxstats.rx_bytes_all);
822
811 if (len > size) 823 if (len > size)
812 len = size; 824 len = size;
813 825
@@ -826,6 +838,9 @@ void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs)
826 838
827 u32 phyerr; 839 u32 phyerr;
828 840
841 RX_STAT_INC(rx_pkts_all);
842 sc->debug.stats.rxstats.rx_bytes_all += rs->rs_datalen;
843
829 if (rs->rs_status & ATH9K_RXERR_CRC) 844 if (rs->rs_status & ATH9K_RXERR_CRC)
830 RX_STAT_INC(crc_err); 845 RX_STAT_INC(crc_err);
831 if (rs->rs_status & ATH9K_RXERR_DECRYPT) 846 if (rs->rs_status & ATH9K_RXERR_DECRYPT)
diff --git a/drivers/net/wireless/ath/ath9k/debug.h b/drivers/net/wireless/ath/ath9k/debug.h
index 5d21704e87f..822b6f3f23c 100644
--- a/drivers/net/wireless/ath/ath9k/debug.h
+++ b/drivers/net/wireless/ath/ath9k/debug.h
@@ -89,6 +89,10 @@ struct ath_rc_stats {
89 89
90/** 90/**
91 * struct ath_tx_stats - Statistics about TX 91 * struct ath_tx_stats - Statistics about TX
92 * @tx_pkts_all: No. of total frames transmitted, including ones that
93 may have had errors.
94 * @tx_bytes_all: No. of total bytes transmitted, including ones that
95 may have had errors.
92 * @queued: Total MPDUs (non-aggr) queued 96 * @queued: Total MPDUs (non-aggr) queued
93 * @completed: Total MPDUs (non-aggr) completed 97 * @completed: Total MPDUs (non-aggr) completed
94 * @a_aggr: Total no. of aggregates queued 98 * @a_aggr: Total no. of aggregates queued
@@ -107,6 +111,8 @@ struct ath_rc_stats {
107 * @delim_urn: TX delimiter underrun errors 111 * @delim_urn: TX delimiter underrun errors
108 */ 112 */
109struct ath_tx_stats { 113struct ath_tx_stats {
114 u32 tx_pkts_all;
115 u32 tx_bytes_all;
110 u32 queued; 116 u32 queued;
111 u32 completed; 117 u32 completed;
112 u32 a_aggr; 118 u32 a_aggr;
@@ -124,6 +130,10 @@ struct ath_tx_stats {
124 130
125/** 131/**
126 * struct ath_rx_stats - RX Statistics 132 * struct ath_rx_stats - RX Statistics
133 * @rx_pkts_all: No. of total frames received, including ones that
134 may have had errors.
135 * @rx_bytes_all: No. of total bytes received, including ones that
136 may have had errors.
127 * @crc_err: No. of frames with incorrect CRC value 137 * @crc_err: No. of frames with incorrect CRC value
128 * @decrypt_crc_err: No. of frames whose CRC check failed after 138 * @decrypt_crc_err: No. of frames whose CRC check failed after
129 decryption process completed 139 decryption process completed
@@ -136,6 +146,8 @@ struct ath_tx_stats {
136 * @phy_err_stats: Individual PHY error statistics 146 * @phy_err_stats: Individual PHY error statistics
137 */ 147 */
138struct ath_rx_stats { 148struct ath_rx_stats {
149 u32 rx_pkts_all;
150 u32 rx_bytes_all;
139 u32 crc_err; 151 u32 crc_err;
140 u32 decrypt_crc_err; 152 u32 decrypt_crc_err;
141 u32 phy_err; 153 u32 phy_err;