All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Vivek Natarajan <vivek.natraj@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC] mac80211: A couple of fixes to dynamic power save.
Date: Mon, 22 Dec 2008 17:57:26 +0100	[thread overview]
Message-ID: <1229965047.10883.6.camel@johannes.berg> (raw)
In-Reply-To: <20081223025735.GB11534@myhost.users.atheros.com> (sfid-20081222_142412_070619_0D315137)

[-- Attachment #1: Type: text/plain, Size: 2178 bytes --]

On Mon, 2008-12-22 at 18:57 -0800, Vivek Natarajan wrote:
> a) hw_config() should not be called from siwpower() for the drivers which do not support
>    dynamic powersave.
> b) IEEE80211_HW_NO_STACK_DYNAMIC_PS needs to be verified in set_associated() also before
>    enabling the power save timers.
> 
> Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>

Seems good to me.

> ---
>  net/mac80211/mlme.c |    3 ++-
>  net/mac80211/wext.c |    9 +++++----
>  2 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index c75d0ea..b23e62b 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -746,7 +746,8 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
>  	bss_info_changed |= BSS_CHANGED_BASIC_RATES;
>  	ieee80211_bss_info_change_notify(sdata, bss_info_changed);
>  
> -	if (local->powersave) {
> +	if (local->powersave &&
> +			!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS)) {
>  		if (local->dynamic_ps_timeout > 0)
>  			mod_timer(&local->dynamic_ps_timer, jiffies +
>  				  msecs_to_jiffies(local->dynamic_ps_timeout));
> diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c
> index 7162d58..673c5d7 100644
> --- a/net/mac80211/wext.c
> +++ b/net/mac80211/wext.c
> @@ -865,9 +865,9 @@ set:
>  	local->powersave = ps;
>  	local->dynamic_ps_timeout = timeout;
>  
> -	if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) {
> -		if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) &&
> -		    local->dynamic_ps_timeout > 0)
> +	if (!(local->hw.flags & IEEE80211_HW_NO_STACK_DYNAMIC_PS) &&
> +			(sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)) {
> +		if (local->dynamic_ps_timeout > 0)
>  			mod_timer(&local->dynamic_ps_timer, jiffies +
>  				  msecs_to_jiffies(local->dynamic_ps_timeout));
>  		else {
> @@ -875,8 +875,9 @@ set:
>  				conf->flags |= IEEE80211_CONF_PS;
>  			else
>  				conf->flags &= ~IEEE80211_CONF_PS;
> +			ret = ieee80211_hw_config(local,
> +					IEEE80211_CONF_CHANGE_PS);
>  		}
> -		ret = ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
>  	}
>  
>  	return ret;

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2008-12-22 16:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23  2:57 [RFC] mac80211: A couple of fixes to dynamic power save Vivek Natarajan
2008-12-22 16:57 ` Johannes Berg [this message]
2008-12-23 19:44 ` 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=1229965047.10883.6.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=vivek.natraj@gmail.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.