diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 04252944fdedb4b90eda52c33fa4084ae324ad52..fb2913845664f1f3c3503856aa9246934770f679 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -510,7 +510,6 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format]; } int8_t ret_proc = nr_ue_process_dci(module_id, cc_id, gNB_index, frame, slot, def_dci_pdu_rel15, dci); - memset(def_dci_pdu_rel15, 0, sizeof(dci_pdu_rel15_t)); return ret_proc; } @@ -1961,8 +1960,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac, pucch->n_CCE = current_harq->n_CCE; pucch->N_CCE = current_harq->N_CCE; pucch->delta_pucch = current_harq->delta_pucch; - current_harq->active = false; - current_harq->ack_received = false; } } } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 56c86f74e4b182b284428fa6114cb92a59efcc17..80b0f6135c8ab830a1bd359075b92405f873f354 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -314,6 +314,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi memcpy(pdu, ptr, pdu_list->TLVs[j].length); pdu += pdu_list->TLVs[j].length; } + dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.ack_nack = 1; // Melissa we will come back during channel modelling dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = length; if (tx_data_request->Slot == 7 && mac->ra.ra_state <= WAIT_RAR) { //Melissa this means we have an RAR, sorta hacky though dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_RAR; @@ -852,9 +853,27 @@ int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *u dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; update_harq_status(dl_info, pdu_id); + NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); + fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request; + nr_scheduled_response_t scheduled_response; + fill_scheduled_response(&scheduled_response, + dl_config, + NULL, + NULL, + dl_info->module_id, + dl_info->cc_id, + dl_info->frame, + dl_info->slot, + dl_info->thread_id); + nr_ue_uci_scheduled_response_stub(&scheduled_response); + if(dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.ack_nack) nr_ue_send_sdu(dl_info, ul_time_alignment, pdu_id); + NR_UE_HARQ_STATUS_t *current_harq = &mac->dl_harq_info[g_harq_pid]; + current_harq->active = false; + current_harq->ack_received = false; + return 0; } @@ -922,7 +941,13 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ dl_info->frame, dl_info->slot, dl_info->dci_ind->dci_list+i); - g_harq_pid = mac->def_dci_pdu_rel15[dl_info->dci_ind->dci_list[0].dci_format].harq_pid; + + fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; + dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format]; + g_harq_pid = def_dci_pdu_rel15->harq_pid; + LOG_D(NR_MAC, "Setting harq_pid = %d and dci_index = %d (based on format)\n", g_harq_pid, dci_index->dci_format); + memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); + ret_mask |= (ret << FAPI_NR_DCI_IND); if (ret >= 0) { AssertFatal( nr_ue_if_module_inst[module_id] != NULL, "IF module is NULL!\n" );