aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-03-06 17:04:59 +0100
committerMax <msuraev@sysmocom.de>2019-03-12 15:35:40 +0100
commitbea2edbc46ad990fdbee700a1ecf421f4988de5e (patch)
tree1c055b347c471b23e0b185c04d79747fdfd18fd2 /src
parent1beed38b54592368d627f0cb58c655627c02ef7e (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/coding_scheme.h29
-rw-r--r--src/gprs_coding_scheme.cpp12
-rw-r--r--src/gprs_coding_scheme.h43
-rw-r--r--src/gprs_ms.cpp20
-rw-r--r--src/gprs_ms.h2
-rw-r--r--src/rlc.cpp100
-rw-r--r--src/tbf_dl.cpp70
-rw-r--r--src/tbf_ul.cpp42
9 files changed, 168 insertions, 151 deletions
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 @@ noinst_HEADERS = \
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 @@ static struct {
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 @@ void GprsCodingScheme::inc(Mode mode)
/* 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 @@ void GprsCodingScheme::dec(Mode mode)
/* 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 @@ void GprsCodingScheme::inc()
if (!isValid())
return;
- m_scheme = Scheme(m_scheme + 1);
+ m_scheme = CodingScheme(m_scheme + 1);
}
void GprsCodingScheme::dec()
@@ -280,7 +280,7 @@ void GprsCodingScheme::dec()
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 @@ public:
#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 @@ public:
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 @@ public:
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 @@ inline bool GprsCodingScheme::isCompatible(GprsCodingScheme o) const
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 @@ inline GprsCodingScheme GprsCodingScheme::getGprsByNum(unsigned num)
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 @@ inline GprsCodingScheme GprsCodingScheme::getEgprsByNum(unsigned num)
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)
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 @@ void GprsMs::set_mode(GprsCodingScheme::Mode mode)
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 @@ void GprsMs::set_mode(GprsCodingScheme::Mode mode)
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 @@ GprsCodingScheme GprsMs::max_cs_ul() const
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 @@ GprsCodingScheme GprsMs::max_cs_ul() const
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 @@ GprsCodingScheme GprsMs::max_cs_dl() const
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 @@ GprsCodingScheme GprsMs::max_cs_dl() const
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 @@ GprsCodingScheme GprsMs::current_cs_dl() const
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 @@ public:
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 @@ unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs,
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 @@ unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs,
}
/* 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 @@ void gprs_rlc_mcs_cps_decode(unsigned int cps,
*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 @@ enum egprs_puncturing_values gprs_get_punct_scheme(
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 @@ enum egprs_puncturing_values gprs_get_punct_scheme(
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 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
* 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 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
* 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 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
* 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 @@ enum egprs_rlc_dl_reseg_bsn_state
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 @@ enum egprs_rlc_dl_reseg_bsn_state
(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 @@ enum egprs_rlcmac_dl_spb gprs_rlcmac_dl_tbf::get_egprs_dl_spb(const int bsn)
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 @@ void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme
{
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 @@ egprs_rlc_ul_reseg_bsn_state gprs_rlcmac_ul_tbf::handle_egprs_ul_spb(
* 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 @@ void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme
{
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;