aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/debug.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-08 16:13:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-11 15:04:20 -0400
commit7109ca5c80a0bb94378ebd7f8bb6d00edb5e6fba (patch)
treeb3909c6a1cbc24ddd4f044b22e86b3ea0b1b9364 /drivers/net/wireless/ath/ath5k/debug.c
parentb5bfc5683db44a121ad47ec0a9f4efd4aac040e0 (diff)
ath5k: use the common cycle counter / listen time implementation
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/debug.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index a342a9da1b3..a3b21712533 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -725,20 +725,21 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf,
725 len += snprintf(buf+len, sizeof(buf)-len, 725 len += snprintf(buf+len, sizeof(buf)-len,
726 "beacon RSSI average:\t%d\n", 726 "beacon RSSI average:\t%d\n",
727 sc->ah->ah_beacon_rssi_avg.avg); 727 sc->ah->ah_beacon_rssi_avg.avg);
728
729#define CC_PRINT(_struct, _field) \
730 _struct._field, \
731 _struct.cycles > 0 ? \
732 _struct._field*100/_struct.cycles : 0
733
728 len += snprintf(buf+len, sizeof(buf)-len, "profcnt tx\t\t%u\t(%d%%)\n", 734 len += snprintf(buf+len, sizeof(buf)-len, "profcnt tx\t\t%u\t(%d%%)\n",
729 as->pfc_tx, 735 CC_PRINT(as->last_cc, tx_frame));
730 as->pfc_cycles > 0 ?
731 as->pfc_tx*100/as->pfc_cycles : 0);
732 len += snprintf(buf+len, sizeof(buf)-len, "profcnt rx\t\t%u\t(%d%%)\n", 736 len += snprintf(buf+len, sizeof(buf)-len, "profcnt rx\t\t%u\t(%d%%)\n",
733 as->pfc_rx, 737 CC_PRINT(as->last_cc, rx_frame));
734 as->pfc_cycles > 0 ?
735 as->pfc_rx*100/as->pfc_cycles : 0);
736 len += snprintf(buf+len, sizeof(buf)-len, "profcnt busy\t\t%u\t(%d%%)\n", 738 len += snprintf(buf+len, sizeof(buf)-len, "profcnt busy\t\t%u\t(%d%%)\n",
737 as->pfc_busy, 739 CC_PRINT(as->last_cc, rx_busy));
738 as->pfc_cycles > 0 ? 740#undef CC_PRINT
739 as->pfc_busy*100/as->pfc_cycles : 0);
740 len += snprintf(buf+len, sizeof(buf)-len, "profcnt cycles\t\t%u\n", 741 len += snprintf(buf+len, sizeof(buf)-len, "profcnt cycles\t\t%u\n",
741 as->pfc_cycles); 742 as->last_cc.cycles);
742 len += snprintf(buf+len, sizeof(buf)-len, 743 len += snprintf(buf+len, sizeof(buf)-len,
743 "listen time\t\t%d\tlast: %d\n", 744 "listen time\t\t%d\tlast: %d\n",
744 as->listen_time, as->last_listen); 745 as->listen_time, as->last_listen);