aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/l1_if.c
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2017-06-09 12:10:19 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2017-06-09 16:09:21 +0200
commit88b2cc30a6a7253c2c4c76178e5727fad48556ca (patch)
tree96efdecf05601e00d5f9800a0243ed74fbd8f927 /src/osmo-bts-sysmo/l1_if.c
parent67d3b8b136a720a0487074c23bc1656f681c94f1 (diff)
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
Diffstat (limited to 'src/osmo-bts-sysmo/l1_if.c')
-rw-r--r--src/osmo-bts-sysmo/l1_if.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 79fccd96..a83816ea 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -897,12 +897,14 @@ static void dump_meas_res(int ll, GsmL1_MeasParam_t *m)
}
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;
@@ -914,6 +916,12 @@ static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
* 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) */
return l1sap_up(trx, &l1sap);
@@ -941,7 +949,7 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
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) {