diff options
Diffstat (limited to 'src/osmo-bts-litecell15/oml.c')
-rw-r--r-- | src/osmo-bts-litecell15/oml.c | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index a2d34609..4b1f3562 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -47,6 +47,7 @@ #include <osmo-bts/nm_bts_fsm.h> #include <osmo-bts/nm_radio_carrier_fsm.h> #include <osmo-bts/nm_bb_transc_fsm.h> +#include <osmo-bts/nm_channel_fsm.h> #include "l1_if.h" #include "lc15bts.h" @@ -280,38 +281,41 @@ static int opstart_compl(struct gsm_abis_mo *mo, struct msgb *l1_msg) get_value_string(lc15bts_l1prim_names, l1p->id), get_value_string(lc15bts_l1status_names, status)); msgb_free(l1_msg); - if (mo->obj_class == NM_OC_RADIO_CARRIER) + switch (mo->obj_class) { + case NM_OC_RADIO_CARRIER: return osmo_fsm_inst_dispatch(trx->rc.fi, NM_RCARRIER_EV_OPSTART_NACK, (void*)(intptr_t)NM_NACK_CANT_PERFORM); - else - return oml_mo_opstart_nack(mo, NM_NACK_CANT_PERFORM); + case NM_OC_CHANNEL: + return osmo_fsm_inst_dispatch(trx->ts[mo->obj_inst.ts_nr].nm_chan.fi, NM_CHAN_EV_OPSTART_NACK, + (void*)(intptr_t)NM_NACK_CANT_PERFORM); + default: + OSMO_ASSERT(0); + } } msgb_free(l1_msg); - - /* We already have a FSM for Radio Carrier, handle it there */ - if (mo->obj_class == NM_OC_RADIO_CARRIER) + switch (mo->obj_class) { + case NM_OC_RADIO_CARRIER: return osmo_fsm_inst_dispatch(trx->rc.fi, NM_RCARRIER_EV_OPSTART_ACK, NULL); - - /* Set to Operational State: Enabled */ - oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK); - - /* ugly hack to auto-activate all SAPIs for the BCCH/CCCH on TS0 */ - if (mo->obj_class == NM_OC_CHANNEL && mo->obj_inst.trx_nr == 0 && - mo->obj_inst.ts_nr == 0) { - struct gsm_lchan *cbch = gsm_bts_get_cbch(mo->bts); - DEBUGP(DL1C, "====> trying to activate lchans of BCCH\n"); - mo->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = - LCHAN_REL_ACT_OML; - lchan_activate(&mo->bts->c0->ts[0].lchan[CCCH_LCHAN]); - if (cbch) { - cbch->rel_act_kind = LCHAN_REL_ACT_OML; - lchan_activate(cbch); + case NM_OC_CHANNEL: + /* ugly hack to auto-activate all SAPIs for the BCCH/CCCH on TS0 */ + if (mo->obj_inst.trx_nr == 0 && + mo->obj_inst.ts_nr == 0) { + struct gsm_lchan *cbch = gsm_bts_get_cbch(mo->bts); + DEBUGP(DL1C, "====> trying to activate lchans of BCCH\n"); + mo->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = + LCHAN_REL_ACT_OML; + lchan_activate(&mo->bts->c0->ts[0].lchan[CCCH_LCHAN]); + if (cbch) { + cbch->rel_act_kind = LCHAN_REL_ACT_OML; + lchan_activate(cbch); + } } + return osmo_fsm_inst_dispatch(trx->ts[mo->obj_inst.ts_nr].nm_chan.fi, + NM_CHAN_EV_OPSTART_ACK, NULL); + default: + OSMO_ASSERT(0); } - - /* Send OPSTART ack */ - return oml_mo_opstart_ack(mo); } static int opstart_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, @@ -321,7 +325,7 @@ static int opstart_compl_cb(struct gsm_bts_trx *trx, struct msgb *l1_msg, GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg); GsmL1_MphConnectCnf_t *cnf = &l1p->u.mphConnectCnf; - mo = &trx->ts[cnf->u8Tn].mo; + mo = &trx->ts[cnf->u8Tn].nm_chan.mo; return opstart_compl(mo, l1_msg); } @@ -1888,6 +1892,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj) { struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; int rc; switch (mo->obj_class) { @@ -1906,7 +1911,8 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, rc = osmo_fsm_inst_dispatch(trx->bb_transc.fi, NM_BBTRANSC_EV_OPSTART_ACK, NULL); break; case NM_OC_CHANNEL: - rc = ts_opstart(obj); + ts = (struct gsm_bts_trx_ts*) obj; + rc = ts_opstart(ts); break; case NM_OC_GPRS_NSE: case NM_OC_GPRS_CELL: |