summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémy Dufour2011-03-03 18:11:53 +0100
committerJérémy Dufour2011-03-04 11:41:01 +0100
commit2500f8b7bfdf084b5b5583bd33e5a6e92fac4212 (patch)
tree530f8105a2766fd62158cd2479215db411f0bb8a
parent50eab6d8ccb2b26c3ec4de0c2e098c7e51a03907 (diff)
cesar/ce/tx: use nominal beacon period for intervals check, closes #2340
-rw-r--r--cesar/ce/tx/src/mme.c9
-rw-r--r--cesar/ce/tx/test/Makefile6
-rw-r--r--cesar/ce/tx/test/src/stub.c27
-rw-r--r--cesar/ce/tx/test/src/test_mme.c8
4 files changed, 13 insertions, 37 deletions
diff --git a/cesar/ce/tx/src/mme.c b/cesar/ce/tx/src/mme.c
index 41076a712e..d1034525a0 100644
--- a/cesar/ce/tx/src/mme.c
+++ b/cesar/ce/tx/src/mme.c
@@ -214,10 +214,11 @@ ce_tx_mme_read_interval_list (cp_t *ctx, bitstream_t *mme_bitstream,
/* Error. */
return false;
}
- /* Compute the beacon period in Allocation Time Unit. */
- uint beacon_period_length_atu =
- bsu_aclf_beacon_period_atu (ctx->bsu_aclf);
- /* Check count is correct and last interval is over beacon period. */
+ /* Compute the nominal beacon period in Allocation Time Unit. */
+ uint beacon_period_length_atu
+ = MAC_TCK_TO_ATU (ctx->bsu_aclf->beacon_period_theo_tck);
+ /* Check count is correct
+ and last interval is over nominal beacon period. */
if (last_index != int_count
|| beacon_period_length_atu > offset_atu)
return false;
diff --git a/cesar/ce/tx/test/Makefile b/cesar/ce/tx/test/Makefile
index 83caf147f9..a8a655d3af 100644
--- a/cesar/ce/tx/test/Makefile
+++ b/cesar/ce/tx/test/Makefile
@@ -12,13 +12,13 @@ common_MODULES = lib mac/common ce/tx cp/sta/mgr \
# For host program.
HOST_PROGRAMS = test_expiration test_mme test_tm
-test_expiration_SOURCES = test_expiration.c mme.c stub.c
+test_expiration_SOURCES = test_expiration.c mme.c
test_expiration_MODULES = $(common_MODULES)
-test_mme_SOURCES = test_mme.c mme.c stub.c
+test_mme_SOURCES = test_mme.c mme.c
test_mme_MODULES = $(common_MODULES)
-test_tm_SOURCES = test_tm.c stub.c
+test_tm_SOURCES = test_tm.c
test_tm_MODULES = $(common_MODULES)
# Include main Makefile.
diff --git a/cesar/ce/tx/test/src/stub.c b/cesar/ce/tx/test/src/stub.c
deleted file mode 100644
index be623e6e49..0000000000
--- a/cesar/ce/tx/test/src/stub.c
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Cesar project {{{
- *
- * Copyright (C) 2010 Spidcom
- *
- * <<<Licence>>>
- *
- * }}} */
-/**
- * \file ce/tx/test/src/stub.c
- * \brief Stub for test.
- * \ingroup test
- */
-#include "common/std.h"
-
-#include "bsu/aclf/aclf.h"
-
-u32
-bsu_aclf_beacon_period_tck (bsu_aclf_t *ctx)
-{
- return 0x4242;
-}
-
-u32
-bsu_aclf_beacon_period_atu (bsu_aclf_t *ctx)
-{
- return 3907;
-}
diff --git a/cesar/ce/tx/test/src/test_mme.c b/cesar/ce/tx/test/src/test_mme.c
index cd03b1d484..33ba1e2ca9 100644
--- a/cesar/ce/tx/test/src/test_mme.c
+++ b/cesar/ce/tx/test/src/test_mme.c
@@ -188,6 +188,8 @@ mme_test_suite (test_t t)
cp.sar = &sar;
cp.mac_config->tonemask_info.carrier_nb = tonemask_default
(cp.mac_config->tonemask_info.tonemask);
+ bsu_aclf_t bsu_aclf = { .beacon_period_theo_tck = 1000000 };
+ cp.bsu_aclf = &bsu_aclf;
/* Create our net/AVLN. */
const cp_tei_t my_tei = 42;
@@ -506,7 +508,7 @@ mme_test_suite (test_t t)
intervals.interval[3].end_offset_atu = 4;
intervals.interval[4].tmi = 0xFE;
intervals.interval[4].end_offset_atu =
- bsu_aclf_beacon_period_atu (cp.bsu_aclf);
+ MAC_TCK_TO_ATU (cp.bsu_aclf->beacon_period_theo_tck);
u32 tmi_list = 1 << 4;
ce_test_mme_cm_chan_est_ind_build (mme_data, header, 1, tmi_list, intervals,
0x0, 0, 0, 0, 0, default_tone_mask);
@@ -537,7 +539,7 @@ mme_test_suite (test_t t)
intervals.interval[3].end_offset_atu = 4;
intervals.interval[4].tmi = 0xFE;
intervals.interval[4].end_offset_atu =
- bsu_aclf_beacon_period_atu (cp.bsu_aclf)
+ MAC_TCK_TO_ATU (cp.bsu_aclf->beacon_period_theo_tck);
- MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK) / 2;
u32 tmi_list = 1 << 4;
ce_test_mme_cm_chan_est_ind_build (mme_data, header, 1, tmi_list, intervals,
@@ -582,7 +584,7 @@ mme_test_suite (test_t t)
intervals.intervals_nb = 1;
intervals.interval[0].tmi = 8;
intervals.interval[0].end_offset_atu =
- bsu_aclf_beacon_period_atu (cp.bsu_aclf);
+ MAC_TCK_TO_ATU (cp.bsu_aclf->beacon_period_theo_tck);
u32 tmi_list = 1 << 4;
ce_test_mme_cm_chan_est_ind_build (mme_data, header, 1, tmi_list, intervals,
0x0, 0, 0, 0, 0, default_tone_mask);