aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_plink.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r--net/mac80211/mesh_plink.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index f7526e509aa8..0b58e8139937 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -38,8 +38,8 @@ enum plink_event {
38}; 38};
39 39
40static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, 40static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
41 enum ieee80211_self_protected_actioncode action, 41 enum ieee80211_self_protected_actioncode action,
42 u8 *da, __le16 llid, __le16 plid, __le16 reason); 42 u8 *da, __le16 llid, __le16 plid, __le16 reason);
43 43
44/** 44/**
45 * mesh_plink_fsm_restart - restart a mesh peer link finite state machine 45 * mesh_plink_fsm_restart - restart a mesh peer link finite state machine
@@ -231,8 +231,9 @@ u32 mesh_plink_deactivate(struct sta_info *sta)
231} 231}
232 232
233static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, 233static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
234 enum ieee80211_self_protected_actioncode action, 234 enum ieee80211_self_protected_actioncode action,
235 u8 *da, __le16 llid, __le16 plid, __le16 reason) { 235 u8 *da, __le16 llid, __le16 plid, __le16 reason)
236{
236 struct ieee80211_local *local = sdata->local; 237 struct ieee80211_local *local = sdata->local;
237 struct sk_buff *skb; 238 struct sk_buff *skb;
238 struct ieee80211_tx_info *info; 239 struct ieee80211_tx_info *info;
@@ -283,13 +284,13 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
283 } 284 }
284 if (ieee80211_add_srates_ie(sdata, skb, true, band) || 285 if (ieee80211_add_srates_ie(sdata, skb, true, band) ||
285 ieee80211_add_ext_srates_ie(sdata, skb, true, band) || 286 ieee80211_add_ext_srates_ie(sdata, skb, true, band) ||
286 mesh_add_rsn_ie(skb, sdata) || 287 mesh_add_rsn_ie(sdata, skb) ||
287 mesh_add_meshid_ie(skb, sdata) || 288 mesh_add_meshid_ie(sdata, skb) ||
288 mesh_add_meshconf_ie(skb, sdata)) 289 mesh_add_meshconf_ie(sdata, skb))
289 goto free; 290 goto free;
290 } else { /* WLAN_SP_MESH_PEERING_CLOSE */ 291 } else { /* WLAN_SP_MESH_PEERING_CLOSE */
291 info->flags |= IEEE80211_TX_CTL_NO_ACK; 292 info->flags |= IEEE80211_TX_CTL_NO_ACK;
292 if (mesh_add_meshid_ie(skb, sdata)) 293 if (mesh_add_meshid_ie(sdata, skb))
293 goto free; 294 goto free;
294 } 295 }
295 296
@@ -333,12 +334,12 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
333 } 334 }
334 335
335 if (action != WLAN_SP_MESH_PEERING_CLOSE) { 336 if (action != WLAN_SP_MESH_PEERING_CLOSE) {
336 if (mesh_add_ht_cap_ie(skb, sdata) || 337 if (mesh_add_ht_cap_ie(sdata, skb) ||
337 mesh_add_ht_oper_ie(skb, sdata)) 338 mesh_add_ht_oper_ie(sdata, skb))
338 goto free; 339 goto free;
339 } 340 }
340 341
341 if (mesh_add_vendor_ies(skb, sdata)) 342 if (mesh_add_vendor_ies(sdata, skb))
342 goto free; 343 goto free;
343 344
344 ieee80211_tx_skb(sdata, skb); 345 ieee80211_tx_skb(sdata, skb);
@@ -666,8 +667,9 @@ u32 mesh_plink_block(struct sta_info *sta)
666} 667}
667 668
668 669
669void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_mgmt *mgmt, 670void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata,
670 size_t len, struct ieee80211_rx_status *rx_status) 671 struct ieee80211_mgmt *mgmt, size_t len,
672 struct ieee80211_rx_status *rx_status)
671{ 673{
672 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg; 674 struct mesh_config *mshcfg = &sdata->u.mesh.mshcfg;
673 struct ieee802_11_elems elems; 675 struct ieee802_11_elems elems;
@@ -680,7 +682,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
680 u8 *baseaddr; 682 u8 *baseaddr;
681 u32 changed = 0; 683 u32 changed = 0;
682 __le16 plid, llid, reason; 684 __le16 plid, llid, reason;
683 static const char *mplstates[] = { 685 static const char * const mplstates[] = {
684 [NL80211_PLINK_LISTEN] = "LISTEN", 686 [NL80211_PLINK_LISTEN] = "LISTEN",
685 [NL80211_PLINK_OPN_SNT] = "OPN-SNT", 687 [NL80211_PLINK_OPN_SNT] = "OPN-SNT",
686 [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD", 688 [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD",
@@ -708,13 +710,15 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
708 baselen += 4; 710 baselen += 4;
709 } 711 }
710 ieee802_11_parse_elems(baseaddr, len - baselen, &elems); 712 ieee802_11_parse_elems(baseaddr, len - baselen, &elems);
713
711 if (!elems.peering) { 714 if (!elems.peering) {
712 mpl_dbg(sdata, 715 mpl_dbg(sdata,
713 "Mesh plink: missing necessary peer link ie\n"); 716 "Mesh plink: missing necessary peer link ie\n");
714 return; 717 return;
715 } 718 }
719
716 if (elems.rsn_len && 720 if (elems.rsn_len &&
717 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) { 721 sdata->u.mesh.security == IEEE80211_MESH_SEC_NONE) {
718 mpl_dbg(sdata, 722 mpl_dbg(sdata,
719 "Mesh plink: can't establish link with secure peer\n"); 723 "Mesh plink: can't establish link with secure peer\n");
720 return; 724 return;
@@ -733,7 +737,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
733 } 737 }
734 738
735 if (ftype != WLAN_SP_MESH_PEERING_CLOSE && 739 if (ftype != WLAN_SP_MESH_PEERING_CLOSE &&
736 (!elems.mesh_id || !elems.mesh_config)) { 740 (!elems.mesh_id || !elems.mesh_config)) {
737 mpl_dbg(sdata, "Mesh plink: missing necessary ie\n"); 741 mpl_dbg(sdata, "Mesh plink: missing necessary ie\n");
738 return; 742 return;
739 } 743 }