diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-15 17:43:31 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-09-20 12:22:53 +0200 |
commit | ea53ad454e91a4ea41671788d12e2f94eeb00ffc (patch) | |
tree | ac03f37c6bd711338f6809940d6ba5be08992844 /src/common/oml.c | |
parent | 729aff79386205093e34f7aa5e9c90b162e7d9b4 (diff) |
Allow setting administrative state through oml_mo_state_chg()
This way it can be changed together with operative/availability state,
and changes announced to the BSC if present.
This commit presents no real change in osmo-bts behavior, since the only
place where adm_state is passed different than -1 is in
st_op_disabled_notinstalled_on_enter(), which is actually never called
(yet) since it's the initial state and no other states transition later
to it.
However, this will change in the future once we support re-connecting to
a (possibly different) BSC, which means objects will need to be moved to
that state to restart the whole OML install procedure on the new BSC.
Change-Id: Ifdc6a1dfb673c0ab915ddf2a9d372928f4f86b4c
Diffstat (limited to 'src/common/oml.c')
-rw-r--r-- | src/common/oml.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/common/oml.c b/src/common/oml.c index 819b033a..d2cf8770 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -340,12 +340,13 @@ void oml_mo_state_init(struct gsm_abis_mo *mo, int op_state, int avail_state) mo->nm_state.operational = op_state; } -int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state) +int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state, int adm_state) { int rc = 0; if ((op_state != -1 && mo->nm_state.operational != op_state) || - (avail_state != -1 && mo->nm_state.availability != avail_state)) { + (avail_state != -1 && mo->nm_state.availability != avail_state) || + (adm_state != -1 && mo->nm_state.administrative != adm_state)) { if (avail_state != -1) { LOGP(DOML, LOGL_INFO, "%s AVAIL STATE %s -> %s\n", gsm_abis_mo_name(mo), @@ -361,6 +362,14 @@ int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state) mo->nm_state.operational = op_state; osmo_signal_dispatch(SS_GLOBAL, S_NEW_OP_STATE, NULL); } + if (adm_state != -1) { + LOGP(DOML, LOGL_INFO, "%s ADMIN STATE %s -> %s\n", + gsm_abis_mo_name(mo), + abis_nm_admin_name(mo->nm_state.administrative), + abis_nm_admin_name(adm_state)); + mo->nm_state.administrative = adm_state; + } + /* send state change report */ rc = oml_tx_state_changed(mo); |