From 2f3cd4b697972d8484f9a9d3b7ef634086f65fa5 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 20 Sep 2021 14:56:39 +0200 Subject: [PATCH] MS Power Control Loop: Disable threshold comparison on {LOWER,UPPER}_CMP_N=0 This way we provide an effective way to disable C/I based decision taking in the MS Power Control Loop. With this set up, MS Power Level is decided only based on RxLev. This allows for working setup in following scenarios: * BTS L1 not passing proper C/I values to upper layers (eg. TRXDv0). * User not willing to spend time configuring proper C/I levels for each channel type. Related: SYS#4917 Change-Id: Ibd10eb96a5d072d5c19f7449a8b11e64aad1cd4c --- src/common/power_control.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/common/power_control.c b/src/common/power_control.c index a3334be85..8f5ce3706 100644 --- a/src/common/power_control.c +++ b/src/common/power_control.c @@ -199,7 +199,7 @@ int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan, uint8_t rxlev_avg; int16_t ul_lqual_cb_avg; const struct gsm_power_ctrl_meas_params *ci_meas; - bool ignore; + bool ignore, ci_on; if (!trx_ms_pwr_ctrl_is_osmo(trx)) return 0; @@ -225,13 +225,19 @@ int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan, return 0; } - /* If computed C/I is out of acceptable thresholds: */ ci_meas = lchan_get_ci_thresholds(lchan); + + /* Is C/I based algo enabled by config? + * FIXME: this can later be generalized when properly implementing P & N counting. */ + ci_on = ci_meas->lower_cmp_n && ci_meas->upper_cmp_n; + ul_lqual_cb_avg = do_avg_algo(ci_meas, &state->ci_meas_proc, ul_lqual_cb); rxlev_avg = do_avg_algo(¶ms->rxlev_meas, &state->rxlev_meas_proc, dbm2rxlev(ul_rssi_dbm)); - if (ul_lqual_cb_avg < ci_meas->lower_thresh * 10) { + + /* If computed C/I is enabled and out of acceptable thresholds: */ + if (ci_on && ul_lqual_cb_avg < ci_meas->lower_thresh * 10) { new_dbm = ms_dbm + params->inc_step_size_db; - } else if (ul_lqual_cb_avg > ci_meas->upper_thresh * 10) { + } else if (ci_on && ul_lqual_cb_avg > ci_meas->upper_thresh * 10) { new_dbm = ms_dbm - params->red_step_size_db; } else { /* Calculate the new Tx power value (in dBm) */