edge: Replace integer cs by GprsCodingScheme

Currently the TBF and MS object use a plain integer value
(current_cs) to manage the coding scheme. This makes it difficult to
support the MCS schemes. GprsCodingScheme supports a partial ordering
of these values (CS and MCS) and provides safe increment and
decrement methods.

Use the GprsCodingScheme type instead of integer for cs fields and
variables. Add a 'mode' to GprsMs which can be set to either GPRS,
EGPRS, or EGPRS_GMSK which also set the initial values of
current_cs_ul/dl. Select the mode based on max_mcs_ul and max_mcs_dl.

Sponsored-by: On-Waves ehf
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index 7082d99..c059233 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -55,7 +55,8 @@
 		if (tbf->pdch[i])
 			vty_out(vty, "%d ", i);
 	}
-	vty_out(vty, " CS=%d%s%s", tbf->ms() ? tbf->ms()->current_cs_dl() : 1,
+	vty_out(vty, " CS=%s%s%s",
+		tbf->ms() ? tbf->ms()->current_cs_dl().name() : "???",
 		VTY_NEWLINE, VTY_NEWLINE);
 }
 
@@ -83,10 +84,11 @@
 	llist_for_each(ms_iter, &bts->ms_store().ms_list()) {
 		GprsMs *ms = ms_iter->entry();
 
-		vty_out(vty, "MS TLLI=%08x, TA=%d, CS-UL=%d, CS-DL=%d, LLC=%d, "
+		vty_out(vty, "MS TLLI=%08x, TA=%d, CS-UL=%s, CS-DL=%s, LLC=%d, "
 			"IMSI=%s%s",
 			ms->tlli(),
-			ms->ta(), ms->current_cs_ul(), ms->current_cs_dl(),
+			ms->ta(), ms->current_cs_ul().name(),
+			ms->current_cs_dl().name(),
 			ms->llc_queue()->size(),
 			ms->imsi(),
 			VTY_NEWLINE);
@@ -101,9 +103,9 @@
 
 	vty_out(vty, "MS TLLI=%08x, IMSI=%s%s", ms->tlli(), ms->imsi(), VTY_NEWLINE);
 	vty_out(vty, "  Timing advance (TA):    %d%s", ms->ta(), VTY_NEWLINE);
-	vty_out(vty, "  Coding scheme uplink:   CS-%d%s", ms->current_cs_ul(),
+	vty_out(vty, "  Coding scheme uplink:   %s%s", ms->current_cs_ul().name(),
 		VTY_NEWLINE);
-	vty_out(vty, "  Coding scheme downlink: CS-%d%s", ms->current_cs_dl(),
+	vty_out(vty, "  Coding scheme downlink: %s%s", ms->current_cs_dl().name(),
 		VTY_NEWLINE);
 	vty_out(vty, "  MS class:               %d%s", ms->ms_class(), VTY_NEWLINE);
 	vty_out(vty, "  EGPRS MS class:         %d%s", ms->egprs_ms_class(), VTY_NEWLINE);