pespin has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bsc/+/28038 )
Change subject: nm_statechg_signal_data: Convert state ptr to data
......................................................................
nm_statechg_signal_data: Convert state ptr to data
There's no need to use pointers there, it is only asking for errors from
code handling the data structe from the signal by attempting to change
them. Even for mem size point of view it doesn't make sense, since it's
3 byte vs a 4 byte pointer.
Furthermore, this is a preparation for new commit, where the NM object
current state will be updated before emitting the signal. This patch
eases a lot the follow up mentioned patch.
Change-Id: I9b648dfd8392b7b40bfe2b38f3345017481f5129
---
M include/osmocom/bsc/signal.h
M src/ipaccess/ipaccess-config.c
M src/osmo-bsc/abis_nm.c
M src/osmo-bsc/abis_om2000.c
M src/osmo-bsc/acc.c
M src/osmo-bsc/nm_bb_transc_fsm.c
M src/osmo-bsc/nm_bts_fsm.c
M src/osmo-bsc/nm_bts_sm_fsm.c
M src/osmo-bsc/nm_channel_fsm.c
M src/osmo-bsc/nm_gprs_cell_fsm.c
M src/osmo-bsc/nm_gprs_nse_fsm.c
M src/osmo-bsc/nm_gprs_nsvc_fsm.c
M src/osmo-bsc/nm_rcarrier_fsm.c
13 files changed, 98 insertions(+), 102 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h
index f775b5b..17c9c03 100644
--- a/include/osmocom/bsc/signal.h
+++ b/include/osmocom/bsc/signal.h
@@ -131,8 +131,8 @@
struct gsm_bts *bts;
uint8_t obj_class;
void *obj;
- const struct gsm_nm_state *old_state;
- const struct gsm_nm_state *new_state;
+ struct gsm_nm_state old_state;
+ struct gsm_nm_state new_state;
/* This pointer is valid for TS 12.21 MO */
struct abis_om_obj_inst *obj_inst;
diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index 332e349..76f10f5 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -369,8 +369,8 @@
break;
case S_NM_STATECHG:
nsd = signal_data;
- nm_state_event(signal, nsd->obj_class, nsd->obj, nsd->old_state,
- nsd->new_state, nsd->obj_inst);
+ nm_state_event(signal, nsd->obj_class, nsd->obj, &nsd->old_state,
+ &nsd->new_state, nsd->obj_inst);
break;
case S_NM_GET_ATTR_REP:
fprintf(stderr, "Received SIGNAL S_NM_GET_ATTR_REP\n");
diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c
index e1e8efa..cdb1fa6 100644
--- a/src/osmo-bsc/abis_nm.c
+++ b/src/osmo-bsc/abis_nm.c
@@ -210,7 +210,7 @@
static int update_admstate(struct gsm_bts *bts, uint8_t obj_class,
struct abis_om_obj_inst *obj_inst, uint8_t adm_state)
{
- struct gsm_nm_state *nm_state, new_state;
+ struct gsm_nm_state *nm_state;
struct nm_statechg_signal_data nsd;
memset(&nsd, 0, sizeof(nsd));
@@ -222,18 +222,16 @@
if (!nm_state)
return -1;
- new_state = *nm_state;
- new_state.administrative = adm_state;
-
nsd.bts = bts;
nsd.obj_class = obj_class;
- nsd.old_state = nm_state;
- nsd.new_state = &new_state;
+ nsd.old_state = *nm_state;
+ nsd.new_state = *nm_state;
nsd.obj_inst = obj_inst;
+
+ nsd.new_state.administrative = adm_state;
+
osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd);
-
nm_state->administrative = adm_state;
-
return 0;
}
@@ -244,17 +242,27 @@
struct e1inp_sign_link *sign_link = mb->dst;
struct gsm_bts *bts = sign_link->trx->bts;
struct tlv_parsed tp;
- struct gsm_nm_state *nm_state, new_state;
+ struct gsm_nm_state *nm_state;
+ struct nm_statechg_signal_data nsd;
- memset(&new_state, 0, sizeof(new_state));
+ memset(&nsd, 0, sizeof(nsd));
+ nsd.obj = gsm_objclass2obj(bts, foh->obj_class, &foh->obj_inst);
+ if (!nsd.obj) {
+ LOGPFOH(DNM, LOGL_ERROR, foh, "unknown managed object\n");
+ return -EINVAL;
+ }
nm_state = gsm_objclass2nmstate(bts, foh->obj_class, &foh->obj_inst);
if (!nm_state) {
LOGPFOH(DNM, LOGL_ERROR, foh, "unknown managed object\n");
return -EINVAL;
}
- new_state = *nm_state;
+ nsd.obj_class = foh->obj_class;
+ nsd.old_state = *nm_state;
+ nsd.new_state = *nm_state;
+ nsd.obj_inst = &foh->obj_inst;
+ nsd.bts = bts;
if (abis_nm_tlv_parse(&tp, bts, foh->data, oh->length - sizeof(*foh)) < 0)
{
LOGPFOH(DNM, LOGL_ERROR, foh, "%s(): tlv_parse failed\n", __func__);
@@ -263,45 +271,35 @@
DEBUGPFOH(DNM, foh, "STATE CHG: ");
if (TLVP_PRESENT(&tp, NM_ATT_OPER_STATE)) {
- new_state.operational = *TLVP_VAL(&tp, NM_ATT_OPER_STATE);
+ nsd.new_state.operational = *TLVP_VAL(&tp, NM_ATT_OPER_STATE);
DEBUGPC(DNM, "OP_STATE=%s ",
- abis_nm_opstate_name(new_state.operational));
+ abis_nm_opstate_name(nsd.new_state.operational));
}
if (TLVP_PRESENT(&tp, NM_ATT_AVAIL_STATUS)) {
if (TLVP_LEN(&tp, NM_ATT_AVAIL_STATUS) == 0)
- new_state.availability = NM_AVSTATE_OK;
+ nsd.new_state.availability = NM_AVSTATE_OK;
else
- new_state.availability = *TLVP_VAL(&tp, NM_ATT_AVAIL_STATUS);
+ nsd.new_state.availability = *TLVP_VAL(&tp, NM_ATT_AVAIL_STATUS);
DEBUGPC(DNM, "AVAIL=%s(%02x) ",
- abis_nm_avail_name(new_state.availability),
- new_state.availability);
+ abis_nm_avail_name(nsd.new_state.availability),
+ nsd.new_state.availability);
} else
- new_state.availability = NM_AVSTATE_OK;
+ nsd.new_state.availability = NM_AVSTATE_OK;
if (TLVP_PRESENT(&tp, NM_ATT_ADM_STATE)) {
- new_state.administrative = *TLVP_VAL(&tp, NM_ATT_ADM_STATE);
+ nsd.new_state.administrative = *TLVP_VAL(&tp, NM_ATT_ADM_STATE);
DEBUGPC(DNM, "ADM=%2s ",
get_value_string(abis_nm_adm_state_names,
- new_state.administrative));
+ nsd.new_state.administrative));
}
- if ((new_state.administrative != 0 && nm_state->administrative == 0) ||
- new_state.operational != nm_state->operational ||
- new_state.availability != nm_state->availability) {
+ if ((nsd.new_state.administrative != 0 && nsd.old_state.administrative == 0) ||
+ nsd.new_state.operational != nsd.old_state.operational ||
+ nsd.new_state.availability != nsd.old_state.availability) {
DEBUGPC(DNM, "\n");
/* Update the operational state of a given object in our in-memory data
* structures and send an event to the higher layer */
- struct nm_statechg_signal_data nsd;
- nsd.obj = gsm_objclass2obj(bts, foh->obj_class, &foh->obj_inst);
- nsd.obj_class = foh->obj_class;
- nsd.old_state = nm_state;
- nsd.new_state = &new_state;
- nsd.obj_inst = &foh->obj_inst;
- nsd.bts = bts;
osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd);
- nm_state->operational = new_state.operational;
- nm_state->availability = new_state.availability;
- if (nm_state->administrative == 0)
- nm_state->administrative = new_state.administrative;
+ *nm_state = nsd.new_state;
} else {
DEBUGPC(DNM, "(No State change detected)\n");
}
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c
index 18d0728..04c783b 100644
--- a/src/osmo-bsc/abis_om2000.c
+++ b/src/osmo-bsc/abis_om2000.c
@@ -950,13 +950,20 @@
static void update_mo_state(struct gsm_bts *bts, struct abis_om2k_mo *mo, uint8_t
mo_state)
{
struct gsm_nm_state *nm_state = mo2nm_state(bts, mo);
- struct gsm_nm_state new_state;
struct nm_statechg_signal_data nsd;
bool has_enabled_state;
if (!nm_state)
return;
+ memset(&nsd, 0, sizeof(nsd));
+
+ nsd.bts = bts;
+ nsd.obj = mo2obj(bts, mo);
+ nsd.old_state = *nm_state;
+ nsd.new_state = *nm_state;
+ nsd.om2k_mo = mo;
+
switch (mo->class) {
case OM2K_MO_CLS_CF:
case OM2K_MO_CLS_TRXC:
@@ -967,36 +974,27 @@
break;
}
- new_state = *nm_state;
switch (mo_state) {
case OM2K_MOSTATE_RESET:
- new_state.availability = NM_AVSTATE_POWER_OFF;
+ nsd.new_state.availability = NM_AVSTATE_POWER_OFF;
break;
case OM2K_MOSTATE_STARTED:
- new_state.availability = has_enabled_state ? NM_AVSTATE_OFF_LINE : NM_AVSTATE_OK;
+ nsd.new_state.availability = has_enabled_state ? NM_AVSTATE_OFF_LINE : NM_AVSTATE_OK;
break;
case OM2K_MOSTATE_ENABLED:
- new_state.availability = NM_AVSTATE_OK;
+ nsd.new_state.availability = NM_AVSTATE_OK;
break;
case OM2K_MOSTATE_DISABLED:
- new_state.availability = NM_AVSTATE_POWER_OFF;
+ nsd.new_state.availability = NM_AVSTATE_POWER_OFF;
break;
default:
- new_state.availability = NM_AVSTATE_DEGRADED;
+ nsd.new_state.availability = NM_AVSTATE_DEGRADED;
break;
}
- memset(&nsd, 0, sizeof(nsd));
-
- nsd.bts = bts;
- nsd.obj = mo2obj(bts, mo);
- nsd.old_state = nm_state;
- nsd.new_state = &new_state;
- nsd.om2k_mo = mo;
-
osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd);
- nm_state->availability = new_state.availability;
+ nm_state->availability = nsd.new_state.availability;
}
static void update_op_state(struct gsm_bts *bts, const struct abis_om2k_mo *mo, uint8_t
op_state)
diff --git a/src/osmo-bsc/acc.c b/src/osmo-bsc/acc.c
index 1172fd8..61a226c 100644
--- a/src/osmo-bsc/acc.c
+++ b/src/osmo-bsc/acc.c
@@ -427,11 +427,11 @@
trx = nsd->obj;
LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: administrative state %s ->
%s\n",
- get_value_string(abis_nm_adm_state_names, nsd->old_state->administrative),
- get_value_string(abis_nm_adm_state_names, nsd->new_state->administrative));
+ get_value_string(abis_nm_adm_state_names, nsd->old_state.administrative),
+ get_value_string(abis_nm_adm_state_names, nsd->new_state.administrative));
LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: operational state %s -> %s\n",
- abis_nm_opstate_name(nsd->old_state->operational),
- abis_nm_opstate_name(nsd->new_state->operational));
+ abis_nm_opstate_name(nsd->old_state.operational),
+ abis_nm_opstate_name(nsd->new_state.operational));
/* We only care about state changes of the first TRX. */
if (trx->nr != 0)
@@ -445,21 +445,21 @@
}
/* Trigger or abort ACC ramping based on the new state of this TRX. */
- if (nsd->old_state->administrative != nsd->new_state->administrative) {
- switch (nsd->new_state->administrative) {
+ if (nsd->old_state.administrative != nsd->new_state.administrative) {
+ switch (nsd->new_state.administrative) {
case NM_STATE_UNLOCKED:
- if (nsd->old_state->operational != nsd->new_state->operational) {
+ if (nsd->old_state.operational != nsd->new_state.operational) {
/*
* Administrative and operational state have both changed.
* Trigger ramping only if TRX 0 will be both enabled and unlocked.
*/
- if (nsd->new_state->operational == NM_OPSTATE_ENABLED)
+ if (nsd->new_state.operational == NM_OPSTATE_ENABLED)
trigger_ramping = true;
else
LOG_TRX(trx, DRSL, LOGL_DEBUG,
"ACC RAMP: ignoring state change because TRX is "
"transitioning into operational state '%s'\n",
- abis_nm_opstate_name(nsd->new_state->operational));
+ abis_nm_opstate_name(nsd->new_state.operational));
} else {
/*
* Operational state has not changed.
@@ -479,24 +479,24 @@
case NM_STATE_NULL:
default:
LOG_TRX(trx, DRSL, LOGL_ERROR, "ACC RAMP: unrecognized administrative state
'0x%x' "
- "reported for TRX 0\n", nsd->new_state->administrative);
+ "reported for TRX 0\n", nsd->new_state.administrative);
break;
}
}
- if (nsd->old_state->operational != nsd->new_state->operational) {
- switch (nsd->new_state->operational) {
+ if (nsd->old_state.operational != nsd->new_state.operational) {
+ switch (nsd->new_state.operational) {
case NM_OPSTATE_ENABLED:
- if (nsd->old_state->administrative != nsd->new_state->administrative) {
+ if (nsd->old_state.administrative != nsd->new_state.administrative) {
/*
* Administrative and operational state have both changed.
* Trigger ramping only if TRX 0 will be both enabled and unlocked.
*/
- if (nsd->new_state->administrative == NM_STATE_UNLOCKED)
+ if (nsd->new_state.administrative == NM_STATE_UNLOCKED)
trigger_ramping = true;
else
LOG_TRX(trx, DRSL, LOGL_DEBUG, "ACC RAMP: ignoring state change "
"because TRX is transitioning into administrative state '%s'\n",
- get_value_string(abis_nm_adm_state_names, nsd->new_state->administrative));
+ get_value_string(abis_nm_adm_state_names, nsd->new_state.administrative));
} else {
/*
* Administrative state has not changed.
@@ -516,7 +516,7 @@
case NM_OPSTATE_NULL:
default:
LOG_TRX(trx, DRSL, LOGL_ERROR, "ACC RAMP: unrecognized operational state
'0x%x' "
- "reported for TRX 0\n", nsd->new_state->administrative);
+ "reported for TRX 0\n", nsd->new_state.administrative);
break;
}
}
diff --git a/src/osmo-bsc/nm_bb_transc_fsm.c b/src/osmo-bsc/nm_bb_transc_fsm.c
index dc8c682..a4cef9c 100644
--- a/src/osmo-bsc/nm_bb_transc_fsm.c
+++ b/src/osmo-bsc/nm_bb_transc_fsm.c
@@ -64,7 +64,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/*should not happen... */
nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED);
@@ -149,7 +149,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED);
@@ -199,7 +199,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_bb_transc_fsm_state_chg(fi, NM_BB_TRANSC_ST_OP_ENABLED);
return;
@@ -253,7 +253,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
diff --git a/src/osmo-bsc/nm_bts_fsm.c b/src/osmo-bsc/nm_bts_fsm.c
index 5216ec8..79ae6a7 100644
--- a/src/osmo-bsc/nm_bts_fsm.c
+++ b/src/osmo-bsc/nm_bts_fsm.c
@@ -66,7 +66,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/*should not happen... */
nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
@@ -177,7 +177,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
@@ -229,7 +229,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_bts_fsm_state_chg(fi, NM_BTS_ST_OP_ENABLED);
return;
@@ -285,7 +285,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
diff --git a/src/osmo-bsc/nm_bts_sm_fsm.c b/src/osmo-bsc/nm_bts_sm_fsm.c
index b99fb53..03bf43c 100644
--- a/src/osmo-bsc/nm_bts_sm_fsm.c
+++ b/src/osmo-bsc/nm_bts_sm_fsm.c
@@ -64,7 +64,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* nanobts always go directly into Reported ENABLED state during
startup, but we still need to OPSTART it, otherwise it won't
@@ -107,7 +107,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED);
return;
@@ -147,7 +147,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_bts_sm_fsm_state_chg(fi, NM_BTS_SM_ST_OP_ENABLED);
return;
@@ -178,7 +178,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
diff --git a/src/osmo-bsc/nm_channel_fsm.c b/src/osmo-bsc/nm_channel_fsm.c
index a4f0839..680e658 100644
--- a/src/osmo-bsc/nm_channel_fsm.c
+++ b/src/osmo-bsc/nm_channel_fsm.c
@@ -65,7 +65,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/*should not happen... */
nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_ENABLED);
@@ -138,7 +138,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_ENABLED);
@@ -187,7 +187,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_chan_fsm_state_chg(fi, NM_CHAN_ST_OP_ENABLED);
return;
@@ -241,7 +241,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
diff --git a/src/osmo-bsc/nm_gprs_cell_fsm.c b/src/osmo-bsc/nm_gprs_cell_fsm.c
index cf91397..9a656e1 100644
--- a/src/osmo-bsc/nm_gprs_cell_fsm.c
+++ b/src/osmo-bsc/nm_gprs_cell_fsm.c
@@ -64,7 +64,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_ENABLED);
@@ -148,7 +148,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_ENABLED);
@@ -198,7 +198,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_gprs_cell_fsm_state_chg(fi, NM_GPRS_CELL_ST_OP_ENABLED);
return;
@@ -252,7 +252,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
diff --git a/src/osmo-bsc/nm_gprs_nse_fsm.c b/src/osmo-bsc/nm_gprs_nse_fsm.c
index 2d6e13b..4ad623e 100644
--- a/src/osmo-bsc/nm_gprs_nse_fsm.c
+++ b/src/osmo-bsc/nm_gprs_nse_fsm.c
@@ -65,7 +65,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_gprs_nse_fsm_state_chg(fi, NM_GPRS_NSE_ST_OP_ENABLED);
@@ -149,7 +149,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_gprs_nse_fsm_state_chg(fi, NM_GPRS_NSE_ST_OP_ENABLED);
@@ -199,7 +199,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_gprs_nse_fsm_state_chg(fi, NM_GPRS_NSE_ST_OP_ENABLED);
return;
@@ -253,7 +253,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
diff --git a/src/osmo-bsc/nm_gprs_nsvc_fsm.c b/src/osmo-bsc/nm_gprs_nsvc_fsm.c
index c2b7db3..75cf4d6 100644
--- a/src/osmo-bsc/nm_gprs_nsvc_fsm.c
+++ b/src/osmo-bsc/nm_gprs_nsvc_fsm.c
@@ -68,7 +68,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_gprs_nsvc_fsm_state_chg(fi, NM_GPRS_NSVC_ST_OP_ENABLED);
@@ -164,7 +164,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_gprs_nsvc_fsm_state_chg(fi, NM_GPRS_NSVC_ST_OP_ENABLED);
@@ -216,7 +216,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_gprs_nsvc_fsm_state_chg(fi, NM_GPRS_NSVC_ST_OP_ENABLED);
return;
@@ -270,7 +270,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
diff --git a/src/osmo-bsc/nm_rcarrier_fsm.c b/src/osmo-bsc/nm_rcarrier_fsm.c
index 0cdba68..f3c230d 100644
--- a/src/osmo-bsc/nm_rcarrier_fsm.c
+++ b/src/osmo-bsc/nm_rcarrier_fsm.c
@@ -64,7 +64,7 @@
break;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/*should not happen... */
nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_ENABLED);
@@ -144,7 +144,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
/* should not happen... */
nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_ENABLED);
@@ -193,7 +193,7 @@
return;
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED) {
nm_rcarrier_fsm_state_chg(fi, NM_RCARRIER_ST_OP_ENABLED);
return;
@@ -238,7 +238,7 @@
switch (event) {
case NM_EV_STATE_CHG_REP:
nsd = (struct nm_statechg_signal_data *)data;
- new_state = nsd->new_state;
+ new_state = &nsd->new_state;
if (new_state->operational == NM_OPSTATE_ENABLED)
return;
switch (new_state->availability) { /* operational = DISABLED */
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/28038
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I9b648dfd8392b7b40bfe2b38f3345017481f5129
Gerrit-Change-Number: 28038
Gerrit-PatchSet: 4
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged