Change in osmo-bts[master]: power_control.c: Don't use announced MS Power level as input for loop...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Nov 21 11:41:25 UTC 2019


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/16141 )

Change subject: power_control.c: Don't use announced MS Power level as input for loop calculations
......................................................................

power_control.c: Don't use announced MS Power level as input for loop calculations

Use instead the received MS Power currently in use by the MS matching
the measured signal. This way there's no need to wait for the MS to
reach the announced MS power level or add checks in case the MS doesn't
support that specific power level. Furthermore, more fine grained
announced power level value can be obtained faster due to more input
iterations not being dropped while waiting.

osmo-bts-trx specific algo was not following this approach and using
announced MS power instead because it's wowrking at a lower level and
henche was not using the transmitted MS Power level value by the MS as
input for the calculation.

The "if (diff < 2 && diff > -2))" condition is dropped since equal
signal strength may still result in a different MS power level announced
(the one currently used by the MS during tx of last SACCH block).

Related: OS#1851
Change-Id: I4494dc27a295a3dca1d3331d4ff712d486643e13
---
M include/osmo-bts/gsm_data_shared.h
M src/common/l1sap.c
M src/common/power_control.c
3 files changed, 4 insertions(+), 26 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved



diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index c19bb21..41998ad 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -322,7 +322,6 @@
 		uint8_t current;
 		uint8_t max;
 		bool fixed;
-		int8_t last_received; /* last received MS Power in uplink L1 SACCH, -1 means not set */
 	} ms_power_ctrl;
 	/* Power levels for BTS */
 	uint8_t bs_power;
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 4937d1e..7bf0b09 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1647,7 +1647,6 @@
 
 	lchan->sacch_deact = 0;
 	lchan->s = lchan->ts->trx->bts->radio_link_timeout;
-	lchan->ms_power_ctrl.last_received = -1; /* mark no ms power received yet */
 
 	rc = l1sap_chan_act_dact_modify(trx, chan_nr, PRIM_INFO_ACTIVATE, 0);
 	if (rc)
diff --git a/src/common/power_control.c b/src/common/power_control.c
index 129334e..d08ed5e 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -51,35 +51,15 @@
 	if (lchan->ms_power_ctrl.fixed)
 		return 0;
 
-	/* The phone hasn't reached the power level yet.
-	   TODO: store .last and check if MS is trying to move towards current. */
-	if (lchan->ms_power_ctrl.current != ms_power) {
-		if (lchan->ms_power_ctrl.last_received == -1 ||
-		    lchan->ms_power_ctrl.last_received != ms_power) {
-			/* MS Power still changing, keep current power level */
-			lchan->ms_power_ctrl.last_received = ms_power;
-			return 0;
-		}
-		/* else: we are stuck with some received MS Power level
-		   different than the one we announce, probably because the MS
-		   doesn't support that exact one so it picked the nearest one
-		   */
-		lchan->ms_power_ctrl.last_received = ms_power;
-	}
-
 	/* How many dBs measured power should be increased (+) or decreased (-)
 	   to reach expected power. */
 	diff = bts->ul_power_target - rxLevel;
 
-	/* power levels change in steps of 2 dB, so a smaller diff will end up in no change */
-	if (diff < 2 && diff > -2)
-		return 0;
-
-	current_dbm = ms_pwr_dbm(band, lchan->ms_power_ctrl.current);
+	current_dbm = ms_pwr_dbm(band, ms_power);
 	if (current_dbm < 0) {
 		LOGPLCHAN(lchan, DLOOP, LOGL_NOTICE,
 			  "Failed to calculate dBm for power ctl level %" PRIu8 " on band %s\n",
-			  lchan->ms_power_ctrl.current, gsm_band_name(band));
+			  ms_power, gsm_band_name(band));
 		return 0;
 	}
 	bsc_max_dbm = ms_pwr_dbm(band, lchan->ms_power_ctrl.max);
@@ -110,13 +90,13 @@
 	}
 
 	if (lchan->ms_power_ctrl.current == new_power) {
-		LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Keeping MS new_power at control level %d, %d dBm "
+		LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "Keeping MS power at control level %d, %d dBm "
 			  "(rx-ms-pwr-lvl %" PRIu8 ", rx-current %d dBm, rx-target %d dBm)\n",
 			new_power, ms_pwr_dbm(band, new_power), ms_power, rxLevel, bts->ul_power_target);
 		return 0;
 	}
 
-	LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "%s MS new_power from control level %d (%d dBm) to %d, %d dBm "
+	LOGPLCHAN(lchan, DLOOP, LOGL_INFO, "%s MS power from control level %d (%d dBm) to %d, %d dBm "
 		  "(rx-ms-pwr-lvl %" PRIu8 ", rx-current %d dBm, rx-target %d dBm)\n",
 		(diff > 0) ? "Raising" : "Lowering",
 		lchan->ms_power_ctrl.current, ms_pwr_dbm(band, lchan->ms_power_ctrl.current),

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/16141
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I4494dc27a295a3dca1d3331d4ff712d486643e13
Gerrit-Change-Number: 16141
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191121/7aff57a6/attachment.htm>


More information about the gerrit-log mailing list