From b9675fb95ba1591ce39c3fbd30c5742ee1ab0d00 Mon Sep 17 00:00:00 2001 From: Jérôme Jutteau Date: Thu, 21 Apr 2011 17:06:49 +0200 Subject: cesar/ce/rx/bitloading: added sta init and uninit for intervals, refs #2366 --- cesar/mac/common/interval.h | 14 ++++++++++++++ cesar/mac/common/src/interval.c | 7 ++++++- cesar/mac/common/src/sta.c | 5 ++++- 3 files changed, 24 insertions(+), 2 deletions(-) (limited to 'cesar/mac/common') diff --git a/cesar/mac/common/interval.h b/cesar/mac/common/interval.h index 7730634097..6ead825016 100644 --- a/cesar/mac/common/interval.h +++ b/cesar/mac/common/interval.h @@ -18,6 +18,20 @@ #include "mac/common/tonemap.h" +/** Number of allocated FSM. */ +extern u8 mac_interval_fsm_count_; + +/** Number of FSM repetition in the beacon period. */ +extern u8 mac_interval_repetition_count_; + +/** + * Measure shift tolerance. When a measure is considered to have the size of + * an interval, the measure must not be too shifted from it's interval + * position. The PPDU payload should start or end within MAC_TM_TOLERANCE_TCK + * (µs) of the boundary. + */ +extern u16 mac_interval_measure_shift_tolerance_; + BEGIN_DECLS /** diff --git a/cesar/mac/common/src/interval.c b/cesar/mac/common/src/interval.c index 7cb86fb75a..1aff6b75ea 100644 --- a/cesar/mac/common/src/interval.c +++ b/cesar/mac/common/src/interval.c @@ -12,9 +12,14 @@ */ #include "common/std.h" #include "lib/utils.h" - +#include "mac/common/timings.h" #include "mac/common/interval.h" +u8 mac_interval_fsm_count_ = 6; +u8 mac_interval_repetition_count_ = 4; +u16 mac_interval_measure_shift_tolerance_ = MAC_TCK_TO_ATU ( + MAC_TM_TOLERANCE_TCK); + void mac_interval_clear (tonemaps_t *tms) { diff --git a/cesar/mac/common/src/sta.c b/cesar/mac/common/src/sta.c index 9246b70dca..817a45edfb 100644 --- a/cesar/mac/common/src/sta.c +++ b/cesar/mac/common/src/sta.c @@ -14,6 +14,7 @@ #include "mac/common/sta.h" #include "mac/common/defs.h" #include "cl/data_rate.h" +#include "ce/rx/bitloading/intervals.h" #include //memset @@ -32,7 +33,7 @@ sta_init (sta_t *sta, uint tei) ce_rx_bitloading_init (&sta->ce_rx_bt); sta->tx_data_rate.data_rate = CL_DATA_RATE_REQ_INIT; sta->rx_data_rate.data_rate = CL_DATA_RATE_REQ_INIT; - dbg_invalid_ptr (sta->intervals); + sta->intervals = NULL; } @@ -43,5 +44,7 @@ sta_uninit (sta_t *sta) tonemaps_release (sta->rx_tonemaps); tonemaps_release (sta->tx_tonemaps); ce_rx_bitloading_uninit (&sta->ce_rx_bt); + if (sta->intervals) + ce_rx_bl_intervals_free (sta->intervals); } -- cgit v1.2.3