Change in osmo-bts[master]: power_control.c: Fix ms pwr ctrl skipped if MS doesn't support announ...

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 14 19:04:15 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/16077 )


Change subject: power_control.c: Fix ms pwr ctrl skipped if MS doesn't support announced MS Power Level
......................................................................

power_control.c: Fix ms pwr ctrl skipped if MS doesn't support announced MS Power Level

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



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/16077/1

diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h
index 8a52fe9..bd10056 100644
--- a/include/osmo-bts/gsm_data_shared.h
+++ b/include/osmo-bts/gsm_data_shared.h
@@ -322,6 +322,7 @@
 		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 7bf0b09..4937d1e 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -1647,6 +1647,7 @@
 
 	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 574825e..129334e 100644
--- a/src/common/power_control.c
+++ b/src/common/power_control.c
@@ -53,8 +53,19 @@
 
 	/* 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)
-		return 0;
+	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. */

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I1a9c00fe4eb3fa1eaa7997a9ec20716ddfe180a7
Gerrit-Change-Number: 16077
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191114/ce34dc9e/attachment.htm>


More information about the gerrit-log mailing list