Change in osmo-bts[master]: Change NM Channel availability Dependency->Offline when RadioCarrier ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Fri Oct 2 17:58:42 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/20407 )


Change subject: Change NM Channel availability Dependency->Offline when RadioCarrier becomes enabled
......................................................................

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
---
M src/osmo-bts-litecell15/oml.c
M src/osmo-bts-oc2g/oml.c
M src/osmo-bts-octphy/l1_oml.c
M src/osmo-bts-omldummy/bts_model.c
M src/osmo-bts-sysmo/oml.c
M src/osmo-bts-trx/l1_if.c
M src/osmo-bts-virtual/bts_model.c
7 files changed, 83 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/20407/1

diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index f14f808..194ba7f 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -268,6 +268,8 @@
 {
 	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 @@
 	/* 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) {
diff --git a/src/osmo-bts-oc2g/oml.c b/src/osmo-bts-oc2g/oml.c
index f9faacf..695850c 100644
--- a/src/osmo-bts-oc2g/oml.c
+++ b/src/osmo-bts-oc2g/oml.c
@@ -268,6 +268,8 @@
 {
 	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 @@
 	/* 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) {
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 300d618..7c203eb 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -185,11 +185,23 @@
 
 static int opstart_compl(struct gsm_abis_mo *mo)
 {
+	struct gsm_bts_trx *trx = gsm_bts_trx_num(mo->bts, mo->obj_inst.trx_nr);
+	uint8_t tn;
 	/* TODO: Send NACK in case of error! */
 
 	/* 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);
+			}
+		}
+	}
+
 	/* 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 == 7) {
diff --git a/src/osmo-bts-omldummy/bts_model.c b/src/osmo-bts-omldummy/bts_model.c
index 311b640..01b78d4 100644
--- a/src/osmo-bts-omldummy/bts_model.c
+++ b/src/osmo-bts-omldummy/bts_model.c
@@ -125,9 +125,22 @@
 int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj)
 {
 	int rc;
+	struct gsm_bts_trx* trx;
+	uint8_t tn;
 
 	switch (mo->obj_class) {
 	case NM_OC_RADIO_CARRIER:
+		trx = (struct gsm_bts_trx*) obj;
+		/* 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);
+			}
+		}
+		oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK);
+		rc = oml_mo_opstart_ack(mo);
+		break;
 	case NM_OC_CHANNEL:
 	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 472a7ae..cc53d72 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -267,6 +267,8 @@
 {
 	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",
@@ -281,6 +283,16 @@
 	/* 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) {
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index bd3661c..8ad004e 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -199,6 +199,7 @@
 	struct phy_instance *pinst = trx_phy_instance(trx);
 	struct trx_l1h *l1h = pinst->u.osmotrx.hdl;
 	int rc;
+	uint8_t tn;
 
 	rc = osmo_fsm_inst_dispatch(l1h->provision_fi, TRX_PROV_EV_CFG_ENABLE, (void*)(intptr_t)true);
 	if (rc != 0)
@@ -207,6 +208,14 @@
 	if (trx == trx->bts->c0)
 		lchan_init_lapdm(&trx->ts[0].lchan[CCCH_LCHAN]);
 
+	/* 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);
+		}
+	}
+
 	/* Send OPSTART ack */
 	return oml_mo_opstart_ack(&trx->mo);
 }
diff --git a/src/osmo-bts-virtual/bts_model.c b/src/osmo-bts-virtual/bts_model.c
index dfce81f..74ad31d 100644
--- a/src/osmo-bts-virtual/bts_model.c
+++ b/src/osmo-bts-virtual/bts_model.c
@@ -139,9 +139,22 @@
 int bts_model_opstart(struct gsm_bts *bts, struct gsm_abis_mo *mo, void *obj)
 {
 	int rc;
+	struct gsm_bts_trx* trx;
+	uint8_t tn;
 
 	switch (mo->obj_class) {
 	case NM_OC_RADIO_CARRIER:
+		trx = (struct gsm_bts_trx*) obj;
+		/* 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);
+			}
+		}
+		oml_mo_state_chg(mo, NM_OPSTATE_ENABLED, NM_AVSTATE_OK);
+		rc = oml_mo_opstart_ack(mo);
+		break;
 	case NM_OC_CHANNEL:
 	case NM_OC_SITE_MANAGER:
 	case NM_OC_BASEB_TRANSC:

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/20407
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Id9e61f8d773e6e6170c68b5b836d276c747d8d69
Gerrit-Change-Number: 20407
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201002/83877c2f/attachment.htm>


More information about the gerrit-log mailing list