Change in osmo-bsc[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/.

pespin gerrit-no-reply at lists.osmocom.org
Fri Oct 2 16:26:38 UTC 2020


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


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

Introduce NM BTS Site Manager FSM

Change-Id: Ic001ce6ebeff6f51470ef58140b0235f4a30265e
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/bts.h
A include/osmocom/bsc/nm_bts_sm_fsm.h
M include/osmocom/bsc/signal.h
M src/ipaccess/Makefile.am
M src/osmo-bsc/Makefile.am
M src/osmo-bsc/abis_nm.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
A src/osmo-bsc/nm_bts_sm_fsm.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/acc/Makefile.am
M tests/acc/acc_test.c
M tests/acc/acc_test.ok
M tests/bsc/Makefile.am
M tests/gsm0408/Makefile.am
M tests/handover/Makefile.am
M tests/nanobts_omlattr/Makefile.am
19 files changed, 465 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/20400/1

diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index 1ee96ed..b25c95a 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -35,6 +35,7 @@
 	misdn.h \
 	neighbor_ident.h \
 	network_listen.h \
+	nm_bts_sm_fsm.h \
 	openbscdefines.h \
 	osmo_bsc.h \
 	osmo_bsc_grace.h \
diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h
index 7f36904..063a531 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -426,6 +426,8 @@
 	struct gsm_bts_trx *c0;
 
 	struct {
+		struct osmo_fsm_inst *fi;
+		bool opstart_sent;
 		struct gsm_abis_mo mo;
 	} site_mgr;
 
diff --git a/include/osmocom/bsc/nm_bts_sm_fsm.h b/include/osmocom/bsc/nm_bts_sm_fsm.h
new file mode 100644
index 0000000..caa46d0
--- /dev/null
+++ b/include/osmocom/bsc/nm_bts_sm_fsm.h
@@ -0,0 +1,43 @@
+/* NM BTS Site Manager 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>
+
+enum nm_bts_sm_op_fsm_states {
+	NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED,
+	NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY,
+	NM_BTS_SM_ST_OP_DISABLED_OFFLINE,
+	NM_BTS_SM_ST_OP_ENABLED,
+};
+
+enum nm_bts_sm_op_fsm_events {
+	NM_BTS_SM_EV_SW_ACT_REP,
+	NM_BTS_SM_EV_STATE_CHG_REP,
+	NM_BTS_SM_EV_OPSTART_ACK,
+	NM_BTS_SM_EV_OPSTART_NACK,
+	NM_BTS_SM_EV_OML_DOWN,
+};
+
+extern struct osmo_fsm nm_bts_sm_fsm;
diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h
index c7d7fe1..abda67e 100644
--- a/include/osmocom/bsc/signal.h
+++ b/include/osmocom/bsc/signal.h
@@ -72,6 +72,7 @@
 	S_NM_STATECHG_ADM,	/* Administrative State changed */
 	S_NM_OM2K_CONF_RES,	/* OM2K Configuration Result */
 	S_NM_OPSTART_ACK,	/* Received OPSTART ACK, arg is struct msgb *oml_msg */
+	S_NM_OPSTART_NACK,	/* Received OPSTART NACK, arg is struct msgb *oml_msg */
 	S_NM_GET_ATTR_REP,	/* Received Get Attributes Response, arg is struct msgb *oml_msg */
 	S_NM_SET_RADIO_ATTR_ACK, /* Received Set Radio Carrier Attributes Ack, arg is struct msgb *oml_msg */
 };
diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am
index 717a6a1..08d6dd1 100644
--- a/src/ipaccess/Makefile.am
+++ b/src/ipaccess/Makefile.am
@@ -54,6 +54,7 @@
 	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(OSMO_LIBS) \
 	$(NULL)
 
@@ -68,5 +69,6 @@
 	$(top_builddir)/src/osmo-bsc/bts.o \
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(OSMO_LIBS) \
 	$(NULL)
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index c19d01b..48e38a0 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -72,6 +72,7 @@
 	neighbor_ident.c \
 	neighbor_ident_vty.c \
 	net_init.c \
