From a0403d3769d3027639e35874c09808ce5c0ba860 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 15 Jan 2020 11:01:24 +0100 Subject: ta_control: move timing advance code from osmo-bts-trx to common The timing advance controller that is implemented in loops.c of osmo-bts-trx only works for osmo-bts-trx and not for any of the phy based bts. Lets move the timing advance controller into the common part and make it available for every bts. Also lets add a unit-test. Change-Id: If7ddf74db3abc9b9872abe620a0aeebe3327e70a Related: SYS#4567 --- src/common/measurement.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common/measurement.c') diff --git a/src/common/measurement.c b/src/common/measurement.c index 3e0daf19..ddc17474 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -10,6 +10,7 @@ #include #include #include +#include /* Tables as per TS 45.008 Section 8.3 */ static const uint8_t ts45008_83_tch_f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }; @@ -696,6 +697,11 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) lchan_meas_compute_extended(lchan); + /* Compute new ta_req value. This has to be done here since the value + * in lchan->meas.num_ul_meas together with lchan->meas.ms_toa256 + * is needed for the computation. */ + lchan_ms_ta_ctrl(lchan); + lchan->meas.num_ul_meas = 0; /* return 1 to indicate that the computation has been done and the next -- cgit v1.2.3