MCS: add Channel Coding Command encoder

Add function to encode MCS value as proper EDGE or GPRS Channel Coding
value according to 3GPP TS 44.060 and corresponding helpers.

Use it for everything except IA Rest Octet encoding which is done in a
follow-up patches to make sure that we distinguish between
encoding-related changes to test output and unrelated changes.

Change-Id: I127fb29f5aaf77a7f6c4c565dfeb3b711af9845d
diff --git a/src/coding_scheme.c b/src/coding_scheme.c
index 4a5d0d4..a4ae882 100644
--- a/src/coding_scheme.c
+++ b/src/coding_scheme.c
@@ -64,6 +64,19 @@
 	return false;
 }
 
+/* Return 3GPP TS 44.060 §12.10d (EDGE) or Table 11.2.28.2 (GPRS) Channel Coding Command value */
+uint8_t mcs_chan_code(enum CodingScheme cs)
+{
+	if (mcs_is_gprs(cs))
+		return cs - CS1;
+
+	if (mcs_is_edge(cs))
+		return cs - MCS1;
+
+	/* Defaults to (M)CS1 */
+	return 0;
+}
+
 static struct {
 	struct {
 		uint8_t data_header_bits;