aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2020-05-08 20:46:01 +0200
committerlaforge <laforge@osmocom.org>2020-05-09 15:58:44 +0000
commitf1c1e7f3451ca0cd0e8e41cc4a5a02513cf1f177 (patch)
tree6b4afcacc5bf57eb3cb816dfba4787fe33672e24
parent8b0f6879ed019bbf4cb02bfc7b0ed5334cfb052d (diff)
bts_nokia_site: Fake 12.21 OM objet state as "OK" when boot is done
Parts of Osmo-BSC want to see the NM state as valid ... Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Change-Id: I0db11819d23e40272c4aa6fd093365b9c13f7bcf
-rw-r--r--src/osmo-bsc/bts_nokia_site.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/osmo-bsc/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c
index cde0afa97..804768234 100644
--- a/src/osmo-bsc/bts_nokia_site.c
+++ b/src/osmo-bsc/bts_nokia_site.c
@@ -1436,6 +1436,39 @@ static int dump_elements(uint8_t * data, int len)
return 0;
}
+static void mo_ok(struct gsm_abis_mo *mo)
+{
+ mo->nm_state.operational = NM_OPSTATE_ENABLED;
+ mo->nm_state.administrative = NM_STATE_UNLOCKED;
+ mo->nm_state.availability = NM_AVSTATE_OK;
+}
+
+static void nokia_abis_nm_fake_1221_ok(struct gsm_bts *bts)
+{
+ /*
+ * The Nokia BTS don't follow the 12.21 model and we don't have OM objects
+ * for the various elements. However some of the BSC code depends on seeing
+ * those object "up & running", so when the Nokia init is done, we fake
+ * a "good" state
+ */
+ struct gsm_bts_trx *trx;
+
+ mo_ok(&bts->mo);
+ mo_ok(&bts->site_mgr.mo);
+
+ llist_for_each_entry(trx, &bts->trx_list, list) {
+ int i;
+
+ mo_ok(&trx->mo);
+ mo_ok(&trx->bb_transc.mo);
+
+ for (i = 0; i < ARRAY_SIZE(trx->ts); i++) {
+ struct gsm_bts_trx_ts *ts = &trx->ts[i];
+ mo_ok(&ts->mo);
+ }
+ }
+}
+
/* TODO: put in a separate file ? */
/* taken from abis_nm.c */
@@ -1633,6 +1666,8 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb)
case NOKIA_MSG_CONF_COMPLETE:
/* send ACK */
abis_nm_ack(bts, ref);
+ /* fake 12.21 OM */
+ nokia_abis_nm_fake_1221_ok(bts);
break;
case NOKIA_MSG_BLOCK_CTRL_REQ: /* seems to be send when something goes wrong !? */
/* send ACK (do we have to send an ACK ?) */