aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-11-21 07:43:14 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-11-21 14:16:04 -0500
commit4d28f771ff2ca0701999b037df38ad06e949edf6 (patch)
tree09543a522d4285833278289c14eca7facec50d6c /drivers/net/wireless/ath
parent1c11e10b6a64f14427be518ccc2a242b73fc3d9f (diff)
ath9k: Fix rate control debugging
Update the rate statistics only when debugfs has been enabled in ath9k and mac80211 and move the stat() functions under proper conditionals. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c36
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.h16
2 files changed, 33 insertions, 19 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 004f016290d3..714558d1ba78 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -982,16 +982,6 @@ static void ath_rc_update_per(struct ath_softc *sc,
982 } 982 }
983} 983}
984 984
985static void ath_debug_stat_retries(struct ath_rate_priv *rc, int rix,
986 int xretries, int retries, u8 per)
987{
988 struct ath_rc_stats *stats = &rc->rcstats[rix];
989
990 stats->xretries += xretries;
991 stats->retries += retries;
992 stats->per = per;
993}
994
995static void ath_rc_update_ht(struct ath_softc *sc, 985static void ath_rc_update_ht(struct ath_softc *sc,
996 struct ath_rate_priv *ath_rc_priv, 986 struct ath_rate_priv *ath_rc_priv,
997 struct ieee80211_tx_info *tx_info, 987 struct ieee80211_tx_info *tx_info,
@@ -1065,14 +1055,6 @@ static void ath_rc_update_ht(struct ath_softc *sc,
1065 1055
1066} 1056}
1067 1057
1068static void ath_debug_stat_rc(struct ath_rate_priv *rc, int final_rate)
1069{
1070 struct ath_rc_stats *stats;
1071
1072 stats = &rc->rcstats[final_rate];
1073 stats->success++;
1074}
1075
1076static void ath_rc_tx_status(struct ath_softc *sc, 1058static void ath_rc_tx_status(struct ath_softc *sc,
1077 struct ath_rate_priv *ath_rc_priv, 1059 struct ath_rate_priv *ath_rc_priv,
1078 struct sk_buff *skb) 1060 struct sk_buff *skb)
@@ -1352,6 +1334,24 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband,
1352 1334
1353#if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS) 1335#if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS)
1354 1336
1337void ath_debug_stat_rc(struct ath_rate_priv *rc, int final_rate)
1338{
1339 struct ath_rc_stats *stats;
1340
1341 stats = &rc->rcstats[final_rate];
1342 stats->success++;
1343}
1344
1345void ath_debug_stat_retries(struct ath_rate_priv *rc, int rix,
1346 int xretries, int retries, u8 per)
1347{
1348 struct ath_rc_stats *stats = &rc->rcstats[rix];
1349
1350 stats->xretries += xretries;
1351 stats->retries += retries;
1352 stats->per = per;
1353}
1354
1355static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, 1355static ssize_t read_file_rcstat(struct file *file, char __user *user_buf,
1356 size_t count, loff_t *ppos) 1356 size_t count, loff_t *ppos)
1357{ 1357{
diff --git a/drivers/net/wireless/ath/ath9k/rc.h b/drivers/net/wireless/ath/ath9k/rc.h
index 528c83cf7011..267dbfcfaa96 100644
--- a/drivers/net/wireless/ath/ath9k/rc.h
+++ b/drivers/net/wireless/ath/ath9k/rc.h
@@ -213,10 +213,24 @@ struct ath_rate_priv {
213 213
214#if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS) 214#if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS)
215 struct dentry *debugfs_rcstats; 215 struct dentry *debugfs_rcstats;
216#endif
217 struct ath_rc_stats rcstats[RATE_TABLE_SIZE]; 216 struct ath_rc_stats rcstats[RATE_TABLE_SIZE];
217#endif
218}; 218};
219 219
220#if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS)
221void ath_debug_stat_rc(struct ath_rate_priv *rc, int final_rate);
222void ath_debug_stat_retries(struct ath_rate_priv *rc, int rix,
223 int xretries, int retries, u8 per);
224#else
225static inline void ath_debug_stat_rc(struct ath_rate_priv *rc, int final_rate)
226{
227}
228static inline void ath_debug_stat_retries(struct ath_rate_priv *rc, int rix,
229 int xretries, int retries, u8 per)
230{
231}
232#endif
233
220#ifdef CONFIG_ATH9K_RATE_CONTROL 234#ifdef CONFIG_ATH9K_RATE_CONTROL
221int ath_rate_control_register(void); 235int ath_rate_control_register(void);
222void ath_rate_control_unregister(void); 236void ath_rate_control_unregister(void);