Change in osmo-bsc[master]: Introduce NM BTS 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:39 UTC 2020


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


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

Introduce NM BTS FSM

Change-Id: I7756a8ce90b6cc8a502b5665889a7987d7f749cb
---
M include/osmocom/bsc/Makefile.am
M include/osmocom/bsc/bts.h
A include/osmocom/bsc/nm_bts_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/abis_om2000.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_ipaccess_nanobts.c
M src/osmo-bsc/bts_nokia_site.c
M src/osmo-bsc/gsm_data.c
A src/osmo-bsc/nm_bts_fsm.c
M src/utils/Makefile.am
M tests/abis/Makefile.am
M tests/acc/Makefile.am
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
22 files changed, 548 insertions(+), 21 deletions(-)



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

diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am
index b25c95a..59ac91a 100644
--- a/include/osmocom/bsc/Makefile.am
+++ b/include/osmocom/bsc/Makefile.am
@@ -36,6 +36,7 @@
 	neighbor_ident.h \
 	network_listen.h \
 	nm_bts_sm_fsm.h \
+	nm_bts_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 063a531..564e2b8 100644
--- a/include/osmocom/bsc/bts.h
+++ b/include/osmocom/bsc/bts.h
@@ -410,7 +410,14 @@
 	/* Abis network management O&M handle */
 	struct abis_nm_h *nmh;
 
-	struct gsm_abis_mo mo;
+	struct {
+		struct osmo_fsm_inst *fi;
+		bool opstart_sent;
+		bool adm_unlock_sent;
+		bool set_bts_attr_sent;
+		bool set_bts_attr_ack_received;
+		struct gsm_abis_mo mo;
+	} nm;
 
 	/* number of this BTS on given E1 link */
 	uint8_t bts_nr;
diff --git a/include/osmocom/bsc/nm_bts_fsm.h b/include/osmocom/bsc/nm_bts_fsm.h
new file mode 100644
index 0000000..3b99762
--- /dev/null
+++ b/include/osmocom/bsc/nm_bts_fsm.h
@@ -0,0 +1,44 @@
+/* NM BTS 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_op_fsm_states {
+	NM_BTS_ST_OP_DISABLED_NOTINSTALLED,
+	NM_BTS_ST_OP_DISABLED_DEPENDENCY,
+	NM_BTS_ST_OP_DISABLED_OFFLINE,
+	NM_BTS_ST_OP_ENABLED,
+};
+
+enum nm_bts_op_fsm_events {
+	NM_BTS_EV_SW_ACT_REP,
+	NM_BTS_EV_STATE_CHG_REP,
+	NM_BTS_EV_SET_ATTR_ACK,
+	NM_BTS_EV_OPSTART_ACK,
+	NM_BTS_EV_OPSTART_NACK,
+	NM_BTS_EV_OML_DOWN,
+};
+
+extern struct osmo_fsm nm_bts_fsm;
diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h
index abda67e..4922ac8 100644
--- a/include/osmocom/bsc/signal.h
+++ b/include/osmocom/bsc/signal.h
@@ -75,6 +75,7 @@
 	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 */
+	S_NM_SET_BTS_ATTR_ACK,  /* Received Set BTS Attributes Ack, arg is struct msgb *oml_msg */
 };
 
 /* SS_LCHAN signals */
diff --git a/src/ipaccess/Makefile.am b/src/ipaccess/Makefile.am
index 08d6dd1..55d7408 100644
--- a/src/ipaccess/Makefile.am
+++ b/src/ipaccess/Makefile.am
@@ -55,6 +55,7 @@
 	$(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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(OSMO_LIBS) \
 	$(NULL)
 
@@ -67,8 +68,10 @@
 	$(top_builddir)/src/osmo-bsc/abis_nm.o \
 	$(top_builddir)/src/osmo-bsc/acc.o \
 	$(top_builddir)/src/osmo-bsc/bts.o \
+	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(OSMO_LIBS) \
 	$(NULL)
diff --git a/src/osmo-bsc/Makefile.am b/src/osmo-bsc/Makefile.am
index 48e38a0..e6fe3f9 100644
--- a/src/osmo-bsc/Makefile.am
+++ b/src/osmo-bsc/Makefile.am
@@ -73,6 +73,7 @@
 	neighbor_ident_vty.c \
 	net_init.c \
 	nm_bts_sm_fsm.c \
+	nm_bts_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 769f73b..0ff1a88 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -842,11 +842,19 @@
 	return 0;
 }
 
