Change in osmo-pcu[master]: MCS: move Coding Scheme enum outside of class definition

Max gerrit-no-reply at lists.osmocom.org
Wed Mar 13 10:20:11 UTC 2019


Max has submitted this change and it was merged. ( https://gerrit.osmocom.org/13064 )

Change subject: MCS: move Coding Scheme enum outside of class definition
......................................................................

MCS: move Coding Scheme enum outside of class definition

Move generic MCS enum to C header file to simplify further modifications
to GprsCodingScheme class in follow-up patches. This also allows us
to use standard libosmocore value_sting functions in upcoming patches
for IA Rest Octet encoding/decoding.

Related: OS#3014
Change-Id: I993b49d9a82b8c7ad677d52d11003794aeabe117
---
M debian/copyright
M src/Makefile.am
A src/coding_scheme.h
M src/gprs_coding_scheme.cpp
M src/gprs_coding_scheme.h
M src/gprs_ms.cpp
M src/gprs_ms.h
M src/rlc.cpp
M src/tbf_dl.cpp
M src/tbf_ul.cpp
M tests/edge/EdgeTest.cpp
M tests/tbf/TbfTest.cpp
12 files changed, 248 insertions(+), 230 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/debian/copyright b/debian/copyright
index 853cd6e..5bb2110 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -15,6 +15,7 @@
            src/gprs_ms.h
            src/gprs_coding_scheme.cpp
            src/gprs_coding_scheme.h
+           src/coding_scheme.h
            src/cxx_linuxlist.h
            src/pcu_vty_functions.cpp
            src/pcu_vty_functions.h
diff --git a/src/Makefile.am b/src/Makefile.am
index 50e0eda..eb4a2bb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -97,6 +97,7 @@
 	cxx_linuxlist.h \
 	gprs_codel.h \
 	gprs_coding_scheme.h \
+	coding_scheme.h \
 	egprs_rlc_compression.h
 
 osmo_pcu_SOURCES = pcu_main.cpp
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
new file mode 100644
index 0000000..3705ea4
--- /dev/null
+++ b/src/coding_scheme.h
@@ -0,0 +1,29 @@
+/* coding_scheme.h
+ *
+ * Copyright (C) 2015-2019 by sysmocom s.f.m.c. GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ */
+
+#pragma once
+
+enum CodingScheme {
+	UNKNOWN,
+	/* GPRS Coding Schemes: */
+	CS1, CS2, CS3, CS4,
+	/* EDGE/EGPRS Modulation and Coding Schemes: */
+	MCS1, MCS2, MCS3, MCS4, MCS5, MCS6, MCS7, MCS8, MCS9,
+	NUM_SCHEMES
+};
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index bbac6e7..990e278 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -27,7 +27,7 @@
  * 1st level is Original MCS( index 0 corresponds to MCS1 and so on)
  * 2nd level is MS MCS (index 0 corresponds to MCS1 and so on)
  */
-enum GprsCodingScheme::Scheme GprsCodingScheme::egprs_mcs_retx_tbl[MAX_NUM_ARQ]
+enum CodingScheme GprsCodingScheme::egprs_mcs_retx_tbl[MAX_NUM_ARQ]
 			[MAX_NUM_MCS][MAX_NUM_MCS] = {
 		{
 			{MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1},
@@ -71,7 +71,7 @@
 	const char *name;
 	GprsCodingScheme::HeaderType data_hdr;
 	enum Family family;
-} mcs_info[GprsCodingScheme::NUM_SCHEMES] = {
+} mcs_info[NUM_SCHEMES] = {
 	{{0, 0},   {0, 0},    0,  0, "UNKNOWN",
 		GprsCodingScheme::HEADER_INVALID, FAMILY_INVALID},
 	{{23, 0},  {23, 0},  20,  0, "CS-1",
@@ -233,7 +233,7 @@
 		/* This should not happen. TODO: Use assert? */
 		return;
 
-	Scheme new_cs(Scheme(m_scheme + 1));
+	CodingScheme new_cs(CodingScheme(m_scheme + 1));
 	if (!GprsCodingScheme(new_cs).isCompatible(mode))
 		/* Clipping, do not change the value */
 		return;
@@ -247,7 +247,7 @@
 		/* This should not happen. TODO: Use assert? */
 		return;
 
-	Scheme new_cs(Scheme(m_scheme - 1));
+	CodingScheme new_cs(CodingScheme(m_scheme - 1));
 	if (!GprsCodingScheme(new_cs).isCompatible(mode))
 		/* Clipping, do not change the value */
 		return;
@@ -266,7 +266,7 @@
 	if (!isValid())
 		return;
 
-	m_scheme = Scheme(m_scheme + 1);
+	m_scheme = CodingScheme(m_scheme + 1);
 }
 
 void GprsCodingScheme::dec()
@@ -280,7 +280,7 @@
 	if (!isValid())
 		return;
 
-	m_scheme = Scheme(m_scheme - 1);
+	m_scheme = CodingScheme(m_scheme - 1);
 }
 
 const char *GprsCodingScheme::modeName(Mode mode)
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index 31f0940..045d34a 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -25,6 +25,7 @@
 
 extern "C" {
 	#include <osmocom/core/utils.h>
+	#include "coding_scheme.h"
 }
 
 class GprsCodingScheme {
@@ -35,14 +36,6 @@
 #define EGPRS_ARQ1            0x0
 #define EGPRS_ARQ2            0x1
 
-	enum Scheme {
-		UNKNOWN,
-		CS1, CS2, CS3, CS4,
-		MCS1, MCS2, MCS3, MCS4,
-		MCS5, MCS6, MCS7, MCS8, MCS9,
-		NUM_SCHEMES
-	};
-
 	enum Mode {
 		GPRS,
 		EGPRS_GMSK,
@@ -59,14 +52,14 @@
 		NUM_HEADER_TYPES
 	};
 
-	GprsCodingScheme(Scheme s = UNKNOWN);
+	GprsCodingScheme(CodingScheme s = UNKNOWN);
 
 	operator bool() const {return m_scheme != UNKNOWN;}
-	operator Scheme() const {return m_scheme;}
+	operator CodingScheme() const {return m_scheme;}
 	uint8_t to_num() const;
 
-	GprsCodingScheme& operator =(Scheme s);
-	bool operator == (Scheme s) const;
+	GprsCodingScheme& operator =(CodingScheme s);
+	bool operator == (CodingScheme s) const;
 	GprsCodingScheme& operator =(GprsCodingScheme o);
 
 	bool isValid()   const {return UNKNOWN <= m_scheme && m_scheme <= MCS9;}
@@ -106,16 +99,16 @@
 	static GprsCodingScheme getEgprsByNum(unsigned num);
 
 	static const char *modeName(Mode mode);
-	static Scheme get_retx_mcs(const GprsCodingScheme mcs,
+	static CodingScheme get_retx_mcs(const GprsCodingScheme mcs,
 				const GprsCodingScheme retx_mcs,
 				const unsigned arq_type);
 
-	static enum Scheme egprs_mcs_retx_tbl[MAX_NUM_ARQ]
+	static enum CodingScheme egprs_mcs_retx_tbl[MAX_NUM_ARQ]
 			[MAX_NUM_MCS][MAX_NUM_MCS];
 private:
 	GprsCodingScheme(int s); /* fail on use */
 	GprsCodingScheme& operator =(int s); /* fail on use */
-	enum Scheme m_scheme;
+	enum CodingScheme m_scheme;
 };
 
 inline uint8_t GprsCodingScheme::to_num() const
@@ -145,14 +138,14 @@
 	return (isGprs() && o.isGprs()) || (isEgprs() && o.isEgprs());
 }
 
-inline GprsCodingScheme::GprsCodingScheme(Scheme s)
+inline GprsCodingScheme::GprsCodingScheme(CodingScheme s)
 	: m_scheme(s)
 {
 	if (!isValid())
 		m_scheme = UNKNOWN;
 }
 
-inline GprsCodingScheme& GprsCodingScheme::operator =(Scheme s)
+inline GprsCodingScheme& GprsCodingScheme::operator =(CodingScheme s)
 {
 	m_scheme = s;
 
@@ -173,7 +166,7 @@
 	if (num < 1 || num > 4)
 		return GprsCodingScheme();
 
-	return GprsCodingScheme(Scheme(CS1 + (num - 1)));
+	return GprsCodingScheme(CodingScheme(CS1 + (num - 1)));
 }
 
 inline GprsCodingScheme GprsCodingScheme::getEgprsByNum(unsigned num)
@@ -181,16 +174,11 @@
 	if (num < 1 || num > 9)
 		return GprsCodingScheme();
 
-	return GprsCodingScheme(Scheme(MCS1 + (num - 1)));
+	return GprsCodingScheme(CodingScheme(MCS1 + (num - 1)));
 }
 
 /* The coding schemes form a partial ordering */
-inline bool operator ==(GprsCodingScheme a, GprsCodingScheme b)
-{
-	return GprsCodingScheme::Scheme(a) == GprsCodingScheme::Scheme(b);
-}
-
-inline bool GprsCodingScheme::operator == (Scheme scheme) const
+inline bool GprsCodingScheme::operator == (CodingScheme scheme) const
 {
 	return this->m_scheme == scheme;
 }
@@ -202,11 +190,10 @@
 
 inline bool operator <(GprsCodingScheme a, GprsCodingScheme b)
 {
-	return a.isCompatible(b) &&
-		GprsCodingScheme::Scheme(a) < GprsCodingScheme::Scheme(b);
+	return a.isCompatible(b) && a.to_num() < b.to_num();
 }
 
-inline GprsCodingScheme::Scheme GprsCodingScheme::get_retx_mcs(
+inline CodingScheme GprsCodingScheme::get_retx_mcs(
 				const GprsCodingScheme mcs,
 				const GprsCodingScheme demanded_mcs,
 				const unsigned arq_type)
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index 8855053..77a8f2e 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -225,13 +225,13 @@
 			m_current_cs_ul = GprsCodingScheme::getGprsByNum(
 				m_bts->bts_data()->initial_cs_ul);
 			if (!m_current_cs_ul.isValid())
-				m_current_cs_ul = GprsCodingScheme::CS1;
+				m_current_cs_ul = CS1;
 		}
 		if (!m_current_cs_dl.isGprs()) {
 			m_current_cs_dl = GprsCodingScheme::getGprsByNum(
 				m_bts->bts_data()->initial_cs_dl);
 			if (!m_current_cs_dl.isValid())
-				m_current_cs_dl = GprsCodingScheme::CS1;
+				m_current_cs_dl = CS1;
 		}
 		break;
 
@@ -241,13 +241,13 @@
 			m_current_cs_ul = GprsCodingScheme::getEgprsByNum(
 				m_bts->bts_data()->initial_mcs_ul);
 			if (!m_current_cs_ul.isValid())
-				m_current_cs_ul = GprsCodingScheme::MCS1;
+				m_current_cs_ul = MCS1;
 		}
 		if (!m_current_cs_dl.isEgprs()) {
 			m_current_cs_dl = GprsCodingScheme::getEgprsByNum(
 				m_bts->bts_data()->initial_mcs_dl);
 			if (!m_current_cs_dl.isValid())
-				m_current_cs_dl = GprsCodingScheme::MCS1;
+				m_current_cs_dl = MCS1;
 		}
 		break;
 	}
