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
This commit is contained in:
Neels Hofmeyr 2021-06-29 21:02:58 +02:00
parent 4cff729353
commit 4011c54620
1 changed files with 10 additions and 4 deletions

View File

@ -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;