Commit b79199b4 authored by knopp's avatar knopp
Browse files

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5397 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7164409e
......@@ -2705,6 +2705,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
uint8_t format1A_size_bits,format1A_size_bytes;
uint8_t format0_size_bits,format0_size_bytes;
uint8_t format1_size_bits,format1_size_bytes;
uint8_t format2_size_bits,format2_size_bytes;
switch (frame_parms->N_RB_DL) {
case 6:
......@@ -2715,6 +2716,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_1_5MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_1_5MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_1_5MHz_TDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_1_5MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_2A_TDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_1_5MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_4A_TDD_t);
}
}
else {
format1A_size_bits = sizeof_DCI1A_1_5MHz_FDD_t;
......@@ -2723,6 +2732,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_1_5MHz_FDD_t);
format1_size_bits = sizeof_DCI1_1_5MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_1_5MHz_FDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_1_5MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_2A_FDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_1_5MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_4A_FDD_t);
}
}
break;
case 25:
......@@ -2734,6 +2751,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_5MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_5MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_5MHz_TDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_5MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_2A_TDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_5MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_4A_TDD_t);
}
}
else {
format1A_size_bits = sizeof_DCI1A_5MHz_FDD_t;
......@@ -2742,6 +2767,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_5MHz_FDD_t);
format1_size_bits = sizeof_DCI1_5MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_5MHz_FDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_5MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_2A_FDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_5MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_4A_FDD_t);
}
}
break;
case 50:
......@@ -2752,6 +2785,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_10MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_10MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_10MHz_TDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_10MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_2A_TDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_10MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_4A_TDD_t);
}
}
else {
format1A_size_bits = sizeof_DCI1A_10MHz_FDD_t;
......@@ -2760,6 +2801,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_10MHz_FDD_t);
format1_size_bits = sizeof_DCI1_10MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_10MHz_FDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_10MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_2A_FDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_10MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_4A_FDD_t);
}
}
break;
......@@ -2771,6 +2820,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_20MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_20MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_20MHz_TDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_20MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_2A_TDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_20MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_4A_TDD_t);
}
}
else {
format1A_size_bits = sizeof_DCI1A_20MHz_FDD_t;
......@@ -2779,6 +2836,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
format0_size_bytes = sizeof(DCI0_20MHz_FDD_t);
format1_size_bits = sizeof_DCI1_20MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_20MHz_FDD_t);
if (frame_parms->nb_antennas_tx == 2) {
format2_size_bits = sizeof_DCI2_20MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_2A_FDD_t);
}
else if (frame_parms->nb_antennas_tx == 4) {
format2_size_bits = sizeof_DCI2_20MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_4A_FDD_t);
}
}
break;
}
......@@ -3096,9 +3161,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
0,
format1A,
format1A,
format2_2A_M10PRB,
sizeof_DCI2_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI2_5MHz_2A_M10PRB_TDD_t),
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
......@@ -3111,7 +3176,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
// Now check UE_SPEC format 2_2A_M10PRB search spaces at aggregation 2
// Now check UE_SPEC format 2 search spaces at aggregation 2
dci_decoding_procedure0(lte_ue_pdcch_vars,0,
subframe,
dci_alloc,
......@@ -3123,9 +3188,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
1,
format1A,
format1A,
format2_2A_M10PRB,
sizeof_DCI2_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI2_5MHz_2A_M10PRB_TDD_t),
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
......@@ -3150,9 +3215,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
2,
format1A,
format1A,
format2_2A_M10PRB,
sizeof_DCI2_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI2_5MHz_2A_M10PRB_TDD_t),
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
......@@ -3178,9 +3243,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *phy_vars_ue,
3,
format1A,
format1A,
format2_2A_M10PRB,
sizeof_DCI2_5MHz_2A_M10PRB_TDD_t,
sizeof(DCI2_5MHz_2A_M10PRB_TDD_t),
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
......
......@@ -553,11 +553,12 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1;
uint8_t frame_type=frame_parms->frame_type;
uint8_t vrb_type=0;
uint8_t mcs=0;
uint8_t mcs=0,mcs1=0,mcs2=0;
uint8_t I_mcs = 0;
uint8_t rv=0;
uint8_t rv=0,rv1=0,rv2=0;
uint8_t rah=0;
uint8_t TPC=0;
// printf("Generate eNB DCI, format %d, rnti %x (pdu %p)\n",dci_format,rnti,dci_pdu);
switch (dci_format) {
......@@ -925,20 +926,231 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
break;
case format2_2A_L10PRB:
return(-1);
break;
case format2_2A_M10PRB:
case format2:
switch (frame_parms->N_RB_DL) {
case 6:
if (frame_parms->nb_antennas_tx == 2) {
if (frame_type == TDD) {
mcs1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_2A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_2A_FDD_t *)dci_pdu)->tpmi;
}
}
else if (frame_parms->nb_antennas_tx == 4) {
if (frame_type == TDD) {
mcs1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_4A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_1_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
}
}
else {
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
}
break;
case 25:
if (frame_parms->nb_antennas_tx == 2) {
if (frame_type == TDD) {
mcs1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_2A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_2A_FDD_t *)dci_pdu)->tpmi;
}
}
else if (frame_parms->nb_antennas_tx == 4) {
if (frame_type == TDD) {
mcs1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_4A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_5MHz_4A_FDD_t *)dci_pdu)->tpmi;
}
}
else {
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
}
break;
case 50:
if (frame_parms->nb_antennas_tx == 2) {
if (frame_type == TDD) {
mcs1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_2A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_2A_FDD_t *)dci_pdu)->tpmi;
}
}
else if (frame_parms->nb_antennas_tx == 4) {
if (frame_type == TDD) {
mcs1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_4A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_10MHz_4A_FDD_t *)dci_pdu)->tpmi;
}
}
else {
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
}
break;
case 100:
if (frame_parms->nb_antennas_tx == 2) {
if (frame_type == TDD) {
mcs1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_2A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_2A_FDD_t *)dci_pdu)->tpmi;
}
}
else if (frame_parms->nb_antennas_tx == 4) {
if (frame_type == TDD) {
mcs1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_4A_TDD_t *)dci_pdu)->tpmi;
}
else {
mcs1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rballoc;
rah = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rah;
rv1 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->harq_pid;
tbswap = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tb_swap;
tpmi = ((DCI2_20MHz_4A_FDD_t *)dci_pdu)->tpmi;
}
}
else {
LOG_E(PHY,"eNB: subframe %d UE %x, Format2 DCI: unsupported number of TX antennas %d\n",frame_parms->nb_antennas_tx);
}
break;
}
harq_pid = ((DCI2_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->harq_pid;
if (harq_pid>=8) {
LOG_E(PHY,"ERROR: Format 2_2A_M10PRB: harq_pid >= 8\n");
LOG_E(PHY,"ERROR: Format 2_2A: harq_pid >= 8\n");
return(-1);
}
tbswap = ((DCI2_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->tb_swap;
// Flip the TB to codeword mapping as described in 5.3.3.1.5 of 36-212 V11.3.0
// note that we must set tbswap=0 in eNB scheduler if one TB is deactivated
if (tbswap == 0) {
dlsch0 = dlsch[0];
dlsch1 = dlsch[1];
......@@ -957,20 +1169,242 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
// printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe);
conv_rballoc(((DCI2_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rah,
((DCI2_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rballoc,frame_parms->N_RB_DL,
conv_rballoc(rah,
rballoc,
frame_parms->N_RB_DL,
dlsch0->rb_alloc);
dlsch1->rb_alloc[0] = dlsch0->rb_alloc[0];
dlsch0->nb_rb = conv_nprb(rah,
rballoc,
frame_parms->N_RB_DL);
dlsch1->nb_rb = dlsch0->nb_rb;
if (dlsch0->nb_rb == 0)
return(-1);
dlsch0->harq_processes[harq_pid]->mcs = mcs1;
dlsch1->harq_processes[harq_pid]->mcs = mcs2;
dlsch0->harq_processes[harq_pid]->rvidx = rv1;
dlsch1->harq_processes[harq_pid]->rvidx = rv2;
// assume both TBs are active
dlsch0->harq_processes[harq_pid]->Nl = 1;
dlsch1->harq_processes[harq_pid]->Nl = 1;
dlsch0->active = 1;
dlsch1->active = 1;
// check if either TB is disabled (see 36-213 V11.3 Section )
if ((dlsch0->harq_processes[harq_pid]->rvidx == 1) && (dlsch0->harq_processes[harq_pid]->mcs == 0)) {
dlsch0->active = 0;
}
if ((dlsch1->harq_processes[harq_pid]->rvidx == 1) && (dlsch1->harq_processes[harq_pid]->mcs == 0)) {
dlsch1->active = 0;
}
dlsch0->nb_rb = conv_nprb(((DCI2_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rah,
((DCI2_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->rballoc,
if (frame_parms->nb_antennas_tx == 2) {
if (dlsch1->active == 1) { // both TBs are active
dlsch0->harq_processes[harq_pid]->TBS = TBStable[get_I_TBS(dlsch0->harq_processes[harq_pid]->mcs)][dlsch0->nb_rb-1];
dlsch1->harq_processes[harq_pid]->TBS = TBStable[get_I_TBS(dlsch1->harq_processes[harq_pid]->mcs)][dlsch0->nb_rb-1];
switch (tpmi) {
case 0:
dlsch0->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING11;
dlsch1->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING1m1;
dlsch0->pmi_alloc = pmi_extend(frame_parms,0);
dlsch1->pmi_alloc = pmi_extend(frame_parms,1);
break;
case 1:
dlsch0->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING1j;
dlsch1->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING1mj;
dlsch0->pmi_alloc = pmi_extend(frame_parms,2);
dlsch0->pmi_alloc = pmi_extend(frame_parms,3);
break;
case 2: // PUSCH precoding
dlsch0->harq_processes[harq_pid]->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch0->pmi_alloc = DL_pmi_single;
dlsch1->harq_processes[harq_pid]->mimo_mode = DUALSTREAM_PUSCH_PRECODING;
dlsch1->pmi_alloc = DL_pmi_single;
break;
default:
break;
}
dlsch0->harq_processes[harq_pid]->TBS = TBStable[get_I_TBS(dlsch0->harq_processes[harq_pid]->mcs)][dlsch0->nb_rb-1];
dlsch1->harq_processes[harq_pid]->TBS = TBStable[get_I_TBS(dlsch1->harq_processes[harq_pid]->mcs)][dlsch1->nb_rb-1];
}
else { // only one is active
switch (tpmi) {
case 0 :
dlsch0->harq_processes[harq_pid]->mimo_mode = ALAMOUTI;
break;
case 1:
dlsch0->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING11;
dlsch0->pmi_alloc = pmi_extend(frame_parms,0);
break;
case 2:
dlsch0->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING1m1;
dlsch0->pmi_alloc = pmi_extend(frame_parms,1);
break;
case 3:
dlsch0->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING1j;
dlsch0->pmi_alloc = pmi_extend(frame_parms,2);
break;
case 4:
dlsch0->harq_processes[harq_pid]->mimo_mode = UNIFORM_PRECODING1mj;
dlsch0->pmi_alloc = pmi_extend(frame_parms,3);
break;
case 5:
dlsch0->harq_processes[harq_pid]->mimo_mode = PUSCH_PRECODING0;
dlsch0->pmi_alloc = DL_pmi_single;
break;
case 6:
dlsch0->harq_processes[harq_pid]->mimo_mode = PUSCH_PRECODING1;
dlsch0->pmi_alloc = DL_pmi_single;
break;
}
dlsch0->harq_processes[harq_pid]->TBS = TBStable[get_I_TBS(dlsch0->harq_processes[harq_pid]->mcs)][dlsch0->nb_rb-1];
}
}
else if (frame_parms->nb_antennas_tx == 4) {
// fill in later
}
// reset HARQ process if this is the first transmission
if (dlsch0->harq_processes[harq_pid]->round == 0) {
dlsch0->harq_processes[harq_pid]->status = ACTIVE;
}
if (dlsch1->harq_processes[harq_pid]->round == 0) {
dlsch1->harq_processes[harq_pid]->status = ACTIVE;
}
dlsch0->rnti = rnti;
dlsch1->rnti = rnti;
dlsch0->dl_power_off = 0;
dlsch1->dl_power_off = 0;
break;
case format2B:
switch (frame_parms->N_RB_DL) {
case 6:
if (frame_type == TDD) {
mcs1 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2B_1_5MHz_TDD_t *)dci_pdu)->harq_pid;
}
else {
mcs1 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->rballoc;
rv1 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2B_1_5MHz_FDD_t *)dci_pdu)->harq_pid;
}
break;
case 25:
if (frame_type == TDD) {
mcs1 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->mcs1;
mcs2 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->mcs2;
rballoc = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rah;
rv1 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rv1;
rv2 = ((DCI2B_5MHz_TDD_t *)dci_pdu)->rv2;
harq_pid = ((DCI2B_5MHz_TDD_t *)dci_pdu)->harq_pid;