#ifndef ce_rx_inc_measure_h #define ce_rx_inc_measure_h /* Cesar project {{{ * * Copyright (C) 2009 Spidcom * * <<>> * * }}} */ /** * \file ce/rx/inc/measure.h * \brief Receive and pre-process measures from the SAR (private). * \ingroup ce_rx */ #include "lib/mbox.h" #include "mac/sar/sar.h" #include "ce/rx/forward.h" #include "ce/rx/measure.h" #include "mac/pbproc/pbproc.h" /** * Ask the PBPDMA to divide the channel data by the number of symbol. */ #define CE_RX_PBDMA_DIVIDE 1 /** * Maximum number of measures to store in the mailbox between the CE and the * SAR. * Sometimes, this size is not respected: channel data are always stored even * if the mail box is already "full". */ #define CE_RX_MEASURE_MBOX_MAX_SIZE 42 /* * This value is used as fsm id to describe the measure as global. * When this value is used there is no intervals. */ #define CE_RX_MEASURE_NO_INTERVAL -1 /** * Mailbox used to exchange measure between the SAR and the CE RX. */ typedef struct ce_rx_measure_mbox_t { /** * Pointer to the mailbox node. */ mbox_node_t mbox_node; /** * TEI of the station. */ pbproc_rx_params_t rx_params; /** * Pointer to the beginning of the channel data. */ phy_chandata_t *chan_data; /** * Count of channel data elements. */ uint chan_data_count; /** * Count of false PB (CRC wrong) in the frame. */ u8 false_pb_count; /** * Total count of PB in the frame. */ u8 total_pb_count; /** * BER sum of PBs with good CRC in the frame. */ u32 ber_sum; /** * Interval's FSM id (set to CE_RX_MEASURE_NO_INTERVAL if there is no * interval fsm). */ s8 fsm_id; } ce_rx_measure_mbox_t; BEGIN_DECLS /** * Initialize the sub module of measure of the CE RX. * \param ce_rx the CE RX context. * \param sar the SAR context. * \param pbproc the PBProc context. */ void ce_rx_measure_init (ce_rx_t *ce_rx, sar_t *sar, pbproc_t *pbproc); /** * Un-initialize the sub module of measure of the CE RX. * \param ce_rx the CE RX context. */ void ce_rx_measure_uninit (ce_rx_t *ce_rx); END_DECLS #endif /* ce_rx_inc_measure_h */