Add data structure for ARQ-II in EGPRS DL

Modify the existing data structure to support ARQ-II for Retx in EGPRS DL.
This will also hadle compilation issue related to renaming the variable.

Change-Id: I734b1024bb32f2daa43af4adf59f4a17f2294afe
This commit is contained in:
Aravind Sirsikar 2016-07-12 14:17:12 +05:30
parent 899d36d813
commit 914955209e
5 changed files with 60 additions and 10 deletions

View File

@ -21,6 +21,38 @@
#include "gprs_coding_scheme.h"
/*
* 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 GprsCodingScheme::Scheme GprsCodingScheme::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}
}
};
static struct {
struct {
unsigned int bytes;

View File

@ -26,6 +26,12 @@
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
enum Scheme {
UNKNOWN,
CS1, CS2, CS3, CS4,
@ -105,6 +111,8 @@ public:
static GprsCodingScheme getEgprsByNum(unsigned num);
static const char *modeName(Mode mode);
static enum Scheme 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 */

View File

@ -119,7 +119,17 @@ struct gprs_rlc_data {
uint8_t len;
struct gprs_rlc_data_block_info block_info;
GprsCodingScheme cs;
/*
* cs_current_trans is variable to hold the cs_last value for
* current transmission. cs_current_trans is same as cs_last during
* transmission case. during retransmission cs_current_trans is
* fetched from egprs_mcs_retx_tbl table based on
* cs and demanded cs.reference is 44.060 Table
* 8.1.1.1 and Table 8.1.1.2
* For UL. cs_last shall be used everywhere.
*/
GprsCodingScheme cs_current_trans;
GprsCodingScheme cs_last;
/* puncturing scheme value to be used for next transmission*/
enum egprs_puncturing_values next_ps;

View File

@ -361,7 +361,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
bsn = m_window.resend_needed();
if (previous_bsn >= 0) {
force_cs = m_rlc.block(previous_bsn)->cs;
force_cs = m_rlc.block(previous_bsn)->cs_last;
if (!force_cs.isEgprs())
return -1;
force_data_len = m_rlc.block(previous_bsn)->len;
@ -375,7 +375,7 @@ int gprs_rlcmac_dl_tbf::take_next_bsn(uint32_t fn,
m_window.mod_sns(bsn - previous_bsn) > RLC_EGPRS_MAX_BSN_DELTA)
return -1;
cs2 = m_rlc.block(bsn)->cs;
cs2 = m_rlc.block(bsn)->cs_last;
data_len2 = m_rlc.block(bsn)->len;
if (force_data_len > 0 && force_data_len != data_len2)
return -1;
@ -500,7 +500,7 @@ int gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, GprsCodingScheme cs)
/* now we still have untransmitted LLC data, so we fill mac block */
rlc_data = m_rlc.block(bsn);
data = rlc_data->prepare(block_data_len);
rlc_data->cs = cs;
rlc_data->cs_last = cs;
rlc_data->len = block_data_len;
rdbi = &(rlc_data->block_info);
@ -565,7 +565,7 @@ int gprs_rlcmac_dl_tbf::create_new_bsn(const uint32_t fn, GprsCodingScheme cs)
} while (ar == Encoding::AR_COMPLETED_SPACE_LEFT);
LOGP(DRLCMACDL, LOGL_DEBUG, "data block (BSN %d, %s): %s\n",
bsn, rlc_data->cs.name(),
bsn, rlc_data->cs_last.name(),
osmo_hexdump(rlc_data->block, block_data_len));
/* raise send state and set ack state array */
m_window.m_v_b.mark_unacked(bsn);
@ -604,7 +604,7 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
* be put into the data area, even if the resulting CS is higher than
* the current limit.
*/
cs = m_rlc.block(index)->cs;
cs = m_rlc.block(index)->cs_last;
bsns[0] = index;
num_bsns = 1;
@ -650,7 +650,7 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
else
bsn = bsns[0];
cs_enc = m_rlc.block(bsn)->cs;
cs_enc = m_rlc.block(bsn)->cs_last;
/* get data and header from current block */
block_data = m_rlc.block(bsn)->block;
@ -817,7 +817,7 @@ int gprs_rlcmac_dl_tbf::analyse_errors(char *show_rbb, uint8_t ssn,
/* Get statistics for current CS */
if (rlc_data->cs != current_cs()) {
if (rlc_data->cs_last != current_cs()) {
/* This block has already been encoded with a different
* CS, so it doesn't help us to decide, whether the
* current CS is ok. Ignore it. */

View File

@ -51,7 +51,7 @@ int gprs_rlcmac_ul_tbf::assemble_forward_llc(const gprs_rlc_data *_data)
const uint8_t *data = _data->block;
uint8_t len = _data->len;
const struct gprs_rlc_data_block_info *rdbi = &_data->block_info;
GprsCodingScheme cs = _data->cs;
GprsCodingScheme cs = _data->cs_last;
Decoding::RlcData frames[16], *frame;
int i, num_frames = 0;
@ -224,7 +224,7 @@ int gprs_rlcmac_ul_tbf::rcv_data_block_acknowledged(
m_window.mod_sns(m_window.v_q() + ws - 1));
block = m_rlc.block(rdbi->bsn);
block->block_info = *rdbi;
block->cs = rlc->cs;
block->cs_last = rlc->cs;
OSMO_ASSERT(rdbi->data_len <= sizeof(block->block));
rlc_data = &(block->block[0]);
/* TODO: Handle SPB != 0 -> Set length to 2*len, add offset if