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@sysmocom.de>
This commit is contained in:
parent
70fdd24d04
commit
8b1a2f8cd7
|
@ -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 @@ struct gsm_bts_trx_ts;
|
|||
|
||||
#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_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, 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,
|
||||
|
|
|
@ -226,11 +226,16 @@ static void lchan_deact_tmr_cb(void *data)
|
|||
|
||||
|
||||
/* 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_trx *trx, enum osmo_sysinfo_type si_type, const uint8_t *data, int len)
|
||||
{
|
||||
struct abis_rsl_dchan_hdr *dh;
|
||||
const struct gsm_bts *bts = trx->bts;
|
||||
struct msgb *msg = rsl_msgb_alloc();
|
||||
uint8_t 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);
|
||||
|
|
|
@ -119,8 +119,7 @@ static int rsl_si(struct gsm_bts_trx *trx, enum osmo_sysinfo_type i, int si_len)
|
|||
rc = rsl_bcch_info(trx, i, (const uint8_t *)GSM_BTS_SI2Q(bts, j), GSM_MACBLOCK_LEN);
|
||||
break;
|
||||
default:
|
||||
rc = rsl_bcch_info(trx, osmo_sitype2rsl(i),
|
||||
GSM_BTS_SI(bts, i), si_len);
|
||||
rc = rsl_bcch_info(trx, i, GSM_BTS_SI(bts, i), si_len);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -139,6 +138,9 @@ int gsm_bts_trx_set_system_infos(struct gsm_bts_trx *trx)
|
|||
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) {
|
||||
|
|
Loading…
Reference in New Issue