aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-23 23:32:37 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-06-24 00:44:13 +0200
commit8b4700dc967bd751a46b42b5789df9bd5ff0335c (patch)
tree31521544d6f1ecf467bf775a5e72c7e70119613e /src/common/rsl.c
parent73b071b1d24f814979adcc772480ccd4abb878d1 (diff)
Revert "RSL: receive and send multiple SI2q messages"
This reverts commit 340cff51f49f6e798cb5fb6d1b9febdd09902906. osmo-gsm-tester detected a regression due to commit 186c6bac0758b6f94aa101e151664b0dea5d8975, which above commit apparently depends on. Revert this along to avoid conflicts. Change-Id: I15bca30ddc09a7a3044096626016f6130d07636c
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c61
1 files changed, 27 insertions, 34 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index bb05decf..eab93797 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -264,7 +264,7 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg)
{
struct gsm_bts *bts = trx->bts;
struct tlv_parsed tp;
- uint8_t rsl_si, count;
+ uint8_t rsl_si, si2q_index, si2q_count;
enum osmo_sysinfo_type osmo_si;
struct gsm48_system_information_type_2quater *si2q;
struct bitvec bv;
@@ -292,43 +292,36 @@ static int rsl_rx_bcch_info(struct gsm_bts_trx *trx, struct msgb *msg)
len = sizeof(sysinfo_buf_t);
}
bts->si_valid |= (1 << osmo_si);
+ memset(bts->si_buf[osmo_si], 0x2b, sizeof(sysinfo_buf_t));
+ memcpy(bts->si_buf[osmo_si],
+ TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO), len);
+ 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_3 == osmo_si && trx->nr == 0 &&
+ num_agch(trx, "RSL") != 1) {
+ lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]);
+ /* will be reactivated by sapi_deactivate_cb() */
+ trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind =
+ LCHAN_REL_ACT_REACT;
+ }
- switch (osmo_si) {
- case SYSINFO_TYPE_2quater:
- si2q = (struct gsm48_system_information_type_2quater *) TLVP_VAL(&tp, RSL_IE_FULL_BCCH_INFO);
+ if (SYSINFO_TYPE_2quater == osmo_si) {
+ si2q = (struct gsm48_system_information_type_2quater *)
+ bts->si_buf[SYSINFO_TYPE_2quater];
bv.data = si2q->rest_octets;
- bv.data_len = GSM_MACBLOCK_LEN;
+ bv.data_len = 20;
bv.cur_bit = 3;
- bts->si2q_index = (uint8_t) bitvec_get_uint(&bv, 4);
-
- count = (uint8_t) bitvec_get_uint(&bv, 4);
- if (bts->si2q_count && bts->si2q_count != count) {
- LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater count changed while receiving: %u -> %d\n",
- bts->si2q_count, count);
- return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT);
- }
-
- bts->si2q_count = count;
- if (bts->si2q_index > bts->si2q_count) {
- LOGP(DRSL, LOGL_ERROR, " Rx RSL SI2quater witn index %u > count %u\n",
- bts->si2q_index, bts->si2q_count);
- return rsl_tx_error_report(trx, RSL_ERR_IE_CONTENT);
+ si2q_index = (uint8_t) bitvec_get_uint(&bv, 4);
+ si2q_count = (uint8_t) bitvec_get_uint(&bv, 4);
+ if (si2q_index || si2q_count) {
+ LOGP(DRSL, LOGL_ERROR,
+ " Rx RSL SI2quater witn unsupported "
+ "index %u, count %u\n",
+ si2q_index, si2q_count);
+ return rsl_tx_error_report(trx,
+ RSL_ERR_IE_CONTENT);
}
-
- 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);
- break;
- case SYSINFO_TYPE_3:
- if (trx->nr == 0 && num_agch(trx, "RSL") != 1) {
- lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]);
- /* will be reactivated by sapi_deactivate_cb() */
- trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = LCHAN_REL_ACT_REACT;
- } /* intentional fall-through to copy SI3 data */
- 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);
- LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s, %u bytes)\n",
- get_value_string(osmo_sitype_strs, osmo_si), len);
}
} else if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) {
uint16_t len = TLVP_LEN(&tp, RSL_IE_L3_INFO);