linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Nikula <jhnikula@gmail.com>
To: Kalle Valo <kvalo@adurom.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [RFC] wl1251: Add support for idle mode
Date: Wed, 30 Mar 2011 10:24:30 +0300	[thread overview]
Message-ID: <20110330102430.8bef80f6.jhnikula@gmail.com> (raw)
In-Reply-To: <87r59prtx6.fsf@purkki.adurom.net>

Hi

On Wed, 30 Mar 2011 09:42:13 +0300
Kalle Valo <kvalo@adurom.com> wrote:

> > It seems it is just enough the authorize ELP mode followed by
> > CMD_DISCONNECT (thanks to Kalle Valo about the idea to use it).
> 
> Actually I was expecting that you would first issue the disconnect
> command and only then enable elp. The thing is that for sending
> commands we need to wakeup firmware from elp, so enabling elp last
> makes more sense. Was there a reason why you did it in this order?
> 
Actually order is this. Both PSM and idle are activated via
wl1251_op_config so those precommands etc are executed first and the ELP
activation after that. See

wl1251_op_config
-> wl1251_ps_elp_wakeup
...
-> wl1251_ps_set_mode (those precommands for PSM and idle)
-> wl1251_ps_elp_sleep (+ called from other functions as well)
  -> ieee80211_queue_delayed_work(wl->hw, &wl->elp_work, delay);
    -> wl1251_elp_work (ELP activated here)

> > --- a/drivers/net/wireless/wl1251/cmd.h
> > +++ b/drivers/net/wireless/wl1251/cmd.h
> > @@ -314,7 +314,8 @@ struct wl1251_cmd_vbm_update {
> >  
> >  enum wl1251_cmd_ps_mode {
> >  	STATION_ACTIVE_MODE,
> > -	STATION_POWER_SAVE_MODE
> > +	STATION_POWER_SAVE_MODE,
> > +	STATION_IDLE,
> >  };
> 
> My idea was that cmd and acx files contain only the firmware
> interface, nothing more. I assume that firmware knows nothing this new
> value, right?
> 
Ok, this is good to know.

> Another way to do this would be that you create a new state enum to
> wl1251.h with the three states above and then change
> wl1251_ps_set_mode(), and it's callers, to use the new enum. That way
> you can keep cmd.h intact.
> 
> Also I'm guessing that in the future we need to store the new state
> enum to struct wl1251.
> 
This sounds much better idea. E.g. now the code is a bit unclear as the
flag psm is used also when in idle. I think the flag psm is better to
replace by some ps_mode state variable since then it can be used to
distinguish the PSM and idle if there's ever need to do so and no risk
that psm and new variable goes out of sync.

-- 
Jarkko

  reply	other threads:[~2011-03-30  7:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-29 14:15 [RFC] wl1251: Add support for idle mode Jarkko Nikula
2011-03-30  6:42 ` Kalle Valo
2011-03-30  7:24   ` Jarkko Nikula [this message]
2011-03-30  7:39     ` Kalle Valo

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=20110330102430.8bef80f6.jhnikula@gmail.com \
    --to=jhnikula@gmail.com \
    --cc=kvalo@adurom.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).