aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-19 17:12:18 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-10-19 17:29:46 +0700
commit284e4c4437cf8fd02e9411ec2810eb752e37d20e (patch)
treed3c6c818e272620b80d68e1af869e69de1314a7b /src
parent00da6dcb88ade39cbe1fe2e2bc274c9030b35df1 (diff)
power_control: do nothing if 'rx-current' equals 'rx-target'
It makes no sense to do further calculations if the actual Uplink signal strength equals the target value configured in the VTY. Change-Id: Id99c7013a722403e773df8367b1a9d7a856e639b Related: SYS#4916
Diffstat (limited to 'src')
-rw-r--r--src/common/power_control.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/common/power_control.c b/src/common/power_control.c
index 4798f4fa..e2d1254a 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -143,6 +143,19 @@ int lchan_ms_pwr_ctrl(struct gsm_lchan *lchan,
to reach expected power. */
diff = bts->ul_power_target - avg_ul_rssi_dbm;
+
+ /* TODO: introduce 'hysteresis' defining a range of tolerable deviation */
+ if (diff == 0) {
+ LOGPLCHAN(lchan, DLOOP, LOGL_INFO,
+ "Keeping MS power at control level %d (%d dBm) because diff %d dBm "
+ "from 'rx-target' %d dBm is not significant\n",
+ ms_power_lvl, ms_dbm, diff, bts->ul_power_target);
+ /* Keep the current power level in sync (just to be sure) */
+ lchan->ms_power_ctrl.current = ms_power_lvl;
+ bts_model_adjst_ms_pwr(lchan);
+ return 0;
+ }
+
/* don't ever change more than MS_{LOWER,RAISE}_MAX_DBM during one loop
iteration, i.e. reduce the speed at which the MS transmit power can
change. A higher value means a lower level (and vice versa) */