Commit 3fcdec1a authored by Gabriel's avatar Gabriel
Browse files

fix for FDD

parent ceb13b8a
......@@ -8013,13 +8013,20 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
ulsch->bundling = 1-AckNackFBMode;
if (frame_parms->frame_type == FDD) {
int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
//int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
int dl_subframe = subframe;
if (ue->dlsch[subframe_DL(&ue->frame_parms,dl_subframe)&0x1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission
ulsch->harq_processes[harq_pid]->O_ACK = 1;
} else {
ulsch->harq_processes[harq_pid]->O_ACK = 0;
}
LOG_I(PHY,"DCI 0 Processing: dl_subframe %d send_harq_status Odd %d send_harq_status Even %d harq_pid %d O_ACK %d\n", dl_subframe,
ue->dlsch[0][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
ue->dlsch[1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
harq_pid,
ulsch->harq_processes[harq_pid]->O_ACK);
} else {
if (ulsch->bundling)
ulsch->harq_processes[harq_pid]->O_ACK = (dai == 3)? 0 : 1;
......
......@@ -343,6 +343,7 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
status = harq_ack[subframe_dl0].send_harq_status;
LOG_I(PHY,"dl subframe %d send_harq_status %d cw_idx %d, reset %d\n",subframe_dl0, status, cw_idx, do_reset);
if(do_reset)
harq_ack[subframe_dl0].send_harq_status = 0;
//printf("get_ack: Getting ACK/NAK for PDSCH (subframe %d) => %d\n",subframe_dl,o_ACK[0]);
......
......@@ -457,507 +457,16 @@ void compute_cqi_ri_resources(PHY_VARS_UE *ue,
uint8_t transmission_mode = ue->transmission_mode[eNB_id];
LOG_I(PHY,"compute_cqi_ri_resources O_RI %d O %d uci format %d \n",ulsch->O_RI,ulsch->O,ulsch->uci_format);
if (cqi_status == 1 || ri_status == 1)
{
if( (AntennaInfoDedicated__transmissionMode_tm3 == transmission_mode) || (AntennaInfoDedicated__transmissionMode_tm4 == transmission_mode) )
{
ulsch->O_RI = 1;
}
else
{
ulsch->O_RI = 0;
}
//ulsch->O_RI = 0; //we only support 2 antenna ports, so this is always 1 according to 3GPP 36.213 Table
switch(transmission_mode) {
// The aperiodic CQI reporting mode is fixed for every transmission mode instead of being configured by higher layer signaling
case 1:
if ((rnti >= cba_rnti) && (rnti < p_rnti)) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
} else if(meas->rank[eNB_id] == 0) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
} else {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
break;
case 2:
if ((rnti >= cba_rnti) && (rnti < p_rnti)) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
} else if(meas->rank[eNB_id] == 0) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
} else {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
break;
case 3:
if ((rnti >= cba_rnti) && (rnti < p_rnti)) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
} else if(meas->rank[eNB_id] == 0) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
} else {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
break;
case 4:
if ((rnti >= cba_rnti) && (rnti < p_rnti)) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
} else if(meas->rank[eNB_id] == 0) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->o_RI[0] = 0;
} else {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank2_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank2_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank2_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank2_2A;
ulsch->o_RI[0] = 1;
}
break;
case 5:
if ((rnti >= cba_rnti) && (rnti < p_rnti)) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
} else if(meas->rank[eNB_id] == 0) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->o_RI[0] = 0;
} else {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank2_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank2_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank2_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank2_2A;
ulsch->o_RI[0] = 1;
}
break;
case 6:
if ((rnti >= cba_rnti) && (rnti < p_rnti)) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
} else if(meas->rank[eNB_id] == 0) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank1_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank1_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank1_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank1_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank1_2A;
ulsch->o_RI[0] = 0;
} else {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_wideband_cqi_rank2_2A_1_5MHz;
break;
case 25:
ulsch->O = sizeof_wideband_cqi_rank2_2A_5MHz;
break;
case 50:
ulsch->O = sizeof_wideband_cqi_rank2_2A_10MHz;
break;
case 100:
ulsch->O = sizeof_wideband_cqi_rank2_2A_20MHz;
break;
}
ulsch->uci_format = wideband_cqi_rank2_2A;
ulsch->o_RI[0] = 1;
}
break;
case 7:
if ((rnti >= cba_rnti) && (rnti < p_rnti)) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_mcs_CBA_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_mcs_CBA;
ulsch->o_RI[0] = 0;
} else if(meas->rank[eNB_id] == 0) {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 0;
} else {
switch (ue->frame_parms.N_RB_DL) {
case 6:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_1_5MHz;
break;
case 25:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_5MHz;
break;
case 50:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_10MHz;
break;
case 100:
ulsch->O = sizeof_HLC_subband_cqi_nopmi_20MHz;
break;
}
ulsch->uci_format = HLC_subband_cqi_nopmi;
ulsch->o_RI[0] = 1;
}
break;
default:
LOG_E(PHY,"Incorrect Transmission Mode \n");
break;
}
ulsch->O = 4;
}
else
{
ulsch->O_RI = 0;
ulsch->O = 0;
ulsch->uci_format = HLC_subband_cqi_nopmi;
//ulsch->O_RI = 0;
//ulsch->O = 0;
//ulsch->uci_format = HLC_subband_cqi_nopmi;
}
}
......@@ -1051,7 +560,6 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id
}
LOG_D(PHY," srsCellSubframe: %d, srsUeSubframe: %d, Nsymb-pusch: %d \n", pSoundingrs_ul_config_dedicated->srsCellSubframe, pSoundingrs_ul_config_dedicated->srsUeSubframe, ue->ulsch[eNB_id]->Nsymb_pusch);
}
}
......@@ -1875,7 +1383,7 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
// check if we received a PDSCH at subframe_tx - 4
// ==> send ACK/NACK on PUSCH
//ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = ack_status_cw0 + ack_status_cw1;
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = ack_status_cw0 + ack_status_cw1;
#if T_TRACER
if(ue->ulsch[eNB_id]->o_ACK[0])
......
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