aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/coding_scheme.c36
-rw-r--r--src/coding_scheme.h1
-rw-r--r--src/gprs_coding_scheme.cpp42
-rw-r--r--src/gprs_coding_scheme.h3
-rw-r--r--src/tbf_dl.cpp8
5 files changed, 40 insertions, 50 deletions
diff --git a/src/coding_scheme.c b/src/coding_scheme.c
index a4ae8827..eaa49534 100644
--- a/src/coding_scheme.c
+++ b/src/coding_scheme.c
@@ -127,3 +127,39 @@ const struct value_string mode_names[] = {
const char *mode_name(enum mcs_kind val) {
return get_value_string(mode_names, val);
}
+
+/* FIXME: take into account padding and special cases of commanded MCS (MCS-6-9 and MCS-5-7) */
+enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum CodingScheme commanded_mcs, bool resegment_bit)
+{
+ OSMO_ASSERT(mcs_is_edge(initial_mcs));
+ OSMO_ASSERT(mcs_is_edge(commanded_mcs));
+ OSMO_ASSERT(NUM_SCHEMES - MCS1 == 9);
+
+ if (resegment_bit) { /* 3GPP TS 44.060 Table 8.1.1.1, reflected over antidiagonal */
+ enum CodingScheme egprs_reseg[NUM_SCHEMES - MCS1][NUM_SCHEMES - MCS1] = {
+ { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 },
+ { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 },
+ { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 },
+ { MCS1, MCS1, MCS1, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 },
+ { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 },
+ { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 },
+ { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 },
+ { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS8, MCS8 },
+ { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 },
+ };
+ return egprs_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(commanded_mcs)];
+ } else { /* 3GPP TS 44.060 Table 8.1.1.2, reflected over antidiagonal */
+ enum CodingScheme egprs_no_reseg[NUM_SCHEMES - MCS1][NUM_SCHEMES - MCS1] = {
+ { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 },
+ { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 },
+ { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 },
+ { MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 },
+ { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 },
+ { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 },
+ { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 },
+ { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS8, MCS8 },
+ { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 },
+ };
+ return egprs_no_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(commanded_mcs)];
+ }
+}
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
index aac4bba1..24db86de 100644
--- a/src/coding_scheme.h
+++ b/src/coding_scheme.h
@@ -32,6 +32,7 @@ enum CodingScheme {
extern const struct value_string mcs_names[];
const char *mcs_name(enum CodingScheme val);
+enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum CodingScheme commanded_mcs, bool resegment_bit);
bool mcs_is_gprs(enum CodingScheme cs);
bool mcs_is_edge(enum CodingScheme cs);
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index a149f814..0c22670f 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -21,41 +21,6 @@
#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)
- */
-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},
- {MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2},
- {MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3},
- {MCS1, MCS1, MCS1, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4},
- {MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7},
- {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9},
- {MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7},
- {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS8, MCS8},
- {MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9}
- },
- {
- {MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1},
- {MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2},
- {MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3},
- {MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4},
- {MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7},
- {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9},
- {MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7},
- {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS8, MCS8},
- {MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9}
- }
- };
-
enum Family {
FAMILY_INVALID,
FAMILY_A,
@@ -63,13 +28,6 @@ enum Family {
FAMILY_C,
};
-CodingScheme GprsCodingScheme::get_retx_mcs(const GprsCodingScheme mcs,
- const GprsCodingScheme demanded_mcs,
- const unsigned arq_type)
-{
- return egprs_mcs_retx_tbl[arq_type][mcs_chan_code(mcs)][mcs_chan_code(demanded_mcs)];
-}
-
static struct {
struct {
uint8_t bytes;
diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h
index d5604fb4..c31f58fb 100644
--- a/src/gprs_coding_scheme.h
+++ b/src/gprs_coding_scheme.h
@@ -73,9 +73,6 @@ public:
static GprsCodingScheme getGprsByNum(unsigned num);
static GprsCodingScheme getEgprsByNum(unsigned num);
- static CodingScheme get_retx_mcs(const GprsCodingScheme mcs,
- const GprsCodingScheme retx_mcs,
- const unsigned arq_type);
private:
GprsCodingScheme(int s); /* fail on use */
GprsCodingScheme& operator =(int s); /* fail on use */
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 08df05a3..c97436a9 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -378,11 +378,9 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
if (is_egprs_enabled()) {
/* Table 8.1.1.2 and Table 8.1.1.1 of 44.060 */
- m_rlc.block(bsn)->cs_current_trans =
- GprsCodingScheme::get_retx_mcs(
- m_rlc.block(bsn)->cs_init,
- ms()->current_cs_dl(),
- bts->bts_data()->dl_arq_type);
+ m_rlc.block(bsn)->cs_current_trans = get_retx_mcs(m_rlc.block(bsn)->cs_init,
+ ms()->current_cs_dl(),
+ !bts->bts_data()->dl_arq_type);
LOGPTBFDL(this, LOGL_DEBUG,
"initial_cs_dl(%s) last_mcs(%s) demanded_mcs(%s) cs_trans(%s) arq_type(%d) bsn(%d)\n",