All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs
@ 2012-04-30 21:20 Ashok Nagarajan
  2012-04-30 21:20 ` [PATCH v2 2/4] mac80211: Implement HT mixed protection mode Ashok Nagarajan
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ashok Nagarajan @ 2012-04-30 21:20 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, johannes, javier, devel, Ashok Nagarajan

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Reviewed-by: Thomas Pedersen <thomas@cozybit.com>
---
 net/mac80211/ibss.c        |    2 +-
 net/mac80211/ieee80211_i.h |    3 ++-
 net/mac80211/mesh.c        |    3 ++-
 net/mac80211/util.c        |    9 +++------
 4 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 61cd391..bb1a3e6 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -164,7 +164,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 		pos = ieee80211_ie_build_ht_cap(pos, &sband->ht_cap,
 						sband->ht_cap.cap);
 		pos = ieee80211_ie_build_ht_oper(pos, &sband->ht_cap,
-						 chan, channel_type);
+						 chan, channel_type, 0);
 	}
 
 	if (local->hw.queues >= IEEE80211_NUM_ACS) {
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 6cd89d4..ae046b5 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1497,7 +1497,8 @@ 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,
 			       struct ieee80211_channel *channel,
-			       enum nl80211_channel_type channel_type);
+			       enum nl80211_channel_type channel_type,
+			       u16 prot_mode);
 
 /* internal work items */
 void ieee80211_work_init(struct ieee80211_local *local);
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 598a96a..8a952e0 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -396,7 +396,8 @@ int mesh_add_ht_oper_ie(struct sk_buff *skb,
 		return -ENOMEM;
 
 	pos = skb_put(skb, 2 + sizeof(struct ieee80211_ht_operation));
-	ieee80211_ie_build_ht_oper(pos, ht_cap, channel, channel_type);
+	ieee80211_ie_build_ht_oper(pos, ht_cap, channel, channel_type,
+				   sdata->vif.bss_conf.ht_operation_mode);
 
 	return 0;
 }
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index d9a747d..22f2216 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1663,7 +1663,8 @@ u8 *ieee80211_ie_build_ht_cap(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
 
 u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
 			       struct ieee80211_channel *channel,
-			       enum nl80211_channel_type channel_type)
+			       enum nl80211_channel_type channel_type,
+			       u16 prot_mode)
 {
 	struct ieee80211_ht_operation *ht_oper;
 	/* Build HT Information */
@@ -1689,11 +1690,7 @@ u8 *ieee80211_ie_build_ht_oper(u8 *pos, struct ieee80211_sta_ht_cap *ht_cap,
 	    channel_type != NL80211_CHAN_HT20)
 		ht_oper->ht_param |= IEEE80211_HT_PARAM_CHAN_WIDTH_ANY;
 
-	/*
-	 * Note: According to 802.11n-2009 9.13.3.1, HT Protection field and
-	 * RIFS Mode are reserved in IBSS mode, therefore keep them at 0
-	 */
-	ht_oper->operation_mode = 0x0000;
+	ht_oper->operation_mode = cpu_to_le16(prot_mode);
 	ht_oper->stbc_param = 0x0000;
 
 	/* It seems that Basic MCS set and Supported MCS set
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 2/4] mac80211: Implement HT mixed protection mode
  2012-04-30 21:20 [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs Ashok Nagarajan
@ 2012-04-30 21:20 ` Ashok Nagarajan
  2012-05-03 19:39   ` Johannes Berg
  2012-04-30 21:20 ` [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh Ashok Nagarajan
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 11+ messages in thread
From: Ashok Nagarajan @ 2012-04-30 21:20 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, johannes, javier, devel, Ashok Nagarajan

Section 9.23.3.5 of IEEE 80211s standard describes the protection rules for
HT mesh STA in a MBSS. Three HT protection modes are supported for now:

non-HT mixed mode - is selected if any non-HT peers are present in our MBSS.
20MHz-protection mode - is selected if all peers in our 20/40MHz MBSS support
			HT and atleast one HT20 peer is present.
no-protection mode - is selected otherwise.

This is a limited implementation of 9.23.3.5, which only considers mesh peers
when determining the HT protection mode. Station's channel_type needs to be
maintained.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Reviewed-by: Thomas Pedersen <thomas@cozybit.com>
---
 net/mac80211/mesh_plink.c |   83 +++++++++++++++++++++++++++++++++++++++++----
 net/mac80211/sta_info.h   |    1 +
 2 files changed, 77 insertions(+), 7 deletions(-)

diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 6209327..2e0ae73 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -105,6 +105,66 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
 	return sta;
 }
 
