diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-10-02 17:50:03 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2020-10-02 20:13:15 +0200 |
commit | 135068d5c8ddb5fcca3379b94eb3f777b3a14525 (patch) | |
tree | b80e62ddb34066f1277ebbf5046744eeeb95b742 /src/common/bts.c | |
parent | a97941aaca7b12f98633a3a97fd71f48b082d591 (diff) |
Introduce NM BTS FSM
Change-Id: Iae631bcc7acdf955296b124707e42d5e565af186
Diffstat (limited to 'src/common/bts.c')
-rw-r--r-- | src/common/bts.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/common/bts.c b/src/common/bts.c index 34a6be27..38ec5534 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -53,6 +53,7 @@ #include <osmo-bts/cbch.h> #include <osmo-bts/bts_shutdown_fsm.h> #include <osmo-bts/nm_bts_sm_fsm.h> +#include <osmo-bts/nm_bts_fsm.h> #define MIN_QUAL_RACH 50 /* minimum link quality (in centiBels) for Access Bursts */ #define MIN_QUAL_NORM -5 /* minimum link quality (in centiBels) for Normal Bursts */ @@ -226,8 +227,10 @@ struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, 0xff, 0xff, 0xff); - gsm_mo_init(&bts->mo, bts, NM_OC_BTS, - bts->nr, 0xff, 0xff); + 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); for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { bts->gprs.nsvc[i].bts = bts; @@ -333,9 +336,9 @@ int bts_init(struct gsm_bts *bts) /* Start with the site manager */ oml_mo_state_init(&bts->site_mgr.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED); + oml_mo_state_init(&bts->nm.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED); - /* set BTS to dependency */ - oml_mo_state_init(&bts->mo, -1, NM_AVSTATE_DEPENDENCY); + /* set BTS attr to dependency */ oml_mo_state_init(&bts->gprs.nse.mo, -1, NM_AVSTATE_DEPENDENCY); oml_mo_state_init(&bts->gprs.cell.mo, -1, NM_AVSTATE_DEPENDENCY); oml_mo_state_init(&bts->gprs.nsvc[0].mo, -1, NM_AVSTATE_DEPENDENCY); @@ -395,9 +398,9 @@ int bts_link_estab(struct gsm_bts *bts) LOGP(DSUM, LOGL_INFO, "Main link established, sending NM Status.\n"); - /* BTS SITE MGR becomes Offline (tx SW ACT Report), BTS is DEPENDENCY */ + /* BTS SITE MGR and BTS become Offline (tx SW ACT Report) */ osmo_fsm_inst_dispatch(bts->site_mgr.fi, NM_BTS_SM_EV_SW_ACT, NULL); - oml_tx_state_changed(&bts->mo); + osmo_fsm_inst_dispatch(bts->nm.fi, NM_BTS_SM_EV_SW_ACT, NULL); /* those should all be in DEPENDENCY */ oml_tx_state_changed(&bts->gprs.nse.mo); |