dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28915 )
Change subject: abis_om2000: update_op_state() does not send signal ......................................................................
abis_om2000: update_op_state() does not send signal
The function update_op_state() updates the OML MO, but it does not notify the update to other entities using S_NM_STATECHG
Change-Id: Id19c6beb2bc79c4db0ec07ef593aacb57fff8b75 Related: OS#5634 --- M src/osmo-bsc/abis_om2000.c 1 file changed, 12 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/15/28915/1
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 903e06e..ac5b401 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -1028,16 +1028,24 @@ static void update_op_state(struct gsm_bts *bts, const struct abis_om2k_mo *mo, uint8_t op_state) { struct gsm_nm_state *nm_state = mo2nm_state(bts, mo); - struct gsm_nm_state new_state; + struct nm_statechg_signal_data nsd;
if (!nm_state) return;
- new_state = *nm_state; + memset(&nsd, 0, sizeof(nsd));
- new_state.operational = oml_opstate_from_om2k_opstate(op_state); + nsd.bts = bts; + nsd.obj = mo2obj(bts, mo); + nsd.old_state = *nm_state; + nsd.new_state = *nm_state; + nsd.om2k_mo = mo;
- nm_state->operational = new_state.operational; + nsd.new_state.operational = oml_opstate_from_om2k_opstate(op_state); + + /* Update current state before emitting signal: */ + nm_state->operational = nsd.new_state.operational; + osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd); }
static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg)