From c3d72b968129ad4aec86c5fc8d2380f01ebebc53 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 11 Feb 2009 13:26:06 -0500 Subject: ipw2x00: 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 Signed-off-by: John W. Linville --- drivers/net/wireless/ipw2x00/ipw2100.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'drivers/net/wireless/ipw2x00/ipw2100.c') diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 52b1cf5..3a6d810 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c @@ -1692,7 +1692,13 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred) u32 lock; u32 ord_len = sizeof(lock); - /* Quite if manually disabled. */ + /* Age scan list entries found before suspend */ + if (priv->suspend_time) { + ieee80211_networks_age(priv->ieee, priv->suspend_time); + priv->suspend_time = 0; + } + + /* Quiet if manually disabled. */ if (priv->status & STATUS_RF_KILL_SW) { IPW_DEBUG_INFO("%s: Radio is disabled by Manual Disable " "switch\n", priv->net_dev->name); @@ -6415,6 +6421,8 @@ static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state) pci_disable_device(pci_dev); pci_set_power_state(pci_dev, PCI_D3hot); + priv->suspend_at = get_seconds(); + mutex_unlock(&priv->action_mutex); return 0; @@ -6458,6 +6466,8 @@ static int ipw2100_resume(struct pci_dev *pci_dev) * the queue of needed */ netif_device_attach(dev); + priv->suspend_time = get_seconds() - priv->suspend_at; + /* Bring the device back up */ if (!(priv->status & STATUS_RF_KILL_SW)) ipw2100_up(priv, 0); -- cgit v1.1