+/** mesh_set_ht_prot_mode - set correct HT protection mode
+ *
+ * Section 9.23.3.5 of IEEE 80211s standard describes the protection rules for
+ * HT mesh STA in a MBSS. Three HT protection modes are supported for now,
+ * non-HT mixed mode, 20MHz-protection and no-protection mode. non-HT mixed
+ * mode is selected if any non-HT peers are present in our MBSS.
+ * 20MHz-protection mode is selected if all peers in our 20/40MHz MBSS support
+ * HT and atleast one HT20 peer is present. Otherwise no-protection mode is
+ * selected.
+ */
+static u32 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
+{
+	struct ieee80211_local *local = sdata->local;
+	struct sta_info *sta;
+	u32 changed = 0;
+	u16 ht_opmode;
+	bool non_ht_sta = false, ht20_sta = false;
+
+	if (local->_oper_channel_type == NL80211_CHAN_NO_HT)
+		return 0;
+
+	rcu_read_lock();
+	list_for_each_entry_rcu(sta, &local->sta_list, list) {
+		if (sdata == sta->sdata &&
+		    sta->plink_state == NL80211_PLINK_ESTAB) {
+			switch (sta->ch_type) {
+			case NL80211_CHAN_NO_HT:
+				mpl_dbg("mesh_plink %pM: nonHT sta (%pM) is present",
+					sdata->vif.addr, sta->sta.addr);
+				non_ht_sta = true;
+				goto out;
+			case NL80211_CHAN_HT20:
+				mpl_dbg("mesh_plink %pM: HT20 sta (%pM) is present",
+					sdata->vif.addr, sta->sta.addr);
+				ht20_sta = true;
+			default:
+				break;
+			}
+		}
+	}
+out:
+	rcu_read_unlock();
+
+	if (non_ht_sta)
+		ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED;
+	else if (ht20_sta && local->_oper_channel_type > NL80211_CHAN_HT20)
+		ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_20MHZ;
+	else
+		ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
+
+	if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) {
+		sdata->vif.bss_conf.ht_operation_mode = ht_opmode;
+		changed = BSS_CHANGED_HT;
+		mpl_dbg("mesh_plink %pM: protection mode changed to %d",
+			sdata->vif.addr, ht_opmode);
+	}
+
+	return changed;
+}
+
 /**
  * __mesh_plink_deactivate - deactivate mesh peer link
  *
@@ -302,11 +362,14 @@ static struct sta_info *mesh_peer_init(struct ieee80211_sub_if_data *sdata,
 	else
 		memset(&sta->sta.ht_cap, 0, sizeof(sta->sta.ht_cap));
 
-	if (elems->ht_operation)
+	if (elems->ht_operation) {
 		if (!(elems->ht_operation->ht_param &
 		      IEEE80211_HT_PARAM_CHAN_WIDTH_ANY))
 			sta->sta.ht_cap.cap &=
 					    ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
+		sta->ch_type =
+			ieee80211_ht_oper_to_channel_type(elems->ht_operation);
+	}
 
 	rate_control_rate_init(sta);
 	spin_unlock_bh(&sta->lock);
@@ -495,9 +558,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
 	enum plink_event event;
 	enum ieee80211_self_protected_actioncode ftype;
 	size_t baselen;
-	bool deactivated, matches_local = true;
+	bool matches_local = true;
 	u8 ie_len;
 	u8 *baseaddr;
+	u32 changed = 0;
 	__le16 plid, llid, reason;
 #ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
 	static const char *mplstates[] = {
@@ -783,7 +847,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
 			sta->plink_state = NL80211_PLINK_ESTAB;
 			spin_unlock_bh(&sta->lock);
 			mesh_plink_inc_estab_count(sdata);
-			ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
+			changed |= mesh_set_ht_prot_mode(sdata);
+			changed |= BSS_CHANGED_BEACON;
 			mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
 				sta->sta.addr);
 			break;
@@ -818,7 +883,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
 			sta->plink_state = NL80211_PLINK_ESTAB;
 			spin_unlock_bh(&sta->lock);
 			mesh_plink_inc_estab_count(sdata);
-			ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
+			changed |= mesh_set_ht_prot_mode(sdata);
+			changed |= BSS_CHANGED_BEACON;
 			mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
 				sta->sta.addr);
 			mesh_plink_frame_tx(sdata,
@@ -836,13 +902,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
 		case CLS_ACPT:
 			reason = cpu_to_le16(WLAN_REASON_MESH_CLOSE);
 			sta->reason = reason;
-			deactivated = __mesh_plink_deactivate(sta);
+			__mesh_plink_deactivate(sta);
 			sta->plink_state = NL80211_PLINK_HOLDING;
 			llid = sta->llid;
 			mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata));
 			spin_unlock_bh(&sta->lock);
-			if (deactivated)
-				ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
+			changed |= mesh_set_ht_prot_mode(sdata);
+			changed |= BSS_CHANGED_BEACON;
 			mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
 					    sta->sta.addr, llid, plid, reason);
 			break;
@@ -889,4 +955,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
 	}
 
 	rcu_read_unlock();
+
+	if (changed)
+		ieee80211_bss_info_change_notify(sdata, changed);
 }
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index f75f5d9..663dc90 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -362,6 +362,7 @@ struct sta_info {
 	struct timer_list plink_timer;
 	s64 t_offset;
 	s64 t_offset_setpoint;
+	enum nl80211_channel_type ch_type;
 #endif
 
 #ifdef CONFIG_MAC80211_DEBUGFS
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh
  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-04-30 21:20 ` Ashok Nagarajan
  2012-05-03 19:40   ` 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
  3 siblings, 1 reply; 11+ messages in thread
From: Ashok Nagarajan @ 2012-04-30 21:20 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, johannes, javier, devel, Ashok Nagarajan

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH v2 4/4] [nl,cfg,mac]80211: Allow user to see/configure HT protection mode
  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-04-30 21:20 ` [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh Ashok Nagarajan
@ 2012-04-30 21:20 ` Ashok Nagarajan
  2012-05-03 19:36 ` [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs Johannes Berg
  3 siblings, 0 replies; 11+ messages in thread
From: Ashok Nagarajan @ 2012-04-30 21:20 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, johannes, javier, devel, Ashok Nagarajan

This patch introduces a new mesh configuration parameter "ht_opmode" and will
allow user to check the current HT protection mode selected. Users could
configure the protection mode by the command "iw mesh_iface set mesh_param
mesh_ht_protection_mode=2". The default protection mode of mesh is set to
non-HT mixed mode.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Reviewed-by: Thomas Pedersen <thomas@cozybit.com>
---
 include/linux/nl80211.h   |    3 +++
 include/net/cfg80211.h    |    1 +
 net/mac80211/cfg.c        |    5 +++++
 net/mac80211/mesh.c       |    3 +++
 net/mac80211/mesh_plink.c |    1 +
 net/wireless/mesh.c       |    1 +
 net/wireless/nl80211.c    |    5 +++++
 7 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 1335084..2540e86 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -2154,6 +2154,8 @@ enum nl80211_mntr_flags {
  * @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
  * to synchronize to for 11s default synchronization method (see 11C.12.2.2)
  *
+ * @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
+ *
  * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
  */
 enum nl80211_meshconf_params {
@@ -2179,6 +2181,7 @@ enum nl80211_meshconf_params {
 	NL80211_MESHCONF_FORWARDING,
 	NL80211_MESHCONF_RSSI_THRESHOLD,
 	NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
+	NL80211_MESHCONF_HT_OPMODE,
 
 	/* keep last */
 	__NL80211_MESHCONF_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 815dc3f..1c36cb5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -821,6 +821,7 @@ struct mesh_config {
 	bool  dot11MeshGateAnnouncementProtocol;
 	bool dot11MeshForwarding;
 	s32 rssi_threshold;
+	u16 ht_opmode;
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 70b2af2..3532ae0 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1364,6 +1364,11 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
 			return -ENOTSUPP;
 		conf->rssi_threshold = nconf->rssi_threshold;
 	}
+	if (_chg_mesh_attr(NL80211_MESHCONF_HT_OPMODE, mask)) {
+		conf->ht_opmode = nconf->ht_opmode;
+		sdata->vif.bss_conf.ht_operation_mode = nconf->ht_opmode;
+		ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);
+	}
 	return 0;
 }
 
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 0fabb8b..0a21e4e 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -595,12 +595,15 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
 	set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
 	ieee80211_mesh_root_setup(ifmsh);
 	ieee80211_queue_work(&local->hw, &sdata->work);
