diff options
author | Javier Cardona <javier@cozybit.com> | 2011-05-13 13:45:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:10:49 -0400 |
commit | 57cf8043a64b56a10b9f194572548a3dfb62e596 (patch) | |
tree | a0b9530e824c7e7b1417e20f87e800819abfe285 /net/mac80211/mesh_plink.c | |
parent | 108697c44b8e50bea3505c6bf9667da4627cb2d5 (diff) |
nl80211: Move peer link state definition to nl80211
These definitions need to be exposed now that we can set the peer link
states via NL80211_ATTR_STA_PLINK_STATE. They were already being
(opaquely) reported by NL80211_STA_INFO_PLINK_STATE.
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 2c37bee3095a..f4adc0917888 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -83,7 +83,7 @@ void mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata) | |||
83 | */ | 83 | */ |
84 | static inline void mesh_plink_fsm_restart(struct sta_info *sta) | 84 | static inline void mesh_plink_fsm_restart(struct sta_info *sta) |
85 | { | 85 | { |
86 | sta->plink_state = PLINK_LISTEN; | 86 | sta->plink_state = NL80211_PLINK_LISTEN; |
87 | sta->llid = sta->plid = sta->reason = 0; | 87 | sta->llid = sta->plid = sta->reason = 0; |
88 | sta->plink_retries = 0; | 88 | sta->plink_retries = 0; |
89 | } | 89 | } |
@@ -126,11 +126,11 @@ static bool __mesh_plink_deactivate(struct sta_info *sta) | |||
126 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 126 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
127 | bool deactivated = false; | 127 | bool deactivated = false; |
128 | 128 | ||
129 | if (sta->plink_state == PLINK_ESTAB) { | 129 | if (sta->plink_state == NL80211_PLINK_ESTAB) { |
130 | mesh_plink_dec_estab_count(sdata); | 130 | mesh_plink_dec_estab_count(sdata); |
131 | deactivated = true; | 131 | deactivated = true; |
132 | } | 132 | } |
133 | sta->plink_state = PLINK_BLOCKED; | 133 | sta->plink_state = NL80211_PLINK_BLOCKED; |
134 | mesh_path_flush_by_nexthop(sta); | 134 | mesh_path_flush_by_nexthop(sta); |
135 | 135 | ||
136 | return deactivated; | 136 | return deactivated; |
@@ -268,7 +268,7 @@ void mesh_neighbour_update(u8 *hw_addr, u32 rates, | |||
268 | sta->last_rx = jiffies; | 268 | sta->last_rx = jiffies; |
269 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; | 269 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
270 | if (mesh_peer_accepts_plinks(elems) && | 270 | if (mesh_peer_accepts_plinks(elems) && |
271 | sta->plink_state == PLINK_LISTEN && | 271 | sta->plink_state == NL80211_PLINK_LISTEN && |
272 | sdata->u.mesh.accepting_plinks && | 272 | sdata->u.mesh.accepting_plinks && |
273 | sdata->u.mesh.mshcfg.auto_open_plinks) | 273 | sdata->u.mesh.mshcfg.auto_open_plinks) |
274 | mesh_plink_open(sta); | 274 | mesh_plink_open(sta); |
@@ -308,8 +308,8 @@ static void mesh_plink_timer(unsigned long data) | |||
308 | sdata = sta->sdata; | 308 | sdata = sta->sdata; |
309 | 309 | ||
310 | switch (sta->plink_state) { | 310 | switch (sta->plink_state) { |
311 | case PLINK_OPN_RCVD: | 311 | case NL80211_PLINK_OPN_RCVD: |
312 | case PLINK_OPN_SNT: | 312 | case NL80211_PLINK_OPN_SNT: |
313 | /* retry timer */ | 313 | /* retry timer */ |
314 | if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { | 314 | if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { |
315 | u32 rand; | 315 | u32 rand; |
@@ -328,17 +328,17 @@ static void mesh_plink_timer(unsigned long data) | |||
328 | } | 328 | } |
329 | reason = cpu_to_le16(MESH_MAX_RETRIES); | 329 | reason = cpu_to_le16(MESH_MAX_RETRIES); |
330 | /* fall through on else */ | 330 | /* fall through on else */ |
331 | case PLINK_CNF_RCVD: | 331 | case NL80211_PLINK_CNF_RCVD: |
332 | /* confirm timer */ | 332 | /* confirm timer */ |
333 | if (!reason) | 333 | if (!reason) |
334 | reason = cpu_to_le16(MESH_CONFIRM_TIMEOUT); | 334 | reason = cpu_to_le16(MESH_CONFIRM_TIMEOUT); |
335 | sta->plink_state = PLINK_HOLDING; | 335 | sta->plink_state = NL80211_PLINK_HOLDING; |
336 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | 336 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); |
337 | spin_unlock_bh(&sta->lock); | 337 | spin_unlock_bh(&sta->lock); |
338 | mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, plid, | 338 | mesh_plink_frame_tx(sdata, PLINK_CLOSE, sta->sta.addr, llid, plid, |
339 | reason); | 339 | reason); |
340 | break; | 340 | break; |
341 | case PLINK_HOLDING: | 341 | case NL80211_PLINK_HOLDING: |
342 | /* holding timer */ | 342 | /* holding timer */ |
343 | del_timer(&sta->plink_timer); | 343 | del_timer(&sta->plink_timer); |
344 | mesh_plink_fsm_restart(sta); | 344 | mesh_plink_fsm_restart(sta); |
@@ -386,11 +386,11 @@ int mesh_plink_open(struct sta_info *sta) | |||
386 | spin_lock_bh(&sta->lock); | 386 | spin_lock_bh(&sta->lock); |
387 | get_random_bytes(&llid, 2); | 387 | get_random_bytes(&llid, 2); |
388 | sta->llid = llid; | 388 | sta->llid = llid; |
389 | if (sta->plink_state != PLINK_LISTEN) { | 389 | if (sta->plink_state != NL80211_PLINK_LISTEN) { |
390 | spin_unlock_bh(&sta->lock); | 390 | spin_unlock_bh(&sta->lock); |
391 | return -EBUSY; | 391 | return -EBUSY; |
392 | } | 392 | } |
393 | sta->plink_state = PLINK_OPN_SNT; | 393 | sta->plink_state = NL80211_PLINK_OPN_SNT; |
394 | mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); | 394 | mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); |
395 | spin_unlock_bh(&sta->lock); | 395 | spin_unlock_bh(&sta->lock); |
396 | mpl_dbg("Mesh plink: starting establishment with %pM\n", | 396 | mpl_dbg("Mesh plink: starting establishment with %pM\n", |
@@ -407,7 +407,7 @@ void mesh_plink_block(struct sta_info *sta) | |||
407 | 407 | ||
408 | spin_lock_bh(&sta->lock); | 408 | spin_lock_bh(&sta->lock); |
409 | deactivated = __mesh_plink_deactivate(sta); | 409 | deactivated = __mesh_plink_deactivate(sta); |
410 | sta->plink_state = PLINK_BLOCKED; | 410 | sta->plink_state = NL80211_PLINK_BLOCKED; |
411 | spin_unlock_bh(&sta->lock); | 411 | spin_unlock_bh(&sta->lock); |
412 | 412 | ||
413 | if (deactivated) | 413 | if (deactivated) |
@@ -430,13 +430,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
430 | __le16 plid, llid, reason; | 430 | __le16 plid, llid, reason; |
431 | #ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG | 431 | #ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG |
432 | static const char *mplstates[] = { | 432 | static const char *mplstates[] = { |
433 | [PLINK_LISTEN] = "LISTEN", | 433 | [NL80211_PLINK_LISTEN] = "LISTEN", |
434 | [PLINK_OPN_SNT] = "OPN-SNT", | 434 | [NL80211_PLINK_OPN_SNT] = "OPN-SNT", |
435 | [PLINK_OPN_RCVD] = "OPN-RCVD", | 435 | [NL80211_PLINK_OPN_RCVD] = "OPN-RCVD", |
436 | [PLINK_CNF_RCVD] = "CNF_RCVD", | 436 | [NL80211_PLINK_CNF_RCVD] = "CNF_RCVD", |
437 | [PLINK_ESTAB] = "ESTAB", | 437 | [NL80211_PLINK_ESTAB] = "ESTAB", |
438 | [PLINK_HOLDING] = "HOLDING", | 438 | [NL80211_PLINK_HOLDING] = "HOLDING", |
439 | [PLINK_BLOCKED] = "BLOCKED" | 439 | [NL80211_PLINK_BLOCKED] = "BLOCKED" |
440 | }; | 440 | }; |
441 | #endif | 441 | #endif |
442 | 442 | ||
@@ -502,7 +502,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
502 | return; | 502 | return; |
503 | } | 503 | } |
504 | 504 | ||
505 | if (sta && sta->plink_state == PLINK_BLOCKED) { | 505 | if (sta && sta->plink_state == NL80211_PLINK_BLOCKED) { |
506 | rcu_read_unlock(); | 506 | rcu_read_unlock(); |
507 | return; | 507 | return; |
508 | } | 508 | } |
@@ -572,7 +572,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
572 | event = CNF_ACPT; | 572 | event = CNF_ACPT; |
573 | break; | 573 | break; |
574 | case PLINK_CLOSE: | 574 | case PLINK_CLOSE: |
575 | if (sta->plink_state == PLINK_ESTAB) | 575 | if (sta->plink_state == NL80211_PLINK_ESTAB) |
576 | /* Do not check for llid or plid. This does not | 576 | /* Do not check for llid or plid. This does not |
577 | * follow the standard but since multiple plinks | 577 | * follow the standard but since multiple plinks |
578 | * per sta are not supported, it is necessary in | 578 | * per sta are not supported, it is necessary in |
@@ -607,14 +607,14 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
607 | reason = 0; | 607 | reason = 0; |
608 | switch (sta->plink_state) { | 608 | switch (sta->plink_state) { |
609 | /* spin_unlock as soon as state is updated at each case */ | 609 | /* spin_unlock as soon as state is updated at each case */ |
610 | case PLINK_LISTEN: | 610 | case NL80211_PLINK_LISTEN: |
611 | switch (event) { | 611 | switch (event) { |
612 | case CLS_ACPT: | 612 | case CLS_ACPT: |
613 | mesh_plink_fsm_restart(sta); | 613 | mesh_plink_fsm_restart(sta); |
614 | spin_unlock_bh(&sta->lock); | 614 | spin_unlock_bh(&sta->lock); |
615 | break; | 615 | break; |
616 | case OPN_ACPT: | 616 | case OPN_ACPT: |
617 | sta->plink_state = PLINK_OPN_RCVD; | 617 | sta->plink_state = NL80211_PLINK_OPN_RCVD; |
618 | sta->plid = plid; | 618 | sta->plid = plid; |
619 | get_random_bytes(&llid, 2); | 619 | get_random_bytes(&llid, 2); |
620 | sta->llid = llid; | 620 | sta->llid = llid; |
@@ -631,7 +631,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
631 | } | 631 | } |
632 | break; | 632 | break; |
633 | 633 | ||
634 | case PLINK_OPN_SNT: | 634 | case NL80211_PLINK_OPN_SNT: |
635 | switch (event) { | 635 | switch (event) { |
636 | case OPN_RJCT: | 636 | case OPN_RJCT: |
637 | case CNF_RJCT: | 637 | case CNF_RJCT: |
@@ -640,7 +640,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
640 | if (!reason) | 640 | if (!reason) |
641 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 641 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
642 | sta->reason = reason; | 642 | sta->reason = reason; |
643 | sta->plink_state = PLINK_HOLDING; | 643 | sta->plink_state = NL80211_PLINK_HOLDING; |
644 | if (!mod_plink_timer(sta, | 644 | if (!mod_plink_timer(sta, |
645 | dot11MeshHoldingTimeout(sdata))) | 645 | dot11MeshHoldingTimeout(sdata))) |
646 | sta->ignore_plink_timer = true; | 646 | sta->ignore_plink_timer = true; |
@@ -652,7 +652,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
652 | break; | 652 | break; |
653 | case OPN_ACPT: | 653 | case OPN_ACPT: |
654 | /* retry timer is left untouched */ | 654 | /* retry timer is left untouched */ |
655 | sta->plink_state = PLINK_OPN_RCVD; | 655 | sta->plink_state = NL80211_PLINK_OPN_RCVD; |
656 | sta->plid = plid; | 656 | sta->plid = plid; |
657 | llid = sta->llid; | 657 | llid = sta->llid; |
658 | spin_unlock_bh(&sta->lock); | 658 | spin_unlock_bh(&sta->lock); |
@@ -660,7 +660,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
660 | plid, 0); | 660 | plid, 0); |
661 | break; | 661 | break; |
662 | case CNF_ACPT: | 662 | case CNF_ACPT: |
663 | sta->plink_state = PLINK_CNF_RCVD; | 663 | sta->plink_state = NL80211_PLINK_CNF_RCVD; |
664 | if (!mod_plink_timer(sta, | 664 | if (!mod_plink_timer(sta, |
665 | dot11MeshConfirmTimeout(sdata))) | 665 | dot11MeshConfirmTimeout(sdata))) |
666 | sta->ignore_plink_timer = true; | 666 | sta->ignore_plink_timer = true; |
@@ -673,7 +673,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
673 | } | 673 | } |
674 | break; | 674 | break; |
675 | 675 | ||
676 | case PLINK_OPN_RCVD: | 676 | case NL80211_PLINK_OPN_RCVD: |
677 | switch (event) { | 677 | switch (event) { |
678 | case OPN_RJCT: | 678 | case OPN_RJCT: |
679 | case CNF_RJCT: | 679 | case CNF_RJCT: |
@@ -682,7 +682,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
682 | if (!reason) | 682 | if (!reason) |
683 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 683 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
684 | sta->reason = reason; | 684 | sta->reason = reason; |
685 | sta->plink_state = PLINK_HOLDING; | 685 | sta->plink_state = NL80211_PLINK_HOLDING; |
686 | if (!mod_plink_timer(sta, | 686 | if (!mod_plink_timer(sta, |
687 | dot11MeshHoldingTimeout(sdata))) | 687 | dot11MeshHoldingTimeout(sdata))) |
688 | sta->ignore_plink_timer = true; | 688 | sta->ignore_plink_timer = true; |
@@ -700,7 +700,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
700 | break; | 700 | break; |
701 | case CNF_ACPT: | 701 | case CNF_ACPT: |
702 | del_timer(&sta->plink_timer); | 702 | del_timer(&sta->plink_timer); |
703 | sta->plink_state = PLINK_ESTAB; | 703 | sta->plink_state = NL80211_PLINK_ESTAB; |
704 | spin_unlock_bh(&sta->lock); | 704 | spin_unlock_bh(&sta->lock); |
705 | mesh_plink_inc_estab_count(sdata); | 705 | mesh_plink_inc_estab_count(sdata); |
706 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); | 706 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); |
@@ -713,7 +713,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
713 | } | 713 | } |
714 | break; | 714 | break; |
715 | 715 | ||
716 | case PLINK_CNF_RCVD: | 716 | case NL80211_PLINK_CNF_RCVD: |
717 | switch (event) { | 717 | switch (event) { |
718 | case OPN_RJCT: | 718 | case OPN_RJCT: |
719 | case CNF_RJCT: | 719 | case CNF_RJCT: |
@@ -722,7 +722,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
722 | if (!reason) | 722 | if (!reason) |
723 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 723 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
724 | sta->reason = reason; | 724 | sta->reason = reason; |
725 | sta->plink_state = PLINK_HOLDING; | 725 | sta->plink_state = NL80211_PLINK_HOLDING; |
726 | if (!mod_plink_timer(sta, | 726 | if (!mod_plink_timer(sta, |
727 | dot11MeshHoldingTimeout(sdata))) | 727 | dot11MeshHoldingTimeout(sdata))) |
728 | sta->ignore_plink_timer = true; | 728 | sta->ignore_plink_timer = true; |
@@ -734,7 +734,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
734 | break; | 734 | break; |
735 | case OPN_ACPT: | 735 | case OPN_ACPT: |
736 | del_timer(&sta->plink_timer); | 736 | del_timer(&sta->plink_timer); |
737 | sta->plink_state = PLINK_ESTAB; | 737 | sta->plink_state = NL80211_PLINK_ESTAB; |
738 | spin_unlock_bh(&sta->lock); | 738 | spin_unlock_bh(&sta->lock); |
739 | mesh_plink_inc_estab_count(sdata); | 739 | mesh_plink_inc_estab_count(sdata); |
740 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); | 740 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON); |
@@ -749,13 +749,13 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
749 | } | 749 | } |
750 | break; | 750 | break; |
751 | 751 | ||
752 | case PLINK_ESTAB: | 752 | case NL80211_PLINK_ESTAB: |
753 | switch (event) { | 753 | switch (event) { |
754 | case CLS_ACPT: | 754 | case CLS_ACPT: |
755 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 755 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
756 | sta->reason = reason; | 756 | sta->reason = reason; |
757 | deactivated = __mesh_plink_deactivate(sta); | 757 | deactivated = __mesh_plink_deactivate(sta); |
758 | sta->plink_state = PLINK_HOLDING; | 758 | sta->plink_state = NL80211_PLINK_HOLDING; |
759 | llid = sta->llid; | 759 | llid = sta->llid; |
760 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | 760 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); |
761 | spin_unlock_bh(&sta->lock); | 761 | spin_unlock_bh(&sta->lock); |
@@ -775,7 +775,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
775 | break; | 775 | break; |
776 | } | 776 | } |
777 | break; | 777 | break; |
778 | case PLINK_HOLDING: | 778 | case NL80211_PLINK_HOLDING: |
779 | switch (event) { | 779 | switch (event) { |
780 | case CLS_ACPT: | 780 | case CLS_ACPT: |
781 | if (del_timer(&sta->plink_timer)) | 781 | if (del_timer(&sta->plink_timer)) |