Change in osmo-bsc[master]: osmo_bsc_main: call bootstrap_bts when OML TEI comes up

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/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Oct 13 03:44:35 UTC 2021


dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/25767 )


Change subject: osmo_bsc_main: call bootstrap_bts when OML TEI comes up
......................................................................

osmo_bsc_main: call bootstrap_bts when OML TEI comes up

At the moment bootstrap_bts is called only once on startup. When a new
BTY is set up during runtime bootstrap_bts is not called. This means
that some parameters of the BTS stay uninitalized until osmo-bsc is
restarted. Lets rather call bootstrap_bts() when the OML TEI of the BTS
comes up.

Change-Id: Ie599f809623efd6ea4ab3f39294195fc1ef84b85
Related: OS#5369
---
M src/osmo-bsc/osmo_bsc_main.c
1 file changed, 55 insertions(+), 52 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/25767/1

diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c
index 92b7475..a133b9e 100644
--- a/src/osmo-bsc/osmo_bsc_main.c
+++ b/src/osmo-bsc/osmo_bsc_main.c
@@ -391,53 +391,6 @@
 	osmo_timer_schedule(&update_connection_stats_timer, 1, 0);
 }
 
-/* Callback function to be called every time we receive a signal from INPUT */
-static int inp_sig_cb(unsigned int subsys, unsigned int signal,
-		      void *handler_data, void *signal_data)
-{
-	struct input_signal_data *isd = signal_data;
-	struct gsm_bts_trx *trx = isd->trx;
-
-	if (subsys != SS_L_INPUT)
-		return -EINVAL;
-
-	LOGP(DLMI, LOGL_DEBUG, "%s(): Input signal '%s' received\n", __func__,
-		get_value_string(e1inp_signal_names, signal));
-	switch (signal) {
-	case S_L_INP_TEI_UP:
-		if (isd->link_type == E1INP_SIGN_OML) {
-			/* Generate Mobile Allocation bit-masks for all timeslots.
-			 * This needs to be done here, because it's used for TS configuration. */
-			generate_ma_for_bts(trx->bts);
-		}
-		if (isd->link_type == E1INP_SIGN_RSL)
-			bootstrap_rsl(trx);
-		break;
-	case S_L_INP_TEI_DN:
-		LOG_TRX(trx, DLMI, LOGL_ERROR, "Lost E1 %s link\n", e1inp_signtype_name(isd->link_type));
-
-		if (isd->link_type == E1INP_SIGN_OML) {
-			rate_ctr_inc(rate_ctr_group_get_ctr(trx->bts->bts_ctrs, BTS_CTR_BTS_OML_FAIL));
-			all_ts_dispatch_event(trx, TS_EV_OML_DOWN);
-		} else if (isd->link_type == E1INP_SIGN_RSL) {
-			rate_ctr_inc(rate_ctr_group_get_ctr(trx->bts->bts_ctrs, BTS_CTR_BTS_RSL_FAIL));
-			acc_ramp_abort(&trx->bts->acc_ramp);
-			all_ts_dispatch_event(trx, TS_EV_RSL_DOWN);
-			if (trx->nr == 0)
-				osmo_timer_del(&trx->bts->cbch_timer);
-		}
-
-		gsm_bts_sm_mo_reset(trx->bts->site_mgr);
-
-		abis_nm_clear_queue(trx->bts);
-		break;
-	default:
-		break;
-	}
-
-	return 0;
-}
-
 static int bootstrap_bts(struct gsm_bts *bts)
 {
 	struct gsm_bts_trx *trx;
@@ -516,6 +469,61 @@
 	return 0;
 }
 
+/* Callback function to be called every time we receive a signal from INPUT */
+static int inp_sig_cb(unsigned int subsys, unsigned int signal,
+		      void *handler_data, void *signal_data)
+{
+	struct input_signal_data *isd = signal_data;
+	struct gsm_bts_trx *trx = isd->trx;
+	int rc;
+
+	if (subsys != SS_L_INPUT)
+		return -EINVAL;
+
+	LOGP(DLMI, LOGL_DEBUG, "%s(): Input signal '%s' received\n", __func__,
+		get_value_string(e1inp_signal_names, signal));
+	switch (signal) {
+	case S_L_INP_TEI_UP:
+		if (isd->link_type == E1INP_SIGN_OML) {
+			/* Check parameters and apply vty config dependant parameters */
+			rc = bootstrap_bts(trx->bts);
+			if (rc < 0) {
+				LOGP(DNM, LOGL_FATAL, "Error bootstrapping BTS\n");
+				return rc;
+			}
+
+			/* Generate Mobile Allocation bit-masks for all timeslots.
+			 * This needs to be done here, because it's used for TS configuration. */
+			generate_ma_for_bts(trx->bts);
+		}
+		if (isd->link_type == E1INP_SIGN_RSL)
+			bootstrap_rsl(trx);
+		break;
+	case S_L_INP_TEI_DN:
+		LOG_TRX(trx, DLMI, LOGL_ERROR, "Lost E1 %s link\n", e1inp_signtype_name(isd->link_type));
+
+		if (isd->link_type == E1INP_SIGN_OML) {
+			rate_ctr_inc(rate_ctr_group_get_ctr(trx->bts->bts_ctrs, BTS_CTR_BTS_OML_FAIL));
+			all_ts_dispatch_event(trx, TS_EV_OML_DOWN);
+		} else if (isd->link_type == E1INP_SIGN_RSL) {
+			rate_ctr_inc(rate_ctr_group_get_ctr(trx->bts->bts_ctrs, BTS_CTR_BTS_RSL_FAIL));
+			acc_ramp_abort(&trx->bts->acc_ramp);
+			all_ts_dispatch_event(trx, TS_EV_RSL_DOWN);
+			if (trx->nr == 0)
+				osmo_timer_del(&trx->bts->cbch_timer);
+		}
+
+		gsm_bts_sm_mo_reset(trx->bts->site_mgr);
+
+		abis_nm_clear_queue(trx->bts);
+		break;
+	default:
+		break;
+	}
+
+	return 0;
+}
+
 static int bsc_network_configure(const char *config_file)
 {
 	struct gsm_bts *bts;
@@ -537,11 +545,6 @@
 	osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL);
 
 	llist_for_each_entry(bts, &bsc_gsmnet->bts_list, list) {
-		rc = bootstrap_bts(bts);
-		if (rc < 0) {
-			LOGP(DNM, LOGL_FATAL, "Error bootstrapping BTS\n");
-			return rc;
-		}
 		rc = e1_reconfig_bts(bts);
 		if (rc < 0) {
 			LOGP(DNM, LOGL_FATAL, "Error enabling E1 input driver\n");

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie599f809623efd6ea4ab3f39294195fc1ef84b85
Gerrit-Change-Number: 25767
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211013/9d76e117/attachment.htm>


More information about the gerrit-log mailing list