aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorThomas Pedersen <thomas@cozybit.com>2011-08-11 22:35:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-22 14:46:00 -0400
commit54ef656b05103f700ff8fc2aaf0382cfd0e54fe4 (patch)
tree418dc854fc3e4bde2075bab8a6c9e59439858eea /net/mac80211
parent6709a6d96e0f9b05a07999f720a15389ad242a4a (diff)
mac80211: update mesh peering frame codes
Have the mesh peering frames use the self-protected action and reason codes specified in 802.11s and defined in ieee80211.h. Remove the local enums. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/mesh_plink.c157
1 files changed, 76 insertions, 81 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index e4113f243fc4..2cf22127d324 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -25,29 +25,12 @@
25#define mod_plink_timer(s, t) (mod_timer(&s->plink_timer, \ 25#define mod_plink_timer(s, t) (mod_timer(&s->plink_timer, \
26 jiffies + HZ * t / 1000)) 26 jiffies + HZ * t / 1000))
27 27
28/* Peer link cancel reasons, all subject to ANA approval */
29#define MESH_LINK_CANCELLED 2
30#define MESH_MAX_NEIGHBORS 3
31#define MESH_CAPABILITY_POLICY_VIOLATION 4
32#define MESH_CLOSE_RCVD 5
33#define MESH_MAX_RETRIES 6
34#define MESH_CONFIRM_TIMEOUT 7
35#define MESH_SECURITY_ROLE_NEGOTIATION_DIFFERS 8
36#define MESH_SECURITY_AUTHENTICATION_IMPOSSIBLE 9
37#define MESH_SECURITY_FAILED_VERIFICATION 10
38
39#define dot11MeshMaxRetries(s) (s->u.mesh.mshcfg.dot11MeshMaxRetries) 28#define dot11MeshMaxRetries(s) (s->u.mesh.mshcfg.dot11MeshMaxRetries)
40#define dot11MeshRetryTimeout(s) (s->u.mesh.mshcfg.dot11MeshRetryTimeout) 29#define dot11MeshRetryTimeout(s) (s->u.mesh.mshcfg.dot11MeshRetryTimeout)
41#define dot11MeshConfirmTimeout(s) (s->u.mesh.mshcfg.dot11MeshConfirmTimeout) 30#define dot11MeshConfirmTimeout(s) (s->u.mesh.mshcfg.dot11MeshConfirmTimeout)
42#define dot11MeshHoldingTimeout(s) (s->u.mesh.mshcfg.dot11MeshHoldingTimeout) 31#define dot11MeshHoldingTimeout(s) (s->u.mesh.mshcfg.dot11MeshHoldingTimeout)
43#define dot11MeshMaxPeerLinks(s) (s->u.mesh.mshcfg.dot11MeshMaxPeerLinks) 32#define dot11MeshMaxPeerLinks(s) (s->u.mesh.mshcfg.dot11MeshMaxPeerLinks)
44 33
45enum plink_frame_type {
46 PLINK_OPEN = 1,
47 PLINK_CONFIRM,
48 PLINK_CLOSE
49};
50
51enum plink_event { 34enum plink_event {
52 PLINK_UNDEFINED, 35 PLINK_UNDEFINED,
53 OPN_ACPT, 36 OPN_ACPT,
@@ -157,8 +140,8 @@ void mesh_plink_deactivate(struct sta_info *sta)
157} 140}
158 141
159static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata, 142static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
160 enum plink_frame_type action, u8 *da, __le16 llid, __le16 plid, 143 enum ieee80211_self_protected_actioncode action,
161 __le16 reason) { 144 u8 *da, __le16 llid, __le16 plid, __le16 reason) {
162 struct ieee80211_local *local = sdata->local; 145 struct ieee80211_local *local = sdata->local;
163 struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 + 146 struct sk_buff *skb = dev_alloc_skb(local->hw.extra_tx_headroom + 400 +
164 sdata->u.mesh.ie_len); 147 sdata->u.mesh.ie_len);
@@ -185,11 +168,11 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
185 mgmt->u.action.category = WLAN_CATEGORY_MESH_ACTION; 168 mgmt->u.action.category = WLAN_CATEGORY_MESH_ACTION;
186 mgmt->u.action.u.plink_action.action_code = action; 169 mgmt->u.action.u.plink_action.action_code = action;
187 170
188 if (action == PLINK_CLOSE) 171 if (action == WLAN_SP_MESH_PEERING_CLOSE)
189 mgmt->u.action.u.plink_action.aux = reason; 172 mgmt->u.action.u.plink_action.aux = reason;
190 else { 173 else {
191 mgmt->u.action.u.plink_action.aux = cpu_to_le16(0x0); 174 mgmt->u.action.u.plink_action.aux = cpu_to_le16(0x0);
192 if (action == PLINK_CONFIRM) { 175 if (action == WLAN_SP_MESH_PEERING_CONFIRM) {
193 pos = skb_put(skb, 4); 176 pos = skb_put(skb, 4);
194 /* two-byte status code followed by two-byte AID */ 177 /* two-byte status code followed by two-byte AID */
195 memset(pos, 0, 2); 178 memset(pos, 0, 2);
@@ -205,14 +188,14 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
205 188
206 /* Add Peer Link Management element */ 189 /* Add Peer Link Management element */
207 switch (action) { 190 switch (action) {
208 case PLINK_OPEN: 191 case WLAN_SP_MESH_PEERING_OPEN:
209 ie_len = 6; 192 ie_len = 6;
210 break; 193 break;
211 case PLINK_CONFIRM: 194 case WLAN_SP_MESH_PEERING_CONFIRM:
212 ie_len = 8; 195 ie_len = 8;
213 include_plid = true; 196 include_plid = true;
214 break; 197 break;
215 case PLINK_CLOSE: 198 case WLAN_SP_MESH_PEERING_CLOSE:
216 default: 199 default:
217 if (!plid) 200 if (!plid)
218 ie_len = 8; 201 ie_len = 8;
@@ -233,7 +216,7 @@ static int mesh_plink_frame_tx(struct ieee80211_sub_if_data *sdata,
233 pos += 2; 216 pos += 2;
234 memcpy(pos, &plid, 2); 217 memcpy(pos, &plid, 2);
235 } 218 }
236 if (action == PLINK_CLOSE) { 219 if (action == WLAN_SP_MESH_PEERING_CLOSE) {
237 pos += 2; 220 pos += 2;
238 memcpy(pos, &reason, 2); 221 memcpy(pos, &reason, 2);
239 } 222 }
@@ -327,21 +310,21 @@ static void mesh_plink_timer(unsigned long data)
327 ++sta->plink_retries; 310 ++sta->plink_retries;
328 mod_plink_timer(sta, sta->plink_timeout); 311 mod_plink_timer(sta, sta->plink_timeout);
329 spin_unlock_bh(&sta->lock); 312 spin_unlock_bh(&sta->lock);
330 mesh_plink_frame_tx(sdata, PLINK_OPEN, sta->sta.addr, llid, 313 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_OPEN,
331 0, 0); 314 sta->sta.addr, llid, 0, 0);
332 break; 315 break;
333 } 316 }
334 reason = cpu_to_le16(MESH_MAX_RETRIES); 317 reason = cpu_to_le16(WLAN_REASON_MESH_MAX_RETRIES);
335 /* fall through on else */ 318 /* fall through on else */
336 case NL80211_PLINK_CNF_RCVD: 319 case NL80211_PLINK_CNF_RCVD:
337 /* confirm timer */ 320 /* confirm timer */
338 if (!reason) 321 if (!reason)
339 reason = cpu_to_le16(MESH_CONFIRM_TIMEOUT); 322 reason = cpu_to_le16(WLAN_REASON_MESH_CONFIRM_TIMEOUT);
340 sta->plink_state = NL80211_PLINK_HOLDING; 323 sta->plink_state = NL80211_PLINK_HOLDING;
341 mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); 324 mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata));
342 spin_unlock_bh(&sta->lock); 325 spin_unlock_bh(&sta->lock);
343 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, plid, 326 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
344 reason); 327 sta->sta.addr, llid, plid, reason);
345 break; 328 break;
346 case NL80211_PLINK_HOLDING: 329 case NL80211_PLINK_HOLDING:
347 /* holding timer */ 330 /* holding timer */
@@ -401,7 +384,7 @@ int mesh_plink_open(struct sta_info *sta)
401 mpl_dbg("Mesh plink: starting establishment with %pM\n", 384 mpl_dbg("Mesh plink: starting establishment with %pM\n",
402 sta->sta.addr); 385 sta->sta.addr);
403 386
404 return mesh_plink_frame_tx(sdata, PLINK_OPEN, 387 return mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_OPEN,
405 sta->sta.addr, llid, 0, 0); 388 sta->sta.addr, llid, 0, 0);
406} 389}
407 390
@@ -427,7 +410,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
427 struct ieee802_11_elems elems; 410 struct ieee802_11_elems elems;
428 struct sta_info *sta; 411 struct sta_info *sta;
429 enum plink_event event; 412 enum plink_event event;
430 enum plink_frame_type ftype; 413 enum ieee80211_self_protected_actioncode ftype;
431 size_t baselen; 414 size_t baselen;
432 bool deactivated, matches_local = true; 415 bool deactivated, matches_local = true;
433 u8 ie_len; 416 u8 ie_len;
@@ -456,7 +439,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
456 439
457 baseaddr = mgmt->u.action.u.plink_action.variable; 440 baseaddr = mgmt->u.action.u.plink_action.variable;
458 baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt; 441 baselen = (u8 *) mgmt->u.action.u.plink_action.variable - (u8 *) mgmt;
459 if (mgmt->u.action.u.plink_action.action_code == PLINK_CONFIRM) { 442 if (mgmt->u.action.u.plink_action.action_code ==
443 WLAN_SP_MESH_PEERING_CONFIRM) {
460 baseaddr += 4; 444 baseaddr += 4;
461 baselen += 4; 445 baselen += 4;
462 } 446 }
@@ -473,15 +457,17 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
473 457
474 ftype = mgmt->u.action.u.plink_action.action_code; 458 ftype = mgmt->u.action.u.plink_action.action_code;
475 ie_len = elems.peer_link_len; 459 ie_len = elems.peer_link_len;
476 if ((ftype == PLINK_OPEN && ie_len != 6) || 460 if ((ftype == WLAN_SP_MESH_PEERING_OPEN && ie_len != 6) ||
477 (ftype == PLINK_CONFIRM && ie_len != 8) || 461 (ftype == WLAN_SP_MESH_PEERING_CONFIRM && ie_len != 8) ||
478 (ftype == PLINK_CLOSE && ie_len != 8 && ie_len != 10)) { 462 (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len != 8
463 && ie_len != 10)) {
479 mpl_dbg("Mesh plink: incorrect plink ie length %d %d\n", 464 mpl_dbg("Mesh plink: incorrect plink ie length %d %d\n",
480 ftype, ie_len); 465 ftype, ie_len);
481 return; 466 return;
482 } 467 }
483 468
484 if (ftype != PLINK_CLOSE && (!elems.mesh_id || !elems.mesh_config)) { 469 if (ftype != WLAN_SP_MESH_PEERING_CLOSE &&
470 (!elems.mesh_id || !elems.mesh_config)) {
485 mpl_dbg("Mesh plink: missing necessary ie\n"); 471 mpl_dbg("Mesh plink: missing necessary ie\n");
486 return; 472 return;
487 } 473 }
@@ -489,13 +475,14 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
489 * from the point of view of this host. 475 * from the point of view of this host.
490 */ 476 */
491 memcpy(&plid, PLINK_GET_LLID(elems.peer_link), 2); 477 memcpy(&plid, PLINK_GET_LLID(elems.peer_link), 2);
492 if (ftype == PLINK_CONFIRM || (ftype == PLINK_CLOSE && ie_len == 10)) 478 if (ftype == WLAN_SP_MESH_PEERING_CONFIRM ||
479 (ftype == WLAN_SP_MESH_PEERING_CLOSE && ie_len == 10))
493 memcpy(&llid, PLINK_GET_PLID(elems.peer_link), 2); 480 memcpy(&llid, PLINK_GET_PLID(elems.peer_link), 2);
494 481
495 rcu_read_lock(); 482 rcu_read_lock();
496 483
497 sta = sta_info_get(sdata, mgmt->sa); 484 sta = sta_info_get(sdata, mgmt->sa);
498 if (!sta && ftype != PLINK_OPEN) { 485 if (!sta && ftype != WLAN_SP_MESH_PEERING_OPEN) {
499 mpl_dbg("Mesh plink: cls or cnf from unknown peer\n"); 486 mpl_dbg("Mesh plink: cls or cnf from unknown peer\n");
500 rcu_read_unlock(); 487 rcu_read_unlock();
501 return; 488 return;
@@ -514,30 +501,30 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
514 501
515 /* Now we will figure out the appropriate event... */ 502 /* Now we will figure out the appropriate event... */
516 event = PLINK_UNDEFINED; 503 event = PLINK_UNDEFINED;
517 if (ftype != PLINK_CLOSE && (!mesh_matches_local(&elems, sdata))) { 504 if (ftype != WLAN_SP_MESH_PEERING_CLOSE &&
505 (!mesh_matches_local(&elems, sdata))) {
518 matches_local = false; 506 matches_local = false;
519 switch (ftype) { 507 switch (ftype) {
520 case PLINK_OPEN: 508 case WLAN_SP_MESH_PEERING_OPEN:
521 event = OPN_RJCT; 509 event = OPN_RJCT;
522 break; 510 break;
523 case PLINK_CONFIRM: 511 case WLAN_SP_MESH_PEERING_CONFIRM:
524 event = CNF_RJCT; 512 event = CNF_RJCT;
525 break; 513 break;
526 case PLINK_CLOSE: 514 default:
527 /* avoid warning */
528 break; 515 break;
529 } 516 }
530 } 517 }
531 518
532 if (!sta && !matches_local) { 519 if (!sta && !matches_local) {
533 rcu_read_unlock(); 520 rcu_read_unlock();
534 reason = cpu_to_le16(MESH_CAPABILITY_POLICY_VIOLATION); 521 reason = cpu_to_le16(WLAN_REASON_MESH_CONFIG);
535 llid = 0; 522 llid = 0;
536 mesh_plink_frame_tx(sdata, PLINK_CLOSE, mgmt->sa, llid, 523 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
537 plid, reason); 524 mgmt->sa, llid, plid, reason);
538 return; 525 return;
539 } else if (!sta) { 526 } else if (!sta) {
540 /* ftype == PLINK_OPEN */ 527 /* ftype == WLAN_SP_MESH_PEERING_OPEN */
541 u32 rates; 528 u32 rates;
542 529
543 rcu_read_unlock(); 530 rcu_read_unlock();
@@ -562,21 +549,21 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
562 } else if (matches_local) { 549 } else if (matches_local) {
563 spin_lock_bh(&sta->lock); 550 spin_lock_bh(&sta->lock);
564 switch (ftype) { 551 switch (ftype) {
565 case PLINK_OPEN: 552 case WLAN_SP_MESH_PEERING_OPEN:
566 if (!mesh_plink_free_count(sdata) || 553 if (!mesh_plink_free_count(sdata) ||
567 (sta->plid && sta->plid != plid)) 554 (sta->plid && sta->plid != plid))
568 event = OPN_IGNR; 555 event = OPN_IGNR;
569 else 556 else
570 event = OPN_ACPT; 557 event = OPN_ACPT;
571 break; 558 break;
572 case PLINK_CONFIRM: 559 case WLAN_SP_MESH_PEERING_CONFIRM:
573 if (!mesh_plink_free_count(sdata) || 560 if (!mesh_plink_free_count(sdata) ||
574 (sta->llid != llid || sta->plid != plid)) 561 (sta->llid != llid || sta->plid != plid))
575 event = CNF_IGNR; 562 event = CNF_IGNR;
576 else 563 else
577 event = CNF_ACPT; 564 event = CNF_ACPT;
578 break; 565 break;
579 case PLINK_CLOSE: 566 case WLAN_SP_MESH_PEERING_CLOSE:
580 if (sta->plink_state == NL80211_PLINK_ESTAB) 567 if (sta->plink_state == NL80211_PLINK_ESTAB)
581 /* Do not check for llid or plid. This does not 568 /* Do not check for llid or plid. This does not
582 * follow the standard but since multiple plinks 569 * follow the standard but since multiple plinks
@@ -625,10 +612,12 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
625 sta->llid = llid; 612 sta->llid = llid;
626 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); 613 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata));
627 spin_unlock_bh(&sta->lock); 614 spin_unlock_bh(&sta->lock);
628 mesh_plink_frame_tx(sdata, PLINK_OPEN, sta->sta.addr, llid, 615 mesh_plink_frame_tx(sdata,
629 0, 0); 616 WLAN_SP_MESH_PEERING_OPEN,
630 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, 617 sta->sta.addr, llid, 0, 0);
631 llid, plid, 0); 618 mesh_plink_frame_tx(sdata,
619 WLAN_SP_MESH_PEERING_CONFIRM,
620 sta->sta.addr, llid, plid, 0);
632 break; 621 break;
633 default: 622 default:
634 spin_unlock_bh(&sta->lock); 623 spin_unlock_bh(&sta->lock);
@@ -640,10 +629,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
640 switch (event) { 629 switch (event) {
641 case OPN_RJCT: 630 case OPN_RJCT:
642 case CNF_RJCT: 631 case CNF_RJCT:
643 reason = cpu_to_le16(MESH_CAPABILITY_POLICY_VIOLATION); 632 reason = cpu_to_le16(WLAN_REASON_MESH_CONFIG);
644 case CLS_ACPT: 633 case CLS_ACPT:
645 if (!reason) 634 if (!reason)
646 reason = cpu_to_le16(MESH_CLOSE_RCVD); 635 reason = cpu_to_le16(WLAN_REASON_MESH_CLOSE);
647 sta->reason = reason; 636 sta->reason = reason;
648 sta->plink_state = NL80211_PLINK_HOLDING; 637 sta->plink_state = NL80211_PLINK_HOLDING;
649 if (!mod_plink_timer(sta, 638 if (!mod_plink_timer(sta,
@@ -652,8 +641,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
652 641
653 llid = sta->llid; 642 llid = sta->llid;
654 spin_unlock_bh(&sta->lock); 643 spin_unlock_bh(&sta->lock);
655 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, 644 mesh_plink_frame_tx(sdata,
656 plid, reason); 645 WLAN_SP_MESH_PEERING_CLOSE,
646 sta->sta.addr, llid, plid, reason);
657 break; 647 break;
658 case OPN_ACPT: 648 case OPN_ACPT:
659 /* retry timer is left untouched */ 649 /* retry timer is left untouched */
@@ -661,8 +651,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
661 sta->plid = plid; 651 sta->plid = plid;
662 llid = sta->llid; 652 llid = sta->llid;
663 spin_unlock_bh(&sta->lock); 653 spin_unlock_bh(&sta->lock);
664 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid, 654 mesh_plink_frame_tx(sdata,
665 plid, 0); 655 WLAN_SP_MESH_PEERING_CONFIRM,
656 sta->sta.addr, llid, plid, 0);
666 break; 657 break;
667 case CNF_ACPT: 658 case CNF_ACPT:
668 sta->plink_state = NL80211_PLINK_CNF_RCVD; 659 sta->plink_state = NL80211_PLINK_CNF_RCVD;
@@ -682,10 +673,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
682 switch (event) { 673 switch (event) {
683 case OPN_RJCT: 674 case OPN_RJCT:
684 case CNF_RJCT: 675 case CNF_RJCT:
685 reason = cpu_to_le16(MESH_CAPABILITY_POLICY_VIOLATION); 676 reason = cpu_to_le16(WLAN_REASON_MESH_CONFIG);
686 case CLS_ACPT: 677 case CLS_ACPT:
687 if (!reason) 678 if (!reason)
688 reason = cpu_to_le16(MESH_CLOSE_RCVD); 679 reason = cpu_to_le16(WLAN_REASON_MESH_CLOSE);
689 sta->reason = reason; 680 sta->reason = reason;
690 sta->plink_state = NL80211_PLINK_HOLDING; 681 sta->plink_state = NL80211_PLINK_HOLDING;
691 if (!mod_plink_timer(sta, 682 if (!mod_plink_timer(sta,
@@ -694,14 +685,15 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
694 685
695 llid = sta->llid; 686 llid = sta->llid;
696 spin_unlock_bh(&sta->lock); 687 spin_unlock_bh(&sta->lock);
697 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, 688 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
698 plid, reason); 689 sta->sta.addr, llid, plid, reason);
699 break; 690 break;
700 case OPN_ACPT: 691 case OPN_ACPT:
701 llid = sta->llid; 692 llid = sta->llid;
702 spin_unlock_bh(&sta->lock); 693 spin_unlock_bh(&sta->lock);
703 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid, 694 mesh_plink_frame_tx(sdata,
704 plid, 0); 695 WLAN_SP_MESH_PEERING_CONFIRM,
696 sta->sta.addr, llid, plid, 0);
705 break; 697 break;
706 case CNF_ACPT: 698 case CNF_ACPT:
707 del_timer(&sta->plink_timer); 699 del_timer(&sta->plink_timer);
@@ -722,10 +714,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
722 switch (event) { 714 switch (event) {
723 case OPN_RJCT: 715 case OPN_RJCT:
724 case CNF_RJCT: 716 case CNF_RJCT:
725 reason = cpu_to_le16(MESH_CAPABILITY_POLICY_VIOLATION); 717 reason = cpu_to_le16(WLAN_REASON_MESH_CONFIG);
726 case CLS_ACPT: 718 case CLS_ACPT:
727 if (!reason) 719 if (!reason)
728 reason = cpu_to_le16(MESH_CLOSE_RCVD); 720 reason = cpu_to_le16(WLAN_REASON_MESH_CLOSE);
729 sta->reason = reason; 721 sta->reason = reason;
730 sta->plink_state = NL80211_PLINK_HOLDING; 722 sta->plink_state = NL80211_PLINK_HOLDING;
731 if (!mod_plink_timer(sta, 723 if (!mod_plink_timer(sta,
@@ -734,8 +726,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
734 726
735 llid = sta->llid; 727 llid = sta->llid;
736 spin_unlock_bh(&sta->lock); 728 spin_unlock_bh(&sta->lock);
737 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, 729 mesh_plink_frame_tx(sdata,
738 plid, reason); 730 WLAN_SP_MESH_PEERING_CLOSE,
731 sta->sta.addr, llid, plid, reason);
739 break; 732 break;
740 case OPN_ACPT: 733 case OPN_ACPT:
741 del_timer(&sta->plink_timer); 734 del_timer(&sta->plink_timer);
@@ -745,8 +738,9 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
745 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); 738 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
746 mpl_dbg("Mesh plink with %pM ESTABLISHED\n", 739 mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
747 sta->sta.addr); 740 sta->sta.addr);
748 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid, 741 mesh_plink_frame_tx(sdata,
749 plid, 0); 742 WLAN_SP_MESH_PEERING_CONFIRM,
743 sta->sta.addr, llid, plid, 0);
750 break; 744 break;
751 default: 745 default:
752 spin_unlock_bh(&sta->lock); 746 spin_unlock_bh(&sta->lock);
@@ -757,7 +751,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
757 case NL80211_PLINK_ESTAB: 751 case NL80211_PLINK_ESTAB:
758 switch (event) { 752 switch (event) {
759 case CLS_ACPT: 753 case CLS_ACPT:
760 reason = cpu_to_le16(MESH_CLOSE_RCVD); 754 reason = cpu_to_le16(WLAN_REASON_MESH_CLOSE);
761 sta->reason = reason; 755 sta->reason = reason;
762 deactivated = __mesh_plink_deactivate(sta); 756 deactivated = __mesh_plink_deactivate(sta);
763 sta->plink_state = NL80211_PLINK_HOLDING; 757 sta->plink_state = NL80211_PLINK_HOLDING;
@@ -766,14 +760,15 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
766 spin_unlock_bh(&sta->lock); 760 spin_unlock_bh(&sta->lock);
767 if (deactivated) 761 if (deactivated)
768 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); 762 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON);
769 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, 763 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
770 plid, reason); 764 sta->sta.addr, llid, plid, reason);
771 break; 765 break;
772 case OPN_ACPT: 766 case OPN_ACPT:
773 llid = sta->llid; 767 llid = sta->llid;
774 spin_unlock_bh(&sta->lock); 768 spin_unlock_bh(&sta->lock);
775 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid, 769 mesh_plink_frame_tx(sdata,
776 plid, 0); 770 WLAN_SP_MESH_PEERING_CONFIRM,
771 sta->sta.addr, llid, plid, 0);
777 break; 772 break;
778 default: 773 default:
779 spin_unlock_bh(&sta->lock); 774 spin_unlock_bh(&sta->lock);
@@ -795,8 +790,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
795 llid = sta->llid; 790 llid = sta->llid;
796 reason = sta->reason; 791 reason = sta->reason;
797 spin_unlock_bh(&sta->lock); 792 spin_unlock_bh(&sta->lock);
798 mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, 793 mesh_plink_frame_tx(sdata, WLAN_SP_MESH_PEERING_CLOSE,
799 llid, plid, reason); 794 sta->sta.addr, llid, plid, reason);
800 break; 795 break;
801 default: 796 default:
802 spin_unlock_bh(&sta->lock); 797 spin_unlock_bh(&sta->lock);