Change in osmo-bts[master]: measurement: send measurement reports for missed interval ends

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

dexter gerrit-no-reply at lists.osmocom.org
Tue Sep 4 13:44:51 UTC 2018


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/10761


Change subject: measurement: send measurement reports for missed interval ends
......................................................................

measurement: send measurement reports for missed interval ends

When the end of the measurement interval can not be detected because the
SACCH block got lost, then the logic runs the measurement computation,
but there is no measurement report sent via RSL. This is due to the fact
that those reports are triggered when a SACCH frame from the MS is
received. The computed measurement result is then put into an RSL
message together with the DTAP message from the MS. However, it is legal
to leave the DTAP part out if it has not been received. Lets add a
function to rsl.c that we can call from measurement.c in order to force
an RSL measurement report when a missing interval end is detected.

- Add new function rsl_push_meas_res()
- Call rsl_push_meas_res() when an interval end has been missed.

Change-Id: Ia6d20136832714e3d439ddf9abaea0f66898bb61
Related: OS#3502
---
M include/osmo-bts/rsl.h
M src/common/measurement.c
M src/common/rsl.c
3 files changed, 32 insertions(+), 5 deletions(-)



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

diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h
index 06d58a2..a7e2d58 100644
--- a/include/osmo-bts/rsl.h
+++ b/include/osmo-bts/rsl.h
@@ -42,6 +42,7 @@
 void cb_ts_disconnected(struct gsm_bts_trx_ts *ts);
 void cb_ts_connected(struct gsm_bts_trx_ts *ts);
 void ipacc_dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc);
+void rsl_push_meas_res(struct gsm_lchan *lchan);
 
 #endif // _RSL_H */
 
diff --git a/src/common/measurement.c b/src/common/measurement.c
index bfba11f..90af761 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -841,6 +841,7 @@
 		 * and add the uplink measurement we got as the first sample
 		 * of a new interval */
 		lchan_meas_check_compute(lchan, fn_missed_end);
+	        rsl_push_meas_res(lchan);
 		lchan_new_ul_meas(lchan, ulm, fn);
 
 		/* Report to the caller that we missed an inverval end
diff --git a/src/common/rsl.c b/src/common/rsl.c
index ff2d997..84106d8 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2590,6 +2590,7 @@
 	uint8_t chan_nr = gsm_lchan2chan_nr(lchan);
 	int res_valid = lchan->meas.flags & LC_UL_M_F_RES_VALID;
 	struct gsm_bts *bts = lchan->ts->trx->bts;
+	int timing_offset = -1;
 
 	LOGP(DRSL, LOGL_DEBUG,
 	     "%s chan_num:%u Tx MEAS RES valid(%d), flags(%02x)\n",
@@ -2602,8 +2603,10 @@
 	if (!msg)
 		return -ENOMEM;
 
+	if (le)
+		timing_offset = ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE;
 	LOGP(DRSL, LOGL_DEBUG,
-	     "%s Send Meas RES: NUM:%u, RXLEV_FULL:%u, RXLEV_SUB:%u, RXQUAL_FULL:%u, RXQUAL_SUB:%u, MS_PWR:%u, UL_TA:%u, L3_LEN:%d, TimingOff:%u\n",
+	     "%s Send Meas RES: NUM:%u, RXLEV_FULL:%u, RXLEV_SUB:%u, RXQUAL_FULL:%u, RXQUAL_SUB:%u, MS_PWR:%u, UL_TA:%u, L3_LEN:%d, TimingOff:%i\n",
 	     gsm_lchan_name(lchan),
 	     lchan->meas.res_nr,
 	     lchan->meas.ul_res.full.rx_lev,
@@ -2611,7 +2614,7 @@
 	     lchan->meas.ul_res.full.rx_qual,
 	     lchan->meas.ul_res.sub.rx_qual,
 	     lchan->meas.l1_info[0],
-	     lchan->meas.l1_info[1], l3_len, ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE);
+	     lchan->meas.l1_info[1], l3_len, timing_offset);
 
 	msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++);
 	size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res,
@@ -2641,13 +2644,26 @@
 		lchan->meas.flags &= ~LC_UL_M_F_RES_VALID;
 	}
 	msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr);
+
+	/* NOTE: In the following we will add measurement results that depend
+	 * on valid L1 and L3 messages from the MS. If we lost the last SACCH
+	 * block we do not have this info. For those cases we will leave out
+	 * L1 info, L3 info and MS timing offset but we will still reset the
+	 * related flags just to be sure. See also: 3GPP TS 08.58,
+	 * chapter 8.4.8 MEASUREMENT RESULT */
 	if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {
-		msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info);
+		if (l3 && l3_len > 0)
+			msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2,
+					  lchan->meas.l1_info);
 		lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
 	}
-	msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);
+
+	if (l3 && l3_len > 0)
+		msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);
 	if (ms_to_valid(lchan)) {
-		msgb_tv_put(msg, RSL_IE_MS_TIMING_OFFSET, ms_to2rsl(lchan, le));
+		if (l3 && l3_len > 0 && le)
+			msgb_tv_put(msg, RSL_IE_MS_TIMING_OFFSET,
+				    ms_to2rsl(lchan, le));
 		lchan->ms_t_offs = -1;
 		lchan->p_offs = -1;
 	}
@@ -2658,6 +2674,15 @@
 	return abis_bts_rsl_sendmsg(msg);
 }
 
+/* forcefully push a measurement report to RSL. This is called by measurement.c,
+ * when it detects that a SACCH block was lost. The report will then only
+ * contain the measurement data from the BTS since the measurement data from
+ * the MS is lost in those cases */
+void rsl_push_meas_res(struct gsm_lchan *lchan)
+{
+	rsl_tx_meas_res(lchan, NULL, 0, NULL);
+}
+
 /* call-back for LAPDm code, called when it wants to send msgs UP */
 int lapdm_rll_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx)
 {

-- 
To view, visit https://gerrit.osmocom.org/10761
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6d20136832714e3d439ddf9abaea0f66898bb61
Gerrit-Change-Number: 10761
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180904/7fe7e162/attachment.htm>


More information about the gerrit-log mailing list