pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28036 )
Change subject: abis_nm: Merge signals S_NM_STATECHG_ADM and S_NM_STATECHG_OPER ......................................................................
abis_nm: Merge signals S_NM_STATECHG_ADM and S_NM_STATECHG_OPER
Having 2 signals makes all code handling them more complex, specially because S_NM_STATE_CHG_OPER could actually provide any change in admin/oper/availability. Both signals already provided the same kind of data (the whole admin/oper/avail state change), so let's simply merge the signals themselves. Current code really doesn't act differently for those 2 signals anyway.
Change-Id: Ia86d20a42b859063d0327b940ba528ec1438b04a --- 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/bts_ipaccess_nanobts.c M src/osmo-bsc/bts_nokia_site.c 7 files changed, 10 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/36/28036/1
diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 084c30d..a2fb1af 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -69,8 +69,7 @@ S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */ S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */ S_NM_TEST_REP, /* GSM 12.21 Test Report */ - S_NM_STATECHG_OPER, /* Operational State changed*/ - S_NM_STATECHG_ADM, /* Administrative State changed */ + S_NM_STATECHG, /* NM Oper/Admin/Avail State changed. arg is struct nm_statechg_signal_data*/ S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */ S_NM_OPSTART_ACK, /* Received OPSTART ACK, arg is struct msgb *oml_msg */ S_NM_OPSTART_NACK, /* Received OPSTART NACK, arg is struct msgb *oml_msg */ @@ -127,6 +126,7 @@
struct abis_om2k_mo;
+/* data for <SS_NM, S_NM_STATECHG>: */ struct nm_statechg_signal_data { struct gsm_bts *bts; uint8_t obj_class; diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index 8f377ae..8e3da49 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -367,8 +367,7 @@ printf("The BTS has nacked the restart. Exiting.\n"); exit(0); break; - case S_NM_STATECHG_OPER: - case S_NM_STATECHG_ADM: + 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); @@ -687,7 +686,7 @@ bootstrap_om(trx); found_trx = 1; } - } else if (evt == S_NM_STATECHG_OPER && + } else if (evt == S_NM_STATECHG && obj_class == NM_OC_RADIO_CARRIER && new_state->availability == NM_AVSTATE_OFF_LINE) { struct gsm_bts_trx *trx = obj; diff --git a/src/osmo-bsc/abis_nm.c b/src/osmo-bsc/abis_nm.c index 980d215..e1e8efa 100644 --- a/src/osmo-bsc/abis_nm.c +++ b/src/osmo-bsc/abis_nm.c @@ -230,7 +230,7 @@ nsd.old_state = nm_state; nsd.new_state = &new_state; nsd.obj_inst = obj_inst; - osmo_signal_dispatch(SS_NM, S_NM_STATECHG_ADM, &nsd); + osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd);
nm_state->administrative = adm_state;
@@ -297,7 +297,7 @@ nsd.new_state = &new_state; nsd.obj_inst = &foh->obj_inst; nsd.bts = bts; - osmo_signal_dispatch(SS_NM, S_NM_STATECHG_OPER, &nsd); + 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) diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index fc40cc4..18d0728 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -994,7 +994,7 @@ nsd.new_state = &new_state; nsd.om2k_mo = mo;
- osmo_signal_dispatch(SS_NM, S_NM_STATECHG_ADM, &nsd); + osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd);
nm_state->availability = new_state.availability; } diff --git a/src/osmo-bsc/acc.c b/src/osmo-bsc/acc.c index 9734a28..755ffd1 100644 --- a/src/osmo-bsc/acc.c +++ b/src/osmo-bsc/acc.c @@ -419,7 +419,7 @@ bool trigger_ramping = false, abort_ramping = false;
/* Handled signals map to an Administrative State Change ACK, or a State Changed Event Report. */ - if (signal != S_NM_STATECHG_ADM && signal != S_NM_STATECHG_OPER) + if (signal != S_NM_STATECHG) return 0;
if (nsd->obj_class != NM_OC_RADIO_CARRIER) diff --git a/src/osmo-bsc/bts_ipaccess_nanobts.c b/src/osmo-bsc/bts_ipaccess_nanobts.c index 54848fb..d2a2545 100644 --- a/src/osmo-bsc/bts_ipaccess_nanobts.c +++ b/src/osmo-bsc/bts_ipaccess_nanobts.c @@ -457,8 +457,7 @@ switch (signal) { case S_NM_SW_ACTIV_REP: return sw_activ_rep(signal_data); - case S_NM_STATECHG_OPER: - case S_NM_STATECHG_ADM: + case S_NM_STATECHG: return nm_statechg_event(signal, signal_data); case S_NM_OPSTART_ACK: nm_rx_opstart_ack(signal_data); diff --git a/src/osmo-bsc/bts_nokia_site.c b/src/osmo-bsc/bts_nokia_site.c index e20519a..4895e6e 100644 --- a/src/osmo-bsc/bts_nokia_site.c +++ b/src/osmo-bsc/bts_nokia_site.c @@ -204,8 +204,7 @@ return 0;
switch (signal) { - case S_NM_STATECHG_OPER: - case S_NM_STATECHG_ADM: + case S_NM_STATECHG: nm_statechg_evt(signal, signal_data); break; default: