Change in osmo-bts[master]: Introduce NM BTS Site Manager FSM

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
Tue Oct 20 13:45:58 UTC 2020


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

Change subject: Introduce NM BTS Site Manager FSM
......................................................................

Introduce NM BTS Site Manager FSM

This fixes old behavior mimicing broken behavior in nanoBTS (according to TS 12.21)
where BTS Site Mgr NM object was announced as Enabled despite no OPSTART
was sent by the BSC.
With this new FSM, BTS SiteManager will be announced as Disabled Offline
during OML startup conversation, instead of Enabled.

The new osmo-bsc OML management FSMs use this change in behavior to find
out whether it should use the old broken management states (without
Offline state, as per nanoBTS) or use the new state transitions (which
allow fixing several race conditions).

Change-Id: Iab2d17c45c9642860cd2d5d523c1baae24502243
---
M include/osmo-bts/Makefile.am
M include/osmo-bts/bts.h
A include/osmo-bts/nm_common_fsm.h
M include/osmo-bts/oml.h
M src/common/Makefile.am
M src/common/bts.c
A src/common/nm_bts_sm_fsm.c
A src/common/nm_common_fsm.c
M src/osmo-bts-litecell15/oml.c
M src/osmo-bts-oc2g/oml.c
M src/osmo-bts-octphy/l1_oml.c
M src/osmo-bts-omldummy/bts_model.c
M src/osmo-bts-sysmo/oml.c
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-virtual/bts_model.c
15 files changed, 284 insertions(+), 15 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am
index cdbaa4f..84dc667 100644
--- a/include/osmo-bts/Makefile.am
+++ b/include/osmo-bts/Makefile.am
@@ -27,4 +27,5 @@
 	phy_link.h \
 	dtx_dl_amr_fsm.h \
 	ta_control.h \
+	nm_common_fsm.h \
 	$(NULL)
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index a2eecc4..ce7d9d4 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -101,6 +101,11 @@
 	MS_UL_PF_ALGO_EWMA,
 };
 
+/* BTS Site Manager */
+struct gsm_bts_sm {
+	struct gsm_abis_mo mo;
+};
+
 /* One BTS */
 struct gsm_bts {
 	/* list header in net->bts_list */
@@ -150,9 +155,7 @@
 	/* CCCH is on C0 */
 	struct gsm_bts_trx *c0;
 
-	struct {
-		struct gsm_abis_mo mo;
-	} site_mgr;
+	struct gsm_bts_sm site_mgr;
 
 	/* bitmask of all SI that are present/valid in si_buf */
 	uint32_t si_valid;
@@ -345,6 +348,10 @@
 #define GSM_BTS_HAS_SI(bts, i) ((bts)->si_valid & (1 << i))
 #define GSM_BTS_SI(bts, i)     (void *)((bts)->si_buf[i][0])
 
+static inline struct gsm_bts *gsm_bts_sm_get_bts(struct gsm_bts_sm *site_mgr) {
+	return (struct gsm_bts *)container_of(site_mgr, struct gsm_bts, site_mgr);
+}
+
 struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num);
 struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num);
 
diff --git a/include/osmo-bts/nm_common_fsm.h b/include/osmo-bts/nm_common_fsm.h
new file mode 100644
index 0000000..bd8f8c1
--- /dev/null
+++ b/include/osmo-bts/nm_common_fsm.h
@@ -0,0 +1,44 @@
+/* Header for all NM FSM. Following 3GPP TS 12.21 Figure 2/GSM 12.21:
+  GSM 12.21 Objects' Operational state and availability status behaviour during initialization */
+
+/* (C) 2020 by sysmocom - s.m.f.c. GmbH <info at sysmocom.de>
+ * Author: Pau Espin Pedrol <pespin at sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#pragma once
+
+#include <osmocom/core/fsm.h>
+#include <osmocom/core/utils.h>
+
+/* Common */
+enum nm_fsm_events {
+	NM_EV_SW_ACT,
+	NM_EV_OPSTART_ACK,
+	NM_EV_OPSTART_NACK,
+};
+extern const struct value_string nm_fsm_event_names[];
+
+
+/* BTS SiteManager */
+enum nm_bts_sm_op_fsm_states {
+	NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED,
+	NM_BTS_SM_ST_OP_DISABLED_OFFLINE,
+	NM_BTS_SM_ST_OP_ENABLED,
+};
+extern struct osmo_fsm nm_bts_sm_fsm;
diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h
index 0689bb0..27afc53 100644
--- a/include/osmo-bts/oml.h
+++ b/include/osmo-bts/oml.h
@@ -30,6 +30,9 @@
 	struct tlv_parsed *nm_attr;
 	/* BTS to which this MO belongs */
 	struct gsm_bts *bts;
