diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-12-13 23:07:46 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-01-03 13:01:16 +0100 |
commit | b998e8bb3e1c6eeae5eab9d6a434563270286c3b (patch) | |
tree | 123f50adba77eec78f3c69eac4f872ff4cce0087 /net/mac80211/sta_info.c | |
parent | 0f6dfcee2e081f47a3e97cb8984fb4d62217e6f7 (diff) | |
download | blackbird-op-linux-b998e8bb3e1c6eeae5eab9d6a434563270286c3b.tar.gz blackbird-op-linux-b998e8bb3e1c6eeae5eab9d6a434563270286c3b.zip |
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.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index ca9fde198188..d743645a17b5 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; } |