aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2019-03-05 14:44:10 +0100
committerMax <msuraev@sysmocom.de>2019-03-12 15:35:40 +0100
commite43ef21d35b0f94d0d3956a3ecb349b084f3749f (patch)
tree2bff4f9d7c44c02a0e02bc19e50219ec6f7b8062
parentbea2edbc46ad990fdbee700a1ecf421f4988de5e (diff)
Make get_retx_mcs() into regular function
Moving from header-defined inline function allows us to hide egprs_mcs_retx_tbl definition and simplify further changes. Change-Id: I95258d1558a3b918ae83f1a69e7c3de2b97e5627
-rw-r--r--src/gprs_coding_scheme.cpp15
-rw-r--r--src/gprs_coding_scheme.h17
2 files changed, 14 insertions, 18 deletions
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index 990e278..bcbb893 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -21,13 +21,16 @@
#include "gprs_coding_scheme.h"
+#define MAX_NUM_ARQ 2 /* max. number of ARQ */
+#define MAX_NUM_MCS 9 /* max. number of MCS */
+
/*
* 44.060 Table 8.1.1.1 and Table 8.1.1.2
* It has 3 level indexing. 0th level is ARQ type
* 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 CodingScheme GprsCodingScheme::egprs_mcs_retx_tbl[MAX_NUM_ARQ]
+static enum CodingScheme egprs_mcs_retx_tbl[MAX_NUM_ARQ]
[MAX_NUM_MCS][MAX_NUM_MCS] = {
{
{MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1},
@@ -60,6 +63,16 @@ enum Family {
FAMILY_C,
};
+CodingScheme GprsCodingScheme::get_retx_mcs(const GprsCodingScheme mcs,
+ const GprsCodingScheme demanded_mcs,
+ const unsigned arq_type)
+{
+ OSMO_ASSERT(mcs.to_num() > 0);
+ OSMO_ASSERT(demanded_mcs.to_num() > 0);
+
+ return egprs_mcs_retx_tbl[arq_type][mcs.to_num() - 1][demanded_mcs.to_num() - 1];
+}
+
static struct {
struct {
uint8_t bytes;
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index 045d34a..d97df08 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -31,8 +31,6 @@ extern "C" {
class GprsCodingScheme {
public:
-#define MAX_NUM_ARQ 2 /* max. number of ARQ */
-#define MAX_NUM_MCS 9 /* max. number of MCS */
#define EGPRS_ARQ1 0x0
#define EGPRS_ARQ2 0x1
@@ -102,9 +100,6 @@ public:
static CodingScheme get_retx_mcs(const GprsCodingScheme mcs,
const GprsCodingScheme retx_mcs,
const unsigned arq_type);
-
- 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 */
@@ -192,15 +187,3 @@ inline bool operator <(GprsCodingScheme a, GprsCodingScheme b)
{
return a.isCompatible(b) && a.to_num() < b.to_num();
}
-
-inline CodingScheme GprsCodingScheme::get_retx_mcs(
- const GprsCodingScheme mcs,
- const GprsCodingScheme demanded_mcs,
- const unsigned arq_type)
-{
- OSMO_ASSERT(mcs.to_num() > 0);
- OSMO_ASSERT(demanded_mcs.to_num() > 0);
-
- return egprs_mcs_retx_tbl[arq_type][mcs.to_num() - 1]
- [demanded_mcs.to_num() - 1];
-}