diff --git a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf index e0d31e46f7..3a14b8c7f7 100644 --- a/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -10,10 +10,10 @@ gNBs = gNB_name = "gNB-OAI"; // Tracking area code, 0x0000 and 0xfffe are reserved values - tracking_area_code = 1; + tracking_area_code = 40960; plmn_list = ({ mcc = 208; - mnc = 99; + mnc = 95; mnc_length = 2; snssaiList = ( { @@ -205,7 +205,7 @@ gNBs = ////////// AMF parameters: - amf_ip_address = ( { ipv4 = "192.168.61.195"; + amf_ip_address = ( { ipv4 = "192.168.70.132"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; diff --git a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf index b12e0c8d05..f5563ecc02 100644 --- a/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/episci/episci_nr-ue.nfapi.conf @@ -15,6 +15,14 @@ log_config = { rrc_log_verbosity ="full"; }; +uicc0 = { +imsi = "208950000000031"; +key = "0c0a34601d4f07677303652c0462535b"; +opc= "63bfa50ee6523365ff14c1f45f88737d"; +dnn= "oai"; +nssai_sst=222; +nssai_sd=123; +} L1s = ( { diff --git a/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf b/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf index e98e1b92f1..1ebe993038 100644 --- a/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf +++ b/ci-scripts/conf_files/episci/episci_ue_test_sfr.conf @@ -92,14 +92,14 @@ UE0: }; SIM: { - MSIN="100000025"; + MSIN="0000000031"; USIM_API_K="0c0a34601d4f07677303652c0462535b"; - OPC="ba05688178e398bedc100674071002cb"; + OPC="63bfa50ee6523365ff14c1f45f88737d"; MSISDN="1011234561024"; }; # Home PLMN Selector with Access Technology - HPLMN= "320230"; + HPLMN= "20895"; # User controlled PLMN Selector with Access Technology UCPLMN_LIST = (); diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 96fbb9686e..01444167b0 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -492,7 +492,7 @@ 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) { + 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); diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index c2ae84963b..3487635063 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -80,7 +80,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response rx_ind->sfn = scheduled_response->ul_config->sfn; rx_ind->slot = scheduled_response->ul_config->slot; rx_ind->number_of_pdus = scheduled_response->tx_request->number_of_pdus; - rx_ind->pdu_list = CALLOC(1, sizeof(*rx_ind->pdu_list)); + rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list)); for (int j = 0; j < rx_ind->number_of_pdus; j++) { fapi_nr_tx_request_body_t *tx_req_body = &scheduled_response->tx_request->tx_request_body[j]; @@ -102,7 +102,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response crc_ind->number_crcs = scheduled_response->ul_config->number_pdus; crc_ind->sfn = scheduled_response->ul_config->sfn; crc_ind->slot = scheduled_response->ul_config->slot; - crc_ind->crc_list = CALLOC(1, sizeof(*crc_ind->crc_list)); + crc_ind->crc_list = CALLOC(crc_ind->number_crcs, sizeof(*crc_ind->crc_list)); for (int j = 0; j < crc_ind->number_crcs; j++) { crc_ind->crc_list[j].handle = pusch_config_pdu->handle; diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c index 508aa9cf5f..f5372ae6ab 100644 --- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.c +++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.c @@ -1288,7 +1288,7 @@ pdcp_run ( // IP/NAS -> PDCP traffic : TX, read the pkt from the upper layer buffer // if (LINK_ENB_PDCP_TO_GTPV1U && ctxt_pP->enb_flag == ENB_FLAG_NO) { - if (!get_softmodem_params()->nsa && (!EPC_MODE_ENABLED || ctxt_pP->enb_flag == ENB_FLAG_NO)) { + if (!get_softmodem_params()->emulate_l1 && (!EPC_MODE_ENABLED || ctxt_pP->enb_flag == ENB_FLAG_NO)) { pdcp_fifo_read_input_sdus(ctxt_pP); } @@ -1298,7 +1298,7 @@ pdcp_run ( } else { start_meas(&UE_pdcp_stats[ctxt_pP->module_id].pdcp_ip); } - if(!get_softmodem_params()->nsa) { + if (!get_softmodem_params()->emulate_l1) { pdcp_fifo_flush_sdus(ctxt_pP); } diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 7c880db211..dab83672cb 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -506,6 +506,52 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n dl_info->slot = ul_dci_req->Slot; } +static nfapi_nr_uci_indication_t *multiplex_uci_ind(NR_UE_MAC_INST_t *mac, int num_active_harqs) +{ + if (num_active_harqs <= 0) + { + return NULL; + } + if (num_active_harqs != nr_uci_ind_queue.num_items) + { + LOG_I(NR_MAC, "The number of active harqs %d doesn't match the number of UCIs in the queue %lu\n", + num_active_harqs, nr_uci_ind_queue.num_items); + return NULL; + } + + nfapi_nr_uci_indication_t *uci_ind = MALLOC(sizeof(*uci_ind)); + uci_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION; + uci_ind->sfn = NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.active_harq_sfn_slot); + uci_ind->slot = NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.active_harq_sfn_slot); + uci_ind->num_ucis = num_active_harqs; + uci_ind->uci_list = MALLOC(uci_ind->num_ucis * sizeof(*uci_ind->uci_list)); + for (int i = 0; i < num_active_harqs; i++) + { + nfapi_nr_uci_indication_t *queued_uci_ind = get_queue(&nr_uci_ind_queue); + /* In openair1/SCHED_NR_UE/fapi_nr_ue_l1.c nr_ue_schedule_response_stub(), the + number of UCIs is hard coded to 1. This is why we always use index 0 of the + queued UCI indication to fill the new multiplexed UCI indication */ + AssertFatal(queued_uci_ind, "There was not a UCI in the queue!\n"); + + nfapi_nr_uci_pucch_pdu_format_0_1_t *pdu_0_1 = &uci_ind->uci_list[i].pucch_pdu_format_0_1; + memset(pdu_0_1, 0, sizeof(*pdu_0_1)); + AssertFatal(i < uci_ind->num_ucis, + "Attempting to index past end of uci_list array. Index = %d\n", + i); + uci_ind->uci_list[i].pdu_type = queued_uci_ind->uci_list[0].pdu_type; + uci_ind->uci_list[i].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t); + + nfapi_nr_uci_pucch_pdu_format_0_1_t *queued_pdu_0_1 = &queued_uci_ind->uci_list[0].pucch_pdu_format_0_1; + pdu_0_1->handle = queued_pdu_0_1->handle; + pdu_0_1->rnti = queued_pdu_0_1->rnti; + pdu_0_1->pucch_format = queued_pdu_0_1->pucch_format; + pdu_0_1->ul_cqi = queued_pdu_0_1->ul_cqi; + pdu_0_1->timing_advance = queued_pdu_0_1->timing_advance; + pdu_0_1->rssi = queued_pdu_0_1->rssi; + } + return uci_ind; +} + static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_nr_ul_tti_request_t *ul_tti_req) { NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id); @@ -518,6 +564,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n AssertFatal(num_pdus <= sizeof(ul_tti_req->pdus_list) / sizeof(ul_tti_req->pdus_list[0]), "Too many pdus %d in ul_tti_req\n", num_pdus); + bool sent_uci = false; for (int i = 0; i < num_pdus; i++) { nfapi_nr_ul_tti_request_number_of_pdus_t *pdu_list = &ul_tti_req->pdus_list[i]; @@ -525,8 +572,15 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n pdu_list->pdu_type, ul_tti_req->pdus_list[i].pucch_pdu.rnti, pdu_list->pucch_pdu.sr_flag, pdu_list->pucch_pdu.bit_len_harq); if (pdu_list->pdu_type == NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE && pdu_list->pucch_pdu.rnti == mac->crnti) { - LOG_I(NR_MAC, "This is the number of UCIs in the queue %ld\n", nr_uci_ind_queue.num_items); - nfapi_nr_uci_indication_t *uci_ind = get_queue(&nr_uci_ind_queue); + if (nr_uci_ind_queue.num_items <= 0) + { + return; + } + + int num_active_harqs = pdu_list->pucch_pdu.bit_len_harq; + LOG_I(NR_MAC, "The number of active harqs %d from ul_tti_req\n", num_active_harqs); + nfapi_nr_uci_indication_t *uci_ind = multiplex_uci_ind(mac, num_active_harqs); + if (uci_ind && uci_ind->num_ucis > 0) { LOG_D(NR_MAC, "This is the SFN/SF [%d, %d] and RNTI %x of the UCI ind. ul_tti_req.pdu[%d]->rnti = %x \n", @@ -564,6 +618,7 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n .uci_ind = *uci_ind, }; send_nsa_standalone_msg(&UL_INFO, uci_ind->header.message_id); + sent_uci = true; for (int k = 0; k < uci_ind->num_ucis; k++) { @@ -586,9 +641,17 @@ static void copy_ul_tti_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n free(uci_ind); uci_ind = NULL; } - } - + } + if (!sent_uci) + { + LOG_E(NR_MAC, "The UL_TTI_REQ did not sent a UCI to the gNB. \n"); + if (!put_queue(&nr_ul_tti_req_queue, ul_tti_req)) + { + LOG_E(NR_PHY, "put_queue failed for ul_tti_req.\n"); + free(ul_tti_req); + ul_tti_req = NULL; + } } } @@ -916,7 +979,7 @@ void *nrue_standalone_pnf_task(void *context) nr_phy_channel_params_t *ch_info = CALLOC(1, sizeof(*ch_info)); memcpy(ch_info, buffer, sizeof(*ch_info)); - LOG_I(NR_PHY, "Received_SINR = %f, sfn:slot %d:%d\n", + LOG_D(NR_PHY, "Received_SINR = %f, sfn:slot %d:%d\n", ch_info->sinr, NFAPI_SFNSLOT2SFN(ch_info->sfn_slot), NFAPI_SFNSLOT2SLOT(ch_info->sfn_slot)); if (!put_queue(&nr_chan_param_queue, ch_info)) @@ -1053,6 +1116,8 @@ 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; + + /* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */ 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; diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index b6259d0161..79b5318b4b 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -7975,7 +7975,7 @@ rrc_eNB_decode_dcch( /*FK: left the condition as is for the case MME is used (S1 mode) but setting dedicated_DRB = 1 otherwise (noS1 mode) so that no second RRCReconfiguration message activationg more DRB is sent as this causes problems with the nasmesh driver.*/ int flexran_agent_handover = 0; - if (EPC_MODE_ENABLED || get_softmodem_params()->nsa) { + if (EPC_MODE_ENABLED || get_softmodem_params()->emulate_l1) { if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { dedicated_DRB = 1; LOG_I(RRC, diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index e02f500e63..f11dc65195 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -397,7 +397,19 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, SEQUENCE_free( &asn_DEF_NR_RadioBearerConfig, RadioBearerConfig, 1 ); return; } - if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { + if (get_softmodem_params()->nsa) { + protocol_ctxt_t ctxt; + NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); + PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_id, ENB_FLAG_YES, mac->crnti, 0, 0, 0); + xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig); + LOG_D(NR_RRC, "Calling fill_default_rbconfig_ue at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld \n", + __LINE__, RadioBearerConfig->drb_ToAddModList->list.array[0]->cnAssociation->choice.eps_BearerIdentity, + RadioBearerConfig->drb_ToAddModList->list.array[0]->drb_Identity, + RadioBearerConfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm, + *RadioBearerConfig->securityConfig->keyToUse); + nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig); + } + else if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig); } } diff --git a/targets/COMMON/create_tasks.c b/targets/COMMON/create_tasks.c index 55ad258b24..95b0798be5 100644 --- a/targets/COMMON/create_tasks.c +++ b/targets/COMMON/create_tasks.c @@ -59,7 +59,7 @@ int create_tasks(uint32_t enb_nb) { rc = itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL); AssertFatal(rc >= 0, "Create task for RRC eNB failed\n"); - if (get_softmodem_params()->nsa || (EPC_MODE_ENABLED && split73 != SPLIT73_DU)) { + if (get_softmodem_params()->emulate_l1 || (EPC_MODE_ENABLED && split73 != SPLIT73_DU)) { rc = itti_create_task(TASK_SCTP, sctp_eNB_task, NULL); AssertFatal(rc >= 0, "Create task for SCTP failed\n"); }