@@ -565,7 +565,7 @@
 
 	if (m_current_cs_ul.isGprs()) {
 		if (!bts_data->max_cs_ul)
-			return GprsCodingScheme(GprsCodingScheme::CS4);
+			return GprsCodingScheme(CS4);
 
 		return GprsCodingScheme::getGprsByNum(bts_data->max_cs_ul);
 	}
@@ -578,10 +578,10 @@
 	else if (bts_data->max_cs_ul)
 		return GprsCodingScheme::getEgprsByNum(bts_data->max_cs_ul);
 
-	return GprsCodingScheme(GprsCodingScheme::MCS4);
+	return GprsCodingScheme(MCS4);
 }
 
-void GprsMs::set_current_cs_dl(GprsCodingScheme::Scheme scheme)
+void GprsMs::set_current_cs_dl(CodingScheme scheme)
 {
 	m_current_cs_dl = scheme;
 }
@@ -595,7 +595,7 @@
 
 	if (m_current_cs_dl.isGprs()) {
 		if (!bts_data->max_cs_dl)
-			return GprsCodingScheme(GprsCodingScheme::CS4);
+			return GprsCodingScheme(CS4);
 
 		return GprsCodingScheme::getGprsByNum(bts_data->max_cs_dl);
 	}
@@ -608,7 +608,7 @@
 	else if (bts_data->max_cs_dl)
 		return GprsCodingScheme::getEgprsByNum(bts_data->max_cs_dl);
 
