summaryrefslogtreecommitdiff
path: root/cesar/cp/cco/action
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/cp/cco/action')
-rw-r--r--cesar/cp/cco/action/cco_action.h7
-rw-r--r--cesar/cp/cco/action/inc/cco_action.h7
-rw-r--r--cesar/cp/cco/action/src/cco_action.c5
-rw-r--r--cesar/cp/cco/action/src/handover.c9
4 files changed, 17 insertions, 11 deletions
diff --git a/cesar/cp/cco/action/cco_action.h b/cesar/cp/cco/action/cco_action.h
index acc085c6c9..b1dcb9313e 100644
--- a/cesar/cp/cco/action/cco_action.h
+++ b/cesar/cp/cco/action/cco_action.h
@@ -261,6 +261,13 @@ void
cp_cco_action_cco_selection__mac_stop_sta_add (cp_t *ctx, cp_sta_t *sta);
/**
+ * Clear the selection context.
+ * \param ctx the module context.
+ */
+void
+cp_cco_action_cco_selection__clear (cp_t *ctx);
+
+/**
* Add a station to the CCo selection procedure.
* \param ctx the module context.
* \param net the station's NET.
diff --git a/cesar/cp/cco/action/inc/cco_action.h b/cesar/cp/cco/action/inc/cco_action.h
index d960a533cd..35efccba91 100644
--- a/cesar/cp/cco/action/inc/cco_action.h
+++ b/cesar/cp/cco/action/inc/cco_action.h
@@ -96,13 +96,6 @@ void
cp_cco_action_cco_selection__sta_remove (cp_t *ctx, cp_sta_t *sta);
/**
- * Clear the selection context.
- * \param ctx the module context.
- */
-void
-cp_cco_action_cco_selection__clear (cp_t *ctx);
-
-/**
* Selects the Next CCo on the AVLN.
* \param ctx the module context.
* \return the station elected or NULL.
diff --git a/cesar/cp/cco/action/src/cco_action.c b/cesar/cp/cco/action/src/cco_action.c
index 463e888ab9..e7ef7c5780 100644
--- a/cesar/cp/cco/action/src/cco_action.c
+++ b/cesar/cp/cco/action/src/cco_action.c
@@ -1028,8 +1028,8 @@ cp_cco_action_cco_selection__sta_add (cp_t *ctx, cp_net_t *net, cp_sta_t *sta)
&& (cp_sta_get_authenticated (ctx, sta)))
{
own = cp_sta_mgr_get_sta_own_data (ctx);
- if ((own->cco_prefered == false)
- && ((sta->cco_cap > CP_CCO_LEVEL)))
+ if (own->cco_prefered == false
+ && sta->cco_cap > CP_CCO_LEVEL)
{
slab_addref (sta);
heap_node_init (&sta->cco_selection_node);
@@ -1160,6 +1160,7 @@ cp_cco_action_sc__sc_cco__cc_assoc_req (cp_t *ctx, cp_mme_rx_t *mme)
void
cp_cco_action_handover_ended (cp_t *ctx)
{
+ cp_cco_action_cco_selection__clear (ctx);
/* trigger the event for the assoc FSM. */
cp_fsm_trigger_new_event (ctx, bare, become_sta);
}
diff --git a/cesar/cp/cco/action/src/handover.c b/cesar/cp/cco/action/src/handover.c
index 1f37e6aadc..778118d47b 100644
--- a/cesar/cp/cco/action/src/handover.c
+++ b/cesar/cp/cco/action/src/handover.c
@@ -298,13 +298,18 @@ cp_cco_action_handover__timeout_cc_handover_info_rsp (cp_t *ctx)
}
}
-
void
cp_cco_action_handover__discover_done (cp_t *ctx)
{
cp_fsm_event_t *event;
dbg_assert (ctx);
-
+ cp_sta_t *sta;
+ cp_net_t *net = cp_sta_mgr_get_our_avln (ctx);
+ cp_cco_action_cco_selection__clear (ctx);
+ for (sta = cp_net_sta_get_first (ctx, net, CP_NET_STA_ASSOC);
+ sta;
+ sta = cp_net_sta_get_next (ctx, net, sta))
+ cp_cco_action_cco_selection__sta_add (ctx, net, sta);
ctx->handover.reason = CP_HANDOVER_REASON_CCO_SELECTION;
event = cp_fsm_event_bare_new (ctx, CP_FSM_EVENT_TYPE_CCO_HANDOVER_START);
cp_fsm_trigger (ctx, event);