dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28896 )
Change subject: abis_om2000: duplicate nmstate of bb_trxc mo to trx mo ......................................................................
abis_om2000: duplicate nmstate of bb_trxc mo to trx mo
In OM2000 a separate bb_trxc MO does not exist to archive better compatibilty towards classic ABIS and its MOs lets mirror the nmstate of the trx MO to the trxc_mo to make it look like if it were present.
Change-Id: I4611d8af16a30725308bd527098b12a356bfde9f Related: OS#5634 --- M src/osmo-bsc/abis_om2000.c 1 file changed, 28 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/96/28896/1
diff --git a/src/osmo-bsc/abis_om2000.c b/src/osmo-bsc/abis_om2000.c index 5026b5e..f61b684 100644 --- a/src/osmo-bsc/abis_om2000.c +++ b/src/osmo-bsc/abis_om2000.c @@ -51,11 +51,13 @@ static inline void abis_om2000_fsm_becomes_enabled(struct gsm_bts_trx *trx) { nm_obj_fsm_becomes_enabled_disabled(trx->bts, trx, NM_OC_RADIO_CARRIER, true); + nm_obj_fsm_becomes_enabled_disabled(trx->bts, &trx->bb_transc, NM_OC_BASEB_TRANSC, true); }
static inline void abis_om2000_fsm_becomes_disabled(struct gsm_bts_trx *trx) { nm_obj_fsm_becomes_enabled_disabled(trx->bts, trx, NM_OC_RADIO_CARRIER, false); + nm_obj_fsm_becomes_enabled_disabled(trx->bts, &trx->bb_transc, NM_OC_BASEB_TRANSC, false); }
/* FIXME: move to libosmocore */ @@ -876,6 +878,25 @@ return mo_buf; }
+/* The OM2000 -> 12.21 mapping we do doesn't have separate bb_transc MO, + * for compatibility reasons we pretend to have it anyway and mirror the + * mo state of the TRXC on it. */ +static void duplicate_trxc_nm_state(struct gsm_bts *bts, const struct abis_om2k_mo *mo) +{ + struct gsm_bts_trx *trx; + + if (mo->class != OM2K_MO_CLS_TRXC) + return; + + trx = gsm_bts_trx_num(bts, mo->inst); + if (!trx) + return; + + printf("dup!\n"); + memcpy(&trx->bb_transc.mo.nm_state, &trx->mo.nm_state, sizeof(trx->bb_transc.mo.nm_state)); + +} + /* resolve the gsm_nm_state data structure for a given MO */ static struct gsm_nm_state *mo2nm_state(struct gsm_bts *bts, const struct abis_om2k_mo *mo) { @@ -1008,6 +1029,7 @@ /* Update current state before emitting signal: */ nm_state->availability = nsd.new_state.availability;
+ duplicate_trxc_nm_state(bts, mo); osmo_signal_dispatch(SS_NM, S_NM_STATECHG, &nsd); }
@@ -1033,6 +1055,7 @@ }
nm_state->operational = new_state.operational; + duplicate_trxc_nm_state(bts, mo); }
static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg) @@ -2216,6 +2239,11 @@ /* See e1_config:bts_isdn_sign_link() / OS#4914 */ otfp->trx->mo.nm_state.administrative = NM_STATE_UNLOCKED;
+ /* The OM2000 -> 12.21 mapping we do doesn't have separate bb_transc MO, + * for compatibility reasons we pretend to have it anyway and mirror the + * mo state of the TRXC on it. */ + otfp->trx->bb_transc.mo.nm_state.administrative = NM_STATE_UNLOCKED; + abis_om2000_fsm_becomes_enabled(otfp->trx);
if (fi->proc.parent)