diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-09-07 18:34:12 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2023-09-07 18:34:25 +0200 |
commit | 8a1f740dfc74cae8e3660e431b418c7eb5212a98 (patch) | |
tree | 791031be1f9faf0cc90556e0c74b928e73e21687 | |
parent | 1d53d231da25e63362d7b7c8132cd9e2314d0b6f (diff) |
rsl: Improve logic reactivating CCCH upon SI3 BS_AG_BLKS_RES change
The previous logic was wrong, since it was only reactivating the channel
if the provided BS_AG_BLKS_RES was != 1.
Example previously broken scenario:
1- osmo-bsc user sets "channel-descrption bs-ag-blks-res 2" during
osmo-bsc startup in osmo-bsc.cfg
2- osmo-bsc user uses VTY to change it to "channel-descrption
bs-ag-blks-res 1"
3- osmo-bsc user uses VTY to deploy the new config: "bts <0-255>
resend-system-information"
Step 3 would fail beforehand, ending up in a NO-OP.
Change-Id: Ibc118e11c64f04de55cb7b94d8bf2c84b431774d
-rw-r--r-- | src/common/rsl.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c index 972de85a..52317655 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -561,6 +561,7 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) struct gsm48_system_information_type_2quater *si2q; struct bitvec bv; const uint8_t *si_buf; + uint8_t prev_bs_ag_blks_res = 0xff; /* 0xff = unknown */ if (rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)) < 0) { LOGPTRX(trx, DRSL, LOGL_ERROR, "%s(): rsl_tlv_parse() failed\n", __func__); @@ -592,7 +593,8 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s, %u bytes)\n", get_value_string(osmo_sitype_strs, osmo_si), len); - if (SYSINFO_TYPE_2quater == osmo_si) { + switch (osmo_si) { + case SYSINFO_TYPE_2quater: si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO); bv.data = si2q->rest_octets; bv.data_len = GSM_MACBLOCK_LEN; @@ -620,7 +622,15 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) memset(GSM_BTS_SI2Q(bts, bts->si2q_index), GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t)); memcpy(GSM_BTS_SI2Q(bts, bts->si2q_index), TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); - } else { + break; + case SYSINFO_TYPE_3: + /* Keep previous BS_AG_BLKS_RES, used below */ + if (GSM_BTS_HAS_SI(bts, SYSINFO_TYPE_3)) { + const struct gsm48_system_information_type_3 *si3 = GSM_BTS_SI(bts, SYSINFO_TYPE_3); + prev_bs_ag_blks_res = si3->control_channel_desc.bs_ag_blks_res; + } + /* fall-through */ + default: memset(bts->si_buf[osmo_si], GSM_MACBLOCK_PADDING, sizeof(sysinfo_buf_t)); memcpy(bts->si_buf[osmo_si], TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len); } @@ -629,7 +639,9 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg) switch (osmo_si) { case SYSINFO_TYPE_3: - if (trx->nr == 0 && num_agch(trx, "RSL") != 1) { + /* If CCCH config on TS0 changed, reactivate the chan with the new config: */ + if (trx->nr == 0 && trx->bts->c0->ts[0].lchan[CCCH_LCHAN].state != LCHAN_S_NONE && + num_agch(trx, "RSL") != prev_bs_ag_blks_res) { trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_REACT; lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); |