fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-bsc/+/27507 )
Change subject: gsm48_make_ho_cmd(): optionally add Cipher Mode Setting IE
......................................................................
gsm48_make_ho_cmd(): optionally add Cipher Mode Setting IE
According to 3GPP TS 44.018, section 9.1.15, the RR Handover Command
message may optionally contain the Cipher Mode Setting IE (10.5.2.9).
Section 9.1.15.10 states that this IE may be omitted in case of the
intra-RAT GERAN-to-GERAN handover, however in case of the inter-RAT
handover (e.g. EUTRAN-to-GERAN), this IE *shall* always be included.
Change-Id: I1d270e82d0a9b12897fc94dae4e8999aa132a22f
Related: SYS#5838
---
M include/osmocom/bsc/gsm_04_08_rr.h
M src/osmo-bsc/gsm_04_08_rr.c
M src/osmo-bsc/handover_fsm.c
3 files changed, 17 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/27507/1
diff --git a/include/osmocom/bsc/gsm_04_08_rr.h b/include/osmocom/bsc/gsm_04_08_rr.h
index 613787d..75307d6 100644
--- a/include/osmocom/bsc/gsm_04_08_rr.h
+++ b/include/osmocom/bsc/gsm_04_08_rr.h
@@ -3,6 +3,8 @@
#include <stdint.h>
#include <osmocom/core/msgb.h>
+enum handover_scope;
+
struct amr_mode;
struct amr_multirate_conf;
struct bsc_subscr;
@@ -25,6 +27,7 @@
const struct gsm48_multi_rate_conf *mr_conf,
const struct amr_mode *modes, unsigned int num_modes);
struct msgb *gsm48_make_ho_cmd(const struct gsm_lchan *new_lchan,
+ enum handover_scope ho_scope,
uint8_t power_command, uint8_t ho_ref);
int gsm48_send_rr_ass_cmd(struct gsm_lchan *dest_lchan, struct gsm_lchan *lchan, uint8_t
power_command);
int gsm48_send_rr_app_info(struct gsm_lchan *lchan, uint8_t apdu_id, uint8_t apdu_flags,
diff --git a/src/osmo-bsc/gsm_04_08_rr.c b/src/osmo-bsc/gsm_04_08_rr.c
index 3f11e48..cf74118 100644
--- a/src/osmo-bsc/gsm_04_08_rr.c
+++ b/src/osmo-bsc/gsm_04_08_rr.c
@@ -534,6 +534,7 @@
/* Chapter 9.1.15: Handover Command */
struct msgb *gsm48_make_ho_cmd(const struct gsm_lchan *new_lchan,
+ enum handover_scope ho_scope,
uint8_t power_command, uint8_t ho_ref)
{
struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 HO CMD");
@@ -574,6 +575,18 @@
new_lchan->ts->hopping.ma_data);
}
+ /* (O) Cipher Mode Setting, TV (see 3GPP TS 44.018, 9.1.15.10).
+ * Omitted in the case of intra-RAT (GERAN-to-GERAN) handover.
+ * Shall be included in the case of inter-RAT handover. */
+ if (ho_scope & HO_INTER_BSC_IN) {
+ uint8_t cms = 0x00;
+ /* This formula copied from gsm48_send_rr_ciph_mode() */
+ if (new_lchan->encr.alg_id > ALG_A5_NR_TO_RSL(0))
+ cms = (new_lchan->encr.alg_id - 2) << 1 | 1;
+ /* T (4 bit) + V (4 bit), see 3GPP TS 44.018, 10.5.2.9 */
+ msgb_v_put(msg, GSM48_IE_CIP_MODE_SET | (cms & 0x0f));
+ }
+
/* in case of multi rate we need to attach a config */
if (gsm48_chan_mode_to_non_vamos(new_lchan->current_ch_mode_rate.chan_mode) ==
GSM48_CMODE_SPEECH_AMR) {
if (put_mr_config_for_ms(msg, &new_lchan->current_mr_conf,
diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index e957a96..b3f78c0 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -1216,6 +1216,7 @@
struct handover *ho = &conn->ho;
struct msgb *rr_ho_cmd = gsm48_make_ho_cmd(ho->new_lchan,
+ ho->scope,
ho->new_lchan->ms_power,
ho->ho_ref);
if (!rr_ho_cmd) {
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bsc/+/27507
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1d270e82d0a9b12897fc94dae4e8999aa132a22f
Gerrit-Change-Number: 27507
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange