diff options
author | Luis Carlos Cobo <luisca@cozybit.com> | 2008-02-29 18:46:08 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-03-06 16:40:52 -0500 |
commit | b4e08ea141e6d663dec31b31d6289baeaaa2a3a2 (patch) | |
tree | f6ca4b30e480f803f5f83c2d60e0df29fb2177ea /net | |
parent | cfa22c716f65b4d286a68aeacee4a7361a4035e6 (diff) |
mac80211: add PLINK_ prefix and kernel doc to enum plink_state
Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/mesh.c | 6 | ||||
-rw-r--r-- | net/mac80211/mesh_pathtbl.c | 6 | ||||
-rw-r--r-- | net/mac80211/mesh_plink.c | 69 | ||||
-rw-r--r-- | net/mac80211/rx.c | 2 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 2 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 31 |
6 files changed, 65 insertions, 51 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 54d5ced566e..594a3356a50 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -91,9 +91,9 @@ void mesh_accept_plinks_update(struct ieee80211_sub_if_data *sdata) | |||
91 | 91 | ||
92 | /* In case mesh_plink_free_count > 0 and mesh_plinktbl_capacity == 0, | 92 | /* In case mesh_plink_free_count > 0 and mesh_plinktbl_capacity == 0, |
93 | * the mesh interface might be able to establish plinks with peers that | 93 | * the mesh interface might be able to establish plinks with peers that |
94 | * are already on the table but are not on ESTAB state. However, in | 94 | * are already on the table but are not on PLINK_ESTAB state. However, |
95 | * general the mesh interface is not accepting peer link requests from | 95 | * in general the mesh interface is not accepting peer link requests |
96 | * new peers, and that must be reflected in the beacon | 96 | * from new peers, and that must be reflected in the beacon |
97 | */ | 97 | */ |
98 | free_plinks = mesh_plink_availables(sdata); | 98 | free_plinks = mesh_plink_availables(sdata); |
99 | 99 | ||
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index f74e4ce40ec..135022d7ee5 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c | |||
@@ -261,9 +261,9 @@ EXPORT_SYMBOL(mesh_plink_broken); | |||
261 | * | 261 | * |
262 | * @sta - mesh peer to match | 262 | * @sta - mesh peer to match |
263 | * | 263 | * |
264 | * RCU notes: this function is called when a mesh plink transitions from ESTAB | 264 | * RCU notes: this function is called when a mesh plink transitions from |
265 | * to any other state, since ESTAB state is the only one that allows path | 265 | * PLINK_ESTAB to any other state, since PLINK_ESTAB state is the only one that |
266 | * creation. This will happen before the sta can be freed (because | 266 | * allows path creation. This will happen before the sta can be freed (because |
267 | * sta_info_destroy() calls this) so any reader in a rcu read block will be | 267 | * sta_info_destroy() calls this) so any reader in a rcu read block will be |
268 | * protected against the plink disappearing. | 268 | * protected against the plink disappearing. |
269 | */ | 269 | */ |
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 23d951a8366..18fe52436c4 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -84,7 +84,7 @@ void mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata) | |||
84 | */ | 84 | */ |
85 | static inline void mesh_plink_fsm_restart(struct sta_info *sta) | 85 | static inline void mesh_plink_fsm_restart(struct sta_info *sta) |
86 | { | 86 | { |
87 | sta->plink_state = LISTEN; | 87 | sta->plink_state = PLINK_LISTEN; |
88 | sta->llid = sta->plid = sta->reason = 0; | 88 | sta->llid = sta->plid = sta->reason = 0; |
89 | sta->plink_retries = 0; | 89 | sta->plink_retries = 0; |
90 | } | 90 | } |
@@ -121,9 +121,9 @@ static void __mesh_plink_deactivate(struct sta_info *sta) | |||
121 | { | 121 | { |
122 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 122 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
123 | 123 | ||
124 | if (sta->plink_state == ESTAB) | 124 | if (sta->plink_state == PLINK_ESTAB) |
125 | mesh_plink_dec_estab_count(sdata); | 125 | mesh_plink_dec_estab_count(sdata); |
126 | sta->plink_state = BLOCKED; | 126 | sta->plink_state = PLINK_BLOCKED; |
127 | mesh_path_flush_by_nexthop(sta); | 127 | mesh_path_flush_by_nexthop(sta); |
128 | } | 128 | } |
129 | 129 | ||
@@ -243,7 +243,7 @@ void mesh_neighbour_update(u8 *hw_addr, u64 rates, struct net_device *dev, | |||
243 | 243 | ||
244 | sta->last_rx = jiffies; | 244 | sta->last_rx = jiffies; |
245 | sta->supp_rates[local->hw.conf.channel->band] = rates; | 245 | sta->supp_rates[local->hw.conf.channel->band] = rates; |
246 | if (peer_accepting_plinks && sta->plink_state == LISTEN && | 246 | if (peer_accepting_plinks && sta->plink_state == PLINK_LISTEN && |
247 | sdata->u.sta.accepting_plinks && | 247 | sdata->u.sta.accepting_plinks && |
248 | sdata->u.sta.mshcfg.auto_open_plinks) | 248 | sdata->u.sta.mshcfg.auto_open_plinks) |
249 | mesh_plink_open(sta); | 249 | mesh_plink_open(sta); |
@@ -283,8 +283,8 @@ static void mesh_plink_timer(unsigned long data) | |||
283 | dev = sdata->dev; | 283 | dev = sdata->dev; |
284 | 284 | ||
285 | switch (sta->plink_state) { | 285 | switch (sta->plink_state) { |
286 | case OPN_RCVD: | 286 | case PLINK_OPN_RCVD: |
287 | case OPN_SNT: | 287 | case PLINK_OPN_SNT: |
288 | /* retry timer */ | 288 | /* retry timer */ |
289 | if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { | 289 | if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { |
290 | u32 rand; | 290 | u32 rand; |
@@ -303,17 +303,17 @@ static void mesh_plink_timer(unsigned long data) | |||
303 | } | 303 | } |
304 | reason = cpu_to_le16(MESH_MAX_RETRIES); | 304 | reason = cpu_to_le16(MESH_MAX_RETRIES); |
305 | /* fall through on else */ | 305 | /* fall through on else */ |
306 | case CNF_RCVD: | 306 | case PLINK_CNF_RCVD: |
307 | /* confirm timer */ | 307 | /* confirm timer */ |
308 | if (!reason) | 308 | if (!reason) |
309 | reason = cpu_to_le16(MESH_CONFIRM_TIMEOUT); | 309 | reason = cpu_to_le16(MESH_CONFIRM_TIMEOUT); |
310 | sta->plink_state = HOLDING; | 310 | sta->plink_state = PLINK_HOLDING; |
311 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | 311 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); |
312 | spin_unlock_bh(&sta->plink_lock); | 312 | spin_unlock_bh(&sta->plink_lock); |
313 | mesh_plink_frame_tx(dev, PLINK_CLOSE, sta->addr, llid, plid, | 313 | mesh_plink_frame_tx(dev, PLINK_CLOSE, sta->addr, llid, plid, |
314 | reason); | 314 | reason); |
315 | break; | 315 | break; |
316 | case HOLDING: | 316 | case PLINK_HOLDING: |
317 | /* holding timer */ | 317 | /* holding timer */ |
318 | del_timer(&sta->plink_timer); | 318 | del_timer(&sta->plink_timer); |
319 | mesh_plink_fsm_restart(sta); | 319 | mesh_plink_fsm_restart(sta); |
@@ -345,11 +345,11 @@ int mesh_plink_open(struct sta_info *sta) | |||
345 | spin_lock_bh(&sta->plink_lock); | 345 | spin_lock_bh(&sta->plink_lock); |
346 | get_random_bytes(&llid, 2); | 346 | get_random_bytes(&llid, 2); |
347 | sta->llid = llid; | 347 | sta->llid = llid; |
348 | if (sta->plink_state != LISTEN) { | 348 | if (sta->plink_state != PLINK_LISTEN) { |
349 | spin_unlock_bh(&sta->plink_lock); | 349 | spin_unlock_bh(&sta->plink_lock); |
350 | return -EBUSY; | 350 | return -EBUSY; |
351 | } | 351 | } |
352 | sta->plink_state = OPN_SNT; | 352 | sta->plink_state = PLINK_OPN_SNT; |
353 | mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); | 353 | mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); |
354 | spin_unlock_bh(&sta->plink_lock); | 354 | spin_unlock_bh(&sta->plink_lock); |
355 | mpl_dbg("Mesh plink: starting establishment with %s\n", | 355 | mpl_dbg("Mesh plink: starting establishment with %s\n", |
@@ -367,7 +367,7 @@ void mesh_plink_block(struct sta_info *sta) | |||
367 | 367 | ||
368 | spin_lock_bh(&sta->plink_lock); | 368 | spin_lock_bh(&sta->plink_lock); |
369 | __mesh_plink_deactivate(sta); | 369 | __mesh_plink_deactivate(sta); |
370 | sta->plink_state = BLOCKED; | 370 | sta->plink_state = PLINK_BLOCKED; |
371 | spin_unlock_bh(&sta->plink_lock); | 371 | spin_unlock_bh(&sta->plink_lock); |
372 | } | 372 | } |
373 | 373 | ||
@@ -385,18 +385,19 @@ int mesh_plink_close(struct sta_info *sta) | |||
385 | sta->reason = cpu_to_le16(MESH_LINK_CANCELLED); | 385 | sta->reason = cpu_to_le16(MESH_LINK_CANCELLED); |
386 | reason = sta->reason; | 386 | reason = sta->reason; |
387 | 387 | ||
388 | if (sta->plink_state == LISTEN || sta->plink_state == BLOCKED) { | 388 | if (sta->plink_state == PLINK_LISTEN || |
389 | sta->plink_state == PLINK_BLOCKED) { | ||
389 | mesh_plink_fsm_restart(sta); | 390 | mesh_plink_fsm_restart(sta); |
390 | spin_unlock_bh(&sta->plink_lock); | 391 | spin_unlock_bh(&sta->plink_lock); |
391 | return 0; | 392 | return 0; |
392 | } else if (sta->plink_state == ESTAB) { | 393 | } else if (sta->plink_state == PLINK_ESTAB) { |
393 | __mesh_plink_deactivate(sta); | 394 | __mesh_plink_deactivate(sta); |
394 | /* The timer should not be running */ | 395 | /* The timer should not be running */ |
395 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | 396 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); |
396 | } else if (!mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata))) | 397 | } else if (!mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata))) |
397 | sta->ignore_plink_timer = true; | 398 | sta->ignore_plink_timer = true; |
398 | 399 | ||
399 | sta->plink_state = HOLDING; | 400 | sta->plink_state = PLINK_HOLDING; |
400 | llid = sta->llid; | 401 | llid = sta->llid; |
401 | plid = sta->plid; | 402 | plid = sta->plid; |
402 | spin_unlock_bh(&sta->plink_lock); | 403 | spin_unlock_bh(&sta->plink_lock); |
@@ -468,7 +469,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
468 | return; | 469 | return; |
469 | } | 470 | } |
470 | 471 | ||
471 | if (sta && sta->plink_state == BLOCKED) { | 472 | if (sta && sta->plink_state == PLINK_BLOCKED) { |
472 | rcu_read_unlock(); | 473 | rcu_read_unlock(); |
473 | return; | 474 | return; |
474 | } | 475 | } |
@@ -529,7 +530,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
529 | event = CNF_ACPT; | 530 | event = CNF_ACPT; |
530 | break; | 531 | break; |
531 | case PLINK_CLOSE: | 532 | case PLINK_CLOSE: |
532 | if (sta->plink_state == ESTAB) | 533 | if (sta->plink_state == PLINK_ESTAB) |
533 | /* Do not check for llid or plid. This does not | 534 | /* Do not check for llid or plid. This does not |
534 | * follow the standard but since multiple plinks | 535 | * follow the standard but since multiple plinks |
535 | * per sta are not supported, it is necessary in | 536 | * per sta are not supported, it is necessary in |
@@ -562,14 +563,14 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
562 | reason = 0; | 563 | reason = 0; |
563 | switch (sta->plink_state) { | 564 | switch (sta->plink_state) { |
564 | /* spin_unlock as soon as state is updated at each case */ | 565 | /* spin_unlock as soon as state is updated at each case */ |
565 | case LISTEN: | 566 | case PLINK_LISTEN: |
566 | switch (event) { | 567 | switch (event) { |
567 | case CLS_ACPT: | 568 | case CLS_ACPT: |
568 | mesh_plink_fsm_restart(sta); | 569 | mesh_plink_fsm_restart(sta); |
569 | spin_unlock_bh(&sta->plink_lock); | 570 | spin_unlock_bh(&sta->plink_lock); |
570 | break; | 571 | break; |
571 | case OPN_ACPT: | 572 | case OPN_ACPT: |
572 | sta->plink_state = OPN_RCVD; | 573 | sta->plink_state = PLINK_OPN_RCVD; |
573 | sta->plid = plid; | 574 | sta->plid = plid; |
574 | get_random_bytes(&llid, 2); | 575 | get_random_bytes(&llid, 2); |
575 | sta->llid = llid; | 576 | sta->llid = llid; |
@@ -586,7 +587,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
586 | } | 587 | } |
587 | break; | 588 | break; |
588 | 589 | ||
589 | case OPN_SNT: | 590 | case PLINK_OPN_SNT: |
590 | switch (event) { | 591 | switch (event) { |
591 | case OPN_RJCT: | 592 | case OPN_RJCT: |
592 | case CNF_RJCT: | 593 | case CNF_RJCT: |
@@ -595,7 +596,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
595 | if (!reason) | 596 | if (!reason) |
596 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 597 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
597 | sta->reason = reason; | 598 | sta->reason = reason; |
598 | sta->plink_state = HOLDING; | 599 | sta->plink_state = PLINK_HOLDING; |
599 | if (!mod_plink_timer(sta, | 600 | if (!mod_plink_timer(sta, |
600 | dot11MeshHoldingTimeout(sdata))) | 601 | dot11MeshHoldingTimeout(sdata))) |
601 | sta->ignore_plink_timer = true; | 602 | sta->ignore_plink_timer = true; |
@@ -607,7 +608,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
607 | break; | 608 | break; |
608 | case OPN_ACPT: | 609 | case OPN_ACPT: |
609 | /* retry timer is left untouched */ | 610 | /* retry timer is left untouched */ |
610 | sta->plink_state = OPN_RCVD; | 611 | sta->plink_state = PLINK_OPN_RCVD; |
611 | sta->plid = plid; | 612 | sta->plid = plid; |
612 | llid = sta->llid; | 613 | llid = sta->llid; |
613 | spin_unlock_bh(&sta->plink_lock); | 614 | spin_unlock_bh(&sta->plink_lock); |
@@ -615,7 +616,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
615 | plid, 0); | 616 | plid, 0); |
616 | break; | 617 | break; |
617 | case CNF_ACPT: | 618 | case CNF_ACPT: |
618 | sta->plink_state = CNF_RCVD; | 619 | sta->plink_state = PLINK_CNF_RCVD; |
619 | if (!mod_plink_timer(sta, | 620 | if (!mod_plink_timer(sta, |
620 | dot11MeshConfirmTimeout(sdata))) | 621 | dot11MeshConfirmTimeout(sdata))) |
621 | sta->ignore_plink_timer = true; | 622 | sta->ignore_plink_timer = true; |
@@ -628,7 +629,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
628 | } | 629 | } |
629 | break; | 630 | break; |
630 | 631 | ||
631 | case OPN_RCVD: | 632 | case PLINK_OPN_RCVD: |
632 | switch (event) { | 633 | switch (event) { |
633 | case OPN_RJCT: | 634 | case OPN_RJCT: |
634 | case CNF_RJCT: | 635 | case CNF_RJCT: |
@@ -637,7 +638,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
637 | if (!reason) | 638 | if (!reason) |
638 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 639 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
639 | sta->reason = reason; | 640 | sta->reason = reason; |
640 | sta->plink_state = HOLDING; | 641 | sta->plink_state = PLINK_HOLDING; |
641 | if (!mod_plink_timer(sta, | 642 | if (!mod_plink_timer(sta, |
642 | dot11MeshHoldingTimeout(sdata))) | 643 | dot11MeshHoldingTimeout(sdata))) |
643 | sta->ignore_plink_timer = true; | 644 | sta->ignore_plink_timer = true; |
@@ -655,7 +656,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
655 | break; | 656 | break; |
656 | case CNF_ACPT: | 657 | case CNF_ACPT: |
657 | del_timer(&sta->plink_timer); | 658 | del_timer(&sta->plink_timer); |
658 | sta->plink_state = ESTAB; | 659 | sta->plink_state = PLINK_ESTAB; |
659 | mesh_plink_inc_estab_count(sdata); | 660 | mesh_plink_inc_estab_count(sdata); |
660 | spin_unlock_bh(&sta->plink_lock); | 661 | spin_unlock_bh(&sta->plink_lock); |
661 | mpl_dbg("Mesh plink with %s ESTABLISHED\n", | 662 | mpl_dbg("Mesh plink with %s ESTABLISHED\n", |
@@ -667,7 +668,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
667 | } | 668 | } |
668 | break; | 669 | break; |
669 | 670 | ||
670 | case CNF_RCVD: | 671 | case PLINK_CNF_RCVD: |
671 | switch (event) { | 672 | switch (event) { |
672 | case OPN_RJCT: | 673 | case OPN_RJCT: |
673 | case CNF_RJCT: | 674 | case CNF_RJCT: |
@@ -676,7 +677,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
676 | if (!reason) | 677 | if (!reason) |
677 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 678 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
678 | sta->reason = reason; | 679 | sta->reason = reason; |
679 | sta->plink_state = HOLDING; | 680 | sta->plink_state = PLINK_HOLDING; |
680 | if (!mod_plink_timer(sta, | 681 | if (!mod_plink_timer(sta, |
681 | dot11MeshHoldingTimeout(sdata))) | 682 | dot11MeshHoldingTimeout(sdata))) |
682 | sta->ignore_plink_timer = true; | 683 | sta->ignore_plink_timer = true; |
@@ -688,7 +689,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
688 | break; | 689 | break; |
689 | case OPN_ACPT: | 690 | case OPN_ACPT: |
690 | del_timer(&sta->plink_timer); | 691 | del_timer(&sta->plink_timer); |
691 | sta->plink_state = ESTAB; | 692 | sta->plink_state = PLINK_ESTAB; |
692 | mesh_plink_inc_estab_count(sdata); | 693 | mesh_plink_inc_estab_count(sdata); |
693 | spin_unlock_bh(&sta->plink_lock); | 694 | spin_unlock_bh(&sta->plink_lock); |
694 | mpl_dbg("Mesh plink with %s ESTABLISHED\n", | 695 | mpl_dbg("Mesh plink with %s ESTABLISHED\n", |
@@ -702,13 +703,13 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
702 | } | 703 | } |
703 | break; | 704 | break; |
704 | 705 | ||
705 | case ESTAB: | 706 | case PLINK_ESTAB: |
706 | switch (event) { | 707 | switch (event) { |
707 | case CLS_ACPT: | 708 | case CLS_ACPT: |
708 | reason = cpu_to_le16(MESH_CLOSE_RCVD); | 709 | reason = cpu_to_le16(MESH_CLOSE_RCVD); |
709 | sta->reason = reason; | 710 | sta->reason = reason; |
710 | __mesh_plink_deactivate(sta); | 711 | __mesh_plink_deactivate(sta); |
711 | sta->plink_state = HOLDING; | 712 | sta->plink_state = PLINK_HOLDING; |
712 | llid = sta->llid; | 713 | llid = sta->llid; |
713 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); | 714 | mod_plink_timer(sta, dot11MeshHoldingTimeout(sdata)); |
714 | spin_unlock_bh(&sta->plink_lock); | 715 | spin_unlock_bh(&sta->plink_lock); |
@@ -726,7 +727,7 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
726 | break; | 727 | break; |
727 | } | 728 | } |
728 | break; | 729 | break; |
729 | case HOLDING: | 730 | case PLINK_HOLDING: |
730 | switch (event) { | 731 | switch (event) { |
731 | case CLS_ACPT: | 732 | case CLS_ACPT: |
732 | if (del_timer(&sta->plink_timer)) | 733 | if (del_timer(&sta->plink_timer)) |
@@ -749,8 +750,8 @@ void mesh_rx_plink_frame(struct net_device *dev, struct ieee80211_mgmt *mgmt, | |||
749 | } | 750 | } |
750 | break; | 751 | break; |
751 | default: | 752 | default: |
752 | /* should not get here, BLOCKED is dealt with at the beggining | 753 | /* should not get here, PLINK_BLOCKED is dealt with at the |
753 | * of the function | 754 | * beggining of the function |
754 | */ | 755 | */ |
755 | spin_unlock_bh(&sta->plink_lock); | 756 | spin_unlock_bh(&sta->plink_lock); |
756 | break; | 757 | break; |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 8e1e2859bfd..644d2774469 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -411,7 +411,7 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) | |||
411 | * establisment frame, beacon or probe, drop the frame. | 411 | * establisment frame, beacon or probe, drop the frame. |
412 | */ | 412 | */ |
413 | 413 | ||
414 | if (!rx->sta || sta_plink_state(rx->sta) != ESTAB) { | 414 | if (!rx->sta || sta_plink_state(rx->sta) != PLINK_ESTAB) { |
415 | struct ieee80211_mgmt *mgmt; | 415 | struct ieee80211_mgmt *mgmt; |
416 | 416 | ||
417 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) | 417 | if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_MGMT) |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 909fa38edb6..e27f896dae5 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -248,7 +248,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, | |||
248 | #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ | 248 | #endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ |
249 | 249 | ||
250 | #ifdef CONFIG_MAC80211_MESH | 250 | #ifdef CONFIG_MAC80211_MESH |
251 | sta->plink_state = LISTEN; | 251 | sta->plink_state = PLINK_LISTEN; |
252 | spin_lock_init(&sta->plink_lock); | 252 | spin_lock_init(&sta->plink_lock); |
253 | init_timer(&sta->plink_timer); | 253 | init_timer(&sta->plink_timer); |
254 | #endif | 254 | #endif |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 547bfc3b243..f166c8039f2 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -106,14 +106,27 @@ struct tid_ampdu_rx { | |||
106 | struct timer_list session_timer; | 106 | struct timer_list session_timer; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | /** | ||
110 | * enum plink_state - state of a mesh peer link finite state machine | ||
111 | * | ||
112 | * @PLINK_LISTEN: initial state, considered the implicit state of non existant | ||
113 | * mesh peer links | ||
114 | * @PLINK_OPN_SNT: mesh plink open frame has been sent to this mesh peer | ||
115 | * @PLINK_OPN_RCVD: mesh plink open frame has been received from this mesh peer | ||
116 | * @PLINK_CNF_RCVD: mesh plink confirm frame has been received from this mesh | ||
117 | * peer | ||
118 | * @PLINK_ESTAB: mesh peer link is established | ||
119 | * @PLINK_HOLDING: mesh peer link is being closed or cancelled | ||
120 | * @PLINK_BLOCKED: all frames transmitted from this mesh plink are discarded | ||
121 | */ | ||
109 | enum plink_state { | 122 | enum plink_state { |
110 | LISTEN, | 123 | PLINK_LISTEN, |
111 | OPN_SNT, | 124 | PLINK_OPN_SNT, |
112 | OPN_RCVD, | 125 | PLINK_OPN_RCVD, |
113 | CNF_RCVD, | 126 | PLINK_CNF_RCVD, |
114 | ESTAB, | 127 | PLINK_ESTAB, |
115 | HOLDING, | 128 | PLINK_HOLDING, |
116 | BLOCKED | 129 | PLINK_BLOCKED |
117 | }; | 130 | }; |
118 | 131 | ||
119 | /** | 132 | /** |
@@ -248,7 +261,7 @@ struct sta_info { | |||
248 | */ | 261 | */ |
249 | __le16 llid; /* Local link ID */ | 262 | __le16 llid; /* Local link ID */ |
250 | __le16 plid; /* Peer link ID */ | 263 | __le16 plid; /* Peer link ID */ |
251 | __le16 reason; /* Buffer for cancel reason on HOLDING state */ | 264 | __le16 reason; /* Cancel reason on PLINK_HOLDING state */ |
252 | u8 plink_retries; /* Retries in establishment */ | 265 | u8 plink_retries; /* Retries in establishment */ |
253 | bool ignore_plink_timer; | 266 | bool ignore_plink_timer; |
254 | enum plink_state plink_state; | 267 | enum plink_state plink_state; |
@@ -280,7 +293,7 @@ static inline enum plink_state sta_plink_state(struct sta_info *sta) | |||
280 | #ifdef CONFIG_MAC80211_MESH | 293 | #ifdef CONFIG_MAC80211_MESH |
281 | return sta->plink_state; | 294 | return sta->plink_state; |
282 | #endif | 295 | #endif |
283 | return LISTEN; | 296 | return PLINK_LISTEN; |
284 | } | 297 | } |
285 | 298 | ||
286 | 299 | ||