From 6adeb607d0a932fcbc07b1daada432e77490e7ce Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 30 Sep 2020 12:52:53 +0200 Subject: Introduce NM BTS FSM Change-Id: I7756a8ce90b6cc8a502b5665889a7987d7f749cb --- include/osmocom/bsc/gsm_data.h | 3 + include/osmocom/bsc/nm_common_fsm.h | 10 + include/osmocom/bsc/signal.h | 1 + src/ipaccess/Makefile.am | 3 + src/osmo-bsc/Makefile.am | 1 + src/osmo-bsc/abis_nm.c | 10 +- src/osmo-bsc/bts.c | 7 + src/osmo-bsc/bts_ipaccess_nanobts.c | 40 ++-- src/osmo-bsc/nm_bts_fsm.c | 353 ++++++++++++++++++++++++++++++++++++ src/osmo-bsc/nm_common_fsm.c | 1 + src/utils/Makefile.am | 4 + tests/abis/Makefile.am | 2 + tests/acc/Makefile.am | 2 + tests/acc/acc_test.ok | 58 ++++++ tests/bsc/Makefile.am | 2 + tests/gsm0408/Makefile.am | 2 + tests/handover/Makefile.am | 1 + tests/nanobts_omlattr/Makefile.am | 1 + 18 files changed, 489 insertions(+), 12 deletions(-) create mode 100644 src/osmo-bsc/nm_bts_fsm.c diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 06348be77..428fe87ae 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -395,6 +395,9 @@ struct gsm_abis_mo { struct gsm_bts *bts; struct osmo_fsm_inst *fi; bool opstart_sent; + bool adm_unlock_sent; + bool set_attr_sent; + bool set_attr_ack_received; }; /* Ericsson OM2000 Managed Object */ diff --git a/include/osmocom/bsc/nm_common_fsm.h b/include/osmocom/bsc/nm_common_fsm.h index a76c19894..719d591a8 100644 --- a/include/osmocom/bsc/nm_common_fsm.h +++ b/include/osmocom/bsc/nm_common_fsm.h @@ -30,6 +30,7 @@ enum nm_fsm_events { NM_EV_SW_ACT_REP, NM_EV_STATE_CHG_REP, + NM_EV_SET_ATTR_ACK, NM_EV_OPSTART_ACK, NM_EV_OPSTART_NACK, NM_EV_OML_DOWN, @@ -44,3 +45,12 @@ enum nm_bts_sm_op_fsm_states { NM_BTS_SM_ST_OP_ENABLED, }; extern struct osmo_fsm nm_bts_sm_fsm; + +/* BTS */ +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, +}; +extern struct osmo_fsm nm_bts_fsm; diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index abda67eeb..4922ac81a 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -75,6 +75,7 @@ enum signal_nm { 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 0e06caabf..e49a77880 100644 --- a/src/ipaccess/Makefile.am +++ b/src/ipaccess/Makefile.am @@ -56,6 +56,7 @@ ipaccess_config_LDADD = \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/nm_common_fsm.o \ $(top_builddir)/src/osmo-bsc/nm_bts_sm_fsm.o \ + $(top_builddir)/src/osmo-bsc/nm_bts_fsm.o \ $(OSMO_LIBS) \ $(NULL) @@ -68,9 +69,11 @@ ipaccess_proxy_LDADD = \ $(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_common_fsm.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 ffa39a03e..4584b2c1d 100644 --- a/src/osmo-bsc/Makefile.am +++ b/src/osmo-bsc/Makefile.am @@ -78,6 +78,7 @@ osmo_bsc_SOURCES = \ net_init.c \ nm_common_fsm.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 511c4b3e2..54dfccbbf 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -842,6 +842,14 @@ static int abis_nm_rx_set_radio_attr_ack(struct msgb *mb) 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; @@ -978,7 +986,7 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb) 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/bts.c b/src/osmo-bsc/bts.c index fe1641230..3dd827e5b 100644 --- a/src/osmo-bsc/bts.c +++ b/src/osmo-bsc/bts.c @@ -153,6 +153,10 @@ static int gsm_bts_talloc_destructor(struct gsm_bts *bts) osmo_fsm_inst_free(bts->site_mgr.mo.fi); bts->site_mgr.mo.fi = NULL; } + if (bts->mo.fi) { + osmo_fsm_inst_free(bts->mo.fi); + bts->mo.fi = NULL; + } return 0; } @@ -183,6 +187,9 @@ struct gsm_bts *gsm_bts_alloc(struct gsm_network *net, uint8_t bts_num) osmo_fsm_inst_update_id_f(bts->site_mgr.mo.fi, "bts_sm"); gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, 0xff, 0xff, 0xff); + bts->mo.fi = osmo_fsm_inst_alloc(&nm_bts_fsm, bts, bts, + LOGL_INFO, NULL); + osmo_fsm_inst_update_id_f(bts->mo.fi, "bts%d", bts->nr); gsm_mo_init(&bts->mo, bts, NM_OC_BTS, bts->nr, 0xff, 0xff); for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c index 457448cdd..bb05236f3 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts.c @@ -143,7 +143,7 @@ static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd) /* 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) { @@ -153,16 +153,7 @@ static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd) 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->mo.fi, NM_EV_STATE_CHG_REP, nsd); break; case NM_OC_CHANNEL: ts = obj; @@ -265,6 +256,9 @@ static int sw_activ_rep(struct msgb *mb) case NM_OC_SITE_MANAGER: osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_SW_ACT_REP, NULL); break; + case NM_OC_BTS: + osmo_fsm_inst_dispatch(bts->mo.fi, NM_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; @@ -326,6 +320,9 @@ static void nm_rx_opstart_ack(struct msgb *oml_msg) case NM_OC_SITE_MANAGER: osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_ACK, NULL); break; + case NM_OC_BTS: + osmo_fsm_inst_dispatch(bts->mo.fi, NM_EV_OPSTART_ACK, NULL); + break; case NM_OC_CHANNEL: nm_rx_opstart_ack_chan(oml_msg); break; @@ -343,11 +340,28 @@ static void nm_rx_opstart_nack(struct msgb *oml_msg) case NM_OC_SITE_MANAGER: osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OPSTART_NACK, NULL); break; + case NM_OC_BTS: + osmo_fsm_inst_dispatch(bts->mo.fi, NM_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->mo.fi, NM_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); @@ -382,6 +396,9 @@ static int bts_ipa_nm_sig_cb(unsigned int subsys, unsigned int signal, 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; @@ -467,6 +484,7 @@ void ipaccess_drop_oml(struct gsm_bts *bts, const char *reason) ipaccess_drop_rsl(trx, "OML link drop"); osmo_fsm_inst_dispatch(bts->site_mgr.mo.fi, NM_EV_OML_DOWN, NULL); + osmo_fsm_inst_dispatch(bts->mo.fi, NM_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_fsm.c b/src/osmo-bsc/nm_bts_fsm.c new file mode 100644 index 000000000..fa4235166 --- /dev/null +++ b/src/osmo-bsc/nm_bts_fsm.c @@ -0,0 +1,353 @@ +/* NM BTS FSM */ + +/* (C) 2020 by sysmocom - s.m.f.c. GmbH + * Author: Pau Espin Pedrol + * + * 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 . + * + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#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->mo.set_attr_sent = false; + bts->mo.set_attr_ack_received = false; + bts->mo.adm_unlock_sent = false; + bts->mo.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_EV_SW_ACT_REP: + break; + case NM_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->mo.set_attr_sent && !bts->mo.set_attr_ack_received) { + bts->mo.set_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->mo.adm_unlock_sent) { + bts->mo.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->mo.set_attr_ack_received) { + if (!bts->mo.opstart_sent) { + bts->mo.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->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_EV_SET_ATTR_ACK: + bts->mo.set_attr_ack_received = true; + bts->mo.set_attr_sent = false; + configure_loop(bts, &bts->mo.nm_state, false); + return; + case NM_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->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_EV_SET_ATTR_ACK: + bts->mo.set_attr_ack_received = true; + bts->mo.set_attr_sent = false; + configure_loop(bts, &bts->mo.nm_state, true); + return; + case NM_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->mo.opstart_sent = false; + bts->mo.adm_unlock_sent = false; + bts->mo.set_attr_sent = false; + bts->mo.set_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_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_EV_OPSTART_ACK: + case NM_EV_OPSTART_NACK: + /* TODO: if on state OFFLINE and rx NACK, try again? */ + bts->mo.opstart_sent = false; + break; + case NM_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_EV_SW_ACT_REP) | + X(NM_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_EV_STATE_CHG_REP) | + X(NM_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_EV_STATE_CHG_REP) | + X(NM_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_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, + }, +}; + +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_EV_OPSTART_ACK) | + X(NM_EV_OPSTART_NACK) | + X(NM_EV_OML_DOWN), + .allstate_action = st_op_allstate, + .event_names = nm_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/osmo-bsc/nm_common_fsm.c b/src/osmo-bsc/nm_common_fsm.c index 9851f5d95..f8aa779cc 100644 --- a/src/osmo-bsc/nm_common_fsm.c +++ b/src/osmo-bsc/nm_common_fsm.c @@ -25,6 +25,7 @@ const struct value_string nm_fsm_event_names[] = { { NM_EV_SW_ACT_REP, "SW_ACT_REP" }, { NM_EV_STATE_CHG_REP, "STATE_CHG_REP" }, + { NM_EV_SET_ATTR_ACK, "SET_ATTR_ACK" }, { NM_EV_OPSTART_ACK, "OPSTART_ACK" }, { NM_EV_OPSTART_NACK, "OPSTART_NACK" }, { NM_EV_OML_DOWN, "OML_DOWN" }, diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 30de5b4e6..4d9ebaa64 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -52,11 +52,13 @@ bs11_config_LDADD = \ $(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_common_fsm.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) \ @@ -125,10 +127,12 @@ meas_json_LDADD = \ $(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_common_fsm.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 55a133925..a40bdfdcb 100644 --- a/tests/abis/Makefile.am +++ b/tests/abis/Makefile.am @@ -28,11 +28,13 @@ abis_test_LDADD = \ $(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_common_fsm.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 460d473c2..176d01863 100644 --- a/tests/acc/Makefile.am +++ b/tests/acc/Makefile.am @@ -28,11 +28,13 @@ acc_test_LDADD = \ $(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_common_fsm.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 1428e4037..636dba889 100644 --- a/tests/acc/acc_test.ok +++ b/tests/acc/acc_test.ok @@ -1,5 +1,6 @@ ===test_acc_mgr_no_ramp=== NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -107,9 +108,11 @@ pcu_info_update(): t2=0x03 t3=0xff, allowed: (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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -347,9 +350,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -418,9 +423,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -486,9 +493,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -557,9 +566,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -625,9 +636,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -696,9 +709,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -764,9 +779,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -835,9 +852,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -903,9 +922,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -974,9 +995,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -1042,9 +1065,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -1113,9 +1138,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -1181,9 +1208,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -1252,9 +1281,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -1320,9 +1351,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -1391,9 +1424,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -1459,9 +1494,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -1527,9 +1564,11 @@ 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_sm){DISABLED_NOTINSTALLED}: Deallocated +NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated BTS deallocated OK in test_acc_mgr_rotate() ===test_acc_ramp=== NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -1564,9 +1603,11 @@ 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_sm){DISABLED_NOTINSTALLED}: Deallocated +NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated BTS deallocated OK in test_acc_ramp() ===test_acc_ramp2=== NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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) @@ -1583,9 +1624,11 @@ sys={10.000000}: select() pcu_info_update(): t2=0x03 t3=0x80, allowed: 0 1 2 3 4 5 6 sys={15.000000}: select() NM_BTS_SM_OP(bts_sm){DISABLED_NOTINSTALLED}: Deallocated +NM_BTS_OP(bts0){DISABLED_NOTINSTALLED}: Deallocated BTS deallocated OK in test_acc_ramp2() ===test_acc_ramp3=== NM_BTS_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -1618,9 +1661,11 @@ sys={40.000000}: select() 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -1709,9 +1754,11 @@ sys={2750.000000}: select() sys={3000.000000}: select() sys={3250.000000}: select() NM_BTS_SM_OP(bts_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -1800,9 +1847,11 @@ sys={2750.000000}: select() sys={3000.000000}: select() sys={3250.000000}: select() NM_BTS_SM_OP(bts_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -1891,9 +1940,11 @@ sys={2750.000000}: select() sys={3000.000000}: select() sys={3250.000000}: select() NM_BTS_SM_OP(bts_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -2012,9 +2063,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -2157,9 +2210,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -2312,9 +2367,11 @@ 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_sm){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_SM_OP{DISABLED_NOTINSTALLED}: Allocated +NM_BTS_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 *** @@ -2373,4 +2430,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_sm){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 d64915bcd..4d3d37979 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -39,6 +39,7 @@ bsc_test_LDADD = \ $(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 \ @@ -47,6 +48,7 @@ bsc_test_LDADD = \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/nm_common_fsm.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 656498f1f..b2451e2e0 100644 --- a/tests/gsm0408/Makefile.am +++ b/tests/gsm0408/Makefile.am @@ -28,6 +28,7 @@ gsm0408_test_LDADD = \ $(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 \ @@ -36,6 +37,7 @@ gsm0408_test_LDADD = \ $(top_builddir)/src/osmo-bsc/neighbor_ident.o \ $(top_builddir)/src/osmo-bsc/nm_common_fsm.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 4b8f26915..4617518e9 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -82,6 +82,7 @@ handover_test_LDADD = \ $(top_builddir)/src/osmo-bsc/net_init.o \ $(top_builddir)/src/osmo-bsc/nm_common_fsm.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 05dc66214..09374b28d 100644 --- a/tests/nanobts_omlattr/Makefile.am +++ b/tests/nanobts_omlattr/Makefile.am @@ -31,6 +31,7 @@ nanobts_omlattr_test_LDADD = \ $(top_builddir)/src/osmo-bsc/gsm_data.o \ $(top_builddir)/src/osmo-bsc/nm_common_fsm.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) \ -- cgit v1.2.3