+	/* NM BTS Site Manager FSM */
+	struct osmo_fsm_inst *fi;
+	bool opstart_success;
 };
 
 int oml_init(void);
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index e3a72dc..458041e 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -37,6 +37,8 @@
 	dtx_dl_amr_fsm.c \
 	scheduler_mframe.c \
 	ta_control.c \
+	nm_common_fsm.c \
+	nm_bts_sm_fsm.c \
 	$(NULL)
 
 libl1sched_a_SOURCES = scheduler.c
diff --git a/src/common/bts.c b/src/common/bts.c
index 8a97b8f..0770640 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -52,6 +52,7 @@
 #include <osmo-bts/dtx_dl_amr_fsm.h>
 #include <osmo-bts/cbch.h>
 #include <osmo-bts/bts_shutdown_fsm.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 #define MIN_QUAL_RACH	 50 /* minimum link quality (in centiBels) for Access Bursts */
 #define MIN_QUAL_NORM	 -5 /* minimum link quality (in centiBels) for Normal Bursts */
@@ -200,6 +201,15 @@
 	{ 0, NULL }
 };
 
+static int gsm_bts_talloc_destructor(struct gsm_bts *bts)
+{
+	if (bts->site_mgr.mo.fi) {
+		osmo_fsm_inst_free(bts->site_mgr.mo.fi);
+		bts->site_mgr.mo.fi = NULL;
+	}
+	return 0;
+}
+
 struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num)
 {
 	struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts);
@@ -208,6 +218,8 @@
 	if (!bts)
 		return NULL;
 
+	talloc_set_destructor(bts, gsm_bts_talloc_destructor);
+
 	bts->nr = bts_num;
 	bts->num_trx = 0;
 	INIT_LLIST_HEAD(&bts->trx_list);
@@ -219,10 +231,13 @@
 					       LOGL_INFO, NULL);
 	osmo_fsm_inst_update_id_f(bts->shutdown_fi, "bts%d", bts->nr);
 
+	bts->site_mgr.mo.fi = osmo_fsm_inst_alloc(&nm_bts_sm_fsm, bts, &bts->site_mgr,
+						  LOGL_INFO, "bts_sm");
+	gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER,
+		    0xff, 0xff, 0xff);
+
 	gsm_mo_init(&bts->mo, bts, NM_OC_BTS,
 			bts->nr, 0xff, 0xff);
