[PATCH] openbsc[master]: bsc_init: Forget which SIs are valid for the trx

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

Max gerrit-no-reply at lists.osmocom.org
Fri Jun 2 09:00:24 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/2819

to look at the new patch set (#2).

bsc_init: Forget which SIs are valid for the trx

Previously the SI generation lead to setting the BCCH SIs for all TRX in
a multi-trx setup. This is because we create the SIs globally but
si_valid appears to be limited to the 'current' trx. Warn if we attempt
to set SIs for the BCCH on a trx that does not have a BCCH.

Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f
Tweaked-by: Max <msuraev at sysmocom.de>
---
M openbsc/include/openbsc/abis_rsl.h
M openbsc/src/libbsc/abis_rsl.c
M openbsc/src/libbsc/bsc_init.c
3 files changed, 12 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/19/2819/2

diff --git a/openbsc/include/openbsc/abis_rsl.h b/openbsc/include/openbsc/abis_rsl.h
index e61d4ea..cf54dec 100644
--- a/openbsc/include/openbsc/abis_rsl.h
+++ b/openbsc/include/openbsc/abis_rsl.h
@@ -25,7 +25,7 @@
 #include <stdbool.h>
 #include <osmocom/gsm/protocol/gsm_08_58.h>
 #include <osmocom/gsm/gsm_utils.h>
-
+#include <osmocom/gsm/sysinfo.h>
 #include <osmocom/core/msgb.h>
 
 struct gsm_bts;
@@ -35,8 +35,7 @@
 
 #define GSM48_LEN2PLEN(a)	(((a) << 2) | 1)
 
-int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type,
-		  const uint8_t *data, int len);
+int rsl_bcch_info(const struct gsm_bts *bts, const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, int len);
 int rsl_sacch_filling(struct gsm_bts_trx *trx, uint8_t type,
 		      const uint8_t *data, int len);
 int rsl_chan_activate(struct gsm_bts_trx *trx, uint8_t chan_nr,
diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c
index 7ee19a7..8156ca6 100644
--- a/openbsc/src/libbsc/abis_rsl.c
+++ b/openbsc/src/libbsc/abis_rsl.c
@@ -226,11 +226,15 @@
 
 
 /* Send a BCCH_INFO message as per Chapter 8.5.1 */
-int rsl_bcch_info(struct gsm_bts_trx *trx, uint8_t type,
-		  const uint8_t *data, int len)
+int rsl_bcch_info(const struct gsm_bts *bts, const struct gsm_bts_trx *trx, enum osmo_sysinfo_type si_type, int len)
 {
 	struct abis_rsl_dchan_hdr *dh;
 	struct msgb *msg = rsl_msgb_alloc();
+	uint8_t *data = GSM_BTS_SI(bts, si_type), type = osmo_sitype2rsl(si_type);
+
+	if (bts->c0 != trx)
+		LOGP(DRR, LOGL_ERROR, "Attempting to set BCCH SI%s on wrong BTS%u/TRX%u\n",
+		     get_value_string(osmo_sitype_strs, si_type), bts->nr, trx->nr);
 
 	dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof*dh);
 	init_dchan_hdr(dh, RSL_MT_BCCH_INFO);
diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index caec800..db18070 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -115,8 +115,7 @@
 				       GSM_BTS_SI(bts, i), si_len);
 		break;
 	default:
-		rc = rsl_bcch_info(trx, osmo_sitype2rsl(i),
-				   GSM_BTS_SI(bts, i), si_len);
+		rc = rsl_bcch_info(bts, trx, i, si_len);
 		break;
 	}
 
@@ -135,6 +134,9 @@
 			ms_pwr_ctl_lvl(bts->band, bts->ms_max_power);
 	bts->si_common.cell_sel_par.neci = bts->network->neci;
 
+	/* Zero, forget the state of the SIs */
+	bts->si_valid = 0;
+
 	/* First, we determine which of the SI messages we actually need */
 
 	if (trx == bts->c0) {

-- 
To view, visit https://gerrit.osmocom.org/2819
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ie0e288252a2e7709c4dae16b96a0b1512278847f
Gerrit-PatchSet: 2
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list