aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/debug.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-08 22:13:54 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-10-11 15:04:20 -0400
commit7109ca5c80a0bb94378ebd7f8bb6d00edb5e6fba (patch)
treeb3909c6a1cbc24ddd4f044b22e86b3ea0b1b9364 /drivers/net/wireless/ath/ath5k/debug.c
parentath9k_hw: move the cycle counter tracking to ath (diff)
downloadlinux-dev-7109ca5c80a0bb94378ebd7f8bb6d00edb5e6fba.tar.xz
linux-dev-7109ca5c80a0bb94378ebd7f8bb6d00edb5e6fba.zip
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 a342a9da1b3e..a3b217125331 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,
len += snprintf(buf+len, sizeof(buf)-len,
"beacon RSSI average:\t%d\n",
sc->ah->ah_beacon_rssi_avg.avg);
+
+#define CC_PRINT(_struct, _field) \
+ _struct._field, \
+ _struct.cycles > 0 ? \
+ _struct._field*100/_struct.cycles : 0
+
len += snprintf(buf+len, sizeof(buf)-len, "profcnt tx\t\t%u\t(%d%%)\n",
- as->pfc_tx,
- as->pfc_cycles > 0 ?
- as->pfc_tx*100/as->pfc_cycles : 0);
+ CC_PRINT(as->last_cc, tx_frame));
len += snprintf(buf+len, sizeof(buf)-len, "profcnt rx\t\t%u\t(%d%%)\n",
- as->pfc_rx,
- as->pfc_cycles > 0 ?
- as->pfc_rx*100/as->pfc_cycles : 0);
+ CC_PRINT(as->last_cc, rx_frame));
len += snprintf(buf+len, sizeof(buf)-len, "profcnt busy\t\t%u\t(%d%%)\n",
- as->pfc_busy,
- as->pfc_cycles > 0 ?
- as->pfc_busy*100/as->pfc_cycles : 0);
+ CC_PRINT(as->last_cc, rx_busy));
+#undef CC_PRINT
len += snprintf(buf+len, sizeof(buf)-len, "profcnt cycles\t\t%u\n",
- as->pfc_cycles);
+ as->last_cc.cycles);
len += snprintf(buf+len, sizeof(buf)-len,
"listen time\t\t%d\tlast: %d\n",
as->listen_time, as->last_listen);