2007-08-05 19:50:20

by Mattias Nissler

[permalink] [raw]
Subject: suspend/resume support in mac80211

Hi,

we have recently been struggling with getting suspend/resume working in
rt2x00. A few questions:

1. What is the recommended scheme for implementing suspend/resume with
mac80211? Some drivers (p54, iwlwifi) call ieee80211_stop_queues().
rt2x00 is currently doing so, but it doesn't seem to be enough: mac80211
calls back into rt2x00 while the device is suspended, resulting in
chaos.

2. Are there any mac80211 drivers that suspend/resume properly? Also
when associated?

3. Shouldn't mac80211 be made suspend/resume-aware (AFAIK it is not), so
we can do things like disassociating during suspend and reassociating
when resuming? I'd like something in the spirit of
netif_device_detach()/netif_device_attach(). Comments?

Cheers,

Mattias



2007-08-05 23:16:32

by Peter Stuge

[permalink] [raw]
Subject: Re: [Rt2400-devel] suspend/resume support in mac80211

On Sun, Aug 05, 2007 at 11:44:12PM +0200, Michael Buesch wrote:
> > we have recently been struggling with getting suspend/resume
> > working in rt2x00. A few questions:
>
> There is no suspend/resume support in mac80211.

Wow, that's really bad news.

Are there plans for it?


> > 3. Shouldn't mac80211 be made suspend/resume-aware
>
> I think we should have a API call to mac80211 that suspends the
> stack (saves the state etc..)

Would it be enough to add a suspended state and functions for
entering/exiting the state? On transitions, the appropriate driver
level functions are called of course.


> and a call the resumes (reassociates, re-handshakes...).
> But that's probably not that easy to implement, as parts of this
> does happen in userspace.

Shouldn't that be handled by hotplugging then?


(I'm not on linux-wireless, but rt2400-devel, no need to cc if you
crosspost.)

//Peter

2007-08-06 09:15:42

by Johannes Berg

[permalink] [raw]
Subject: Re: suspend/resume support in mac80211

On Sun, 2007-08-05 at 23:44 +0200, Michael Buesch wrote:

> I think we should have a API call to mac80211 that suspends the stack
> (saves the state etc..) and a call the resumes (reassociates, re-handshakes...).
> But that's probably not that easy to implement, as parts of this
> does happen in userspace.

At the minimum it should be resetting the keys. Reassocation etc. could
probably be done as well if using the in-kernel MLME.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-08-05 21:44:22

by Michael Büsch

[permalink] [raw]
Subject: Re: suspend/resume support in mac80211

On Sunday 05 August 2007, Mattias Nissler wrote:
> Hi,
>
> we have recently been struggling with getting suspend/resume working in
> rt2x00. A few questions:

There is no suspend/resume support in mac80211.

> 1. What is the recommended scheme for implementing suspend/resume with
> mac80211? Some drivers (p54, iwlwifi) call ieee80211_stop_queues().

Calling stop_queues() from outside of the TX handler may deadlock.
That is a bug in mac80211. I don't think it has been fixed, yet.

> 2. Are there any mac80211 drivers that suspend/resume properly? Also
> when associated?
>
> 3. Shouldn't mac80211 be made suspend/resume-aware (AFAIK it is not), so
> we can do things like disassociating during suspend and reassociating
> when resuming? I'd like something in the spirit of
> netif_device_detach()/netif_device_attach(). Comments?

I think we should have a API call to mac80211 that suspends the stack
(saves the state etc..) and a call the resumes (reassociates, re-handshakes...).
But that's probably not that easy to implement, as parts of this
does happen in userspace.