From: Johannes Berg <johannes@sipsolutions.net>
To: Eliad Peller <eliad@wizery.com>
Cc: Arend van Spriel <arend@broadcom.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
Gautam Kumar Shukla <gautams@broadcom.com>
Subject: Re: [RFC] cfg80211: Add feature flag for 4-way handshake offload
Date: Thu, 18 Dec 2014 14:51:45 +0100 [thread overview]
Message-ID: <1418910705.6134.7.camel@sipsolutions.net> (raw)
In-Reply-To: <CAB3XZEcF0r2fMD1GSw+ojWrsO7bxdxBfvQwLkZpTu4RP-iQtTg@mail.gmail.com> (sfid-20141218_144439_055976_B01A1198)
On Thu, 2014-12-18 at 15:44 +0200, Eliad Peller wrote:
> > u32 flags, regulatory_flags, features;
> > + u8 ext_features[1];
> >
> i think it would be nicer to use unsigned long (instead of u8) along
> with BITS_TO_LONGS
That works in the kernel, but not in the userspace API. We can do it on
the kernel side, but then we have to write a translation loop in
nl80211. I'm not sure that's worth it.
> > /**
> > + * enum nl80211_ext_feature_index - bit index of extended features.
> > + *
> > + * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE: the device supports 4way handshake
> > + */
> > +enum nl80211_ext_feature_index {
> > + NL80211_EXT_FEATURE_4WAY_HANDSHAKE,
> > +};
>
> just add the standard LAST/MAX defines here, and the bitmap size will
> be allocated automatically.
If you add a max here then we just have to hope that in userspace nobody
abuses it ... but I guess we can and should do that to size the flags
array properly automatically. The problem is that if somebody tries to
use it in userspace for parsing, like
u8 eflags[DIV_ROUND_UP(FEATURE_MAX, 8)];
memcpy(eflags, nla_data(attr), nla_len(attr));
then surely that will cause memory corruption... so we should probably
add a note or something there.
> and these (or only the implementations) could be replaced by set_bit/test_bit.
They could - but as I said above then we have to translate this to
userspace. The problem with the unsigned long array thing is that the
size of unsigned long varies on different platforms (32 vs 64 bit) and
not all platforms are little endian where that wouldn't matter ...
Maybe the better choice would be to create u8 bitmap helper functions -
after all we already have them in at least 2 other places in wifi:
* TIM IE
* extended capabilities IE
Probably there are others elsewhere?
johannes
next prev parent reply other threads:[~2014-12-18 13:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-18 12:51 [RFC] cfg80211: Add feature flag for 4-way handshake offload Arend van Spriel
2014-12-18 13:31 ` Johannes Berg
2014-12-18 17:56 ` Arend van Spriel
2014-12-18 13:44 ` Eliad Peller
2014-12-18 13:51 ` Johannes Berg [this message]
2014-12-18 15:21 ` Arend van Spriel
2014-12-18 16:01 ` Eliad Peller
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=1418910705.6134.7.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arend@broadcom.com \
--cc=eliad@wizery.com \
--cc=gautams@broadcom.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).