aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-12-13 17:07:46 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 07:01:16 -0500
commitb998e8bb3e1c6eeae5eab9d6a434563270286c3b (patch)
tree123f50adba77eec78f3c69eac4f872ff4cce0087 /net/mac80211/sta_info.c
parent0f6dfcee2e081f47a3e97cb8984fb4d62217e6f7 (diff)
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 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)
885void sta_info_stop(struct ieee80211_local *local) 885void sta_info_stop(struct ieee80211_local *local)
886{ 886{
887 del_timer_sync(&local->sta_cleanup); 887 del_timer_sync(&local->sta_cleanup);
888 sta_info_flush(local, NULL);
889} 888}
890 889
891/** 890/**
@@ -893,12 +892,11 @@ void sta_info_stop(struct ieee80211_local *local)
893 * 892 *
894 * Returns the number of removed STA entries. 893 * Returns the number of removed STA entries.
895 * 894 *
896 * @local: local interface data 895 * @sdata: sdata to remove all stations from
897 * @sdata: matching rule for the net device (sta->dev) or %NULL to match all STAs
898 */ 896 */
899int sta_info_flush(struct ieee80211_local *local, 897int sta_info_flush(struct ieee80211_sub_if_data *sdata)
900 struct ieee80211_sub_if_data *sdata)
901{ 898{
899 struct ieee80211_local *local = sdata->local;
902 struct sta_info *sta, *tmp; 900 struct sta_info *sta, *tmp;
903 int ret = 0; 901 int ret = 0;
904 902
@@ -906,7 +904,7 @@ int sta_info_flush(struct ieee80211_local *local,
906 904
907 mutex_lock(&local->sta_mtx); 905 mutex_lock(&local->sta_mtx);
908 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { 906 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) {
909 if (!sdata || sdata == sta->sdata) { 907 if (sdata == sta->sdata) {
910 WARN_ON(__sta_info_destroy(sta)); 908 WARN_ON(__sta_info_destroy(sta));
911 ret++; 909 ret++;
912 } 910 }
@@ -915,17 +913,8 @@ int sta_info_flush(struct ieee80211_local *local,
915 913
916 rcu_barrier(); 914 rcu_barrier();
917 915
918 if (sdata) { 916 ieee80211_cleanup_sdata_stas(sdata);
919 ieee80211_cleanup_sdata_stas(sdata); 917 cancel_work_sync(&sdata->cleanup_stations_wk);
920 cancel_work_sync(&sdata->cleanup_stations_wk);
921 } else {
922 mutex_lock(&local->iflist_mtx);
923 list_for_each_entry(sdata, &local->interfaces, list) {
924 ieee80211_cleanup_sdata_stas(sdata);
925 cancel_work_sync(&sdata->cleanup_stations_wk);
926 }
927 mutex_unlock(&local->iflist_mtx);
928 }
929 918
930 return ret; 919 return ret;
931} 920}