From: Alexander Simon <alexander.simon@saxnet.de>
To: linux-wireless@vger.kernel.org
Subject: [RFC 1/4] mac80211: support for IEEE80211N in IBSS
Date: Thu, 20 Jan 2011 09:10:58 +0000 (UTC) [thread overview]
Message-ID: <loom.20110120T093834-982@post.gmane.org> (raw)
In-Reply-To: 1295447708.4685.5.camel@jlt3.sipsolutions.net
Ok, here we go.
What do you mean with a "not so refactoring version"? I am adding a new IE.
These are only insertions, no other changes. Or do you mean that dev_alloc_skb?
However, i took the last "try" from Benoit.
I split my patch into 4 sections: Setting channel_type, Building the HT IE when
joining an IBSS, parse the HT IE of a newly joined station and enable
aggregation code for IBSS.
This first patch adds setting nl80211_channel_type for an IBSS. This is mostly
Benoits work.
When a IBSS to connect to is given by iw, there is a new argument to set HT20,
HT40+ or HT40-.
When we create an IBSS, we have that struct params where we can find the channel
type set by iw.
When we join a already existing IBSS, we don't. If we find a HT IE, then we will
distinguish our channel type by that.
Here the problem remains if a legacy station has joined a HT IBSS and we got its
beacon. Then we'll won't have an HT IE... This has to be fixed, maybe something
like "found a HT20 STA, switching to HT20. And now found a HT40-, switching to
HT40-"
diff -Nrup compat-wireless-2011-01-17/include/net/cfg80211.h
compat-wireless-2011-01-17.1//include/net/cfg80211.h
--- compat-wireless-2011-01-17/include/net/cfg80211.h 2011-01-17
21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17.1//include/net/cfg80211.h 2011-01-20
09:56:01.000000000 +0100
@@ -960,6 +960,7 @@ struct cfg80211_ibss_params {
u8 *ssid;
u8 *bssid;
struct ieee80211_channel *channel;
+ enum nl80211_channel_type channel_type;
u8 *ie;
u8 ssid_len, ie_len;
u16 beacon_interval;
diff -Nrup compat-wireless-2011-01-17/net/mac80211/ibss.c
compat-wireless-2011-01-17.1//net/mac80211/ibss.c
--- compat-wireless-2011-01-17/net/mac80211/ibss.c 2011-01-17 21:03:25.000000000
+0100
+++ compat-wireless-2011-01-17.1//net/mac80211/ibss.c 2011-01-20
09:56:01.000000000 +0100
@@ -66,6 +66,7 @@ static void ieee80211_rx_mgmt_auth_ibss(
static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
const u8 *bssid, const int beacon_int,
struct ieee80211_channel *chan,
+ enum nl80211_channel_type channel_type,
const u32 basic_rates,
const u16 capability, u64 tsf)
{
@@ -107,7 +108,7 @@ static void __ieee80211_sta_join_ibss(st
sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
local->oper_channel = chan;
- WARN_ON(!ieee80211_set_channel_type(local, sdata, NL80211_CHAN_NO_HT));
+ WARN_ON(!ieee80211_set_channel_type(local, sdata, channel_type));
ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
sband = local->hw.wiphy->bands[chan->band];
@@ -221,6 +222,7 @@ static void ieee80211_sta_join_ibss(stru
u32 basic_rates;
int i, j;
u16 beacon_int = cbss->beacon_interval;
+ enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
lockdep_assert_held(&sdata->u.ibss.mtx);
@@ -244,9 +246,29 @@ static void ieee80211_sta_join_ibss(stru
}
}
+ /* parse HT Information IE, if present */
+ ht_info_ie = ieee80211_bss_get_ie(cbss, WLAN_EID_HT_INFORMATION);
+ if (ht_info_ie) {
+ const struct ieee80211_ht_info *ht_info =
+ (const struct ieee80211_ht_info *)(ht_info_ie + 2);
+
+ switch (ht_info->ht_param & IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+ case IEEE80211_HT_PARAM_CHA_SEC_NONE:
+ channel_type = NL80211_CHAN_HT20;
+ break;
+ case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+ channel_type = NL80211_CHAN_HT40PLUS;
+ break;
+ case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+ channel_type = NL80211_CHAN_HT40MINUS;
+ break;
+ }
+ }
+
__ieee80211_sta_join_ibss(sdata, cbss->bssid,
beacon_int,
cbss->channel,
+ channel_type,
basic_rates,
cbss->capability,
cbss->tsf);
@@ -565,7 +587,7 @@ static void ieee80211_sta_create_ibss(st
sdata->drop_unencrypted = 0;
__ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
- ifibss->channel, ifibss->basic_rates,
+ ifibss->channel, ifibss->channel_type, ifibss->basic_rates,
capability, 0);
}
@@ -925,13 +947,14 @@ int ieee80211_ibss_join(struct ieee80211
sdata->vif.bss_conf.beacon_int = params->beacon_interval;
sdata->u.ibss.channel = params->channel;
+ sdata->u.ibss.channel_type = params->channel_type;
sdata->u.ibss.fixed_channel = params->channel_fixed;
/* fix ourselves to that channel now already */
if (params->channel_fixed) {
sdata->local->oper_channel = params->channel;
WARN_ON(!ieee80211_set_channel_type(sdata->local, sdata,
- NL80211_CHAN_NO_HT));
+ params->channel_type));
}
if (params->ie) {
diff -Nrup compat-wireless-2011-01-17/net/mac80211/ieee80211_i.h
compat-wireless-2011-01-17.1//net/mac80211/ieee80211_i.h
--- compat-wireless-2011-01-17/net/mac80211/ieee80211_i.h 2011-01-17
21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17.1//net/mac80211/ieee80211_i.h 2011-01-20
09:56:01.000000000 +0100
@@ -438,6 +438,7 @@ struct ieee80211_if_ibss {
u8 ssid_len, ie_len;
u8 *ie;
struct ieee80211_channel *channel;
+ enum nl80211_channel_type channel_type;
unsigned long ibss_join_req;
/* probe response/beacon for IBSS */
diff -Nrup compat-wireless-2011-01-17/net/wireless/nl80211.c
compat-wireless-2011-01-17.1//net/wireless/nl80211.c
--- compat-wireless-2011-01-17/net/wireless/nl80211.c 2011-01-17
21:03:26.000000000 +0100
+++ compat-wireless-2011-01-17.1//net/wireless/nl80211.c 2011-01-20
09:56:01.000000000 +0100
@@ -3907,8 +3907,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)
next prev parent reply other threads:[~2011-01-20 9:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-19 13:38 [RFC] mac80211: support for IEEE80211N in IBSS Alexander Simon
2011-01-19 14:35 ` Johannes Berg
2011-01-20 9:10 ` Alexander Simon [this message]
2011-01-20 9:24 ` [RFC 1/4] " Johannes Berg
2011-01-20 9:48 ` Alexander Simon
2011-01-20 9:54 ` Johannes Berg
2011-01-20 10:15 ` Alexander Simon
2011-01-20 10:20 ` Johannes Berg
2011-01-20 9:21 ` [RFC 2/4] " Alexander Simon
2011-01-20 9:26 ` [RFC 3/4] " Alexander Simon
2011-01-20 9:37 ` [RFC 4/4] " Alexander Simon
2011-01-20 9:49 ` Johannes Berg
2011-01-26 16:31 ` [RFC] " Baldomero Coll
2011-02-03 10:59 ` Baldomero Coll
2011-02-04 17:10 ` Baldomero Coll
2011-02-04 17:22 ` Brian Prodoehl
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.20110120T093834-982@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).