+static int abis_nm_rx_set_bts_attr_ack(struct msgb *mb)
+{
+	struct abis_om_fom_hdr *foh = msgb_l3(mb);
+	DEBUGPFOH(DNM, foh, "Set BTS Attributes ACK\n");
+	osmo_signal_dispatch(SS_NM, S_NM_SET_BTS_ATTR_ACK, mb);
+	return 0;
+}
+
 bool all_trx_rsl_connected_unlocked(const struct gsm_bts *bts)
 {
 	const struct gsm_bts_trx *trx;
 
-	if (bts->mo.nm_state.administrative == NM_STATE_LOCKED)
+	if (bts->nm.mo.nm_state.administrative == NM_STATE_LOCKED)
 		return false;
 
 	if (bts->gprs.mode != BTS_GPRS_NONE) {
@@ -978,7 +986,7 @@
 		osmo_signal_dispatch(SS_NM, S_NM_IPACC_RESTART_NACK, NULL);
 		break;
 	case NM_MT_SET_BTS_ATTR_ACK:
-		DEBUGPFOH(DNM, foh, "Set BTS Attribute ACK\n");
+		abis_nm_rx_set_bts_attr_ack(mb);
 		break;
 	case NM_MT_GET_ATTR_RESP:
 		ret = abis_nm_rx_get_attr_resp(mb, gsm_bts_trx_num(bts, (foh)->obj_inst.trx_nr));
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c
index a3f689a..b8c71e8 100644
--- a/src/osmo-bsc/abis_om2000.c
+++ b/src/osmo-bsc/abis_om2000.c
@@ -898,7 +898,7 @@
 		nm_state = &bts->rbs2000.con.mo.nm_state;
 		break;
 	case OM2K_MO_CLS_CF:
-		nm_state = &bts->mo.nm_state;
+		nm_state = &bts->nm.mo.nm_state;
 		break;
 	case OM2K_MO_CLS_TX:
 		trx = gsm_bts_trx_num(bts, mo->inst);
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c
index 8808c20..1d35dc2 100644
--- a/src/osmo-bsc/bsc_vty.c
+++ b/src/osmo-bsc/bsc_vty.c
@@ -457,7 +457,7 @@
 		vty_out(vty, "  Skip Reset: %d%s",
 			bts->nokia.skip_reset, VTY_NEWLINE);
 	vty_out(vty, "  NM State: ");
-	net_dump_nmstate(vty, &bts->mo.nm_state);
+	net_dump_nmstate(vty, &bts->nm.mo.nm_state);
 	vty_out(vty, "  Site Mgr NM State: ");
 	net_dump_nmstate(vty, &bts->site_mgr.mo.nm_state);
 
diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c
index 16cd51e..7396117 100644
--- a/src/osmo-bsc/bts.c
+++ b/src/osmo-bsc/bts.c
@@ -24,6 +24,7 @@
 #include <osmocom/bsc/bts.h>
 #include <osmocom/bsc/debug.h>
 #include <osmocom/bsc/nm_bts_sm_fsm.h>
+#include <osmocom/bsc/nm_bts_fsm.h>
 
 const struct value_string bts_attribute_names[] = {
 	OSMO_VALUE_STRING(BTS_TYPE_VARIANT),
@@ -153,6 +154,10 @@
 		osmo_fsm_inst_free(bts->site_mgr.fi);
 		bts->site_mgr.fi = NULL;
 	}
+	if (bts->nm.fi) {
+		osmo_fsm_inst_free(bts->nm.fi);
+		bts->nm.fi = NULL;
+	}
 	return 0;
 }
 
@@ -178,7 +183,10 @@
 
 	bts->ms_max_power = 15;	/* dBm */
 
-	gsm_mo_init(&bts->mo, bts, NM_OC_BTS,
+	bts->nm.fi = osmo_fsm_inst_alloc(&nm_bts_fsm, bts, bts,
+					      LOGL_INFO, NULL);
+	osmo_fsm_inst_update_id_f(bts->nm.fi, "bts%d", bts->nr);
+	gsm_mo_init(&bts->nm.mo, bts, NM_OC_BTS,
 			bts->nr, 0xff, 0xff);
 
 	bts->site_mgr.fi = osmo_fsm_inst_alloc(&nm_bts_sm_fsm, bts, bts,
@@ -581,7 +589,7 @@
 	struct gsm_bts_trx *trx;
 	unsigned int i;
 
-	gsm_abis_mo_reset(&bts->mo);
+	gsm_abis_mo_reset(&bts->nm.mo);
 	gsm_abis_mo_reset(&bts->site_mgr.mo);
 	for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++)
 		gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo);
@@ -641,7 +649,7 @@
 	if (!bts->oml_link)
 		return 0;
 
-	return bts->mo.nm_state.operational == NM_OPSTATE_ENABLED;
+	return bts->nm.mo.nm_state.operational == NM_OPSTATE_ENABLED;
 }
 
 int bts_depend_check(struct gsm_bts *bts)
diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c
index df968ed..f450a16 100644
--- a/src/osmo-bsc/bts_ipaccess_nanobts.c
+++ b/src/osmo-bsc/bts_ipaccess_nanobts.c
@@ -47,6 +47,7 @@
 #include <osmocom/bsc/timeslot_fsm.h>
 #include <osmocom/bsc/bts.h>
 #include <osmocom/bsc/nm_bts_sm_fsm.h>
+#include <osmocom/bsc/nm_bts_fsm.h>
 
 static int bts_model_nanobts_start(struct gsm_network *net);
 static void bts_model_nanobts_e1line_bind_ops(struct e1inp_line *line);
@@ -142,7 +143,7 @@
 
 	/* S_NM_STATECHG_ADM is called after we call chg_adm_state() and would create
 	 * endless loop */
-	if (evt != S_NM_STATECHG_OPER)
+	if (obj_class != NM_OC_BTS && evt != S_NM_STATECHG_OPER)
 		return 0;
 
 	switch (obj_class) {
@@ -152,16 +153,7 @@
 		break;
 	case NM_OC_BTS:
 		bts = obj;
-		if (new_state->availability == NM_AVSTATE_DEPENDENCY) {
-			msgb = nanobts_attr_bts_get(bts);
-			abis_nm_set_bts_attr(bts, msgb->data, msgb->len);
-			msgb_free(msgb);
-			abis_nm_chg_adm_state(bts, obj_class,
-					      bts->bts_nr, 0xff, 0xff,
-					      NM_STATE_UNLOCKED);
-			abis_nm_opstart(bts, obj_class,
-					bts->bts_nr, 0xff, 0xff);
-		}
+		osmo_fsm_inst_dispatch(bts->nm.fi, NM_BTS_EV_STATE_CHG_REP, nsd);
 		break;
 	case NM_OC_CHANNEL:
 		ts = obj;
@@ -258,6 +250,9 @@
 	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_BTS:
+		osmo_fsm_inst_dispatch(bts->nm.fi, NM_BTS_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;
@@ -319,6 +314,9 @@
 	case NM_OC_SITE_MANAGER:
 		osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_OPSTART_ACK, NULL);
 		break;
+	case NM_OC_BTS:
+		osmo_fsm_inst_dispatch(bts->nm.fi, NM_BTS_EV_OPSTART_ACK, NULL);
+		break;
 	case NM_OC_CHANNEL:
 		nm_rx_opstart_ack_chan(oml_msg);
 		break;
@@ -336,11 +334,28 @@
 	case NM_OC_SITE_MANAGER:
 		osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_OPSTART_NACK, NULL);
 		break;