-	gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER,
-			0xff, 0xff, 0xff);
 
 	for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) {
 		bts->gprs.nsvc[i].bts = bts;
@@ -331,7 +346,7 @@
 	bts->radio_link_timeout.current = bts->radio_link_timeout.oml;
 
 	/* Start with the site manager */
-	oml_mo_state_init(&bts->site_mgr.mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK);
+	oml_mo_state_init(&bts->site_mgr.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
 
 	/* set BTS to dependency */
 	oml_mo_state_init(&bts->mo, -1, NM_AVSTATE_DEPENDENCY);
@@ -395,8 +410,8 @@
 
 	LOGP(DSUM, LOGL_INFO, "Main link established, sending NM Status.\n");
 
-	/* BTS and SITE MGR are EANBLED, BTS is DEPENDENCY */
-	oml_tx_state_changed(&bts->site_mgr.mo);
+	/* BTS SITE MGR becomes Offline (tx SW ACT Report), BTS is DEPENDENCY */
+	osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_SW_ACT, NULL);
 	oml_tx_state_changed(&bts->mo);
 
 	/* those should all be in DEPENDENCY */
diff --git a/src/common/nm_bts_sm_fsm.c b/src/common/nm_bts_sm_fsm.c
new file mode 100644
index 0000000..dedbacb
--- /dev/null
+++ b/src/common/nm_bts_sm_fsm.c
@@ -0,0 +1,145 @@
+/* NM BTS Site Manager FSM */
+
+/* (C) 2020 by sysmocom - s.m.f.c. GmbH <info at sysmocom.de>
+ * Author: Pau Espin Pedrol <pespin at sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <osmocom/core/fsm.h>
+#include <osmocom/core/tdef.h>
+#include <osmocom/gsm/protocol/gsm_12_21.h>
+
+#include <osmo-bts/logging.h>
+#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/bts_model.h>
+#include <osmo-bts/bts.h>
+#include <osmo-bts/rsl.h>
+#include <osmo-bts/nm_common_fsm.h>
+#include <osmo-bts/phy_link.h>
+
+#define X(s) (1 << (s))
+
+#define nm_bts_sm_fsm_state_chg(fi, NEXT_STATE) \
+	osmo_fsm_inst_state_chg(fi, NEXT_STATE, 0, 0)
+
+//////////////////////////
+// FSM STATE ACTIONS
+//////////////////////////
+
+static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+	struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv;
+	site_mgr->mo.opstart_success = false;
+	oml_mo_state_chg(&site_mgr->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
+}
+
+static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+	struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv;
+
+	switch (event) {
+	case NM_EV_SW_ACT:
+		oml_mo_tx_sw_act_rep(&site_mgr->mo);
+		nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_OFFLINE);
+		return;
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static void st_op_disabled_offline_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+	struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv;
+	site_mgr->mo.opstart_success = false;
+	oml_mo_state_chg(&site_mgr->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
+}
+
+static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+	struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv;
+
+	switch (event) {
+	case NM_EV_OPSTART_ACK:
+		site_mgr->mo.opstart_success = true;
+		oml_mo_opstart_ack(&site_mgr->mo);
+		nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED);
+		break; /* check statechg below */
+	case NM_EV_OPSTART_NACK:
+		site_mgr->mo.opstart_success = false;
+		oml_mo_opstart_nack(&site_mgr->mo, (int)(intptr_t)data);
+		return;
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+	struct gsm_bts_sm *site_mgr = (struct gsm_bts_sm *)fi->priv;
+	oml_mo_state_chg(&site_mgr->mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK);
+}
+
+static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+}
+
+static struct osmo_fsm_state nm_bts_sm_fsm_states[] = {
+	[NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED] = {
+		.in_event_mask =
+			X(NM_EV_SW_ACT),
+		.out_state_mask =
+			X(NM_BTS_SM_ST_OP_DISABLED_OFFLINE),
+		.name = "DISABLED_NOTINSTALLED",
+		.onenter = st_op_disabled_notinstalled_on_enter,
+		.action = st_op_disabled_notinstalled,
+	},
+	[NM_BTS_SM_ST_OP_DISABLED_OFFLINE] = {
+		.in_event_mask =
+			X(NM_EV_OPSTART_ACK) |
+			X(NM_EV_OPSTART_NACK),
+		.out_state_mask =
+			X(NM_BTS_SM_ST_OP_ENABLED),
+		.name = "DISABLED_OFFLINE",
+		.onenter = st_op_disabled_offline_on_enter,
+		.action = st_op_disabled_offline,
+	},
+	[NM_BTS_SM_ST_OP_ENABLED] = {
+		.in_event_mask = 0,
+		.out_state_mask = 0,
+		.name = "ENABLED",
+		.onenter = st_op_enabled_on_enter,
+		.action = st_op_enabled,
+	},
+};
+
+struct osmo_fsm nm_bts_sm_fsm = {
+	.name = "NM_BTS_SM_OP",
+	.states = nm_bts_sm_fsm_states,
+	.num_states = ARRAY_SIZE(nm_bts_sm_fsm_states),
+	.event_names = nm_fsm_event_names,
+	.log_subsys = DOML,
+};
+
+static __attribute__((constructor)) void nm_bts_sm_fsm_init(void)
+{
+	OSMO_ASSERT(osmo_fsm_register(&nm_bts_sm_fsm) == 0);
+}
diff --git a/src/common/nm_common_fsm.c b/src/common/nm_common_fsm.c
new file mode 100644
index 0000000..662a760
--- /dev/null
+++ b/src/common/nm_common_fsm.c
@@ -0,0 +1,31 @@
+/* NM FSM, common bits */
+
+/* (C) 2020 by sysmocom - s.m.f.c. GmbH <info at sysmocom.de>
+ * Author: Pau Espin Pedrol <pespin at sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include <osmocom/core/utils.h>
+#include <osmo-bts/nm_common_fsm.h>
+
+
+const struct value_string nm_fsm_event_names[] = {
+	{ NM_EV_SW_ACT, "SW_ACT" },
+	{ NM_EV_OPSTART_ACK, "OPSTART_ACK" },
+	{ NM_EV_OPSTART_NACK, "OPSTART_NACK" },
+	{ 0, NULL }
+};
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index 194ba7f..6ae0492 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -42,6 +42,7 @@
 #include <osmo-bts/phy_link.h>
 #include <osmo-bts/handover.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 #include "l1_if.h"
 #include "lc15bts.h"
@@ -1887,6 +1888,9 @@
 	int rc;
 
 	switch (mo->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		rc = osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_RADIO_CARRIER:
 		rc = trx_init(obj);
 		break;
@@ -1894,7 +1898,6 @@
 		rc = ts_opstart(obj);
 		break;
 	case NM_OC_BTS:
-	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
 	case NM_OC_GPRS_NSE:
 	case NM_OC_GPRS_CELL:
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index 695850c..8dda1e9 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -42,6 +42,7 @@
 #include <osmo-bts/phy_link.h>
 #include <osmo-bts/handover.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 #include "l1_if.h"
 #include "oc2gbts.h"
@@ -1896,6 +1897,9 @@
 	int rc;
 
 	switch (mo->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		rc = osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_RADIO_CARRIER:
 		rc = trx_init(obj);
 		break;
@@ -1903,7 +1907,6 @@
 		rc = ts_opstart(obj);
 		break;
 	case NM_OC_BTS:
-	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
 	case NM_OC_GPRS_NSE:
 	case NM_OC_GPRS_CELL:
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 7c203eb..be84466 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -38,6 +38,7 @@
 #include <osmo-bts/bts.h>
 #include <osmo-bts/bts_model.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 #include "l1_if.h"
 #include "l1_oml.h"
@@ -1766,6 +1767,9 @@
 	struct gsm_bts_trx_ts *ts;
 
 	switch (mo->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		rc = osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_RADIO_CARRIER:
 		rc = trx_init(obj);
 		break;
@@ -1774,7 +1778,6 @@
 		rc = ts_connect_as(ts, ts->pchan, pchan_act_compl_cb, NULL);
 		break;
 	case NM_OC_BTS:
-	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
 	case NM_OC_GPRS_NSE:
 	case NM_OC_GPRS_CELL:
diff --git a/src/osmo-bts-omldummy/bts_model.c b/src/osmo-bts-omldummy/bts_model.c
index 8a54107..6762c4e 100644
--- a/src/osmo-bts-omldummy/bts_model.c
+++ b/src/osmo-bts-omldummy/bts_model.c
@@ -34,6 +34,7 @@
 #include <osmo-bts/bts_model.h>
 #include <osmo-bts/handover.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 /* TODO: check if dummy method is sufficient, else implement */
 int bts_model_lchan_deactivate(struct gsm_lchan *lchan)
