aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2009-02-20 04:43:20 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:49 -0500
commit9e7127908473bfb863c5064b0a61d0f0d6b1af46 (patch)
treeaa58b869ebf4e36764ae058d678b58dc3d8bb526 /drivers
parentd9ae96d94a9117fa8d80dd4881f5835f9112c449 (diff)
ath9k: Add PER to RC debug statistics
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath9k/debug.c12
-rw-r--r--drivers/net/wireless/ath9k/debug.h9
-rw-r--r--drivers/net/wireless/ath9k/rc.c3
3 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c
index 800ad5926b6f..0c422c50e4f0 100644
--- a/drivers/net/wireless/ath9k/debug.c
+++ b/drivers/net/wireless/ath9k/debug.c
@@ -258,13 +258,14 @@ void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb)
258 258
259/* FIXME: legacy rates, later on .. */ 259/* FIXME: legacy rates, later on .. */
260void ath_debug_stat_retries(struct ath_softc *sc, int rix, 260void ath_debug_stat_retries(struct ath_softc *sc, int rix,
261 int xretries, int retries) 261 int xretries, int retries, u8 per)
262{ 262{
263 if (conf_is_ht(&sc->hw->conf)) { 263 if (conf_is_ht(&sc->hw->conf)) {
264 int idx = sc->cur_rate_table->info[rix].dot11rate; 264 int idx = sc->cur_rate_table->info[rix].dot11rate;
265 265
266 sc->debug.stats.n_rcstats[idx].xretries += xretries; 266 sc->debug.stats.n_rcstats[idx].xretries += xretries;
267 sc->debug.stats.n_rcstats[idx].retries += retries; 267 sc->debug.stats.n_rcstats[idx].retries += retries;
268 sc->debug.stats.n_rcstats[idx].per = per;
268 } 269 }
269} 270}
270 271
@@ -277,15 +278,16 @@ static ssize_t ath_read_file_stat_11n_rc(struct file *file,
277 unsigned int len = 0; 278 unsigned int len = 0;
278 int i = 0; 279 int i = 0;
279 280
280 len += sprintf(buf, "%7s %13s %8s %8s\n\n", "Rate", "Success", 281 len += sprintf(buf, "%7s %13s %8s %8s %6s\n\n", "Rate", "Success",
281 "Retries", "XRetries"); 282 "Retries", "XRetries", "PER");
282 283
283 for (i = 0; i <= 15; i++) { 284 for (i = 0; i <= 15; i++) {
284 len += snprintf(buf + len, sizeof(buf) - len, 285 len += snprintf(buf + len, sizeof(buf) - len,
285 "%5s%3d: %8u %8u %8u\n", "MCS", i, 286 "%5s%3d: %8u %8u %8u %8u\n", "MCS", i,
286 sc->debug.stats.n_rcstats[i].success, 287 sc->debug.stats.n_rcstats[i].success,
287 sc->debug.stats.n_rcstats[i].retries, 288 sc->debug.stats.n_rcstats[i].retries,
288 sc->debug.stats.n_rcstats[i].xretries); 289 sc->debug.stats.n_rcstats[i].xretries,
290 sc->debug.stats.n_rcstats[i].per);
289 } 291 }
290 292
291 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 293 return simple_read_from_buffer(user_buf, count, ppos, buf, len);
diff --git a/drivers/net/wireless/ath9k/debug.h b/drivers/net/wireless/ath9k/debug.h
index 61e969894c0a..01681f2d0549 100644
--- a/drivers/net/wireless/ath9k/debug.h
+++ b/drivers/net/wireless/ath9k/debug.h
@@ -91,12 +91,13 @@ struct ath_11n_rc_stats {
91 u32 success; 91 u32 success;
92 u32 retries; 92 u32 retries;
93 u32 xretries; 93 u32 xretries;
94 u8 per;
94}; 95};
95 96
96struct ath_stats { 97struct ath_stats {
97 struct ath_interrupt_stats istats; 98 struct ath_interrupt_stats istats;
98 struct ath_legacy_rc_stats legacy_rcstats[12]; /* max(11a,11b,11g) */ 99 struct ath_legacy_rc_stats legacy_rcstats[12]; /* max(11a,11b,11g) */
99 struct ath_11n_rc_stats n_rcstats[16]; /* 0..15 MCS rates */ 100 struct ath_11n_rc_stats n_rcstats[16]; /* 0..15 MCS rates */
100}; 101};
101 102
102struct ath9k_debug { 103struct ath9k_debug {
@@ -115,7 +116,7 @@ void ath9k_exit_debug(struct ath_softc *sc);
115void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); 116void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status);
116void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb); 117void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb);
117void ath_debug_stat_retries(struct ath_softc *sc, int rix, 118void ath_debug_stat_retries(struct ath_softc *sc, int rix,
118 int xretries, int retries); 119 int xretries, int retries, u8 per);
119 120
120#else 121#else
121 122
@@ -144,7 +145,7 @@ static inline void ath_debug_stat_rc(struct ath_softc *sc,
144} 145}
145 146
146static inline void ath_debug_stat_retries(struct ath_softc *sc, int rix, 147static inline void ath_debug_stat_retries(struct ath_softc *sc, int rix,
147 int xretries, int retries) 148 int xretries, int retries, u8 per)
148{ 149{
149} 150}
150 151
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index 0e3e2b7dd2ec..cf0559f183af 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -1267,7 +1267,8 @@ static void ath_rc_update_ht(struct ath_softc *sc,
1267 ath_rc_priv->per_down_time = now_msec; 1267 ath_rc_priv->per_down_time = now_msec;
1268 } 1268 }
1269 1269
1270 ath_debug_stat_retries(sc, tx_rate, xretries, retries); 1270 ath_debug_stat_retries(sc, tx_rate, xretries, retries,
1271 ath_rc_priv->state[tx_rate].per);
1271 1272
1272#undef CHK_RSSI 1273#undef CHK_RSSI
1273} 1274}