-	return GprsCodingScheme(GprsCodingScheme::MCS4);
+	return GprsCodingScheme(MCS4);
 }
 
 void GprsMs::update_cs_ul(const pcu_l1_meas *meas)
@@ -746,7 +746,7 @@
 	cs.dec(mode());
 
 	/* CS-2 doesn't gain throughput with small packets, further reduce to CS-1 */
-	if (cs == GprsCodingScheme(GprsCodingScheme::CS2))
+	if (cs == GprsCodingScheme(CS2))
 		cs.dec(mode());
 
 	return cs;
diff --git a/src/gprs_ms.h b/src/gprs_ms.h
index 857f0c9..0a9efb8 100644
--- a/src/gprs_ms.h
+++ b/src/gprs_ms.h
@@ -86,7 +86,7 @@
 	uint8_t egprs_ms_class() const;
 	void set_ms_class(uint8_t ms_class);
 	void set_egprs_ms_class(uint8_t ms_class);
-	void set_current_cs_dl(GprsCodingScheme::Scheme scheme);
+	void set_current_cs_dl(CodingScheme scheme);
 
 	GprsCodingScheme current_cs_ul() const;
 	GprsCodingScheme current_cs_dl() const;
diff --git a/src/rlc.cpp b/src/rlc.cpp
index ee88bd9..323fde4 100644
--- a/src/rlc.cpp
+++ b/src/rlc.cpp
@@ -391,27 +391,27 @@
 	enum egprs_puncturing_values punct2, bool with_padding)
 {
 	/* validate that punct and punct2 are as expected */
-	switch (GprsCodingScheme::Scheme(cs)) {
-	case GprsCodingScheme::MCS9:
-	case GprsCodingScheme::MCS8:
-	case GprsCodingScheme::MCS7:
+	switch (CodingScheme(cs)) {
+	case MCS9:
+	case MCS8:
+	case MCS7:
 		if (punct2 == EGPRS_PS_INVALID) {
 			LOGP(DRLCMACDL, LOGL_ERROR,
 			     "Invalid punct2 value for coding scheme %d: %d\n",
-			     GprsCodingScheme::Scheme(cs), punct2);
+			     CodingScheme(cs), punct2);
 			return -1;
 		}
 		/* fall through */
-	case GprsCodingScheme::MCS6:
-	case GprsCodingScheme::MCS5:
-	case GprsCodingScheme::MCS4:
-	case GprsCodingScheme::MCS3:
-	case GprsCodingScheme::MCS2:
-	case GprsCodingScheme::MCS1:
+	case MCS6:
+	case MCS5:
+	case MCS4:
+	case MCS3:
+	case MCS2:
+	case MCS1:
 		if (punct == EGPRS_PS_INVALID) {
 			LOGP(DRLCMACDL, LOGL_ERROR,
 			     "Invalid punct value for coding scheme %d: %d\n",
-			     GprsCodingScheme::Scheme(cs), punct);
+			     CodingScheme(cs), punct);
 			return -1;
 		}
 		break;
@@ -420,26 +420,26 @@
 	}
 
 	/* See 3GPP TS 44.060 10.4.8a.3.1, 10.4.8a.2.1, 10.4.8a.1.1 */