@@ -126,6 +127,9 @@
 	uint8_t tn;
 
 	switch (mo->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		rc = osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_RADIO_CARRIER:
 		trx = (struct gsm_bts_trx*) obj;
 		/* Mark Dependency TS as Offline (ready to be Opstarted) */
@@ -139,7 +143,6 @@
 		rc = oml_mo_opstart_ack(mo);
 		break;
 	case NM_OC_CHANNEL:
-	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
 	case NM_OC_BTS:
 	case NM_OC_GPRS_NSE:
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index cc53d72..7e77a99 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -39,6 +39,7 @@
 #include <osmo-bts/phy_link.h>
 #include <osmo-bts/handover.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 #include "l1_if.h"
 #include "femtobts.h"
@@ -1773,6 +1774,9 @@
 	int rc;
 
 	switch (mo->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		rc = osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_RADIO_CARRIER:
 		rc = trx_init(obj);
 		break;
@@ -1780,7 +1784,6 @@
 		rc = ts_opstart(obj);
 		break;
 	case NM_OC_BTS:
-	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
 	case NM_OC_GPRS_NSE:
 	case NM_OC_GPRS_CELL:
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 8ad004e..6aa77cb 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -44,6 +44,7 @@
 #include <osmo-bts/abis.h>
 #include <osmo-bts/scheduler.h>
 #include <osmo-bts/pcu_if.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 #include "l1_if.h"
 #include "trx_if.h"
@@ -616,13 +617,15 @@
 	int rc;
 
 	switch (mo->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		rc = osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_RADIO_CARRIER:
 		/* activate transceiver */
 		rc = trx_init(obj);
 		break;
 	case NM_OC_CHANNEL:
 	case NM_OC_BTS:
-	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
 	case NM_OC_GPRS_NSE:
 	case NM_OC_GPRS_CELL:
diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c
index 74ad31d..4aedff4 100644
--- a/src/osmo-bts-virtual/bts_model.c
+++ b/src/osmo-bts-virtual/bts_model.c
@@ -34,6 +34,7 @@
 #include <osmo-bts/bts_model.h>
 #include <osmo-bts/handover.h>
 #include <osmo-bts/l1sap.h>
+#include <osmo-bts/nm_common_fsm.h>
 
 #include "virtual_um.h"
 
@@ -143,6 +144,9 @@
 	uint8_t tn;
 
 	switch (mo->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		rc = osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_RADIO_CARRIER:
 		trx = (struct gsm_bts_trx*) obj;
 		/* Mark Dependency TS as Offline (ready to be Opstarted) */
@@ -156,7 +160,6 @@
 		rc = oml_mo_opstart_ack(mo);
 		break;
 	case NM_OC_CHANNEL:
-	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
 	case NM_OC_BTS:
 	case NM_OC_GPRS_NSE:

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Iab2d17c45c9642860cd2d5d523c1baae24502243
Gerrit-Change-Number: 20408
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-CC: fixeria <vyanitskiy at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201020/b1001657/attachment.htm>


More information about the gerrit-log mailing list