summaryrefslogtreecommitdiff
path: root/cesar/cp
diff options
context:
space:
mode:
authorDavid Mercadie2011-04-19 17:01:26 +0200
committerDavid Mercadie2011-04-20 16:51:04 +0200
commitc4a12659fce42396fe678692a9ca39f547c4f33c (patch)
treec9aecb3f4ed66b9b896d923fb1cdfb3e720ad002 /cesar/cp
parent6b9929375615e9fdce145df6ccdd8558e5099db4 (diff)
cesar/cp/{fsm, cco/action}: patch merge avln
This commit add an event raised while merging two avlns; this event make the power fsm change from state CCO to USTA.
Diffstat (limited to 'cesar/cp')
-rw-r--r--cesar/cp/cco/action/src/cco_action.c2
-rw-r--r--cesar/cp/cco/action/test/utest/inc/scenario_defs.h4
-rw-r--r--cesar/cp/cco/action/test/utest/src/assoc.c6
-rw-r--r--cesar/cp/cco/action/test/utest/src/scenario_actions.c6
-rw-r--r--cesar/cp/fsm/src/fsm/cp.fsm3
5 files changed, 18 insertions, 3 deletions
diff --git a/cesar/cp/cco/action/src/cco_action.c b/cesar/cp/cco/action/src/cco_action.c
index 63644e77d8..ffef623ae7 100644
--- a/cesar/cp/cco/action/src/cco_action.c
+++ b/cesar/cp/cco/action/src/cco_action.c
@@ -1539,5 +1539,5 @@ cp_cco_action_beacon_with_same_nid (
/* To merge the two avlns we shut our network by turning the cco into
* an unassociated sta. */
- cp_cco_action_cco__unassoc_stop (ctx);
+ cp_fsm_post_new_event (ctx, bare, cco_leave_merge_avln);
}
diff --git a/cesar/cp/cco/action/test/utest/inc/scenario_defs.h b/cesar/cp/cco/action/test/utest/inc/scenario_defs.h
index f5f16657a7..d9db841b57 100644
--- a/cesar/cp/cco/action/test/utest/inc/scenario_defs.h
+++ b/cesar/cp/cco/action/test/utest/inc/scenario_defs.h
@@ -59,7 +59,8 @@
cco__unassoc_stop, \
cco__assoc_start, \
cco__assoc_stop, \
- BEACON_WITH_SAME_NID
+ BEACON_WITH_SAME_NID, \
+ cco_leave_merge_avln
/* Actions without parameter. */
#define __0(action) \
@@ -120,6 +121,7 @@ __0 (cco__unassoc_stop)
__0 (cco__assoc_start)
__0 (cco__assoc_stop)
__n (BEACON_WITH_SAME_NID, bsu_beacon_t *beacon, cp_net_t *net, cp_sta_t *sta)
+__0 (cco_leave_merge_avln)
#undef __0
#undef __n
diff --git a/cesar/cp/cco/action/test/utest/src/assoc.c b/cesar/cp/cco/action/test/utest/src/assoc.c
index 0e229e19f3..456241d6e4 100644
--- a/cesar/cp/cco/action/test/utest/src/assoc.c
+++ b/cesar/cp/cco/action/test/utest/src/assoc.c
@@ -424,6 +424,9 @@ assoc_test_case_beacon_with_same_nid (test_t t)
SCENARIO_ACTION (BEACON_WITH_SAME_NID, .beacon = beacon, .net = net,
.sta = NULL),
SCENARIO_EVENT (cp_fsm_event_bare_new,
+ .type = CP_FSM_EVENT_TYPE_cco_leave_merge_avln),
+ SCENARIO_ACTION (cco_leave_merge_avln),
+ SCENARIO_EVENT (cp_fsm_event_bare_new,
.type = CP_FSM_EVENT_TYPE_sta_status_changed),
SCENARIO_EVENT (cp_beacon_discover_uninit),
SCENARIO_EVENT (cp_fsm_event_bare_new,
@@ -457,6 +460,9 @@ assoc_test_case_beacon_with_same_nid (test_t t)
SCENARIO_ACTION (BEACON_WITH_SAME_NID, .beacon = beacon, .net = net,
.sta = NULL),
SCENARIO_EVENT (cp_fsm_event_bare_new,
+ .type = CP_FSM_EVENT_TYPE_cco_leave_merge_avln),
+ SCENARIO_ACTION (cco_leave_merge_avln),
+ SCENARIO_EVENT (cp_fsm_event_bare_new,
.type = CP_FSM_EVENT_TYPE_sta_status_changed),
SCENARIO_EVENT (cp_beacon_discover_uninit),
SCENARIO_EVENT (cp_fsm_event_bare_new,
diff --git a/cesar/cp/cco/action/test/utest/src/scenario_actions.c b/cesar/cp/cco/action/test/utest/src/scenario_actions.c
index 1f3edc27d2..edfeb88e34 100644
--- a/cesar/cp/cco/action/test/utest/src/scenario_actions.c
+++ b/cesar/cp/cco/action/test/utest/src/scenario_actions.c
@@ -109,3 +109,9 @@ scenario_action_BEACON_WITH_SAME_NID_cb (scenario_globals_t *globals,
cp_cco_action_beacon_with_same_nid (globals->cp, p->beacon, p->net, p->sta);
}
+void
+scenario_action_cco_leave_merge_avln_cb (scenario_globals_t *globals,
+ scenario_params_t *params)
+{
+ cp_cco_action_cco__unassoc_stop (globals->cp);
+}
diff --git a/cesar/cp/fsm/src/fsm/cp.fsm b/cesar/cp/fsm/src/fsm/cp.fsm
index 2f5fc78be2..498921c91a 100644
--- a/cesar/cp/fsm/src/fsm/cp.fsm
+++ b/cesar/cp/fsm/src/fsm/cp.fsm
@@ -153,6 +153,7 @@ Events:
cco__all_sta_leaved
cco__snid_conflict
cco__nek_change
+ cco_leave_merge_avln
cco_nek_change__nek_provide
cco_nek_change__nek_timeout
@@ -469,7 +470,6 @@ UCCO:
BEACON_TIMER_EXPIRES -> . [cp_beacon_cco_update_beacon_data]
BEACON: nid match -> USTA_JOINING [cp_sta_action_poweron__ucco__beacon]
BEACON: no nid match -> USTA
- BEACON_WITH_SAME_NID -> USTA [cp_cco_action_ucco_stop]
to_stop -> USTA [cp_cco_action_ucco__to_stop]
CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]
@@ -527,6 +527,7 @@ CCO:
cco__nek_change -> . [cp_cco_action_cco__cco_nek_change]
cco__snid_conflict -> . [cp_cco_action_cco__cco_snid_conflict]
+ cco_leave_merge_avln -> USTA [cp_cco_action_cco__unassoc_stop]
CC_WHO_RU_REQ -> . [cp_sta_action_process_cc_who_ru_req]
CC_ASSOC_REQ -> . [cp_cco_action_cco__cc_assoc_req]