diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 9d980c666cb83497b90d0a42394607da09d0e897..d08f7cb0bda324e0d1f7fdcdf8a882bac6a1ecf3 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -492,6 +492,12 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg) nr_ue_ul_indication(&ul_info); check_nr_prach(mac, &ul_info, &prach_resources); } + if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa) { + NR_UE_MAC_INST_t *mac = get_mac_inst(0); + protocol_ctxt_t ctxt; + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, 0, ENB_FLAG_NO, mac->crnti, frame, slot, 0); + pdcp_run(&ctxt); + } process_queued_nr_nfapi_msgs(mac, sfn_slot); free(slot_ind); slot_ind = NULL; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index f6f28d8cf2842d70fd0545756560d22f87726054..20ae10beca1ad46d8b22b3b4f503dcef6197b42d 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -458,7 +458,7 @@ int main( int argc, char **argv ) { init_NR_UE(1,rrc_config_path); - int mode_offset = get_softmodem_params()->nsa ? NUMBER_OF_UE_MAX : 0; + int mode_offset = get_softmodem_params()->nsa ? NUMBER_OF_UE_MAX : 1; uint16_t node_number = get_softmodem_params()->node_number; ue_id_g = (node_number == 0) ? 0 : node_number - 2; AssertFatal(ue_id_g >= 0, "UE id is expected to be nonnegative.\n"); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index d330060b7902c74d35dfbfe743ce8466924c3bbb..711e81f7f6f2a850fbac03ae81ce382bebefdfc6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -599,6 +599,15 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format]; + if (get_softmodem_params()->sa) { + if (((dci->rnti != 0xFFFF) && (mac->ra.ra_state <= GENERATE_PREAMBLE)) || + ((dci->rnti != 0x10b) && (mac->ra.ra_state == WAIT_RAR)) || + ((dci->rnti != mac->ra.t_crnti ) && (mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION)) || + ((dci->rnti != mac->crnti ) && (mac->ra.ra_state == RA_SUCCEEDED))) { + return -1; + } + } + LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n", dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits); int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15); @@ -3795,6 +3804,11 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t LOG_D(NR_MAC, "In %s:[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", __FUNCTION__, frame, slot, mod_id, preamble_index); + if (ra->RA_RAPID_found == 1) + { + return -1; + } + while (1) { n_subheaders++; if (rarh->T == 1) { diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index a63b5efc301c10de8db7ab810d3ef34c40bfd585..7c880db211f140cd86412be5cd1ed8d2050150ac 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -278,6 +278,12 @@ static bool is_my_dci(NR_UE_MAC_INST_t *mac, nfapi_nr_dl_dci_pdu_t *received_pdu { if (received_pdu->RNTI != mac->crnti && mac->ra.ra_state == RA_SUCCEEDED) return false; + if (received_pdu->RNTI != mac->ra.t_crnti && mac->ra.ra_state == WAIT_CONTENTION_RESOLUTION) + return false; + if (received_pdu->RNTI != 0x10b && mac->ra.ra_state == WAIT_RAR) + return false; + if (received_pdu->RNTI != 0xFFFF && mac->ra.ra_state <= GENERATE_PREAMBLE) + return false; } return true; } @@ -316,7 +322,10 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_ uint16_t num_dcis = pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci; if (num_dcis > 0) { - dl_info->dci_ind = CALLOC(1, sizeof(fapi_nr_dci_indication_t)); + if (!dl_info->dci_ind && !pdu_idx) + { + dl_info->dci_ind = CALLOC(1, sizeof(fapi_nr_dci_indication_t)); + } dl_info->dci_ind->SFN = dl_tti_request->SFN; dl_info->dci_ind->slot = dl_tti_request->Slot; AssertFatal(num_dcis < sizeof(dl_info->dci_ind->dci_list) / sizeof(dl_info->dci_ind->dci_list[0]), @@ -1044,6 +1053,10 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ dl_info->dci_ind->dci_list+i); fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i; + if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) { + LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n"); + break; + } 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);