aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/sysfs.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2009-02-11 17:14:43 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:40 -0500
commitcb3a8eec0e66edfe8db7d3b3bf19d25745bae3c3 (patch)
treeb4eacfc01470617fca40779bccdca6625dba7716 /net/wireless/sysfs.c
parentabd2fdb4c606f0e5cfec3647d57ebd20f03caafd (diff)
cfg80211: age scan results on resume
Scanned BSS entries are timestamped with jiffies, which doesn't increment across suspend and hibernate. On resume, every BSS in the scan list looks like it was scanned within the last 10 seconds, irregardless of how long the machine was actually asleep. Age scan results on resume with the time spent during sleep so userspace has a clue how old they really are. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/sysfs.c')
-rw-r--r--net/wireless/sysfs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c
index 26a72b0797a0..15feaeb5ced5 100644
--- a/net/wireless/sysfs.c
+++ b/net/wireless/sysfs.c
@@ -60,6 +60,8 @@ static int wiphy_suspend(struct device *dev, pm_message_t state)
60 struct cfg80211_registered_device *rdev = dev_to_rdev(dev); 60 struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
61 int ret = 0; 61 int ret = 0;
62 62
63 rdev->suspend_at = get_seconds();
64
63 if (rdev->ops->suspend) { 65 if (rdev->ops->suspend) {
64 rtnl_lock(); 66 rtnl_lock();
65 ret = rdev->ops->suspend(&rdev->wiphy); 67 ret = rdev->ops->suspend(&rdev->wiphy);
@@ -74,6 +76,11 @@ static int wiphy_resume(struct device *dev)
74 struct cfg80211_registered_device *rdev = dev_to_rdev(dev); 76 struct cfg80211_registered_device *rdev = dev_to_rdev(dev);
75 int ret = 0; 77 int ret = 0;
76 78
79 /* Age scan results with time spent in suspend */
80 spin_lock_bh(&rdev->bss_lock);
81 cfg80211_bss_age(rdev, get_seconds() - rdev->suspend_at);
82 spin_unlock_bh(&rdev->bss_lock);
83
77 if (rdev->ops->resume) { 84 if (rdev->ops->resume) {
78 rtnl_lock(); 85 rtnl_lock();
79 ret = rdev->ops->resume(&rdev->wiphy); 86 ret = rdev->ops->resume(&rdev->wiphy);