pcu: Support sending with CS other than CS1 in f_ms_tx_ul_block()

Change-Id: Ibafa4246b442e7c26666eb0d37570bfbbf1dbda7
diff --git a/library/RLCMAC_Templates.ttcn b/library/RLCMAC_Templates.ttcn
index 848052e..560074f 100644
--- a/library/RLCMAC_Templates.ttcn
+++ b/library/RLCMAC_Templates.ttcn
@@ -93,6 +93,30 @@
 		return CS_1;
 	}
 
+	/* Minimum CodingScheme required to fit RLCMAC block */
+	function f_rlcmac_block_len_required_cs_mcs(uint32_t len, boolean is_mcs) return CodingScheme {
+		if (is_mcs) {
+			if (len <= 27) { return MCS_1; }
+			if (len <= 33) { return MCS_2; }
+			if (len <= 42) { return MCS_3; }
+			if (len <= 49) { return MCS_4; }
+			if (len <= 60) { return MCS_5; }
+			if (len <= 61) { return MCS_5; }
+			if (len <= 79) { return MCS_6; }
+			if (len <= 119) { return MCS_7; }
+			if (len <= 143) { return MCS_8; }
+			if (len <= 155) { return MCS_9; }
+			return MCS_1; /* error! */
+		} else {
+			/* 3GPP TS 44.060 Table 10.2.1: RLC data block size, discounting padding in octet */
+			if (len <= 23) { return CS_1; }
+			if (len <= 33) { return CS_2; }
+			if (len <= 39) { return CS_3; }
+			if (len <= 53) { return CS_4; }
+			return CS_1; /* error! */
+		}
+	}
+
 	function f_rlcmac_block_ChCodingCommand2cs_mcs(ChCodingCommand chcc) return CodingScheme {
 		select (chcc) {
 			case (CH_CODING_CS1) { return CS_1; }