[MERGED] osmocom-bb[master]: trxcon: Prefix SACCH fill frame with L1 header

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sun Apr 15 09:11:12 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: trxcon: Prefix SACCH fill frame with L1 header
......................................................................


trxcon: Prefix SACCH fill frame with L1 header

The main problem here is that the existing implementatin missing the L1
header in this message.  A SACCH message doesn't have a 23byte LAPDm
message, but only a 21 byte LAPDm message prefixed by a 2-byte Layer1
header. So on the receiver in the BTS, right now the first two bytes of
the UL SACCH frame are misinterpreted as L1 header.

This it what causes RLL ERROR INDICATION on the Abis side, which is why
our BTS_Tests fail.

Change-Id: Id7776bf3604d0e8a32e04547e01b8bd377903272
Related: OS#3170
---
M src/host/trxcon/sched_prim.c
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c
index e1c87bb..2ee06d7 100644
--- a/src/host/trxcon/sched_prim.c
+++ b/src/host/trxcon/sched_prim.c
@@ -275,8 +275,18 @@
 		/* FIXME: should we do anything for CSD? */
 		return 0;
 	} else {
+		uint8_t *cur = prim_buffer;
+
+		if (CHAN_IS_SACCH(chan)) {
+			/* Add 2-byte SACCH header */
+			/* FIXME: How to get TA and MS Tx Power from l1l->trx->tx_power + l1l->trx->ta? */
+			cur[0] = cur[1] = 0x00;
+			cur += 2;
+		}
+
 		/* Copy a fill frame payload */
-		memcpy(prim_buffer, lapdm_fill_frame, sizeof(lapdm_fill_frame));
+		memcpy(cur, lapdm_fill_frame, sizeof(lapdm_fill_frame));
+		cur += sizeof(lapdm_fill_frame);
 
 		/**
 		 * TS 144.006, section 5.2 "Frame delimitation and fill bits"
@@ -284,7 +294,7 @@
 		 * be set to the binary value "00101011", each fill bit should
 		 * be set to a random value when sent by the network.
 		 */
-		for (i = sizeof(lapdm_fill_frame); i < GSM_MACBLOCK_LEN; i++)
+		for (i = cur - prim_buffer; i < GSM_MACBLOCK_LEN; i++)
 			prim_buffer[i] = (uint8_t) rand();
 
 		/* Define a prim length */

-- 
To view, visit https://gerrit.osmocom.org/7807
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id7776bf3604d0e8a32e04547e01b8bd377903272
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>



More information about the gerrit-log mailing list