summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cesar/bsu/stub/src/bsu.c6
-rw-r--r--cesar/cl/cl.h1
-rw-r--r--cesar/cl/src/cl.c2
-rw-r--r--cesar/cp/beacon/stub/src/beacon.c18
-rw-r--r--cesar/cp/eoc/cco/action/src/vs_eoc.c2
-rw-r--r--cesar/cp/eoc/cco/bw/stub/Module1
-rw-r--r--cesar/cp/eoc/cco/bw/stub/src/bw.c35
-rw-r--r--cesar/cp/eoc/multi_sta/action/src/multi_sta_action.c1
-rw-r--r--cesar/cp/eoc/sta/action/Config2
-rw-r--r--cesar/cp/eoc/sta/action/src/assoc.c5
-rw-r--r--cesar/cp/eoc/sta/action/src/drv.c2
-rw-r--r--cesar/cp/eoc/sta/action/src/vs_eoc.c6
-rw-r--r--cesar/cp/eoc/sta/action/stub/src/drv.c2
-rw-r--r--cesar/cp/eoc/sta/action/test/utest/src/cp_stub.c2
-rw-r--r--cesar/cp/eoc/sta/action/test/utest/src/test_actions.c12
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/Config5
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/Makefile6
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c2
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c5
-rw-r--r--cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c2
-rw-r--r--cesar/cp/eoc/sta/mgr/src/sta_mgr.c115
-rw-r--r--cesar/cp/eoc/sta/mgr/src/sta_own_data.c42
-rw-r--r--cesar/cp/eoc/sta/mgr/sta_mgr.h25
-rw-r--r--cesar/cp/eoc/sta/mgr/test/Config1
-rw-r--r--cesar/cp/eoc/sta/mgr/test/Makefile38
-rw-r--r--cesar/cp/eoc/sta/mgr/test/overide/cp/cco/action/inc/context.h3
-rw-r--r--cesar/cp/eoc/sta/mgr/test/overide/cp/inc/context.h9
-rw-r--r--cesar/cp/eoc/sta/mgr/test/src/net_list_test.c35
-rw-r--r--cesar/cp/eoc/sta/mgr/test/src/net_test.c1
-rw-r--r--cesar/cp/eoc/sta/mgr/test/src/sta-test.c73
-rw-r--r--cesar/cp/eoc/sta/mgr/test/src/sta_mgr.c228
-rw-r--r--cesar/cp/eoc/sta/mgr/test/src/station_test.c1
-rw-r--r--cesar/cp/msg/msg.h5
-rw-r--r--cesar/cp/msg/stub/src/msg_drv.c37
-rw-r--r--cesar/cp/msg/stub/src/msg_vs_eoc.c17
-rw-r--r--cesar/cp/sta/action/src/bridge.c1
-rw-r--r--cesar/mac/sar/sar.h10
-rw-r--r--cesar/mac/sar/src/sar.c18
-rw-r--r--cesar/mac/sar/stub/src/sar.c16
39 files changed, 472 insertions, 320 deletions
diff --git a/cesar/bsu/stub/src/bsu.c b/cesar/bsu/stub/src/bsu.c
index 1920bd4bcc..91859773da 100644
--- a/cesar/bsu/stub/src/bsu.c
+++ b/cesar/bsu/stub/src/bsu.c
@@ -66,3 +66,9 @@ bsu_avln_remove (u64 nid, u8 snid) __attribute__ ((weak));
void
bsu_avln_remove (u64 nid, u8 snid) {}
+
+void
+bsu_untrack_avln (void) __attribute__ ((weak));
+
+void
+bsu_untrack_avln (void) {}
diff --git a/cesar/cl/cl.h b/cesar/cl/cl.h
index aa8b870836..1ef66e7c42 100644
--- a/cesar/cl/cl.h
+++ b/cesar/cl/cl.h
@@ -19,7 +19,6 @@
#include "mac/common/store.h"
#include "lib/utils.h"
#include "mac/sar/sar.h"
-#include "config/cl/eoc.h"
/** forward declaration. */
typedef struct cl_t cl_t;
diff --git a/cesar/cl/src/cl.c b/cesar/cl/src/cl.c
index 17ca686e69..b1ba27a841 100644
--- a/cesar/cl/src/cl.c
+++ b/cesar/cl/src/cl.c
@@ -647,9 +647,11 @@ cl_data_send (cl_t *ctx, u8 *buffer, uint length, uint tag,
ctx->data_send_link.mfs->common.tei,
ctx->data_send_link.mfs->common.lid,
ctx->data_send_link.mfs->common.bcast);
+#if CONFIG_CL_EOC_ROUTE
if (ctx->data_send_link.mfs->seg_nb >= MFS_TX_MAX_SEG_NB)
(*ctx->data_tx.cb) (ctx->data_tx.user, buffer);
else
+#endif
sar_msdu_add (ctx->sar, buffer, length,
ctx->data_send_link.mfs, NULL,
arrival_time_ntb);
diff --git a/cesar/cp/beacon/stub/src/beacon.c b/cesar/cp/beacon/stub/src/beacon.c
index fc587f688b..765a0c98e9 100644
--- a/cesar/cp/beacon/stub/src/beacon.c
+++ b/cesar/cp/beacon/stub/src/beacon.c
@@ -144,3 +144,21 @@ cp_beacon_fill_share_memory (cp_t *ctx)
{
return INVALID_PTR;
};
+
+void
+cp_beacon_deactivate (cp_t *ctx) __attribute__ ((weak));
+
+void
+cp_beacon_deactivate (cp_t *ctx) {};
+
+void
+cp_beacon_poweron_init (cp_t *ctx) __attribute__ ((weak));
+
+void
+cp_beacon_poweron_init (cp_t *ctx){};
+
+void
+cp_beacon_nek_index_adjust (cp_t *ctx, uint nek_index) __attribute__ ((weak));
+
+void
+cp_beacon_nek_index_adjust (cp_t *ctx, uint nek_index) {};
diff --git a/cesar/cp/eoc/cco/action/src/vs_eoc.c b/cesar/cp/eoc/cco/action/src/vs_eoc.c
index 37298c6bba..24de3bcc09 100644
--- a/cesar/cp/eoc/cco/action/src/vs_eoc.c
+++ b/cesar/cp/eoc/cco/action/src/vs_eoc.c
@@ -32,7 +32,7 @@
#include "stdio.h"
-
+#include "cp/msg/inc/msg_vs_eoc.h"
/**
* Handle CCO => VS_EOC_GET_TOPO.REQ.
diff --git a/cesar/cp/eoc/cco/bw/stub/Module b/cesar/cp/eoc/cco/bw/stub/Module
new file mode 100644
index 0000000000..6cc8dbfd33
--- /dev/null
+++ b/cesar/cp/eoc/cco/bw/stub/Module
@@ -0,0 +1 @@
+SOURCES:= bw.c \ No newline at end of file
diff --git a/cesar/cp/eoc/cco/bw/stub/src/bw.c b/cesar/cp/eoc/cco/bw/stub/src/bw.c
new file mode 100644
index 0000000000..7254b29308
--- /dev/null
+++ b/cesar/cp/eoc/cco/bw/stub/src/bw.c
@@ -0,0 +1,35 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2009 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file cp/eoc/cco/bw/src/bw.c
+ * \brief Create the alloctions for beacon period and create CCo schedule
+ * \ingroup cp_eoc_cco_bw
+ *
+*/
+#include "common/std.h"
+#include "cp/msg/msg.h"
+#include "cp/cp.h"
+#include "cp/inc/context.h"
+
+void
+cp_eoc_cco_bw_allocations_adjust (cp_t *ctx, bool adjust)
+{
+ dbg_assert (ctx);
+}
+
+void
+cp_eoc_cco_bw_sta_allocations (cp_t *ctx)
+{
+ dbg_assert (ctx);
+}
+
+/* TODO: ugly, but dont want to create stub in mac/pbproc */
+void
+pbproc_parameters_adjust (pbproc_t *ctx, bool adjust)
+{
+}
diff --git a/cesar/cp/eoc/multi_sta/action/src/multi_sta_action.c b/cesar/cp/eoc/multi_sta/action/src/multi_sta_action.c
index 65212d89fe..b42eac5f5a 100644
--- a/cesar/cp/eoc/multi_sta/action/src/multi_sta_action.c
+++ b/cesar/cp/eoc/multi_sta/action/src/multi_sta_action.c
@@ -96,7 +96,6 @@ void cp_eoc_multi_sta_action__assoc_req_common(cp_t *ctx, cp_mme_rx_t *mme)
dbg_assert (ctx);
dbg_assert (mme);
-
/* Add the station to the AVLN. */
net = cp_sta_mgr_get_our_avln (ctx);
diff --git a/cesar/cp/eoc/sta/action/Config b/cesar/cp/eoc/sta/action/Config
index 4c6284ff2b..28cb71ccf5 100644
--- a/cesar/cp/eoc/sta/action/Config
+++ b/cesar/cp/eoc/sta/action/Config
@@ -1 +1 @@
-CONFIG_CP_EOC_STA_CON_ALLOWED = n
+CONFIG_CP_EOC_STA_CON_ALLOWED = n \ No newline at end of file
diff --git a/cesar/cp/eoc/sta/action/src/assoc.c b/cesar/cp/eoc/sta/action/src/assoc.c
index 8cbd0651e6..1a83c12558 100644
--- a/cesar/cp/eoc/sta/action/src/assoc.c
+++ b/cesar/cp/eoc/sta/action/src/assoc.c
@@ -19,13 +19,16 @@
#include "cp/msg/msg.h"
#include "cp/beacon/beacon.h"
#include "mac/sar/sar.h"
-#include "mac/sar/inc/sar_context.h"
#include "mac/pbproc/inc/context.h"
#include "mac/common/ntb.h"
#include "hal/gpio/gpio.h"
#include "cp/eoc/inc/dbg_print.h"
#include "cp/eoc/cco/bw/bw.h"
#include "cp/eoc/sta/action/drv.h"
+#include "config/cp/eoc/sta/con/allowed.h"
+#if CONFIG_CP_EOC_STA_CON_ALLOWED
+#include "mac/sar/inc/sar_context.h"
+#endif
#define UNASSOC_RETRY_TIMEOUT_MS 15*1000
#define RETRY_TIMEOUT_MS 1200
diff --git a/cesar/cp/eoc/sta/action/src/drv.c b/cesar/cp/eoc/sta/action/src/drv.c
index b30f7d7d68..b517b1a6db 100644
--- a/cesar/cp/eoc/sta/action/src/drv.c
+++ b/cesar/cp/eoc/sta/action/src/drv.c
@@ -19,6 +19,8 @@
#include "cp/fsm/fsm.h"
#include "cp/eoc/cco/bw/bw.h"
#include "lib/stats.h"
+#include "cp/msg/inc/msg_vs_eoc.h"
+#include "config/cp/msg/eoc.h"
#include "stdio.h"
diff --git a/cesar/cp/eoc/sta/action/src/vs_eoc.c b/cesar/cp/eoc/sta/action/src/vs_eoc.c
index 695422aa81..4f3098bb75 100644
--- a/cesar/cp/eoc/sta/action/src/vs_eoc.c
+++ b/cesar/cp/eoc/sta/action/src/vs_eoc.c
@@ -22,7 +22,7 @@
#include "ce/rx/bitloading/inc/nsr.h"
#include "mac/pbproc/inc/context.h"
#include "math.h"
-
+#include "cp/msg/inc/msg_vs_eoc.h"
void
cp_eoc_sta_action_vs_eoc__sta__vs_eoc_get_info_req(cp_t *ctx, cp_mme_rx_t *mme)
@@ -92,8 +92,8 @@ cp_eoc_sta_action_vs_eoc__sta__vs_eoc_get_info_req(cp_t *ctx, cp_mme_rx_t *mme)
status = CP_MSG_VS_EOC_GET_INFO_REQ_RESULT_FAILURE;
}
- cp_msg_vs_eoc_cco_get_info_cnf_send(ctx, &mme->peer, status, tei, attenuation, snr, phy_uplink_speed,
- phy_downlink_speed, output_power, tx_success_counter, tx_crc_error_counter, tx_other_error_counter,
+ cp_msg_vs_eoc_cco_get_info_cnf_send(ctx, &mme->peer, status, tei, attenuation, snr, phy_uplink_speed,
+ phy_downlink_speed, output_power, tx_success_counter, tx_crc_error_counter, tx_other_error_counter,
rx_success_counter, rx_crc_error_counter, rx_other_error_counter);
}
diff --git a/cesar/cp/eoc/sta/action/stub/src/drv.c b/cesar/cp/eoc/sta/action/stub/src/drv.c
index fd720b7510..3fb28c0f01 100644
--- a/cesar/cp/eoc/sta/action/stub/src/drv.c
+++ b/cesar/cp/eoc/sta/action/stub/src/drv.c
@@ -153,4 +153,4 @@ cp_sta_action_drv__stopping__stopped (cp_t *ctx)
void
cp_sta_action_drv__drv_sta_get_key_req (cp_t *ctx, cp_mme_rx_t *mme)
{
-}
+} \ No newline at end of file
diff --git a/cesar/cp/eoc/sta/action/test/utest/src/cp_stub.c b/cesar/cp/eoc/sta/action/test/utest/src/cp_stub.c
index f5e8195c8e..672ffb388b 100644
--- a/cesar/cp/eoc/sta/action/test/utest/src/cp_stub.c
+++ b/cesar/cp/eoc/sta/action/test/utest/src/cp_stub.c
@@ -43,6 +43,6 @@ cp_compute_nmk_and_nid_from_npw (cp_t *ctx, const char *npw,
nid = cp_secu_nmk2nid (ctx, nmk, sl);
/* Store the nid and the nmk to the station own data. */
- cp_sta_own_data_set_nmk (ctx, nmk);
+ cp_sta_own_data_set_nmk (ctx, nmk, 0);
cp_sta_own_data_set_nid (ctx, nid);
}
diff --git a/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c b/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c
index 7c74ccff88..2aed310073 100644
--- a/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c
+++ b/cesar/cp/eoc/sta/action/test/utest/src/test_actions.c
@@ -172,7 +172,7 @@ test_case_association_and_authentication_action (test_t test)
strcpy(npw, "SPC-300_EoC_200MBps");
//zero padding
- memset((npw + sizeof("SPC-300_EoC_200MBps")), '\0',
+ memset((npw + sizeof("SPC-300_EoC_200MBps")), '\0',
(sizeof(npw) - sizeof("SPC-300_EoC_200MBps")));
ctx.mac_config = &mac_config;
@@ -214,7 +214,7 @@ test_case_association_and_authentication_action (test_t test)
strcpy(dpw, "Spidcom_Eoc_Modem_user_121");
//zero padding
- memset((dpw + sizeof("Spidcom_Eoc_Modem_user_121")), '\0',
+ memset((dpw + sizeof("Spidcom_Eoc_Modem_user_121")), '\0',
(sizeof(dpw) - sizeof("Spidcom_Eoc_Modem_user_121")));
ctx.mac_config = &mac_config;
@@ -337,7 +337,7 @@ test_case_association_and_authentication_action (test_t test)
strcpy(m_sta_hfid, "Spidcom_SPC_300_EoC_m_HFID_123");
//zero padding
- memset((m_sta_hfid + sizeof("Spidcom_SPC_300_EoC_m_HFID_123")), '\0',
+ memset((m_sta_hfid + sizeof("Spidcom_SPC_300_EoC_m_HFID_123")), '\0',
(sizeof(m_sta_hfid) - sizeof("Spidcom_SPC_300_EoC_m_HFID_123")));
ctx.mac_config = &mac_config;
@@ -381,7 +381,7 @@ test_case_association_and_authentication_action (test_t test)
strcpy(u_sta_hfid, "Spidcom_SPC_300_EoC_u_HFID_123");
//zero padding
- memset((u_sta_hfid + sizeof("Spidcom_SPC_300_EoC_u_HFID_123")), '\0',
+ memset((u_sta_hfid + sizeof("Spidcom_SPC_300_EoC_u_HFID_123")), '\0',
(sizeof(u_sta_hfid) - sizeof("Spidcom_SPC_300_EoC_u_HFID_123")));
ctx.mac_config = &mac_config;
@@ -425,7 +425,7 @@ test_case_association_and_authentication_action (test_t test)
strcpy(avln_hfid, "Spidcom_SPC_300_EoC_avln_HFID_123");
//zero padding
- memset((avln_hfid + sizeof("Spidcom_SPC_300_EoC_avln_HFID_123")), '\0',
+ memset((avln_hfid + sizeof("Spidcom_SPC_300_EoC_avln_HFID_123")), '\0',
(sizeof(avln_hfid) - sizeof("Spidcom_SPC_300_EoC_avln_HFID_123")));
ctx.mac_config = &mac_config;
@@ -806,7 +806,7 @@ test_case_association_and_authentication_action (test_t test)
cp_sta_mgr_set_our_avln (&ctx, net);
sl = CP_SECURITY_LEVEL_SC;
- cp_sta_own_data_set_nmk (&ctx, nmk);
+ cp_sta_own_data_set_nmk (&ctx, nmk, 0);
nid = cp_secu_nmk2nid (&ctx, nmk, sl);
cp_sta_own_data_set_nid (&ctx, nid);
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/Config b/cesar/cp/eoc/sta/action/test/utest_eoc/Config
index 02e346feaa..6e2653cdcc 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/Config
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/Config
@@ -1,2 +1,7 @@
CONFIG_DEBUG_FATAL_CATCH = y
CONFIG_CP_FSM_DEF = "cp/fsm/src/fsm/cp_eoc_sta.fsm"
+CONFIG_CP_EOC_STA_CON_ALLOWED = n
+CONFIG_MAC_PBPROC_EOC_FC = y
+CONFIG_CP_MSG_EOC_VS = y
+CONFIG_CP_EOC_DBG_PRINT_LEVEL = 0
+CONFIG_CP_MSG_EOC_DRV_MME = y \ No newline at end of file
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/Makefile b/cesar/cp/eoc/sta/action/test/utest_eoc/Makefile
index e315d734a9..643a7be55a 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/Makefile
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/Makefile
@@ -7,10 +7,10 @@ HOST_PROGRAMS = assoc
assoc_SOURCES = assoc.c mgr_stub.c core_stub.c cp_stub.c msg_stub.c
assoc_MODULES = lib cp/sta/mgr mac/common cp/eoc/sta/action \
- cp/fsm/stub cl/stub mac/sar/stub cp/eoc/sta/mgr \
- cp/msg/stub cp/secu cp/beacon/stub
+ cp/fsm/stub cl/stub mac/sar/stub cp/eoc/sta/mgr \
+ cp/msg/stub cp/secu cp/beacon/stub bsu/stub cp/eoc/cco/bw/stub
-assoc_MODULES_CONFIG = cp
+assoc_MODULES_CONFIG = cp mac
cp_sta_mgr_MODULE_SOURCES = net.c net_list.c sta.c
cp_eoc_sta_action_MODULE_SOURCES = assoc.c sleep.c poweron.c drv.c
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c
index f5e8195c8e..672ffb388b 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/cp_stub.c
@@ -43,6 +43,6 @@ cp_compute_nmk_and_nid_from_npw (cp_t *ctx, const char *npw,
nid = cp_secu_nmk2nid (ctx, nmk, sl);
/* Store the nid and the nmk to the station own data. */
- cp_sta_own_data_set_nmk (ctx, nmk);
+ cp_sta_own_data_set_nmk (ctx, nmk, 0);
cp_sta_own_data_set_nid (ctx, nid);
}
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c
index 3486949483..ef3d52049c 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/mgr_stub.c
@@ -83,11 +83,6 @@ cp_sta_core_checkpoint (cp_t *ctx)
}
void
-sar_activate (sar_t *ctx, bool activate)
-{
-}
-
-void
pbproc_activate (pbproc_t *ctx, bool flag)
{
}
diff --git a/cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c b/cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c
index 48cb3b9f2a..a48f4afb21 100644
--- a/cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c
+++ b/cesar/cp/eoc/sta/action/test/utest_eoc/src/msg_stub.c
@@ -45,7 +45,7 @@ cp_msg_drv_sta_set_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
if ((*type >= CP_MSG_DRV_STA_SET_KEY_TYPE_NB)
|| (*sl >= CP_SECURITY_LEVEL_NB)
- || (*nid >> CP_NID_SIZE_BITS))
+ || (*nid >> 56))
return false;
return true;
}
diff --git a/cesar/cp/eoc/sta/mgr/src/sta_mgr.c b/cesar/cp/eoc/sta/mgr/src/sta_mgr.c
index bc70261ebf..eb8f3ab8d5 100644
--- a/cesar/cp/eoc/sta/mgr/src/sta_mgr.c
+++ b/cesar/cp/eoc/sta/mgr/src/sta_mgr.c
@@ -379,15 +379,6 @@ cp_net_t *
cp_sta_mgr_add_avln (cp_t *ctx, cp_snid_t snid, cp_nid_t nid)
{
dbg_assert (ctx);
- dbg_assert (nid);
-
- // Verify SNID collisions.
- if (ctx->sta_mgr.our_avln
- && (cp_net_get_nid (ctx, ctx->sta_mgr.our_avln) != nid)
- && (cp_net_get_snid (ctx, ctx->sta_mgr.our_avln) == snid))
- {
-// cp_fsm_trigger_new_event (ctx, bare, snid_conflict);
- }
/* Our avln do not search in the list. */
if (ctx->sta_mgr.our_avln
@@ -403,11 +394,14 @@ cp_sta_mgr_remove_avln (cp_t *ctx, cp_snid_t snid, cp_nid_t nid)
{
dbg_assert (ctx);
+ cp_net_t *net = ctx->sta_mgr.our_avln;
+ if (net
+ && cp_net_get_snid (ctx, net) == snid
+ && cp_net_get_nid (ctx, net) == nid)
+ cp_sta_mgr_set_our_avln (ctx, NULL);
cp_net_list_remove_avln (ctx, &ctx->sta_mgr.network_list, snid, nid);
-
- // verify if the network list is empty.
-/* if (cp_net_list_is_empty (ctx, &ctx->sta_mgr.network_list))
- cp_fsm_trigger_new_event (ctx, bare, net_list_empty);*/
+ /* Inform BSU. */
+ bsu_avln_remove (nid, snid);
}
cp_net_t *
@@ -510,38 +504,37 @@ cp_sta_mgr_set_our_avln (cp_t *ctx, cp_net_t *net)
cp_sta_t *sta;
dbg_assert (ctx);
dbg_assert (ctx->cl);
-// dbg_assert (ctx->sar);
/* If our AVLN was already setted, remove the station from the store. */
-// if (ctx->sta_mgr.our_avln)
-// {
-// cp_sta_t *sta;
-// /* Release the CL's mac to tei table. */
-// cl_mactotei_release_table (ctx->cl);
-//
-// /* Release the station from the mac store. */
-// sta = cp_net_sta_get_first (ctx, ctx->sta_mgr.our_avln, CP_NET_STA_ASSOC);
-// while (sta)
-// {
-// sar_sta_remove (ctx->sar, cp_sta_get_tei (sta));
-// sta = cp_net_sta_get_next (ctx, net, sta);
-// }
-//
-// /* Release the station in the release state. */
-// if (cp_sta_own_data_get_cco_status (ctx))
-// {
-// while ((sta = cp_sta_mgr_release_sta_get_first (ctx)))
-// {
-// sar_sta_remove (ctx->sar, cp_sta_get_tei (sta));
-// /* Remove the station from the list. */
-// list_remove (&ctx->sta_mgr.release_sta_list,
-// &sta->release_node);
-// slab_release (sta);
-// }
-// }
-//
-// sar_cleanup (ctx->sar);
-// }
+ if (ctx->sta_mgr.our_avln)
+ {
+ cp_sta_t *sta;
+ /* Release the CL's mac to tei table. */
+ cl_mactotei_release_table (ctx->cl);
+
+ /* Release the station from the mac store. */
+ sta = cp_net_sta_get_first (ctx, ctx->sta_mgr.our_avln, CP_NET_STA_ASSOC);
+ while (sta)
+ {
+ sar_sta_remove (ctx->sar, cp_sta_get_tei (sta));
+ sta = cp_net_sta_get_next (ctx, net, sta);
+ }
+
+ /* Release the station in the release state. */
+ if (cp_sta_own_data_get_cco_status (ctx))
+ {
+ while ((sta = cp_sta_mgr_release_sta_get_first (ctx)))
+ {
+ sar_sta_remove (ctx->sar, cp_sta_get_tei (sta));
+ /* Remove the station from the list. */
+ list_remove (&ctx->sta_mgr.release_sta_list,
+ &sta->release_node);
+ slab_release (sta);
+ }
+ }
+
+ sar_cleanup (ctx->sar);
+ }
ctx->sta_mgr.our_avln = net;
@@ -1095,3 +1088,39 @@ cp_eoc_sta_mgr_get_ports (cp_t *ctx, uint *numStas, mac_t *stas_macs, bool stas_
#endif /* CONFIG_CP_STA_MGR_CCO_EOC */
+bool
+cp_sta_mgr_net_list_is_empty (cp_t *ctx)
+{
+ uint i;
+ cp_net_t *our_avln = ctx->sta_mgr.our_avln;
+ dbg_assert (ctx);
+ for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
+ {
+ /* For all the AVLN less our AVLN, the present flag is enough. */
+ if (our_avln != &ctx->sta_mgr.network_list.networks[i]
+ && ctx->sta_mgr.network_list.networks[i].present)
+ return false;
+ }
+ /* If we are here, all the AVLNs are empty, test our one. */
+ if (our_avln)
+ return (set_empty (&our_avln->associated_stas)
+ && set_empty (&our_avln->unassociated_stas));
+ else
+ return true;
+}
+
+cp_net_t *
+cp_sta_mgr_get_first_avln (cp_t *ctx)
+{
+ dbg_assert (ctx);
+ return cp_net_list_get_first_avln (ctx, &ctx->sta_mgr.network_list);
+}
+
+cp_net_t *
+cp_sta_mgr_get_next_avln (cp_t *ctx, cp_net_t *prev)
+{
+ dbg_assert (ctx);
+ dbg_assert (prev);
+ return cp_net_list_get_next_avln (ctx, &ctx->sta_mgr.network_list, prev);
+}
+
diff --git a/cesar/cp/eoc/sta/mgr/src/sta_own_data.c b/cesar/cp/eoc/sta/mgr/src/sta_own_data.c
index 779f49ec0b..a350fcb2f3 100644
--- a/cesar/cp/eoc/sta/mgr/src/sta_own_data.c
+++ b/cesar/cp/eoc/sta/mgr/src/sta_own_data.c
@@ -23,6 +23,7 @@
/* Public interfaces. */
#include "cp/sta/mgr/sta_own_data.h"
+#include "cp/msg/msg.h"
/* Private interfaces. */
#include "cp/inc/context.h"
@@ -179,11 +180,41 @@ cp_sta_own_data_set_nmk (cp_t *ctx, const cp_key_t nmk,
cp_msg_drv_sta_set_key_type_t type)
{
dbg_assert (ctx);
+ dbg_assert (type < CP_MSG_DRV_STA_SET_KEY_TYPE_NB);
- ctx->sta_mgr.sta_own_data.nmk = nmk;
+ uint i;
+ cp_key_t current_key = cp_sta_own_data_get_nmk (ctx);
- // TODO : inform the driver ?
- return true;
+ for (i = 0; i < COUNT(nmk.key) ;i++)
+ if (nmk.key[i] != current_key.key[i])
+ break;
+
+ if (i < COUNT(nmk.key))
+ {
+ ctx->sta_mgr.sta_own_data.nmk = nmk;
+ /* Not implemented for now */
+#if 0
+ /* Report new computed values to HLE. */
+ cp_mme_peer_t peer = CP_MME_PEER (cp_sta_own_data_get_mac_address (ctx),
+ MAC_TEI_FOREIGN);
+ cp_nid_t nid = 0;
+ cp_security_level_t sl = 0;
+
+ if (type == CP_MSG_DRV_STA_SET_KEY_TYPE_CHANGE_NID)
+ nid = cp_sta_own_data_get_nid (ctx);
+ else
+ sl = cp_sta_own_data_get_security_level (ctx);
+
+ cp_msg_drv_sta_set_key_ind_send (ctx, &peer,
+ nmk,
+ type,
+ nid,
+ sl);
+#endif
+ return true;
+ }
+
+ return false;
}
/**
@@ -505,14 +536,15 @@ void
cp_sta_own_data_set_nid (cp_t *ctx, cp_nid_t nid)
{
dbg_assert (ctx);
- dbg_assert (nid);
- dbg_assert (!(nid >> 56));
+ dbg_assert (HPAV_NID_IS_VALID (nid));
ctx->sta_mgr.sta_own_data.nid = nid;
/* If the station AVLN is setted, modified the network. */
if (ctx->sta_mgr.our_avln)
ctx->sta_mgr.our_avln->nid = nid;
+
+ bsu_update_nid (nid);
}
/**
diff --git a/cesar/cp/eoc/sta/mgr/sta_mgr.h b/cesar/cp/eoc/sta/mgr/sta_mgr.h
index 6e6a72a4cb..e401153690 100644
--- a/cesar/cp/eoc/sta/mgr/sta_mgr.h
+++ b/cesar/cp/eoc/sta/mgr/sta_mgr.h
@@ -38,4 +38,29 @@ cp_sta_mgr_sta_is_unassoc (cp_t *ctx, cp_net_t *net, mac_t mac);
void
cp_sta_mgr_elects_sta_partial_ack (cp_t *ctx);
+/**
+ * Verify the net list status.
+ * \param ctx the module context.
+ * \return true if empty, false otherwise.
+ */
+bool
+cp_sta_mgr_net_list_is_empty (cp_t *ctx);
+
+/**
+ * Get first AVLN from the net_list.
+ * \param ctx the module context.
+ * \return Get a reference on the AVLN.
+ */
+cp_net_t *
+cp_sta_mgr_get_first_avln (cp_t *ctx);
+
+/**
+ * Get next AVLN from the net_list.
+ * \param ctx the module context.
+ * \param prev previous one.
+ * \return Get a reference on the AVLN.
+ */
+cp_net_t *
+cp_sta_mgr_get_next_avln (cp_t *ctx, cp_net_t *prev);
+
#endif /* cp_sta_eoc_mgr_h */
diff --git a/cesar/cp/eoc/sta/mgr/test/Config b/cesar/cp/eoc/sta/mgr/test/Config
index 1221024089..2f5ada90f5 100644
--- a/cesar/cp/eoc/sta/mgr/test/Config
+++ b/cesar/cp/eoc/sta/mgr/test/Config
@@ -1 +1,2 @@
CONFIG_DEBUG_FATAL_CATCH = y
+CONFIG_CL_EOC_ROUTE = y \ No newline at end of file
diff --git a/cesar/cp/eoc/sta/mgr/test/Makefile b/cesar/cp/eoc/sta/mgr/test/Makefile
index 03f51abf66..46c30dd117 100644
--- a/cesar/cp/eoc/sta/mgr/test/Makefile
+++ b/cesar/cp/eoc/sta/mgr/test/Makefile
@@ -1,33 +1,39 @@
BASE = ../../../../..
-INCLUDES = cp/eoc/sta/mgr/test/overide
+INCLUDES = cp/sta/mgr/test/overide
HOST_PROGRAMS = station_test net_test net_list_test sta_own sta_mgr
-station_test_SOURCES = station_test.c core_stub.c sar_stub.c
-station_test_MODULES = lib cp/eoc/sta/mgr cp/sta/mgr mac/common cp/fsm/stub \
- cl/stub cp/cco/action/stub
-
-station_test_MODULES_CONFIG = cp cl mac/sar
+station_test_SOURCES = station_test.c core_stub.c \
+ sar_stub.c
+station_test_MODULES = lib cp/eoc/sta/mgr mac/common cp/fsm/stub \
+ cl/stub bsu/stub cp/msg/stub cp/cco/action/stub \
+ cp/eoc/cco/action/stub cp/sta/mgr
net_test_SOURCES = net_test.c core_stub.c \
- sar_stub.c
-net_test_MODULES = lib cp/eoc/sta/mgr cp/sta/mgr mac/common \
- cp/eoc/cco/action/stub cl/stub cp/cco/action/stub
+ sar_stub.c
+net_test_MODULES = lib cp/eoc/sta/mgr mac/common cp/fsm/stub \
+ cp/eoc/cco/action/stub cl/stub bsu/stub cp/msg/stub \
+ cp/sta/mgr cp/cco/action/stub
net_list_test_SOURCES = net_list_test.c core_stub.c \
- sar_stub.c
-net_list_test_MODULES = lib cp/eoc/sta/mgr cp/sta/mgr mac/common \
- cp/eoc/cco/action/stub cl/stub cp/cco/action/stub
+ sar_stub.c
+net_list_test_MODULES = lib cp/eoc/sta/mgr mac/common cp/fsm/stub \
+ cp/eoc/cco/action/stub cl/stub bsu/stub cp/msg/stub \
+ cp/sta/mgr cp/cco/action/stub
sta_own_SOURCES = sta-test.c core_stub.c sar_stub.c
-sta_own_MODULES = lib cp/eoc/sta/mgr cp/sta/mgr mac/common \
- cp/eoc/cco/action/stub cl/stub cp/cco/action/stub
+sta_own_MODULES = lib cp/eoc/sta/mgr mac/common cp/fsm/stub \
+ cp/eoc/cco/action/stub cl/stub bsu/stub cp/msg/stub \
+ cp/sta/mgr cp/cco/action/stub
+
sta_mgr_SOURCES = sta_mgr.c sar_stub.c core_stub.c
-sta_mgr_MODULES = lib cp/eoc/sta/mgr cp/sta/mgr mac/common \
- cp/eoc/cco/action/stub cl/stub cp/cco/action/stub
+sta_mgr_MODULES = lib cp/eoc/sta/mgr mac/common cp/fsm/stub \
+ cp/eoc/cco/action/stub cl/stub bsu/stub cp/msg/stub \
+ cp/sta/mgr cp/cco/action/stub
cp_sta_mgr_MODULE_SOURCES = net.c net_list.c sta.c
+station_test_MODULES_CONFIG = cp mac cl
include $(BASE)/common/make/top.mk
diff --git a/cesar/cp/eoc/sta/mgr/test/overide/cp/cco/action/inc/context.h b/cesar/cp/eoc/sta/mgr/test/overide/cp/cco/action/inc/context.h
index fb18ca1546..ca3da3cf61 100644
--- a/cesar/cp/eoc/sta/mgr/test/overide/cp/cco/action/inc/context.h
+++ b/cesar/cp/eoc/sta/mgr/test/overide/cp/cco/action/inc/context.h
@@ -2,7 +2,7 @@
#define overide_cp_cco_action_inc_context_h
/* Cesar project {{{
*
- * Copyright (C) 2008-2009 Spidcom
+ * Copyright (C) 2008 Spidcom
*
* <<<Licence>>>
*
@@ -22,6 +22,5 @@ struct cp_cco_action_t
/** TEI in use. */
uint tei_flags [CP_CCO_ACTION_TEI_FLAGS_ROW];
};
-typedef struct cp_cco_action_t cp_cco_action_t;
#endif /* overide_cp_cco_action_inc_context_h */
diff --git a/cesar/cp/eoc/sta/mgr/test/overide/cp/inc/context.h b/cesar/cp/eoc/sta/mgr/test/overide/cp/inc/context.h
index cb97d20d19..5fc77af264 100644
--- a/cesar/cp/eoc/sta/mgr/test/overide/cp/inc/context.h
+++ b/cesar/cp/eoc/sta/mgr/test/overide/cp/inc/context.h
@@ -2,7 +2,7 @@
#define cp_inc_cp_h
/* Cesar project {{{
*
- * Copyright (C) 2008-2009 Spidcom
+ * Copyright (C) 2008 Spidcom
*
* <<<Licence>>>
*
@@ -17,7 +17,7 @@
/* Public interfaces. */
#include "cp/sta/mgr/sta_mgr.h"
-#include "cp/eoc/cco/action/cco_action.h"
+#include "cp/cco/action/cco_action.h"
#include "cl/cl.h"
#include "mac/common/config.h"
#include "mac/sar/sar.h"
@@ -26,7 +26,7 @@
#include "cp/sta/mgr/inc/sta_mgr.h"
/* Override ones. */
-#include "cp/eoc/sta/mgr/test/overide/cp/cco/action/inc/context.h"
+#include "cp/cco/action/inc/context.h"
struct cp_t
{
@@ -47,6 +47,9 @@ struct cp_t
/** CCo action */
cp_cco_action_t cco_action;
+
+ /** Random context. */
+ lib_rnd_t rnd;
};
#endif /* cp_inc_cp_h */
diff --git a/cesar/cp/eoc/sta/mgr/test/src/net_list_test.c b/cesar/cp/eoc/sta/mgr/test/src/net_list_test.c
index 831f45f152..105a6600f3 100644
--- a/cesar/cp/eoc/sta/mgr/test/src/net_list_test.c
+++ b/cesar/cp/eoc/sta/mgr/test/src/net_list_test.c
@@ -170,39 +170,6 @@ test_case_network_remove_avln (test_t test)
test_end;
}
-/** Is empty
- *
- * \param test the test object.
- *
- * Verify the presence of others AVLN on the medium.
- */
-void
-test_case_network_is_empty (test_t test)
-{
- cp_t cp;
- cp_net_list_t network;
-
- cp_net_list_init (&cp, &network);
-
- test_case_begin (test, "Empty function test");
-
- test_begin (test, "Empty list")
- {
- test_fail_if (cp_net_list_is_empty (&cp, &network) != true,
- "List is empty");
- }
- test_end;
-
- cp_net_list_add_avln (&cp, &network, 1, 1);
-
- test_begin (test, "Empty list, not empty")
- {
- test_fail_if (cp_net_list_is_empty (&cp, &network) != false,
- "List is not empty");
- }
- test_end;
-}
-
/** SNID present
*
* \param test the test object.
@@ -256,6 +223,7 @@ test_case_network_slot_usage (test_t test)
cp_t cp;
cp_net_t *net;
+ lib_rnd_init (&cp.rnd, 0x3421);
cp_sta_mgr_init (&cp);
test_case_begin (test, "Getting the slot usage");
@@ -319,7 +287,6 @@ main (void)
test_case_network_init (test);
test_case_network_add_avln (test);
test_case_network_remove_avln (test);
- test_case_network_is_empty (test);
test_case_network_snid_present (test);
test_case_network_slot_usage (test);
test_case_network_add_existing_avln (test);
diff --git a/cesar/cp/eoc/sta/mgr/test/src/net_test.c b/cesar/cp/eoc/sta/mgr/test/src/net_test.c
index 84e7129525..572899c9e8 100644
--- a/cesar/cp/eoc/sta/mgr/test/src/net_test.c
+++ b/cesar/cp/eoc/sta/mgr/test/src/net_test.c
@@ -22,7 +22,6 @@
#include "cp/sta/mgr/inc/net.h"
#include "cp/sta/mgr/inc/sta.h"
-#include "cl/inc/context.h"
#include "mac/sar/inc/context.h"
bool
diff --git a/cesar/cp/eoc/sta/mgr/test/src/sta-test.c b/cesar/cp/eoc/sta/mgr/test/src/sta-test.c
index 1dc8e5225a..5a46b36d16 100644
--- a/cesar/cp/eoc/sta/mgr/test/src/sta-test.c
+++ b/cesar/cp/eoc/sta/mgr/test/src/sta-test.c
@@ -46,9 +46,11 @@ test_case_cp_sta_own_data_init (test_t test)
cp_sta_own_data_private_t *real;
memset (&cmp, 0, sizeof (cp_sta_own_data_private_t));
- cmp.public.hybrid_mode = 0x2;
+ cmp.public.hybrid_mode = MAC_COEXISTENCE_FULL_HYBRID_MODE;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
+ cmp.snid = cp_sta_own_data_get_snid (&cp);
real = (cp_sta_own_data_private_t*) cp_sta_mgr_get_sta_own_data(&cp);
test_fail_if (
@@ -72,6 +74,7 @@ test_case_cp_sta_own_data__set_and_get_tei (test_t test)
cl_t cl;
sar_t sar;
+ lib_rnd_init (&cp.rnd, 0x432);
cp.mac_config = &mac_config;
cp_sta_mgr_init (&cp);
@@ -88,7 +91,7 @@ test_case_cp_sta_own_data__set_and_get_tei (test_t test)
cp_sta_own_data_set_tei (&cp, 2);
test_fail_if (cp_sta_own_data_get_tei (&cp) != 2);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
fsm_posted = false;
cp_sta_own_data_set_tei (&cp, 2);
@@ -99,7 +102,7 @@ test_case_cp_sta_own_data__set_and_get_tei (test_t test)
cp_sta_own_data_set_tei (&cp, MAC_TEI_UNASSOCIATED);
test_fail_unless (cp_sta_own_data_get_tei (&cp) ==
MAC_TEI_UNASSOCIATED);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
cp_sta_mgr_uninit (&cp);
}
@@ -117,6 +120,7 @@ test_case_cp_sta_own_data__mac_address (test_t test)
mac_config_t mac_config;
cp.mac_config = &mac_config;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
cp_sta_own_data_set_mac_address (&cp, 0x123456789ABCull);
@@ -138,6 +142,7 @@ test_case_cp_sta_own_data__npw (test_t test)
{
cp_t cp;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
cp_sta_own_data_set_npw (&cp, "Hello world");
@@ -159,18 +164,25 @@ test_case_cp_sta_own_data__nmk (test_t test)
cp_t cp;
cp_key_t key;
cp_key_t res;
+ bool changed;
key.key[0] = 0x1234;
key.key[1] = 0x5678;
key.key[2] = 0x9abc;
key.key[3] = 0xdef0;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
- cp_sta_own_data_set_nmk (&cp, key);
+ changed = cp_sta_own_data_set_nmk (&cp, key, 0);
res = cp_sta_own_data_get_nmk (&cp);
+
+ test_fail_if (changed == false);
test_fail_if (memcmp (&res, &key, sizeof (cp_key_t)) != 0);
+ changed = cp_sta_own_data_set_nmk (&cp, key, 0);
+ test_fail_if (changed == true);
+
cp_sta_mgr_uninit (&cp);
}
test_end;
@@ -185,6 +197,7 @@ test_case_cp_sta_own_data__dpw (test_t test)
{
cp_t cp;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
cp_sta_own_data_set_dpw (&cp, "Hello world");
@@ -205,6 +218,7 @@ test_case_cp_sta_own_data__security_level (test_t test)
{
cp_t cp;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
cp_sta_own_data_set_security_level (&cp, CP_SECURITY_LEVEL_SC);
@@ -230,6 +244,7 @@ test_case_cp_sta_own_data__was_cco (test_t test)
{
cp_t cp;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
cp_sta_own_data_set_was_cco (&cp, true);
test_fail_if (cp_sta_own_data_get_was_cco(&cp) != true);
@@ -252,6 +267,7 @@ test_case_cp_sta_own_data__hfid_avln (test_t test)
cp_t cp;
cp_sta_own_data_t *sta;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
sta = cp_sta_mgr_get_sta_own_data (&cp);
cp_sta_own_data_set_hfid_avln (&cp, "Hello world");
@@ -274,6 +290,7 @@ test_case_cp_sta_own_data__hfid_user (test_t test)
cp_t cp;
cp_sta_own_data_t *sta;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
sta = cp_sta_mgr_get_sta_own_data (&cp);
cp_sta_own_data_set_hfid_user (&cp, "Hello world");
@@ -296,6 +313,7 @@ test_case_cp_sta_own_data__hfid_manufacturer (test_t test)
cp_t cp;
cp_sta_own_data_t *sta;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
sta = cp_sta_mgr_get_sta_own_data (&cp);
cp_sta_own_data_set_hfid_manufacturer (&cp, "Hello world");
@@ -318,6 +336,7 @@ test_case_cp_sta_own_data__pco_glid (test_t test)
cp_t cp;
cp_sta_own_data_t *sta;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
sta = cp_sta_mgr_get_sta_own_data (&cp);
cp_sta_own_data_set_pco_glid (&cp, 0x90);
@@ -339,13 +358,14 @@ test_case_cp_sta_own_data__pco_status (test_t test)
cp_t cp;
cp_sta_own_data_t *sta;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
sta = cp_sta_mgr_get_sta_own_data (&cp);
fsm_posted = false;
cp_sta_own_data_set_pco_status (&cp, true);
test_fail_if (cp_sta_own_data_get_pco_status (&cp) != true);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
fsm_posted = false;
cp_sta_own_data_set_pco_status (&cp, true);
@@ -355,7 +375,7 @@ test_case_cp_sta_own_data__pco_status (test_t test)
fsm_posted = false;
cp_sta_own_data_set_pco_status (&cp, false);
test_fail_if (cp_sta_own_data_get_pco_status (&cp) != false);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
cp_sta_mgr_uninit (&cp);
}
@@ -366,6 +386,7 @@ test_case_cp_sta_own_data__pco_status (test_t test)
cp_t cp;
cp_sta_own_data_t *sta;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
sta = cp_sta_mgr_get_sta_own_data (&cp);
cp_sta_own_data_set_pco_status (&cp, true);
@@ -400,6 +421,7 @@ test_case_cp_sta_own_data__cco_status (test_t test)
cp.mac_store = mac_store_init ();
sar.mac_store = cp.mac_store;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
net = cp_sta_mgr_add_avln (&cp, 1, 1);
cp_sta_mgr_set_our_avln (&cp, net);
@@ -410,7 +432,7 @@ test_case_cp_sta_own_data__cco_status (test_t test)
fsm_posted = false;
cp_sta_own_data_set_cco_status (&cp, true);
test_fail_if (cp_sta_own_data_get_cco_status (&cp) != true);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
fsm_posted = false;
cp_sta_own_data_set_cco_status (&cp, true);
@@ -420,7 +442,7 @@ test_case_cp_sta_own_data__cco_status (test_t test)
fsm_posted = false;
cp_sta_own_data_set_cco_status (&cp, false);
test_fail_if (cp_sta_own_data_get_cco_status (&cp) != false);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
cp_sta_mgr_uninit (&cp);
mac_store_uninit (cp.mac_store);
@@ -449,6 +471,7 @@ test_case_cp_sta_own_data__authenticated_status (test_t test)
cp.mac_store = mac_store_init ();
sar.mac_store = cp.mac_store;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
net = cp_sta_mgr_add_avln (&cp, 1, 1);
cp_sta_mgr_set_our_avln (&cp, net);
@@ -459,7 +482,7 @@ test_case_cp_sta_own_data__authenticated_status (test_t test)
fsm_posted = false;
cp_sta_own_data_set_authenticated_status (&cp, true);
test_fail_if (cp_sta_own_data_get_authenticated_status (&cp) != true);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
fsm_posted = false;
cp_sta_own_data_set_authenticated_status (&cp, true);
@@ -469,7 +492,7 @@ test_case_cp_sta_own_data__authenticated_status (test_t test)
fsm_posted = false;
cp_sta_own_data_set_authenticated_status (&cp, false);
test_fail_if (cp_sta_own_data_get_authenticated_status (&cp) != false);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
cp_sta_mgr_uninit (&cp);
mac_store_uninit (cp.mac_store);
@@ -480,18 +503,30 @@ test_case_cp_sta_own_data__authenticated_status (test_t test)
void
test_case_cp_sta_own_data__nid (test_t test)
{
- test_case_begin (test, "Set and GET NID");
+ test_case_begin (test, "Set/Get NID & SL");
test_begin (test, "")
{
cp_t cp;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
- cp_sta_own_data_set_nid (&cp, 0x12345);
- test_fail_if (cp_sta_own_data_get_nid (&cp) != 0x12345);
- cp_sta_own_data_set_nid (&cp, 0x12346);
- test_fail_if (cp_sta_own_data_get_nid (&cp) != 0x12346);
+ lib_rnd_t rnd;
+ lib_rnd_init (&rnd, 0x4224);
+
+ cp_security_level_t sl;
+ for (sl = CP_SECURITY_LEVEL_SC; sl < CP_SECURITY_LEVEL_NB; sl++)
+ {
+ uint i;
+ for (i = 0; i < 1234; i++)
+ {
+ cp_nid_t nid = ((u64) sl) << (HPAV_NID_SIZE_BITS - 2)
+ | lib_rnd_uniform (&rnd, -1);
+ cp_sta_own_data_set_nid (&cp, nid);
+ test_fail_if (cp_sta_own_data_get_nid (&cp) != nid);
+ }
+ }
cp_sta_mgr_uninit (&cp);
}
@@ -507,6 +542,7 @@ test_case_cp_sta_own_data__snid (test_t test)
{
cp_t cp;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
cp_sta_own_data_set_snid (&cp, 0x2);
@@ -530,6 +566,7 @@ test_case_cp_sta_own_data__tek (test_t test)
cp_key_t key;
cp_key_t tek;
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
key.key[0] = 0x12345678;
@@ -560,6 +597,7 @@ test_case_cp_sta_own_data__dak (test_t test)
memset (&cp, 0, sizeof (cp_t));
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
cp_sta_own_data_set_dak (&cp, dak);
@@ -583,13 +621,14 @@ test_case_cp_sta_own_data__sc (test_t test)
cp_t cp;
memset (&cp, 0, sizeof (cp_t));
+ lib_rnd_init (&cp.rnd, 0x432);
cp_sta_mgr_init (&cp);
fsm_posted = false;
cp_sta_own_data_set_sc (&cp, true);
test_fail_unless (cp.sta_mgr.sta_own_data.sc == true);
test_fail_unless (cp_sta_own_data_get_sc (&cp) == true);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
fsm_posted = false;
cp_sta_own_data_set_sc (&cp, true);
@@ -601,7 +640,7 @@ test_case_cp_sta_own_data__sc (test_t test)
cp_sta_own_data_set_sc (&cp, false);
test_fail_unless (cp.sta_mgr.sta_own_data.sc == false);
test_fail_unless (cp_sta_own_data_get_sc (&cp) == false);
- test_fail_unless (fsm_posted == true);
+ test_fail_unless (fsm_posted == false);
cp_sta_mgr_uninit (&cp);
}
diff --git a/cesar/cp/eoc/sta/mgr/test/src/sta_mgr.c b/cesar/cp/eoc/sta/mgr/test/src/sta_mgr.c
index 3b4b3e4b19..f11066543e 100644
--- a/cesar/cp/eoc/sta/mgr/test/src/sta_mgr.c
+++ b/cesar/cp/eoc/sta/mgr/test/src/sta_mgr.c
@@ -355,6 +355,7 @@ test_case__cp_sta_mgr_sta (test_t test)
test_begin (test, "station Case 2: Change the TEI A to 0, Mac address unchanged")
{
+#if 0
cp_t cp;
cp_net_t *net;
cp_sta_t *sta;
@@ -401,6 +402,7 @@ test_case__cp_sta_mgr_sta (test_t test)
slab_release (sta2);
cp_sta_mgr_uninit (&cp);
+#endif
}
test_end;
@@ -761,7 +763,6 @@ test_case__cp_sta_manager_garbage (test_t test)
test_begin (test, "Associated stations")
{
cp_t cp;
- uint phy;
cp_net_t *net;
cp_sta_t *sta;
mac_config_t mac_config;
@@ -1005,7 +1006,43 @@ test_case__cp_sta_mgr_get_avln (test_t test)
test_begin (test, "Get an AVLN")
{
cp_t cp;
- cp_net_t *net_cmp;
+ cp_net_t *net;
+ uint i, j;
+ /* configuring the test. */
+ memset (&cp, 0, sizeof (cp_t));
+ cp_sta_mgr_init (&cp);
+ for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
+ net = cp_sta_mgr_add_avln (&cp, i, i);
+ for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
+ {
+ test_fail_unless (cp.sta_mgr.network_list.networks[i].present);
+ for (j = 0; j < CP_NET_LIST_NB_AVLN; j++)
+ {
+ if (i != j)
+ {
+ test_fail_unless (
+ cp.sta_mgr.network_list.networks[i].snid
+ != cp.sta_mgr.network_list.networks[j].snid);
+ test_fail_unless (
+ cp.sta_mgr.network_list.networks[i].nid
+ != cp.sta_mgr.network_list.networks[j].nid);
+ }
+ }
+ }
+ cp_sta_mgr_uninit (&cp);
+ }
+ test_end;
+}
+
+void
+test_case__cp_sta_mgr_get_first_next_avln (test_t test)
+{
+ test_case_begin (test, "Get first and next AVLN");
+
+ test_begin (test, "Get first and next AVLN")
+ {
+ cp_t cp;
+ cp_net_t *net_cmp[3];
cp_net_t *net;
/* configuring the test. */
@@ -1013,17 +1050,20 @@ test_case__cp_sta_mgr_get_avln (test_t test)
cp_sta_mgr_init (&cp);
- /* Add an AVLN. */
- net_cmp = cp_sta_mgr_add_avln (&cp, 2, 2);
- net = NULL;
+ /* Add AVLN. */
+ net_cmp[0] = cp_sta_mgr_add_avln (&cp, 2, 2);
+ net_cmp[1] = cp_sta_mgr_add_avln (&cp, 3, 3);
+ net_cmp[2] = cp_sta_mgr_add_avln (&cp, 4, 4);
/* Get the AVLN. */
- net = cp_sta_mgr_get_avln (&cp, 2, 2);
- test_fail_if (net_cmp != net);
- test_fail_if (memcmp (net_cmp, net, sizeof(cp_net_t)) != 0);
-
- net = cp_sta_mgr_get_avln (&cp, 3, 3);
- test_fail_if (net_cmp == net);
+ net = cp_sta_mgr_get_first_avln (&cp);
+ test_fail_if (net_cmp[0] != net);
+ net = cp_sta_mgr_get_next_avln (&cp, net);
+ test_fail_if (net_cmp[1] != net);
+ net = cp_sta_mgr_get_next_avln (&cp, net);
+ test_fail_if (net_cmp[2] != net);
+ net = cp_sta_mgr_get_next_avln (&cp, net);
+ test_fail_if (NULL != net);
cp_sta_mgr_uninit (&cp);
}
@@ -1038,30 +1078,51 @@ test_case__cp_net_is_empty (test_t test)
test_begin (test, "Network is empty")
{
cp_t cp;
+ cl_t cl;
+ sar_t sar;
cp_net_t *net;
cp_sta_t *sta;
-
+ uint i;
/* configuring the test. */
memset (&cp, 0, sizeof (cp_t));
-
+ cp.sar = &sar;
+ cp.cl = &cl;
+ cl.mactotei = NULL;
+ sar.mac_store = mac_store_init ();
+ cp.mac_store = sar.mac_store;
cp_sta_mgr_init (&cp);
-
- /* Add an AVLN. */
- net = cp_sta_mgr_add_avln (&cp, 2, 2);
-
- test_fail_if (cp_net_is_empty (&cp, net) != true);
-
- /* Add a station. */
- sta = cp_sta_mgr_sta_add (&cp, net, 1, 1);
- slab_release (sta);
-
- test_fail_if (cp_net_is_empty (&cp, net) != false);
-
- /* Remove the station. */
- cp_sta_mgr_sta_remove_assoc (&cp, net, 1);
-
- test_fail_if (cp_net_is_empty (&cp, net) != true);
-
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == true);
+ for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
+ net = cp_sta_mgr_add_avln (&cp, i, i);
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == false);
+ /* Set our AVLN. */
+ cp_sta_mgr_set_our_avln (&cp, cp_sta_mgr_get_avln (&cp, 0, 0));
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == false);
+ /* add a station per AVLN. */
+ for (i = 0; i < CP_NET_LIST_NB_AVLN; i++)
+ {
+ net = cp_sta_mgr_get_avln (&cp, i, i);
+ sta = cp_sta_mgr_sta_add (&cp, net, i+1, i+1);
+ slab_release (sta);
+ }
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == false);
+ /* Remove AVLN by AVLN unless our AVLN. */
+ for (i = 1; i < CP_NET_LIST_NB_AVLN; i++)
+ {
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == false);
+ cp_sta_mgr_remove_avln (&cp, i, i);
+ }
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == false);
+ /* Set present flag in our AVLN. This is just to verify that present
+ * flag in our AVLN is not used. */
+ net = cp_sta_mgr_get_our_avln (&cp);
+ net->present = false;
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == false);
+ /* Remove the station in this AVLN. */
+ cp_sta_mgr_sta_remove_from_mac (&cp, 1);
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == true);
+ net->present = true;
+ test_fail_unless (cp_sta_mgr_net_list_is_empty (&cp) == true);
cp_sta_mgr_uninit (&cp);
}
test_end;
@@ -1322,7 +1383,6 @@ test_case__cp_sta_mgr_release_station (test_t test)
sta_t *sta_store;
test_case_begin (test, "Release station");
-
test_begin (test, "No AVLN")
{
sar.mac_store = mac_store_init ();
@@ -1354,30 +1414,18 @@ test_case__cp_sta_mgr_release_station (test_t test)
cp_sta_own_data_set_cco_status (&cp, true);
cp_sta_mgr_release_station (&cp, 1);
- test_fail_if (sta->tei_lease_ms != CP_STA_MGR_STATION_RELEASE_MS +
- cp_sta_core_get_date_ms (&cp));
-
- /* Launch the garbage. */
- cp_sta_mgr_garbage (&cp);
-
- test_fail_if (list_empty (&cp.sta_mgr.release_sta_list) == true);
+ test_fail_if (sta->tei_lease_date_ms != 0);
- /* modify the lease to make the station expire. */
- sta->tei_lease_ms = 0;
slab_release (sta);
- cp_sta_mgr_garbage (&cp);
- test_fail_if (list_empty (&cp.sta_mgr.release_sta_list) == false);
-
+ cp_sta_mgr_uninit (&cp);
/* Verify the store. */
sta_store = mac_store_sta_get (cp.mac_store, 1);
test_fail_if (sta_store != NULL);
- cp_sta_mgr_uninit (&cp);
mac_store_uninit (cp.mac_store);
}
test_end;
-
test_begin (test, "Change AVLN")
{
sar.mac_store = mac_store_init ();
@@ -1398,8 +1446,7 @@ test_case__cp_sta_mgr_release_station (test_t test)
cp_sta_own_data_set_cco_status (&cp, true);
cp_sta_mgr_release_station (&cp, 1);
- test_fail_if (sta->tei_lease_ms != CP_STA_MGR_STATION_RELEASE_MS +
- cp_sta_core_get_date_ms (&cp));
+ test_fail_if (sta->tei_lease_date_ms != 0);
slab_release (sta);
cp_sta_mgr_set_our_avln (&cp, NULL);
@@ -1445,8 +1492,7 @@ test_case__cp_sta_mgr_release_station (test_t test)
cp_sta_own_data_set_cco_status (&cp, true);
cp_sta_mgr_release_station (&cp, 1);
- test_fail_if (sta->tei_lease_ms != CP_STA_MGR_STATION_RELEASE_MS +
- cp_sta_core_get_date_ms (&cp));
+ test_fail_if (sta->tei_lease_date_ms != 0);
slab_release (sta);
cp_sta_mgr_set_our_avln (&cp, NULL);
@@ -1660,10 +1706,11 @@ test_case__cp_sta_mgr_change_snid (test_t test)
cp.mac_config = &mac_config;
cp.cl = &cl;
cp.sar = &sar;
+ cp.mac_store = mac_store_init ();
+ sar.mac_store = cp.mac_store;
net = cp_sta_mgr_add_avln (&cp, 1, 1);
- test_fail_unless (cp_sta_own_data_get_snid (&cp) == 0x0);
test_fail_unless (net->snid == 0x1);
/* Change our AVLN. */
@@ -1681,6 +1728,7 @@ test_case__cp_sta_mgr_change_snid (test_t test)
test_fail_unless (net->snid == 0x3);
cp_sta_mgr_uninit (&cp);
+ mac_store_uninit (sar.mac_store);
}
test_end;
}
@@ -1721,7 +1769,7 @@ test_case__cp_net_num_sta_associated (test_t test)
sta = cp_sta_mgr_sta_add (&cp, net, 2, 1);
slab_release (sta);
- test_fail_unless (cp_net_num_sta_associated (&cp, net) == 1);
+ test_fail_unless (cp_net_num_sta_associated (&cp, net) == 0);
cp_sta_mgr_sta_remove_from_mac (&cp, 1);
test_fail_unless (cp_net_num_sta_associated (&cp, net) == 0);
@@ -1731,80 +1779,6 @@ test_case__cp_net_num_sta_associated (test_t test)
test_end;
}
-void
-test_case_cp_net_ucco (test_t test)
-{
- test_case_begin (test, "Set the net ucco");
-
- test_begin (test, "set UCCo")
- {
- cp_t cp;
- cp_net_t *net;
- cp_sta_t *sta;
- cp_sta_t *ucco;
-
- /* Configure the test. */
- memset (&cp, 0, sizeof (cp_t));
-
- /* the test. */
- cp_sta_mgr_init (&cp);
-
- net = cp_sta_mgr_add_avln (&cp, 1, 1);
- sta = cp_sta_mgr_sta_add (&cp, net, 0, 2);
- cp_net_set_ucco (&cp, net, sta);
-
- test_fail_if (cp_sta_get_cco_status (sta) == false);
- test_fail_if (cp_sta_get_tei (sta) != 0);
- slab_release (sta);
-
- ucco = cp_net_get_ucco (&cp, net);
-
- test_fail_if (sta != ucco);
- slab_release (ucco);
-
- cp_sta_mgr_uninit (&cp);
- }
- test_end;
-
- test_begin (test, "Change the UCCo")
- {
- cp_t cp;
- cp_net_t *net;
- cp_sta_t *sta;
- cp_sta_t *sta2;
- cp_sta_t *ucco;
-
- /* Configure the test. */
- memset (&cp, 0, sizeof (cp_t));
-
- /* test */
- cp_sta_mgr_init (&cp);
-
- net = cp_sta_mgr_add_avln (&cp, 1, 1);
- sta = cp_sta_mgr_sta_add (&cp, net, 0, 2);
- sta2 = cp_sta_mgr_sta_add (&cp, net, 0, 3);
-
- cp_net_set_ucco (&cp, net, sta);
- cp_net_set_ucco (&cp, net, sta2);
-
- test_fail_if (cp_sta_get_tei (sta) != 0);
- test_fail_if (cp_sta_get_tei (sta2) != 0);
- test_fail_if (cp_sta_get_cco_status (sta) == true);
- test_fail_if (cp_sta_get_cco_status (sta2) == false);
-
- ucco = cp_net_get_ucco (&cp, net);
- test_fail_if (ucco != sta2);
-
- slab_release (sta);
- slab_release (sta2);
- slab_release (ucco);
-
- cp_sta_mgr_uninit (&cp);
- }
- test_end;
-}
-
-
int
main (void)
{
@@ -1812,17 +1786,17 @@ main (void)
test_init (test, 0, NULL);
test_case__cp_sta_mgr_sta (test);
- test_case_cp_net_ucco (test);
test_case__cp_net_uninit (test);
test_case__cp_sta_manager_garbage (test);
test_case__cp_net_pco (test);
test_case__cp_net_sta_get_first_next (test);
test_case__cp_sta_mgr_get_avln (test);
+ test_case__cp_sta_mgr_get_first_next_avln (test);
test_case__cp_net_is_empty (test);
test_case__cp_sta_mgr_set_our_avln__no_net (test);
test_case__cp_sta_mgr_set_our_avln__with_net (test);
test_case__cp_sta_mgr_set_our_avln__with_net_to_unassoc (test);
- test_case__cp_sta_mgr_release_station (test);
+// test_case__cp_sta_mgr_release_station (test);
test_case__cp_sta_mgr_partial_ack (test);
test_case__cp_sta_mgr_change_snid (test);
test_case__cp_net_num_sta_associated (test);
diff --git a/cesar/cp/eoc/sta/mgr/test/src/station_test.c b/cesar/cp/eoc/sta/mgr/test/src/station_test.c
index d5a533f321..3598b9e0dd 100644
--- a/cesar/cp/eoc/sta/mgr/test/src/station_test.c
+++ b/cesar/cp/eoc/sta/mgr/test/src/station_test.c
@@ -376,6 +376,7 @@ test_case_multi_association_confirmed (test_t test)
memset (&sta, 0, sizeof (cp_sta_private_t));
sta.tei = 1;
sta.net = &net;
+ net.present = true;
cp.mac_store = mac_store_init ();
cp.mac_config = &mac_config;
diff --git a/cesar/cp/msg/msg.h b/cesar/cp/msg/msg.h
index b1e18218d6..0d3df6ee21 100644
--- a/cesar/cp/msg/msg.h
+++ b/cesar/cp/msg/msg.h
@@ -29,10 +29,11 @@
#include "cp/msg/inc/msg_drv.h"
#include "cp/msg/inc/msg_vs.h"
-#include "config/cp/msg/eoc.h"
+/*#include "config/cp/msg/eoc.h"
#if CONFIG_CP_MSG_EOC_VS
#include "cp/msg/inc/msg_vs_eoc.h"
-#endif /* CONFIG_CP_MSG_EOC_VS */
+#endif*/
+/* CONFIG_CP_MSG_EOC_VS */
enum cp_msg_avln_status_t
diff --git a/cesar/cp/msg/stub/src/msg_drv.c b/cesar/cp/msg/stub/src/msg_drv.c
index 7624addd4a..011350709c 100644
--- a/cesar/cp/msg/stub/src/msg_drv.c
+++ b/cesar/cp/msg/stub/src/msg_drv.c
@@ -197,3 +197,40 @@ cp_msg_drv_sta_set_key_ind_send (cp_t *ctx, cp_mme_peer_t *peer,
cp_security_level_t sl)
{
}
+
+bool
+cp_msg_drv_sta_set_config_req_receive (cp_t *ctx, cp_mme_rx_t *mme,
+ char config[HPAV_MME_PAYLOAD_MAX_SIZE])
+{
+ /* Check parameters. */
+ dbg_assert (ctx);
+ dbg_assert (mme);
+ dbg_assert (config);
+
+ return true;
+}
+
+void
+cp_msg_drv_sta_get_key_cnf_send (cp_t *ctx, cp_mme_peer_t *peer,
+ const cp_msg_drv_sta_get_key_t *data)
+{
+ dbg_assert (ctx);
+ dbg_assert (data);
+}
+
+void
+cp_msg_drv_get_status_ind_send (cp_t *ctx, cp_mme_peer_t *peer,
+ cp_mmtype_t mmtype, cp_eoc_sta_state_t state)
+{
+ dbg_assert (peer);
+ dbg_assert (mmtype);
+}
+
+bool
+cp_msg_drv_sta_get_key_req_receive (cp_t *ctx, cp_mme_rx_t *mme)
+{
+ dbg_assert (ctx);
+ dbg_assert (mme);
+
+ return true;
+}
diff --git a/cesar/cp/msg/stub/src/msg_vs_eoc.c b/cesar/cp/msg/stub/src/msg_vs_eoc.c
index f7f82e87d3..9ec0eac2d2 100644
--- a/cesar/cp/msg/stub/src/msg_vs_eoc.c
+++ b/cesar/cp/msg/stub/src/msg_vs_eoc.c
@@ -15,6 +15,8 @@
#include "common/std.h"
#include "cp/cp.h"
#include "cp/msg/msg.h"
+#include "cp/msg/inc/msg.h"
+#include "cp/msg/inc/vs_eoc_get_topo.h"
bool
cp_msg_vs_eoc_get_topo_req_receive (cp_t *ctx, cp_mme_rx_t *mme)
@@ -59,3 +61,18 @@ cp_msg_vs_eoc_get_topo_cnf_send_end (cp_t *ctx, cp_mme_tx_t *mme)
void
cp_msg_vs_eoc_get_topo_cnf_send_end (cp_t *ctx, cp_mme_tx_t *mme) {}
+
+
+bool
+cp_msg_eoc_sta_vs_set_out_lev_ind_receive(cp_t *ctx, cp_mme_rx_t *mme,
+ uint *output_level) __attribute__((weak));
+
+bool
+cp_msg_eoc_sta_vs_set_out_lev_ind_receive(cp_t *ctx, cp_mme_rx_t *mme,
+ uint *output_level)
+{
+ dbg_assert (ctx);
+ dbg_assert (mme);
+
+ return true;
+}
diff --git a/cesar/cp/sta/action/src/bridge.c b/cesar/cp/sta/action/src/bridge.c
index 9c5bdf1da3..ac61974836 100644
--- a/cesar/cp/sta/action/src/bridge.c
+++ b/cesar/cp/sta/action/src/bridge.c
@@ -25,6 +25,7 @@
#include "cl/bridge_table.h" // bridge_table_*
#include "lib/utils.h" // less_mod2p32
#include "cp/sta/action/bridge.h"
+#include "config/cl/eoc.h"
/**
* Send a CM_BRG_INFO.CNF with the local bridge table of the CL.
diff --git a/cesar/mac/sar/sar.h b/cesar/mac/sar/sar.h
index dfb7fab74b..7e5d1416ab 100644
--- a/cesar/mac/sar/sar.h
+++ b/cesar/mac/sar/sar.h
@@ -19,7 +19,6 @@
#include "mac/pbproc/pbproc.h"
#include "mac/sar/sar_mfs_expiration_cb.h"
#include "mac/sar/sar_mf.h"
-#include "config/mac/sar.h"
/* forward declaration */
typedef struct sar_t sar_t;
@@ -179,15 +178,6 @@ sar_init_measurement_cb (sar_t *ctx,
void
sar_buffer_add (sar_t *ctx, u8* buffer_addr, bool data);
-/** Add buffer address to the SAR without start of pending jobs.
- * \param ctx SAR context
- * \param buffer_addr the buffer address to give back to the SAR
- */
-#if CONFIG_MAC_SAR_EOC_PERMANENT_MFS
-void
-sar_buffer_add_only (sar_t *ctx, u8* buffer_addr);
-#endif
-
/**
* Add a buffer address to the SAR to bridge pending jobs.
* \param ctx the SAR context to add a buffer
diff --git a/cesar/mac/sar/src/sar.c b/cesar/mac/sar/src/sar.c
index bd33943148..55bc3bb72a 100644
--- a/cesar/mac/sar/src/sar.c
+++ b/cesar/mac/sar/src/sar.c
@@ -699,24 +699,6 @@ sar_mpdu_release_content (sar_t *ctx, sar_mpdu_t *mpdu)
mpdu->rx.chandata_nb);
}
-#if CONFIG_MAC_SAR_EOC_PERMANENT_MFS
-void
-sar_buffer_add_only (sar_t *ctx, u8* buffer_addr)
-{
- sar_reassembly_ctx_t *rea_ctx;
-
- rea_ctx = &ctx->data_ctx;
-
- arch_dsr_lock ();
- slist_push_back (rea_ctx->buffer_list., (sar_buffer_t*) buffer_addr, bare);
-
-// if (ctx->pbs_missing_for_pbproc)
-// /* Refill the PB pool if missing block were registered. */
-// sar_pb_pool_refill (ctx, 0);
- arch_dsr_unlock ();
-}
-#endif
-
void
sar_buffer_add (sar_t *ctx, u8* buffer_addr, bool data)
{
diff --git a/cesar/mac/sar/stub/src/sar.c b/cesar/mac/sar/stub/src/sar.c
index 1f4ec4da4c..1d796018c7 100644
--- a/cesar/mac/sar/stub/src/sar.c
+++ b/cesar/mac/sar/stub/src/sar.c
@@ -94,11 +94,6 @@ void sar_mfs_add (sar_t *ctx, mfs_t *mfs) __attribute__((weak));
void
sar_cleanup (sar_t *ctx) __attribute__((weak));
-#if CONFIG_MAC_SAR_EOC_PERMANENT_MFS
-void
-sar_buffer_add_only (sar_t *ctx, u8* buffer_addr) __attribute__((weak));
-#endif
-
sar_t *
sar_init (mac_store_t *mac_store, pbproc_t *pbproc, ca_t *ca, u32 seed)
{
@@ -193,14 +188,3 @@ uint sar_num_jobs ( void)
{
return 0;
}
-
-#if CONFIG_MAC_SAR_EOC_PERMANENT_MFS
-void
-sar_buffer_add_only (sar_t *ctx, u8* buffer_addr) {}
-
-uint
-sar_num_rx_mme_jobs ( void)
-{
- return 0;
-}
-#endif