summaryrefslogtreecommitdiff
path: root/cesar
diff options
context:
space:
mode:
Diffstat (limited to 'cesar')
-rw-r--r--cesar/ce/rx/bitloading/inc/intervals.h27
-rw-r--r--cesar/ce/rx/bitloading/src/intervals.c75
-rw-r--r--cesar/ce/rx/bitloading/test/src/test_intervals.c161
3 files changed, 0 insertions, 263 deletions
diff --git a/cesar/ce/rx/bitloading/inc/intervals.h b/cesar/ce/rx/bitloading/inc/intervals.h
index ab95a45c9b..1cece9ace8 100644
--- a/cesar/ce/rx/bitloading/inc/intervals.h
+++ b/cesar/ce/rx/bitloading/inc/intervals.h
@@ -34,33 +34,6 @@ BEGIN_DECLS
u32
ce_rx_bl_intervals_get_tmi_used_list (sta_t *sta, bool check_default);
-/**
- * Estimate the start and the end date of a PPDU.
- * It transforms dates from rx_param in ATU.
- * \param rx_param parameters of PPDU.
- * \param start_date_atu start date (in ATU) corresponds to PPDU
- * payload beginning. It must already be allocated, start date will be written
- * at this address.
- * \param end_date_atu end date (in ATU) corresponds to PPDU payload end.
- * It must already be allocated, end date will be written at this address.
- */
-void
-ce_rx_bl_intervals_measure_to_date (pbproc_rx_params_t *rx_param,
- s16 *start_date_atu,
- s16 *end_date_atu);
-
-/**
- * Inform if a measure is on an interval or not and give this interval.
- * \param tms tonemaps.
- * \param start start date of the measure (in ATU).
- * \param end end date of the measure (in ATU).
- * \return the interval number or -1 if the measure is global.
- */
-int
-ce_rx_bl_intervals_measure_to_interval (tonemaps_t *tms,
- s16 mea_start,
- s16 mea_end);
-
/*
* Reconstruct RX intervals based on fsm TMI.
* \param sta station.
diff --git a/cesar/ce/rx/bitloading/src/intervals.c b/cesar/ce/rx/bitloading/src/intervals.c
index c85572dfe9..2ce5857dfe 100644
--- a/cesar/ce/rx/bitloading/src/intervals.c
+++ b/cesar/ce/rx/bitloading/src/intervals.c
@@ -49,81 +49,6 @@ ce_rx_bl_intervals_get_tmi_used_list (sta_t *sta, bool check_default)
}
void
-ce_rx_bl_intervals_measure_to_date (pbproc_rx_params_t *rx_param,
- s16 *start_date_atu,
- s16 *end_date_atu)
-{
- dbg_assert (rx_param);
- dbg_assert (start_date_atu);
- dbg_assert (end_date_atu);
-
- /* Estimate the start date.
- * As we don't know how in which mode we are, we take an average of hybrid
- * and AV modes. */
- u32 average_tck = ((MAC_PREAMBLE_HYBRID_TCK + MAC_FC_10_TCK + MAC_FC_AV_TCK)
- + (MAC_PREAMBLE_TCK + MAC_FC_AV_TCK)) / 2;
- *start_date_atu = MAC_TCK_TO_ATU (
- ((s32) (rx_param->preamble_ntb - rx_param->beacon_period_start_ntb))
- + average_tck);
-
- /* Estimate the end date. */
- *end_date_atu = *start_date_atu + MAC_TCK_TO_ATU (rx_param->fl_tck);
-
- /* Check we didn't have overflowed. */
- dbg_assert (*start_date_atu < *end_date_atu);
-}
-
-int
-ce_rx_bl_intervals_measure_to_interval (tonemaps_t *tms,
- s16 mea_start,
- s16 mea_end)
-{
- dbg_assert (tms);
- dbg_assert (tms->intervals);
- dbg_assert (mea_start < mea_end);
-
- tonemap_intervals_t *ints = tms->intervals;
-
- if (!ints->intervals_nb)
- return -1;
-
- /* We take the middle of the measure and see in which interval it is
- * supposed to be. */
- s16 mea_middle = (mea_start + mea_end) / 2;
- if (mea_middle <= 0)
- return -1;
-
- /* Measure middle is contained in this interval. */
- u8 int_num = tonemap_interval_find (tms, mea_middle);
-
- /* If we are not located in an interval, the measure is after the last
- * offset (our beacon period may not be perfect). We may consider this
- * measure as global. */
- if (int_num >= ints->intervals_nb)
- return -1;
-
- /* Get the start/end date of this interval. */
- /* We remove 1 because the date correspond to the next interval. */
- s16 int_end = ints->interval[int_num].end_offset_atu - 1;
- s16 int_start;
- if (int_num == 0)
- int_start = 0;
- else
- int_start = ints->interval[int_num - 1].end_offset_atu;
- dbg_assert (int_start < int_end);
-
- /* Check the measure didn't shifted too much. */
- if (mea_end > int_end
- && mea_end - int_end > MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK))
- return -1;
- if (mea_start < int_start
- && int_start - mea_start > MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK))
- return -1;
-
- return int_num;
-}
-
-void
ce_rx_bl_intervals_update_tmi (sta_t *sta, const bsu_aclf_bp_t bp_tck)
{
dbg_assert (sta);
diff --git a/cesar/ce/rx/bitloading/test/src/test_intervals.c b/cesar/ce/rx/bitloading/test/src/test_intervals.c
index 50e1cd88d9..ff32aaefa4 100644
--- a/cesar/ce/rx/bitloading/test/src/test_intervals.c
+++ b/cesar/ce/rx/bitloading/test/src/test_intervals.c
@@ -137,163 +137,6 @@ test_suite_ce_rx_bl_intervals_get_tmi_used_list (test_t t)
ce_rx_bl_intervals_repetition_count_ = old_repetition_nb;
}
-/**
- * Time transformation from pbproc information to ATU.
- */
-void
-test_suite_ce_rx_bl_intervals_measure_to_date (test_t t)
-{
- test_case_begin (t, "Time transformation from pbproc timing to ATU");
- s16 start = 0, end = 0;
- pbproc_rx_params_t rxp;
-
- test_begin (t, "Classic value")
- {
- rxp.preamble_ntb = 2000000;
- rxp.beacon_period_start_ntb = 1000000;
- rxp.fl_tck = 1000;
- ce_rx_bl_intervals_measure_to_date (&rxp, &start, &end);
- s16 computed_start = MAC_TCK_TO_ATU (
- ((MAC_PREAMBLE_HYBRID_TCK + MAC_FC_10_TCK + MAC_FC_AV_TCK)
- + (MAC_PREAMBLE_TCK + MAC_FC_AV_TCK)) / 2 + 1000000);
- test_fail_unless (computed_start == start);
- test_fail_unless (end == start + (s16) MAC_TCK_TO_ATU (rxp.fl_tck));
- } test_end;
-
- test_begin (t, "Beacon period start after preamble")
- {
- rxp.preamble_ntb = 1000;
- rxp.beacon_period_start_ntb = 2000;
- rxp.fl_tck = 1000;
- ce_rx_bl_intervals_measure_to_date (&rxp, &start, &end);
- s16 computed_start = MAC_TCK_TO_ATU (
- ((MAC_PREAMBLE_HYBRID_TCK + MAC_FC_10_TCK + MAC_FC_AV_TCK)
- + (MAC_PREAMBLE_TCK + MAC_FC_AV_TCK)) / 2 + (s32) (1000 - 2000));
- test_fail_unless (computed_start == start);
- test_fail_unless (end == start + (s16) MAC_TCK_TO_ATU (rxp.fl_tck));
- } test_end;
-
- test_begin (t, "Overflowed counter value")
- {
- rxp.preamble_ntb = 1;
- rxp.beacon_period_start_ntb = 0xfffff000;
- rxp.fl_tck = 1000;
- ce_rx_bl_intervals_measure_to_date (&rxp, &start, &end);
- s16 computed_start = MAC_TCK_TO_ATU (
- ((MAC_PREAMBLE_HYBRID_TCK + MAC_FC_10_TCK + MAC_FC_AV_TCK)
- + (MAC_PREAMBLE_TCK + MAC_FC_AV_TCK)) / 2 + (s32) (1 - 0xfffff000));
- test_fail_unless (computed_start == start);
- test_fail_unless (end == start + (s16) MAC_TCK_TO_ATU (rxp.fl_tck));
- } test_end;
-}
-
-/*
- * Test suite for measure to interval computation.
- */
-void
-test_suite_ce_rx_bl_intervals_measure_to_interval (test_t t)
-{
- test_case_begin (t, "Measure to interval");
-
- test_begin (t, "Global measure")
- {
- tonemaps_t *tms = tonemaps_alloc ();
- int int_nb = 0;
- uint bp = MAC_TCK_TO_ATU (BSU_ACLF_BP_50HZ_TCK);
- int end_offset_atu = 0;
- do
- {
- end_offset_atu = ++int_nb * bp / 24;
- int_nb = mac_interval_append (tms, end_offset_atu, 51);
- } while (int_nb != 24);
- mac_interval_commit_changes (tms, 0);
-
- int i = ce_rx_bl_intervals_measure_to_interval (tms, bp / 4, bp / 2);
- test_fail_if (i != -1);
- tonemaps_release (tms);
- } test_end;
-
- test_begin (t, "Global measure no existing interval")
- {
- tonemaps_t *tms = tonemaps_alloc ();
- uint bp = MAC_TCK_TO_ATU (BSU_ACLF_BP_50HZ_TCK);
-
- /* No interval so the measure should be global. */
- int i = ce_rx_bl_intervals_measure_to_interval (tms, 0, bp / 48);
- test_fail_if (i != -1);
- tonemaps_release (tms);
- } test_end;
-
- test_begin (t, "Measure position shift ok")
- {
- tonemaps_t *tms = tonemaps_alloc ();
- int int_nb = 0;
- uint bp = MAC_TCK_TO_ATU (BSU_ACLF_BP_50HZ_TCK);
- int end_offset_atu = 0;
- do
- {
- end_offset_atu = ++int_nb * bp / 24;
- int_nb = mac_interval_append (tms, end_offset_atu, 51);
- } while (int_nb != 24);
- mac_interval_commit_changes (tms, 0);
-
- int a;
- for (a = 0; a < 24; a++)
- {
- int i = ce_rx_bl_intervals_measure_to_interval (
- tms,
- a == 0 ? 0 : a * bp / 24
- - MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK),
- (a + 1) * bp / 24
- + MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK) - 1);
- test_fail_if (i != a);
- }
- tonemaps_release (tms);
- } test_end;
-
- test_begin (t, "Measure position shift fail start")
- {
- tonemaps_t *tms = tonemaps_alloc ();
- int int_nb = 0;
- uint bp = MAC_TCK_TO_ATU (BSU_ACLF_BP_50HZ_TCK);
- int end_offset_atu = 0;
- do
- {
- end_offset_atu = ++int_nb * bp / 24;
- int_nb = mac_interval_append (tms, end_offset_atu, 51);
- } while (int_nb != 24);
- mac_interval_commit_changes (tms, 0);
-
- int i = ce_rx_bl_intervals_measure_to_interval (
- tms,
- bp / 24 - MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK) - 1,
- 2 * bp / 24 + MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK) - 1);
- test_fail_if (i != -1);
- tonemaps_release (tms);
- } test_end;
-
- test_begin (t, "Measure position shift fail end")
- {
- tonemaps_t *tms = tonemaps_alloc ();
- int int_nb = 0;
- uint bp = MAC_TCK_TO_ATU (BSU_ACLF_BP_50HZ_TCK);
- int end_offset_atu = 0;
- do
- {
- end_offset_atu = ++int_nb * bp / 24;
- int_nb = mac_interval_append (tms, end_offset_atu, 51);
- } while (int_nb != 24);
- mac_interval_commit_changes (tms, 0);
-
- int i = ce_rx_bl_intervals_measure_to_interval (
- tms,
- bp / 24 - MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK),
- 2 * bp / 24 + MAC_TCK_TO_ATU (MAC_TM_TOLERANCE_TCK));
- test_fail_if (i != -1);
- tonemaps_release (tms);
- } test_end;
-}
-
void
test_suite_ce_rx_bl_intervals_measure_to_event_master_test (
test_t t,
@@ -835,10 +678,6 @@ test_suite_ce_rx_bl_intervals (test_t t)
test_suite_ce_rx_bl_intervals_init (t);
/* Get used tonemap list. */
test_suite_ce_rx_bl_intervals_get_tmi_used_list (t);
- /* Time transformation from pbproc information to ATU. */
- test_suite_ce_rx_bl_intervals_measure_to_date (t);
- /* Measure to interval computation. */
- test_suite_ce_rx_bl_intervals_measure_to_interval (t);
/* Measure to event computation */
test_suite_ce_rx_bl_intervals_measure_to_event (t);
/* Updating TMI of intervals. */