[MERGED] osmo-bts[master]: sysmobts: normalize frame number in measurement indication

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
Fri Jun 9 14:33:20 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: sysmobts: normalize frame number in measurement indication
......................................................................


sysmobts: normalize frame number in measurement indication

The higher layers relay on a normalized version of frame number
in order to detect the end of a measurement period.

The frame number on which the measurement reports are sent may
depend on the phy, so we need to normalize the frame number
before we report it to the higher layers.

Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6
---
M src/osmo-bts-sysmo/l1_if.c
1 file changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 79fccd9..a83816e 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -897,12 +897,14 @@
 }
 
 static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
-			    uint32_t fn, GsmL1_MeasParam_t *m)
+			    uint32_t fn, GsmL1_PhDataInd_t *data_ind)
 {
 	struct osmo_phsap_prim l1sap;
 	memset(&l1sap, 0, sizeof(l1sap));
 	osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO,
 		PRIM_OP_INDICATION, NULL);
+	GsmL1_MeasParam_t *m = &data_ind->measParam;
+
 	l1sap.u.info.type = PRIM_INFO_MEAS;
 	l1sap.u.info.u.meas_ind.chan_nr = chan_nr;
 	l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming;
@@ -913,6 +915,12 @@
 	 * physical radio link, the uplink is delayed by 3 timeslots, we need
 	 * to compensate for that delay. */
 	l1sap.u.info.u.meas_ind.fn = fn + 3;
+
+	/* Align frame number with measurement period ends */
+	if (data_ind->sapi == GsmL1_Sapi_TchF)
+		l1sap.u.info.u.meas_ind.fn += 1;
+	else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == GsmL1_SubCh_0)
+		l1sap.u.info.u.meas_ind.fn += 1;
 
 	/* l1sap wants to take msgb ownership.  However, as there is no
 	 * msg, it will msgb_free(l1sap.oph.msg == NULL) */
@@ -941,7 +949,7 @@
 	fn = data_ind->u32Fn;
 	link_id =  (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC;
 
-	process_meas_res(trx, chan_nr, fn, &data_ind->measParam);
+	process_meas_res(trx, chan_nr, fn, data_ind);
 
 	if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm
 	 && data_ind->msgUnitParam.u8Size != 0) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list