Review at  https://gerrit.osmocom.org/6868

Revert "measurement: fix measurement computation"

This reverts commit d5fdcfe6d95f52fb76c4f4201969347a062fc9fd, which
introduces a new function lchan_meas_update_ordered_TA whose
functionality I still haven't yet managed to fully understand. It
appears to be adjusting the requested timing advance (lchan->rqd_ta) but
outside osmo-bts-trx/loops.c code. This is odd, as rqd_ta is a state
variable of that loops.c code.

So for one part, it is a failure of encapsulation. The TA loop code
should be self-contained, particularly as it is only used for
omso-bts-trx, and not for the other BTS models. The new
lchan_meas_update_ordered_TA() function is used from common code,
applicable to all BTS models.

The resulting interaction between loops.c code and this new (now
reverted) function cause the TA value to only ever grow, despite the MS
never moving at all.

Change-Id: I5a5adac6f18f94a5b51758a5ace8ef6ddfd23e80
Related: OS#2989
---
M src/common/measurement.c
M src/common/rsl.c
2 files changed, 1 insertion(+), 49 deletions(-)


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

diff --git a/src/common/measurement.c b/src/common/measurement.c
index e4b8720..4b486d3 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -240,50 +240,6 @@
        return 7;
 }
 
-/* Update order  TA at end of meas period */
-static void lchan_meas_update_ordered_TA(struct gsm_lchan *lchan,
-                                        int32_t taqb_sum)
-{
-       int32_t ms_timing_offset = 0;
-       uint8_t l1_info_valid;
-
-       l1_info_valid = lchan->meas.flags & LC_UL_M_F_L1_VALID;
-
-       if (l1_info_valid) {
-               DEBUGP(DMEAS,
-                      "%s Update TA TimingOffset_Mean:%d, UL RX TA:%d, DL 
ordered TA:%d, flags:%d \n",
-                      gsm_lchan_name(lchan), taqb_sum, lchan->meas.l1_info[1],
-                      lchan->rqd_ta, lchan->meas.flags);
-
-               ms_timing_offset =
-                   taqb_sum + (lchan->meas.l1_info[1] - lchan->rqd_ta);
-
-               if (ms_timing_offset > 0) {
-                       if (lchan->rqd_ta < MEAS_MAX_TIMING_ADVANCE) {
-                               /* MS is moving away from BTS.
-                                * So increment Ordered TA by 1 */
-                               lchan->rqd_ta++;
-                       }
-               } else if (ms_timing_offset < 0) {
-                       if (lchan->rqd_ta > MEAS_MIN_TIMING_ADVANCE) {
-                               /* MS is moving toward BTS. So decrement
-                                * Ordered TA by 1 */
-                               lchan->rqd_ta--;
-                       }
-               }
-
-               DEBUGP(DMEAS,
-                      "%s New Update TA--> TimingOff_diff:%d, UL RX TA:%d, DL 
ordered TA:%d \n",
-                      gsm_lchan_name(lchan), ms_timing_offset,
-                      lchan->meas.l1_info[1], lchan->rqd_ta);
-       }
-
-       /* Clear L1 INFO valid flag at Meas period end */
-       lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
-
-       return;
-}
-
 int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn)
 {
        struct gsm_meas_rep_unidir *mru;
@@ -338,9 +294,6 @@
                taqb_sum, ber_full_sum/100,
                ber_full_sum%100, irssi_full_sum, ber_sub_sum/100, 
ber_sub_sum%100,
                irssi_sub_sum);
-
-       /* Update ordered TA for DL SACCH L1 Header */
-       lchan_meas_update_ordered_TA(lchan, taqb_sum);
 
        /* store results */
        mru = &lchan->meas.ul_res;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index 5bbd61a..8448925 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -2376,8 +2376,7 @@
        msgb_tv_put(msg, RSL_IE_BS_POWER, lchan->meas.bts_tx_pwr);
        if (lchan->meas.flags & LC_UL_M_F_L1_VALID) {
                msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, 2, lchan->meas.l1_info);
-               /* Note: L1 info valid flag is cleared by function
-                * lchan_meas_update_ordered_TA() in measurement.c */
+               lchan->meas.flags &= ~LC_UL_M_F_L1_VALID;
        }
        msgb_tl16v_put(msg, RSL_IE_L3_INFO, l3_len, l3);
        if (ms_to_valid(lchan)) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a5adac6f18f94a5b51758a5ace8ef6ddfd23e80
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <lafo...@gnumonks.org>

Reply via email to