[MERGED] osmo-bts[master]: Add high-accuracy ToA value to Uplink Measurement Reports

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
Tue Feb 27 21:58:36 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: Add high-accuracy ToA value to Uplink Measurement Reports
......................................................................


Add high-accuracy ToA value to Uplink Measurement Reports

Normal Abis RSL MEasurement Results contain only the "MS Timing Offset
IE" in units of full symbols.  In some use cases it is important to have
higher-accuracy timing information exposed to the BSC.

We do this by adding the average timing offset value during the last
measurement interval in 1/256th symbol accuracy to the "Supplementary
MEasuremen Information" part of the TS 48.058 9.3.25 Uplink Measurements
IE.

In order to avoid any compatibility issues, this feature is only enabled
if the new vty config command "supp-meas-info toa256" at the bts node
is enabled.

Change-Id: Ie85e53b47d4041cc4e6d7b78406ae8b79b2d9397
---
M include/osmo-bts/gsm_data_shared.h
M src/common/rsl.c
M src/common/vty.c
3 files changed, 41 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index 2d6ead1..2c21865 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -818,6 +818,7 @@
 	int bcch_change_mark;
 
 	struct rate_ctr_group *ctrs;
+	bool supp_meas_toa256;
 
 	void *role;
 };
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5c266ba..98e8913 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2400,6 +2400,7 @@
 	uint8_t meas_res[16];
 	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;
 
 	LOGP(DRSL, LOGL_DEBUG,
 	     "%s chan_num:%u Tx MEAS RES valid(%d), flags(%02x)\n",
@@ -2429,6 +2430,17 @@
 						meas_res);
 	lchan->tch.dtx.dl_active = false;
 	if (ie_len >= 3) {
+		if (bts->supp_meas_toa256) {
+			/* append signed 16bit value containing MS timing offset in 1/256th symbols
+			 * in the vendor-specific "Supplementary Measurement Information" part of
+			 * the uplink measurements IE.  This is the current offset *relative* to the
+			 * TA which the MS has already applied.  So if you want to know the total
+			 * propagation time between MS and BTS, you need to add the actual TA value
+			 * used (from L1_INFO below, in full symbols) plus the ms_toa256 value
+			 * in 1/256 symbol periods. */
+			meas_res[ie_len++] = lchan->meas.ms_toa256 >> 8;
+			meas_res[ie_len++] = lchan->meas.ms_toa256 & 0xff;
+		}
 		msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, ie_len, meas_res);
 		lchan->meas.flags &= ~LC_UL_M_F_RES_VALID;
 	}
diff --git a/src/common/vty.c b/src/common/vty.c
index 3938de5..b57e019 100644
--- a/src/common/vty.c
+++ b/src/common/vty.c
@@ -295,6 +295,8 @@
 		VTY_NEWLINE);
 	if (strcmp(btsb->pcu.sock_path, PCU_SOCK_DEFAULT))
 		vty_out(vty, " pcu-socket %s%s", btsb->pcu.sock_path, VTY_NEWLINE);
+	if (bts->supp_meas_toa256)
+		vty_out(vty, " supp-meas-info toa256%s", VTY_NEWLINE);
 
 	bts_model_config_write_bts(vty, bts);
 
@@ -621,6 +623,30 @@
 	btsb->pcu.sock_path = talloc_strdup(btsb, argv[0]);
 	/* FIXME: re-open the interface? */
 
+	return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_supp_meas_toa256, cfg_bts_supp_meas_toa256_cmd,
+	"supp-meas-info toa256",
+	"Configure the RSL Supplementary Measurement Info\n"
+	"Report the TOA in 1/256th symbol periods\n")
+{
+	struct gsm_bts *bts = vty->index;
+	struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+	bts->supp_meas_toa256 = true;
+	return CMD_SUCCESS;
+}
+
+DEFUN(cfg_bts_no_supp_meas_toa256, cfg_bts_no_supp_meas_toa256_cmd,
+	"no supp-meas-info toa256",
+	NO_STR "Configure the RSL Supplementary Measurement Info\n"
+	"Report the TOA in 1/256th symbol periods\n")
+{
+	struct gsm_bts *bts = vty->index;
+	struct gsm_bts_role_bts *btsb = bts_role_bts(bts);
+
+	bts->supp_meas_toa256 = false;
 	return CMD_SUCCESS;
 }
 
@@ -1559,6 +1585,8 @@
 	install_element(BTS_NODE, &cfg_bts_min_qual_norm_cmd);
 	install_element(BTS_NODE, &cfg_bts_max_ber_rach_cmd);
 	install_element(BTS_NODE, &cfg_bts_pcu_sock_cmd);
+	install_element(BTS_NODE, &cfg_bts_supp_meas_toa256_cmd);
+	install_element(BTS_NODE, &cfg_bts_no_supp_meas_toa256_cmd);
 
 	install_element(BTS_NODE, &cfg_trx_gsmtap_sapi_cmd);
 	install_element(BTS_NODE, &cfg_trx_no_gsmtap_sapi_cmd);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie85e53b47d4041cc4e6d7b78406ae8b79b2d9397
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list