Change in ...osmo-bts[master]: L1SAP: refactor handling of Access Bursts on PDCH

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

fixeria gerrit-no-reply at lists.osmocom.org
Tue Oct 8 20:19:21 UTC 2019


fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/15711


Change subject: L1SAP: refactor handling of Access Bursts on PDCH
......................................................................

L1SAP: refactor handling of Access Bursts on PDCH

First of all, we also need to apply the same filtering to Access
Bursts on PDCH as for the normal ones on RACH, i.e. filter them
by ToA (Timing of Arrival) and BER (Bit Error Rate).

Secondly, we shall not interpret Access Bursts on PDTCH/U as
handover related ones. Instead, let's print a warning and
ignore them since they are not (yet) supported by OsmoBTS.

Finally, in gsmtap_pdch() we need to set a proper channel type
for Access Bursts received on PDCH (PDTCH/U or PTCCH/U).

Change-Id: I461fde9f4543c45c42b591cd3fd0ff3d98673cec
---
M src/common/l1sap.c
1 file changed, 47 insertions(+), 19 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/15711/1

diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 93a70cd..06de8a3 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -349,18 +349,27 @@
 static int gsmtap_ph_rach(struct osmo_phsap_prim *l1sap, uint8_t *chan_type,
 	uint8_t *tn, uint8_t *ss, uint32_t *fn, uint8_t **data, unsigned int *len)
 {
-	uint8_t chan_nr;
+	uint8_t chan_nr = l1sap->u.rach_ind.chan_nr;
 
 	*chan_type = GSMTAP_CHANNEL_RACH;
 	*fn = l1sap->u.rach_ind.fn;
-	*tn = L1SAP_CHAN2TS(l1sap->u.rach_ind.chan_nr);
-	chan_nr = l1sap->u.rach_ind.chan_nr;
+	*tn = L1SAP_CHAN2TS(chan_nr);
+
 	if (L1SAP_IS_CHAN_TCHH(chan_nr))
 		*ss = L1SAP_CHAN2SS_TCHH(chan_nr);
 	else if (L1SAP_IS_CHAN_SDCCH4(chan_nr))
 		*ss = L1SAP_CHAN2SS_SDCCH4(chan_nr);
 	else if (L1SAP_IS_CHAN_SDCCH8(chan_nr))
 		*ss = L1SAP_CHAN2SS_SDCCH8(chan_nr);
+	else if (L1SAP_IS_CHAN_PDCH(chan_nr)) {
+		if (L1SAP_IS_PTCCH(*fn)) {
+			/* TODO: calculate sub-slot from frame-number */
+			*chan_type = GSMTAP_CHANNEL_PTCCH;
+		} else {
+			*chan_type = GSMTAP_CHANNEL_PDTCH;
+		}
+	}
+
 	*data = (uint8_t *)&l1sap->u.rach_ind.ra;
 	*len = 1;
 
@@ -1303,6 +1312,32 @@
 	return 0;
 }
 
+/* Special case for Access Bursts on PDTCH/U or PTCCH/U */
+static int l1sap_pdch_rach(struct gsm_bts_trx *trx, struct ph_rach_ind_param *rach_ind)
+{
+	/* Filter out noise / interference / ghosts */
+	if (!rach_pass_filter(rach_ind, trx->bts))
+		return -EAGAIN;
+
+	/* PTCCH/U (Packet Timing Advance Control Channel) */
+	if (L1SAP_IS_PTCCH(rach_ind->fn)) {
+		LOGPFN(DL1P, LOGL_DEBUG, rach_ind->fn,
+		       /* TODO: calculate and print Timing Advance Index */
+		       "Access Burst for continuous Timing Advance control (toa256=%d)\n",
+		       rach_ind->acc_delay_256bits);
+
+		/* QTA: Timing Advance in units of 1/4 of a symbol */
+		pcu_tx_rach_ind(trx->bts, rach_ind->acc_delay_256bits >> 6,
+				rach_ind->ra, rach_ind->fn, rach_ind->is_11bit,
+				rach_ind->burst_type, PCU_IF_SAPI_PTCCH);
+		return 0;
+	} else { /* The MS may acknowledge DL data by 4 consequent Access Bursts */
+		LOGPFN(DL1P, LOGL_NOTICE, rach_ind->fn,
+		       "Access Bursts on PDTCH/U are not (yet) supported\n");
+		return -ENOTSUP;
+	}
+}
+
 /* RACH received from bts model */
 static int l1sap_ph_rach_ind(struct gsm_bts_trx *trx,
 	 struct osmo_phsap_prim *l1sap, struct ph_rach_ind_param *rach_ind)
@@ -1312,22 +1347,15 @@
 
 	DEBUGPFN(DL1P, rach_ind->fn, "Rx PH-RA.ind\n");
 
-	/* PTCCH/UL (Packet Timing Advance Control Channel) */
-	if (L1SAP_IS_CHAN_PDCH(rach_ind->chan_nr) && L1SAP_IS_PTCCH(rach_ind->fn)) {
-		LOGPFN(DL1P, LOGL_DEBUG, rach_ind->fn,
-		       /* TODO: calculate and print Timing Advance Index */
-		       "Access Burst for continuous Timing Advance control (toa256=%d)\n",
-		       rach_ind->acc_delay_256bits);
-
-		/* QTA: Timing Advance in units of 1/4 of a symbol */
-		pcu_tx_rach_ind(bts, rach_ind->acc_delay_256bits >> 6,
-				rach_ind->ra, rach_ind->fn, rach_ind->is_11bit,
-				rach_ind->burst_type, PCU_IF_SAPI_PTCCH);
-		return 0;
-	}
-
-	/* check for handover access burst on dedicated channels */
-	if (!L1SAP_IS_CHAN_RACH(rach_ind->chan_nr)) {
+	/* Check the origin of an Access Burst */
+	switch (rach_ind->chan_nr & 0xf8) {
+	case RSL_CHAN_RACH:
+		/* CS or PS RACH, to be handled in this function */
+		break;
+	case RSL_CHAN_OSMO_PDCH:
+		/* TODO: do we need to count Access Bursts on PDCH? */
+		return l1sap_pdch_rach(trx, rach_ind);
+	default:
 		rate_ctr_inc2(trx->bts->ctrs, BTS_CTR_RACH_HO);
 		return l1sap_handover_rach(trx, rach_ind);
 	}

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I461fde9f4543c45c42b591cd3fd0ff3d98673cec
Gerrit-Change-Number: 15711
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <axilirator at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191008/7b5b31d7/attachment.htm>


More information about the gerrit-log mailing list