aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/rsl.c
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2021-05-20 02:32:56 +0200
committerlaforge <laforge@osmocom.org>2021-06-04 20:04:13 +0000
commitd8598005ce27f419a940e1a4c16e25f876f25cb9 (patch)
treed741ebbc12bc39d437a3c6b04a534c758a611139 /src/common/rsl.c
parent60fc1d37631cc72164e67e958cdaadf61571191e (diff)
[VAMOS] l1sap_chan_act(): handle Osmocom specific TSC IE
This is an Osmocom specific RSL IE that, if present, takes precedence over the values indicated via the A-bis/OML. Change-Id: I717e5b2a6ca5b4faeaab9cae4bb971907945871b Related: SYS#4895, OS#4941
Diffstat (limited to 'src/common/rsl.c')
-rw-r--r--src/common/rsl.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/common/rsl.c b/src/common/rsl.c
index bb53aa51..516e6096 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -134,6 +134,16 @@ static int rsl_handle_chan_mod_ie(struct gsm_lchan *lchan,
case RSL_CMOD_CRT_TCH_Bm:
case RSL_CMOD_CRT_TCH_Lm:
break;
+ case RSL_CMOD_CRT_OSMO_TCH_VAMOS_Bm:
+ case RSL_CMOD_CRT_OSMO_TCH_VAMOS_Lm:
+ /* Make sure that Osmocom specific TSC IE is present */
+ if (!TLVP_PRES_LEN(tp, RSL_IE_OSMO_TRAINING_SEQUENCE, 2)) {
+ LOGPLCHAN(lchan, DRSL, LOGL_ERROR,
+ "Training Sequence IE is not present\n");
+ *cause = RSL_ERR_MAND_IE_ERROR;
+ return -ENODEV;
+ }
+ break;
default:
LOGPLCHAN(lchan, DRSL, LOGL_ERROR, "Channel Mode IE contains "
"unknown 'Channel rate and type' value 0x%02x\n",
@@ -265,6 +275,24 @@ static int rsl_handle_chan_ident_ie(struct gsm_lchan *lchan,
return 0;
}
+/* Handle Osmocom specific TSC IE */
+static int rsl_handle_osmo_tsc_ie(struct gsm_lchan *lchan,
+ const struct tlv_parsed *tp,
+ uint8_t *cause)
+{
+ /* Osmocom specific IE indicating Training Sequence Code and Set */
+ if (TLVP_PRES_LEN(tp, RSL_IE_OSMO_TRAINING_SEQUENCE, 2)) {
+ const uint8_t *ie = TLVP_VAL(tp, RSL_IE_OSMO_TRAINING_SEQUENCE);
+ lchan->ts->tsc_set = ie[0] & 0x03; /* Range: 0..3 */
+ lchan->ts->tsc = ie[1] & 0x07; /* Range: 0..7 */
+ } else {
+ lchan->ts->tsc = lchan->ts->tsc_oml;
+ lchan->ts->tsc_set = 0;
+ }
+
+ return 0;
+}
+
/*
* support
@@ -1482,6 +1510,8 @@ static int rsl_rx_chan_activ(struct msgb *msg)
return rsl_tx_chan_act_nack(lchan, cause);
if (rsl_handle_chan_ident_ie(lchan, &tp, &cause) != 0)
return rsl_tx_chan_act_nack(lchan, cause);
+ if (rsl_handle_osmo_tsc_ie(lchan, &tp, &cause) != 0)
+ return rsl_tx_chan_act_nack(lchan, cause);
}
/* 9.3.7 Encryption Information */
@@ -1996,6 +2026,9 @@ static int rsl_rx_mode_modif(struct msgb *msg)
/* 9.3.5 Channel Identification */
if (rsl_handle_chan_ident_ie(lchan, &tp, &cause) != 0)
return rsl_tx_mode_modif_nack(lchan, cause);
+ /* Osmocom specific TSC IE for VAMOS */
+ if (rsl_handle_osmo_tsc_ie(lchan, &tp, &cause) != 0)
+ return rsl_tx_mode_modif_nack(lchan, cause);
/* 9.3.7 Encryption Information */
if (TLVP_PRESENT(&tp, RSL_IE_ENCR_INFO)) {