+	case NM_OC_BTS:
+		osmo_fsm_inst_dispatch(bts->nm.fi, NM_BTS_EV_OPSTART_ACK, NULL);
+		break;
 	default:
 		break;
 	}
 }
 
+static void nm_rx_set_bts_attr_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;
+
+	if (foh->obj_class != NM_OC_BTS) {
+		LOG_BTS(bts, DNM, LOGL_ERROR, "Set BTS Attr Ack received on non BTS object!\n");
+		return;
+	}
+	osmo_fsm_inst_dispatch(bts->nm.fi, NM_BTS_EV_SET_ATTR_ACK, NULL);
+}
+
+
 static void nm_rx_set_radio_attr_ack(struct msgb *oml_msg)
 {
 	struct abis_om_fom_hdr *foh = msgb_l3(oml_msg);
@@ -375,6 +390,9 @@
 	case S_NM_OPSTART_NACK:
 		nm_rx_opstart_nack(signal_data);
 		return 0;
+	case S_NM_SET_BTS_ATTR_ACK:
+		nm_rx_set_bts_attr_ack(signal_data);
+		return 0;
 	case S_NM_SET_RADIO_ATTR_ACK:
 		nm_rx_set_radio_attr_ack(signal_data);
 		return 0;
@@ -460,6 +478,7 @@
 		ipaccess_drop_rsl(trx, "OML link drop");
 
 	osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_OML_DOWN, NULL);
