From cad1175154fd4ed20e9e9ff5c2fce35b5b87ef8b Mon Sep 17 00:00:00 2001 From: Melissa Elkadi Date: Wed, 25 Aug 2021 17:15:16 -0700 Subject: [PATCH] Get IP traffic in MAC layer and handling of RAR Previously, we would assume every downlink in slot 7 was an RAR; now we assume every slot 7 that occurs before the CFRA procedure is done is an RAR. Also changed the logic in scheduler to allow us to get nr_ue_sdus in the MAC layer. --- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 34d3a2685e..234f7acc0d 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1041,7 +1041,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator; mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] = 0; } else { - if (!SOFTMODEM_NOS1_BIT && (mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] != + if (!SOFTMODEM_NOS1_BIT || (mac->UL_ndi[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id] != ulcfg_pdu->pusch_config_pdu.pusch_data.new_data_indicator || mac->first_ul_tx[ulcfg_pdu->pusch_config_pdu.pusch_data.harq_process_id]==1)){ diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 0f98ecbbd5..b8414e0baa 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -266,6 +266,7 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_tx_data_request_t *tx_data_request) { + NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); int num_pdus = tx_data_request->Number_of_PDUs; if (num_pdus <= 0) { @@ -304,7 +305,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi pdu += pdu_list->TLVs[j].length; } dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = length; - if (tx_data_request->Slot == 7) { //Melissa this means we have an RAR, sorta hacky though + 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; } else {