All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Kalle Valo <kalle.valo@nokia.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC v3 1/4] mac80211: enable IEEE80211_CONF_PS only when associated
Date: Fri, 28 Nov 2008 23:11:03 +0100	[thread overview]
Message-ID: <1227910263.3543.0.camel@johannes.berg> (raw)
In-Reply-To: <1227901784-5325-2-git-send-email-kalle.valo@nokia.com> (sfid-20081128_205002_114359_21347A04)

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

On Fri, 2008-11-28 at 21:49 +0200, Kalle Valo wrote:

> @@ -953,25 +953,44 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
>  				    struct iw_param *wrq,
>  				    char *extra)
>  {
> +	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
>  	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
> +	struct ieee80211_if_sta *ifsta = &sdata->u.sta;
>  	struct ieee80211_conf *conf = &local->hw.conf;
> +	int ret = 0;
> +	bool ps;
>  
>  	if (wrq->disabled) {
> -		conf->flags &= ~IEEE80211_CONF_PS;
> -		return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
> +		ps = false;
> +		goto set;
>  	}
>  
>  	switch (wrq->flags & IW_POWER_MODE) {
>  	case IW_POWER_ON:       /* If not specified */
>  	case IW_POWER_MODE:     /* If set all mask */
>  	case IW_POWER_ALL_R:    /* If explicitely state all */
> -		conf->flags |= IEEE80211_CONF_PS;
> +		ps = true;
>  		break;
>  	default:                /* Otherwise we don't support it */
>  		return -EINVAL;
>  	}
>  
> -	return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
> +	if (ps == local->powersave)
> +		return ret;
> +
> +set:
> +	local->powersave = ps;
> +
> +	if (ifsta->flags && IEEE80211_STA_ASSOCIATED) {

This really needs to check you're actually in STA mode.

johannes

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

  reply	other threads:[~2008-11-28 22:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28 19:49 [RFC v3] mac80211 dynamic power save Kalle Valo
2008-11-28 19:49 ` [RFC v3 1/4] mac80211: enable IEEE80211_CONF_PS only when associated Kalle Valo
2008-11-28 22:11   ` Johannes Berg [this message]
2008-11-29  6:50     ` Kalle Valo
2008-11-28 19:49 ` [RFC v3 2/4] mac80211: implement dynamic power save Kalle Valo
2008-11-28 22:14   ` Johannes Berg
2008-11-29  6:53     ` Kalle Valo
2008-12-01 19:10   ` Luis R. Rodriguez
2008-12-01 22:40     ` Johannes Berg
2008-12-01 23:49       ` Luis R. Rodriguez
2008-12-02 19:42     ` Kalle Valo
2008-11-28 19:49 ` [RFC v3 3/4] mac80211: add IEEE80211_HW_NO_DYNAMIC_PS flag Kalle Valo
2008-11-28 22:15   ` Johannes Berg
2008-11-29  6:55     ` Kalle Valo
2008-11-28 19:49 ` [RFC v3 4/4] mac80211: move dynamic_ps_timeout to hw.conf Kalle Valo
2008-11-28 22:18   ` Johannes Berg
2008-11-29  7:00     ` Kalle Valo
2008-12-01 19:11   ` Luis R. Rodriguez
2008-12-01 19:41     ` Johannes Berg
2008-12-01 20:36       ` Luis R. Rodriguez
2008-12-01 20:30     ` 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=1227910263.3543.0.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=kalle.valo@nokia.com \
    --cc=linux-wireless@vger.kernel.org \
    /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.