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
This commit is contained in:
Max 2019-03-05 14:44:10 +01:00
parent bea2edbc46
commit e43ef21d35
2 changed files with 14 additions and 18 deletions

View File

@ -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;

View File

@ -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];
}