aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-04-05 14:09:12 +0200
committerpespin <pespin@sysmocom.de>2023-04-06 10:28:22 +0000
commitd50d2399147a70100559ffa91223a27e28958167 (patch)
treea3ce90a3cb8531a9ad0defcab5f2a2f2eef2a276
parent989d99ca0063ee0c5a97b1e2eb82ceffd305ac30 (diff)
Introduce NM FSM for GPRS Cell object
-rw-r--r--include/osmo-bts/bts.h20
-rw-r--r--include/osmo-bts/nm_common_fsm.h9
-rw-r--r--src/common/Makefile.am1
-rw-r--r--src/common/bts.c17
-rw-r--r--src/common/nm_gprs_cell_fsm.c258
-rw-r--r--src/common/nm_gprs_nse_fsm.c5
-rw-r--r--src/common/oml.c28
-rw-r--r--src/osmo-bts-lc15/oml.c2
-rw-r--r--src/osmo-bts-oc2g/oml.c2
-rw-r--r--src/osmo-bts-octphy/l1_oml.c2
-rw-r--r--src/osmo-bts-omldummy/bts_model.c2
-rw-r--r--src/osmo-bts-sysmo/oml.c2
-rw-r--r--src/osmo-bts-trx/l1_if.c2
-rw-r--r--src/osmo-bts-virtual/bts_model.c2
14 files changed, 320 insertions, 32 deletions
diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h
index bbf5dc46..c5a0709a 100644
--- a/include/osmo-bts/bts.h
+++ b/include/osmo-bts/bts.h
@@ -143,6 +143,14 @@ struct gsm_gprs_nse {
uint8_t timer[7];
};
+/* GPRS CELL; ip.access specific NM Object */
+struct gsm_gprs_cell {
+ struct gsm_abis_mo mo;
+ uint16_t bvci;
+ uint8_t timer[11];
+ struct gprs_rlc_cfg rlc_cfg;
+};
+
/* Struct that holds one OML-Address (Address of the BSC) */
struct bsc_oml_host {
struct llist_head list;
@@ -232,12 +240,7 @@ struct gsm_bts {
/* Not entirely sure how ip.access specific this is */
struct {
struct gsm_gprs_nse nse;
- struct {
- struct gsm_abis_mo mo;
- uint16_t bvci;
- uint8_t timer[11];
- struct gprs_rlc_cfg rlc_cfg;
- } cell;
+ struct gsm_gprs_cell cell;
struct gsm_bts_gprs_nsvc nsvc[2];
uint8_t rac;
} gprs;
@@ -404,6 +407,11 @@ static inline struct gsm_bts *gsm_gprs_nse_get_bts(struct gsm_gprs_nse *nse)
return (struct gsm_bts *)container_of(nse, struct gsm_bts, gprs.nse);
}
+static inline struct gsm_bts *gsm_gprs_cell_get_bts(struct gsm_gprs_cell *cell)
+{
+ return (struct gsm_bts *)container_of(cell, struct gsm_bts, gprs.cell);
+}
+
struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num);
struct gsm_bts *gsm_bts_num(const struct gsm_network *net, int num);
diff --git a/include/osmo-bts/nm_common_fsm.h b/include/osmo-bts/nm_common_fsm.h
index 9264eea5..c599a210 100644
--- a/include/osmo-bts/nm_common_fsm.h
+++ b/include/osmo-bts/nm_common_fsm.h
@@ -103,3 +103,12 @@ enum nm_gprs_nse_op_fsm_states {
NM_GPRS_NSE_ST_OP_ENABLED,
};
extern struct osmo_fsm nm_gprs_nse_fsm;
+
+/* GPRS CELL */
+enum nm_gprs_cell_op_fsm_states {
+ NM_GPRS_CELL_ST_OP_DISABLED_NOTINSTALLED,
+ NM_GPRS_CELL_ST_OP_DISABLED_DEPENDENCY,
+ NM_GPRS_CELL_ST_OP_DISABLED_OFFLINE,
+ NM_GPRS_CELL_ST_OP_ENABLED,
+};
+extern struct osmo_fsm nm_gprs_cell_fsm;
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index cb5ff501..d904ab17 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -61,6 +61,7 @@ libbts_a_SOURCES = \
nm_bts_fsm.c \
nm_bb_transc_fsm.c \
nm_channel_fsm.c \
+ nm_gprs_cell_fsm.c \
nm_gprs_nse_fsm.c \
nm_radio_carrier_fsm.c \
probes.d \
diff --git a/src/common/bts.c b/src/common/bts.c
index 29f0c562..5845fb28 100644
--- a/src/common/bts.c
+++ b/src/common/bts.c
@@ -271,18 +271,20 @@ struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num)
memcpy(&bts->gprs.nse.timer, bts_nse_timer_default,
sizeof(bts->gprs.nse.timer));
+ /* NM GPRS CELL */
+ bts->gprs.cell.mo.fi = osmo_fsm_inst_alloc(&nm_gprs_cell_fsm, bts, &bts->gprs.cell,
+ LOGL_INFO, NULL);
+ osmo_fsm_inst_update_id_f(bts->gprs.cell.mo.fi, "gprs_cell%d-0", bts->nr);
+ gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, bts->nr, 0, 0xff);
+ memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, sizeof(bts->gprs.cell.rlc_cfg));
+ memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, sizeof(bts->gprs.cell.timer));
+
for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) {
bts->gprs.nsvc[i].bts = bts;
bts->gprs.nsvc[i].id = i;
gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC,
bts->nr, i, 0xff);
}
- memcpy(&bts->gprs.cell.timer, bts_cell_timer_default,
- sizeof(bts->gprs.cell.timer));
- gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL,
- bts->nr, 0, 0xff);
- memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default,
- sizeof(bts->gprs.cell.rlc_cfg));
/* create our primary TRX. It will be initialized during bts_init() */
bts->c0 = gsm_bts_trx_alloc(bts);
@@ -379,9 +381,9 @@ int bts_init(struct gsm_bts *bts)
oml_mo_state_init(&bts->site_mgr.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
oml_mo_state_init(&bts->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
oml_mo_state_init(&bts->gprs.nse.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
+ oml_mo_state_init(&bts->gprs.cell.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED);
/* set BTS attr to dependency */
- oml_mo_state_init(&bts->gprs.cell.mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY);
oml_mo_state_init(&bts->gprs.nsvc[0].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY);
oml_mo_state_init(&bts->gprs.nsvc[1].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY);
@@ -458,7 +460,6 @@ int bts_link_estab(struct gsm_bts *bts)
osmo_fsm_inst_dispatch(bts->gprs.nse.mo.fi, NM_EV_SW_ACT, NULL);
/* those should all be in DEPENDENCY */
- oml_tx_state_changed(&bts->gprs.cell.mo);
oml_tx_state_changed(&bts->gprs.nsvc[0].mo);
oml_tx_state_changed(&bts->gprs.nsvc[1].mo);
diff --git a/src/common/nm_gprs_cell_fsm.c b/src/common/nm_gprs_cell_fsm.c
new file mode 100644
index 00000000..036df3e4
--- /dev/null
+++ b/src/common/nm_gprs_cell_fsm.c
@@ -0,0 +1,258 @@
+/* NM GPRS Cell FSM */
+
+/* (C) 2023 by sysmocom - s.m.f.c. GmbH <info@sysmocom.de>
+ * Author: Pau Espin Pedrol <pespin@sysmocom.de>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public Licecell as published by
+ * the Free Software Foundation; either version 3 of the Licecell, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public Licecell for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public Licecell
+ * along with this program. If not, see <http://www.gnu.org/licecells/>.
+ *
+ */
+
+#include <errno.h>
+#include <unistd.h>
+#include <inttypes.h>
+
+#include <osmocom/core/fsm.h>
+#include <osmocom/core/tdef.h>
+#include <osmocom/gsm/protocol/gsm_12_21.h>
+
+#include <osmo-bts/logging.h>
+#include <osmo-bts/gsm_data.h>
+#include <osmo-bts/bts_model.h>
+#include <osmo-bts/bts.h>
+#include <osmo-bts/rsl.h>
+#include <osmo-bts/nm_common_fsm.h>
+
+#define X(s) (1 << (s))
+
+#define nm_gprs_cell_fsm_state_chg(fi, NEXT_STATE) \
+ osmo_fsm_inst_state_chg(fi, NEXT_STATE, 0, 0)
+
+/* Can the GPRS Cell be enabled (OPSTARTed)? aka should it stay in "Disabled Dependency" state? */
+static bool gprs_cell_can_be_enabled(struct gsm_gprs_cell *cell)
+{
+ struct gsm_bts *bts = gsm_gprs_cell_get_bts(cell);
+ return bts->gprs.nse.mo.nm_state.operational == NM_OPSTATE_ENABLED;
+}
+
+
+//////////////////////////
+// FSM STATE ACTIONS
+//////////////////////////
+
+static void st_op_disabled_notinstalled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+ /* Reset state here: */
+
+ cell->mo.setattr_success = false;
+ cell->mo.opstart_success = false;
+ oml_mo_state_chg(&cell->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_NOT_INSTALLED, NM_STATE_LOCKED);
+}
+
+static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+
+ switch (event) {
+ case NM_EV_SW_ACT:
+ oml_mo_tx_sw_act_rep(&cell->mo);
+ if (gprs_cell_can_be_enabled(cell))
+ nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_DISABLED_OFFLINE);
+ else
+ nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_DISABLED_DEPENDENCY);
+ return;
+ default:
+ OSMO_ASSERT(0);
+ }
+}
+
+static void st_op_disabled_dependency_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+ cell->mo.setattr_success = false;
+ cell->mo.opstart_success = false;
+ oml_mo_state_chg(&cell->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_DEPENDENCY, -1);
+}
+
+static void st_op_disabled_dependency(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+ struct gsm_bts *bts = gsm_gprs_cell_get_bts(cell);
+ struct nm_fsm_ev_setattr_data *setattr_data;
+ int rc;
+
+ switch (event) {
+ case NM_EV_RX_SETATTR:
+ setattr_data = (struct nm_fsm_ev_setattr_data *)data;
+ rc = bts_model_apply_oml(bts, setattr_data->msg,
+ &cell->mo, cell);
+ cell->mo.setattr_success = rc == 0;
+ oml_fom_ack_nack_copy_msg(setattr_data->msg, rc);
+ break;
+ case NM_EV_RX_OPSTART:
+ if (!cell->mo.setattr_success) {
+ oml_mo_opstart_nack(&cell->mo, NM_NACK_CANT_PERFORM);
+ return;
+ }
+ bts_model_opstart(bts, &cell->mo, cell);
+ break;
+ case NM_EV_OPSTART_ACK:
+ cell->mo.opstart_success = true;
+ oml_mo_opstart_ack(&cell->mo);
+ nm_gprs_cell_fsm_state_chg(fi, NM_CHAN_ST_OP_ENABLED);
+ return;
+ case NM_EV_OPSTART_NACK:
+ cell->mo.opstart_success = false;
+ oml_mo_opstart_nack(&cell->mo, (int)(intptr_t)data);
+ return;
+ default:
+ OSMO_ASSERT(0);
+ }
+}
+
+static void st_op_disabled_offline_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+ cell->mo.opstart_success = false;
+ oml_mo_state_chg(&cell->mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE, -1);
+}
+
+static void st_op_disabled_offline(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+ struct gsm_bts *bts = gsm_gprs_cell_get_bts(cell);
+ struct nm_fsm_ev_setattr_data *setattr_data;
+ int rc;
+
+ switch (event) {
+ case NM_EV_RX_SETATTR:
+ setattr_data = (struct nm_fsm_ev_setattr_data *)data;
+ rc = bts_model_apply_oml(bts, setattr_data->msg, &cell->mo, bts);
+ cell->mo.setattr_success = rc == 0;
+ oml_fom_ack_nack_copy_msg(setattr_data->msg, rc);
+ break;
+ case NM_EV_RX_OPSTART:
+ if (!cell->mo.setattr_success) {
+ oml_mo_opstart_nack(&cell->mo, NM_NACK_CANT_PERFORM);
+ return;
+ }
+ bts_model_opstart(bts, &cell->mo, bts);
+ break;
+ case NM_EV_OPSTART_ACK:
+ cell->mo.opstart_success = true;
+ oml_mo_opstart_ack(&cell->mo);
+ nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_ENABLED);
+ break; /* check statechg below */
+ case NM_EV_OPSTART_NACK:
+ cell->mo.opstart_success = false;
+ oml_mo_opstart_nack(&cell->mo, (int)(intptr_t)data);
+ return;
+ default:
+ OSMO_ASSERT(0);
+ }
+}
+
+static void st_op_enabled_on_enter(struct osmo_fsm_inst *fi, uint32_t prev_state)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+ oml_mo_state_chg(&cell->mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK, -1);
+}
+
+static void st_op_enabled(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+}
+
+static void nm_gprs_cell_allstate(struct osmo_fsm_inst *fi, uint32_t event, void *data)
+{
+ struct gsm_gprs_cell *cell = (struct gsm_gprs_cell *)fi->priv;
+
+ switch (event) {
+ case NM_EV_SHUTDOWN_START:
+ /* Announce we start shutting down */
+ oml_mo_state_chg(&cell->mo, -1, -1, NM_STATE_SHUTDOWN);
+ break;
+ case NM_EV_SHUTDOWN_FINISH:
+ nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_DISABLED_NOTINSTALLED);
+ break;
+ default:
+ OSMO_ASSERT(false);
+ }
+}
+
+static struct osmo_fsm_state nm_gprs_cell_fsm_states[] = {
+ [NM_GPRS_CELL_ST_OP_DISABLED_NOTINSTALLED] = {
+ .in_event_mask =
+ X(NM_EV_SW_ACT),
+ .out_state_mask =
+ X(NM_GPRS_CELL_ST_OP_DISABLED_NOTINSTALLED) |
+ X(NM_GPRS_CELL_ST_OP_DISABLED_DEPENDENCY) |
+ X(NM_GPRS_CELL_ST_OP_DISABLED_OFFLINE),
+ .name = "DISABLED_NOTINSTALLED",
+ .onenter = st_op_disabled_notinstalled_on_enter,
+ .action = st_op_disabled_notinstalled,
+ },
+ [NM_GPRS_CELL_ST_OP_DISABLED_DEPENDENCY] = {
+ .in_event_mask =
+ X(NM_EV_RX_SETATTR) |
+ X(NM_EV_RX_OPSTART) | /* backward compatibility, buggy BSC */
+ X(NM_EV_OPSTART_ACK) | /* backward compatibility, buggy BSC */
+ X(NM_EV_OPSTART_NACK), /* backward compatibility, buggy BSC */
+ .out_state_mask =
+ X(NM_CHAN_ST_OP_DISABLED_NOTINSTALLED) |
+ X(NM_CHAN_ST_OP_DISABLED_OFFLINE) |
+ X(NM_CHAN_ST_OP_ENABLED), /* backward compatibility, buggy BSC */
+ .name = "DISABLED_DEPENDENCY",
+ .onenter = st_op_disabled_dependency_on_enter,
+ .action = st_op_disabled_dependency,
+ },
+ [NM_GPRS_CELL_ST_OP_DISABLED_OFFLINE] = {
+ .in_event_mask =
+ X(NM_EV_RX_SETATTR) |
+ X(NM_EV_RX_OPSTART) |
+ X(NM_EV_OPSTART_ACK) |
+ X(NM_EV_OPSTART_NACK),
+ .out_state_mask =
+ X(NM_GPRS_CELL_ST_OP_DISABLED_NOTINSTALLED) |
+ X(NM_GPRS_CELL_ST_OP_ENABLED),
+ .name = "DISABLED_OFFLINE",
+ .onenter = st_op_disabled_offline_on_enter,
+ .action = st_op_disabled_offline,
+ },
+ [NM_GPRS_CELL_ST_OP_ENABLED] = {
+ .in_event_mask = 0,
+ .out_state_mask =
+ X(NM_GPRS_CELL_ST_OP_DISABLED_NOTINSTALLED),
+ .name = "ENABLED",
+ .onenter = st_op_enabled_on_enter,
+ .action = st_op_enabled,
+ },
+};
+
+struct osmo_fsm nm_gprs_cell_fsm = {
+ .name = "NM_GPRS_CELL_OP",
+ .states = nm_gprs_cell_fsm_states,
+ .num_states = ARRAY_SIZE(nm_gprs_cell_fsm_states),
+ .event_names = nm_fsm_event_names,
+ .allstate_action = nm_gprs_cell_allstate,
+ .allstate_event_mask = X(NM_EV_SHUTDOWN_START) |
+ X(NM_EV_SHUTDOWN_FINISH),
+ .log_subsys = DOML,
+};
+
+static __attribute__((constructor)) void nm_gprs_cell_fsm_init(void)
+{
+ OSMO_ASSERT(osmo_fsm_register(&nm_gprs_cell_fsm) == 0);
+}
diff --git a/src/common/nm_gprs_nse_fsm.c b/src/common/nm_gprs_nse_fsm.c
index b6588282..ba956fdd 100644
--- a/src/common/nm_gprs_nse_fsm.c
+++ b/src/common/nm_gprs_nse_fsm.c
@@ -44,10 +44,10 @@
static void ev_dispatch_children(struct gsm_gprs_nse *nse, uint32_t event)
{
- /* TODO: once we have FSMs for GPRS Cell and GPRS NSVC: */
-#if 0
struct gsm_bts *bts = gsm_gprs_nse_get_bts(nse);
osmo_fsm_inst_dispatch(bts->gprs.cell.mo.fi, event, NULL);
+ /* TODO: once we have FSMs for GPRS Cell and GPRS NSVC: */
+#if 0
if (bts->gprs.nsvc[0].fi)
osmo_fsm_inst_dispatch(bts->gprs.nsvc[0].fi, event, NULL);
if (bts->gprs.nsvc[1].fi)
@@ -84,6 +84,7 @@ static void st_op_disabled_notinstalled(struct osmo_fsm_inst *fi, uint32_t event
switch (event) {
case NM_EV_SW_ACT:
oml_mo_tx_sw_act_rep(&nse->mo);
+ ev_dispatch_children(nse, event);
if (nse_can_be_enabled(nse))
nm_gprs_nse_fsm_state_chg(fi, NM_GPRS_NSE_ST_OP_DISABLED_OFFLINE);
else
diff --git a/src/common/oml.c b/src/common/oml.c
index 5e8f0ad4..e23a0876 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -1096,7 +1096,7 @@ static int oml_rx_opstart(struct gsm_bts *bts, struct msgb *msg)
if (!mo->fi) {
/* Some NM objets still don't have FSMs implemented, such as
- * NM_OC_GPRS_CELL or NM_OC_GPRS_NSVC. For those, don't go through FSM:
+ * NM_OC_GPRS_NSVC. For those, don't go through FSM:
*/
return bts_model_opstart(bts, mo, obj);
}
@@ -1292,10 +1292,15 @@ static int oml_ipa_mo_set_attr_nse(void *obj,
return 0;
}
-static int oml_ipa_mo_set_attr_cell(void *obj, const struct tlv_parsed *tp)
+static int oml_ipa_mo_set_attr_cell(void *obj,
+ const struct msgb *msg,
+ const struct tlv_parsed *tp)
{
- struct gsm_bts *bts = container_of(obj, struct gsm_bts, gprs.cell);
- struct gprs_rlc_cfg *rlcc = &bts->gprs.cell.rlc_cfg;
+ struct gsm_gprs_cell *gprs_cell = obj;
+ struct gsm_bts *bts = gsm_gprs_cell_get_bts(gprs_cell);
+ struct gprs_rlc_cfg *rlcc = &gprs_cell->rlc_cfg;
+ struct nm_fsm_ev_setattr_data ev_data;
+ int rc;
const uint8_t *cur;
uint16_t _cur_s;
@@ -1309,8 +1314,7 @@ static int oml_ipa_mo_set_attr_cell(void *obj, const struct tlv_parsed *tp)
}
if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_BVCI, 2))
- bts->gprs.cell.bvci =
- ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_BVCI));
+ gprs_cell->bvci = ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_BVCI));
if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_RLC_CFG, 9)) {
cur = TLVP_VAL(tp, NM_ATT_IPACC_RLC_CFG);
@@ -1357,6 +1361,13 @@ static int oml_ipa_mo_set_attr_cell(void *obj, const struct tlv_parsed *tp)
rlcc->initial_mcs = *TLVP_VAL(tp, NM_ATT_IPACC_RLC_CFG_3);
}
+ ev_data = (struct nm_fsm_ev_setattr_data){
+ .msg = msg,
+ };
+ rc = osmo_fsm_inst_dispatch(gprs_cell->mo.fi, NM_EV_RX_SETATTR, &ev_data);
+ if (rc < 0)
+ return NM_NACK_CANT_PERFORM;
+
osmo_signal_dispatch(SS_GLOBAL, S_NEW_CELL_ATTR, bts);
return 0;
@@ -1464,7 +1475,7 @@ static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg)
rc = oml_ipa_mo_set_attr_nse(obj, msg, &tp);
break;
case NM_OC_GPRS_CELL:
- rc = oml_ipa_mo_set_attr_cell(obj, &tp);
+ rc = oml_ipa_mo_set_attr_cell(obj, msg, &tp);
break;
case NM_OC_GPRS_NSVC:
rc = oml_ipa_mo_set_attr_nsvc(obj, &tp);
@@ -1485,8 +1496,7 @@ static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg)
mo->nm_attr = tp_merged;
/* These are not yet handled through NM FSM: */
- if (mo->obj_class == NM_OC_GPRS_CELL ||
- mo->obj_class == NM_OC_GPRS_NSVC)
+ if (mo->obj_class == NM_OC_GPRS_NSVC)
return oml_fom_ack_nack(msg, rc);
return rc;
}
diff --git a/src/osmo-bts-lc15/oml.c b/src/osmo-bts-lc15/oml.c
index aec639da..fb1dc2d1 100644
--- a/src/osmo-bts-lc15/oml.c
+++ b/src/osmo-bts-lc15/oml.c
@@ -1867,6 +1867,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
case NM_OC_BTS:
case NM_OC_BASEB_TRANSC:
case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL);
break;
case NM_OC_RADIO_CARRIER:
@@ -1877,7 +1878,6 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
ts = (struct gsm_bts_trx_ts*) obj;
rc = ts_opstart(ts);
break;
- case NM_OC_GPRS_CELL:
case NM_OC_GPRS_NSVC:
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK, -1);
rc = oml_mo_opstart_ack(mo);
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index a3e09aa7..66906810 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -1872,6 +1872,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
case NM_OC_BTS:
case NM_OC_BASEB_TRANSC:
case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL);
break;
case NM_OC_RADIO_CARRIER:
@@ -1882,7 +1883,6 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
ts = (struct gsm_bts_trx_ts*) obj;
rc = ts_opstart(ts);
break;
- case NM_OC_GPRS_CELL:
case NM_OC_GPRS_NSVC:
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK, -1);
rc = oml_mo_opstart_ack(mo);
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 08d120bf..73daa2bd 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -1771,6 +1771,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj)
case NM_OC_BTS:
case NM_OC_BASEB_TRANSC:
case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL);
break;
case NM_OC_RADIO_CARRIER:
@@ -1781,7 +1782,6 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj)
ts = (struct gsm_bts_trx_ts*) obj;
rc = ts_connect_as(ts, ts->pchan, pchan_act_compl_cb, NULL);
break;
- case NM_OC_GPRS_CELL:
case NM_OC_GPRS_NSVC:
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, -1, -1);
rc = oml_mo_opstart_ack(mo);
diff --git a/src/osmo-bts-omldummy/bts_model.c b/src/osmo-bts-omldummy/bts_model.c
index 04c4ab98..d85d9cd3 100644
--- a/src/osmo-bts-omldummy/bts_model.c
+++ b/src/osmo-bts-omldummy/bts_model.c
@@ -129,9 +129,9 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj)
case NM_OC_RADIO_CARRIER:
case NM_OC_CHANNEL:
case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL);
break;
- case NM_OC_GPRS_CELL:
case NM_OC_GPRS_NSVC:
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK, -1);
rc = oml_mo_opstart_ack(mo);
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 725ab093..bf65b49e 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -1748,6 +1748,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
case NM_OC_BTS:
case NM_OC_BASEB_TRANSC:
case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL);
break;
case NM_OC_RADIO_CARRIER:
@@ -1758,7 +1759,6 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
ts = (struct gsm_bts_trx_ts*) obj;
rc = ts_opstart(ts);
break;
- case NM_OC_GPRS_CELL:
case NM_OC_GPRS_NSVC:
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK, -1);
rc = oml_mo_opstart_ack(mo);
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index bf8393c6..af7d0349 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -585,6 +585,7 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
case NM_OC_BASEB_TRANSC:
case NM_OC_CHANNEL:
case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL);
break;
case NM_OC_RADIO_CARRIER:
@@ -592,7 +593,6 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo,
trx = (struct gsm_bts_trx *) obj;
rc = trx_init(trx);
break;
- case NM_OC_GPRS_CELL:
case NM_OC_GPRS_NSVC:
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK, -1);
rc = oml_mo_opstart_ack(mo);
diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c
index a69e1d8a..d758a82b 100644
--- a/src/osmo-bts-virtual/bts_model.c
+++ b/src/osmo-bts-virtual/bts_model.c
@@ -164,9 +164,9 @@ int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj)
case NM_OC_BASEB_TRANSC:
case NM_OC_CHANNEL:
case NM_OC_GPRS_NSE:
+ case NM_OC_GPRS_CELL:
rc = osmo_fsm_inst_dispatch(mo->fi, NM_EV_OPSTART_ACK, NULL);
break;
- case NM_OC_GPRS_CELL:
case NM_OC_GPRS_NSVC:
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK, -1);
rc = oml_mo_opstart_ack(mo);