summaryrefslogtreecommitdiff
path: root/cesar/cp2
diff options
context:
space:
mode:
authorchertier2008-06-12 13:37:16 +0000
committerchertier2008-06-12 13:37:16 +0000
commit93024f349ad564f412a4aa184ab144b9987584c1 (patch)
tree37b9d85278b0db1dbe7ca039a649a12745da2fa7 /cesar/cp2
parent6d4183aa871b9cb0d244e1233faca74cef457b8a (diff)
updated sta core and sta core test accordingly to cp_cl_interf modification,
and managing/verifying counters used in sta core thread terminate event test git-svn-id: svn+ssh://pessac/svn/cesar/trunk@2302 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/cp2')
-rw-r--r--cesar/cp2/sta/core/src/core.c19
-rw-r--r--cesar/cp2/sta/core/test/overide/cp2/cl_interf/cl_interf.h8
-rw-r--r--cesar/cp2/sta/core/test/overide/cp2/cl_interf/src/cl_interf.c12
3 files changed, 26 insertions, 13 deletions
diff --git a/cesar/cp2/sta/core/src/core.c b/cesar/cp2/sta/core/src/core.c
index 402aab87a9..9c106dcd66 100644
--- a/cesar/cp2/sta/core/src/core.c
+++ b/cesar/cp2/sta/core/src/core.c
@@ -89,6 +89,8 @@ extern int count_of_recv_beacon_events;
extern int count_of_beacon_processing;
extern int count_of_garbage_collector_events;
extern int count_of_garbage_collector_processing;
+extern int count_of_cp_thread_terminate_events;
+extern int count_of_cp_thread_terminate_processing;
#endif
/**
@@ -235,6 +237,9 @@ cp_sta_core_signal_garbage_collector_event(cp_t *cp_ctx)
void
cp_sta_core_signal_terminate_thread_event(cp_t *cp_ctx)
{
+#ifdef CP_STA_CORE_UNIT_TEST
+ count_of_cp_thread_terminate_events++;
+#endif
dbg_assert(cp_ctx);
cyg_flag_setbits (&cp_ctx->sta_core.wait_event_core_flag, CP_STA_CORE_EVENT_FLAG_TERMINATE);
}
@@ -584,7 +589,7 @@ void
cp_sta_core_run_mme_processing(cp_t *cp_ctx)
{
/* call the dedicated function in CP-CL interface module */
- (void) cp_cl_interf_give_last_mme(cp_ctx);
+ cp_cl_interf_process_mme(cp_ctx);
}
/**
@@ -754,7 +759,7 @@ cp_sta_core_wait_event_loop(cp_t *cp_ctx)
cp_sta_core_stop_timed_or_cyclic_event(cp_ctx, &sta_core_garbage_collector_event);
cyg_flag_destroy(&cp_ctx->sta_core.wait_event_core_flag);
#if DEBUG
- diag_printf("%u %s() : CP station thread terminating, not waiting for events anymore (@core_event_flag=0x%08lx ; flag_mask=0x%08lx)...\n",
+ diag_printf("%u %s() : CP sta core thread terminating, not waiting for events anymore (@core_event_flag=0x%08lx ; flag_mask=0x%08lx)...\n",
cyg_hal_sys_getpid(),__FUNCTION__,(unsigned long)&cp_ctx->sta_core.wait_event_core_flag,(unsigned long)flag_mask);
#endif
}
@@ -774,6 +779,7 @@ cp_sta_core_wait_event_loop(cp_t *cp_ctx)
void cp_sta_core_cp_thread(cyg_addrword_t data)
{
cp_t *cp_ctx = (cp_t *)data;
+
#if DEBUG
diag_printf("%u %s() : CP sta core thread entry-point...\n",
cyg_hal_sys_getpid(),__FUNCTION__);
@@ -790,4 +796,13 @@ void cp_sta_core_cp_thread(cyg_addrword_t data)
// run the wait-event loop of the thread...
cp_sta_core_wait_event_loop(cp_ctx);
+
+#ifdef CP_STA_CORE_UNIT_TEST
+ count_of_cp_thread_terminate_processing++;
+#endif
+
+#if DEBUG
+ diag_printf("%u %s() : CP sta core thread terminated.\n",
+ cyg_hal_sys_getpid(),__FUNCTION__);
+#endif
}
diff --git a/cesar/cp2/sta/core/test/overide/cp2/cl_interf/cl_interf.h b/cesar/cp2/sta/core/test/overide/cp2/cl_interf/cl_interf.h
index d7f1107f03..330107dd6e 100644
--- a/cesar/cp2/sta/core/test/overide/cp2/cl_interf/cl_interf.h
+++ b/cesar/cp2/sta/core/test/overide/cp2/cl_interf/cl_interf.h
@@ -24,13 +24,13 @@ typedef struct cp_cl_interf_t cp_cl_interf_t;
BEGIN_DECLS
/**
- * return the last received and completed mme.
+ * Process the MME received.
*
* \param ctx the cp context
- * \return mme_rx_t the mme context (for unit test purpose only)
+ *
*/
-cp_mme_rx_t *
-cp_cl_interf_give_last_mme(cp_t *ctx);
+void
+cp_cl_interf_process_mme(cp_t *ctx);
/**
* this function will remove expired block of fragmented mme.
diff --git a/cesar/cp2/sta/core/test/overide/cp2/cl_interf/src/cl_interf.c b/cesar/cp2/sta/core/test/overide/cp2/cl_interf/src/cl_interf.c
index ca5751a231..f542d96695 100644
--- a/cesar/cp2/sta/core/test/overide/cp2/cl_interf/src/cl_interf.c
+++ b/cesar/cp2/sta/core/test/overide/cp2/cl_interf/src/cl_interf.c
@@ -16,22 +16,20 @@
#include "common/std.h"
#include "cp2/cl_interf/cl_interf.h"
-static cp_mme_rx_t cp_mme_rx;
extern int count_of_mme_processing;
extern int count_of_cl_interf_garbage_processing;
/**
- * return the last received and completed mme.
+ * Process the MME received.
+ *
+ * \param ctx the cp context
*
- * \param ctx the cp context
- * \return mme_rx_t the mme context (for unit test purpose only)
*/
-cp_mme_rx_t *
-cp_cl_interf_give_last_mme(cp_t *ctx)
+void
+cp_cl_interf_process_mme(cp_t *ctx)
{
dbg_assert(ctx);
count_of_mme_processing++;
- return &cp_mme_rx;
}
/**