diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/rc.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 27ed80b5488..714558d1ba7 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 | ||
985 | static 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 | |||
995 | static void ath_rc_update_ht(struct ath_softc *sc, | 985 | static 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 | ||
1068 | static 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 | |||
1076 | static void ath_rc_tx_status(struct ath_softc *sc, | 1058 | static 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) |
@@ -1350,7 +1332,25 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, | |||
1350 | } | 1332 | } |
1351 | } | 1333 | } |
1352 | 1334 | ||
1353 | #ifdef CONFIG_ATH9K_DEBUGFS | 1335 | #if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS) |
1336 | |||
1337 | void 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 | |||
1345 | void 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 | 1354 | ||
1355 | static ssize_t read_file_rcstat(struct file *file, char __user *user_buf, | 1355 | static 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) |
@@ -1428,10 +1428,17 @@ static void ath_rate_add_sta_debugfs(void *priv, void *priv_sta, | |||
1428 | struct dentry *dir) | 1428 | struct dentry *dir) |
1429 | { | 1429 | { |
1430 | struct ath_rate_priv *rc = priv_sta; | 1430 | struct ath_rate_priv *rc = priv_sta; |
1431 | debugfs_create_file("rc_stats", S_IRUGO, dir, rc, &fops_rcstat); | 1431 | rc->debugfs_rcstats = debugfs_create_file("rc_stats", S_IRUGO, |
1432 | dir, rc, &fops_rcstat); | ||
1433 | } | ||
1434 | |||
1435 | static void ath_rate_remove_sta_debugfs(void *priv, void *priv_sta) | ||
1436 | { | ||
1437 | struct ath_rate_priv *rc = priv_sta; | ||
1438 | debugfs_remove(rc->debugfs_rcstats); | ||
1432 | } | 1439 | } |
1433 | 1440 | ||
1434 | #endif /* CONFIG_ATH9K_DEBUGFS */ | 1441 | #endif /* CONFIG_MAC80211_DEBUGFS && CONFIG_ATH9K_DEBUGFS */ |
1435 | 1442 | ||
1436 | static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) | 1443 | static void *ath_rate_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) |
1437 | { | 1444 | { |
@@ -1476,8 +1483,10 @@ static struct rate_control_ops ath_rate_ops = { | |||
1476 | .free = ath_rate_free, | 1483 | .free = ath_rate_free, |
1477 | .alloc_sta = ath_rate_alloc_sta, | 1484 | .alloc_sta = ath_rate_alloc_sta, |
1478 | .free_sta = ath_rate_free_sta, | 1485 | .free_sta = ath_rate_free_sta, |
1479 | #ifdef CONFIG_ATH9K_DEBUGFS | 1486 | |
1487 | #if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS) | ||
1480 | .add_sta_debugfs = ath_rate_add_sta_debugfs, | 1488 | .add_sta_debugfs = ath_rate_add_sta_debugfs, |
1489 | .remove_sta_debugfs = ath_rate_remove_sta_debugfs, | ||
1481 | #endif | 1490 | #endif |
1482 | }; | 1491 | }; |
1483 | 1492 | ||