aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-oc2g
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-01 17:21:15 +0200
committerlaforge <laforge@osmocom.org>2020-10-20 13:45:57 +0000
commit6d117891c93da969e0ff8b293bef97c699490f2b (patch)
tree5e899f9420e29c020be6172bfe47680c5986ace6 /src/osmo-bts-oc2g
parentcf7a7fcebf625a14fd764355c3b96fa86c77458c (diff)
Change NM Channel availability Dependency->Offline when RadioCarrier becomes enabled
This fix allows osmo-bts to play fine with newer osmo-bsc NM OML FSMs, which expectes for non-nanoBTS types to follow TS 12.21 guidelines. Until now, BSC simply waited to received State Event Change Dependency for each TS and then sent all required commands (Set Chan Attr, Adm Unlock and Opstart). In newer osmo-bsc FSMs, Opstart is only sent when in Offline state, so we need to transit to that state. For the above mentioned reason, since we pass through the Dependency state anyway after this patch, older osmo-bscs will work correctly too. Change-Id: Id9e61f8d773e6e6170c68b5b836d276c747d8d69
Diffstat (limited to 'src/osmo-bts-oc2g')
-rw-r--r--src/osmo-bts-oc2g/oml.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index f9faacf1..695850c8 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -268,6 +268,8 @@ static int opstart_compl(struct gsm_abis_mo *mo, struct msgb *l1_msg)
{
GsmL1_Prim_t *l1p = msgb_l1prim(l1_msg);
GsmL1_Status_t status = prim_status(l1p);
+ struct gsm_bts_trx *trx = gsm_bts_trx_num(mo->bts, mo->obj_inst.trx_nr);
+ uint8_t tn;
if (status != GsmL1_Status_Success) {
LOGP(DL1C, LOGL_ERROR, "Rx %s, status: %s\n",
@@ -282,6 +284,16 @@ static int opstart_compl(struct gsm_abis_mo *mo, struct msgb *l1_msg)
/* Set to Operational State: Enabled */
oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK);
+ if (mo->obj_class == NM_OC_RADIO_CARRIER) {
+ /* Mark Dependency TS as Offline (ready to be Opstarted) */
+ for (tn = 0; tn < TRX_NR_TS; tn++) {
+ if (trx->ts[tn].mo.nm_state.operational == NM_OPSTATE_DISABLED &&
+ trx->ts[tn].mo.nm_state.availability == NM_AVSTATE_DEPENDENCY) {
+ oml_mo_state_chg(&trx->ts[tn].mo, NM_OPSTATE_DISABLED, NM_AVSTATE_OFF_LINE);
+ }
+ }
+ }
+
/* ugly hack to auto-activate all SAPIs for the BCCH/CCCH on TS0 */
if (mo->obj_class == NM_OC_CHANNEL && mo->obj_inst.trx_nr == 0 &&
mo->obj_inst.ts_nr == 0) {