Commit b72acddb authored by Ben Greear's avatar Ben Greear Committed by John W. Linville

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: default avatarBen Greear <greearb@candelatech.com>
Acked-by: default avatarBruno Randolf <br1@einfach.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1be7fe8d
...@@ -1433,6 +1433,7 @@ static bool ...@@ -1433,6 +1433,7 @@ static bool
ath5k_receive_frame_ok(struct ath5k_softc *sc, struct ath5k_rx_status *rs) ath5k_receive_frame_ok(struct ath5k_softc *sc, struct ath5k_rx_status *rs)
{ {
sc->stats.rx_all_count++; sc->stats.rx_all_count++;
sc->stats.rx_bytes_count += rs->rs_datalen;
if (unlikely(rs->rs_status)) { if (unlikely(rs->rs_status)) {
if (rs->rs_status & AR5K_RXERR_CRC) if (rs->rs_status & AR5K_RXERR_CRC)
...@@ -1611,6 +1612,7 @@ ath5k_tx_frame_completed(struct ath5k_softc *sc, struct sk_buff *skb, ...@@ -1611,6 +1612,7 @@ ath5k_tx_frame_completed(struct ath5k_softc *sc, struct sk_buff *skb,
int i; int i;
sc->stats.tx_all_count++; sc->stats.tx_all_count++;
sc->stats.tx_bytes_count += skb->len;
info = IEEE80211_SKB_CB(skb); info = IEEE80211_SKB_CB(skb);
ieee80211_tx_info_clear_status(info); ieee80211_tx_info_clear_status(info);
......
...@@ -121,6 +121,13 @@ struct ath5k_statistics { ...@@ -121,6 +121,13 @@ struct ath5k_statistics {
/* frame errors */ /* frame errors */
unsigned int rx_all_count; /* all RX frames, including errors */ unsigned int rx_all_count; /* all RX frames, including errors */
unsigned int tx_all_count; /* all TX frames, including errors */ unsigned int tx_all_count; /* all TX frames, including errors */
unsigned int rx_bytes_count; /* all RX bytes, including errored pks
* and the MAC headers for each packet
*/
unsigned int tx_bytes_count; /* all TX bytes, including errored pkts
* and the MAC headers and padding for
* each packet.
*/
unsigned int rxerr_crc; unsigned int rxerr_crc;
unsigned int rxerr_phy; unsigned int rxerr_phy;
unsigned int rxerr_phy_code[32]; unsigned int rxerr_phy_code[32];
......
...@@ -587,6 +587,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf, ...@@ -587,6 +587,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
st->rxerr_jumbo*100/st->rx_all_count : 0); st->rxerr_jumbo*100/st->rx_all_count : 0);
len += snprintf(buf+len, sizeof(buf)-len, "[RX all\t%d]\n", len += snprintf(buf+len, sizeof(buf)-len, "[RX all\t%d]\n",
st->rx_all_count); st->rx_all_count);
len += snprintf(buf+len, sizeof(buf)-len, "RX-all-bytes\t%d\n",
st->rx_bytes_count);
len += snprintf(buf+len, sizeof(buf)-len, len += snprintf(buf+len, sizeof(buf)-len,
"\nTX\n---------------------\n"); "\nTX\n---------------------\n");
...@@ -604,6 +606,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf, ...@@ -604,6 +606,8 @@ static ssize_t read_file_frameerrors(struct file *file, char __user *user_buf,
st->txerr_filt*100/st->tx_all_count : 0); st->txerr_filt*100/st->tx_all_count : 0);
len += snprintf(buf+len, sizeof(buf)-len, "[TX all\t%d]\n", len += snprintf(buf+len, sizeof(buf)-len, "[TX all\t%d]\n",
st->tx_all_count); st->tx_all_count);
len += snprintf(buf+len, sizeof(buf)-len, "TX-all-bytes\t%d\n",
st->tx_bytes_count);
if (len > sizeof(buf)) if (len > sizeof(buf))
len = sizeof(buf); len = sizeof(buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment