summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
authorMarko Stankovic2012-04-09 13:40:02 +0200
committerMarko Stankovic2012-05-03 14:00:13 +0200
commite0defe530d12f6495c3a319cbd1bccb51c0fa603 (patch)
tree8cab105d6dc97913e084fcba7f8e99ae71a1ba83 /cesar
parent9c488accf870990d4455d26e62d61ebe12529524 (diff)
cesar/cp/{fsm,eoc/sta}[eoc]: track beacon when sta is unassociated, refs #3071
Diffstat (limited to 'cesar')
-rw-r--r--cesar/cp/eoc/sta/action/assoc.h37
-rw-r--r--cesar/cp/eoc/sta/action/src/assoc.c24
-rw-r--r--cesar/cp/fsm/src/fsm/cp_eoc_sta.fsm4
3 files changed, 62 insertions, 3 deletions
diff --git a/cesar/cp/eoc/sta/action/assoc.h b/cesar/cp/eoc/sta/action/assoc.h
index 64588b8fe2..e162f4c325 100644
--- a/cesar/cp/eoc/sta/action/assoc.h
+++ b/cesar/cp/eoc/sta/action/assoc.h
@@ -182,10 +182,43 @@ void
cp_sta_action_assoc__start_retry_timer (cp_t *ctx);
void
-cp_eoc_sta_action_auth__authenticated_set_key_req (cp_t *ctx, cp_mme_rx_t *mme);
+cp_eoc_sta_action_auth__authenticated_set_key_req (cp_t *ctx,
+ cp_mme_rx_t *mme);
void
-cp_eoc_sta_action_auth__authenticated_set_out_lev (cp_t *ctx, cp_mme_rx_t *mme);
+cp_eoc_sta_action_auth__authenticated_set_out_lev (cp_t *ctx,
+ cp_mme_rx_t *mme);
+
+/**
+ * Several beacons were not detected while station was in
+ * detecting beacon state
+ * \param ctx control plane context
+ *
+ */
+void
+cp_eoc_sta_action_assoc__detecting_no_beacons (cp_t *ctx);
+
+/**
+ * Several beacons were not detected while station was in
+ * unassociated state
+ * \param ctx control plane context
+ *
+ */
+void
+cp_eoc_sta_action_assoc__unassoc_no_beacons (cp_t *ctx);
+
+/**
+ * BEACON was received while station was in unassociated state
+ * \param ctx control plane context
+ * \param beacon pointer to received beacon
+ * \param net pointer to station's network
+ * \param sta pointer to control plane station
+ *
+ */
+void
+cp_eoc_sta_action_unassoc__beacon_received (cp_t *ctx, bsu_beacon_t *beacon,
+ cp_net_t *net, cp_sta_t *sta);
+
END_DECLS
diff --git a/cesar/cp/eoc/sta/action/src/assoc.c b/cesar/cp/eoc/sta/action/src/assoc.c
index e6408224ef..b23fef264f 100644
--- a/cesar/cp/eoc/sta/action/src/assoc.c
+++ b/cesar/cp/eoc/sta/action/src/assoc.c
@@ -104,6 +104,12 @@ cp_eoc_sta_action_assoc__detecting_timeout (cp_t *ctx)
}
void
+cp_eoc_sta_action_assoc__detecting_no_beacons (cp_t *ctx)
+{
+ cp_eoc_sta_action_sta_clear_status (ctx);
+}
+
+void
cp_eoc_sta_action_detect__beacon_received (cp_t *ctx, bsu_beacon_t *beacon,
cp_net_t *net, cp_sta_t *sta)
{
@@ -631,6 +637,24 @@ cp_sta_action_unassoc__stop_retry_timer (cp_t *ctx)
ctx, &ctx->sta_action.assoc.timer);
}
+void
+cp_eoc_sta_action_assoc__unassoc_no_beacons (cp_t *ctx)
+{
+ cp_eoc_sta_action_sta_clear_status (ctx);
+}
+
+void
+cp_eoc_sta_action_unassoc__beacon_received (cp_t *ctx, bsu_beacon_t *beacon,
+ cp_net_t *net, cp_sta_t *sta)
+{
+ dbg_assert (ctx);
+ dbg_assert (beacon);
+ dbg_assert (net);
+ dbg_assert (sta);
+
+ ctx->sta_action.assoc.beacon_loss = 0;
+}
+
/* release fsm, goto UNASSOC state: SLEEP, no action, normal situation */
void
cp_eoc_sta_action_assoc__sleep_authenticated_no_beacons (cp_t *ctx)
diff --git a/cesar/cp/fsm/src/fsm/cp_eoc_sta.fsm b/cesar/cp/fsm/src/fsm/cp_eoc_sta.fsm
index 0e4065a20d..7449f9c153 100644
--- a/cesar/cp/fsm/src/fsm/cp_eoc_sta.fsm
+++ b/cesar/cp/fsm/src/fsm/cp_eoc_sta.fsm
@@ -167,12 +167,14 @@ DETECTING_BEACON:
BEACON -> . [cp_eoc_sta_action_detect__beacon_received]
nd_beacon -> ASSOCIATING [cp_eoc_sta_action_assoc__detecting_detected]
nd_beacon_timeout -> UNASSOCIATED [cp_eoc_sta_action_assoc__detecting_timeout]
- no_beacons -> . [cp_eoc_sta_action_sta_clear_status]
+ no_beacons -> . [cp_eoc_sta_action_assoc__detecting_no_beacons]
UNASSOCIATED:
enter_sleep_unassociated -> SLEEP_UNASSOCIATED [cp_eoc_sta_action_sleep__unassociated_enter_sleep]
retry_unassociated -> DETECTING_BEACON [NULL]
timeout_unassociating -> DETECTING_BEACON [NULL]
+ no_beacons -> . [cp_eoc_sta_action_assoc__unassoc_no_beacons]
+ BEACON -> . [cp_eoc_sta_action_unassoc__beacon_received]
ASSOCIATING:
timeout_associating: retry -> DETECTING_BEACON [cp_eoc_sta_action_assoc__associating_timeout]