Update CPS calculation with new data structures
Update existing CPS calculation function to align with new data structure introduced
This commit is contained in:
parent
7a05b039c8
commit
a859a21800
33
src/rlc.cpp
33
src/rlc.cpp
|
@ -339,21 +339,32 @@ void gprs_rlc_data_block_info_init(struct gprs_rlc_data_block_info *rdbi,
|
|||
rdbi->spb = 0;
|
||||
}
|
||||
|
||||
unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs, int punct, int punct2,
|
||||
int with_padding)
|
||||
unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs,
|
||||
enum egprs_puncturing_values punct,
|
||||
enum egprs_puncturing_values punct2, int with_padding)
|
||||
{
|
||||
switch (GprsCodingScheme::Scheme(cs)) {
|
||||
case GprsCodingScheme::MCS1: return 0b1011 + punct % 2;
|
||||
case GprsCodingScheme::MCS2: return 0b1001 + punct % 2;
|
||||
case GprsCodingScheme::MCS1: return 0b1011 +
|
||||
punct % EGPRS_MAX_PS_NUM_2;
|
||||
case GprsCodingScheme::MCS2: return 0b1001 +
|
||||
punct % EGPRS_MAX_PS_NUM_2;
|
||||
case GprsCodingScheme::MCS3: return (with_padding ? 0b0110 : 0b0011) +
|
||||
punct % 3;
|
||||
case GprsCodingScheme::MCS4: return 0b0000 + punct % 3;
|
||||
case GprsCodingScheme::MCS5: return 0b100 + punct % 2;
|
||||
punct % EGPRS_MAX_PS_NUM_3;
|
||||
case GprsCodingScheme::MCS4: return 0b0000 +
|
||||
punct % EGPRS_MAX_PS_NUM_3;
|
||||
case GprsCodingScheme::MCS5: return 0b100 +
|
||||
punct % EGPRS_MAX_PS_NUM_2;
|
||||
case GprsCodingScheme::MCS6: return (with_padding ? 0b010 : 0b000) +
|
||||
punct % 2;
|
||||
case GprsCodingScheme::MCS7: return 0b10100 + 3 * (punct % 3) + punct2 % 3;
|
||||
case GprsCodingScheme::MCS8: return 0b01011 + 3 * (punct % 3) + punct2 % 3;
|
||||
case GprsCodingScheme::MCS9: return 0b00000 + 4 * (punct % 3) + punct2 % 3;
|
||||
punct % EGPRS_MAX_PS_NUM_2;
|
||||
case GprsCodingScheme::MCS7: return 0b10100 +
|
||||
3 * (punct % EGPRS_MAX_PS_NUM_3) +
|
||||
punct2 % EGPRS_MAX_PS_NUM_3;
|
||||
case GprsCodingScheme::MCS8: return 0b01011 +
|
||||
3 * (punct % EGPRS_MAX_PS_NUM_3) +
|
||||
punct2 % EGPRS_MAX_PS_NUM_3;
|
||||
case GprsCodingScheme::MCS9: return 0b00000 +
|
||||
4 * (punct % EGPRS_MAX_PS_NUM_3) +
|
||||
punct2 % EGPRS_MAX_PS_NUM_3;
|
||||
default: ;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,8 +132,8 @@ void gprs_rlc_data_info_init_ul(struct gprs_rlc_data_info *rlc,
|
|||
GprsCodingScheme cs, bool with_padding);
|
||||
void gprs_rlc_data_block_info_init(struct gprs_rlc_data_block_info *rdbi,
|
||||
GprsCodingScheme cs, bool with_padding);
|
||||
unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs, int punct, int punct2,
|
||||
int with_padding);
|
||||
unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs, enum egprs_puncturing_values
|
||||
punct, enum egprs_puncturing_values punct2, int with_padding);
|
||||
void gprs_rlc_mcs_cps_decode(unsigned int cps, GprsCodingScheme cs,
|
||||
int *punct, int *punct2, int *with_padding);
|
||||
|
||||
|
|
|
@ -589,7 +589,7 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
|
|||
GprsCodingScheme cs;
|
||||
int bsns[ARRAY_SIZE(rlc.block_info)];
|
||||
unsigned num_bsns;
|
||||
int punct[ARRAY_SIZE(rlc.block_info)];
|
||||
enum egprs_puncturing_values punct[ARRAY_SIZE(rlc.block_info)];
|
||||
bool need_padding = false;
|
||||
|
||||
/*
|
||||
|
@ -651,7 +651,8 @@ struct msgb *gprs_rlcmac_dl_tbf::create_dl_acked_block(
|
|||
block_data = m_rlc.block(bsn)->block;
|
||||
|
||||
/* TODO: Use real puncturing values */
|
||||
punct[data_block_idx] = data_block_idx;
|
||||
punct[data_block_idx] =
|
||||
(enum egprs_puncturing_values) data_block_idx;
|
||||
|
||||
rdbi = &rlc.block_info[data_block_idx];
|
||||
block_info = &m_rlc.block(bsn)->block_info;
|
||||
|
|
Loading…
Reference in New Issue