-	switch (GprsCodingScheme::Scheme(cs)) {
-	case GprsCodingScheme::MCS1: return 0b1011 +
+	switch (CodingScheme(cs)) {
+	case MCS1: return 0b1011 +
 		punct % EGPRS_MAX_PS_NUM_2;
-	case GprsCodingScheme::MCS2: return 0b1001 +
+	case MCS2: return 0b1001 +
 		punct % EGPRS_MAX_PS_NUM_2;
-	case GprsCodingScheme::MCS3: return (with_padding ? 0b0110 : 0b0011) +
+	case MCS3: return (with_padding ? 0b0110 : 0b0011) +
 		punct % EGPRS_MAX_PS_NUM_3;
-	case GprsCodingScheme::MCS4: return 0b0000 +
+	case MCS4: return 0b0000 +
 		punct % EGPRS_MAX_PS_NUM_3;
-	case GprsCodingScheme::MCS5: return  0b100 +
+	case MCS5: return  0b100 +
 		punct % EGPRS_MAX_PS_NUM_2;
-	case GprsCodingScheme::MCS6: return (with_padding ? 0b010 : 0b000) +
+	case MCS6: return (with_padding ? 0b010 : 0b000) +
 		punct % EGPRS_MAX_PS_NUM_2;
-	case GprsCodingScheme::MCS7: return 0b10100 +
+	case MCS7: return 0b10100 +
 		3 * (punct % EGPRS_MAX_PS_NUM_3) +
 		punct2 % EGPRS_MAX_PS_NUM_3;
-	case GprsCodingScheme::MCS8: return 0b01011 +
+	case MCS8: return 0b01011 +
 		3 * (punct % EGPRS_MAX_PS_NUM_3) +
 		punct2 % EGPRS_MAX_PS_NUM_3;
-	case GprsCodingScheme::MCS9: return 0b00000 +
+	case MCS9: return 0b00000 +
 		4 * (punct % EGPRS_MAX_PS_NUM_3) +
 		punct2 % EGPRS_MAX_PS_NUM_3;
 	default: ;
@@ -454,24 +454,24 @@
 	*punct2 = -1;
 	*with_padding = 0;
 
-	switch (GprsCodingScheme::Scheme(cs)) {
-	case GprsCodingScheme::MCS1:
+	switch (CodingScheme(cs)) {
+	case MCS1:
 		cps -= 0b1011; *punct = cps % 2; break;
-	case GprsCodingScheme::MCS2:
+	case MCS2:
 		cps -= 0b1001; *punct = cps % 2; break;
-	case GprsCodingScheme::MCS3:
+	case MCS3:
 		cps -= 0b0011; *punct = cps % 3; *with_padding = cps >= 3; break;
-	case GprsCodingScheme::MCS4:
+	case MCS4:
 		cps -= 0b0000; *punct = cps % 3; break;
-	case GprsCodingScheme::MCS5:
+	case MCS5:
 		cps -= 0b100; *punct = cps % 2; break;
-	case GprsCodingScheme::MCS6:
+	case MCS6:
 		cps -= 0b000; *punct = cps % 2; *with_padding = cps >= 2; break;
-	case GprsCodingScheme::MCS7:
+	case MCS7:
 		cps -= 0b10100; *punct = cps / 3; *punct2 = cps % 3; break;
-	case GprsCodingScheme::MCS8:
+	case MCS8:
 		cps -= 0b01011; *punct = cps / 3; *punct2 = cps % 3; break;
-	case GprsCodingScheme::MCS9:
+	case MCS9:
 		cps -= 0b00000; *punct = cps / 4; *punct2 = cps % 3; break;
 	default: ;
 	}
@@ -501,23 +501,23 @@
 		return punct;
 
 	/* TS  44.060 9.3.2.1.1 */
-	if ((GprsCodingScheme::Scheme(cs) == GprsCodingScheme::MCS9) &&
-	(GprsCodingScheme::Scheme(cs_current) == GprsCodingScheme::MCS6)) {
+	if ((CodingScheme(cs) == MCS9) &&
+	(CodingScheme(cs_current) == MCS6)) {
 		if ((punct == EGPRS_PS_1) || (punct == EGPRS_PS_3))
 			return EGPRS_PS_1;
 		else if (punct == EGPRS_PS_2)
 			return EGPRS_PS_2;
-	} else if ((GprsCodingScheme::Scheme(cs) == GprsCodingScheme::MCS6) &&
-	(GprsCodingScheme::Scheme(cs_current) == GprsCodingScheme::MCS9)) {
+	} else if ((CodingScheme(cs) == MCS6) &&
+	(CodingScheme(cs_current) == MCS9)) {
 		if (punct == EGPRS_PS_1)
 			return EGPRS_PS_3;
 		else if (punct == EGPRS_PS_2)
 			return EGPRS_PS_2;
-	} else if ((GprsCodingScheme::Scheme(cs) == GprsCodingScheme::MCS7) &&
-	(GprsCodingScheme::Scheme(cs_current) == GprsCodingScheme::MCS5))
+	} else if ((CodingScheme(cs) == MCS7) &&
+	(CodingScheme(cs_current) == MCS5))
 		return EGPRS_PS_1;
-	else if ((GprsCodingScheme::Scheme(cs) == GprsCodingScheme::MCS5) &&
-	(GprsCodingScheme::Scheme(cs_current) == GprsCodingScheme::MCS7))
+	else if ((CodingScheme(cs) == MCS5) &&
+	(CodingScheme(cs_current) == MCS7))
 		return EGPRS_PS_2;
 	else if (cs != cs_current)
 		return EGPRS_PS_1;
@@ -540,19 +540,19 @@
 void gprs_update_punct_scheme(enum egprs_puncturing_values *punct,
 	const GprsCodingScheme &cs)
 {
-	switch (GprsCodingScheme::Scheme(cs)) {
-	case GprsCodingScheme::MCS1 :
-	case GprsCodingScheme::MCS2 :
-	case GprsCodingScheme::MCS5 :
-	case GprsCodingScheme::MCS6 :
+	switch (CodingScheme(cs)) {
+	case MCS1 :
+	case MCS2 :
+	case MCS5 :
+	case MCS6 :
 		*punct = ((enum egprs_puncturing_values)((*punct + 1) %
 			EGPRS_MAX_PS_NUM_2));
 		break;
-	case GprsCodingScheme::MCS3 :
-	case GprsCodingScheme::MCS4 :
-	case GprsCodingScheme::MCS7 :
-	case GprsCodingScheme::MCS8 :
-	case GprsCodingScheme::MCS9 :
+	case MCS3 :
+	case MCS4 :
+	case MCS7 :
+	case MCS8 :
+	case MCS9 :
 		*punct = ((enum egprs_puncturing_values)((*punct + 1) %
 			EGPRS_MAX_PS_NUM_3));
 		break;
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 0ef3032..7b0052f 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -395,9 +395,9 @@
 			 * transistion is handled.
 			 * Refer commit be881c028fc4da00c4046ecd9296727975c206a3
 			 */
-			if (m_rlc.block(bsn)->cs_init == GprsCodingScheme::MCS8)
+			if (m_rlc.block(bsn)->cs_init == MCS8)
 				m_rlc.block(bsn)->cs_current_trans =
-					GprsCodingScheme::MCS8;
+					MCS8;
 		} else
 			m_rlc.block(bsn)->cs_current_trans =
 					m_rlc.block(bsn)->cs_last;
@@ -701,9 +701,9 @@
 	 * if the intial mcs is 8 and retransmission mcs is either 6 or 3
 	 * we have to include the padding of 6 octets in first segment
 	 */
-	if ((GprsCodingScheme::Scheme(cs_init) == GprsCodingScheme::MCS8) &&
-		(GprsCodingScheme::Scheme(cs) == GprsCodingScheme::MCS6 ||
-		GprsCodingScheme::Scheme(cs) == GprsCodingScheme::MCS3)) {
+	if ((CodingScheme(cs_init) == MCS8) &&
+		(CodingScheme(cs) == MCS6 ||
+		CodingScheme(cs) == MCS3)) {
 		if (spb_status == EGPRS_RESEG_DL_DEFAULT ||
 			spb_status == EGPRS_RESEG_SECOND_SEG_SENT)
 			need_padding  = true;
@@ -715,7 +715,7 @@
 		 * Refer commit be881c028fc4da00c4046ecd9296727975c206a3
 		 * dated 2016-02-07 23:45:40 (UTC)
 		 */
-		if (cs != GprsCodingScheme(GprsCodingScheme::MCS8))
+		if (cs != GprsCodingScheme(MCS8))
 			cs.decToSingleBlock(&need_padding);
 	}
 
@@ -1261,19 +1261,19 @@
 	if (cs_current_trans.headerTypeData() ==
 			GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_3) {
 		if (*block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT) {
-			switch (GprsCodingScheme::Scheme(cs_init)) {
-			case GprsCodingScheme::MCS6 :
-			case GprsCodingScheme::MCS9 :
+			switch (CodingScheme(cs_init)) {
+			case MCS6 :
+			case MCS9 :
 				*block_data = &rlc_data->block[37];
 				break;
-			case GprsCodingScheme::MCS7 :
-			case GprsCodingScheme::MCS5 :
+			case MCS7 :
+			case MCS5 :
 				*block_data = &rlc_data->block[28];
 				break;
-			case GprsCodingScheme::MCS8 :
+			case MCS8 :
 				*block_data = &rlc_data->block[31];
 				break;
-			case GprsCodingScheme::MCS4 :
+			case MCS4 :
 				*block_data = &rlc_data->block[22];
 				break;
 			default:
@@ -1291,10 +1291,10 @@
 			(cs_init.headerTypeData() ==
 				GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) {
 			return EGPRS_RESEG_FIRST_SEG_SENT;
-		} else if ((GprsCodingScheme::Scheme(cs_init) ==
-					GprsCodingScheme::MCS4) &&
-				(GprsCodingScheme::Scheme(cs_current_trans) ==
-					GprsCodingScheme::MCS1)) {
+		} else if ((CodingScheme(cs_init) ==
+					MCS4) &&
+				(CodingScheme(cs_current_trans) ==
+					MCS1)) {
 			return EGPRS_RESEG_FIRST_SEG_SENT;
 		}
 	}
@@ -1343,10 +1343,10 @@
 				GprsCodingScheme::HEADER_EGPRS_DATA_TYPE_2)) {
 			bts->spb_downlink_first_segment();
 			return EGPRS_RLCMAC_DL_FIRST_SEG;
-		} else if ((GprsCodingScheme::Scheme(cs_init) ==
-					GprsCodingScheme::MCS4) &&
-				(GprsCodingScheme::Scheme(cs_current_trans) ==
-					GprsCodingScheme::MCS1)) {
+		} else if ((CodingScheme(cs_init) ==
+					MCS4) &&
+				(CodingScheme(cs_current_trans) ==
+					MCS1)) {
 			bts->spb_downlink_first_segment();
 			return EGPRS_RLCMAC_DL_FIRST_SEG;
 		}
@@ -1367,61 +1367,61 @@
 {
 	uint8_t coding_scheme = 0;
 
-	coding_scheme = GprsCodingScheme::Scheme(cs);
+	coding_scheme = CodingScheme(cs);
 	if (cs.isGprs()) {
 		switch (coding_scheme) {
-		case GprsCodingScheme::CS1 :
+		case CS1 :
 			bts->gprs_dl_cs1();
 			rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS1]);
 			break;
-		case GprsCodingScheme::CS2 :
+		case CS2 :
 			bts->gprs_dl_cs2();
 			rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS2]);
 			break;
-		case GprsCodingScheme::CS3 :
+		case CS3 :
 			bts->gprs_dl_cs3();
 			rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS3]);
 			break;
-		case GprsCodingScheme::CS4 :
+		case CS4 :
 			bts->gprs_dl_cs4();
 			rate_ctr_inc(&m_dl_gprs_ctrs->ctr[TBF_CTR_GPRS_DL_CS4]);
 			break;
 		}
 	} else {
 		switch (coding_scheme) {
-		case GprsCodingScheme::MCS1 :
+		case MCS1 :
 			bts->egprs_dl_mcs1();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS1]);
 			break;
-		case GprsCodingScheme::MCS2 :
+		case MCS2 :
 			bts->egprs_dl_mcs2();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS2]);
 			break;
