diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-04-04 14:05:21 +0200 |
---|---|---|
committer | pespin <pespin@sysmocom.de> | 2023-04-06 10:28:22 +0000 |
commit | cea6c230ada9b1fea7cc517946a1c16caccaaa51 (patch) | |
tree | 79e26834c8d509fa87fafb6ef8af16ad98df987d /src/common/oml.c | |
parent | 92d1d1582b2ca97a37f3fa638fe0b3f01036fb9c (diff) |
nm: Apply OPSTART through NM FSMs
This way we have further control on how to handle the OPSTART messages
received. For instance, NACK them if the NM object FSMs are not at the
expected correct state.
Related: OS#5992
Change-Id: I5df0bfb4cc812c11c7a00a8ffa882ae1915d562f
Diffstat (limited to 'src/common/oml.c')
-rw-r--r-- | src/common/oml.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/common/oml.c b/src/common/oml.c index 54996eab..a55ba445 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1078,6 +1078,7 @@ static int oml_rx_opstart(struct gsm_bts *bts, struct msgb *msg) struct abis_om_fom_hdr *foh = msgb_l3(msg); struct gsm_abis_mo *mo; void *obj; + int rc; DEBUGPFOH(DOML, foh, "Rx OPSTART\n"); @@ -1093,8 +1094,17 @@ static int oml_rx_opstart(struct gsm_bts *bts, struct msgb *msg) return oml_mo_opstart_ack(mo); } - /* Step 3: Ask BTS driver to apply the opstart */ - return bts_model_opstart(bts, mo, obj); + if (!mo->fi) { + /* Some NM objets still don't have FSMs implemented, such as + * NM_OC_GPRS_NSE, NM_OC_GPRS_CELL or NM_OC_GPRS_NSVC. For those, don't go through FSM: + */ + return bts_model_opstart(bts, mo, obj); + } + + rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_RX_OPSTART, NULL); + if (rc < 0) + return oml_fom_ack_nack(msg, NM_NACK_CANT_PERFORM); + return rc; } static int oml_rx_chg_adm_state(struct gsm_bts *bts, struct msgb *msg) |