[PATCH] osmo-bts[master]: Add 11-bit RACH support to osmo-bts-trx

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

Max gerrit-no-reply at lists.osmocom.org
Wed Feb 7 19:49:21 UTC 2018


Hello Vadim Yanitskiy, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/6315

to look at the new patch set (#2).

Add 11-bit RACH support to osmo-bts-trx

Attempt to decode incoming RACH burst as 11-bit first and fallback to
8-bit if unsuccessful.

Related: OS#1854
Change-Id: Ia28741603636406744e5e22ffff1fb7a9689955a
---
M src/osmo-bts-trx/scheduler_trx.c
1 file changed, 22 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/15/6315/2

diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c
index 0f3272e..44cf887 100644
--- a/src/osmo-bts-trx/scheduler_trx.c
+++ b/src/osmo-bts-trx/scheduler_trx.c
@@ -719,6 +719,7 @@
 	uint8_t chan_nr;
 	struct osmo_phsap_prim l1sap;
 	uint8_t ra;
+	uint16_t ra11;
 	int rc;
 
 	chan_nr = trx_chan_desc[chan].chan_nr | tn;
@@ -726,10 +727,26 @@
 	LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received RACH toa=%.2f\n", toa);
 
 	/* decode */
-	rc = gsm0503_rach_decode(&ra, bits + 8 + 41, l1t->trx->bts->bsic);
-	if (rc) {
-		LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received bad AB frame\n");
-		return 0;
+	rc = gsm0503_rach_ext_decode(&ra11, bits + 8 + 41, l1t->trx->bts->bsic);
+	if (rc < 0) {
+		rc = gsm0503_rach_decode(&ra, bits + 8 + 41, l1t->trx->bts->bsic);
+		if (rc < 0) {
+			LOGL1S(DL1P, LOGL_DEBUG, l1t, tn, chan, fn, "Received bad AB frame\n");
+			return 0;
+		}
+		l1sap.u.rach_ind.is_11bit = 0;
+		l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0;
+	} else {
+		l1sap.u.rach_ind.is_11bit = 1;
+		l1sap.u.rach_ind.burst_type = BSIC2BCC(l1t->trx->bts->bsic);
+		if (l1sap.u.rach_ind.burst_type != GSM_L1_BURST_TYPE_ACCESS_0 ||
+		    l1sap.u.rach_ind.burst_type != GSM_L1_BURST_TYPE_ACCESS_1 ||
+		    l1sap.u.rach_ind.burst_type != GSM_L1_BURST_TYPE_ACCESS_2) {
+			LOGL1S(DL1P, LOGL_ERROR, l1t, tn, chan, fn,
+			       "Received RACH frame with unexpected TSC %u, forcing default %u\n",
+			       l1sap.u.rach_ind.burst_type, GSM_L1_BURST_TYPE_ACCESS_0);
+			l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0;
+		}
 	}
 
 	/* compose primitive */
@@ -738,17 +755,13 @@
 	osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_PH_RACH, PRIM_OP_INDICATION,
 		NULL);
 	l1sap.u.rach_ind.chan_nr = chan_nr;
-	l1sap.u.rach_ind.ra = ra;
+	l1sap.u.rach_ind.ra = l1sap.u.rach_ind.is_11bit ? ra11 : ra;
 #ifdef TA_TEST
 #warning TIMING ADVANCE TEST-HACK IS ENABLED!!!
 	toa *= 10;
 #endif
 	l1sap.u.rach_ind.acc_delay = (toa >= 0) ? toa : 0;
 	l1sap.u.rach_ind.fn = fn;
-
-	/* 11bit RACH is not supported for osmo-trx */
-	l1sap.u.rach_ind.is_11bit = 0;
-	l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0;
 
 	/* forward primitive */
 	l1sap_up(l1t->trx, &l1sap);

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia28741603636406744e5e22ffff1fb7a9689955a
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list