-		case GprsCodingScheme::MCS3 :
+		case MCS3 :
 			bts->egprs_dl_mcs3();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS3]);
 			break;
-		case GprsCodingScheme::MCS4 :
+		case MCS4 :
 			bts->egprs_dl_mcs4();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS4]);
 			break;
-		case GprsCodingScheme::MCS5 :
+		case MCS5 :
 			bts->egprs_dl_mcs5();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS5]);
 			break;
-		case GprsCodingScheme::MCS6 :
+		case MCS6 :
 			bts->egprs_dl_mcs6();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS6]);
 			break;
-		case GprsCodingScheme::MCS7 :
+		case MCS7 :
 			bts->egprs_dl_mcs7();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS7]);
 			break;
-		case GprsCodingScheme::MCS8 :
+		case MCS8 :
 			bts->egprs_dl_mcs8();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS8]);
 			break;
-		case GprsCodingScheme::MCS9 :
+		case MCS9 :
 			bts->egprs_dl_mcs9();
 			rate_ctr_inc(&m_dl_egprs_ctrs->ctr[TBF_CTR_EGPRS_DL_MCS9]);
 			break;
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 7937f8b..bc36733 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -501,18 +501,18 @@
 	 * upgrade the MCS to the type 2
 	 */
 	if (assemble_status == EGPRS_RESEG_DEFAULT) {
-		switch (GprsCodingScheme::Scheme(rlc->cs)) {
-		case GprsCodingScheme::MCS3 :
-			block->cs_last = GprsCodingScheme::MCS6;
+		switch (CodingScheme(rlc->cs)) {
+		case MCS3 :
+			block->cs_last = MCS6;
 			LOGPTBFUL(this, LOGL_DEBUG, "Upgrading to MCS6\n");
 			break;
-		case GprsCodingScheme::MCS2 :
-			block->cs_last = GprsCodingScheme::MCS5;
+		case MCS2 :
+			block->cs_last = MCS5;
 			LOGPTBFUL(this, LOGL_DEBUG, "Upgrading to MCS5\n");
 			break;
-		case GprsCodingScheme::MCS1 :
+		case MCS1 :
 			LOGPTBFUL(this, LOGL_DEBUG, "Upgrading to MCS4\n");
-			block->cs_last = GprsCodingScheme::MCS4;
+			block->cs_last = MCS4;
 			break;
 		default:
 			LOGPTBFUL(this, LOGL_ERROR,
@@ -528,61 +528,61 @@
 {
 	uint8_t coding_scheme = 0;
 
-	coding_scheme = GprsCodingScheme::Scheme(cs);
+	coding_scheme = CodingScheme(cs);
 	if (cs.isGprs()) {
 		switch (coding_scheme) {
-		case GprsCodingScheme::CS1 :
+		case CS1 :
 			bts->gprs_ul_cs1();
 			rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS1]);
 			break;
-		case GprsCodingScheme::CS2 :
+		case CS2 :
 			bts->gprs_ul_cs2();
 			rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS2]);
 			break;
-		case GprsCodingScheme::CS3 :
+		case CS3 :
 			bts->gprs_ul_cs3();
 			rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS3]);
 			break;
-		case GprsCodingScheme::CS4 :
+		case CS4 :
 			bts->gprs_ul_cs4();
 			rate_ctr_inc(&m_ul_gprs_ctrs->ctr[TBF_CTR_GPRS_UL_CS4]);
 			break;
 		}
 	} else {
 		switch (coding_scheme) {
-		case GprsCodingScheme::MCS1 :
+		case MCS1 :
 			bts->egprs_ul_mcs1();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS1]);
 			break;
