Change in osmo-bts[master]: Implement tx power ramp down during BTS shutdown

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 Jun 18 12:51:36 UTC 2020


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


Change subject: Implement tx power ramp down during BTS shutdown
......................................................................

Implement tx power ramp down during BTS shutdown

Upon BTS shutdown (for instance because the Abis link against BSC was
lost), stop the operation in an ordered manner (cell soft lock). This
means slowly decrease tx power so that MS have time to handover to other
neighbour cells.

Related: SYS#4920
Change-Id: I70e34dda8974ebd94aea33bd9fb1d99f9063cc55
---
M include/osmo-bts/bts_shutdown_fsm.h
M src/common/bts_shutdown_fsm.c
M src/common/gsm_data.c
3 files changed, 37 insertions(+), 7 deletions(-)



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

diff --git a/include/osmo-bts/bts_shutdown_fsm.h b/include/osmo-bts/bts_shutdown_fsm.h
index 1ced7a1..95ab552 100644
--- a/include/osmo-bts/bts_shutdown_fsm.h
+++ b/include/osmo-bts/bts_shutdown_fsm.h
@@ -33,6 +33,7 @@
 
 enum bts_shutdown_fsm_events {
 	E_BTS_SHUTDOWN_START,
+	E_BTS_SHUTDOWN_TRX_RAMP_COMPL,
 };
 
 extern struct osmo_fsm bts_shutdown_fsm;
diff --git a/src/common/bts_shutdown_fsm.c b/src/common/bts_shutdown_fsm.c
index c8aa0ff..e24bab1 100644
--- a/src/common/bts_shutdown_fsm.c
+++ b/src/common/bts_shutdown_fsm.c
@@ -48,17 +48,44 @@
 	}
 }
 
+static void ramp_down_compl_cb(struct gsm_bts_trx *trx) {
+       osmo_fsm_inst_dispatch(trx->bts->shutdown_fi, E_BTS_SHUTDOWN_TRX_RAMP_COMPL, trx);
+}
+
 static void st_bts_shutdown_wait_ramp_down_compl_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
 {
-	/* TODO: here power ramp down will be started on all TRX, prior to changing state */
+	struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
+	unsigned int i;
+
+	for (i = 0; i < bts->num_trx; i++) {
+		struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, i);
+		power_ramp_start(trx, 0, 1, ramp_down_compl_cb);
+	}
 }
 
 static void st_bts_shutdown_wait_ramp_down_compl(struct osmo_fsm_inst *fi, uint32_t event, void *data)
 {
-	/* TODO: In here once we have ramp down implemented we'll transit to
-	   regular exit. For now we simply wait for state timeout
-	   bts_shutdown_fsm_state_chg(fi, ST_BTS_SHUTDOWN_EXIT);
-	*/
+	struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
+	struct gsm_bts_trx *src_trx;
+	unsigned int i, remaining = 0;
+
+	switch(event) {
+	case E_BTS_SHUTDOWN_TRX_RAMP_COMPL:
+		src_trx = (struct gsm_bts_trx *)data;
+
+		/* All other objects start off-line until the BTS Model code says otherwise */
+		for (i = 0; i < bts->num_trx; i++) {
+			struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, i);
+			if (trx->power_params.p_total_cur_mdBm != 0)
+				remaining++;
+		}
+
+		LOGPFSML(fi, LOGL_INFO, "%s Ramping down complete, %d TRX remaining\n",
+			 gsm_trx_name(src_trx), remaining);
+		if (remaining == 0)
+			bts_shutdown_fsm_state_chg(fi, ST_BTS_SHUTDOWN_EXIT);
+		break;
+	}
 }
 
 static void st_bts_shutdown_exit_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
@@ -83,7 +110,8 @@
 		.action = st_bts_shutdown_none,
 	},
 	[ST_BTS_SHUTDOWN_WAIT_RAMP_DOWN_COMPL] = {
-		.in_event_mask = 0,
+		.in_event_mask =
+			X(E_BTS_SHUTDOWN_TRX_RAMP_COMPL),
 		.out_state_mask =
 			X(ST_BTS_SHUTDOWN_EXIT),
 		.name = "WaitRampDownComplete",
@@ -98,6 +126,7 @@
 
 const struct value_string bts_shutdown_fsm_event_names[] = {
 	OSMO_VALUE_STRING(E_BTS_SHUTDOWN_START),
+	OSMO_VALUE_STRING(E_BTS_SHUTDOWN_TRX_RAMP_COMPL),
 	{ 0, NULL }
 };
 
diff --git a/src/common/gsm_data.c b/src/common/gsm_data.c
index 5591af1..f983970 100644
--- a/src/common/gsm_data.c
+++ b/src/common/gsm_data.c
@@ -40,7 +40,7 @@
 #include <osmo-bts/bts_shutdown_fsm.h>
 
 static struct osmo_tdef bts_T_defs[] = {
-	{ .T=-1, .default_val=1, .desc="Grace time for ramp down complete during shutdown (s)" },
+	{ .T=-1, .default_val=650, .desc="Grace time for ramp down complete during shutdown (s)" },
 	{ .T=-2, .default_val=3, .desc="Grace time for proper ordered shutdown of transceivers (s)" },
 	{}
 };

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I70e34dda8974ebd94aea33bd9fb1d99f9063cc55
Gerrit-Change-Number: 18904
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/20200618/1fd5b8e8/attachment.htm>


More information about the gerrit-log mailing list