diff options
Diffstat (limited to 'src/osmo-bts-sysmo')
-rw-r--r-- | src/osmo-bts-sysmo/l1_if.c | 38 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/main.c | 2 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/oml.c | 15 |
3 files changed, 48 insertions, 7 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 2206cbc4..d4cb7fdb 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -37,6 +37,7 @@ #include <osmo-bts/logging.h> #include <osmo-bts/bts.h> +#include <osmo-bts/oml.h> #include <osmo-bts/gsm_data.h> #include <osmo-bts/paging.h> #include <osmo-bts/measurement.h> @@ -111,7 +112,7 @@ int l1if_req_compl(struct femtol1_hdl *fl1h, struct msgb *msg, wlc->is_sys_prim = 0; wlc->conf_prim_id = femtobts_l1prim_req2conf[l1p->id]; wqueue = &fl1h->write_q[MQ_L1_WRITE]; - timeout_secs = 10; + timeout_secs = 30; } else { FemtoBts_Prim_t *sysp = msgb_sysprim(msg); @@ -592,8 +593,11 @@ int sysinfo_has_changed(struct gsm_bts *bts, int si) static int activate_rf_compl_cb(struct msgb *resp, void *data) { FemtoBts_Prim_t *sysp = msgb_sysprim(resp); + struct femtol1_hdl *fl1h = data; + struct gsm_bts_trx *trx = fl1h->priv; GsmL1_Status_t status; int on = 0; + unsigned int i; if (sysp->id == FemtoBts_PrimId_ActivateRfCnf) on = 1; @@ -606,11 +610,32 @@ static int activate_rf_compl_cb(struct msgb *resp, void *data) LOGP(DL1C, LOGL_INFO, "Rx RF-%sACT.conf (status=%s)\n", on ? "" : "DE", get_value_string(femtobts_l1status_names, status)); + + if (on) { + if (status != GsmL1_Status_Success) { + LOGP(DL1C, LOGL_FATAL, "RF-ACT.conf with status %s\n", + get_value_string(femtobts_l1status_names, status)); + bts_shutdown(trx->bts, "RF-ACT failure"); + } + /* signal availability */ + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OK); + oml_mo_tx_sw_act_rep(&trx->mo); + oml_mo_state_chg(&trx->bb_transc.mo, -1, NM_AVSTATE_OK); + oml_mo_tx_sw_act_rep(&trx->bb_transc.mo); + + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) + oml_mo_state_chg(&trx->ts[i].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY); + } else { + oml_mo_state_chg(&trx->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); + oml_mo_state_chg(&trx->bb_transc.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE); + } + talloc_free(resp); return 0; } +/* activate or de-activate the entire RF-Frontend */ int l1if_activate_rf(struct femtol1_hdl *hdl, int on) { struct msgb *msg = sysp_msgb_alloc(); @@ -629,6 +654,7 @@ int l1if_activate_rf(struct femtol1_hdl *hdl, int on) static int reset_compl_cb(struct msgb *resp, void *data) { struct femtol1_hdl *fl1h = data; + struct gsm_bts_trx *trx = fl1h->priv; FemtoBts_Prim_t *sysp = msgb_sysprim(resp); GsmL1_Status_t status = sysp->u.layer1ResetCnf.status; @@ -638,8 +664,14 @@ static int reset_compl_cb(struct msgb *resp, void *data) talloc_free(resp); /* If we're coming out of reset .. */ - if (status == GsmL1_Status_Success) - l1if_activate_rf(fl1h, 1); + if (status != GsmL1_Status_Success) { + LOGP(DL1C, LOGL_FATAL, "L1-RESET.conf with status %s\n", + get_value_string(femtobts_l1status_names, status)); + bts_shutdown(trx->bts, "L1-RESET failure"); + } + + /* otherwise, request activation of RF board */ + l1if_activate_rf(fl1h, 1); return 0; } diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index cf6aeae9..07ed8dcb 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -170,7 +170,7 @@ static void signal_handler(int signal) switch (signal) { case SIGINT: //osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); - bts_shutdown(bts); + bts_shutdown(bts, "SIGINT"); break; case SIGABRT: case SIGUSR1: diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index c765c595..9c471a89 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -195,9 +195,17 @@ static int trx_init_compl_cb(struct msgb *l1_msg, void *data) GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); GsmL1_MphInitCnf_t *ic = &l1p->u.mphInitCnf; + LOGP(DL1C, LOGL_INFO, "Rx MPH-INIT.conf (status=%s)\n", + get_value_string(femtobts_l1status_names, ic->status)); + /* store layer1 handle */ - if (ic->status == GsmL1_Status_Success) - fl1h->hLayer1 = ic->hLayer1; + if (ic->status != GsmL1_Status_Success) { + LOGP(DL1C, LOGL_FATAL, "Rx MPH-INIT.conf status=%s\n", + get_value_string(femtobts_l1status_names, ic->status)); + bts_shutdown(trx->bts, "MPH-INIT failure"); + } + + fl1h->hLayer1 = ic->hLayer1; return opstart_compl_cb(l1_msg, &trx->mo); } @@ -585,8 +593,9 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, case NM_OC_BTS: case NM_OC_SITE_MANAGER: case NM_OC_BASEB_TRANSC: - mo->nm_state.operational = NM_OPSTATE_ENABLED; + oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, -1); rc = oml_mo_opstart_ack(mo); + break; default: rc = oml_mo_opstart_nack(mo, NM_NACK_OBJCLASS_NOTSUPP); } |