-		case GprsCodingScheme::MCS2 :
+		case MCS2 :
 			bts->egprs_ul_mcs2();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS2]);
 			break;
-		case GprsCodingScheme::MCS3 :
+		case MCS3 :
 			bts->egprs_ul_mcs3();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS3]);
 			break;
-		case GprsCodingScheme::MCS4 :
+		case MCS4 :
 			bts->egprs_ul_mcs4();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS4]);
 			break;
-		case GprsCodingScheme::MCS5 :
+		case MCS5 :
 			bts->egprs_ul_mcs5();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS5]);
 			break;
-		case GprsCodingScheme::MCS6 :
+		case MCS6 :
 			bts->egprs_ul_mcs6();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS6]);
 			break;
-		case GprsCodingScheme::MCS7 :
+		case MCS7 :
 			bts->egprs_ul_mcs7();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS7]);
 			break;
-		case GprsCodingScheme::MCS8 :
+		case MCS8 :
 			bts->egprs_ul_mcs8();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS8]);
 			break;
-		case GprsCodingScheme::MCS9 :
+		case MCS9 :
 			bts->egprs_ul_mcs9();
 			rate_ctr_inc(&m_ul_egprs_ctrs->ctr[TBF_CTR_EGPRS_UL_MCS9]);
 			break;
diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp
index 0cb123e..9db90ca 100644
--- a/tests/edge/EdgeTest.cpp
+++ b/tests/edge/EdgeTest.cpp
@@ -121,33 +121,33 @@
 	unsigned i;
 	uint8_t last_size_UL;
 	uint8_t last_size_DL;
