diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-29 21:02:58 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-06-29 22:24:24 +0200 |
commit | 4011c5462002f30be7aa9e12bd6e380590d4aab5 (patch) | |
tree | c38a1d2e3e23d7575d9e9455c4da832705898432 | |
parent | 4cff7293534eab399b28a0414a388f18df4afe13 (diff) |
handover_decision_2.c: add current_rxqual()
Pre-empt code dup: this will be also used by an upcoming patch, so first
put it in a function.
Change-Id: I0d5bdaa9605f2bd4241cdd47ccf1ce1c697818a8
-rw-r--r-- | src/osmo-bsc/handover_decision_2.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c index c9d11981a..7a14f06ae 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -250,6 +250,15 @@ static int current_rxlev(struct gsm_lchan *lchan) ho_get_hodec2_rxlev_avg_win(bts->ho)); } +static int current_rxqual(struct gsm_lchan *lchan) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + return get_meas_rep_avg(lchan, + ho_get_hodec2_full_tdma(bts->ho) ? + MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB, + ho_get_hodec2_rxqual_avg_win(bts->ho)); +} + static bool is_low_rxlev(int rxlev_current, struct handover_cfg *neigh_cfg) { return rxlev_current >= 0 @@ -1464,10 +1473,7 @@ static void on_measurement_report(struct gsm_meas_rep *mr) /* get average levels. if not enough measurements yet, value is < 0 */ av_rxlev = current_rxlev(lchan); - av_rxqual = get_meas_rep_avg(lchan, - ho_get_hodec2_full_tdma(bts->ho) ? - MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB, - ho_get_hodec2_rxqual_avg_win(bts->ho)); + av_rxqual = current_rxqual(lchan); if (av_rxlev < 0 && av_rxqual < 0) { LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measurements\n"); return; |