aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-trx/l1_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-trx/l1_if.c')
-rw-r--r--src/osmo-bts-trx/l1_if.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index 6b417f40..90adde29 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -555,21 +555,38 @@ int bts_model_apply_oml(struct gsm_bts *bts, struct msgb *msg,
struct tlv_parsed *new_attr, int kind, void *obj)
{
struct abis_om_fom_hdr *foh = msgb_l3(msg);
- int cause = 0;
+ struct gsm_abis_mo *mo = gsm_objclass2mo(bts, foh->obj_class, &foh->obj_inst);
+ struct nm_fsm_ev_setattr_data ev_data = {
+ .msg = msg,
+ .cause = 0,
+ };
+ int rc;
+
+ /* TODO: NM Object without FSM: */
+ switch (foh->obj_class) {
+ case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
+ case NM_OC_GPRS_NSVC:
+ return oml_fom_ack_nack(ev_data.msg, ev_data.cause);
+ }
switch (foh->msg_type) {
case NM_MT_SET_BTS_ATTR:
- cause = trx_set_bts(obj, new_attr);
+ ev_data.cause = trx_set_bts(obj, new_attr);
break;
case NM_MT_SET_RADIO_ATTR:
- cause = trx_set_trx(obj);
+ ev_data.cause = trx_set_trx(obj);
break;
case NM_MT_SET_CHAN_ATTR:
- cause = trx_set_ts(obj);
+ ev_data.cause = trx_set_ts(obj);
break;
}
- return oml_fom_ack_nack(msg, cause);
+ rc = osmo_fsm_inst_dispatch(mo->fi,
+ ev_data.cause == 0 ? NM_EV_SETATTR_ACK : NM_EV_SETATTR_NACK,
+ &ev_data);
+ /* msgb ownsership is transferred to FSM if it received ev: */
+ return rc == 0 ? 1 : 0;
}
/* callback from OML */