Change in osmocom-bb[master]: trxcon/scheduler: align Downlink reception to the first burst

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Mon Mar 16 10:32:43 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/17354 )

Change subject: trxcon/scheduler: align Downlink reception to the first burst
......................................................................

trxcon/scheduler: align Downlink reception to the first burst

It may happen that the burst reception would start from bid != 0:

  <0005> sched_trx.c:263 (Re)configure TDMA timeslot #2 as TCH/H+SACCH
  <0005> sched_trx.c:420 Activating lchan=TCH/H(0) on ts=2
  <0005> sched_trx.c:420 Activating lchan=SACCH/TH(0) on ts=2
  <0006> sched_lchan_xcch.c:96 Received incomplete data frame at fn=0 (0/104) for SACCH/TH(0)
  <0006> sched_lchan_xcch.c:106 Received bad data frame at fn=0 (0/104) for SACCH/TH(0)

so in that case, both measurement processing and the frame number
calculation would yield incorrect and/or incomplete results. The
Rx burst mask can be used to eliminate this problem.

In particular, if we shift it left instead of cleaning, it would
never be equal 0x00 after at least one burst is received. This
would allow us to skip decoding of an incomplete frame at the
beginning when the logical channel was just activated.

Note that TCH/H handler is not affected because it already uses
the strategy described above, so we keep it unchanged.

Change-Id: Ib8ddf2edd5ef84f2ab12155f7a8874c9fc56d436
Related: OS#3554
---
M src/host/trxcon/sched_lchan_pdtch.c
M src/host/trxcon/sched_lchan_tchf.c
M src/host/trxcon/sched_lchan_xcch.c
3 files changed, 18 insertions(+), 9 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/host/trxcon/sched_lchan_pdtch.c b/src/host/trxcon/sched_lchan_pdtch.c
index d965daa..8de947e 100644
--- a/src/host/trxcon/sched_lchan_pdtch.c
+++ b/src/host/trxcon/sched_lchan_pdtch.c
@@ -58,9 +58,9 @@
 	LOGP(DSCHD, LOGL_DEBUG, "Packet data received on %s: "
 		"fn=%u ts=%u bid=%u\n", lchan_desc->name, fn, ts->index, bid);
 
-	/* Reset internal state */
-	if (bid == 0)
-		*mask = 0x0;
+	/* Align to the first burst of a block */
+	if (*mask == 0x00 && bid != 0)
+		return 0;
 
 	/* Update mask */
 	*mask |= (1 << bid);
@@ -92,6 +92,9 @@
 		return -1;
 	}
 
+	/* Keep the mask updated */
+	*mask = *mask << 4;
+
 	/* Attempt to decode */
 	rc = gsm0503_pdtch_decode(l2, buffer,
 		NULL, &n_errors, &n_bits_total);
diff --git a/src/host/trxcon/sched_lchan_tchf.c b/src/host/trxcon/sched_lchan_tchf.c
index 198d25f..312425b 100644
--- a/src/host/trxcon/sched_lchan_tchf.c
+++ b/src/host/trxcon/sched_lchan_tchf.c
@@ -60,9 +60,9 @@
 	LOGP(DSCHD, LOGL_DEBUG, "Traffic received on %s: fn=%u ts=%u bid=%u\n",
 		lchan_desc->name, fn, ts->index, bid);
 
-	/* Reset internal state */
-	if (bid == 0)
-		*mask = 0x00;
+	/* Align to the first burst of a block */
+	if (*mask == 0x00 && bid != 0)
+		return 0;
 
 	/* Update mask */
 	*mask |= (1 << bid);
@@ -95,6 +95,9 @@
 		goto bfi;
 	}
 
+	/* Keep the mask updated */
+	*mask = *mask << 4;
+
 	switch (lchan->tch_mode) {
 	case GSM48_CMODE_SIGN:
 	case GSM48_CMODE_SPEECH_V1: /* FR */
diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c
index 0818e20..a0b61ad 100644
--- a/src/host/trxcon/sched_lchan_xcch.c
+++ b/src/host/trxcon/sched_lchan_xcch.c
@@ -57,9 +57,9 @@
 	LOGP(DSCHD, LOGL_DEBUG, "Data received on %s: fn=%u ts=%u bid=%u\n",
 		lchan_desc->name, fn, ts->index, bid);
 
-	/* Reset internal state */
-	if (bid == 0)
-		*mask = 0x0;
+	/* Align to the first burst of a block */
+	if (*mask == 0x00 && bid != 0)
+		return 0;
 
 	/* Update mask */
 	*mask |= (1 << bid);
@@ -93,6 +93,9 @@
 		 * abort here. */
 	}
 
+	/* Keep the mask updated */
+	*mask = *mask << 4;
+
 	/* Attempt to decode */
 	rc = gsm0503_xcch_decode(l2, buffer, &n_errors, &n_bits_total);
 	if (rc) {

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/17354
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ib8ddf2edd5ef84f2ab12155f7a8874c9fc56d436
Gerrit-Change-Number: 17354
Gerrit-PatchSet: 6
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200316/f0249cab/attachment.htm>


More information about the gerrit-log mailing list