From b8425680391c96b3bb3635cbfdfca4931e85d70b Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Tue, 30 Jun 2020 17:40:20 +0700 Subject: gsm_04_08_rr: fix hopping parameters in RR Assignment Command According to 3GPP TS 44.018, section 9.1.2.4, if at least one of the Channel Description IEs indicates frequency hopping, one and only one of the following IEs shall be present: - Mobile Allocation, after time (see 10.5.2.21); - Frequency List, after time (see 10.5.2.13). For some reason, osmo-bsc includes the GSM48_IE_MA_BEFORE instead of GSM48_IE_MA_AFTER - fix this. According to section 9.1.2.6 of the same document, if any of the Mobile Allocation IEs (before/after time) is present, then the network must ensure that either the MS has already received the the proper reference cell frequency list (CA), or that the Cell Channel Description IE (see 10.5.2.1b) is present. Without this IE, the phone I was using in my testing setup sends RR Status message with cause #100 "conditional IE error". Fortunately, we already have generate_cell_chan_list(), since we also need to include the Cell Channel Description in SI Type 1. Change-Id: I43ef66c109b107ebcaa1cb6197637701b13b3787 Related: SYS#4868, OS#4545, OS#4546 --- src/osmo-bsc/gsm_04_08_rr.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 8a74aabac..f47c31f41 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -43,6 +43,7 @@ #include #include #include +#include int gsm48_sendmsg(struct msgb *msg) @@ -576,13 +577,18 @@ int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, gsm48_lchan2chan_desc(&ass->chan_desc, lchan); ass->power_command = power_command; - /* optional: cell channel description */ + /* Cell Channel Description (freq. hopping), TV (see 3GPP TS 44.018, 10.5.2.1b) */ + if (lchan->ts->hopping.enabled) { + uint8_t *chan_desc = msgb_put(msg, 1 + 16); /* tag + fixed length */ + generate_cell_chan_list(chan_desc + 1, dest_lchan->ts->trx->bts); + chan_desc[0] = GSM48_IE_CELL_CH_DESC; + } msgb_tv_put(msg, GSM48_IE_CHANMODE_1, lchan->tch_mode); - /* mobile allocation in case of hopping */ + /* Mobile Allocation (freq. hopping), TLV (see 3GPP TS 44.018, 10.5.2.21) */ if (lchan->ts->hopping.enabled) { - msgb_tlv_put(msg, GSM48_IE_MA_BEFORE, lchan->ts->hopping.ma_len, + msgb_tlv_put(msg, GSM48_IE_MA_AFTER, lchan->ts->hopping.ma_len, lchan->ts->hopping.ma_data); } -- cgit v1.2.3