aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-02-27 19:41:11 +0100
committerHarald Welte <laforge@gnumonks.org>2018-02-27 20:00:16 +0100
commit5bd6132c044b022d17f113f55d4778ce686a6259 (patch)
tree3d39c017ba8dd234aa5c94244fd3ada89bad75c4 /src/common/rsl.c
parent916d508bf6312acbc29a3e3575151b9bc7bc66d2 (diff)
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
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5c266ba7..98e8913b 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2400,6 +2400,7 @@ static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, con
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 @@ static int rsl_tx_meas_res(struct gsm_lchan *lchan, uint8_t *l3, int l3_len, con
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;
}