+	sdata->vif.bss_conf.ht_operation_mode =
+				ifmsh->mshcfg.ht_opmode;
 	sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL;
 	sdata->vif.bss_conf.basic_rates =
 		ieee80211_mandatory_rates(sdata->local,
 					  sdata->local->hw.conf.channel->band);
 	ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON |
 						BSS_CHANGED_BEACON_ENABLED |
+						BSS_CHANGED_HT |
 						BSS_CHANGED_BASIC_RATES |
 						BSS_CHANGED_BEACON_INT);
 }
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 2e0ae73..8cc8461 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -157,6 +157,7 @@ out:
 
 	if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) {
 		sdata->vif.bss_conf.ht_operation_mode = ht_opmode;
+		sdata->u.mesh.mshcfg.ht_opmode = ht_opmode;
 		changed = BSS_CHANGED_HT;
 		mpl_dbg("mesh_plink %pM: protection mode changed to %d",
 			sdata->vif.addr, ht_opmode);
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index 8c747fa..2749cb8 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -61,6 +61,7 @@ const struct mesh_config default_mesh_config = {
 	.dot11MeshGateAnnouncementProtocol = false,
 	.dot11MeshForwarding = true,
 	.rssi_threshold = MESH_RSSI_THRESHOLD,
+	.ht_opmode = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED,
 };
 
 const struct mesh_setup default_mesh_setup = {
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 140c1d2..859bd66 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3335,6 +3335,8 @@ static int nl80211_get_mesh_config(struct sk_buff *skb,
 			cur_params.dot11MeshForwarding);
 	NLA_PUT_U32(msg, NL80211_MESHCONF_RSSI_THRESHOLD,
 			cur_params.rssi_threshold);
+	NLA_PUT_U32(msg, NL80211_MESHCONF_HT_OPMODE,
+			cur_params.ht_opmode);
 	nla_nest_end(msg, pinfoattr);
 	genlmsg_end(msg, hdr);
 	return genlmsg_reply(msg, info);
@@ -3369,6 +3371,7 @@ static const struct nla_policy nl80211_meshconf_params_policy[NL80211_MESHCONF_A
 	[NL80211_MESHCONF_GATE_ANNOUNCEMENTS] = { .type = NLA_U8 },
 	[NL80211_MESHCONF_FORWARDING] = { .type = NLA_U8 },
 	[NL80211_MESHCONF_RSSI_THRESHOLD] = { .type = NLA_U32},
+	[NL80211_MESHCONF_HT_OPMODE] = { .type = NLA_U16},
 };
 
 static const struct nla_policy
@@ -3466,6 +3469,8 @@ do {\
 			mask, NL80211_MESHCONF_FORWARDING, nla_get_u8);
 	FILL_IN_MESH_PARAM_IF_SET(tb, cfg, rssi_threshold,
 			mask, NL80211_MESHCONF_RSSI_THRESHOLD, nla_get_u32);
+	FILL_IN_MESH_PARAM_IF_SET(tb, cfg, ht_opmode,
+			mask, NL80211_MESHCONF_HT_OPMODE, nla_get_u16);
 	if (mask_out)
 		*mask_out = mask;
 
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs
  2012-04-30 21:20 [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs Ashok Nagarajan
                   ` (2 preceding siblings ...)
  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 ` Johannes Berg
  2012-05-03 20:20   ` Ashok Nagarajan
  3 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2012-05-03 19:36 UTC (permalink / raw)
  To: Ashok Nagarajan; +Cc: linux-wireless, linville, javier, devel

On Mon, 2012-04-30 at 14:20 -0700, Ashok Nagarajan wrote:

>  		pos = ieee80211_ie_build_ht_oper(pos, &sband->ht_cap,
> -						 chan, channel_type);
> +						 chan, channel_type, 0);

> -	/*
> -	 * Note: According to 802.11n-2009 9.13.3.1, HT Protection field and
> -	 * RIFS Mode are reserved in IBSS mode, therefore keep them at 0
> -	 */
> -	ht_oper->operation_mode = 0x0000;
> +	ht_oper->operation_mode = cpu_to_le16(prot_mode);

Please move the comment to the now correct place instead of deleting it.

johannes


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/4] mac80211: Implement HT mixed protection mode
  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
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2012-05-03 19:39 UTC (permalink / raw)
  To: Ashok Nagarajan; +Cc: linux-wireless, linville, javier, devel

On Mon, 2012-04-30 at 14:20 -0700, Ashok Nagarajan wrote:

> +/** mesh_set_ht_prot_mode - set correct HT protection mode

I think you need a newline before the function name, but this isn't
really valid kernel-doc anyway so please just don't use **

> + *
> + * Section 9.23.3.5 of IEEE 80211s standard

There's no 80211s standard. 802.11s is an amendment, please correct the
reference to the -2012 version.

> +	rcu_read_lock();
> +	list_for_each_entry_rcu(sta, &local->sta_list, list) {
> +		if (sdata == sta->sdata &&
> +		    sta->plink_state == NL80211_PLINK_ESTAB) {

there would be less indentation if you'd add a continue for the mismatch
cases :-)

johannes


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh
  2012-04-30 21:20 ` [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh Ashok Nagarajan
@ 2012-05-03 19:40   ` Johannes Berg
  2012-05-03 20:23     ` Ashok Nagarajan
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2012-05-03 19:40 UTC (permalink / raw)
  To: Ashok Nagarajan; +Cc: linux-wireless, linville, javier, devel

On Mon, 2012-04-30 at 14:20 -0700, Ashok Nagarajan wrote:

> -	    (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)

I don't think you should use > operators since we may later have to add
other channel types like 5 and 10 MHz.

johannes


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 1/4] mac80211: Advertise HT protection mode in IEs
  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
  0 siblings, 0 replies; 11+ messages in thread
From: Ashok Nagarajan @ 2012-05-03 20:20 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, linville, javier, devel

On Thu, May 3, 2012 at 12:36 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2012-04-30 at 14:20 -0700, Ashok Nagarajan wrote:
>
>>               pos = ieee80211_ie_build_ht_oper(pos, &sband->ht_cap,
>> -                                              chan, channel_type);
>> +                                              chan, channel_type, 0);
>
>> -     /*
>> -      * Note: According to 802.11n-2009 9.13.3.1, HT Protection field and
>> -      * RIFS Mode are reserved in IBSS mode, therefore keep them at 0
>> -      */
>> -     ht_oper->operation_mode = 0x0000;
>> +     ht_oper->operation_mode = cpu_to_le16(prot_mode);
>
> Please move the comment to the now correct place instead of deleting it.
>
Sure.
> johannes
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 2/4] mac80211: Implement HT mixed protection mode
  2012-05-03 19:39   ` Johannes Berg
@ 2012-05-03 20:21     ` Ashok Nagarajan
  0 siblings, 0 replies; 11+ messages in thread
From: Ashok Nagarajan @ 2012-05-03 20:21 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, linville, javier, devel

On Thu, May 3, 2012 at 12:39 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2012-04-30 at 14:20 -0700, Ashok Nagarajan wrote:
>
>> +/** mesh_set_ht_prot_mode - set correct HT protection mode
>
> I think you need a newline before the function name, but this isn't
> really valid kernel-doc anyway so please just don't use **
>
Noted.
>> + *
>> + * Section 9.23.3.5 of IEEE 80211s standard
>
> There's no 80211s standard. 802.11s is an amendment, please correct the
> reference to the -2012 version.
>
Noted.
>> +     rcu_read_lock();
>> +     list_for_each_entry_rcu(sta, &local->sta_list, list) {
>> +             if (sdata == sta->sdata &&
>> +                 sta->plink_state == NL80211_PLINK_ESTAB) {
>
> there would be less indentation if you'd add a continue for the mismatch
> cases :-)
>
> johannes
>

Thank you,
Ashok

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh
  2012-05-03 19:40   ` Johannes Berg
@ 2012-05-03 20:23     ` Ashok Nagarajan
  2012-05-03 20:29       ` Johannes Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Ashok Nagarajan @ 2012-05-03 20:23 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, linville, javier, devel

On Thu, May 3, 2012 at 12:40 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Mon, 2012-04-30 at 14:20 -0700, Ashok Nagarajan wrote:
>
>> -         (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)
>
> I don't think you should use > operators since we may later have to add
> other channel types like 5 and 10 MHz.
>
Sure. I will send a fix patch reflecting this change.

> johannes
>

Thanks,
Ashok

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh
  2012-05-03 20:23     ` Ashok Nagarajan
@ 2012-05-03 20:29       ` Johannes Berg
  0 siblings, 0 replies; 11+ messages in thread
From: Johannes Berg @ 2012-05-03 20:29 UTC (permalink / raw)
  To: Ashok Nagarajan; +Cc: linux-wireless, linville, javier, devel

On Thu, 2012-05-03 at 13:23 -0700, Ashok Nagarajan wrote:
> On Thu, May 3, 2012 at 12:40 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Mon, 2012-04-30 at 14:20 -0700, Ashok Nagarajan wrote:
> >
> >> -         (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)
> >
> > I don't think you should use > operators since we may later have to add
> > other channel types like 5 and 10 MHz.
> >
> Sure. I will send a fix patch reflecting this change.

I think all of this has been merged so please send fixes for the other
things too.

Thanks,
johannes


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-05-03 20:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v2 3/4] mac80211: Allow nonHT/HT peering in mesh Ashok Nagarajan
2012-05-03 19:40   ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.