Commit 746fb828 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge remote-tracking branch 'origin/NR_UE_get_Qm_dl_fix' into develop_integration_2020_w36

parents 2dcf50a5 15a376fa
...@@ -1616,92 +1616,156 @@ uint16_t Table_61412[28][2] = {{2,30},{2,40},{2,50},{2,64},{2,78},{2,99},{2,120} ...@@ -1616,92 +1616,156 @@ uint16_t Table_61412[28][2] = {{2,30},{2,40},{2,50},{2,64},{2,78},{2,99},{2,120}
uint8_t nr_get_Qm_dl(uint8_t Imcs, uint8_t table_idx) { uint8_t nr_get_Qm_dl(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) { switch(table_idx) {
case 0: case 0:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 0 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51311[Imcs][0]); return (Table_51311[Imcs][0]);
break; break;
case 1: case 1:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 1 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_51312[Imcs][0]); return (Table_51312[Imcs][0]);
break; break;
case 2: case 2:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 2 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51313[Imcs][0]); return (Table_51313[Imcs][0]);
break; break;
default: default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx); AssertFatal(0, "Invalid MCS table index %d (expected in range [0,2])\n", table_idx);
} }
} }
uint32_t nr_get_code_rate_dl(uint8_t Imcs, uint8_t table_idx) { uint32_t nr_get_code_rate_dl(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) { switch(table_idx) {
case 0: case 0:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 0 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51311[Imcs][1]); return (Table_51311[Imcs][1]);
break; break;
case 1: case 1:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 1 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_51312[Imcs][1]); return (Table_51312[Imcs][1]);
break; break;
case 2: case 2:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 2 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51313[Imcs][1]); return (Table_51313[Imcs][1]);
break; break;
default: default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx); AssertFatal(0, "Invalid MCS table index %d (expected in range [0,2])\n", table_idx);
} }
} }
uint8_t nr_get_Qm_ul(uint8_t Imcs, uint8_t table_idx) { uint8_t nr_get_Qm_ul(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) { switch(table_idx) {
case 0: case 0:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 0 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51311[Imcs][0]); return (Table_51311[Imcs][0]);
break; break;
case 1: case 1:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 1 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_51312[Imcs][0]); return (Table_51312[Imcs][0]);
break; break;
case 2: case 2:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 2 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51313[Imcs][0]); return (Table_51313[Imcs][0]);
break; break;
case 3: case 3:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 3 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_61411[Imcs][0]); return (Table_61411[Imcs][0]);
break; break;
case 4: case 4:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 4 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_61412[Imcs][0]); return (Table_61412[Imcs][0]);
break; break;
default: default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,2])\n", table_idx); AssertFatal(0, "Invalid MCS table index %d (expected in range [0,4])\n", table_idx);
} }
} }
uint32_t nr_get_code_rate_ul(uint8_t Imcs, uint8_t table_idx) { uint32_t nr_get_code_rate_ul(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) { switch(table_idx) {
case 0: case 0:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 0 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51311[Imcs][1]); return (Table_51311[Imcs][1]);
break; break;
case 1: case 1:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 1 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_51312[Imcs][1]); return (Table_51312[Imcs][1]);
break; break;
case 2: case 2:
if (Imcs > 28) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 2 (expected range [0,28])\n", Imcs);
Imcs = 28;
}
return (Table_51313[Imcs][1]); return (Table_51313[Imcs][1]);
break; break;
case 3: case 3:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 3 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_61411[Imcs][1]); return (Table_61411[Imcs][1]);
break; break;
case 4: case 4:
if (Imcs > 27) {
LOG_E(MAC, "Invalid MCS index %d for MCS table 4 (expected range [0,27])\n", Imcs);
Imcs = 27;
}
return (Table_61412[Imcs][1]); return (Table_61412[Imcs][1]);
break; break;
default: default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,2])\n", table_idx); AssertFatal(0, "Invalid MCS table index %d (expected in range [0,4])\n", table_idx);
} }
} }
......
...@@ -3801,9 +3801,8 @@ void nr_ue_process_mac_pdu(module_id_t module_idP, ...@@ -3801,9 +3801,8 @@ void nr_ue_process_mac_pdu(module_id_t module_idP,
} }
pdu_ptr += ( mac_subheader_len + mac_ce_len + mac_sdu_len ); pdu_ptr += ( mac_subheader_len + mac_ce_len + mac_sdu_len );
pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len );
if (pdu_len < 0) //AssertFatal(pdu_len >= 0, "[MAC] nr_ue_process_mac_pdu, residual mac pdu length %d < 0!, mac_pdu_len %d, mac_sdu_len %d, mac_ce_len %d, mac_subheader_len %d\n", if (pdu_len < 0)
LOG_E(MAC,"nr_ue_process_mac_pdu, residual mac pdu length %d < 0!, mac_pdu_len %d, mac_sdu_len %d, mac_ce_len %d, mac_subheader_len %d\n", LOG_E(MAC, "[MAC] nr_ue_process_mac_pdu, residual mac pdu length %d < 0!\n", pdu_len);
pdu_len,mac_pdu_len,mac_sdu_len,mac_ce_len,mac_sdu_len);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment