linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Simon <alexander.simon@saxnet.de>
To: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/4] nl80211: Add NL80211_ATTR_WIPHY_CHANNEL_TYPE for IBSS
Date: Tue, 12 Apr 2011 11:04:16 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110412T130245-14@post.gmane.org> (raw)
In-Reply-To: 1302604964.2139.5.camel@alex-2

Needed for IBSS IEEE802.11N operation

* Add a new attribute NL80211_ATTR_WIPHY_CHANNEL_TYPE to specify
    a HT channel type for IBSS

Signed-off-by: Alexander Simon <alexander.simon@saxnet.de>
---
 nl80211.c |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff -Nrup a/net/wireless/nl80211.c b/net/wireless/nl80211.c
--- a/net/wireless/nl80211.c	2011-03-31 21:04:02.000000000 +0200
+++ b/net/wireless/nl80211.c	2011-04-12 08:49:19.000000000 +0200
@@ -3927,8 +3927,24 @@ static int nl80211_join_ibss(struct sk_b
 		ibss.ie_len = nla_len(info->attrs[NL80211_ATTR_IE]);
 	}
 
-	ibss.channel = ieee80211_get_channel(wiphy,
-		nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]));
+	if (info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
+		enum nl80211_channel_type channel_type;
+
+		channel_type = nla_get_u32(
+			info->attrs[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
+		if (channel_type != NL80211_CHAN_NO_HT &&
+				channel_type != NL80211_CHAN_HT20 &&
+				channel_type != NL80211_CHAN_HT40PLUS &&
+				channel_type != NL80211_CHAN_HT40MINUS)
+			return -EINVAL;
+		ibss.channel_type = channel_type;
+	} else {
+		ibss.channel_type = NL80211_CHAN_NO_HT;
+	}
+
+	ibss.channel = rdev_freq_to_chan(rdev,
+		nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_FREQ]),
+		ibss.channel_type);
 	if (!ibss.channel ||
 	    ibss.channel->flags & IEEE80211_CHAN_NO_IBSS ||
 	    ibss.channel->flags & IEEE80211_CHAN_DISABLED)




  reply	other threads:[~2011-04-12 11:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 10:42 [PATCH 1/4] cfg80211: Add channel type for IBSS Alexander Simon
2011-04-12 11:04 ` Alexander Simon [this message]
2011-04-12 11:08   ` [PATCH 2/4] nl80211: Add NL80211_ATTR_WIPHY_CHANNEL_TYPE " Johannes Berg
2011-04-12 11:06 ` [PATCH 3/4] mac80211: Add function to build HT caps Alexander Simon
2011-04-12 11:16   ` Johannes Berg
2011-04-12 11:22     ` Alexander Simon
2011-04-12 11:07 ` [PATCH 4/4] mac80211: Add IEEE802.11n for IBSS Alexander Simon
2011-04-12 11:19   ` Johannes Berg
2011-04-28 12:13     ` Alexander Simon
2011-04-28 12:56       ` Johannes Berg
2011-04-29  6:54         ` Alexander Simon
2011-04-29  7:21           ` Johannes Berg
2011-04-29  8:37             ` Alexander Simon
2011-04-29 12:36               ` Alexander Simon
2011-04-29 12:39                 ` Johannes Berg
2011-04-29 12:50                   ` Alexander Simon
2011-04-26 19:11 ` [PATCH 1/4] cfg80211: Add channel type " John W. Linville
2011-04-28 12:15   ` Alexander Simon

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=loom.20110412T130245-14@post.gmane.org \
    --to=alexander.simon@saxnet.de \
    --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).