提交 2ca813ad 编写于 作者: J Johannes Berg

cfg80211: move locking into cfg80211_bss_age

There's no reason for it to require external
locking, move it into the function.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 50521aa8
...@@ -231,15 +231,16 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev, ...@@ -231,15 +231,16 @@ int __cfg80211_stop_sched_scan(struct cfg80211_registered_device *rdev,
return 0; return 0;
} }
/* must hold dev->bss_lock! */
void cfg80211_bss_age(struct cfg80211_registered_device *dev, void cfg80211_bss_age(struct cfg80211_registered_device *dev,
unsigned long age_secs) unsigned long age_secs)
{ {
struct cfg80211_internal_bss *bss; struct cfg80211_internal_bss *bss;
unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC); unsigned long age_jiffies = msecs_to_jiffies(age_secs * MSEC_PER_SEC);
spin_lock_bh(&dev->bss_lock);
list_for_each_entry(bss, &dev->bss_list, list) list_for_each_entry(bss, &dev->bss_list, list)
bss->ts -= age_jiffies; bss->ts -= age_jiffies;
spin_unlock_bh(&dev->bss_lock);
} }
void cfg80211_bss_expire(struct cfg80211_registered_device *dev) void cfg80211_bss_expire(struct cfg80211_registered_device *dev)
......
...@@ -108,9 +108,7 @@ static int wiphy_resume(struct device *dev) ...@@ -108,9 +108,7 @@ static int wiphy_resume(struct device *dev)
int ret = 0; int ret = 0;
/* Age scan results with time spent in suspend */ /* Age scan results with time spent in suspend */
spin_lock_bh(&rdev->bss_lock);
cfg80211_bss_age(rdev, get_seconds() - rdev->suspend_at); cfg80211_bss_age(rdev, get_seconds() - rdev->suspend_at);
spin_unlock_bh(&rdev->bss_lock);
if (rdev->ops->resume) { if (rdev->ops->resume) {
rtnl_lock(); rtnl_lock();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册