summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/measure.h
blob: 526e3e3046a27921f1aa47f572a640560f4eaa28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef ce_rx_measure_h
#define ce_rx_measure_h
/* Cesar project {{{
 *
 * Copyright (C) 2009 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    ce/rx/measure.h
 * \brief   Receive and pre-process measures from the SAR.
 * \ingroup ce_rx
 *
 * This sub module of the CE in RX can be divided into two parts:
 *   - receive the measures of the SAR (executed in the context of the SAR).
 *   This part should be quick and just copy data, without any processing and
 *   add a work flag for the CE in RX.
 *   - process of received data. This part is done in the context of the CE in
 *   RX ; it processes measures and give the to the bitloading.
 */

#include "mac/sar/sar.h"

/**
 * Number of blocks required to get all the noise NRJ from the PBProc.
 */
#define CE_RX_MEASURE_CONF_SIZE \
    ((PHY_CARRIER_NB + (BLK_SIZE / 4) - 1) / (BLK_SIZE / 4))

BEGIN_DECLS

/**
 * Call back called by the SAR to give the measures.
 * \param  data  the context of the CE RX.
 * \param  rx_params  general information on measures (date, from).
 * \param  pbm_count  number of PB measurements available.
 * \param  first_pbm  the first block used to store the PB measurements.
 * \param  last_pbm  the last block used to store the PB measurements.
 * \param  chan_data  the head of the channel data.
 * \param  chan_data_count  the count of PBs in the channel data.
 * \param  false_pb_count  number of false PBs (CRC error) inside the frame.
 * \return  true if there are one or more blocks allocated to store the
 * measurements.
 *
 * Have a look at \sa sar_measurement_cb_t.
 */
bool
ce_rx_measure_sar_cb (void *data, pbproc_rx_params_t *rx_params,
                      uint pbm_count, blk_t **first_pbm, blk_t **last_pbm,
                      pb_t *chan_data, uint chan_data_count,
                      u8 **false_pb_count);

END_DECLS

#endif /* ce_rx_measure_h */