library/RSL_Types: RSL_SpeechAlgo: support CSD

Prepare to test CSD in BSC_Tests.ttcn. After sending a BSSAP assignment
request to the BSC with channel type data, the BSC will send a channel
activation via RSL to the BTS (which is emulated by the testsuite).

Without CSD support in the RSL template, the testsuite is unable to
decode the message, prints "Data remained at the end of the stream
after successful decoding" and the test fails.

Related: OS#4393
Change-Id: Ief2d95c7e9d71afb26fa74da755294226c8e158d
diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn
index cad8a34..fff87f2 100644
--- a/library/RSL_Types.ttcn
+++ b/library/RSL_Types.ttcn
@@ -386,8 +386,10 @@
 		RSL_CHRT_OSMO_TCH_F_VAMOS	('10001000'B),
 		RSL_CHRT_OSMO_TCH_H_VAMOS	('10001001'B)
 	} with { variant "FIELDLENGTH(8)" };
-	type enumerated RSL_SpeechAlgo {
-		RSL_CMOD_NO_RESOURCE	('00000000'B),
+	type enumerated RSL_ChanModeOct6Signalling {
+		RSL_CMOD_NO_RESOURCE	('00000000'B)
+	} with { variant "FIELDLENGTH(8)" };
+	type enumerated RSL_ChanModeOct6SpeechAlgo {
 		RSL_CMOD_SP_GSM1	('00000001'B),
 		RSL_CMOD_SP_GSM2	('00010001'B),
 		RSL_CMOD_SP_GSM3	('00100001'B),
@@ -395,6 +397,33 @@
 		RSL_CMOD_SP_GSM5	('00001001'B),
 		RSL_CMOD_SP_GSM6	('00001101'B)
 	} with { variant "FIELDLENGTH(8)" };
+	type enumerated RSL_ChanModeOct6DataRate {
+		RSL_CMOD_CSD_NTA_43k5_14k5	('01100001'B),
+		RSL_CMOD_CSD_NTA_29k0_14k5	('01100010'B),
+		RSL_CMOD_CSD_NTA_43k5_29k0	('01100011'B),
+		RSL_CMOD_CSD_NTA_14k5_43k5	('01101001'B),
+		RSL_CMOD_CSD_NTA_14k5_29k0	('01101010'B),
+		RSL_CMOD_CSD_NTA_29k0_43k5	('01101011'B),
+		RSL_CMOD_CSD_NT_43k5		('01110100'B),
+		RSL_CMOD_CSD_NT_28k8		('01110001'B),
+		RSL_CMOD_CSD_NT_14k5		('01011000'B),
+		RSL_CMOD_CSD_NT_12k0		('01010000'B),
+		RSL_CMOD_CSD_NT_6k0		('01010001'B),
+		RSL_CMOD_CSD_T_32k0		('00111000'B),
+		RSL_CMOD_CSD_T_29k0		('00111001'B),
+		RSL_CMOD_CSD_T_14k4		('00011000'B),
+		RSL_CMOD_CSD_T_9k6		('00010000'B),
+		RSL_CMOD_CSD_T_4k8		('00010001'B),
+		RSL_CMOD_CSD_T_2k4		('00010010'B),
+		RSL_CMOD_CSD_T_1k2		('00010011'B),
+		RSL_CMOD_CSD_T_600		('00010100'B),
+		RSL_CMOD_CSD_T_1200_75		('00010101'B)
+	} with { variant "FIELDLENGTH(8)" };
+	type union RSL_ChanModeOct6 {
+		RSL_ChanModeOct6Signalling sign,
+		RSL_ChanModeOct6SpeechAlgo speech,
+		RSL_ChanModeOct6DataRate data
+	};
 	type record RSL_IE_ChannelMode {
 		uint8_t		len,
 		BIT6		reserved,
@@ -402,8 +431,13 @@
 		boolean		dtx_u,
 		RSL_SpeechDataInd spd_ind,
 		RSL_ChanRateType  ch_rate_type,
-		RSL_SpeechAlgo	coding_alg_rate
-	} with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,coding_alg_rate)" }
+		RSL_ChanModeOct6  u
+	} with { variant (len) "LENGTHTO(reserved,dtx_d,dtx_u,spd_ind,ch_rate_type,u)"
+		 variant (u) "CROSSTAG(
+				sign, spd_ind = RSL_SPDI_SIGN;
+				speech, spd_ind = RSL_SPDI_SPEECH;
+				data, spd_ind = RSL_SPDI_DATA;
+			      )"}
 
 	template (value) RSL_IE_ChannelMode ts_RSL_ChanMode_SIGN(RSL_ChanRateType t := RSL_CHRT_SDCCH,
 								 boolean dtx_downlink := false) := {
@@ -413,10 +447,10 @@
 		dtx_u := false,
 		spd_ind := RSL_SPDI_SIGN,
 		ch_rate_type := t,
-		coding_alg_rate := RSL_CMOD_NO_RESOURCE
+		u := { sign := RSL_CMOD_NO_RESOURCE }
 	}
 
-	template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_SpeechAlgo alg,
+	template (value) RSL_IE_ChannelMode ts_RSL_ChanMode(RSL_ChanRateType t, RSL_ChanModeOct6SpeechAlgo alg,
 							    boolean dtx_downlink := false) := {
 		len := 0,	/* overwritten */
 		reserved := '000000'B,
@@ -424,17 +458,17 @@
 		dtx_u := false,
 		spd_ind := RSL_SPDI_SPEECH,
 		ch_rate_type := t,
-		coding_alg_rate := alg
+		u := { speech := alg }
 	}
 	template RSL_IE_ChannelMode tr_RSL_ChanMode(template RSL_ChanRateType t,
-						    template RSL_SpeechAlgo alg) := {
+						    template RSL_ChanModeOct6SpeechAlgo alg) := {
 		len := ?,
 		reserved := '000000'B,
 		dtx_d := ?,
 		dtx_u := ?,
 		spd_ind := RSL_SPDI_SPEECH,
 		ch_rate_type := t,
-		coding_alg_rate := alg
+		u := { speech := alg }
 	}
 
 	/* 9.3.4 BS Power IE */