-	GprsCodingScheme::Scheme gprs_schemes[] = {
-		GprsCodingScheme::CS1,
-		GprsCodingScheme::CS2,
-		GprsCodingScheme::CS3,
-		GprsCodingScheme::CS4
+	CodingScheme gprs_schemes[] = {
+		CS1,
+		CS2,
+		CS3,
+		CS4
 	};
 	struct {
-		GprsCodingScheme::Scheme s;
+		CodingScheme s;
 		bool is_gmsk;
 	} egprs_schemes[] = {
-		{GprsCodingScheme::MCS1, true},
-		{GprsCodingScheme::MCS2, true},
-		{GprsCodingScheme::MCS3, true},
-		{GprsCodingScheme::MCS4, true},
-		{GprsCodingScheme::MCS5, false},
-		{GprsCodingScheme::MCS6, false},
-		{GprsCodingScheme::MCS7, false},
-		{GprsCodingScheme::MCS8, false},
-		{GprsCodingScheme::MCS9, false},
+		{ MCS1, true},
+		{ MCS2, true},
+		{ MCS3, true},
+		{ MCS4, true},
+		{ MCS5, false},
+		{ MCS6, false},
+		{ MCS7, false},
+		{ MCS8, false},
+		{ MCS9, false},
 	};
 
 	printf("=== start %s ===\n", __func__);
 
 	GprsCodingScheme cs;
 	OSMO_ASSERT(!cs);
-	OSMO_ASSERT(GprsCodingScheme::Scheme(cs) == GprsCodingScheme::UNKNOWN);
-	OSMO_ASSERT(cs == GprsCodingScheme(GprsCodingScheme::UNKNOWN));
+	OSMO_ASSERT(CodingScheme(cs) == UNKNOWN);
+	OSMO_ASSERT(cs == GprsCodingScheme(UNKNOWN));
 	OSMO_ASSERT(!cs.isCompatible(GprsCodingScheme::GPRS));
 	OSMO_ASSERT(!cs.isCompatible(GprsCodingScheme::EGPRS_GMSK));
 	OSMO_ASSERT(!cs.isCompatible(GprsCodingScheme::EGPRS));
@@ -160,7 +160,7 @@
 		OSMO_ASSERT(current_cs.isGprs());
 		OSMO_ASSERT(!current_cs.isEgprs());
 		OSMO_ASSERT(!current_cs.isEgprsGmsk());
-		OSMO_ASSERT(GprsCodingScheme::Scheme(current_cs) == gprs_schemes[i]);
+		OSMO_ASSERT(CodingScheme(current_cs) == gprs_schemes[i]);
 		OSMO_ASSERT(current_cs == GprsCodingScheme(gprs_schemes[i]));
 
 		OSMO_ASSERT(check_strong_monotonicity(&current_cs, last_size_UL, last_size_DL));
@@ -183,7 +183,7 @@
 		OSMO_ASSERT(!current_cs.isGprs());
 		OSMO_ASSERT(current_cs.isEgprs());
 		OSMO_ASSERT(!!current_cs.isEgprsGmsk() == !!egprs_schemes[i].is_gmsk);
-		OSMO_ASSERT(GprsCodingScheme::Scheme(current_cs) == egprs_schemes[i].s);
+		OSMO_ASSERT(CodingScheme(current_cs) == egprs_schemes[i].s);
 		OSMO_ASSERT(current_cs == GprsCodingScheme(egprs_schemes[i].s));
 
 		OSMO_ASSERT(check_strong_monotonicity(&current_cs, last_size_UL, last_size_DL));
@@ -213,7 +213,7 @@
 	printf("=== start %s ===\n", __func__);
 
 	/* TS 44.060, B.1 */
-	cs = GprsCodingScheme::CS4;
+	cs = CS4;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 0;
 	rdbi.ti = 0;
@@ -237,7 +237,7 @@
 	OSMO_ASSERT(!chunks[2].is_complete);
 
 	/* TS 44.060, B.2 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 0;
 	rdbi.ti = 0;
@@ -271,7 +271,7 @@
 	OSMO_ASSERT(!chunks[1].is_complete);
 
 	/* TS 44.060, B.3 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 0;
 	rdbi.ti = 0;
@@ -292,7 +292,7 @@
 	OSMO_ASSERT(chunks[1].is_complete);
 
 	/* TS 44.060, B.4 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 1;
 	rdbi.ti = 0;
@@ -308,7 +308,7 @@
 	OSMO_ASSERT(!chunks[0].is_complete);
 
 	/* TS 44.060, B.6 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 1;
 	rdbi.ti = 0;
@@ -324,7 +324,7 @@
 	OSMO_ASSERT(chunks[0].is_complete);
 
 	/* TS 44.060, B.8.1 */
-	cs = GprsCodingScheme::MCS4;
+	cs = MCS4;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 0;
 	rdbi.ti = 0;
@@ -353,7 +353,7 @@
 	 * includes the FBI/E header bits into the N2 octet count which
 	 * is not consistent with Section 10.3a.1 & 10.3a.2. */
 
-	cs = GprsCodingScheme::MCS2;
+	cs = MCS2;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 0;
 	rdbi.ti = 0;
@@ -417,7 +417,7 @@
 
 	/* Note that the spec confuses the byte numbering here, too (see above) */
 
-	cs = GprsCodingScheme::MCS2;
+	cs = MCS2;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 1;
 	rdbi.ti = 0;
@@ -433,7 +433,7 @@
 	OSMO_ASSERT(chunks[0].is_complete);
 
 	/* CS-1, TLLI, last block, single chunk until the end of the block */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 1;
 	rdbi.ti = 1;
@@ -454,7 +454,7 @@
 	OSMO_ASSERT(chunks[0].is_complete);
 
 	/* Like TS 44.060, B.2, first RLC block but with TLLI */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 0;
 	rdbi.ti = 1;
@@ -476,7 +476,7 @@
 	OSMO_ASSERT(!chunks[0].is_complete);
 
 	/* Like TS 44.060, B.8.1 but with TLLI */
-	cs = GprsCodingScheme::MCS4;
+	cs = MCS4;
 	rdbi.data_len = cs.maxDataBlockBytes();
 	rdbi.e = 0;
 	rdbi.ti = 1;
@@ -543,7 +543,7 @@
 	llc.init();
 
 	/* TS 44.060, B.1 */
-	cs = GprsCodingScheme::CS4;
+	cs = CS4;
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
 	num_chunks = 0;
 	write_offset = 0;
@@ -594,7 +594,7 @@
 	OSMO_ASSERT(data[2] == 0);
 
 	/* TS 44.060, B.2 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -654,7 +654,7 @@
 	OSMO_ASSERT(data[1] == 0);
 
 	/* TS 44.060, B.3 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -693,7 +693,7 @@
 	OSMO_ASSERT(data[2] == 0);
 
 	/* TS 44.060, B.4 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -718,7 +718,7 @@
 	OSMO_ASSERT(data[0] == 0);
 
 	/* TS 44.060, B.5 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -743,7 +743,7 @@
 	OSMO_ASSERT(data[0] == 0);
 
 	/* TS 44.060, B.7 */
-	cs = GprsCodingScheme::CS1;
+	cs = CS1;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -801,7 +801,7 @@
 	OSMO_ASSERT(data[1] == 0);
 
 	/* TS 44.060, B.8.1 */
-	cs = GprsCodingScheme::MCS4;
+	cs = MCS4;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -859,7 +859,7 @@
 	 * includes the FBI/E header bits into the N2 octet count which
 	 * is not consistent with Section 10.3a.1 & 10.3a.2. */
 
-	cs = GprsCodingScheme::MCS2;
+	cs = MCS2;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -991,7 +991,7 @@
 
 	/* Note that the spec confuses the byte numbering here, too (see above) */
 
-	cs = GprsCodingScheme::MCS2;
+	cs = MCS2;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -1017,7 +1017,7 @@
 
 	/* Final block with an LLC of size data_len-1 */
 
-	cs = GprsCodingScheme::MCS2;
+	cs = MCS2;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -1045,7 +1045,7 @@
 
 	/* Final block with an LLC of size data_len-2 */
 
-	cs = GprsCodingScheme::MCS2;
+	cs = MCS2;
 
 	/* Block 1 */
 	gprs_rlc_data_block_info_init(&rdbi, cs, false, 0);
@@ -1081,13 +1081,13 @@
 	uint8_t saved_block[256];
 	uint8_t test_block[256];
 	uint8_t out_block[256];
-	GprsCodingScheme::Scheme scheme;
+	CodingScheme scheme;
 	int pattern;
 	volatile unsigned int block_idx, i;
 
-	for (scheme = GprsCodingScheme::CS1;
-		scheme < GprsCodingScheme::NUM_SCHEMES;
-		scheme = GprsCodingScheme::Scheme(scheme + 1))
+	for (scheme = CS1;
+		scheme < NUM_SCHEMES;
+		scheme = CodingScheme(scheme + 1))
 	{
 		GprsCodingScheme cs(scheme);
 
@@ -1148,13 +1148,13 @@
 
 	printf("=== start %s ===\n", __func__);
 	gprs_rlc_data_info_init_dl(&rlc,
-			GprsCodingScheme(GprsCodingScheme::CS1), false, 0);
+			GprsCodingScheme(CS1), false, 0);
 	OSMO_ASSERT(rlc.num_data_blocks == 1);
 	OSMO_ASSERT(rlc.data_offs_bits[0] == 24);
 	OSMO_ASSERT(rlc.block_info[0].data_len == 20);
 
 	gprs_rlc_data_info_init_dl(&rlc,
-			GprsCodingScheme(GprsCodingScheme::MCS1), false, 0);
+			GprsCodingScheme(MCS1), false, 0);
 	OSMO_ASSERT(rlc.num_data_blocks == 1);
 	OSMO_ASSERT(rlc.data_offs_bits[0] == 33);
 	OSMO_ASSERT(rlc.block_info[0].data_len == 22);
@@ -1193,7 +1193,7 @@
 	int rc, offs;
 
 	/*without padding*/
-	cs = GprsCodingScheme::MCS5;
+	cs = MCS5;
 	egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data;
 	egprs2->r = 1;
 	egprs2->si = 1;
@@ -1218,7 +1218,7 @@
 	OSMO_ASSERT(rlc.block_info[0].bsn == 0);
 
 	/* with padding case */
-	cs = GprsCodingScheme::MCS6;
+	cs = MCS6;
 	egprs2 = (struct gprs_rlc_ul_header_egprs_2 *) data;
 	egprs2->r = 1;
 	egprs2->si = 1;
@@ -1298,7 +1298,7 @@
 	tfi = 1;
 
 	/* MCS 7 */
-	cs = GprsCodingScheme::MCS7;
+	cs = MCS7;
 	egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data;
 	egprs1->si = 1;
 	egprs1->r = 1;
