diff options
author | Ben Greear <greearb@candelatech.com> | 2010-10-01 13:54:04 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-05 13:35:25 -0400 |
commit | b72acddbbe521d1372e7e9106e9d72e1cbab3010 (patch) | |
tree | ceddb7117ff551d9b65468f81b065212e35e139e /drivers/net/wireless/ath | |
parent | 1be7fe8de9f25e173282f8f989f83bc5b5decfe9 (diff) |
ath5k: Print rx/tx bytes in debugfs
This adds counters for tx and rx bytes, including any
errored packets as well as all wireless headers.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Acked-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/debug.c | 4 |
3 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 2ed327a8d690..d914a31cb0b6 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -1433,6 +1433,7 @@ static bool | |||
1433 | ath5k_receive_frame_ok(struct ath5k_softc *sc, struct ath5k_rx_status *rs) | 1433 | ath5k_receive_frame_ok(struct ath5k_softc *sc, struct ath5k_rx_status *rs) |
1434 | { | 1434 | { |
1435 | sc->stats.rx_all_count++; | 1435 | sc->stats.rx_all_count++; |
1436 | sc->stats.rx_bytes_count += rs->rs_datalen; | ||
1436 | 1437 | ||
1437 | if (unlikely(rs->rs_status)) { | 1438 | if (unlikely(rs->rs_status)) { |
1438 | if (rs->rs_status & AR5K_RXERR_CRC) | 1439 | if (rs->rs_status & AR5K_RXERR_CRC) |
@@ -1611,6 +1612,7 @@ ath5k_tx_frame_completed(struct ath5k_softc *sc, struct sk_buff *skb, | |||
1611 | int i; | 1612 | int i; |
1612 | 1613 | ||
1613 | sc->stats.tx_all_count++; | 1614 | sc->stats.tx_all_count++; |
1615 | sc->stats.tx_bytes_count += skb->len; | ||
1614 | info = IEEE80211_SKB_CB(skb); | 1616 | info = IEEE80211_SKB_CB(skb); |
1615 | 1617 | ||
1616 | ieee80211_tx_info_clear_status(info); | 1618 | ieee80211_tx_info_clear_status(info); |
diff --git a/drivers/net/wireless/ath/ath5k/base.h b/drivers/net/wireless/ath/ath5k/base.h index b9f6d13b7675..9a79773cdc2a 100644 --- a/drivers/net/wireless/ath/ath5k/base.h +++ b/drivers/net/wireless/ath/ath5k/base.h | |||
@@ -121,6 +121,13 @@ struct ath5k_statistics { | |||
121 | /* frame errors */ | 121 | /* frame errors */ |
122 | unsigned int rx_all_count; /* all RX frames, including errors */ | 122 | unsigned int rx_all_count; /* all RX frames, including errors */ |
123 | unsigned int tx_all_count; /* all TX frames, including errors */ | 123 | unsigned int tx_all_count; /* all TX frames, including errors */ |
124 | unsigned int rx_bytes_count; /* all RX bytes, including errored pks | ||
125 | * and the MAC headers for each packet | ||
126 | */ | ||
127 | unsigned int tx_bytes_count; /* all TX bytes, including errored pkts | ||
128 | * and the MAC headers and padding for | ||
129 | * each packet. | ||
130 | */ | ||
124 | unsigned int rxerr_crc; | 131 | unsigned int rxerr_crc; |
125 | unsigned int rxerr_phy; | 132 | unsigned int rxerr_phy; |
126 | unsigned int rxerr_phy_code[32]; | 133 | unsigned int rxerr_phy_code[32]; |
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c index 0f06e8490314..c2d549f871f9 100644 --- a/drivers/net/wireless/ath/ath5k/debug.c +++ b/drivers/net/wireless/ath/ath5k/debug.c | |||
@@ -587,6 +587,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf, | |||
587 | st->rxerr_jumbo*100/st->rx_all_count : 0); | 587 | st->rxerr_jumbo*100/st->rx_all_count : 0); |
588 | len += snprintf(buf+len, sizeof(buf)-len, "[RX all\t%d]\n", | 588 | len += snprintf(buf+len, sizeof(buf)-len, "[RX all\t%d]\n", |
589 | st->rx_all_count); | 589 | st->rx_all_count); |
590 | len += snprintf(buf+len, sizeof(buf)-len, "RX-all-bytes\t%d\n", | ||
591 | st->rx_bytes_count); | ||
590 | 592 | ||
591 | len += snprintf(buf+len, sizeof(buf)-len, | 593 | len += snprintf(buf+len, sizeof(buf)-len, |
592 | "\nTX\n---------------------\n"); | 594 | "\nTX\n---------------------\n"); |
@@ -604,6 +606,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf, | |||
604 | st->txerr_filt*100/st->tx_all_count : 0); | 606 | st->txerr_filt*100/st->tx_all_count : 0); |
605 | len += snprintf(buf+len, sizeof(buf)-len, "[TX all\t%d]\n", | 607 | len += snprintf(buf+len, sizeof(buf)-len, "[TX all\t%d]\n", |
606 | st->tx_all_count); | 608 | st->tx_all_count); |
609 | len += snprintf(buf+len, sizeof(buf)-len, "TX-all-bytes\t%d\n", | ||
610 | st->tx_bytes_count); | ||
607 | 611 | ||
608 | if (len > sizeof(buf)) | 612 | if (len > sizeof(buf)) |
609 | len = sizeof(buf); | 613 | len = sizeof(buf); |