mac80211: clean up station cleanup timer
authorJohannes Berg <johannes.berg@intel.com>
Fri, 1 Apr 2011 11:52:48 +0000 (13:52 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 4 Apr 2011 20:20:07 +0000 (16:20 -0400)
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>
net/mac80211/main.c
net/mac80211/sta_info.c
net/mac80211/sta_info.h
net/mac80211/util.c

index 562d2984c4826fd39278a1924ae117ea0776afd1..dc50fc3153e53d3e689570036cdea5e079ad9cbb 100644 (file)
@@ -879,10 +879,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
        local->dynamic_ps_forced_timeout = -1;
 
-       result = sta_info_start(local);
-       if (result < 0)
-               goto fail_sta_info;
-
        result = ieee80211_wep_init(local);
        if (result < 0)
                wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
@@ -945,7 +941,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
        rtnl_unlock();
        ieee80211_wep_free(local);
        sta_info_stop(local);
- fail_sta_info:
        destroy_workqueue(local->workqueue);
  fail_workqueue:
        wiphy_unregister(local->hw.wiphy);
index 5ec0a7c51b6df02ba934fdb02f444a97227c772a..999f8fbf0b4b3ad0edcf36598ca88129c06160fe 100644 (file)
@@ -768,9 +768,8 @@ static void sta_info_cleanup(unsigned long data)
        if (!timer_needed)
                return;
 
-       local->sta_cleanup.expires =
-               round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
-       add_timer(&local->sta_cleanup);
+       mod_timer(&local->sta_cleanup,
+                 round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL));
 }
 
 void sta_info_init(struct ieee80211_local *local)
@@ -783,14 +782,6 @@ void sta_info_init(struct ieee80211_local *local)
 
        setup_timer(&local->sta_cleanup, sta_info_cleanup,
                    (unsigned long)local);
-       local->sta_cleanup.expires =
-               round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
-}
-
-int sta_info_start(struct ieee80211_local *local)
-{
-       add_timer(&local->sta_cleanup);
-       return 0;
 }
 
 void sta_info_stop(struct ieee80211_local *local)
index 57681149e37fd1cf45bb4540f9a2a2ae8fe8e68c..43238e99cfb363ff810008be818702935ab281d0 100644 (file)
@@ -497,7 +497,6 @@ void sta_info_set_tim_bit(struct sta_info *sta);
 void sta_info_clear_tim_bit(struct sta_info *sta);
 
 void sta_info_init(struct ieee80211_local *local);
-int sta_info_start(struct ieee80211_local *local);
 void sta_info_stop(struct ieee80211_local *local);
 int sta_info_flush(struct ieee80211_local *local,
                   struct ieee80211_sub_if_data *sdata);
index 556647a910acc8ea96d7d6d2e1a4a56e063a2c55..ef0560a2346a1b7869f4518baa7941e272707bed 100644 (file)
@@ -1290,7 +1290,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
                }
        }
 
-       add_timer(&local->sta_cleanup);
+       mod_timer(&local->sta_cleanup, jiffies + 1);
 
        mutex_lock(&local->sta_mtx);
        list_for_each_entry(sta, &local->sta_list, list)