diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2012-11-21 07:43:13 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-21 14:16:04 -0500 |
commit | 1c11e10b6a64f14427be518ccc2a242b73fc3d9f (patch) | |
tree | 8954346167be679b25e9443212b77a5ce9dd3923 /drivers | |
parent | c0b74876ee4873dc89d80b59f5e890a1d0a87be1 (diff) |
ath9k: Fill remove_sta_debugfs() callback
Remove the rate control statistics debugfs file properly
via remove_sta_debugfs(). Also, check for both MAC80211_DEBUGFS
and ATH9K_DEBUGFS config options.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.c | 17 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/rc.h | 2 |
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index 27ed80b54881..004f016290d3 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -1350,7 +1350,7 @@ static void ath_rate_update(void *priv, struct ieee80211_supported_band *sband, | |||
1350 | } | 1350 | } |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | #ifdef CONFIG_ATH9K_DEBUGFS | 1353 | #if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS) |
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); | ||
1432 | } | 1433 | } |
1433 | 1434 | ||
1434 | #endif /* CONFIG_ATH9K_DEBUGFS */ | 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); | ||
1439 | } | ||
1440 | |||
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 | ||
diff --git a/drivers/net/wireless/ath/ath9k/rc.h b/drivers/net/wireless/ath/ath9k/rc.h index 268e67dc5fb2..528c83cf7011 100644 --- a/drivers/net/wireless/ath/ath9k/rc.h +++ b/drivers/net/wireless/ath/ath9k/rc.h | |||
@@ -211,7 +211,9 @@ struct ath_rate_priv { | |||
211 | struct ath_rateset neg_ht_rates; | 211 | struct ath_rateset neg_ht_rates; |
212 | const struct ath_rate_table *rate_table; | 212 | const struct ath_rate_table *rate_table; |
213 | 213 | ||
214 | #if defined(CONFIG_MAC80211_DEBUGFS) && defined(CONFIG_ATH9K_DEBUGFS) | ||
214 | struct dentry *debugfs_rcstats; | 215 | struct dentry *debugfs_rcstats; |
216 | #endif | ||
215 | struct ath_rc_stats rcstats[RATE_TABLE_SIZE]; | 217 | struct ath_rc_stats rcstats[RATE_TABLE_SIZE]; |
216 | }; | 218 | }; |
217 | 219 | ||