Change in osmo-bsc[master]: power_control: fix: properly initialize per-lchan BS power

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/.

laforge gerrit-no-reply at lists.osmocom.org
Thu Jan 14 18:12:46 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/22192 )

Change subject: power_control: fix: properly initialize per-lchan BS power
......................................................................

power_control: fix: properly initialize per-lchan BS power

My assumption that lchan_reset() is called on CHANnel ACTIVation
was wrong - it's actually called on CHANnel RELease.  Therefore
(re)setting per-lchan BS power value must be done in the other
function that is responsible for channel activation.

Change-Id: I056c448ce017458dc4a004374ddca86d44dc35b4
Related: SYS#4918
---
M src/osmo-bsc/lchan_fsm.c
1 file changed, 6 insertions(+), 9 deletions(-)

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



diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index 5a42527..5054096 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -379,9 +379,6 @@
  */
 static void lchan_reset(struct gsm_lchan *lchan)
 {
-	const struct gsm_bts_trx *trx = lchan->ts->trx;
-	const struct gsm_bts *bts = trx->bts;
-
 	LOG_LCHAN(lchan, LOGL_DEBUG, "Clearing lchan state\n");
 
 	if (lchan->conn)
@@ -411,12 +408,6 @@
 
 		.release.rr_cause = GSM48_RR_CAUSE_NORMAL,
 	};
-
-	/* Default BS Power reduction value (in 2 dB steps) */
-	if (bts->bs_power_ctrl.mode == GSM_PWR_CTRL_MODE_DYN_BTS)
-		lchan->bs_power = bts->bs_power_ctrl.bs_power_max_db / 2;
-	else
-		lchan->bs_power = bts->bs_power_ctrl.bs_power_val_db / 2;
 }
 
 static void lchan_fsm_unused_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state)
@@ -595,6 +586,12 @@
 		/* Upon last entering the UNUSED state, from lchan_reset():
 		 * - bs_power is still zero, 0dB reduction, output power = Pn.
 		 * - TA is still zero, to be determined by RACH. */
+
+		/* Default BS Power reduction value (in 2 dB steps) */
+		if (bts->bs_power_ctrl.mode == GSM_PWR_CTRL_MODE_DYN_BTS)
+			lchan->bs_power = bts->bs_power_ctrl.bs_power_max_db / 2;
+		else
+			lchan->bs_power = bts->bs_power_ctrl.bs_power_val_db / 2;
 	}
 
 	if (info->chan_mode == GSM48_CMODE_SPEECH_AMR) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I056c448ce017458dc4a004374ddca86d44dc35b4
Gerrit-Change-Number: 22192
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
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/20210114/54b96c21/attachment.htm>


More information about the gerrit-log mailing list