aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-12-13 23:07:46 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 13:01:16 +0100
commitb998e8bb3e1c6eeae5eab9d6a434563270286c3b (patch)
tree123f50adba77eec78f3c69eac4f872ff4cce0087 /net/mac80211/sta_info.c
parent0f6dfcee2e081f47a3e97cb8984fb4d62217e6f7 (diff)
downloadkernel_goldelico_gta04-b998e8bb3e1c6eeae5eab9d6a434563270286c3b.zip
kernel_goldelico_gta04-b998e8bb3e1c6eeae5eab9d6a434563270286c3b.tar.gz
kernel_goldelico_gta04-b998e8bb3e1c6eeae5eab9d6a434563270286c3b.tar.bz2
mac80211: remove final sta_info_flush()
When all interfaces have been removed, there can't be any stations left over, so there's no need to flush again. Remove this, and all code associated with it, which also simplifies the function. Tested-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index ca9fde1..d743645 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -885,7 +885,6 @@ void sta_info_init(struct ieee80211_local *local)
void sta_info_stop(struct ieee80211_local *local)
{
del_timer_sync(&local->sta_cleanup);
- sta_info_flush(local, NULL);
}
/**
@@ -893,12 +892,11 @@ void sta_info_stop(struct ieee80211_local *local)
*
* Returns the number of removed STA entries.
*
- * @local: local interface data
- * @sdata: matching rule for the net device (sta->dev) or %NULL to match all STAs
+ * @sdata: sdata to remove all stations from
*/
-int sta_info_flush(struct ieee80211_local *local,
- struct ieee80211_sub_if_data *sdata)
+int sta_info_flush(struct ieee80211_sub_if_data *sdata)
{
+ struct ieee80211_local *local = sdata->local;
struct sta_info *sta, *tmp;
int ret = 0;
@@ -906,7 +904,7 @@ int sta_info_flush(struct ieee80211_local *local,
mutex_lock(&local->sta_mtx);
list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
- if (!sdata || sdata == sta->sdata) {
+ if (sdata == sta->sdata) {
WARN_ON(__sta_info_destroy(sta));
ret++;
}
@@ -915,17 +913,8 @@ int sta_info_flush(struct ieee80211_local *local,
rcu_barrier();
- if (sdata) {
- ieee80211_cleanup_sdata_stas(sdata);
- cancel_work_sync(&sdata->cleanup_stations_wk);
- } else {
- mutex_lock(&local->iflist_mtx);
- list_for_each_entry(sdata, &local->interfaces, list) {
- ieee80211_cleanup_sdata_stas(sdata);
- cancel_work_sync(&sdata->cleanup_stations_wk);
- }
- mutex_unlock(&local->iflist_mtx);
- }
+ ieee80211_cleanup_sdata_stas(sdata);
+ cancel_work_sync(&sdata->cleanup_stations_wk);
return ret;
}