summaryrefslogtreecommitdiff
path: root/cesar/mac/sar/test
diff options
context:
space:
mode:
authorNélio Laranjeiro2011-09-14 15:24:52 +0200
committerNélio Laranjeiro2011-11-02 17:44:27 +0100
commit2f14bb627691abe01f6e09beef5643d3cd1921a8 (patch)
tree7772f59ee8b724f2113e0cd6925fc974f4cd9bc6 /cesar/mac/sar/test
parentc6fa3a6fdf24501e16f824da0ae5cd439093ba02 (diff)
cesar/mac/sar: fix missing PBs calculation, closes #2722
Diffstat (limited to 'cesar/mac/sar/test')
-rw-r--r--cesar/mac/sar/test/unit_test/ecos/src/stats.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/cesar/mac/sar/test/unit_test/ecos/src/stats.c b/cesar/mac/sar/test/unit_test/ecos/src/stats.c
index 63a0a56d50..f9a3bc5391 100644
--- a/cesar/mac/sar/test/unit_test/ecos/src/stats.c
+++ b/cesar/mac/sar/test/unit_test/ecos/src/stats.c
@@ -231,11 +231,16 @@ test_sar_stats_rx_compute (link_stats_rx_t *stats, pb_t *pb, u16 ssn,
if (pb_dropped_nb == 0
|| (pb_dropped_nb != 0
&& pb_dropped_table[pb_dropped_index] != pb->header.ssn))
+ {
stats->num_pbs++;
+ }
/* Some PBs are drop. */
else if (less_mod2p16 (pb->header.ssn, ssn))
{
stats->num_segs_missed++;
+ }
+ if (pb_dropped_table[pb_dropped_index] == pb->header.ssn)
+ {
pb_dropped_index++;
}
}
@@ -267,8 +272,20 @@ u16
test_sar_stats_rx_ssn_min_compute (pbproc_rx_desc_t *mpdu, bool bcast, u16 ssn,
uint ws)
{
- pb_t *pb;
- for (pb = mpdu->rx->pb_first; pb; pb = pb->next)
+ pb_t *pb = mpdu->rx->pb_first;
+ /* If a single PB with an OPSF is received, the SSN MIN must
+ * be equal to its SSN + 1. */
+ if (pb->next == NULL
+ && pb->header.opsf
+ && pb->header.vpbf
+ && !pb->phy_pb.pb_rx.pb_measurement.crc_error
+ && (pb->header.mmqf
+ || mpdu->rx->params.eks == MAC_EKS_CLEAR)
+ )
+ {
+ ssn = pb->header.ssn + 1;
+ }
+ for (; pb; pb = pb->next)
{
if (ssn == pb->header.ssn
&& !pb->phy_pb.pb_rx.pb_measurement.crc_error)
@@ -404,6 +421,7 @@ test_sar_stats_rx_do (test_t test, bool bcast)
&pb_nb, bcast,
mfs->window_size,
lib_rnd32 (&rnd));
+ dbg_assert (mpdu->rx->pb_nb);
/* Compute which PB is dropped because it is outside the MFS
* window. */
test_sar_stats_rx_pb_dropped (mpdu, bcast, ssn_min_computed,