summaryrefslogtreecommitdiff
path: root/cesar/mac/common
diff options
context:
space:
mode:
authorJérôme Jutteau2011-04-21 17:06:49 +0200
committerJérôme Jutteau2011-05-12 17:40:18 +0200
commitb9675fb95ba1591ce39c3fbd30c5742ee1ab0d00 (patch)
tree282908965593867e6a890ff4302b7b55d92b88e8 /cesar/mac/common
parentb79329907d2acbd0d5b81acb02d46e10e0013f80 (diff)
cesar/ce/rx/bitloading: added sta init and uninit for intervals, refs #2366
Diffstat (limited to 'cesar/mac/common')
-rw-r--r--cesar/mac/common/interval.h14
-rw-r--r--cesar/mac/common/src/interval.c7
-rw-r--r--cesar/mac/common/src/sta.c5
3 files changed, 24 insertions, 2 deletions
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 <string.h> //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);
}