linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: reinette chatre <reinette.chatre@intel.com>
To: Dan Williams <dcbw@redhat.com>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"Zhu, Yi" <yi.zhu@intel.com>
Subject: Re: [PATCH] ipw2x00: age scan results on resume
Date: Tue, 10 Feb 2009 13:35:14 -0800	[thread overview]
Message-ID: <1234301714.1626.27.camel@rc-desk> (raw)
In-Reply-To: <1234280177.3119.23.camel@localhost>

On Tue, 2009-02-10 at 07:36 -0800, Dan Williams wrote:
> 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>

This makes sense.

> ---
> This fixes NetworkManager and wpa_supplicant trying to connect to the AP
> associated with at suspend/hibernate time, which clearly may not exist
> at the location where the machine is waking up.
> 
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index 823c2bf..abf897d 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);
> @@ -6414,6 +6420,9 @@ 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);
>  
> +	if (!priv->suspend_at)
> +		priv->suspend_at = get_seconds();
> +

I do not see where suspend_at is reset. Would that not confuse things
when you suspend two or more times?

Reinette




  reply	other threads:[~2009-02-10 21:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-10 15:36 [PATCH] ipw2x00: age scan results on resume Dan Williams
2009-02-10 21:35 ` reinette chatre [this message]
2009-02-10 22:04   ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1234301714.1626.27.camel@rc-desk \
    --to=reinette.chatre@intel.com \
    --cc=dcbw@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=yi.zhu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).