diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2021-10-02 12:03:19 +0200 |
---|---|---|
committer | neels <nhofmeyr@sysmocom.de> | 2021-10-04 11:04:21 +0000 |
commit | 62c4097dcf3e6fdf57f47fcc8f45076572a25d9f (patch) | |
tree | 13088832fb4e82fdc8c9806ad523b2933855e209 /src/osmo-bsc/bsc_vty.c | |
parent | 335d7f730e525da5a2f0e3c15498a726749e827f (diff) |
fix TSC / TSC Set used for Handover
From the nature of the lchan_activate_info.tsc_set and .tsc, it is easy
to forget to set tsc_set,tsc = -1 to use default TSC Set and TSC values.
Handover code is one such instance that forgets to set -1.
Change the semantics of tsc_set and tsc so that this kind of error can
not happen again as easily: use a separate bool to flag whether to use
the default config or explicit values.
Implicitly fix the lchan_activate_infos "launched" in handover_fsm.c as
well as abis_rsl_chan_rqd_queue_poll().
Related: OS#5244 SYS#4895
Related: I1ed6f068c85b01e5a2d7b5f2651498a1521f89af (osmo-ttcn3-hacks)
Change-Id: Iae20df4387c3d75752301bd5daeeea7508966393
Diffstat (limited to 'src/osmo-bsc/bsc_vty.c')
-rw-r--r-- | src/osmo-bsc/bsc_vty.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/osmo-bsc/bsc_vty.c b/src/osmo-bsc/bsc_vty.c index 5ccd78487..bd6155519 100644 --- a/src/osmo-bsc/bsc_vty.c +++ b/src/osmo-bsc/bsc_vty.c @@ -849,6 +849,7 @@ static int ho_or_as(struct vty *vty, const char *argv[], int argc) return CMD_WARNING; } +/* tsc_set and tsc: -1 to automatically determine which TSC Set / which TSC to use. */ static int trigger_vamos_mode_modify(struct vty *vty, struct gsm_lchan *lchan, bool vamos, int tsc_set, int tsc) { struct lchan_modify_info info = { @@ -856,8 +857,14 @@ static int trigger_vamos_mode_modify(struct vty *vty, struct gsm_lchan *lchan, b .ch_mode_rate = lchan->current_ch_mode_rate, .requires_voice_stream = (lchan->fi_rtp != NULL), .vamos = vamos, - .tsc_set = tsc_set, - .tsc = tsc, + .tsc_set = { + .present = (tsc_set >= 0), + .val = tsc_set, + }, + .tsc = { + .present = (tsc >= 0), + .val = tsc, + }, }; lchan_mode_modify(lchan, &info); @@ -1540,10 +1547,7 @@ DEFUN(pdch_act, pdch_act_cmd, /* Activate / Deactivate a single lchan with a specific codec mode */ static int lchan_act_single(struct vty *vty, struct gsm_lchan *lchan, const char *codec_str, int amr_mode, int activate) { - struct lchan_activate_info info = { - .tsc_set = -1, - .tsc = -1, - }; + struct lchan_activate_info info = {0}; uint16_t amr_modes[8] = { GSM0808_SC_CFG_AMR_4_75, GSM0808_SC_CFG_AMR_4_75_5_90_7_40_12_20, GSM0808_SC_CFG_AMR_5_90, GSM0808_SC_CFG_AMR_6_70, GSM0808_SC_CFG_AMR_7_40, GSM0808_SC_CFG_AMR_7_95, GSM0808_SC_CFG_AMR_10_2, @@ -1612,8 +1616,12 @@ static int lchan_act_single(struct vty *vty, struct gsm_lchan *lchan, const char if (activate == 2 || lchan->vamos.is_secondary) { info.vamos = true; - info.tsc_set = lchan->vamos.is_secondary ? 1 : 0; - info.tsc = 0; + if (lchan->vamos.is_secondary) { + info.tsc_set.present = true; + info.tsc_set.val = 1; + } + info.tsc.present = true; + info.tsc.val = 0; info.ch_mode_rate.chan_mode = gsm48_chan_mode_to_vamos(info.ch_mode_rate.chan_mode); } |