aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-oc2g/oml.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-oc2g/oml.c')
-rw-r--r--src/osmo-bts-oc2g/oml.c56
1 files changed, 31 insertions, 25 deletions
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index 737afd31..f441be29 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/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 "oc2gbts.h"
@@ -280,38 +281,41 @@ static int opstart_compl(struct gsm_abis_mo *mo, struct msgb *l1_msg)
get_value_string(oc2gbts_l1prim_names, l1p->id),
get_value_string(oc2gbts_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);
}
@@ -1896,6 +1900,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) {
@@ -1918,6 +1923,7 @@ 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:
+ ts = (struct gsm_bts_trx_ts*) obj;
rc = ts_opstart(obj);
break;
case NM_OC_GPRS_NSE: