linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Pedersen <thomas@cozybit.com>
To: linux-wireless@vger.kernel.org
Cc: devel@lists.open80211s.org,
	Chun-Yeow Yeoh <yeohchunyeow@gmail.com>,
	Thomas Pedersen <thomas@cozybit.com>,
	johannes@sipsolutions.net, linville@tuxdriver.com
Subject: [PATCH 1/7] {nl,cfg,mac}80211: Allow Setting Multicast Rate in Mesh
Date: Wed, 23 Nov 2011 12:32:20 -0800	[thread overview]
Message-ID: <1322080347-7644-2-git-send-email-thomas@cozybit.com> (raw)
In-Reply-To: <1322080347-7644-1-git-send-email-thomas@cozybit.com>

From: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
---
 include/net/cfg80211.h |    2 ++
 net/mac80211/cfg.c     |    6 ++++++
 net/mac80211/tx.c      |    1 +
 net/wireless/nl80211.c |    5 +++++
 4 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index d5e1891..edf1a4b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -802,6 +802,7 @@ struct mesh_config {
  * @ie_len: length of vendor information elements
  * @is_authenticated: this mesh requires authentication
  * @is_secure: this mesh uses security
+ * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
  *
  * These parameters are fixed when the mesh is created.
  */
@@ -814,6 +815,7 @@ struct mesh_setup {
 	u8 ie_len;
 	bool is_authenticated;
 	bool is_secure;
+	int mcast_rate[IEEE80211_NUM_BANDS];
 };
 
 /**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 2577c45..8fa85db 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1185,6 +1185,8 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
 {
 	u8 *new_ie;
 	const u8 *old_ie;
+	struct ieee80211_sub_if_data *sdata = container_of(ifmsh,
+					struct ieee80211_sub_if_data, u.mesh);
 
 	/* allocate information elements */
 	new_ie = NULL;
@@ -1211,6 +1213,10 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
 	if (setup->is_secure)
 		ifmsh->security |= IEEE80211_MESH_SEC_SECURED;
 
+	/* mcast rate setting in Mesh Node */
+	memcpy(sdata->vif.bss_conf.mcast_rate, setup->mcast_rate,
+						sizeof(setup->mcast_rate));
+
 	return 0;
 }
 
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 8d31933..6ec3194 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -636,6 +636,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
 	else
 		txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1;
 	txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP ||
+		    tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
 		    tx->sdata->vif.type == NL80211_IFTYPE_ADHOC);
 
 	/* set up RTS protection if desired */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a1cabde..9b8f9d9 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5648,6 +5648,11 @@ static int nl80211_join_mesh(struct sk_buff *skb, struct genl_info *info)
 	setup.mesh_id = nla_data(info->attrs[NL80211_ATTR_MESH_ID]);
 	setup.mesh_id_len = nla_len(info->attrs[NL80211_ATTR_MESH_ID]);
 
+	if (info->attrs[NL80211_ATTR_MCAST_RATE] &&
+		!nl80211_parse_mcast_rate(rdev, setup.mcast_rate,
+		nla_get_u32(info->attrs[NL80211_ATTR_MCAST_RATE])))
+			return -EINVAL;
+
 	if (info->attrs[NL80211_ATTR_MESH_SETUP]) {
 		/* parse additional setup parameters if given */
 		err = nl80211_parse_mesh_setup(info, &setup);
-- 
1.7.5.4


  reply	other threads:[~2011-11-23 20:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 20:32 [PATCH 0/7] mesh fixes and improvements Thomas Pedersen
2011-11-23 20:32 ` Thomas Pedersen [this message]
2011-11-24 15:15   ` [PATCH 1/7] {nl,cfg,mac}80211: Allow Setting Multicast Rate in Mesh Johannes Berg
2011-11-23 20:32 ` [PATCH 2/7] mac80211: failed forwarded mesh frame addressing Thomas Pedersen
2011-11-23 20:32 ` [PATCH 3/7] mac80211: fix switched HWMP frame addresses Thomas Pedersen
2011-11-23 20:32 ` [PATCH 4/7] mac80211: fix forwarded mesh frame queue mapping Thomas Pedersen
2011-11-24 15:16   ` Johannes Berg
2011-11-25  1:03     ` Thomas Pedersen
2011-11-23 20:32 ` [PATCH 5/7] {nl,cfg,mac}80211: implement dot11MeshHWMPperrMinInterval Thomas Pedersen
2011-11-23 20:32 ` [PATCH 6/7] mac80211: don't initiate path discovery when forwarding frame with unknown DA Thomas Pedersen
2011-11-23 20:32 ` [PATCH 7/7] mac80211: clean up rx_h_mesh_fwding Thomas Pedersen

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=1322080347-7644-2-git-send-email-thomas@cozybit.com \
    --to=thomas@cozybit.com \
    --cc=devel@lists.open80211s.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=yeohchunyeow@gmail.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).