linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ashok Nagarajan <ashok@cozybit.com>
To: linux-wireless@vger.kernel.org
Cc: linville@tuxdriver.com, johannes@sipsolutions.net,
	javier@cozybit.com, devel@lists.open80211s.org,
	Ashok Nagarajan <ashok@cozybit.com>
Subject: [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh
Date: Mon, 30 Apr 2012 14:20:31 -0700	[thread overview]
Message-ID: <1335820832-18887-3-git-send-email-ashok@cozybit.com> (raw)
In-Reply-To: <1335820832-18887-1-git-send-email-ashok@cozybit.com>

Now that we have protection enabled, allow non-HT and HT20 stations to peer
with HT40+/- stations. Peering is still disallowed for HT40+/- mismatch.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Reviewed-by: Thomas Pedersen <thomas@cozybit.com>
---
v2:
	Fix compiler warnings (John)

 net/mac80211/mesh.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 8a952e0..0fabb8b 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -76,6 +76,7 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
 	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
 	struct ieee80211_local *local = sdata->local;
 	u32 basic_rates = 0;
+	enum nl80211_channel_type sta_channel_type = NL80211_CHAN_NO_HT;
 
 	/*
 	 * As support for each feature is added, check for matching
@@ -102,10 +103,15 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
 	if (sdata->vif.bss_conf.basic_rates != basic_rates)
 		goto mismatch;
 
-	/* disallow peering with mismatched channel types for now */
+	if (ie->ht_operation)
+		sta_channel_type =
+			ieee80211_ht_oper_to_channel_type(ie->ht_operation);
+
+	/* Disallow HT40+/- mismatch */
 	if (ie->ht_operation &&
-	    (local->_oper_channel_type !=
-	     ieee80211_ht_oper_to_channel_type(ie->ht_operation)))
+	    local->_oper_channel_type > NL80211_CHAN_HT20 &&
+	    sta_channel_type > NL80211_CHAN_HT20 &&
+	    local->_oper_channel_type != sta_channel_type)
 		goto mismatch;
 
 	return true;
-- 
1.7.5.4


  parent reply	other threads:[~2012-04-30 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-30 21:20 [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs Ashok Nagarajan
2012-04-30 21:20 ` [PATCH v2 2/4] mac80211: Implement HT mixed protection mode Ashok Nagarajan
2012-05-03 19:39   ` Johannes Berg
2012-05-03 20:21     ` Ashok Nagarajan
2012-04-30 21:20 ` Ashok Nagarajan [this message]
2012-05-03 19:40   ` [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh Johannes Berg
2012-05-03 20:23     ` Ashok Nagarajan
2012-05-03 20:29       ` Johannes Berg
2012-04-30 21:20 ` [PATCH v2 4/4] [nl,cfg,mac]80211: Allow user to see/configure HT protection mode Ashok Nagarajan
2012-05-03 19:36 ` [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs Johannes Berg
2012-05-03 20:20   ` Ashok Nagarajan

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=1335820832-18887-3-git-send-email-ashok@cozybit.com \
    --to=ashok@cozybit.com \
    --cc=devel@lists.open80211s.org \
    --cc=javier@cozybit.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).