@@ -1326,7 +1326,7 @@
 	OSMO_ASSERT(rlc.tfi == 1);
 
 	/* MCS 8 */
-	cs = GprsCodingScheme::MCS8;
+	cs = MCS8;
 	egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data;
 	egprs1->si = 1;
 	egprs1->r = 1;
@@ -1354,7 +1354,7 @@
 	OSMO_ASSERT(rlc.tfi == 1);
 
 	/* MCS 9 */
-	cs = GprsCodingScheme::MCS9;
+	cs = MCS9;
 	egprs1 = (struct gprs_rlc_ul_header_egprs_1 *) data;
 	egprs1->si = 1;
 	egprs1->r = 1;
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index d78a4ab..0d473a1 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -720,7 +720,7 @@
 	 * TS 44.060, B.8.1
 	 * first seg received first, later second seg
 	 */
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 0;
 	egprs3->r = 1;
@@ -872,7 +872,7 @@
 	 * TS 44.060, B.8.1
 	 * first seg received first, later second seg
 	 */
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -917,7 +917,7 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_DEFAULT);
 	OSMO_ASSERT(block->cs_last ==
-			GprsCodingScheme::MCS6);
+			MCS6);
 	/* Assembled MCS is MCS6. so the size is 74 */
 	OSMO_ASSERT(block->len == 74);
 
@@ -927,7 +927,7 @@
 	 */
 	memset(data_msg, 0, sizeof(data_msg));
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -972,7 +972,7 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_DEFAULT);
 	OSMO_ASSERT(block->cs_last ==
-			GprsCodingScheme::MCS6);
+			MCS6);
 	/* Assembled MCS is MCS6. so the size is 74 */
 	OSMO_ASSERT(block->len == 74);
 
@@ -980,7 +980,7 @@
 	 * TS 44.060, B.8.1
 	 * Error scenario with spb as 1
 	 */
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1017,7 +1017,7 @@
 	for (i = 0; i < 42; i++)
 		data_msg[i] = i;
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1041,7 +1041,7 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_FIRST_SEG_RXD);
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1067,9 +1067,9 @@
 	/* Assembled MCS is MCS6. so the size is 74 */
 	OSMO_ASSERT(block->len == 74);
 	OSMO_ASSERT(block->cs_last ==
-			GprsCodingScheme::MCS6);
+			MCS6);
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1093,7 +1093,7 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_FIRST_SEG_RXD);
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1117,7 +1117,7 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_FIRST_SEG_RXD);
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1141,11 +1141,11 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_DEFAULT);
 	OSMO_ASSERT(block->cs_last ==
-			GprsCodingScheme::MCS6);
+			MCS6);
 	/* Assembled MCS is MCS6. so the size is 74 */
 	OSMO_ASSERT(block->len == 74);
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1169,7 +1169,7 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_SECOND_SEG_RXD);
 
-	cs = GprsCodingScheme::MCS3;
+	cs = MCS3;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 1;
 	egprs3->r = 1;
@@ -1194,7 +1194,7 @@
 	OSMO_ASSERT(block->spb_status.block_status_ul ==
 				EGPRS_RESEG_DEFAULT);
 	OSMO_ASSERT(block->cs_last ==
-			GprsCodingScheme::MCS6);
+			MCS6);
 	/* Assembled MCS is MCS6. so the size is 74 */
 	OSMO_ASSERT(block->len == 74);
 
@@ -2407,7 +2407,7 @@
 	OSMO_ASSERT(ms->ta() == qta/4);
 	OSMO_ASSERT(ms->ul_tbf() == ul_tbf);
 
-	cs = GprsCodingScheme::MCS4;
+	cs = MCS4;
 	egprs3 = (struct gprs_rlc_ul_header_egprs_3 *) data_msg;
 	egprs3->si = 0;
 	egprs3->r = 1;
@@ -2793,8 +2793,8 @@
 	OSMO_ASSERT(bsn1 == 0);
 
 	dl_tbf->ms()->set_current_cs_dl
-		(static_cast < GprsCodingScheme::Scheme >
-			(GprsCodingScheme::CS4 + demanded_mcs));
+		(static_cast < CodingScheme >
+			(CS4 + demanded_mcs));
 
 	fn = fn_add_blocks(fn, 1);
 
@@ -2825,8 +2825,8 @@
 
 	/* Handle (MCS3, MCS3) -> MCS6 case */
 	dl_tbf->ms()->set_current_cs_dl
-		(static_cast < GprsCodingScheme::Scheme >
-			(GprsCodingScheme::CS4 + mcs));
+		(static_cast < CodingScheme >
+			(CS4 + mcs));
 
 	NACK(dl_tbf, 0);
 
@@ -2874,8 +2874,8 @@
 	NACK(dl_tbf, 0);
 
 	dl_tbf->ms()->set_current_cs_dl
-		(static_cast < GprsCodingScheme::Scheme >
-			(GprsCodingScheme::CS4 + demanded_mcs));
+		(static_cast < CodingScheme >
+			(CS4 + demanded_mcs));
 
 	fn = fn_add_blocks(fn, 1);
 
@@ -2961,8 +2961,8 @@
 
 		/* Set the demanded MCS to demanded_mcs */
 		dl_tbf->ms()->set_current_cs_dl
-			(static_cast < GprsCodingScheme::Scheme >
-				(GprsCodingScheme::CS4 + demanded_mcs));
+			(static_cast < CodingScheme >
+				(CS4 + demanded_mcs));
 
 		fn = fn_add_blocks(fn, 1);
 		/* Retransmit the first RLC data block with demanded_mcs */
@@ -2988,8 +2988,8 @@
 		NACK(dl_tbf, 1);
 
 		dl_tbf->ms()->set_current_cs_dl
-			(static_cast < GprsCodingScheme::Scheme >
-				(GprsCodingScheme::CS4 + demanded_mcs));
+			(static_cast < CodingScheme >
+				(CS4 + demanded_mcs));
 
 		fn = fn_add_blocks(fn, 1);
 		/* Send first, second RLC data blocks with demanded_mcs */

-- 
To view, visit https://gerrit.osmocom.org/13064
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I993b49d9a82b8c7ad677d52d11003794aeabe117
Gerrit-Change-Number: 13064
Gerrit-PatchSet: 5
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190313/b1dcc202/attachment.html>


More information about the gerrit-log mailing list