From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH v8 2/2] mac80211: Support ht-cap over-rides.
Date: Tue, 08 Nov 2011 12:58:58 -0800 [thread overview]
Message-ID: <4EB99812.3000507@candelatech.com> (raw)
In-Reply-To: <1320783128.24797.48.camel@jlt3.sipsolutions.net>
On 11/08/2011 12:12 PM, Johannes Berg wrote:
> On Tue, 2011-11-08 at 11:36 -0800, greearb@candelatech.com wrote:
>
>> +bool ieee80111_cfg_override_disables_ht40(struct ieee80211_sub_if_data *sdata)
>> +{
>> + if ((sdata->u.mgd.ht_capa_mask.cap_info&
>> + IEEE80211_HT_CAP_SUP_WIDTH_20_40)&&
>> + !(sdata->u.mgd.ht_capa.cap_info&
>> + IEEE80211_HT_CAP_SUP_WIDTH_20_40))
>> + return true;
>> + return false;
>
> Would it really go above 80 cols if you didn't line-wrap it? Maybe
> remove the extra sets of parentheses? And even if it goes to a little
> bit above 80 it's still be more readable without the wrapping ...
It is more readable w/out the wrapping, but hard to know when
patches get rejected about that or not, so I tried to keep
checkpatch happy. If you'll take slightly longer lines I'll
happily un-wrap it.
>
> One thing I don't quite understand: Why don't you calculate the HT caps
> to use upon assoc request, and then store *those* instead, then you
> wouldn't have to check the overrides every time.
Adding more state just gives more places to mess up that
state or forget to update it somehow. Think of the channel
pointers in the scan & work code :)
Not to mention the extra bloat in RAM.
Since this is not hot-path code, I think having less state
is well worth the effort.
> For example here:
>
>> if (!(ap_ht_cap_flags& IEEE80211_HT_CAP_40MHZ_INTOLERANT)&&
>> + !ieee80111_cfg_override_disables_ht40(sdata)&&
>> (sband->ht_cap.cap& IEEE80211_HT_CAP_SUP_WIDTH_20_40)&&
>> (hti->ht_param& IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)) {
>> switch(hti->ht_param& IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
>
> This just adds complexity. If you calculate sdata->used_ht_caps first
> then you can replace the sband->ht_cap.cap check with an
> sdata->used_ht_caps.cap check and be done with it, instead of having to
> check both.
I think that's a bad idea, but will change it if you insist.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2011-11-08 20:59 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-08 19:36 [PATCH v8 1/2] wireless: Support ht-capabilities over-rides greearb
2011-11-08 19:36 ` [PATCH v8 2/2] mac80211: Support ht-cap over-rides greearb
2011-11-08 20:09 ` Johannes Berg
2011-11-08 20:44 ` Ben Greear
2011-11-08 20:58 ` Johannes Berg
2011-11-08 21:00 ` Johannes Berg
2011-11-08 21:06 ` Ben Greear
2011-11-08 21:08 ` Johannes Berg
2011-11-08 20:12 ` Johannes Berg
2011-11-08 20:17 ` Johannes Berg
2011-11-08 20:58 ` Ben Greear [this message]
2011-11-08 21:02 ` Johannes Berg
2011-11-08 23:11 ` Ben Greear
2011-11-09 8:37 ` Johannes Berg
2011-11-10 19:25 ` Ben Greear
2011-11-17 11:28 ` Johannes Berg
2011-11-17 17:22 ` Ben Greear
2011-11-17 17:25 ` Johannes Berg
2011-11-17 17:42 ` Ben Greear
2011-11-08 20:07 ` [PATCH v8 1/2] wireless: Support ht-capabilities over-rides 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=4EB99812.3000507@candelatech.com \
--to=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--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).