+	osmo_fsm_inst_dispatch(bts->nm.fi, NM_BTS_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/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c
index 2b6f918..35a252b 100644
--- a/src/osmo-bsc/bts_nokia_site.c
+++ b/src/osmo-bsc/bts_nokia_site.c
@@ -1451,7 +1451,7 @@
 	 */
 	struct gsm_bts_trx *trx;
 
-	mo_ok(&bts->mo);
+	mo_ok(&bts->nm.mo);
 	mo_ok(&bts->site_mgr.mo);
 
 	llist_for_each_entry(trx, &bts->trx_list, list) {
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 18fd5cf..1909d50 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -351,7 +351,7 @@
 
 	switch (obj_class) {
 	case NM_OC_BTS:
-		mo = &bts->mo;
+		mo = &bts->nm.mo;
 		break;
 	case NM_OC_RADIO_CARRIER:
 		if (obj_inst->trx_nr >= bts->num_trx) {
diff --git a/src/osmo-bsc/nm_bts_fsm.c b/src/osmo-bsc/nm_bts_fsm.c
new file mode 100644
index 0000000..0a580ad
--- /dev/null
+++ b/src/osmo-bsc/nm_bts_fsm.c
@@ -0,0 +1,363 @@
+/* NM BTS 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/bts_ipaccess_nanobts_omlattr.h>
+#include <osmocom/bsc/nm_bts_fsm.h>
+#include <osmocom/bsc/debug.h>
+
+#define X(s) (1 << (s))
+
+#define nm_bts_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->nm.set_bts_attr_sent = false;
+	bts->nm.set_bts_attr_ack_received = false;
+	bts->nm.adm_unlock_sent = false;
+	bts->nm.opstart_sent = false;
+}
+
+static void st_op_disabled_notinstalled(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_EV_SW_ACT_REP:
+		break;
+	case NM_BTS_EV_STATE_CHG_REP:
+		nsd = (struct nm_statechg_signal_data *)data;
+		new_state = nsd->new_state;
+		if (new_state->operational == NM_OPSTATE_ENABLED) {
+			/*should not happen... */
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
+			return;
+		}
+		switch (new_state->availability) { /* operational = DISABLED */
+		case NM_AVSTATE_DEPENDENCY:
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_DEPENDENCY);
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_OFFLINE);
+			return;
+		default:
+			return;
+		}
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static void configure_loop(struct gsm_bts *bts, struct gsm_nm_state *state, bool allow_opstart) {
+	struct msgb *msgb;
+
+	if (!bts->nm.set_bts_attr_sent && !bts->nm.set_bts_attr_ack_received) {
+		bts->nm.set_bts_attr_sent = true;
+		msgb = nanobts_attr_bts_get(bts);
+		abis_nm_set_bts_attr(bts, msgb->data, msgb->len);
+		msgb_free(msgb);
+	}
+
+	if (state->administrative != NM_STATE_UNLOCKED && !bts->nm.adm_unlock_sent) {
+		bts->nm.adm_unlock_sent = true;
+		abis_nm_chg_adm_state(bts, NM_OC_BTS,
+				      bts->bts_nr, 0xff, 0xff,
+				      NM_STATE_UNLOCKED);
+	}
+
+	if (allow_opstart && state->administrative == NM_STATE_UNLOCKED &&
+	    bts->nm.set_bts_attr_ack_received) {
+		    if (!bts->nm.opstart_sent) {
+			    bts->nm.opstart_sent = true;
+			    abis_nm_opstart(bts, NM_OC_BTS, bts->bts_nr, 0xff, 0xff);
+		    }
+	    }
+}
+
+static void st_op_disabled_dependency_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+	struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
+
+	/* nanoBTS is broken, doesn't follow TS 12.21. Opstart MUST be sent
+	   during Dependency, so we simply move to OFFLINE state here to avoid
+	   duplicating code */
+	if (bts->type == GSM_BTS_TYPE_NANOBTS) {
+		nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_OFFLINE);
+		return;
+	}
+	configure_loop(bts, &bts->nm.mo.nm_state, false);
+}
+
+static void st_op_disabled_dependency(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_EV_SET_ATTR_ACK:
+		bts->nm.set_bts_attr_ack_received = true;
+		bts->nm.set_bts_attr_sent = false;
+		configure_loop(bts, &bts->nm.mo.nm_state, false);
+		return;
+	case NM_BTS_EV_STATE_CHG_REP:
+		nsd = (struct nm_statechg_signal_data *)data;
+		new_state = nsd->new_state;
+		if (new_state->operational == NM_OPSTATE_ENABLED) {
+			/* should not happen... */
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
+			return;
+		}
+		switch (new_state->availability) { /* operational = DISABLED */
+		case NM_AVSTATE_NOT_INSTALLED:
+		case NM_AVSTATE_POWER_OFF:
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_NOTINSTALLED);
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_OFFLINE);
+			return;
+		case NM_AVSTATE_DEPENDENCY:
+			configure_loop(bts, new_state, false);
+			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;
+
+	/* Warning: In here we may be acessing an state older than new_state
+	   from prev (syncrhonous) FSM state */
+	configure_loop(bts, &bts->nm.mo.nm_state, true);
+}
+
+static void st_op_disabled_offline(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_EV_SET_ATTR_ACK:
+		bts->nm.set_bts_attr_ack_received = true;
+		bts->nm.set_bts_attr_sent = false;
+		configure_loop(bts, &bts->nm.mo.nm_state, true);
+		return;
+	case NM_BTS_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_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
+			return;
+		}
+		switch (new_state->availability) { /* operational = DISABLED */
+		case NM_AVSTATE_NOT_INSTALLED:
+		case NM_AVSTATE_POWER_OFF:
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_NOTINSTALLED);
+			return;
+		case NM_AVSTATE_DEPENDENCY:
+			/* There's no point in moving back to Dependency in nanoBTS, since it's broken
+			   and it acts actually as if it was in Offline state */
+			if (bts->type != GSM_BTS_TYPE_NANOBTS) {
+				nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_DEPENDENCY);
+			} else {
+				/* Moreover, in nanoBTS we need to check here for tx
+				   Opstart since we may have gone Unlocked state
+				   in this event, which means Opstart may be txed here. */
+				configure_loop(bts, new_state, true);
+			}
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			configure_loop(bts, new_state, true);
+			return;
+		default:
+			return;
+		}
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+	struct gsm_bts *bts = (struct gsm_bts *)fi->priv;
+
+	/* Reset state, we don't need it in this state and it will need to be
+	  reused as soon as we move back to Disabled */
+	bts->nm.opstart_sent = false;
+	bts->nm.adm_unlock_sent = false;
+	bts->nm.set_bts_attr_sent = false;
+	bts->nm.set_bts_attr_ack_received = false;
+}
+
+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_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_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_NOTINSTALLED);
+			return;
+		case NM_AVSTATE_DEPENDENCY:
+			nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_DEPENDENCY);
+			return;
+		case NM_AVSTATE_OFF_LINE:
+		case NM_AVSTATE_OK:
+			nm_bts_fsm_state_chg(fi, NM_BTS_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_EV_OPSTART_ACK:
+	case NM_BTS_EV_OPSTART_NACK:
+		/* TODO: if on state OFFLINE and rx NACK, try again? */
+		bts->nm.opstart_sent = false;
+		break;
+	case NM_BTS_EV_OML_DOWN:
+		nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_DISABLED_NOTINSTALLED);
+		break;
+	default:
+		OSMO_ASSERT(0);
+	}
+}
+
+static struct osmo_fsm_state nm_bts_fsm_states[] = {
+	[NM_BTS_ST_OP_DISABLED_NOTINSTALLED] = {
+		.in_event_mask =
+			X(NM_BTS_EV_SW_ACT_REP) |
+			X(NM_BTS_EV_STATE_CHG_REP),
+		.out_state_mask =
+			X(NM_BTS_ST_OP_DISABLED_DEPENDENCY) |
+			X(NM_BTS_ST_OP_DISABLED_OFFLINE) |
+			X(NM_BTS_ST_OP_ENABLED),
+		.name = "DISABLED_NOTINSTALLED",
+		.onenter = st_op_disabled_notinstalled_on_enter,
+		.action = st_op_disabled_notinstalled,
+	},
+	[NM_BTS_ST_OP_DISABLED_DEPENDENCY] = {
+		.in_event_mask =
+			X(NM_BTS_EV_STATE_CHG_REP) |
+			X(NM_BTS_EV_SET_ATTR_ACK),
+		.out_state_mask =
+			X(NM_BTS_ST_OP_DISABLED_NOTINSTALLED) |
+			X(NM_BTS_ST_OP_DISABLED_OFFLINE) |
+			X(NM_BTS_ST_OP_ENABLED),
+		.name = "DISABLED_DEPENDENCY",
+		.onenter = st_op_disabled_dependency_on_enter,
+		.action = st_op_disabled_dependency,
+	},
+	[NM_BTS_ST_OP_DISABLED_OFFLINE] = {
+		.in_event_mask =
+			X(NM_BTS_EV_STATE_CHG_REP) |
+			X(NM_BTS_EV_SET_ATTR_ACK),
+		.out_state_mask =
+			X(NM_BTS_ST_OP_DISABLED_NOTINSTALLED) |
+			X(NM_BTS_ST_OP_DISABLED_DEPENDENCY) |
+			X(NM_BTS_ST_OP_ENABLED),
+		.name = "DISABLED_OFFLINE",
+		.onenter = st_op_disabled_offline_on_enter,
+		.action = st_op_disabled_offline,
+	},
+	[NM_BTS_ST_OP_ENABLED] = {
+	.in_event_mask =
+		X(NM_BTS_EV_STATE_CHG_REP),
+	.out_state_mask =
+		X(NM_BTS_ST_OP_DISABLED_NOTINSTALLED) |
+		X(NM_BTS_ST_OP_DISABLED_DEPENDENCY) |
+		X(NM_BTS_ST_OP_DISABLED_OFFLINE),
+	.name = "ENABLED",
+	.onenter = st_op_enabled_on_enter,
+	.action = st_op_enabled,
+	},
+};
+
+const struct value_string nm_bts_fsm_event_names[] = {
+	{ NM_BTS_EV_SW_ACT_REP, "SW_ACT_REP" },
+	{ NM_BTS_EV_STATE_CHG_REP, "STATE_CHG_REP" },
+	{ NM_BTS_EV_SET_ATTR_ACK, "SET_ATTR_ACK" },
+	{ NM_BTS_EV_OPSTART_ACK, "OPSTART_ACK" },
+	{ NM_BTS_EV_OPSTART_NACK, "OPSTART_NACK" },
+	{ NM_BTS_EV_OML_DOWN, "OML_DOWN" },
+	{ 0, NULL }
+};
+
+struct osmo_fsm nm_bts_fsm = {
+	.name = "NM_BTS_OP",
+	.states = nm_bts_fsm_states,
+	.num_states = ARRAY_SIZE(nm_bts_fsm_states),
+	.allstate_event_mask =
+		X(NM_BTS_EV_OPSTART_ACK) |
+		X(NM_BTS_EV_OPSTART_NACK) |
+		X(NM_BTS_EV_OML_DOWN),
+	.allstate_action = st_op_allstate,
+	.event_names = nm_bts_fsm_event_names,
+	.log_subsys = DNM,
+};
+
+static __attribute__((constructor)) void nm_bts_fsm_init(void)
+{
+	OSMO_ASSERT(osmo_fsm_register(&nm_bts_fsm) == 0);
+}
diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am
index 151437e..7040989 100644
--- a/src/utils/Makefile.am
+++ b/src/utils/Makefile.am
@@ -52,10 +52,12 @@
 	$(top_builddir)/src/osmo-bsc/bts.o \
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/bts_siemens_bs11.o \
+	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \
 	$(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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
@@ -124,9 +126,11 @@
 	$(top_builddir)/src/osmo-bsc/abis_nm.o \
 	$(top_builddir)/src/osmo-bsc/acc.o \
 	$(top_builddir)/src/osmo-bsc/bts.o \
+	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
diff --git a/tests/abis/Makefile.am b/tests/abis/Makefile.am
index 28c284f..1a4b4d7 100644
--- a/tests/abis/Makefile.am
+++ b/tests/abis/Makefile.am
@@ -28,10 +28,12 @@
 	$(top_builddir)/src/osmo-bsc/abis_nm.o \
 	$(top_builddir)/src/osmo-bsc/acc.o \
 	$(top_builddir)/src/osmo-bsc/bts.o \
+	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \
 	$(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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/acc/Makefile.am b/tests/acc/Makefile.am
index 98362a9..b8372c1 100644
--- a/tests/acc/Makefile.am
+++ b/tests/acc/Makefile.am
@@ -28,10 +28,12 @@
 	$(top_builddir)/src/osmo-bsc/abis_nm.o \
 	$(top_builddir)/src/osmo-bsc/acc.o \
 	$(top_builddir)/src/osmo-bsc/bts.o \
+	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \
 	$(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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
diff --git a/tests/acc/acc_test.ok b/tests/acc/acc_test.ok
index 6315a92..832c7f5 100644
--- a/tests/acc/acc_test.ok
+++ b/tests/acc/acc_test.ok
@@ -1,4 +1,5 @@
 ===test_acc_mgr_no_ramp===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -107,8 +108,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_no_ramp()
 ===test_acc_mgr_manual_ramp===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -347,8 +350,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_manual_ramp()
 ===test_acc_mgr_rotate(true, 1)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -418,8 +423,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 1)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -486,8 +493,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 2)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -557,8 +566,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 2)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -625,8 +636,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 3)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -696,8 +709,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 3)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -764,8 +779,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 4)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -835,8 +852,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 4)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -903,8 +922,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 5)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -974,8 +995,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 5)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1042,8 +1065,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 6)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1113,8 +1138,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 6)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1181,8 +1208,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 7)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1252,8 +1281,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 7)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1320,8 +1351,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(true, 8)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1391,8 +1424,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 8)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1459,8 +1494,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_mgr_rotate(false, 9)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1527,8 +1564,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_mgr_rotate()
 ===test_acc_ramp===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1564,8 +1603,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp()
 ===test_acc_ramp2===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1583,8 +1624,10 @@
 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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp2()
 ===test_acc_ramp3===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1618,8 +1661,10 @@
 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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp3()
 ===test_acc_ramp_up_rotate(0, 100, 100)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1709,8 +1754,10 @@
 sys={3000.000000}: select()
 sys={3250.000000}: select()
 NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_up_rotate(0, 20, 50)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1800,8 +1847,10 @@
 sys={3000.000000}: select()
 sys={3250.000000}: select()
 NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_up_rotate(70, 80, 90)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -1891,8 +1940,10 @@
 sys={3000.000000}: select()
 sys={3250.000000}: select()
 NM_BTS_SM_OP(bts_sm0){DISABLED_NOTINSTALLED}: Deallocated
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_up_rotate()
 ===test_acc_ramp_updown_rotate(80, 90, 0, 100, 15)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -2012,8 +2063,10 @@
 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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(30, 50, 10, 100, 15)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -2157,8 +2210,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(50, 49, 0, 100, 10)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -2312,8 +2367,10 @@
 (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
+NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated
 BTS deallocated OK in test_acc_ramp_updown_rotate()
 ===test_acc_ramp_updown_rotate(30, 80, 30, 80, 5)===
+NM_BTS_OP{DISABLED_NOTINSTALLED}: Allocated
 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()
@@ -2373,4 +2430,5 @@
 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
+NM_BTS_OP(bts0){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 0c5f47f..1fd7396 100644
--- a/tests/bsc/Makefile.am
+++ b/tests/bsc/Makefile.am
@@ -39,6 +39,7 @@
 	$(top_builddir)/src/osmo-bsc/osmo_bsc_filter.o \
 	$(top_builddir)/src/osmo-bsc/bsc_subscriber.o \
 	$(top_builddir)/src/osmo-bsc/bts.o \
+	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/handover_cfg.o \
@@ -46,6 +47,7 @@
 	$(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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOVTY_LIBS) \
diff --git a/tests/gsm0408/Makefile.am b/tests/gsm0408/Makefile.am
index 5525670..1cbaca5 100644
--- a/tests/gsm0408/Makefile.am
+++ b/tests/gsm0408/Makefile.am
@@ -28,6 +28,7 @@
 	$(top_builddir)/src/osmo-bsc/gsm_04_08_rr.o \
 	$(top_builddir)/src/osmo-bsc/arfcn_range_encode.o \
 	$(top_builddir)/src/osmo-bsc/bts.o \
+	$(top_builddir)/src/osmo-bsc/bts_ipaccess_nanobts_omlattr.o \
 	$(top_builddir)/src/osmo-bsc/bts_trx.o \
 	$(top_builddir)/src/osmo-bsc/gsm_data.o \
 	$(top_builddir)/src/osmo-bsc/net_init.o \
@@ -35,6 +36,7 @@
 	$(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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \
diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am
index c4b6932..e478882 100644
--- a/tests/handover/Makefile.am
+++ b/tests/handover/Makefile.am
@@ -81,6 +81,7 @@
 	$(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/nm_bts_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 e4c9581..5f65337 100644
--- a/tests/nanobts_omlattr/Makefile.am
+++ b/tests/nanobts_omlattr/Makefile.am
@@ -30,6 +30,7 @@
 	$(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 \
+	$(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \
 	$(LIBOSMOCORE_LIBS) \
 	$(LIBOSMOGSM_LIBS) \
 	$(LIBOSMOABIS_LIBS) \

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7756a8ce90b6cc8a502b5665889a7987d7f749cb
Gerrit-Change-Number: 20401
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/e8634188/attachment.htm>


More information about the gerrit-log mailing list