summaryrefslogtreecommitdiff
path: root/cesar/cp/sta/action
diff options
context:
space:
mode:
authorlaranjeiro2010-07-08 09:55:06 +0000
committerlaranjeiro2010-07-08 09:55:06 +0000
commit360fb415ce609bb98e99eacf1f2c11c390eb2def (patch)
tree281021181055279f5f06e373eee61dcfe55e9189 /cesar/cp/sta/action
parent233e4e0512c46198530c29bd1ec401d8638135ff (diff)
cesar/cp/{fsm, sta/action}: Update bsu on state change, closes #1732
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@7288 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp/sta/action')
-rw-r--r--cesar/cp/sta/action/assoc.h16
-rw-r--r--cesar/cp/sta/action/src/assoc.c19
-rw-r--r--cesar/cp/sta/action/src/poweron.c10
-rw-r--r--cesar/cp/sta/action/test/utest/Makefile4
-rw-r--r--cesar/cp/sta/action/test/utest/src/bsu_stub.c27
-rw-r--r--cesar/cp/sta/action/test/utest/src/cco_stub.c8
6 files changed, 55 insertions, 29 deletions
diff --git a/cesar/cp/sta/action/assoc.h b/cesar/cp/sta/action/assoc.h
index 71709eae8b..7df99ac2ac 100644
--- a/cesar/cp/sta/action/assoc.h
+++ b/cesar/cp/sta/action/assoc.h
@@ -488,6 +488,22 @@ cp_sta_action_assoc__leave_wait__enter (cp_t *ctx);
void
cp_sta_action_assoc__leave_wait__timeout (cp_t *ctx);
+/**
+ * Enter in STA state.
+ * \param ctx the module context.
+ * Update the BSU to act as STA.
+ */
+void
+cp_sta_action_assoc__sta__enter (cp_t *ctx);
+
+/**
+ * Enter in Unassociating state.
+ * \param ctx the module context.
+ * Update the BSU to act as STA.
+ */
+void
+cp_sta_action_unassoc__unassoc__enter (cp_t *ctx);
+
END_DECLS
#endif /* cp_sta_action_assoc_h */
diff --git a/cesar/cp/sta/action/src/assoc.c b/cesar/cp/sta/action/src/assoc.c
index 845e59f13d..ce5115988b 100644
--- a/cesar/cp/sta/action/src/assoc.c
+++ b/cesar/cp/sta/action/src/assoc.c
@@ -20,6 +20,7 @@
#include "cp/beacon/beacon.h"
#include "lib/rnd.h"
#include "cp/secu/defs.h"
+#include "cp/beacon/beacon.h"
#define RETRY_TIMEOUT_MS 1000
#define RENEW_MARGIN_MS (5 * 60 * 1000)
@@ -740,3 +741,21 @@ cp_sta_action_assoc__leave_wait__timeout (cp_t *ctx)
{
dbg_assert (ctx);
}
+
+void
+cp_sta_action_assoc__sta__enter (cp_t *ctx)
+{
+ dbg_assert (ctx);
+ /* Update the BSU. */
+ bsu_beacon_t *beacon = cp_beacon_fill_share_memory (ctx);
+ bsu_update (beacon, BSU_UPDATE_STA_TYPE_STA);
+}
+
+void
+cp_sta_action_unassoc__unassoc__enter (cp_t *ctx)
+{
+ dbg_assert (ctx);
+ /* Update the BSU. */
+ bsu_beacon_t *beacon = cp_beacon_fill_share_memory (ctx);
+ bsu_update (beacon, BSU_UPDATE_STA_TYPE_STA);
+}
diff --git a/cesar/cp/sta/action/src/poweron.c b/cesar/cp/sta/action/src/poweron.c
index aec226a186..596896c55f 100644
--- a/cesar/cp/sta/action/src/poweron.c
+++ b/cesar/cp/sta/action/src/poweron.c
@@ -187,6 +187,10 @@ cp_sta_action_poweron__poweron__enter (cp_t *ctx)
event, btt_timeout_ms);
/* USTT timer. */
cp_sta_action_poweron_ustt_start (ctx, CP_USTA_IND_INTERVAL_MS);
+ bsu_beacon_t *beacon = cp_beacon_fill_share_memory (ctx);
+ /* Act as STA, for BSU corresponds to only hear the central beacon from
+ * the CCo. */
+ bsu_update (beacon, BSU_UPDATE_STA_TYPE_STA);
}
void
@@ -284,6 +288,8 @@ void
cp_sta_action_poweron__usta__enter (cp_t *ctx)
{
cp_sta_action_poweron_ustt_start (ctx, CP_DISCOVER_PERIOD_MAX_MS);
+ bsu_beacon_t *beacon = cp_beacon_fill_share_memory (ctx);
+ bsu_update (beacon, BSU_UPDATE_STA_TYPE_STA);
}
void
@@ -349,6 +355,8 @@ void
cp_sta_action_poweron__ucco__enter (cp_t *ctx)
{
dbg_assert (ctx);
+ bsu_beacon_t *beacon = cp_beacon_fill_share_memory (ctx);
+ bsu_update (beacon, BSU_UPDATE_STA_TYPE_UCCO);
}
void
@@ -383,6 +391,8 @@ cp_sta_action_poweron__cco__enter (cp_t *ctx)
event = cp_fsm_event_bare_new (ctx, CP_FSM_EVENT_TYPE_join_timeout);
cp_sta_core_gen_timed_event (ctx, &ctx->sta_action.poweron.join_timer,
event, CP_DISCOVER_PERIOD_MAX_MS);
+ bsu_beacon_t *beacon = cp_beacon_fill_share_memory (ctx);
+ bsu_update (beacon, BSU_UPDATE_STA_TYPE_CCO);
}
void
diff --git a/cesar/cp/sta/action/test/utest/Makefile b/cesar/cp/sta/action/test/utest/Makefile
index 254725a314..f31a54c79f 100644
--- a/cesar/cp/sta/action/test/utest/Makefile
+++ b/cesar/cp/sta/action/test/utest/Makefile
@@ -6,12 +6,12 @@ HOST_PROGRAMS = test_sta_action
test_sta_action_SOURCES = test_sta_action.c assoc.c drv.c info.c key.c \
poweron.c misc.c bridge.c sc.c handover.c \
msg_stub.c dataplane_stub.c fsm_stub.c \
- core_stub.c beacon_stub.c cp_stub.c bsu_stub.c \
+ core_stub.c beacon_stub.c cp_stub.c \
cco_stub.c scenario_actions.c sc_test.c vs.c ce_stub.c
test_sta_action_MODULES = lib lib/scenario cp/sta/action cp/sta/mgr \
cp/fsm/stub cp/secu mac/common cl/stub cl \
cp/cco/action/stub cp/beacon/stub cp/msg/stub \
- ce/stub mac/sar/stub cp/av/cco/bw/stub
+ ce/stub mac/sar/stub cp/av/cco/bw/stub bsu/stub
cp_fsm_MODULE_SOURCES = tables.c
# For bridging MME tests.
diff --git a/cesar/cp/sta/action/test/utest/src/bsu_stub.c b/cesar/cp/sta/action/test/utest/src/bsu_stub.c
deleted file mode 100644
index 188f3eddc6..0000000000
--- a/cesar/cp/sta/action/test/utest/src/bsu_stub.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2010 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file src/bsu_stub.c
- */
-#include "common/std.h"
-#include "mac/common/defs.h"
-
-void
-bsu_activate (bool activate)
-{
-}
-
-void
-bsu_power_on (u8 snid)
-{
-}
-
-void
-bsu_track_avln (u64 nid, u16 snid, u8 tei, mac_coexistence_mode_t hm)
-{
-}
diff --git a/cesar/cp/sta/action/test/utest/src/cco_stub.c b/cesar/cp/sta/action/test/utest/src/cco_stub.c
index 93dcc467ae..09782afd6f 100644
--- a/cesar/cp/sta/action/test/utest/src/cco_stub.c
+++ b/cesar/cp/sta/action/test/utest/src/cco_stub.c
@@ -121,3 +121,11 @@ void
cp_cco_action_cco_selection__clear (cp_t *ctx)
{
}
+
+void
+cp_cco_action_cco__cc_discover_list_req (
+ cp_t *ctx, cp_net_t *net, cp_sta_t *sta) __attribute__ ((weak));
+
+void
+cp_cco_action_cco__cc_discover_list_req (
+ cp_t *ctx, cp_net_t *net, cp_sta_t *sta) {}