summaryrefslogtreecommitdiff
path: root/cesar/mac/sar/src/sar.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/mac/sar/src/sar.c')
-rw-r--r--cesar/mac/sar/src/sar.c53
1 files changed, 9 insertions, 44 deletions
diff --git a/cesar/mac/sar/src/sar.c b/cesar/mac/sar/src/sar.c
index a1dc70d5dd..9f68bcae02 100644
--- a/cesar/mac/sar/src/sar.c
+++ b/cesar/mac/sar/src/sar.c
@@ -1057,9 +1057,9 @@ sar_reassembly_run (sar_t *ctx, sar_mpdu_t *rx)
dbg_assert (!rx->rx.mfs);
dbg_assert (!rx->rx.mfs_mme);
/* Channel data ownership is handed over to callee. */
- (*ctx->sar_measurement) (ctx->ul_ce_ctx, &rx->rx.params, 0, NULL,
- NULL, rx->rx.chandata_first,
- rx->rx.chandata_nb, NULL);
+ ctx->sar_measurement (ctx->ul_ce_ctx, &rx->rx.params, 0,
+ rx->rx.chandata_first, rx->rx.chandata_nb,
+ 0, 0);
}
else
{
@@ -1116,16 +1116,8 @@ sar_rx_mpdu_process (sar_t *ctx, sar_mpdu_t * rx)
mfs_rx_t *mfs_current = NULL;
pb_t *pb_current = NULL;
bool mme = false;
-
- blk_t *blk_first;
- blk_t *blk_last;
- blk_t *blk_current;
- uint blk_offset = 0;
- bool collect_measure;
u8 pb_crc_error = 0;
- u8 *ce_pb_crc_error;
u32 ber_sum = 0;
- dbg_invalid_ptr(ce_pb_crc_error);
/* Statistics variables. */
uint pb_data_nb = 0;
uint pb_data_dropped = 0;
@@ -1140,13 +1132,6 @@ sar_rx_mpdu_process (sar_t *ctx, sar_mpdu_t * rx)
dbg_assert (ctx->sar_measurement);
- /* Call the CE to get the blocks to put the measurements. Channel data
- * ownership is handed over to callee. */
- collect_measure = (*ctx->sar_measurement) (ctx->ul_ce_ctx,
- &rx->rx.params, rx->rx.pb_nb, &blk_first, &blk_last,
- rx->rx.chandata_first, rx->rx.chandata_nb, &ce_pb_crc_error);
- blk_current = blk_first;
-
/* Initialise data. */
rx_head = rx->rx.pb_first;
/* The current PB pointing a PB in the MFS current. This can evolve and
@@ -1162,26 +1147,6 @@ sar_rx_mpdu_process (sar_t *ctx, sar_mpdu_t * rx)
/* Refresh Leon cache for the PB. Load both PB header and PB
* Measurements. */
arch_load_cache ((u32 *) &rx_head->header, 2);
-
- /* Collect measure for the CE. */
- if (collect_measure)
- {
- dbg_assert (blk_last);
- dbg_assert (blk_current);
-
- if (blk_offset == (BLK_SIZE / sizeof (pb_measurement_t)))
- {
- blk_current = blk_last;
- blk_offset = 0;
- }
-
- *((pb_measurement_t *) blk_current->data + blk_offset)
- = rx_head->phy_pb.pb_rx.pb_measurement;
- /* PB measurements are 1 word long and blk_current data is
- * handled as a pb_measurement. */
- blk_offset ++;
- }
-
/* If PB is not valid, crc error or Data not encrypt, Drop the PB.*/
if (!rx_head->header.vpbf
|| rx_head->phy_pb.pb_rx.pb_measurement.crc_error
@@ -1190,6 +1155,8 @@ sar_rx_mpdu_process (sar_t *ctx, sar_mpdu_t * rx)
{
if (rx_head->phy_pb.pb_rx.pb_measurement.crc_error)
pb_crc_error ++;
+ else
+ ber_sum += rx_head->phy_pb.pb_rx.pb_measurement.ber;
SAR_TRACE (PB_ERROR, rx_head->header.ssn);
rx_head = sar_pb_release (rx_head);
}
@@ -1281,12 +1248,10 @@ sar_rx_mpdu_process (sar_t *ctx, sar_mpdu_t * rx)
rx_head = sar_pb_release (rx_head);
}
}
-
- if (ce_pb_crc_error)
- {
- dbg_claim_ptr (ce_pb_crc_error);
- *ce_pb_crc_error = pb_crc_error;
- }
+ /* Call the CE. */
+ ctx->sar_measurement (ctx->ul_ce_ctx, &rx->rx.params, rx->rx.pb_nb,
+ rx->rx.chandata_first, rx->rx.chandata_nb,
+ pb_crc_error, ber_sum);
#if CONFIG_STATS
/* Increase statistics. */
ctx->stats.rx_pb_count += rx->rx.pb_nb;