All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: reinette chatre <reinette.chatre@intel.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 17:04:18 -0500	[thread overview]
Message-ID: <1234303458.15997.24.camel@localhost> (raw)
In-Reply-To: <1234301714.1626.27.camel@rc-desk>

On Tue, 2009-02-10 at 13:35 -0800, reinette chatre wrote:
> 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?

Ah right; left over from a previous iteration.  Thanks for the catch.

Dan



      reply	other threads:[~2009-02-10 22:05 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
2009-02-10 22:04   ` Dan Williams [this message]

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=1234303458.15997.24.camel@localhost \
    --to=dcbw@redhat.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=reinette.chatre@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.