+	nm_bts_sm_fsm.c \
 	gsm_08_08.c \
 	osmo_bsc_bssap.c \
 	osmo_bsc_ctrl.c \
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index 7cd50ed..769f73b 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -826,6 +826,14 @@
 	return 0;
 }
 
+static int abis_nm_rx_opstart_nack(struct msgb *mb)
+{
+	struct abis_om_fom_hdr *foh = msgb_l3(mb);
+	DEBUGPFOH(DNM, foh, "Opstart NACK\n");
+	osmo_signal_dispatch(SS_NM, S_NM_OPSTART_NACK, mb);
+	return 0;
+}
+
 static int abis_nm_rx_set_radio_attr_ack(struct msgb *mb)
 {
 	struct abis_om_fom_hdr *foh = msgb_l3(mb);
@@ -947,7 +955,10 @@
 		ret = abis_nm_rx_lmt_event(mb);
 		break;
 	case NM_MT_OPSTART_ACK:
-		abis_nm_rx_opstart_ack(mb);
+		ret = abis_nm_rx_opstart_ack(mb);
+		break;
+	case NM_MT_OPSTART_NACK:
+		ret = abis_nm_rx_opstart_nack(mb);
 		break;
 	case NM_MT_SET_CHAN_ATTR_ACK:
 		DEBUGPFOH(DNM, foh, "Set Channel Attributes ACK\n");
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index ce1b200..16cd51e 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -23,6 +23,7 @@
 #include <osmocom/bsc/gsm_data.h>
 #include <osmocom/bsc/bts.h>
 #include <osmocom/bsc/debug.h>
+#include <osmocom/bsc/nm_bts_sm_fsm.h>
 
 const struct value_string bts_attribute_names[] = {
 	OSMO_VALUE_STRING(BTS_TYPE_VARIANT),
@@ -146,6 +147,15 @@
 	.initial_mcs = 6,
 };
 
+static int gsm_bts_talloc_destructor(struct gsm_bts *bts)
+{
+	if (bts->site_mgr.fi) {
+		osmo_fsm_inst_free(bts->site_mgr.fi);
+		bts->site_mgr.fi = NULL;
+	}
+	return 0;
+}
+
 /* Initialize those parts that don't require osmo-bsc specific dependencies.
  * This part is shared among the thin programs in osmo-bsc/src/utils/.
  * osmo-bsc requires further initialization that pulls in more dependencies (see
@@ -159,6 +169,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);
@@ -168,6 +180,10 @@
 
 	gsm_mo_init(&bts->mo, bts, NM_OC_BTS,
 			bts->nr, 0xff, 0xff);
+
+	bts->site_mgr.fi = osmo_fsm_inst_alloc(&nm_bts_sm_fsm, bts, bts,
+					      LOGL_INFO, NULL);
+	osmo_fsm_inst_update_id_f(bts->site_mgr.fi, "bts_sm%d", bts->nr);
 	gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER,
 			0xff, 0xff, 0xff);
 
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c
index e02eabc..df968ed 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -46,6 +46,7 @@
 #include <osmocom/bsc/paging.h>
 #include <osmocom/bsc/timeslot_fsm.h>
 #include <osmocom/bsc/bts.h>
+#include <osmocom/bsc/nm_bts_sm_fsm.h>
 
 static int bts_model_nanobts_start(struct gsm_network *net);
 static void bts_model_nanobts_e1line_bind_ops(struct e1inp_line *line);
@@ -147,11 +148,7 @@
 	switch (obj_class) {
 	case NM_OC_SITE_MANAGER:
 		bts = container_of(obj, struct gsm_bts, site_mgr);
-		if ((new_state->operational == NM_OPSTATE_ENABLED &&
-		     new_state->availability == NM_AVSTATE_OK) ||
-		    (new_state->operational == NM_OPSTATE_DISABLED &&
-		     new_state->availability == NM_AVSTATE_OFF_LINE))
-			abis_nm_opstart(bts, obj_class, 0xff, 0xff, 0xff);
+		osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_STATE_CHG_REP, nsd);
 		break;
 	case NM_OC_BTS:
 		bts = obj;
@@ -252,16 +249,18 @@
 	struct abis_om_fom_hdr *foh = msgb_l3(mb);
 	struct e1inp_sign_link *sign_link = mb->dst;
 	struct gsm_bts *bts = sign_link->trx->bts;
-	struct gsm_bts_trx *trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr);
+	struct gsm_bts_trx *trx;
 
-	if (!trx)
-		return -EINVAL;
-
-	if (!is_ipaccess_bts(trx->bts))
+	if (!is_ipaccess_bts(bts))
 		return 0;
 
 	switch (foh->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_SW_ACT_REP, NULL);
+		break;
 	case NM_OC_BASEB_TRANSC:
+		if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
+			return -EINVAL;
 		abis_nm_chg_adm_state(trx->bts, foh->obj_class,
 				      trx->bts->bts_nr, trx->nr, 0xff,
 				      NM_STATE_UNLOCKED);
@@ -272,6 +271,8 @@
 					     3003, trx->rsl_tei);
 		break;
 	case NM_OC_RADIO_CARRIER: {
+		if (!(trx = gsm_bts_trx_num(bts, foh->obj_inst.trx_nr)))
+			return -EINVAL;
 		/*
 		 * Locking the radio carrier will make it go
 		 * offline again and we would come here. The
@@ -312,7 +313,12 @@
 static void nm_rx_opstart_ack(struct msgb *oml_msg)
 {
 	struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
+	struct e1inp_sign_link *sign_link = oml_msg->dst;
+	struct gsm_bts *bts = sign_link->trx->bts;
 	switch (foh->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_CHANNEL:
 		nm_rx_opstart_ack_chan(oml_msg);
 		break;
@@ -321,6 +327,20 @@
 	}
 }
 
+static void nm_rx_opstart_nack(struct msgb *oml_msg)
+{
+	struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
+	struct e1inp_sign_link *sign_link = oml_msg->dst;
+	struct gsm_bts *bts = sign_link->trx->bts;
+	switch (foh->obj_class) {
+	case NM_OC_SITE_MANAGER:
+		osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_OPSTART_NACK, NULL);
+		break;
+	default:
+		break;
+	}
+}
+
 static void nm_rx_set_radio_attr_ack(struct msgb *oml_msg)
 {
 	struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
@@ -352,6 +372,9 @@
 	case S_NM_OPSTART_ACK:
 		nm_rx_opstart_ack(signal_data);
 		return 0;
+	case S_NM_OPSTART_NACK:
+		nm_rx_opstart_nack(signal_data);
+		return 0;
 	case S_NM_SET_RADIO_ATTR_ACK:
 		nm_rx_set_radio_attr_ack(signal_data);
 		return 0;
@@ -436,6 +459,7 @@
 	llist_for_each_entry(trx, &bts->trx_list, list)
 		ipaccess_drop_rsl(trx, "OML link drop");
 
+	osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_OML_DOWN, NULL);
 	gsm_bts_all_ts_dispatch(bts, TS_EV_OML_DOWN, NULL);
 
 	bts->ip_access.flags = 0;
diff --git a/src/osmo-bsc/nm_bts_sm_fsm.c b/src/osmo-bsc/nm_bts_sm_fsm.c
new file mode 100644
index 0000000..0f66f38
--- /dev/null
+++ b/src/osmo-bsc/nm_bts_sm_fsm.c
@@ -0,0 +1,286 @@
+/* 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 <osmocom/bsc/bts.h>
+#include <osmocom/bsc/signal.h>
+#include <osmocom/bsc/abis_nm.h>
+#include <osmocom/bsc/nm_bts_sm_fsm.h>
+#include <osmocom/bsc/debug.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 *bts = (struct gsm_bts *)fi->priv;
+
+	bts->site_mgr.opstart_sent = false;
+}
+
+static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+	struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
+	struct nm_statechg_signal_data *nsd;
+	struct gsm_nm_state *new_state;
+
+	switch (event) {
+	case NM_BTS_SM_EV_SW_ACT_REP:
+		break;
+	case NM_BTS_SM_EV_STATE_CHG_REP:
+		nsd = (struct nm_statechg_signal_data *)data;
+		new_state = nsd->new_state;
+		if (new_state->operational == NM_OPSTATE_ENABLED) {
+			/* nanobts always go directly into Reported ENABLED state during
+			   startup, but we still need to OPSTART it, otherwise it won't
+			   connect on RSL later on */
+			if (bts->type == GSM_BTS_TYPE_NANOBTS) {
+				bts->site_mgr.opstart_sent = true;
+				abis_nm_opstart(bts, NM_OC_SITE_MANAGER, 0xff, 0xff, 0xff);
+			} else {
+				LOGPFSML(fi, LOGL_NOTICE, "Received BTS Site Mgr State Report Enabled "
+					 "without Opstart. You are probably using a nanoBTS but don't "
+					 "have your .cfg with 'type nanobts'\n");
+			}
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED);
+			return;
+		}
+		switch (new_state->availability) { /* operational = DISABLED */
+		case NM_AVSTATE_DEPENDENCY:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY);
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_OFFLINE);
+			return;
+		default:
+			return;
+		}
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+	struct nm_statechg_signal_data *nsd;
+	struct gsm_nm_state *new_state;
+
+	switch (event) {
+	case NM_BTS_SM_EV_STATE_CHG_REP:
+		nsd = (struct nm_statechg_signal_data *)data;
+		new_state = nsd->new_state;
+		if (new_state->operational == NM_OPSTATE_ENABLED) {
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED);
+			return;
+		}
+		switch (new_state->availability) { /* operational = DISABLED */
+		case NM_AVSTATE_NOT_INSTALLED:
+		case NM_AVSTATE_POWER_OFF:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED);
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_OFFLINE);
+			return;
+		default:
+			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 *bts = (struct gsm_bts *)fi->priv;
+	if (!bts->site_mgr.opstart_sent) {
+		bts->site_mgr.opstart_sent = true;
+		abis_nm_opstart(bts, NM_OC_SITE_MANAGER, 0xff, 0xff, 0xff);
+	}
+}
+
+static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+	struct nm_statechg_signal_data *nsd;
+	struct gsm_nm_state *new_state;
+
+	switch (event) {
+	case NM_BTS_SM_EV_STATE_CHG_REP:
+		nsd = (struct nm_statechg_signal_data *)data;
+		new_state = nsd->new_state;
+		if (new_state->operational == NM_OPSTATE_ENABLED) {
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED);
+			return;
+		}
+		switch (new_state->availability) { /* operational = DISABLED */
+		case NM_AVSTATE_NOT_INSTALLED:
+		case NM_AVSTATE_POWER_OFF:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED);
+			return;
+		case NM_AVSTATE_DEPENDENCY:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY);
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			return;
+		default:
+			return;
+		}
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+	struct nm_statechg_signal_data *nsd;
+	struct gsm_nm_state *new_state;
+
+	switch (event) {
+	case NM_BTS_SM_EV_STATE_CHG_REP:
+		nsd = (struct nm_statechg_signal_data *)data;
+		new_state = nsd->new_state;
+		if (new_state->operational == NM_OPSTATE_ENABLED)
+			return;
+		switch (new_state->availability) { /* operational = DISABLED */
+		case NM_AVSTATE_NOT_INSTALLED:
+		case NM_AVSTATE_POWER_OFF:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED);
+			return;
+		case NM_AVSTATE_DEPENDENCY:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY);
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_OFFLINE);
+			return;
+		default:
+			return;
+		}
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static void st_op_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+	struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
+
+	switch (event) {
+	case NM_BTS_SM_EV_OPSTART_ACK:
+	case NM_BTS_SM_EV_OPSTART_NACK:
+		/* TODO: if on state OFFLINE and rx NACK, try again? */
+		bts->site_mgr.opstart_sent = false;
+		break;
+	case NM_BTS_SM_EV_OML_DOWN:
+		nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED);
+		break;
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static struct osmo_fsm_state nm_bts_sm_fsm_states[] = {
+	[NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED] = {
+		.in_event_mask =
+			X(NM_BTS_SM_EV_SW_ACT_REP) |
+			X(NM_BTS_SM_EV_STATE_CHG_REP),
+		.out_state_mask =
+			X(NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY) |
+			X(NM_BTS_SM_ST_OP_DISABLED_OFFLINE) |
+			X(NM_BTS_SM_ST_OP_ENABLED),
+		.name = "DISABLED_NOTINSTALLED",
+		.onenter = st_op_disabled_notinstalled_on_enter,
+		.action = st_op_disabled_notinstalled,
+	},
+	[NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY] = {
+		.in_event_mask =
+			X(NM_BTS_SM_EV_STATE_CHG_REP),
+		.out_state_mask =
+			X(NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED) |
+			X(NM_BTS_SM_ST_OP_DISABLED_OFFLINE) |
+			X(NM_BTS_SM_ST_OP_ENABLED),
+		.name = "DISABLED_DEPENDENCY",
+		.action = st_op_disabled_dependency,
+	},
+	[NM_BTS_SM_ST_OP_DISABLED_OFFLINE] = {
+		.in_event_mask =
+			X(NM_BTS_SM_EV_STATE_CHG_REP),
+		.out_state_mask =
+			X(NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED) |
+			X(NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY) |
+			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 =
+			X(NM_BTS_SM_EV_STATE_CHG_REP),
+		.out_state_mask =
+			X(NM_BTS_SM_ST_OP_DISABLED_NOTINSTALLED) |
+			X(NM_BTS_SM_ST_OP_DISABLED_DEPENDENCY) |
+			X(NM_BTS_SM_ST_OP_DISABLED_OFFLINE),
+		.name = "ENABLED",
+		.action = st_op_enabled,
+	},
+};
+
+const struct value_string nm_bts_sm_fsm_event_names[] = {
+	{ NM_BTS_SM_EV_SW_ACT_REP, "SW_ACT_REP" },
+	{ NM_BTS_SM_EV_STATE_CHG_REP, "STATE_CHG_REP" },
+	{ NM_BTS_SM_EV_OPSTART_ACK, "OPSTART_ACK" },
+	{ NM_BTS_SM_EV_OPSTART_NACK, "OPSTART_NACK" },
+	{ NM_BTS_SM_EV_OML_DOWN, "OML_DOWN" },
+	{ 0, NULL }
+};
+
+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),
+	.allstate_event_mask =
+		X(NM_BTS_SM_EV_OPSTART_ACK) |
+		X(NM_BTS_SM_EV_OPSTART_NACK) |
+		X(NM_BTS_SM_EV_OML_DOWN),
+	.allstate_action = st_op_allstate,
+	.event_names = nm_bts_sm_fsm_event_names,
+	.log_subsys = DNM,
+};
+
+static __attribute__((constructor)) void nm_bts_sm_fsm_init(void)
+{
+	OSMO_ASSERT(osmo_fsm_register(&nm_bts_sm_fsm) == 0);
+}
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index fd03cb3..151437e 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -55,6 +55,7 @@
 	$(top_builddir)/src/osmo-bsc/e1_config.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
