From: Johannes Berg <johannes@sipsolutions.net>
To: Arik Nemtsov <arik@wizery.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC 2/4] cfg80211: support unused HT-cap-per-band configuration
Date: Fri, 06 Jul 2012 08:59:48 +0200 [thread overview]
Message-ID: <1341557988.4462.6.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <CA+XVXfdwGAdxdmZTx+4pC4=6agM0SuvHV_xsF0gGCE_5NMB7YA@mail.gmail.com> (sfid-20120705_132546_765088_3B704243)
On Thu, 2012-07-05 at 14:25 +0300, Arik Nemtsov wrote:
> > Yuck. Why use the union at all? You could just put the ht_cap_invalid
> > into the ht_cap struct, and it wouldn't even take space, there's
> > padding :-)
>
> The point is - we still want to use ht_cap.ht_supported, even when
> ht_cap is invalid. I was afraid there would be some confusion, hence
> one can set:
> band.ht_supported = true;
> band.ht_cap_invalid = false;
>
> And the union means we don't have to change old drivers.
>
> Also putting ht_cap_invalid inside the struct creates strange corner
> cases. One could mark the vif ht_cap as invalid as well, but the code
> would just ignore it.
Good point. But then let's just move it out and change drivers ...
that's much cleaner I think.
> >> @@ -30,13 +31,16 @@ rdev_freq_to_chan(struct cfg80211_registered_device *rdev,
> >> chan->flags & IEEE80211_CHAN_NO_HT40PLUS)
> >> return NULL;
> >>
> >> - ht_cap = &rdev->wiphy.bands[chan->band]->ht_cap;
> >> + sband = rdev->wiphy.bands[chan->band];
> >> + ht_cap = &sband->ht_cap;
> >>
> >> if (channel_type != NL80211_CHAN_NO_HT) {
> >> - if (!ht_cap->ht_supported)
> >> + if (!sband->ht_supported)
> >> return NULL;
> >>
> >> - if (channel_type != NL80211_CHAN_HT20 &&
> >> + /* this check is ignored when per-band HT caps are not used */
> >> + if (!sband->ht_cap_invalid &&
> >> + channel_type != NL80211_CHAN_HT20 &&
> >
> > This is also major confusion, it seems you should roll 2/3 into one
> > patch?
>
> I'm not sure that would help. rdev_freq_to_chan doesn't get the
> net_device, so it can't get the HT caps. I guess I can add the
> net_device as an optional argument where it is used and check the
> caps. OTOH it seem like a sanity check we can do without?
I don't think we should do without that check? If you request say AP
operation on 40 MHz then you absolutely rely on that happening or
returning an error, not randomly operating in legacy mode!
johannes
next prev parent reply other threads:[~2012-07-06 6:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 15:58 [RFC 0/4] allow setting HT capabilities per vif Arik Nemtsov
2012-07-04 15:58 ` [RFC 1/4] nl80211: accept optional netdev in send_wiphy Arik Nemtsov
2012-07-04 15:58 ` [RFC 2/4] cfg80211: support unused HT-cap-per-band configuration Arik Nemtsov
2012-07-05 7:39 ` Johannes Berg
2012-07-05 11:25 ` Arik Nemtsov
2012-07-06 6:59 ` Johannes Berg [this message]
2012-07-06 7:30 ` Arik Nemtsov
2012-07-06 7:34 ` Johannes Berg
2012-07-06 7:41 ` Arik Nemtsov
2012-07-09 9:31 ` Johannes Berg
2012-07-04 15:58 ` [RFC 3/4] cfg80211: allow driver to implement HT capabilities per netdev Arik Nemtsov
2012-07-05 7:42 ` Johannes Berg
2012-07-05 11:48 ` Arik Nemtsov
2012-07-05 13:33 ` Arik Nemtsov
2012-07-04 15:58 ` [RFC 4/4] mac80211: allow setting HT capabilities per vif Arik Nemtsov
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=1341557988.4462.6.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=arik@wizery.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).