Change in osmo-bsc[master]: nm_rcarrier_fsm: Trigger S_NM_RUNNING_CHG when Admin st changes in op...
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28217 ) Change subject: nm_rcarrier_fsm: Trigger S_NM_RUNNING_CHG when Admin st changes in op=Enabled ...................................................................... nm_rcarrier_fsm: Trigger S_NM_RUNNING_CHG when Admin st changes in op=Enabled It was described in [1] that the NM FSM failed to trigger the S_NM_RUNNNG_CHG signal when locking/unlocking the TRX. That's because current osmo-bts doesn't fully conform to TS 52.021 and it doesn't go back to Op=Disabled Avail=Dependency when becoming Admin=Locked. It's true though that TS 52.021 sec 5.3.1 is not really helpful since it doesn't explicitly state that specific object should go into Disabled Dependency, despite saying it for most of the other ones. Hence, let's account for both possibilities at the BSC side. [1] https://gerrit.osmocom.org/c/osmo-bsc/+/28205 Related: OS#5576 Change-Id: Ifbdc066fd88bdbf826800d14524e74416815b625 --- M src/osmo-bsc/nm_rcarrier_fsm.c 1 file changed, 20 insertions(+), 1 deletion(-) Approvals: fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/nm_rcarrier_fsm.c b/src/osmo-bsc/nm_rcarrier_fsm.c index fbd3179..c8b95ad 100644 --- a/src/osmo-bsc/nm_rcarrier_fsm.c +++ b/src/osmo-bsc/nm_rcarrier_fsm.c @@ -250,8 +250,27 @@ 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) + /* Op state stays in Enabled, hence either Avail or Admin changed: */ + if (new_state->operational == NM_OPSTATE_ENABLED) { + /* Some sort of availability change we don't care about: */ + if (nsd->old_state.administrative == new_state->administrative) + return; + /* HACK: Admin state change without Op state change: + * According to TS 52.021 sec 5.3.1, Locking the NM obj should make + * it go into Disabled Dependency state, but current and older + * versions of osmo-bts (and potentially nanobts?) don't move from + * Operative=Enabled state and only change the Adminsitrative one. + * Let's account for this behavior here: */ + switch (new_state->administrative) { + case NM_STATE_LOCKED: + nm_rcarrier_fsm_becomes_disabled(trx); + break; + case NM_STATE_UNLOCKED: + nm_rcarrier_fsm_becomes_enabled(trx); + break; + } return; + } switch (new_state->availability) { /* operational = DISABLED */ case NM_AVSTATE_NOT_INSTALLED: case NM_AVSTATE_POWER_OFF: -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28217 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ifbdc066fd88bdbf826800d14524e74416815b625 Gerrit-Change-Number: 28217 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> Gerrit-Reviewer: osmith <osmith@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de> Gerrit-MessageType: merged
participants (1)
-
pespin