@@ -125,6 +126,7 @@
 	$(top_builddir)/src/osmo-bsc/bts.o \
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am
index a245b51..28c284f 100644
--- a/tests/abis/Makefile.am
+++ b/tests/abis/Makefile.am
@@ -31,6 +31,7 @@
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/acc/Makefile.am b/tests/acc/Makefile.am
index 4726ddc..98362a9 100644
--- a/tests/acc/Makefile.am
+++ b/tests/acc/Makefile.am
@@ -31,6 +31,7 @@
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/acc/acc_test.c b/tests/acc/acc_test.c
index f463a2e..81b9e8d 100644
--- a/tests/acc/acc_test.c
+++ b/tests/acc/acc_test.c
@@ -497,6 +497,7 @@
 	log_set_print_category_hex(osmo_stderr_target, false);
 	log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_NONE);
 	log_set_use_color(osmo_stderr_target, 0);
+	osmo_fsm_log_addr(false);
 
 	net = gsm_network_init(tall_bsc_ctx);
 	if (!net) {
diff --git a/tests/acc/acc_test.ok b/tests/acc/acc_test.ok
index 866502e..6315a92 100644
--- a/tests/acc/acc_test.ok
+++ b/tests/acc/acc_test.ok
@@ -1,4 +1,5 @@
 ===test_acc_mgr_no_ramp===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_no_ramp()
 do_allowed_len_adm_loop(1)
@@ -105,8 +106,10 @@
 *** Barring zero ACCs ***
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 pcu_info_update(): t2=0x00 t3=0x00, allowed: 0 1 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_no_ramp()
 ===test_acc_mgr_manual_ramp===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_manual_ramp()
 do_allowed_len_ramp_loop(1)
@@ -343,8 +346,10 @@
 pcu_info_update(): t2=0x03 t3=0xff, allowed:
 (bts=0) ACC: New ACC allowed subset 0x24c (active_len=4, ramp_len=4, adm_len=4, perm_len=4, rotation=off)
 pcu_info_update(): t2=0x01 t3=0xb3, allowed: 2 3 6 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_manual_ramp()
 ===test_acc_mgr_rotate(true, 1)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -412,8 +417,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x001 -> 0x002 (active_len=1, ramp_len=10, adm_len=1, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xfd, allowed: 1
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 1)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x200 (active_len=1, ramp_len=10, adm_len=1, perm_len=10, rotation=on)
@@ -478,8 +485,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x100 -> 0x200 (active_len=1, ramp_len=10, adm_len=1, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x01 t3=0xff, allowed: 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 2)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -547,8 +556,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x101 -> 0x003 (active_len=2, ramp_len=10, adm_len=2, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xfc, allowed: 0 1
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 2)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x300 (active_len=2, ramp_len=10, adm_len=2, perm_len=10, rotation=on)
@@ -613,8 +624,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x180 -> 0x300 (active_len=2, ramp_len=10, adm_len=2, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0xff, allowed: 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 3)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -682,8 +695,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x181 -> 0x103 (active_len=3, ramp_len=10, adm_len=3, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0xfc, allowed: 0 1 8
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 3)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x380 (active_len=3, ramp_len=10, adm_len=3, perm_len=10, rotation=on)
@@ -748,8 +763,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1c0 -> 0x380 (active_len=3, ramp_len=10, adm_len=3, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x7f, allowed: 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 4)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -817,8 +834,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1c1 -> 0x183 (active_len=4, ramp_len=10, adm_len=4, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x7c, allowed: 0 1 7 8
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 4)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3c0 (active_len=4, ramp_len=10, adm_len=4, perm_len=10, rotation=on)
@@ -883,8 +902,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1e0 -> 0x3c0 (active_len=4, ramp_len=10, adm_len=4, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x3f, allowed: 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 5)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -952,8 +973,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1e1 -> 0x1c3 (active_len=5, ramp_len=10, adm_len=5, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x3c, allowed: 0 1 6 7 8
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 5)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3e0 (active_len=5, ramp_len=10, adm_len=5, perm_len=10, rotation=on)
@@ -1018,8 +1041,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f0 -> 0x3e0 (active_len=5, ramp_len=10, adm_len=5, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x1f, allowed: 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 6)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -1087,8 +1112,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f1 -> 0x1e3 (active_len=6, ramp_len=10, adm_len=6, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x1c, allowed: 0 1 5 6 7 8
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 6)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3f0 (active_len=6, ramp_len=10, adm_len=6, perm_len=10, rotation=on)
@@ -1153,8 +1180,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f8 -> 0x3f0 (active_len=6, ramp_len=10, adm_len=6, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x0f, allowed: 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 7)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -1222,8 +1251,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1f9 -> 0x1f3 (active_len=7, ramp_len=10, adm_len=7, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x0c, allowed: 0 1 4 5 6 7 8
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 7)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3f8 (active_len=7, ramp_len=10, adm_len=7, perm_len=10, rotation=on)
@@ -1288,8 +1319,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1fc -> 0x3f8 (active_len=7, ramp_len=10, adm_len=7, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x07, allowed: 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 8)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 *** Barring one ACC ***
@@ -1357,8 +1390,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1fd -> 0x1fb (active_len=8, ramp_len=10, adm_len=8, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x02 t3=0x04, allowed: 0 1 3 4 5 6 7 8
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 8)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3fc (active_len=8, ramp_len=10, adm_len=8, perm_len=10, rotation=on)
@@ -1423,8 +1458,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1fe -> 0x3fc (active_len=8, ramp_len=10, adm_len=8, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x03, allowed: 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 9)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_mgr_rotate()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3fe (active_len=9, ramp_len=10, adm_len=9, perm_len=10, rotation=on)
@@ -1489,8 +1526,10 @@
 sys={40.000000}: select()
 (bts=0) ACC: rotate ACC allowed active subset 0x1ff -> 0x3fe (active_len=9, ramp_len=10, adm_len=9, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x00 t3=0x01, allowed: 1 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_ramp===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x000 (active_len=0, ramp_len=0, adm_len=10, perm_len=10, rotation=off)
@@ -1524,8 +1563,10 @@
 sys={450.000000}: select()
 (bts=0) ACC: update ACC allowed active subset 0x1ff -> 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 pcu_info_update(): t2=0x00 t3=0x00, allowed: 0 1 2 3 4 5 6 7 8 9
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp()
 ===test_acc_ramp2===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp2()
 (bts=0) ACC: update ACC allowed active subset 0x3ff -> 0x3f8 (active_len=7, ramp_len=10, adm_len=7, perm_len=10, rotation=on)
@@ -1541,8 +1582,10 @@
 (bts=0) ACC: update ACC allowed active subset 0x03f -> 0x07f (active_len=7, ramp_len=7, adm_len=7, perm_len=10, rotation=on)
 pcu_info_update(): t2=0x03 t3=0x80, allowed: 0 1 2 3 4 5 6
 sys={15.000000}: select()
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp2()
 ===test_acc_ramp3===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp3()
 *** Barring some ACCs ***
@@ -1574,8 +1617,10 @@
 (bts=0) ACC: update ACC allowed active subset 0x15a -> 0x15a (active_len=5, ramp_len=9, adm_len=10, perm_len=5, rotation=off)
 sys={45.000000}: select()
 (bts=0) ACC: update ACC allowed active subset 0x15a -> 0x15a (active_len=5, ramp_len=10, adm_len=10, perm_len=5, rotation=off)
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp3()
 ===test_acc_ramp_up_rotate(0, 100, 100)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_up_rotate()
 *** Barring one ACC ***
@@ -1663,8 +1708,10 @@
 sys={2750.000000}: select()
 sys={3000.000000}: select()
 sys={3250.000000}: select()
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_up_rotate(0, 20, 50)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_up_rotate()
 *** Barring one ACC ***
@@ -1752,8 +1799,10 @@
 sys={2750.000000}: select()
 sys={3000.000000}: select()
 sys={3250.000000}: select()
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_up_rotate(70, 80, 90)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_up_rotate()
 *** Barring one ACC ***
@@ -1841,8 +1890,10 @@
 sys={2750.000000}: select()
 sys={3000.000000}: select()
 sys={3250.000000}: select()
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_updown_rotate(80, 90, 0, 100, 15)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -1960,8 +2011,10 @@
 sys={7000.000000}: select(47): chan_load_avg=75
 sys={7250.000000}: select(48): chan_load_avg=90
 sys={7500.000000}: select(49): chan_load_avg=100
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(30, 50, 10, 100, 15)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -2103,8 +2156,10 @@
 sys={4200.000000}: select(49): chan_load_avg=25
 (bts=0) ACC: rotate ACC allowed active subset 0x003 -> 0x006 (active_len=2, ramp_len=2, adm_len=10, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xf9, allowed: 1 2
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(50, 49, 0, 100, 10)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -2256,8 +2311,10 @@
 sys={4200.000000}: select(49): chan_load_avg=90
 (bts=0) ACC: rotate ACC allowed active subset 0x01c -> 0x038 (active_len=3, ramp_len=3, adm_len=10, perm_len=9, rotation=on)
 pcu_info_update(): t2=0x03 t3=0xc7, allowed: 3 4 5
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(30, 80, 30, 80, 5)===
+NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated
 (bts=0) ACC: New ACC allowed subset 0x3ff (active_len=10, ramp_len=10, adm_len=10, perm_len=10, rotation=off)
 BTS allocation OK in test_acc_ramp_updown_rotate()
 *** Barring one ACC ***
@@ -2315,4 +2372,5 @@
 sys={12000.000000}: select(47): chan_load_avg=65
 sys={12250.000000}: select(48): chan_load_avg=70
 sys={12500.000000}: select(49): chan_load_avg=75
+NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am
index 468c032..0c5f47f 100644
--- a/tests/bsc/Makefile.am
+++ b/tests/bsc/Makefile.am
@@ -45,6 +45,7 @@
 	$(top_builddir)/src/osmo-bsc/handover_logic.o \
 	$(top_builddir)/src/osmo-bsc/neighbor_ident.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOVTY_LIBS) \
diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am
index 66e4072..5525670 100644
--- a/tests/gsm0408/Makefile.am
+++ b/tests/gsm0408/Makefile.am
@@ -34,6 +34,7 @@
 	$(top_builddir)/src/osmo-bsc/rest_octets.o \
 	$(top_builddir)/src/osmo-bsc/system_information.o \
 	$(top_builddir)/src/osmo-bsc/neighbor_ident.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am
index 87981d9..c4b6932 100644
--- a/tests/handover/Makefile.am
+++ b/tests/handover/Makefile.am
@@ -80,6 +80,7 @@
 	$(top_builddir)/src/osmo-bsc/neighbor_ident.o \
 	$(top_builddir)/src/osmo-bsc/neighbor_ident_vty.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(top_builddir)/src/osmo-bsc/osmo_bsc_ctrl.o \
 	$(top_builddir)/src/osmo-bsc/osmo_bsc_lcls.o \
 	$(top_builddir)/src/osmo-bsc/osmo_bsc_mgcp.o \
diff --git a/tests/nanobts_omlattr/Makefile.am b/tests/nanobts_omlattr/Makefile.am
index 1cdcc50..e4c9581 100644
--- a/tests/nanobts_omlattr/Makefile.am
+++ b/tests/nanobts_omlattr/Makefile.am
@@ -29,6 +29,7 @@
 	$(top_builddir)/src/osmo-bsc/bts.o \
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
+	$(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic001ce6ebeff6f51470ef58140b0235f4a30265e
Gerrit-Change-Number: 20400
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/20201002/577245d7/attachment.htm>


More information about the gerrit-log mailing list