diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:01:46 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:20 -0400 |
commit | 24723d1bc9da79a53d0495b9cf9ee18747121b03 (patch) | |
tree | 083ace192a6b36dc2545caf839fbf9a79ae5d4d6 /net/mac80211/sta_info.c | |
parent | 39fcf7a315e098430e878a5c0c4d39561c93ebf6 (diff) |
mac80211: move ieee80211_sta_expire
ieee80211_sta_expire uses the internal __sta_info_unlink
function which can become static if this function is moved
to sta_info.c.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index f2ba653b9d69..3370b2625633 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -424,7 +424,7 @@ void sta_info_clear_tim_bit(struct sta_info *sta) | |||
424 | spin_unlock_irqrestore(&sta->local->sta_lock, flags); | 424 | spin_unlock_irqrestore(&sta->local->sta_lock, flags); |
425 | } | 425 | } |
426 | 426 | ||
427 | void __sta_info_unlink(struct sta_info **sta) | 427 | static void __sta_info_unlink(struct sta_info **sta) |
428 | { | 428 | { |
429 | struct ieee80211_local *local = (*sta)->local; | 429 | struct ieee80211_local *local = (*sta)->local; |
430 | struct ieee80211_sub_if_data *sdata = (*sta)->sdata; | 430 | struct ieee80211_sub_if_data *sdata = (*sta)->sdata; |
@@ -802,3 +802,29 @@ void sta_info_flush_delayed(struct ieee80211_sub_if_data *sdata) | |||
802 | schedule_work(&local->sta_flush_work); | 802 | schedule_work(&local->sta_flush_work); |
803 | spin_unlock_irqrestore(&local->sta_lock, flags); | 803 | spin_unlock_irqrestore(&local->sta_lock, flags); |
804 | } | 804 | } |
805 | |||
806 | void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata, | ||
807 | unsigned long exp_time) | ||
808 | { | ||
809 | struct ieee80211_local *local = sdata->local; | ||
810 | struct sta_info *sta, *tmp; | ||
811 | LIST_HEAD(tmp_list); | ||
812 | DECLARE_MAC_BUF(mac); | ||
813 | unsigned long flags; | ||
814 | |||
815 | spin_lock_irqsave(&local->sta_lock, flags); | ||
816 | list_for_each_entry_safe(sta, tmp, &local->sta_list, list) | ||
817 | if (time_after(jiffies, sta->last_rx + exp_time)) { | ||
818 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | ||
819 | printk(KERN_DEBUG "%s: expiring inactive STA %s\n", | ||
820 | sdata->dev->name, print_mac(mac, sta->addr)); | ||
821 | #endif | ||
822 | __sta_info_unlink(&sta); | ||
823 | if (sta) | ||
824 | list_add(&sta->list, &tmp_list); | ||
825 | } | ||
826 | spin_unlock_irqrestore(&local->sta_lock, flags); | ||
827 | |||
828 | list_for_each_entry_safe(sta, tmp, &tmp_list, list) | ||
829 | sta_info_destroy(sta); | ||
830 | } | ||