Change in osmo-bts[master]: nm_*_fsm: Move reset state code to st_op_disabled_notinstalled_on_enter

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
Fri Oct 8 15:54:24 UTC 2021


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


Change subject: nm_*_fsm: Move reset state code to st_op_disabled_notinstalled_on_enter
......................................................................

nm_*_fsm: Move reset state code to st_op_disabled_notinstalled_on_enter

Let's rather put it there instead of the shutdown code path, since we'll
be adding more and more reset coe there.

Change-Id: I43a136ade731a2c58c0a29d97875088e9b6d4414
---
M src/common/nm_bts_fsm.c
M src/common/nm_channel_fsm.c
2 files changed, 8 insertions(+), 5 deletions(-)



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

diff --git a/src/common/nm_bts_fsm.c b/src/common/nm_bts_fsm.c
index d2c48fb..c825ab5 100644
--- a/src/common/nm_bts_fsm.c
+++ b/src/common/nm_bts_fsm.c
@@ -57,6 +57,9 @@
 static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
 {
 	struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
+	/* Reset state: */
+	bts->si_valid = 0;
+
 	bts->mo.setattr_success = false;
 	bts->mo.opstart_success = false;
 	oml_mo_state_chg(&bts->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED, NM_STATE_LOCKED);
@@ -150,8 +153,6 @@
 	case NM_EV_SHUTDOWN_FINISH:
 		/* Propagate event to children: */
 		ev_dispatch_children(bts, event);
-		/* Reset state: */
-		bts->si_valid = 0;
 		nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_NOTINSTALLED);
 		break;
 	default:
diff --git a/src/common/nm_channel_fsm.c b/src/common/nm_channel_fsm.c
index 6456005..8ffddae 100644
--- a/src/common/nm_channel_fsm.c
+++ b/src/common/nm_channel_fsm.c
@@ -55,6 +55,11 @@
 static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
 {
 	struct gsm_bts_trx_ts *ts = (struct gsm_bts_trx_ts *)fi->priv;
+	/* Reset state: */
+	gsm_ts_release(ts);
+	if (ts->vamos.peer)
+		gsm_ts_release(ts->vamos.peer);
+
 	ts->mo.setattr_success = false;
 	ts->mo.opstart_success = false;
 	oml_mo_state_chg(&ts->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED, NM_STATE_LOCKED);
@@ -193,9 +198,6 @@
 		oml_mo_state_chg(&ts->mo, -1, -1, NM_STATE_SHUTDOWN);
 		break;
 	case NM_EV_SHUTDOWN_FINISH:
-		gsm_ts_release(ts);
-		if (ts->vamos.peer)
-			gsm_ts_release(ts->vamos.peer);
 		nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_DISABLED_NOTINSTALLED);
 		break;
 	default:

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I43a136ade731a2c58c0a29d97875088e9b6d4414
Gerrit-Change-Number: 25729
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/20211008/5d9d90b5/attachment.htm>


More information about the gerrit-log mailing list