diff options
-rw-r--r-- | include/osmo-bts/oml.h | 3 | ||||
-rw-r--r-- | src/common/bts.c | 10 | ||||
-rw-r--r-- | src/common/oml.c | 7 |
3 files changed, 15 insertions, 5 deletions
diff --git a/include/osmo-bts/oml.h b/include/osmo-bts/oml.h index 0fdb95f5..01c127a5 100644 --- a/include/osmo-bts/oml.h +++ b/include/osmo-bts/oml.h @@ -14,6 +14,9 @@ int oml_mo_statechg_ack(struct gsm_abis_mo *mo); /* Change the state and send STATE CHG REP */ int oml_mo_state_chg(struct gsm_abis_mo *mo, int op_state, int avail_state); +/* First initialization of MO, does _not_ generate state changes */ +int oml_mo_state_init(struct gsm_abis_mo *mo, int op_state, int avail_state); + /* Transmit STATE CHG REP even if there was no state change */ int oml_tx_state_changed(struct gsm_abis_mo *mo); diff --git a/src/common/bts.c b/src/common/bts.c index bc60479d..e899ebd5 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -79,11 +79,11 @@ int bts_init(struct gsm_bts *bts) btsb->radio_link_timeout = 32; /* set BTS to dependency */ - oml_mo_state_chg(&bts->mo, -1, NM_AVSTATE_DEPENDENCY); - oml_mo_state_chg(&bts->gprs.nse.mo, -1, NM_AVSTATE_DEPENDENCY); - oml_mo_state_chg(&bts->gprs.cell.mo, -1, NM_AVSTATE_DEPENDENCY); - oml_mo_state_chg(&bts->gprs.nsvc[0].mo, -1, NM_AVSTATE_DEPENDENCY); - oml_mo_state_chg(&bts->gprs.nsvc[1].mo, -1, NM_AVSTATE_DEPENDENCY); + oml_mo_state_init(&bts->mo, -1, NM_AVSTATE_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); + oml_mo_state_init(&bts->gprs.nsvc[1].mo, -1, NM_AVSTATE_DEPENDENCY); /* initialize bts data structure */ llist_for_each_entry(trx, &bts->trx_list, list) { diff --git a/src/common/oml.c b/src/common/oml.c index 5a647097..62078662 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -229,6 +229,13 @@ int oml_tx_state_changed(struct gsm_abis_mo *mo) return oml_mo_send_msg(mo, nmsg, NM_MT_STATECHG_EVENT_REP); } +/* First initialization of MO, does _not_ generate state changes */ +int oml_mo_state_init(struct gsm_abis_mo *mo, int op_state, int avail_state) +{ + mo->nm_state.availability = 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 rc = 0; |