Historical ath9k-devel archives
 help / color / mirror / Atom feed
From: Seth Forshee <seth.forshee@canonical.com>
To: ath9k-devel@lists.ath9k.org
Subject: [ath9k-devel] [PATCH 5/7] mac80211: Expand powersave configuration flag to be two bits
Date: Thu, 31 Jan 2013 10:33:55 -0600	[thread overview]
Message-ID: <20130131163355.GE28799@thinkpad-t410> (raw)
In-Reply-To: <1359645648.8415.77.camel@jlt4.sipsolutions.net>

On Thu, Jan 31, 2013 at 04:20:48PM +0100, Johannes Berg wrote:
> On Tue, 2013-01-29 at 17:47 -0600, Seth Forshee wrote:
> 
> > +static inline bool ieee80211_is_ps_disabled(struct ieee80211_conf *conf)
> 
> > +static inline bool ieee80211_is_ps_enabled(struct ieee80211_conf *conf)
> 
> Huh, is that worth the confusion? It seems !enabled should be the same
> as disabled, but it's not quite the same, which might be confusing.

In this patch there's no distinction, but after adding the off-channel
powersave state there is -- disabled == !enabled && !offchannel.
Actually one of the last bugs I fixed before sending these was a place
where I had used disabled instead of !enabled, and the frames ended up
with PM set when it shouldn't have been.

I agree though that the distinction is confusing. Maybe some better
state names are needed. Perhaps awake, offchannel, and doze?

> > +/**
> > + * ieee80211_set_ps_state - set device powersave state
> > + *
> > + * Sets the powersave state in the supplied device configuration to the
> > + * specified state.
> > + *
> > + * @conf: device configuration
> > + * @state: new powersave state. Must be one of the IEEE80211_CONF_PS_*
> > + *	flags from enum ieee80211_conf_flags.
> > + */
> > +static inline void ieee80211_set_ps_state(struct ieee80211_conf *conf,
> > +					  u32 state)
> > +{
> > +	conf->flags = (conf->flags & ~IEEE80211_CONF_PS_MASK) |
> > +		      (state & IEEE80211_CONF_PS_MASK);
> > +}
> 
> I don't think the driver should do this, so the inline shouldn't be
> here?

That's true. Would moving it to ieee80211_i.h be appropriate, or is
there somewhere better?

Seth

  reply	other threads:[~2013-01-31 16:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1359503255-18270-1-git-send-email-seth.forshee@canonical.com>
2013-01-29 23:47 ` [ath9k-devel] [PATCH 5/7] mac80211: Expand powersave configuration flag to be two bits Seth Forshee
2013-01-31 15:20   ` Johannes Berg
2013-01-31 16:33     ` Seth Forshee [this message]
2013-01-31 16:53       ` Johannes Berg
2013-01-31 17:18         ` Seth Forshee
2013-01-31 17:50           ` Johannes Berg
2013-02-05 22:51             ` Seth Forshee
2013-02-06 16:48               ` Johannes Berg
2013-02-06 17:09                 ` Seth Forshee
2013-02-06 17:44                   ` Johannes Berg
2013-02-06 18:02                     ` Seth Forshee
2013-02-06 21:30                       ` Johannes Berg

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=20130131163355.GE28799@thinkpad-t410 \
    --to=seth.forshee@canonical.com \
    --cc=ath9k-devel@lists.ath9k.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox