aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/lchan_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2021-04-19 22:01:14 +0000
committerNeels Hofmeyr <neels@hofmeyr.de>2021-06-10 16:14:57 +0200
commite3e317242c2ac1b3cea0cb4f84770fa894986b56 (patch)
treea33391cd791c2f0ecb9a8abdf3bac34035697c60 /src/osmo-bsc/lchan_fsm.c
parenta56b94ce0f8cdc40b930c10171bcd98db0a3a778 (diff)
implement Channel Mode Modify to VAMOS mode
Put a (primary) lchan in VAMOS speech mode. This is not yet about activating shadow lchans, this merely puts any lchan in a VAMOS capable channel- and speech mode. Protocol: In RR Channel Mode Modify, send a spec conforming VAMOS channel mode as well as an Extended TSC Set, wich adds the TSC Set to the training sequence code value. In RSL MODE MODIFY, send Osmocom specific extensions to indicate the TSC Set and TSC, as well as the VAMOS channel mode; only to OsmoBTS type cells. - Set the Channel Mode's Channel Rate to Osmocom specific RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm / RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm - Add the Osmocom specific Training Sequence IE containing both TSC Set and TSC. (These are documented in the Abis manual.) Implementation: The internal API to request a Mode Modify is lchan_modify(info). Add to this info the 'vamos' bool, set to true when the modification should put the lchan in VAMOS channel mode or not. When info.vamos == true, make sure the channel mode value is a VAMOS one: in the copy of info->ch_mode_rate at lchan->modify.ch_mode_rate, convert to the right VAMOS/non-VAMOS equivalent channel mode. When the modification is through, set lchan->vamos.enabled appropriately. This patch also builds on Ic665125255d7354f5499d10dda1dd866ab243d24 'allow explixit TSC Set and TSC on chan activ / modif / assignment' placing tsc_set and tsc values in the TSC related IEs. Related: SYS#5315 OS#4940 Change-Id: Ibf53f4797d7491b17a33946fd7d920f038362b4c
Diffstat (limited to 'src/osmo-bsc/lchan_fsm.c')
-rw-r--r--src/osmo-bsc/lchan_fsm.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c
index ded4129d1..0613fcb71 100644
--- a/src/osmo-bsc/lchan_fsm.c
+++ b/src/osmo-bsc/lchan_fsm.c
@@ -382,6 +382,16 @@ void lchan_mode_modify(struct gsm_lchan *lchan, struct lchan_modify_info *info)
{
OSMO_ASSERT(lchan && info);
+ if (info->vamos && !osmo_bts_has_feature(&lchan->ts->trx->bts->features, BTS_FEAT_VAMOS)) {
+ lchan->last_error = talloc_strdup(lchan->ts->trx, "VAMOS related Channel Mode Modify requested,"
+ " but BTS does not support VAMOS");
+ LOG_LCHAN(lchan, LOGL_ERROR,
+ "VAMOS related Channel Mode Modify requested, but BTS %u does not support VAMOS\n",
+ lchan->ts->trx->bts->nr);
+ lchan_on_mode_modify_failure(lchan, info->modify_for, lchan->conn);
+ return;
+ }
+
/* To make sure that the lchan is actually allowed to initiate Mode Modify, feed through an FSM event. */
if (osmo_fsm_inst_dispatch(lchan->fi, LCHAN_EV_REQUEST_MODE_MODIFY, info)) {
LOG_LCHAN(lchan, LOGL_ERROR,
@@ -973,6 +983,7 @@ static void lchan_fsm_wait_rsl_chan_mode_modify_ack(struct osmo_fsm_inst *fi, ui
lchan->current_mr_conf = lchan->modify.mr_conf_filtered;
lchan->tsc_set = lchan->modify.tsc_set;
lchan->tsc = lchan->modify.tsc;
+ lchan->vamos.enabled = lchan->modify.info.vamos;
if (lchan->modify.info.requires_voice_stream
&& !lchan->fi_rtp) {
@@ -1118,7 +1129,13 @@ static void lchan_fsm_established(struct osmo_fsm_inst *fi, uint32_t event, void
use_mgwep_ci = lchan_use_mgw_endpoint_ci_bts(lchan);
lchan->modify.ch_mode_rate = lchan->modify.info.ch_mode_rate;
- /* future: automatically adjust chan_mode in lchan->modify.ch_mode_rate */
+ lchan->modify.ch_mode_rate.chan_mode = (lchan->modify.info.vamos
+ ? gsm48_chan_mode_to_vamos(lchan->modify.info.ch_mode_rate.chan_mode)
+ : gsm48_chan_mode_to_non_vamos(lchan->modify.info.ch_mode_rate.chan_mode));
+ if (lchan->modify.ch_mode_rate.chan_mode < 0) {
+ lchan_fail("Invalid chan_mode: %s", gsm48_chan_mode_name(lchan->modify.info.ch_mode_rate.chan_mode));
+ return;
+ }
if (gsm48_chan_mode_to_non_vamos(modif_info->ch_mode_rate.chan_mode) == GSM48_CMODE_SPEECH_AMR) {
if (lchan_mr_config(&lchan->modify.mr_conf_filtered, lchan, modif_info->ch_mode_rate.s15_s0)