aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-01 07:52:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-04 16:20:07 -0400
commit26d59535aa08386b97ece58a27bb16fca4f066db (patch)
tree13949e0c77c36c502d99d417a72188189c87e0b6
parentccc7c28af205888798b51b6cbc0b557ac1170a49 (diff)
mac80211: clean up station cleanup timer
We currently run this timer exactly once when a new mac80211 device is registered, but that is completely pointless since it will have no work to do at all. Therefore, remove that and also simplify some code using the timer. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--net/mac80211/main.c5
-rw-r--r--net/mac80211/sta_info.c13
-rw-r--r--net/mac80211/sta_info.h1
-rw-r--r--net/mac80211/util.c2
4 files changed, 3 insertions, 18 deletions
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 562d2984c482..dc50fc3153e5 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -879,10 +879,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
879 879
880 local->dynamic_ps_forced_timeout = -1; 880 local->dynamic_ps_forced_timeout = -1;
881 881
882 result = sta_info_start(local);
883 if (result < 0)
884 goto fail_sta_info;
885
886 result = ieee80211_wep_init(local); 882 result = ieee80211_wep_init(local);
887 if (result < 0) 883 if (result < 0)
888 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n", 884 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
@@ -945,7 +941,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
945 rtnl_unlock(); 941 rtnl_unlock();
946 ieee80211_wep_free(local); 942 ieee80211_wep_free(local);
947 sta_info_stop(local); 943 sta_info_stop(local);
948 fail_sta_info:
949 destroy_workqueue(local->workqueue); 944 destroy_workqueue(local->workqueue);
950 fail_workqueue: 945 fail_workqueue:
951 wiphy_unregister(local->hw.wiphy); 946 wiphy_unregister(local->hw.wiphy);
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 5ec0a7c51b6d..999f8fbf0b4b 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -768,9 +768,8 @@ static void sta_info_cleanup(unsigned long data)
768 if (!timer_needed) 768 if (!timer_needed)
769 return; 769 return;
770 770
771 local->sta_cleanup.expires = 771 mod_timer(&local->sta_cleanup,
772 round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL); 772 round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL));
773 add_timer(&local->sta_cleanup);
774} 773}
775 774
776void sta_info_init(struct ieee80211_local *local) 775void sta_info_init(struct ieee80211_local *local)
@@ -783,14 +782,6 @@ void sta_info_init(struct ieee80211_local *local)
783 782
784 setup_timer(&local->sta_cleanup, sta_info_cleanup, 783 setup_timer(&local->sta_cleanup, sta_info_cleanup,
785 (unsigned long)local); 784 (unsigned long)local);
786 local->sta_cleanup.expires =
787 round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
788}
789
790int sta_info_start(struct ieee80211_local *local)
791{
792 add_timer(&local->sta_cleanup);
793 return 0;
794} 785}
795 786
796void sta_info_stop(struct ieee80211_local *local) 787void sta_info_stop(struct ieee80211_local *local)
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 57681149e37f..43238e99cfb3 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -497,7 +497,6 @@ void sta_info_set_tim_bit(struct sta_info *sta);
497void sta_info_clear_tim_bit(struct sta_info *sta); 497void sta_info_clear_tim_bit(struct sta_info *sta);
498 498
499void sta_info_init(struct ieee80211_local *local); 499void sta_info_init(struct ieee80211_local *local);
500int sta_info_start(struct ieee80211_local *local);
501void sta_info_stop(struct ieee80211_local *local); 500void sta_info_stop(struct ieee80211_local *local);
502int sta_info_flush(struct ieee80211_local *local, 501int sta_info_flush(struct ieee80211_local *local,
503 struct ieee80211_sub_if_data *sdata); 502 struct ieee80211_sub_if_data *sdata);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 556647a910ac..ef0560a2346a 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1290,7 +1290,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1290 } 1290 }
1291 } 1291 }
1292 1292
1293 add_timer(&local->sta_cleanup); 1293 mod_timer(&local->sta_cleanup, jiffies + 1);
1294 1294
1295 mutex_lock(&local->sta_mtx); 1295 mutex_lock(&local->sta_mtx);
1296 list_for_each_entry(sta, &local->sta_list, list) 1296 list_for_each_entry(sta, &local->sta_list, list)