瀏覽代碼

{nl,cfg,mac}80211: Allow Setting Multicast Rate in Mesh

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Chun-Yeow Yeoh 13 年之前
父節點
當前提交
4bb62344e4
共有 4 個文件被更改,包括 14 次插入0 次删除
  1. 2 0
      include/net/cfg80211.h
  2. 6 0
      net/mac80211/cfg.c
  3. 1 0
      net/mac80211/tx.c
  4. 5 0
      net/wireless/nl80211.c

+ 2 - 0
include/net/cfg80211.h

@@ -802,6 +802,7 @@ struct mesh_config {
  * @ie_len: length of vendor information elements
  * @ie_len: length of vendor information elements
  * @is_authenticated: this mesh requires authentication
  * @is_authenticated: this mesh requires authentication
  * @is_secure: this mesh uses security
  * @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.
  * These parameters are fixed when the mesh is created.
  */
  */
@@ -814,6 +815,7 @@ struct mesh_setup {
 	u8 ie_len;
 	u8 ie_len;
 	bool is_authenticated;
 	bool is_authenticated;
 	bool is_secure;
 	bool is_secure;
+	int mcast_rate[IEEE80211_NUM_BANDS];
 };
 };
 
 
 /**
 /**

+ 6 - 0
net/mac80211/cfg.c

@@ -1195,6 +1195,8 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
 {
 {
 	u8 *new_ie;
 	u8 *new_ie;
 	const u8 *old_ie;
 	const u8 *old_ie;
+	struct ieee80211_sub_if_data *sdata = container_of(ifmsh,
+					struct ieee80211_sub_if_data, u.mesh);
 
 
 	/* allocate information elements */
 	/* allocate information elements */
 	new_ie = NULL;
 	new_ie = NULL;
@@ -1221,6 +1223,10 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
 	if (setup->is_secure)
 	if (setup->is_secure)
 		ifmsh->security |= IEEE80211_MESH_SEC_SECURED;
 		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;
 	return 0;
 }
 }
 
 

+ 1 - 0
net/mac80211/tx.c

@@ -640,6 +640,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
 	else
 	else
 		txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1;
 		txrc.max_rate_idx = fls(txrc.rate_idx_mask) - 1;
 	txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP ||
 	txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP ||
+		    tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
 		    tx->sdata->vif.type == NL80211_IFTYPE_ADHOC);
 		    tx->sdata->vif.type == NL80211_IFTYPE_ADHOC);
 
 
 	/* set up RTS protection if desired */
 	/* set up RTS protection if desired */

+ 5 - 0
net/wireless/nl80211.c

@@ -5667,6 +5667,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 = nla_data(info->attrs[NL80211_ATTR_MESH_ID]);
 	setup.mesh_id_len = nla_len(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]) {
 	if (info->attrs[NL80211_ATTR_MESH_SETUP]) {
 		/* parse additional setup parameters if given */
 		/* parse additional setup parameters if given */
 		err = nl80211_parse_mesh_setup(info, &setup);
 		err = nl80211_parse_mesh_setup(info, &setup);