diff options
author | Sujith <Sujith.Manoharan@atheros.com> | 2009-02-03 21:40:26 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-11 11:44:22 -0500 |
commit | 029bc43270e770e0d57d67dc431fe711c58e74f5 (patch) | |
tree | c9f2247642743c97ef803c4fdefde8b7e2746af4 | |
parent | d42c6b71a8e722e00a302e7e3365909560de478a (diff) |
ath9k: Add retry counters to rate control debug file
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/debug.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/rc.c | 2 |
3 files changed, 30 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index 63d3eb6cda88..64fc5c269f22 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -137,6 +137,8 @@ struct ath_legacy_rc_stats { | |||
137 | 137 | ||
138 | struct ath_11n_rc_stats { | 138 | struct ath_11n_rc_stats { |
139 | u32 success; | 139 | u32 success; |
140 | u32 retries; | ||
141 | u32 xretries; | ||
140 | }; | 142 | }; |
141 | 143 | ||
142 | struct ath_stats { | 144 | struct ath_stats { |
@@ -160,6 +162,8 @@ int ath9k_init_debug(struct ath_softc *sc); | |||
160 | void ath9k_exit_debug(struct ath_softc *sc); | 162 | void ath9k_exit_debug(struct ath_softc *sc); |
161 | void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); | 163 | void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status); |
162 | void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb); | 164 | void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb); |
165 | void ath_debug_stat_retries(struct ath_softc *sc, int rix, | ||
166 | int xretries, int retries); | ||
163 | 167 | ||
164 | #else | 168 | #else |
165 | 169 | ||
@@ -187,6 +191,11 @@ static inline void ath_debug_stat_rc(struct ath_softc *sc, | |||
187 | { | 191 | { |
188 | } | 192 | } |
189 | 193 | ||
194 | static inline void ath_debug_stat_retries(struct ath_softc *sc, int rix, | ||
195 | int xretries, int retries) | ||
196 | { | ||
197 | } | ||
198 | |||
190 | #endif /* CONFIG_ATH9K_DEBUG */ | 199 | #endif /* CONFIG_ATH9K_DEBUG */ |
191 | 200 | ||
192 | struct ath_config { | 201 | struct ath_config { |
diff --git a/drivers/net/wireless/ath9k/debug.c b/drivers/net/wireless/ath9k/debug.c index 6181e49eecba..2de1b8a57b94 100644 --- a/drivers/net/wireless/ath9k/debug.c +++ b/drivers/net/wireless/ath9k/debug.c | |||
@@ -258,21 +258,36 @@ void ath_debug_stat_rc(struct ath_softc *sc, struct sk_buff *skb) | |||
258 | ath_debug_stat_legacy_rc(sc, skb); | 258 | ath_debug_stat_legacy_rc(sc, skb); |
259 | } | 259 | } |
260 | 260 | ||
261 | /* FIXME: legacy rates, later on .. */ | ||
262 | void ath_debug_stat_retries(struct ath_softc *sc, int rix, | ||
263 | int xretries, int retries) | ||
264 | { | ||
265 | if (conf_is_ht(&sc->hw->conf)) { | ||
266 | int idx = sc->cur_rate_table->info[rix].dot11rate; | ||
267 | |||
268 | sc->sc_debug.stats.n_rcstats[idx].xretries += xretries; | ||
269 | sc->sc_debug.stats.n_rcstats[idx].retries += retries; | ||
270 | } | ||
271 | } | ||
272 | |||
261 | static ssize_t ath_read_file_stat_11n_rc(struct file *file, | 273 | static ssize_t ath_read_file_stat_11n_rc(struct file *file, |
262 | char __user *user_buf, | 274 | char __user *user_buf, |
263 | size_t count, loff_t *ppos) | 275 | size_t count, loff_t *ppos) |
264 | { | 276 | { |
265 | struct ath_softc *sc = file->private_data; | 277 | struct ath_softc *sc = file->private_data; |
266 | char buf[512]; | 278 | char buf[1024]; |
267 | unsigned int len = 0; | 279 | unsigned int len = 0; |
268 | int i = 0; | 280 | int i = 0; |
269 | 281 | ||
270 | len += sprintf(buf, "%7s %13s\n\n", "Rate", "Success"); | 282 | len += sprintf(buf, "%7s %13s %8s %8s\n\n", "Rate", "Success", |
283 | "Retries", "XRetries"); | ||
271 | 284 | ||
272 | for (i = 0; i <= 15; i++) { | 285 | for (i = 0; i <= 15; i++) { |
273 | len += snprintf(buf + len, sizeof(buf) - len, | 286 | len += snprintf(buf + len, sizeof(buf) - len, |
274 | "%5s%3d: %8u\n", "MCS", i, | 287 | "%5s%3d: %8u %8u %8u\n", "MCS", i, |
275 | sc->sc_debug.stats.n_rcstats[i].success); | 288 | sc->sc_debug.stats.n_rcstats[i].success, |
289 | sc->sc_debug.stats.n_rcstats[i].retries, | ||
290 | sc->sc_debug.stats.n_rcstats[i].xretries); | ||
276 | } | 291 | } |
277 | 292 | ||
278 | 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/rc.c b/drivers/net/wireless/ath9k/rc.c index 704b62778142..69a4ca46ce90 100644 --- a/drivers/net/wireless/ath9k/rc.c +++ b/drivers/net/wireless/ath9k/rc.c | |||
@@ -1267,6 +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); | ||
1271 | |||
1270 | #undef CHK_RSSI | 1272 | #undef CHK_RSSI |
1271 | } | 1273 | } |
1272 | 1274 | ||