linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luis R. Rodriguez" <lrodriguez@atheros.com>
To: johannes@sipsolutions.net, linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	"Luis R. Rodriguez" <lrodriguez@atheros.com>
Subject: [PATCH v2 4/6] cfg80211: check allowed channel type upon userspace requests
Date: Thu, 19 Mar 2009 01:54:38 -0400	[thread overview]
Message-ID: <1237442080-27509-5-git-send-email-lrodriguez@atheros.com> (raw)
In-Reply-To: <1237442080-27509-1-git-send-email-lrodriguez@atheros.com>

Thanks to nl80211 userspace can be verify specific upon device
configuration. Before processing the request for the new HT40
channel types (HT40- or HT40+) we need to ensure we can use them
regulatory-wise. This wasn't required with wireless extensions as
specifying the channel type wasn't not available and configuration
was done towards the end implicitly upon association or reception
of beacons from the AP. For the new nl80211 we have to check this
when configuring the interfaces explicitly.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
---
 net/wireless/nl80211.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 53fe209..e03c9a2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -426,6 +426,24 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
 		if (!chan || chan->flags & IEEE80211_CHAN_DISABLED)
 			goto bad_res;
 
+		if (channel_type == NL80211_CHAN_HT40MINUS ||
+		    channel_type == NL80211_CHAN_HT40PLUS)
+			if (chan->flags & IEEE80211_CHAN_NO_HT40)
+				goto bad_res;
+
+		if (channel_type == NL80211_CHAN_HT40MINUS &&
+		    (chan->flags & IEEE80211_CHAN_NO_HT40MINUS))
+			goto bad_res;
+		else if (channel_type == NL80211_CHAN_HT40PLUS &&
+			 (chan->flags & IEEE80211_CHAN_NO_HT40PLUS))
+			goto bad_res;
+
+		/*
+		 * At this point we know if that if HT40 was requested
+		 * we are allowed to use it and the extension channel
+		 * exists.
+		 */
+
 		if (channel_type == NL80211_CHAN_HT40MINUS)
 			sec_freq = freq - 20;
 		else if (channel_type == NL80211_CHAN_HT40PLUS)
-- 
1.6.0.6


  parent reply	other threads:[~2009-03-19  5:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19  5:54 [PATCH v2 0/6] Use the regulatory bandwidth and export HT40 stuff Luis R. Rodriguez
2009-03-19  5:54 ` [PATCH v2 1/6] cfg80211: Process regulatory max bandwidth checks for HT40 Luis R. Rodriguez
2009-03-19  5:54 ` [PATCH v2 2/6] wireless: rename IEEE80211_CHAN_NO_FAT_* to HT40-/+ Luis R. Rodriguez
2009-03-19  5:54 ` [PATCH v2 3/6] mac80211: check if HT40+/- is allowed before sending assoc Luis R. Rodriguez
2009-03-19  5:54 ` Luis R. Rodriguez [this message]
2009-03-20 10:45   ` [PATCH v2 4/6] cfg80211: check allowed channel type upon userspace requests Johannes Berg
2009-03-19  5:54 ` [PATCH v2 5/6] cfg80211: send channel max bandwidth to userspace Luis R. Rodriguez
2009-03-19  5:54 ` [PATCH v2 6/6] cfg80211: send to userspace if HT40-/+ is allowed on each channel Luis R. Rodriguez
2009-03-19 19:40 ` [PATCH v2 0/6] Use the regulatory bandwidth and export HT40 stuff Johannes Berg
2009-03-19 20:28   ` Luis R. Rodriguez
2009-03-19 21:40     ` Johannes Berg
2009-03-19 20:44       ` Luis R. Rodriguez
2009-03-19 21:46         ` Johannes Berg
2009-03-19 20:56           ` Luis R. Rodriguez

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=1237442080-27509-5-git-send-email-lrodriguez@atheros.com \
    --to=lrodriguez@atheros.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).