From 9ff1c3d6503dd0cfd00cd62a725e8b9dc2188c69 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Wed, 2 Sep 2020 18:29:17 +0700 Subject: gsm_04_08_rr: fix hopping parameters in RR Handover Command A similar problem has already been fixed in [1]: - include GSM48_IE_MA_AFTER instead of GSM48_IE_MA_BEFORE, - fix position of the Mobile Allocation (after time) IE. This problem was uncovered by (not yet merged) TTCN-3 test case verifying handling of the hopping parameters [2]. This change makes it pass. [1] I43ef66c109b107ebcaa1cb6197637701b13b3787 [2] BSC_Tests.TC_fh_params_handover_cmd Change-Id: I7569eead9760b6fd4bb91fc2d8d0b8200bebe374 Related: SYS#4868, OS#4545 --- src/osmo-bsc/gsm_04_08_rr.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c index 69ec4d3f9..be114f007 100644 --- a/src/osmo-bsc/gsm_04_08_rr.c +++ b/src/osmo-bsc/gsm_04_08_rr.c @@ -523,23 +523,24 @@ struct msgb *gsm48_make_ho_cmd(struct gsm_lchan *new_lchan, uint8_t power_comman if (new_lchan->ts->hopping.enabled) { struct gsm_bts *bts = new_lchan->ts->trx->bts; struct gsm48_system_information_type_1 *si1; - uint8_t *cur; si1 = GSM_BTS_SI(bts, SYSINFO_TYPE_1); /* Copy the Cell Chan Desc (ARFCNS in this cell) */ - msgb_put_u8(msg, GSM48_IE_CELL_CH_DESC); - cur = msgb_put(msg, GSM48_HOCMD_CCHDESC_LEN); - memcpy(cur, si1->cell_channel_description, - GSM48_HOCMD_CCHDESC_LEN); - /* Copy the Mobile Allocation */ - msgb_tlv_put(msg, GSM48_IE_MA_BEFORE, - new_lchan->ts->hopping.ma_len, - new_lchan->ts->hopping.ma_data); + msgb_tv_fixed_put(msg, GSM48_IE_CELL_CH_DESC, + GSM48_HOCMD_CCHDESC_LEN, + si1->cell_channel_description); } /* FIXME: optional bits for type of synchronization? */ msgb_tv_put(msg, GSM48_IE_CHANMODE_1, new_lchan->tch_mode); + /* Mobile Allocation (after time), TLV (see 3GPP TS 44.018, 10.5.2.21) */ + if (new_lchan->ts->hopping.enabled) { + msgb_tlv_put(msg, GSM48_IE_MA_AFTER, + new_lchan->ts->hopping.ma_len, + new_lchan->ts->hopping.ma_data); + } + /* in case of multi rate we need to attach a config */ if (new_lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) msgb_tlv_put(msg, GSM48_IE_MUL_RATE_CFG, new_lchan->mr_ms_lv[0], -- cgit v1.2.1