From: Rostislav Lisovy <lisovy@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: "John W. Linville" <linville@tuxdriver.com>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
Michal Sojka <sojkam1@fel.cvut.cz>,
s.sander@nordsys.de, jan-niklas.meier@volkswagen.de,
Rostislav Lisovy <rostislav.lisovy@fel.cvut.cz>
Subject: Re: [RFC 1/2] cfg80211: Add channel flags limiting availability to OCB mode only
Date: Mon, 26 May 2014 11:06:39 +0200 [thread overview]
Message-ID: <1401095199.11908.6.camel@umadbro> (raw)
In-Reply-To: <1400511063.4273.10.camel@jlt4.sipsolutions.net>
On Mon, 2014-05-19 at 16:51 +0200, Johannes Berg wrote:
> This patch is fine, but insufficient - you should also do something
> with
> the new flags?
That's definitely a good point. I think the biggest issue is that the
flags can't be checked only with the knowledge of the 'wiphy' but they
are related to the 'vif' type -- this prohibits checking in the
cfg80211_chandef_usable() (I assume).
Would the following be sufficient?
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -801,6 +801,10 @@ static int __ieee80211_vif_change_channel(struct ieee80211_sub_if_data *sdata,
*changed |= BSS_CHANGED_BANDWIDTH;
}
+ if (sdata->vif.type == NL80211_IFTYPE_OCB &&
+ !(chandef->chan->flags & IEEE80211_CHAN_OCB_ONLY))
+ return -EINVAL;
+
sdata->vif.bss_conf.chandef = *chandef;
ctx->conf.def = *chandef;
@@ -1049,6 +1053,12 @@ int ieee80211_vif_change_bandwidth(struct ieee80211_sub_if_data *sdata,
goto out;
}
+ if (sdata->vif.type == NL80211_IFTYPE_OCB &&
+ !(chandef->chan->flags & IEEE80211_CHAN_OCB_ONLY)) {
+ ret = -EINVAL;
+ goto out;
+ }
+
if (chandef->width == NL80211_CHAN_WIDTH_20_NOHT ||
sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT) {
ret = -EINVAL;
--
Best regards;
Rostislav Lisovy
next prev parent reply other threads:[~2014-05-26 9:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-19 14:49 [RFC 0/2] mac80211: Add new interface type for OCB (Outside the Context of a BSS) mode Rostislav Lisovy
2014-05-19 14:49 ` [RFC 1/2] cfg80211: Add channel flags limiting availability to OCB mode only Rostislav Lisovy
2014-05-19 14:51 ` Johannes Berg
2014-05-26 9:06 ` Rostislav Lisovy [this message]
2014-05-26 9:35 ` Johannes Berg
2014-05-19 14:49 ` [RFC 2/2] mac80211: Add new interface type for OCB mode Rostislav Lisovy
2014-05-19 14:57 ` 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=1401095199.11908.6.camel@umadbro \
--to=lisovy@gmail.com \
--cc=jan-niklas.meier@volkswagen.de \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=rostislav.lisovy@fel.cvut.cz \
--cc=s.sander@nordsys.de \
--cc=sojkam1@fel.cvut.cz \
/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
all inboxes | Powered by JetHome®