linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Joe Perches <joe@perches.com>
Cc: linux-wireless@vger.kernel.org, gregory.greenman@intel.com
Subject: Re: [RFC] mac80211: convert HW flags to unsigned long bitmap
Date: Wed, 03 Jun 2015 09:04:45 +0200	[thread overview]
Message-ID: <1433315085.2274.3.camel@sipsolutions.net> (raw)
In-Reply-To: <1433313312.4861.119.camel@perches.com>

On Tue, 2015-06-02 at 23:35 -0700, Joe Perches wrote:

> > +	IEEE80211_HW_HAS_RATE_CONTROL,
> > +	IEEE80211_HW_RX_INCLUDES_FCS,
> 
> It may be nicer to use specified bit numbers here.
> 
> It may make compatibility easier and maybe it should be
> written down that new entries are only to be added at
> the bottom of the enum and not inserted in the middle.

There's no reason for that, since it's pure kernel internal API any
renumbering of these bits is perfectly fine.

> This is similar to the broadcom tg3 driver, but a little different.
> 
> The mechanism in tg3 compared to ieee80211_hw is
> 	tg3_flag	ieee80211_hw_check
> 	tg3_flag_set	ieee80211_hw_set
> 	tg3_flag_clear	?
> 
> Would a ieee80211_hw_clear be useful?

See my reply to Julian.

> Would it be clearer without the _check?

Well, I thought it would read as

ieee80211_hw "check has_rate_control"

with this in a sense, for example.

> >  static ssize_t hwflags_read(struct file *file, char __user *user_buf,
> >  			    size_t count, loff_t *ppos)
> >  {
> []
> > +	for (i = 0; i < NUM_IEEE80211_HW_FLAGS; i++) {
> > +		if (test_bit(i, local->hw.flags))
> 
> Maybe use the ieee80211_hw_check() function?

Obviously that won't work. :) I could use the _ieee80211 one, but I'm
considering just getting rid of that one and inlining the test_bit into
the macro instead.

johannes


      reply	other threads:[~2015-06-03  7:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 19:39 [RFC] mac80211: convert HW flags to unsigned long bitmap Johannes Berg
2015-06-03  0:57 ` Julian Calaby
2015-06-03  7:02   ` Johannes Berg
2015-06-03  7:16     ` Julian Calaby
2015-06-03  6:35 ` Joe Perches
2015-06-03  7:04   ` Johannes Berg [this message]

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=1433315085.2274.3.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=gregory.greenman@intel.com \
    --cc=joe@perches.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 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).