aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJavier Cardona <javier@cozybit.com>2011-04-07 18:08:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-12 16:57:37 -0400
commit581a8b0feeed8877aab3a8ca4c972419790cd07f (patch)
tree36ef0e86b367e0abeb0a50fbf59840f125efdbc7 /net/mac80211
parenta22e93f5d819f11d2a2d6332e20ff5b462e5c208 (diff)
nl80211: rename NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE
To NL80211_MESH_SETUP_IE. This reflects our ability to insert any ie into a mesh beacon, not simply path selection ies. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c15
-rw-r--r--net/mac80211/ieee80211_i.h4
-rw-r--r--net/mac80211/mesh.c6
-rw-r--r--net/mac80211/mesh_plink.c2
-rw-r--r--net/mac80211/tx.c2
5 files changed, 14 insertions, 15 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index bf5d28da46e6..d9428afd8bf6 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1034,26 +1034,25 @@ static int copy_mesh_setup(struct ieee80211_if_mesh *ifmsh,
1034 u8 *new_ie; 1034 u8 *new_ie;
1035 const u8 *old_ie; 1035 const u8 *old_ie;
1036 1036
1037 /* first allocate the new vendor information element */ 1037 /* allocate information elements */
1038 new_ie = NULL; 1038 new_ie = NULL;
1039 old_ie = ifmsh->vendor_ie; 1039 old_ie = ifmsh->ie;
1040 1040
1041 ifmsh->vendor_ie_len = setup->vendor_ie_len; 1041 if (setup->ie_len) {
1042 if (setup->vendor_ie_len) { 1042 new_ie = kmemdup(setup->ie, setup->ie_len,
1043 new_ie = kmemdup(setup->vendor_ie, setup->vendor_ie_len,
1044 GFP_KERNEL); 1043 GFP_KERNEL);
1045 if (!new_ie) 1044 if (!new_ie)
1046 return -ENOMEM; 1045 return -ENOMEM;
1047 } 1046 }
1047 ifmsh->ie_len = setup->ie_len;
1048 ifmsh->ie = new_ie;
1049 kfree(old_ie);
1048 1050
1049 /* now copy the rest of the setup parameters */ 1051 /* now copy the rest of the setup parameters */
1050 ifmsh->mesh_id_len = setup->mesh_id_len; 1052 ifmsh->mesh_id_len = setup->mesh_id_len;
1051 memcpy(ifmsh->mesh_id, setup->mesh_id, ifmsh->mesh_id_len); 1053 memcpy(ifmsh->mesh_id, setup->mesh_id, ifmsh->mesh_id_len);
1052 ifmsh->mesh_pp_id = setup->path_sel_proto; 1054 ifmsh->mesh_pp_id = setup->path_sel_proto;
1053 ifmsh->mesh_pm_id = setup->path_metric; 1055 ifmsh->mesh_pm_id = setup->path_metric;
1054 ifmsh->vendor_ie = new_ie;
1055
1056 kfree(old_ie);
1057 1056
1058 return 0; 1057 return 0;
1059} 1058}
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 6eb2c8523eeb..6450100594ba 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -488,8 +488,8 @@ struct ieee80211_if_mesh {
488 struct mesh_config mshcfg; 488 struct mesh_config mshcfg;
489 u32 mesh_seqnum; 489 u32 mesh_seqnum;
490 bool accepting_plinks; 490 bool accepting_plinks;
491 const u8 *vendor_ie; 491 const u8 *ie;
492 u8 vendor_ie_len; 492 u8 ie_len;
493}; 493};
494 494
495#ifdef CONFIG_MAC80211_MESH 495#ifdef CONFIG_MAC80211_MESH
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 2a57cc02c618..1c244c0c7664 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -279,9 +279,9 @@ void mesh_mgmt_ies_add(struct sk_buff *skb, struct ieee80211_sub_if_data *sdata)
279 MESHCONF_CAPAB_ACCEPT_PLINKS : 0x00; 279 MESHCONF_CAPAB_ACCEPT_PLINKS : 0x00;
280 *pos++ = 0x00; 280 *pos++ = 0x00;
281 281
282 if (sdata->u.mesh.vendor_ie) { 282 if (sdata->u.mesh.ie) {
283 int len = sdata->u.mesh.vendor_ie_len; 283 int len = sdata->u.mesh.ie_len;
284 const u8 *data = sdata->u.mesh.vendor_ie; 284 const u8 *data = sdata->u.mesh.ie;
285 if (skb_tailroom(skb) > len) 285 if (skb_tailroom(skb) > len)
286 memcpy(skb_put(skb, len), data, len); 286 memcpy(skb_put(skb, len), data, len);
287 } 287 }
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 44b53931ba5e..c705b20e1acb 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -161,7 +161,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
161 __le16 reason) { 161 __le16 reason) {
162 struct ieee80211_local *local = sdata->local; 162 struct ieee80211_local *local = sdata->local;
163 struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 + 163 struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 +
164 sdata->u.mesh.vendor_ie_len); 164 sdata->u.mesh.ie_len);
165 struct ieee80211_mgmt *mgmt; 165 struct ieee80211_mgmt *mgmt;
166 bool include_plid = false; 166 bool include_plid = false;
167 static const u8 meshpeeringproto[] = { 0x00, 0x0F, 0xAC, 0x2A }; 167 static const u8 meshpeeringproto[] = { 0x00, 0x0F, 0xAC, 0x2A };
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index ce4596ed1268..17b10be31f55 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -2262,7 +2262,7 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
2262 2262
2263 /* headroom, head length, tail length and maximum TIM length */ 2263 /* headroom, head length, tail length and maximum TIM length */
2264 skb = dev_alloc_skb(local->tx_headroom + 400 + 2264 skb = dev_alloc_skb(local->tx_headroom + 400 +
2265 sdata->u.mesh.vendor_ie_len); 2265 sdata->u.mesh.ie_len);
2266 if (!skb) 2266 if (!skb)
2267 goto out; 2267 goto out;
2268 2268