From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Arik Nemtsov <arik@wizery.com>,
Arik Nemtsov <arikx.nemtsov@intel.com>,
Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Subject: [PATCH 02/10] mac80211: TDLS: add proper HT-oper IE
Date: Sun, 25 Oct 2015 10:59:34 +0200 [thread overview]
Message-ID: <1445763582-11421-2-git-send-email-emmanuel.grumbach@intel.com> (raw)
In-Reply-To: <1445763582-11421-1-git-send-email-emmanuel.grumbach@intel.com>
From: Arik Nemtsov <arik@wizery.com>
When 11n peers performs a TDLS connection on a legacy BSS, the HT
operation IE must be specified according to IEEE802.11-2012 section
9.23.3.2. Otherwise HT-protection is compromised and the medium becomes
noisy for both the TDLS and the BSS links.
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
---
RESEND - already to the ML in August
---
---
net/mac80211/ibss.c | 2 +-
net/mac80211/ieee80211_i.h | 2 +-
net/mac80211/mesh.c | 3 ++-
net/mac80211/tdls.c | 13 ++++++++++---
net/mac80211/util.c | 5 ++++-
5 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 2001555..3b5874e 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -188,7 +188,7 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata,
* keep them at 0
*/
pos = ieee80211_ie_build_ht_oper(pos, &sband->ht_cap,
- chandef, 0);
+ chandef, 0, false);
/* add VHT capability and information IEs */
if (chandef->width != NL80211_CHAN_WIDTH_20 &&
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 68680ad..5c76ba7 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1962,7 +1962,7 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
u16 cap);
u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
const struct cfg80211_chan_def *chandef,
- u16 prot_mode);
+ u16 prot_mode, bool rifs_mode);
u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
u32 cap);
u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 626e8de..fa28500 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -466,7 +466,8 @@ int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata,
pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_operation));
ieee80211_ie_build_ht_oper(pos, ht_cap, &sdata->vif.bss_conf.chandef,
- sdata->vif.bss_conf.ht_operation_mode);
+ sdata->vif.bss_conf.ht_operation_mode,
+ false);
return 0;
}
diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c
index ecc5e2a..c9eeb3f 100644
--- a/net/mac80211/tdls.c
+++ b/net/mac80211/tdls.c
@@ -591,12 +591,19 @@ ieee80211_tdls_add_setup_cfm_ies(struct ieee80211_sub_if_data *sdata,
offset = noffset;
}
- /* if HT support is only added in TDLS, we need an HT-operation IE */
+ /*
+ * if HT support is only added in TDLS, we need an HT-operation IE.
+ * add the IE as required by IEEE802.11-2012 9.23.3.2.
+ */
if (!ap_sta->sta.ht_cap.ht_supported && sta->sta.ht_cap.ht_supported) {
+ u16 prot = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED |
+ IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT |
+ IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT;
+
pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_operation));
- /* send an empty HT operation IE */
ieee80211_ie_build_ht_oper(pos, &sta->sta.ht_cap,
- &sdata->vif.bss_conf.chandef, 0);
+ &sdata->vif.bss_conf.chandef, prot,
+ true);
}
ieee80211_tdls_add_link_ie(sdata, skb, peer, initiator);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 13b07ed..7150ae2 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -2274,7 +2274,7 @@ u8 *ieee80211_ie_build_vht_cap(u8 *pos, struct ieee80211_sta_vht_cap *vht_cap,
u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
const struct cfg80211_chan_def *chandef,
- u16 prot_mode)
+ u16 prot_mode, bool rifs_mode)
{
struct ieee80211_ht_operation *ht_oper;
/* Build HT Information */
@@ -2302,6 +2302,9 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
chandef->width != NL80211_CHAN_WIDTH_20)
ht_oper->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
+ if (rifs_mode)
+ ht_oper->ht_param |= IEEE80211_HT_PARAM_RIFS_MODE;
+
ht_oper->operation_mode = cpu_to_le16(prot_mode);
ht_oper->stbc_param = 0x0000;
--
2.1.4
next prev parent reply other threads:[~2015-10-25 9:00 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-25 8:59 [PATCH 01/10] mac80211: don't reconfigure sched scan in case of wowlan Emmanuel Grumbach
2015-10-25 8:59 ` Emmanuel Grumbach [this message]
2015-11-03 9:43 ` [PATCH 02/10] mac80211: TDLS: add proper HT-oper IE Johannes Berg
2015-10-25 8:59 ` [PATCH 03/10] mac80211: use freezable workqueue for restart work Emmanuel Grumbach
2015-11-03 9:37 ` Johannes Berg
2015-10-25 8:59 ` [PATCH 04/10] mac80211: call drv_stop only if driver is started Emmanuel Grumbach
2015-11-03 9:41 ` Johannes Berg
2015-10-25 8:59 ` [PATCH 05/10] mac80211: make enable_qos parameter to ieee80211_set_wmm_default() Emmanuel Grumbach
2015-10-25 9:14 ` Emmanuel Grumbach
2015-10-25 8:59 ` [PATCH 06/10] mac80211: Fix local deauth while associating Emmanuel Grumbach
2015-11-03 9:36 ` Johannes Berg
2015-10-25 8:59 ` [PATCH 07/10] mac80211: allow driver to prevent two stations w/ same address Emmanuel Grumbach
2015-10-25 9:14 ` Emmanuel Grumbach
2015-10-25 8:59 ` [PATCH 08/10] mac80211: Remove WARN_ON_ONCE in ieee80211_recalc_smps Emmanuel Grumbach
2015-11-03 9:38 ` Johannes Berg
2015-10-25 8:59 ` [PATCH 09/10] mac80211: allow null chandef in tracing Emmanuel Grumbach
2015-11-03 9:30 ` Johannes Berg
2015-10-25 8:59 ` [PATCH 10/10] mac80211: further improve "no supported rates" warning Emmanuel Grumbach
2015-11-03 9:42 ` [PATCH 01/10] mac80211: don't reconfigure sched scan in case of wowlan 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=1445763582-11421-2-git-send-email-emmanuel.grumbach@intel.com \
--to=emmanuel.grumbach@intel.com \
--cc=arik@wizery.com \
--cc=arikx.nemtsov@intel.com \
--cc=johannes@sipsolutions.net \
--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).