From e303b1be6bdf06659a4f3070d8ec935c5680a031 Mon Sep 17 00:00:00 2001 From: David Kim Date: Fri, 29 Oct 2021 17:48:30 -0700 Subject: [PATCH 01/16] Fixing ra procedures sync problem by checking rnti value. --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/RRC/NR_UE/rrc_UE.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 1273a76da8..93ea43d07b 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -550,7 +550,7 @@ 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 ((dci->rnti != mac->crnti) && (dci->rnti != mac->ra.ra_rnti)) { + if ((dci->rnti != mac->crnti) && (dci->rnti != mac->ra.ra_rnti) && (dci->rnti != 0xFFFF)) { LOG_D(MAC,"We skip for the received dci indication rnti %4x != mac->crnti %4x frame slot %4d.%2d RA state %d\n", dci->rnti, mac->crnti, frame, slot, mac->ra.ra_state); return 0; diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index f0a2789b17..cc0b34aaf1 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -408,6 +408,7 @@ 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 0 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); @@ -418,6 +419,7 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, RadioBearerConfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm, *RadioBearerConfig->securityConfig->keyToUse); nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig); +#endif } break; From d62599b34e81abf5c849ae75d5eae3bdb0b94c01 Mon Sep 17 00:00:00 2001 From: David Kim Date: Mon, 1 Nov 2021 10:21:49 -0700 Subject: [PATCH 02/16] updated RRC_UE.c in nsa mode. --- openair2/RRC/NR_UE/rrc_UE.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index cc0b34aaf1..10c2109477 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -408,6 +408,11 @@ 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 0 + if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { + xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig); + } +#endif #if 0 protocol_ctxt_t ctxt; NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); @@ -420,7 +425,6 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, *RadioBearerConfig->securityConfig->keyToUse); nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig); #endif - } break; From 7b619c5439411f4c6be20b2c70260c9e4c1d0bb2 Mon Sep 17 00:00:00 2001 From: David Kim Date: Mon, 1 Nov 2021 14:34:10 -0700 Subject: [PATCH 03/16] updated for CI debug from crash. --- openair1/PHY/NR_UE_TRANSPORT/nr_prach.c | 5 ++++- openair2/LAYER2/NR_MAC_UE/config_ue.c | 1 - openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 6 +++--- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c index 24299fd788..583c774c79 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c @@ -221,8 +221,11 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ k += kbar; k *= 2; - LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id, + LOG_I(PHY, "PRACH [UE %d] in slot %d, mu %d, fp->samples_per_subframe %d, prach_sequence_length %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id, slot, + mu, + fp->samples_per_subframe, + prach_sequence_length, k, n_ra_prb, nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1, diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 25b4100577..2220d1d7bd 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -707,7 +707,6 @@ int nr_rrc_mac_config_req_ue( // Setup the SSB to Rach Occasions mapping according to the config build_ssb_to_ro_map(mac); } - /* if(mac_cell_group_configP != NULL){ if(mac_cell_group_configP->drx_Config != NULL ){ diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 93ea43d07b..d6ab1bb07f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -2440,7 +2440,7 @@ void nr_ue_send_sdu(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *u VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN); - LOG_D(MAC, "In %s [%d.%d] Handling DLSCH PDU...\n", __FUNCTION__, dl_info->frame, dl_info->slot); + LOG_I(MAC, "In %s [%d.%d] Handling DLSCH PDU...\n", __FUNCTION__, dl_info->frame, dl_info->slot); // Processing MAC PDU // it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs @@ -3645,9 +3645,9 @@ 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( mac->crnti == ra->t_crnti ) + if ((mac->crnti == ra->t_crnti) && (get_softmodem_params()->nsa)) { - LOG_D(MAC, "Discarding the received RAR.\n"); + LOG_I(MAC, "Discarding the received RAR.\n"); return -1; } while (1) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index bfdb07a61c..86185bf358 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1895,6 +1895,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s format = prach_occasion_info_p->format; format0 = format & 0xff; // single PRACH format format1 = (format >> 8) & 0xff; // dual PRACH format + LOG_D(NR_MAC,"We are here with format %u, %s %d\n", format, __FUNCTION__, __LINE__); AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); From bb21c02d2c380dd0b1b90b50b2abf2181ef64168 Mon Sep 17 00:00:00 2001 From: David Kim Date: Tue, 2 Nov 2021 08:56:06 -0700 Subject: [PATCH 04/16] updated for CI debug in nrUE side. --- executables/nr-ue.c | 3 ++ openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 10 ++++- openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c | 1 + openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 10 +++-- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 43 +++++++++++++++----- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 4 ++ openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 +- 7 files changed, 56 insertions(+), 17 deletions(-) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index 5fa314d9af..b89646d4d9 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -560,6 +560,7 @@ void processSlotTX(void *arg) { ul_indication.thread_id = proc->thread_id; ul_indication.ue_sched_mode = rxtxD->ue_sched_mode; + LOG_I(PHY,"We are here to call ul_indication\n"); UE->if_inst->ul_indication(&ul_indication); } @@ -621,6 +622,7 @@ void processSlotRX(void *arg) { } else { rxtxD->ue_sched_mode = SCHED_ALL; + LOG_I(PHY, "We are calling processSlotTX in processSlotRX \n"); processSlotTX(rxtxD); } @@ -639,6 +641,7 @@ void processSlotRX(void *arg) { } if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) { + LOG_I(PHY, "We are calling nr_ue_prach_procedures in processSlotRX\n"); nr_ue_prach_procedures(UE, proc, gNB_id); } LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", proc->frame_tx, proc->nr_slot_tx); diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index 2d3223e635..cc7c830d8e 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -2079,11 +2079,13 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t prach_resources->init_msg1 = 1; } else { - nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx); LOG_D(PHY, "In %s:[%d.%d] getting PRACH resources : %d\n", __FUNCTION__, frame_tx, nr_slot_tx,nr_prach); } + if (nr_prach > 0) + LOG_I(PHY, "In %s: We are here with nr_prach = %u (GENERATE_PREAMBLE: 1)\n", __FUNCTION__, nr_prach); + if (nr_prach == GENERATE_PREAMBLE) { if (ue->mac_enabled == 1) { @@ -2115,7 +2117,9 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN); + LOG_I(PHY, "In %s: We are here to call generate_nr_prach \n", __FUNCTION__); prach_power = generate_nr_prach(ue, gNB_id, nr_slot_tx); + LOG_I(PHY, "In %s: We are here after calling generate_nr_prach \n", __FUNCTION__); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT); @@ -2128,8 +2132,10 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t dB_fixed(prach_power), ue->prach_vars[gNB_id]->amp); - if (ue->mac_enabled == 1) + if (ue->mac_enabled == 1){ nr_Msg1_transmitted(mod_id, ue->CC_id, frame_tx, gNB_id); + LOG_I(PHY, "In %s: We are here after nr_Msg1_transmitted\n", __FUNCTION__); + } } else if (nr_prach == WAIT_CONTENTION_RESOLUTION) { LOG_D(PHY, "In %s: [UE %d] RA waiting contention resolution\n", __FUNCTION__, mod_id); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 5d10af4f20..f2fd33aef6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -928,6 +928,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, AssertFatal(TBS_max > ra->Msg3_size, "In %s: allocated resources are not enough for Msg3!\n", __FUNCTION__); // Init RA procedure + LOG_I(NR_MAC, " We are here in nr_ue_get_rach: prach_format %d\n", prach_pdu->prach_format); init_RA(mod_id, prach_resources, setup, rach_ConfigGeneric, rach_ConfigDedicated); nr_get_RA_window(mac); // Fill in preamble and PRACH resources diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index d6ab1bb07f..4cc4032c57 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -565,6 +565,8 @@ 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); + if (!get_softmodem_params()->nsa) + memset(def_dci_pdu_rel15, 0, sizeof(dci_pdu_rel15_t)); return ret_proc; } @@ -684,9 +686,11 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr LOG_W(MAC, "In %s: ul_config request is NULL. Probably due to unexpected UL DCI in frame.slot %d.%d. Ignoring DCI!\n", __FUNCTION__, frame, slot); return -1; } - ul_config->number_pdus = 0; - AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), - "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); + if (get_softmodem_params()->nsa) { + ul_config->number_pdus = 0; + AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), + "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); + } nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu; fill_ul_config(ul_config, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 86185bf358..2455e47b11 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -161,7 +161,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl num_slots_ul, index); - if(!mac->ul_config_request) + if(!mac->ul_config_request && get_softmodem_params()->nsa) return NULL; return &mac->ul_config_request[index]; } @@ -896,7 +896,8 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in dcireq.slot = rx_slot; dcireq.dl_config_req.number_pdus = 0; nr_ue_dcireq(&dcireq); //to be replaced with function pointer later - mac->dl_config_request = dcireq.dl_config_req; + if (get_softmodem_params()->nsa) + mac->dl_config_request = dcireq.dl_config_req; fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) @@ -945,7 +946,8 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in uint8_t ulsch_input_buffer[MAX_ULSCH_PAYLOAD_BYTES]; nr_scheduled_response_t scheduled_response; fapi_nr_tx_request_t tx_req; - memset(&tx_req, 0, sizeof(tx_req)); + if (get_softmodem_params()->nsa) + memset(&tx_req, 0, sizeof(tx_req)); for (int j = 0; j < ul_config->number_pdus; j++) { @@ -1853,11 +1855,18 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); RA_config_t *ra = &mac->ra; - fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP); - if (!ul_config) { - LOG_E(NR_MAC, "mac->ul_config is null! \n"); - return; + fapi_nr_ul_config_request_t *ul_config; + if (get_softmodem_params()->nsa) { + ul_config = get_ul_config_request(mac, slotP); + if (!ul_config) { + LOG_E(NR_MAC, "mac->ul_config is null! \n"); + return; + } } + else { + ul_config = &mac->ul_config_request[0]; + } + LOG_I(NR_MAC, "We are here to check calling nr_ue_prach_scheduler\n"); fapi_nr_ul_config_prach_pdu *prach_config_pdu; fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; @@ -1888,6 +1897,8 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s &prach_occasion_info_p); if (is_nr_prach_slot && ra->ra_state == RA_UE_IDLE) { + LOG_I(NR_MAC, "We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)\n", + is_nr_prach_slot, ra->ra_state); AssertFatal(NULL != prach_occasion_info_p,"PRACH Occasion Info not returned in a valid NR Prach Slot\n"); ra->generate_nr_prach = GENERATE_PREAMBLE; @@ -1895,13 +1906,15 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s format = prach_occasion_info_p->format; format0 = format & 0xff; // single PRACH format format1 = (format >> 8) & 0xff; // dual PRACH format - LOG_D(NR_MAC,"We are here with format %u, %s %d\n", format, __FUNCTION__, __LINE__); + LOG_I(NR_MAC,"We are here with format0 %u, format1 %u, %s %d\n", + format0, format1, __FUNCTION__, __LINE__); AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu; memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu)); - ul_config->number_pdus += 1; + if (get_softmodem_params()->nsa) + ul_config->number_pdus += 1; fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH); LOG_D(PHY, "In %s: (%p) %d UL PDUs:\n", __FUNCTION__, ul_config, ul_config->number_pdus); @@ -1919,7 +1932,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s prach_config_pdu->restricted_set = prach_config->restricted_set_config; prach_config_pdu->freq_msg1 = prach_config->num_prach_fd_occasions_list[prach_occasion_info_p->fdm].k1; - LOG_D(NR_MAC,"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u\n", frameP, prach_config_pdu->prach_slot, prach_config_pdu->prach_start_symbol, prach_config_pdu->num_ra); + LOG_I(NR_MAC,"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u\n", frameP, prach_config_pdu->prach_slot, prach_config_pdu->prach_start_symbol, prach_config_pdu->num_ra); // Search which SSB is mapped in the RO (among all the SSBs mapped to this RO) for (prach_config_pdu->ssb_nb_in_ro=0; prach_config_pdu->ssb_nb_in_ronb_mapped_ssb; prach_config_pdu->ssb_nb_in_ro++) { @@ -1927,7 +1940,8 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s break; } AssertFatal(prach_config_pdu->ssb_nb_in_ronb_mapped_ssb, "%u not found in the mapped SSBs to the PRACH occasion", selected_gnb_ssb_idx); - + LOG_I(NR_MAC,"We are here Before set prach_config_pdu->prach_format %x, %s %d\n", + prach_config_pdu->prach_format, __FUNCTION__, __LINE__); if (format1 != 0xff) { switch(format0) { // dual PRACH format case 0xa1: @@ -1981,11 +1995,18 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s AssertFatal(1 == 0, "Invalid PRACH format"); } } // if format1 + LOG_I(NR_MAC,"We are here After set prach_config_pdu->prach_format %x, %s %d\n", + prach_config_pdu->prach_format, __FUNCTION__, __LINE__); fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); } // is_nr_prach_slot + else + LOG_I(NR_MAC, "We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)\n", + is_nr_prach_slot, ra->ra_state); } // if is_nr_UL_slot + else + LOG_I(NR_MAC, "We are here It is not is_nr_UL_slot\n"); } // This function schedules the reception of SIB1 after initial sync and before going to real time state diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 2e89229e90..b99533d147 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -844,6 +844,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ if (ul_info->ue_sched_mode == ONLY_PUSCH) { ret = nr_ue_scheduler(NULL, ul_info); + LOG_I(NR_MAC, "In nr_ue_ul_indication: We are to return due to ul_info->ue_sched_mode == ONLY_PUSCH\n"); return 0; } if (ul_info->ue_sched_mode == SCHED_ALL) { @@ -856,7 +857,10 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon; if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test) + { + LOG_I(NR_MAC, "In nr_ue_ul_indication: We are here to call nr_ue_prach_scheduler \n"); nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); + } if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 54729a44b3..6e91410411 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1033,7 +1033,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, // one symbol (13) NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; - pucchres0->startingPRB=(8+rnti) % curr_bwp; + pucchres0->startingPRB=0;//(8+rnti) % curr_bwp; LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->secondHopPRB=NULL; From c7f083b14a231793b3317d52ea7bc9487ade2b52 Mon Sep 17 00:00:00 2001 From: David Kim Date: Wed, 3 Nov 2021 22:30:28 -0700 Subject: [PATCH 05/16] Updated gNB part to handle CI test --- common/utils/LOG/log.h | 2 +- executables/nr-ue.c | 3 - nfapi/oai_integration/nfapi_vnf.c | 4 - openair1/PHY/NR_TRANSPORT/pucch_rx.c | 6 + openair1/PHY/NR_UE_TRANSPORT/nr_prach.c | 5 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 7 + openair1/SCHED_NR_UE/phy_procedures_nr_ue.c | 10 +- openair2/LAYER2/NR_MAC_UE/config_ue.c | 3 +- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 52 ++- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 17 +- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c | 4 +- .../LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 10 +- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 316 ++++++++++++------ openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 20 +- openair2/RRC/LTE/defs_NB_IoT.h | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 1 + openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- openair2/RRC/NR_UE/rrc_UE.c | 15 +- 18 files changed, 307 insertions(+), 172 deletions(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index 6083d23580..ce3ada3972 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -426,7 +426,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int # define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0) # define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0) /* logs intended for analysis */ # define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0) -# define LOG_D(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0) +# define LOG_D(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0) # define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0) # define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0) diff --git a/executables/nr-ue.c b/executables/nr-ue.c index b89646d4d9..5fa314d9af 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -560,7 +560,6 @@ void processSlotTX(void *arg) { ul_indication.thread_id = proc->thread_id; ul_indication.ue_sched_mode = rxtxD->ue_sched_mode; - LOG_I(PHY,"We are here to call ul_indication\n"); UE->if_inst->ul_indication(&ul_indication); } @@ -622,7 +621,6 @@ void processSlotRX(void *arg) { } else { rxtxD->ue_sched_mode = SCHED_ALL; - LOG_I(PHY, "We are calling processSlotTX in processSlotRX \n"); processSlotTX(rxtxD); } @@ -641,7 +639,6 @@ void processSlotRX(void *arg) { } if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) { - LOG_I(PHY, "We are calling nr_ue_prach_procedures in processSlotRX\n"); nr_ue_prach_procedures(UE, proc, gNB_id); } LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", proc->frame_tx, proc->nr_slot_tx); diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 45b5434361..bc2a0353a2 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -612,8 +612,6 @@ int phy_sync_indication(struct nfapi_vnf_p7_config *config, uint8_t sync) { return(0); } -uint16_t pnf_frame; -uint16_t pnf_slot; int phy_slot_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uint16_t sfn, uint16_t slot) { static uint8_t first_time = 1; @@ -626,8 +624,6 @@ int phy_slot_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id, uin if (RC.gNB && RC.gNB[0]->configured) { // uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf); // uint16_t sf = NFAPI_SFNSF2SF(sfn_sf); - pnf_frame = sfn; - pnf_slot = slot; LOG_D(PHY,"[VNF] slot indication sfn:%d slot:%d\n", sfn, slot); wake_gNB_rxtx(RC.gNB[0], sfn, slot); // DONE: find NR equivalent } else { diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index f030c41d68..5782dd337d 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -413,6 +413,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); + AssertFatal ( uci_pdu->sr != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 0\n"); uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0; uci_stats->pucch0_sr_trials++; if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) { @@ -421,10 +422,13 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } else { uci_pdu->sr->sr_indication = 0; } + LOG_I(PHY, "uci_01->harq->num_harq == 0\n"); } else if (pucch_pdu->bit_len_harq==1) { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); + AssertFatal ( uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 1\n"); uci_pdu->harq->num_harq = 1; + LOG_I(PHY, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", uci_pdu->harq->num_harq, uci_pdu, uci_pdu->harq); uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; @@ -440,7 +444,9 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } else { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); + AssertFatal ( uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq > 1\n"); uci_pdu->harq->num_harq = 2; + LOG_I(PHY, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", uci_pdu->harq->num_harq, uci_pdu, uci_pdu->harq); uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c index 583c774c79..24299fd788 100644 --- a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c +++ b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c @@ -221,11 +221,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ k += kbar; k *= 2; - LOG_I(PHY, "PRACH [UE %d] in slot %d, mu %d, fp->samples_per_subframe %d, prach_sequence_length %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id, + LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id, slot, - mu, - fp->samples_per_subframe, - prach_sequence_length, k, n_ra_prb, nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1, diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index bd44a1e983..513d3e3db6 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -682,6 +682,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { offset = pucch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size + (gNB->frame_parms.first_carrier_offset+pucch_pdu->prb_start*12); power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset],12); LOG_D(PHY,"frame %d, slot %d: PUCCH signal energy %d\n",frame_rx,slot_rx,power_rxF); + LOG_D(PHY,"num_ucis = %d *expecting 0 since it is index in array also (case 0)\n",num_ucis); nr_decode_pucch0(gNB, frame_rx, @@ -691,6 +692,11 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->UL_INFO.uci_ind.num_ucis += 1; pucch->active = 0; + if (((uci_pdu_format0->pduBitmap >> 1) & 0x01)){ + LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p\n", uci_pdu_format0); + LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p harq %p\n", uci_pdu_format0, uci_pdu_format0->harq); + LOG_I(NR_PHY, "uci_01->harq->num_harq %u\n", uci_pdu_format0->harq->num_harq); + } break; case 2: num_ucis = gNB->UL_INFO.uci_ind.num_ucis; @@ -700,6 +706,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->uci_pdu_list[num_ucis].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE; gNB->uci_pdu_list[num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t); nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu_format2 = &gNB->uci_pdu_list[num_ucis].pucch_pdu_format_2_3_4; + LOG_D(PHY,"num_ucis = %d in case 1\n",num_ucis); nr_decode_pucch2(gNB, slot_rx, diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c index cc7c830d8e..2d3223e635 100644 --- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c +++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c @@ -2079,13 +2079,11 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t prach_resources->init_msg1 = 1; } else { + nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx); LOG_D(PHY, "In %s:[%d.%d] getting PRACH resources : %d\n", __FUNCTION__, frame_tx, nr_slot_tx,nr_prach); } - if (nr_prach > 0) - LOG_I(PHY, "In %s: We are here with nr_prach = %u (GENERATE_PREAMBLE: 1)\n", __FUNCTION__, nr_prach); - if (nr_prach == GENERATE_PREAMBLE) { if (ue->mac_enabled == 1) { @@ -2117,9 +2115,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN); - LOG_I(PHY, "In %s: We are here to call generate_nr_prach \n", __FUNCTION__); prach_power = generate_nr_prach(ue, gNB_id, nr_slot_tx); - LOG_I(PHY, "In %s: We are here after calling generate_nr_prach \n", __FUNCTION__); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT); @@ -2132,10 +2128,8 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t dB_fixed(prach_power), ue->prach_vars[gNB_id]->amp); - if (ue->mac_enabled == 1){ + if (ue->mac_enabled == 1) nr_Msg1_transmitted(mod_id, ue->CC_id, frame_tx, gNB_id); - LOG_I(PHY, "In %s: We are here after nr_Msg1_transmitted\n", __FUNCTION__); - } } else if (nr_prach == WAIT_CONTENTION_RESOLUTION) { LOG_D(PHY, "In %s: [UE %d] RA waiting contention resolution\n", __FUNCTION__, mod_id); diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index 2220d1d7bd..d223b9ddd7 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -689,7 +689,7 @@ int nr_rrc_mac_config_req_ue( } config_control_ue(mac); if (get_softmodem_params()->nsa) { - if (cell_group_config->spCellConfig->reconfigurationWithSync) { + if (cell_group_config->spCellConfig && cell_group_config->spCellConfig->reconfigurationWithSync) { if (cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated) { ra->rach_ConfigDedicated = cell_group_config->spCellConfig->reconfigurationWithSync->rach_ConfigDedicated->choice.uplink; } @@ -707,6 +707,7 @@ int nr_rrc_mac_config_req_ue( // Setup the SSB to Rach Occasions mapping according to the config build_ssb_to_ro_map(mac); } + /* if(mac_cell_group_configP != NULL){ if(mac_cell_group_configP->drx_Config != NULL ){ diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 4cc4032c57..8accb610b6 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -550,7 +550,7 @@ 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 ((dci->rnti != mac->crnti) && (dci->rnti != mac->ra.ra_rnti) && (dci->rnti != 0xFFFF)) { + if ((dci->rnti != mac->crnti) && (dci->rnti != mac->ra.ra_rnti) && (get_softmodem_params()->nsa)) { LOG_D(MAC,"We skip for the received dci indication rnti %4x != mac->crnti %4x frame slot %4d.%2d RA state %d\n", dci->rnti, mac->crnti, frame, slot, mac->ra.ra_state); return 0; @@ -2444,7 +2444,7 @@ void nr_ue_send_sdu(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *u VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN); - LOG_I(MAC, "In %s [%d.%d] Handling DLSCH PDU...\n", __FUNCTION__, dl_info->frame, dl_info->slot); + LOG_D(MAC, "In %s [%d.%d] Handling DLSCH PDU...\n", __FUNCTION__, dl_info->frame, dl_info->slot); // Processing MAC PDU // it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs @@ -3422,7 +3422,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, case DL_SCH_LCID_DCCH1: // check if LCID is valid at current time. default: - { + if (get_softmodem_params()->nsa) { // check if LCID is valid at current time. if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) return; @@ -3472,6 +3472,50 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, break; } + else + { + // check if LCID is valid at current time. + if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ + //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; + mac_subheader_len = 3; + mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) + | ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); + + } else { + mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; + mac_subheader_len = 2; + } + + LOG_D(MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len); + + #if defined(ENABLE_MAC_PAYLOAD_DEBUG) + LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); + + for (i = 0; i < 32; i++) + LOG_T(MAC, "%x.", (pduP + mac_subheader_len)[i]); + + LOG_T(MAC, "\n"); + #endif + + if (rx_lcid < NB_RB_MAX && rx_lcid >= DL_SCH_LCID_DCCH) { + + mac_rlc_data_ind(module_idP, + mac->crnti, + gNB_index, + frameP, + ENB_FLAG_NO, + MBMS_FLAG_NO, + rx_lcid, + (char *) (pduP + mac_subheader_len), + mac_sdu_len, + 1, + NULL); + } else { + LOG_E(MAC, "[UE %d] Frame %d : unknown LCID %d (gNB %d)\n", module_idP, frameP, rx_lcid, gNB_index); + } + + break; + } } pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len ); pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); @@ -3651,7 +3695,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t if ((mac->crnti == ra->t_crnti) && (get_softmodem_params()->nsa)) { - LOG_I(MAC, "Discarding the received RAR.\n"); + LOG_D(MAC, "Discarding the received RAR.\n"); return -1; } while (1) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 2455e47b11..9e57abcd35 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -1866,7 +1866,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s else { ul_config = &mac->ul_config_request[0]; } - LOG_I(NR_MAC, "We are here to check calling nr_ue_prach_scheduler\n"); fapi_nr_ul_config_prach_pdu *prach_config_pdu; fapi_nr_config_request_t *cfg = &mac->phy_config.config_req; @@ -1897,8 +1896,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s &prach_occasion_info_p); if (is_nr_prach_slot && ra->ra_state == RA_UE_IDLE) { - LOG_I(NR_MAC, "We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)\n", - is_nr_prach_slot, ra->ra_state); AssertFatal(NULL != prach_occasion_info_p,"PRACH Occasion Info not returned in a valid NR Prach Slot\n"); ra->generate_nr_prach = GENERATE_PREAMBLE; @@ -1906,8 +1903,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s format = prach_occasion_info_p->format; format0 = format & 0xff; // single PRACH format format1 = (format >> 8) & 0xff; // dual PRACH format - LOG_I(NR_MAC,"We are here with format0 %u, format1 %u, %s %d\n", - format0, format1, __FUNCTION__, __LINE__); AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); @@ -1932,7 +1927,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s prach_config_pdu->restricted_set = prach_config->restricted_set_config; prach_config_pdu->freq_msg1 = prach_config->num_prach_fd_occasions_list[prach_occasion_info_p->fdm].k1; - LOG_I(NR_MAC,"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u\n", frameP, prach_config_pdu->prach_slot, prach_config_pdu->prach_start_symbol, prach_config_pdu->num_ra); + LOG_D(NR_MAC,"Selected RO Frame %u, Slot %u, Symbol %u, Fdm %u\n", frameP, prach_config_pdu->prach_slot, prach_config_pdu->prach_start_symbol, prach_config_pdu->num_ra); // Search which SSB is mapped in the RO (among all the SSBs mapped to this RO) for (prach_config_pdu->ssb_nb_in_ro=0; prach_config_pdu->ssb_nb_in_ronb_mapped_ssb; prach_config_pdu->ssb_nb_in_ro++) { @@ -1940,8 +1935,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s break; } AssertFatal(prach_config_pdu->ssb_nb_in_ronb_mapped_ssb, "%u not found in the mapped SSBs to the PRACH occasion", selected_gnb_ssb_idx); - LOG_I(NR_MAC,"We are here Before set prach_config_pdu->prach_format %x, %s %d\n", - prach_config_pdu->prach_format, __FUNCTION__, __LINE__); + if (format1 != 0xff) { switch(format0) { // dual PRACH format case 0xa1: @@ -1995,18 +1989,11 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s AssertFatal(1 == 0, "Invalid PRACH format"); } } // if format1 - LOG_I(NR_MAC,"We are here After set prach_config_pdu->prach_format %x, %s %d\n", - prach_config_pdu->prach_format, __FUNCTION__, __LINE__); fill_scheduled_response(&scheduled_response, NULL, ul_config, NULL, module_idP, 0 /*TBR fix*/, frameP, slotP, thread_id); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) mac->if_module->scheduled_response(&scheduled_response); } // is_nr_prach_slot - else - LOG_I(NR_MAC, "We are here to see is_nr_prach_slot = %d, ra->ra_state = %d (RA_UE_IDLE: 0)\n", - is_nr_prach_slot, ra->ra_state); } // if is_nr_UL_slot - else - LOG_I(NR_MAC, "We are here It is not is_nr_UL_slot\n"); } // This function schedules the reception of SIB1 after initial sync and before going to real time state diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 1e84199c89..a3f26aa101 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -535,7 +535,9 @@ void nr_initiate_ra_proc(module_id_t module_idP, if (ra->state == RA_IDLE) { for(int j = 0; j < ra->preambles.num_preambles; j++) { //check if the preamble received correspond to one of the listed or configured preambles - if (preamble_index == ra->preambles.preamble_list[j] && ra->rnti != 0) { + if (preamble_index == ra->preambles.preamble_list[j]) { + if (ra->rnti == 0 && get_softmodem_params()->nsa) + continue; pr_found=1; break; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 5df7e3d707..f23f7968a8 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1081,6 +1081,11 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, if (((uci_01->pduBitmap >> 1) & 0x01)) { // iterate over received harq bits + + LOG_I(NR_MAC, "uci_01 %p \n", uci_01); + LOG_I(NR_MAC, "uci_01->harq %p \n", uci_01->harq); + LOG_I(NR_MAC, "uci_01->harq->num_harq %u \n", uci_01->harq->num_harq); + for (int harq_bit = 0; harq_bit < uci_01->harq->num_harq; harq_bit++) { const uint8_t harq_value = uci_01->harq->harq_list[harq_bit].harq_value; const uint8_t harq_confidence = uci_01->harq->harq_confidence_level; @@ -1094,7 +1099,10 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, remove_front_nr_list(&sched_ctrl->feedback_dl_harq); /* According to nfapi_nr_interface_scf.h, harq_value = 0 is a pass (The check below was for harq_value == 1 in the develop branch) */ - handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0); + if (get_softmodem_params()->nsa) + handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0); + else + handle_dl_harq(mod_id, UE_id, pid, harq_value == 1 && harq_confidence == 0); if (harq_confidence == 1) UE_info->mac_stats[UE_id].pucch0_DTX++; } } diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index aa10ca0116..27619bfa90 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -63,18 +63,35 @@ extern uint16_t sl_ahead; void handle_nr_rach(NR_UL_IND_t *UL_info) { - if (gnb_rach_ind_queue.num_items ==0) - return; - LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); - nfapi_nr_rach_indication_t *rach_ind = get_queue(&gnb_rach_ind_queue); + if(NFAPI_MODE == NFAPI_MODE_PNF) { + if (UL_info->rach_ind.number_of_pdus>0) { + LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot); + oai_nfapi_nr_rach_indication(&UL_info->rach_ind); + UL_info->rach_ind.number_of_pdus = 0; + } + return; + } NR_UL_IND_t UL_INFO; - UL_INFO.rach_ind = *rach_ind; - UL_INFO.frame = rach_ind->sfn; - UL_INFO.slot = rach_ind->slot; - UL_INFO.module_id = UL_info->module_id; - UL_INFO.CC_id = UL_info->CC_id; + nfapi_nr_rach_indication_t *rach_ind = NULL; + if (get_softmodem_params()->nsa) + { + if (gnb_rach_ind_queue.num_items ==0) + return; + LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); + rach_ind = get_queue(&gnb_rach_ind_queue); - int frame_diff = UL_info->frame - rach_ind->sfn; + UL_INFO.rach_ind = *rach_ind; + UL_INFO.module_id = UL_info->module_id; + UL_INFO.CC_id = UL_info->CC_id; + } + else + { + UL_INFO.rach_ind = UL_info->rach_ind; + UL_INFO.module_id = UL_info->module_id; + UL_INFO.CC_id = UL_info->CC_id; + } + + int frame_diff = UL_info->frame - UL_INFO.rach_ind.sfn; if (frame_diff < 0) { frame_diff += 1024; @@ -101,28 +118,53 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) UL_INFO.rach_ind.pdu_list[i].preamble_list[0].timing_advance); } } - if (rach_ind && rach_ind->number_of_pdus > 0) + if (get_softmodem_params()->nsa) { - for(int i = 0; i < rach_ind->number_of_pdus; i++) - free(rach_ind->pdu_list[i].preamble_list); - free(rach_ind->pdu_list); + if (rach_ind && rach_ind->number_of_pdus > 0) + { + for(int i = 0; i < rach_ind->number_of_pdus; i++) + { + free(rach_ind->pdu_list[i].preamble_list); + rach_ind->pdu_list[i].preamble_list = NULL; + } + free(rach_ind->pdu_list); + rach_ind->pdu_list = NULL; + } + free(rach_ind); + rach_ind = NULL; } - free(rach_ind); } void handle_nr_uci(NR_UL_IND_t *UL_info) { - if (gnb_uci_ind_queue.num_items ==0) - return; - LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); - nfapi_nr_uci_indication_t *uci_ind = get_queue(&gnb_uci_ind_queue); + if(NFAPI_MODE == NFAPI_MODE_PNF) { + if (UL_info->uci_ind.num_ucis>0) { + LOG_D(PHY,"PNF Sending UL_info->num_ucis:%d PDU_type: %d, SFN/SF:%d.%d \n", UL_info->uci_ind.num_ucis, UL_info->uci_ind.uci_list[0].pdu_type ,UL_info->frame, UL_info->slot); + oai_nfapi_nr_uci_indication(&UL_info->uci_ind); + UL_info->uci_ind.num_ucis = 0; + } + return; + } + NR_UL_IND_t UL_INFO; - UL_INFO.uci_ind = *uci_ind; + nfapi_nr_uci_indication_t *uci_ind = NULL; + if (get_softmodem_params()->nsa) + { + if (gnb_uci_ind_queue.num_items ==0) + return; + LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); + uci_ind = get_queue(&gnb_uci_ind_queue); + UL_INFO.uci_ind = *uci_ind; + } + else + { + UL_INFO.uci_ind = UL_info->uci_ind; + } const module_id_t mod_id = UL_info->module_id; - const frame_t frame = UL_INFO.uci_ind.sfn; - const sub_frame_t slot = UL_INFO.uci_ind.slot; + const frame_t frame = UL_INFO.uci_ind.sfn;//TODO: Need to check to use UL_info->frame; + const sub_frame_t slot = UL_INFO.uci_ind.slot;//TODO: Need to check to use UL_info->slot; int num_ucis = UL_INFO.uci_ind.num_ucis; nfapi_nr_uci_t *uci_list = UL_INFO.uci_ind.uci_list; @@ -149,23 +191,30 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) } } - for (int i = 0; i < num_ucis; i++) { - switch (uci_list[i].pdu_type) { - case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: - free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list); - free(uci_list[i].pucch_pdu_format_0_1.harq); - break; + if (get_softmodem_params()->nsa) + { + for (int i = 0; i < num_ucis; i++) { + switch (uci_list[i].pdu_type) { + case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: + free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list); + free(uci_list[i].pucch_pdu_format_0_1.harq); + break; - case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: - free(uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); - free(uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); - free(uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); - break; + case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: + free(uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); + free(uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); + free(uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); + break; + } } + if (uci_ind && num_ucis > 0) + free(uci_list); + free(uci_ind); + } + else + { + UL_info->uci_ind.num_ucis = 0; } - if (uci_ind && num_ucis > 0) - free(uci_list); - free(uci_ind); } static bool crc_sfn_slot_matcher(void *wanted, void *candidate) @@ -190,39 +239,70 @@ static bool crc_sfn_slot_matcher(void *wanted, void *candidate) void handle_nr_ulsch(NR_UL_IND_t *UL_info) { - nfapi_nr_rx_data_indication_t *rx_ind = get_queue(&gnb_rx_ind_queue); - if (!rx_ind) - { - LOG_D(NR_PHY, "No rx data indication (empty gnb_rx_ind_queue)\n"); - return; - } - int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); - - nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&gnb_crc_ind_queue, - MAX_QUEUE_SIZE, - crc_sfn_slot_matcher, - &sfn_slot); - if (!crc_ind) - { - LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); - put_queue(&gnb_rx_ind_queue, rx_ind); + if(NFAPI_MODE == NFAPI_MODE_PNF) { + if (UL_info->crc_ind.number_crcs>0) { + LOG_D(PHY,"UL_info->UL_info->crc_ind.number_crcs:%d CRC_IND:SFN/Slot:%d.%d\n", UL_info->crc_ind.number_crcs, UL_info->crc_ind.sfn, UL_info->crc_ind.slot); + oai_nfapi_nr_crc_indication(&UL_info->crc_ind); + UL_info->crc_ind.number_crcs = 0; + } + + if (UL_info->rx_ind.number_of_pdus>0) { + LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/Slot:%d.%d \n", UL_info->rx_ind.number_of_pdus, UL_info->rx_ind.sfn, UL_info->rx_ind.slot); + oai_nfapi_nr_rx_data_indication(&UL_info->rx_ind); + UL_info->rx_ind.number_of_pdus = 0; + } return; } NR_UL_IND_t UL_INFO; - UL_INFO.rx_ind = *rx_ind; - UL_INFO.crc_ind = *crc_ind; - UL_INFO.frame = rx_ind->sfn; - UL_INFO.slot = rx_ind->slot; + nfapi_nr_rx_data_indication_t *rx_ind = NULL; + nfapi_nr_crc_indication_t *crc_ind = NULL; + if (get_softmodem_params()->nsa) + { + rx_ind = get_queue(&gnb_rx_ind_queue); + if (!rx_ind) + { + LOG_D(NR_PHY, "No rx data indication (empty gnb_rx_ind_queue)\n"); + return; + } + + int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); + + crc_ind = unqueue_matching(&gnb_crc_ind_queue, + MAX_QUEUE_SIZE, + crc_sfn_slot_matcher, + &sfn_slot); + if (!crc_ind) + { + LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); + put_queue(&gnb_rx_ind_queue, rx_ind); + return; + } + + UL_INFO.rx_ind = *rx_ind; + UL_INFO.crc_ind = *crc_ind; + UL_INFO.module_id = UL_info->module_id; + UL_INFO.CC_id = UL_info->CC_id; + } + else + { + UL_INFO.rx_ind = UL_info->rx_ind; + UL_INFO.crc_ind = UL_info->crc_ind; + UL_INFO.module_id = UL_info->module_id; + UL_INFO.CC_id = UL_info->CC_id; + } + + UL_INFO.frame = UL_INFO.rx_ind.sfn;//TODO: Need to check to use UL_info->frame; + UL_INFO.slot = UL_INFO.rx_ind.slot;//TODO: Need to check to use UL_info->slot; UL_INFO.module_id = UL_info->module_id; UL_INFO.CC_id = UL_info->CC_id; - LOG_I(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n", + LOG_D(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n", UL_info->frame, UL_info->slot, - rx_ind->sfn, rx_ind->slot, - crc_ind->sfn, crc_ind->slot + UL_INFO.rx_ind.sfn, UL_INFO.rx_ind.slot, + UL_INFO.crc_ind.sfn, UL_INFO.crc_ind.slot ); - if (rx_ind && UL_INFO.rx_ind.number_of_pdus > 0 && crc_ind && UL_INFO.crc_ind.number_crcs > 0) { + if (UL_INFO.rx_ind.number_of_pdus > 0 && UL_INFO.crc_ind.number_crcs > 0) { for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { int j; for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) { @@ -264,58 +344,68 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc); break; } // for (j=0;jnsa) { - crc_ind->crc_list[j] = crc_ind->crc_list[last]; - UL_INFO.crc_ind.number_crcs--; - } - else if (j == last) - { - UL_INFO.crc_ind.number_crcs--; - } + int last = UL_INFO.crc_ind.number_crcs - 1; + if (j < last) + { + crc_ind->crc_list[j] = crc_ind->crc_list[last]; + UL_INFO.crc_ind.number_crcs--; + } + else if (j == last) + { + UL_INFO.crc_ind.number_crcs--; + } - last = UL_INFO.rx_ind.number_of_pdus - 1; - if (i < last) - { - rx_ind->pdu_list[i] = rx_ind->pdu_list[last]; - UL_INFO.rx_ind.number_of_pdus--; - i--; - } - else if (i == last) - { - UL_INFO.rx_ind.number_of_pdus--; + last = UL_INFO.rx_ind.number_of_pdus - 1; + if (i < last) + { + rx_ind->pdu_list[i] = rx_ind->pdu_list[last]; + UL_INFO.rx_ind.number_of_pdus--; + i--; + } + else if (i == last) + { + UL_INFO.rx_ind.number_of_pdus--; + } } } // for (i=0;insa) + { + if (UL_INFO.crc_ind.number_crcs > 0) + { + crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs; + requeue(&gnb_crc_ind_queue, crc_ind); + } - if (UL_INFO.crc_ind.number_crcs > 0) - { - crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs; - requeue(&gnb_crc_ind_queue, crc_ind); - } + if (UL_INFO.rx_ind.number_of_pdus > 0) + { + rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus; + requeue(&gnb_rx_ind_queue, rx_ind); + } - if (UL_INFO.rx_ind.number_of_pdus > 0) - { - rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus; - requeue(&gnb_rx_ind_queue, rx_ind); + if (UL_INFO.crc_ind.number_crcs == 0) + { + free(crc_ind->crc_list); + crc_ind->crc_list = NULL; + free(crc_ind); + crc_ind = NULL; + } + if (UL_INFO.rx_ind.number_of_pdus == 0) + { + free(rx_ind->pdu_list); + rx_ind->pdu_list = NULL; + free(rx_ind); + rx_ind = NULL; + } } - - if (UL_INFO.crc_ind.number_crcs == 0) + else { - free(crc_ind->crc_list); - crc_ind->crc_list = NULL; - free(crc_ind); - crc_ind = NULL; + UL_INFO.crc_ind.number_crcs = 0; + UL_INFO.rx_ind.number_of_pdus = 0; } - if (UL_INFO.rx_ind.number_of_pdus == 0) - { - free(rx_ind->pdu_list); - rx_ind->pdu_list = NULL; - free(rx_ind); - rx_ind = NULL; - } - } else if ((rx_ind && UL_INFO.rx_ind.number_of_pdus != 0) - || (crc_ind && UL_INFO.crc_ind.number_crcs != 0)) { + } else if ((UL_INFO.rx_ind.number_of_pdus != 0) + || (UL_INFO.crc_ind.number_crcs != 0)) { LOG_E(NR_PHY, "hoping not to have mis-match between CRC ind and RX ind - " "hopefully the missing message is coming shortly " @@ -343,6 +433,18 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { UL_info->frame,UL_info->slot, module_id,CC_id, gnb_rach_ind_queue.num_items, gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); +/* + LOG_I(MAC, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", + UL_info->uci_ind.uci_list->pucch_pdu_format_0_1.harq->num_harq, + &UL_info->uci_ind.uci_list->pucch_pdu_format_0_1, + UL_info->uci_ind.uci_list->pucch_pdu_format_0_1.harq); +*/ + handle_nr_rach(UL_info); + + handle_nr_uci(UL_info); + // clear UL DCI prior to handling ULSCH + mac->UL_dci_req[CC_id].numPdus = 0; + handle_nr_ulsch(UL_info); if (NFAPI_MODE != NFAPI_MODE_PNF) { @@ -356,14 +458,6 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { ifi->CC_mask |= (1<UL_dci_req[CC_id].numPdus = 0; - handle_nr_ulsch(UL_info); - if (ifi->CC_mask == ((1<rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; + if (get_softmodem_params()->nsa) + dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; update_harq_status(dl_info, pdu_id); if(dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.ack_nack) @@ -844,7 +845,6 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ if (ul_info->ue_sched_mode == ONLY_PUSCH) { ret = nr_ue_scheduler(NULL, ul_info); - LOG_I(NR_MAC, "In nr_ue_ul_indication: We are to return due to ul_info->ue_sched_mode == ONLY_PUSCH\n"); return 0; } if (ul_info->ue_sched_mode == SCHED_ALL) { @@ -857,10 +857,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){ NR_TDD_UL_DL_ConfigCommon_t *tdd_UL_DL_ConfigurationCommon = mac->scc != NULL ? mac->scc->tdd_UL_DL_ConfigurationCommon : mac->scc_SIB->tdd_UL_DL_ConfigurationCommon; if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test) - { - LOG_I(NR_MAC, "In nr_ue_ul_indication: We are here to call nr_ue_prach_scheduler \n"); nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); - } if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type)) nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id); @@ -905,11 +902,14 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ dl_info->slot, dl_info->dci_ind->dci_list+i); - 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)); + if (get_softmodem_params()->nsa) + { + 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) { diff --git a/openair2/RRC/LTE/defs_NB_IoT.h b/openair2/RRC/LTE/defs_NB_IoT.h index 37a26086b5..3907d2321d 100644 --- a/openair2/RRC/LTE/defs_NB_IoT.h +++ b/openair2/RRC/LTE/defs_NB_IoT.h @@ -148,7 +148,7 @@ typedef struct UE_RRC_INFO_NB_IoT_s { //Measurement Report not supported in NB-IoT #define PAYLOAD_SIZE_MAX 1024 -#define RRC_BUF_SIZE 512 +#define RRC_BUF_SIZE 8192 #define UNDEF_SECURITY_MODE 0xff #define NO_SECURITY_MODE 0x20 diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 6e91410411..d58e60dfbb 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1034,6 +1034,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; pucchres0->startingPRB=0;//(8+rnti) % curr_bwp; + //pucchres0->startingPRB = (8+rnti) % curr_bwp; LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->secondHopPRB=NULL; diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index ebe6af57fd..be4f2ef78e 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -945,7 +945,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = i + 6; + *delay[i] = (i<6) ? (i+2) : 0;//TODO: Needs to check to use i + 6; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 10c2109477..03af93e59b 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -248,17 +248,20 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR if(NR_UE_rrc_inst[module_id].radio_bearer_config == NULL){ NR_UE_rrc_inst[module_id].radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig; }else{ - 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); + //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); struct NR_RadioBearerConfig *RadioBearerConfig = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig; - xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig); + //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); + //nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig); + if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { + xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig); + } } } if(rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->secondaryCellGroup != NULL){ @@ -408,11 +411,9 @@ 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 0 if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig); } -#endif #if 0 protocol_ctxt_t ctxt; NR_UE_MAC_INST_t *mac = get_mac_inst(module_id); From f4049a9fe262a12437744d3b8bdec79b08d0f4d9 Mon Sep 17 00:00:00 2001 From: David Kim Date: Thu, 4 Nov 2021 09:31:42 -0700 Subject: [PATCH 06/16] Code cleanup --- common/utils/LOG/log.h | 2 +- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 7 --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 48 +------------------- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 7 +-- openair2/RRC/LTE/defs_NB_IoT.h | 2 +- openair2/RRC/NR/MESSAGES/asn1_msg.c | 3 +- openair2/RRC/NR/rrc_gNB_reconfig.c | 2 +- openair2/RRC/NR_UE/rrc_UE.c | 24 +--------- 8 files changed, 8 insertions(+), 87 deletions(-) diff --git a/common/utils/LOG/log.h b/common/utils/LOG/log.h index ce3ada3972..6083d23580 100644 --- a/common/utils/LOG/log.h +++ b/common/utils/LOG/log.h @@ -426,7 +426,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int # define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0) # define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0) /* logs intended for analysis */ # define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0) -# define LOG_D(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0) +# define LOG_D(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0) # define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0) # define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 513d3e3db6..bd44a1e983 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -682,7 +682,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { offset = pucch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size + (gNB->frame_parms.first_carrier_offset+pucch_pdu->prb_start*12); power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset],12); LOG_D(PHY,"frame %d, slot %d: PUCCH signal energy %d\n",frame_rx,slot_rx,power_rxF); - LOG_D(PHY,"num_ucis = %d *expecting 0 since it is index in array also (case 0)\n",num_ucis); nr_decode_pucch0(gNB, frame_rx, @@ -692,11 +691,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->UL_INFO.uci_ind.num_ucis += 1; pucch->active = 0; - if (((uci_pdu_format0->pduBitmap >> 1) & 0x01)){ - LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p\n", uci_pdu_format0); - LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p harq %p\n", uci_pdu_format0, uci_pdu_format0->harq); - LOG_I(NR_PHY, "uci_01->harq->num_harq %u\n", uci_pdu_format0->harq->num_harq); - } break; case 2: num_ucis = gNB->UL_INFO.uci_ind.num_ucis; @@ -706,7 +700,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { gNB->uci_pdu_list[num_ucis].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE; gNB->uci_pdu_list[num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t); nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu_format2 = &gNB->uci_pdu_list[num_ucis].pucch_pdu_format_2_3_4; - LOG_D(PHY,"num_ucis = %d in case 1\n",num_ucis); nr_decode_pucch2(gNB, slot_rx, diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 8accb610b6..6079d1c93f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3422,7 +3422,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, case DL_SCH_LCID_DCCH1: // check if LCID is valid at current time. default: - if (get_softmodem_params()->nsa) { + { // check if LCID is valid at current time. if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT)) return; @@ -3472,50 +3472,6 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, break; } - else - { - // check if LCID is valid at current time. - if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){ - //mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8; - mac_subheader_len = 3; - mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8) - | ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff); - - } else { - mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L; - mac_subheader_len = 2; - } - - LOG_D(MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len); - - #if defined(ENABLE_MAC_PAYLOAD_DEBUG) - LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP); - - for (i = 0; i < 32; i++) - LOG_T(MAC, "%x.", (pduP + mac_subheader_len)[i]); - - LOG_T(MAC, "\n"); - #endif - - if (rx_lcid < NB_RB_MAX && rx_lcid >= DL_SCH_LCID_DCCH) { - - mac_rlc_data_ind(module_idP, - mac->crnti, - gNB_index, - frameP, - ENB_FLAG_NO, - MBMS_FLAG_NO, - rx_lcid, - (char *) (pduP + mac_subheader_len), - mac_sdu_len, - 1, - NULL); - } else { - LOG_E(MAC, "[UE %d] Frame %d : unknown LCID %d (gNB %d)\n", module_idP, frameP, rx_lcid, gNB_index); - } - - break; - } } pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len ); pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len ); @@ -3695,7 +3651,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t if ((mac->crnti == ra->t_crnti) && (get_softmodem_params()->nsa)) { - LOG_D(MAC, "Discarding the received RAR.\n"); + LOG_I(MAC, "Discarding the received RAR.\n"); return -1; } while (1) { diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 27619bfa90..aad0d1f2ab 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -433,12 +433,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { UL_info->frame,UL_info->slot, module_id,CC_id, gnb_rach_ind_queue.num_items, gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items); -/* - LOG_I(MAC, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", - UL_info->uci_ind.uci_list->pucch_pdu_format_0_1.harq->num_harq, - &UL_info->uci_ind.uci_list->pucch_pdu_format_0_1, - UL_info->uci_ind.uci_list->pucch_pdu_format_0_1.harq); -*/ + handle_nr_rach(UL_info); handle_nr_uci(UL_info); diff --git a/openair2/RRC/LTE/defs_NB_IoT.h b/openair2/RRC/LTE/defs_NB_IoT.h index 3907d2321d..37a26086b5 100644 --- a/openair2/RRC/LTE/defs_NB_IoT.h +++ b/openair2/RRC/LTE/defs_NB_IoT.h @@ -148,7 +148,7 @@ typedef struct UE_RRC_INFO_NB_IoT_s { //Measurement Report not supported in NB-IoT #define PAYLOAD_SIZE_MAX 1024 -#define RRC_BUF_SIZE 8192 +#define RRC_BUF_SIZE 512 #define UNDEF_SECURITY_MODE 0xff #define NO_SECURITY_MODE 0x20 diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index d58e60dfbb..cac2a3a6a0 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1033,8 +1033,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, // one symbol (13) NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; - pucchres0->startingPRB=0;//(8+rnti) % curr_bwp; - //pucchres0->startingPRB = (8+rnti) % curr_bwp; + pucchres0->startingPRB = (8+rnti) % curr_bwp; LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->secondHopPRB=NULL; diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index be4f2ef78e..980bd39c37 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -945,7 +945,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco long *delay[8]; for (int i=0;i<8;i++) { delay[i] = calloc(1,sizeof(*delay[i])); - *delay[i] = (i<6) ? (i+2) : 0;//TODO: Needs to check to use i + 6; + *delay[i] = (i<6) ? (i+2) : 0; ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]); } pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList)); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 03af93e59b..8e697bf108 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -248,18 +248,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR if(NR_UE_rrc_inst[module_id].radio_bearer_config == NULL){ NR_UE_rrc_inst[module_id].radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig; }else{ - //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); - struct NR_RadioBearerConfig *RadioBearerConfig = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig; - //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); if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { + struct NR_RadioBearerConfig *RadioBearerConfig = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig; xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig); } } @@ -414,18 +404,6 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type, if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) { xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig); } -#if 0 - 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); -#endif } break; From d2ecd40fbd333dc63cfbe1a606c5da6f4db0174f Mon Sep 17 00:00:00 2001 From: David Kim Date: Thu, 4 Nov 2021 10:34:06 -0700 Subject: [PATCH 07/16] Removed unused debug log. --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 9 +++------ openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 ----- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 8fff0372a3..6e82693962 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -415,7 +415,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); - AssertFatal ( uci_pdu->sr != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 0\n"); + AssertFatal (uci_pdu->sr != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 0\n"); uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0; uci_stats->pucch0_sr_trials++; if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) { @@ -424,13 +424,11 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } else { uci_pdu->sr->sr_indication = 0; } - LOG_I(PHY, "uci_01->harq->num_harq == 0\n"); } else if (pucch_pdu->bit_len_harq==1) { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); - AssertFatal ( uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 1\n"); + AssertFatal (uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 1\n"); uci_pdu->harq->num_harq = 1; - LOG_I(PHY, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", uci_pdu->harq->num_harq, uci_pdu, uci_pdu->harq); uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); uci_pdu->harq->harq_list[0].harq_value = index&0x01; @@ -446,9 +444,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } else { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); - AssertFatal ( uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq > 1\n"); + AssertFatal (uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq > 1\n"); uci_pdu->harq->num_harq = 2; - LOG_I(PHY, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n", uci_pdu->harq->num_harq, uci_pdu, uci_pdu->harq); uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); uci_pdu->harq->harq_list[1].harq_value = index&0x01; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 448bb2aa5b..7b58d0e531 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1087,11 +1087,6 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, if (((uci_01->pduBitmap >> 1) & 0x01)) { // iterate over received harq bits - - LOG_I(NR_MAC, "uci_01 %p \n", uci_01); - LOG_I(NR_MAC, "uci_01->harq %p \n", uci_01->harq); - LOG_I(NR_MAC, "uci_01->harq->num_harq %u \n", uci_01->harq->num_harq); - for (int harq_bit = 0; harq_bit < uci_01->harq->num_harq; harq_bit++) { const uint8_t harq_value = uci_01->harq->harq_list[harq_bit].harq_value; const uint8_t harq_confidence = uci_01->harq->harq_confidence_level; From ae8e0ea3da5be04b549ad1849c848a192a50907f Mon Sep 17 00:00:00 2001 From: David Kim Date: Thu, 4 Nov 2021 13:46:24 -0700 Subject: [PATCH 08/16] Reverted unncessary changes. --- openair1/PHY/NR_TRANSPORT/pucch_rx.c | 3 --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 +- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 3 +-- openair2/RRC/NR/MESSAGES/asn1_msg.c | 2 +- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c index 6e82693962..781f018b60 100644 --- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c +++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c @@ -415,7 +415,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, if (pucch_pdu->bit_len_harq==0) { uci_pdu->harq = NULL; uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr)); - AssertFatal (uci_pdu->sr != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 0\n"); uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0; uci_stats->pucch0_sr_trials++; if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) { @@ -427,7 +426,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } else if (pucch_pdu->bit_len_harq==1) { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); - AssertFatal (uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq == 1\n"); uci_pdu->harq->num_harq = 1; uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1); @@ -444,7 +442,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB, } else { uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq)); - AssertFatal (uci_pdu->harq != NULL, "Memory allocation failed when pucch_pdu->bit_len_harq > 1\n"); uci_pdu->harq->num_harq = 2; uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0; uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2); diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index b6cc0896b4..09e7614c7b 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -3807,7 +3807,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t if ((mac->crnti == ra->t_crnti) && (get_softmodem_params()->nsa)) { - LOG_I(MAC, "Discarding the received RAR.\n"); + LOG_D(MAC, "Discarding the received RAR.\n"); return -1; } while (1) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 54da163872..05c82431b0 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -2184,6 +2184,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); RA_config_t *ra = &mac->ra; + fapi_nr_ul_config_request_t *ul_config; if (get_softmodem_params()->nsa) { ul_config = get_ul_config_request(mac, slotP); @@ -2237,8 +2238,6 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu; memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu)); - if (get_softmodem_params()->nsa) - ul_config->number_pdus += 1; fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH); LOG_D(PHY, "In %s: (%p) %d UL PDUs:\n", __FUNCTION__, ul_config, ul_config->number_pdus); diff --git a/openair2/RRC/NR/MESSAGES/asn1_msg.c b/openair2/RRC/NR/MESSAGES/asn1_msg.c index 5422c8bc6a..7fb73470b2 100755 --- a/openair2/RRC/NR/MESSAGES/asn1_msg.c +++ b/openair2/RRC/NR/MESSAGES/asn1_msg.c @@ -1033,7 +1033,7 @@ void fill_initial_SpCellConfig(rnti_t rnti, // one symbol (13) NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0)); pucchres0->pucch_ResourceId=0; - pucchres0->startingPRB = (8+rnti) % curr_bwp; + pucchres0->startingPRB=(8+rnti) % curr_bwp; LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp); pucchres0->intraSlotFrequencyHopping=NULL; pucchres0->secondHopPRB=NULL; From fc1815170e96f64f906c4dc422ae7cd30c0daf6b Mon Sep 17 00:00:00 2001 From: David Kim Date: Fri, 5 Nov 2021 09:48:48 -0700 Subject: [PATCH 09/16] Fixed a bug on setting the number of pdus. --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 61c6e4db8f..35877eb88d 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -410,8 +410,8 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) } else { - UL_INFO.crc_ind.number_crcs = 0; - UL_INFO.rx_ind.number_of_pdus = 0; + UL_info->crc_ind.number_crcs = 0; + UL_info->rx_ind.number_of_pdus = 0; } } else if ((UL_INFO.rx_ind.number_of_pdus != 0) || (UL_INFO.crc_ind.number_crcs != 0)) { From 8d6b112c174f69fe5772e132440068d9daa154d0 Mon Sep 17 00:00:00 2001 From: David Kim Date: Fri, 5 Nov 2021 12:35:15 -0700 Subject: [PATCH 10/16] Removed unrequired nsa conditions. --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 2 -- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 18 +++++------------- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 2 +- openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c | 17 ++++++----------- 4 files changed, 12 insertions(+), 27 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 09e7614c7b..5314db10c1 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -614,8 +614,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); - if (!get_softmodem_params()->nsa) - memset(def_dci_pdu_rel15, 0, sizeof(dci_pdu_rel15_t)); return ret_proc; } diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index 05c82431b0..e6f515a43f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -961,8 +961,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in uint8_t ulsch_input_buffer[MAX_ULSCH_PAYLOAD_BYTES]; nr_scheduled_response_t scheduled_response; fapi_nr_tx_request_t tx_req; - if (get_softmodem_params()->nsa) - memset(&tx_req, 0, sizeof(tx_req)); + memset(&tx_req, 0, sizeof(tx_req)); for (int j = 0; j < ul_config->number_pdus; j++) { @@ -2184,17 +2183,10 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP); RA_config_t *ra = &mac->ra; - - fapi_nr_ul_config_request_t *ul_config; - if (get_softmodem_params()->nsa) { - ul_config = get_ul_config_request(mac, slotP); - if (!ul_config) { - LOG_E(NR_MAC, "mac->ul_config is null! \n"); - return; - } - } - else { - ul_config = &mac->ul_config_request[0]; + fapi_nr_ul_config_request_t *ul_config = get_ul_config_request(mac, slotP); + if (!ul_config) { + LOG_E(NR_MAC, "mac->ul_config is null! \n"); + return; } fapi_nr_ul_config_prach_pdu *prach_config_pdu; diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 35877eb88d..afef9e253e 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -176,7 +176,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1; - LOG_I(NR_MAC, "The received uci has sfn slot %d %d, num_ucis %d and pdu_size %d\n", + LOG_D(NR_MAC, "The received uci has sfn slot %d %d, num_ucis %d and pdu_size %d\n", UL_INFO.uci_ind.sfn, UL_INFO.uci_ind.slot, num_ucis, uci_list[i].pdu_size); handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu); break; diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 22881e008c..9dc6cf918f 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -876,8 +876,7 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t // Note: sdu should always be processed because data and timing advance updates are transmitted by the UE int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){ - if (get_softmodem_params()->nsa) - dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; + dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid; update_harq_status(dl_info, pdu_id); if(dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.ack_nack) @@ -951,14 +950,10 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ dl_info->slot, dl_info->dci_ind->dci_list+i); - if (get_softmodem_params()->nsa) - { - 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)); - } + 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); ret_mask |= (ret << FAPI_NR_DCI_IND); if (ret >= 0) { @@ -967,7 +962,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_ 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_if_module_inst[module_id]->scheduled_response(&scheduled_response); } - + memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15)); } free(dl_info->dci_ind); dl_info->dci_ind = NULL; From fa6aa315596da398fb9a5fbde83003c10698c954 Mon Sep 17 00:00:00 2001 From: David Kim Date: Fri, 5 Nov 2021 14:25:09 -0700 Subject: [PATCH 11/16] Changed log level from I to D in PUSCH detection. --- openair1/SCHED_NR/phy_procedures_nr_gNB.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index bd44a1e983..9722b8b13e 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -733,7 +733,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { (ulsch_harq->slot == slot_rx) && (ulsch_harq->handled == 0)){ - LOG_I(PHY, "PUSCH detection started in frame %d slot %d\n", + LOG_D(PHY, "PUSCH detection started in frame %d slot %d\n", frame_rx,slot_rx); int num_dmrs=0; for (int s=0;s Date: Fri, 5 Nov 2021 14:34:18 -0700 Subject: [PATCH 12/16] Removed unrequired comments. --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index afef9e253e..4a7e36cad4 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -163,8 +163,8 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) } const module_id_t mod_id = UL_info->module_id; - const frame_t frame = UL_INFO.uci_ind.sfn;//TODO: Need to check to use UL_info->frame; - const sub_frame_t slot = UL_INFO.uci_ind.slot;//TODO: Need to check to use UL_info->slot; + const frame_t frame = UL_INFO.uci_ind.sfn; + const sub_frame_t slot = UL_INFO.uci_ind.slot; int num_ucis = UL_INFO.uci_ind.num_ucis; nfapi_nr_uci_t *uci_list = UL_INFO.uci_ind.uci_list; @@ -301,8 +301,8 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) UL_INFO.CC_id = UL_info->CC_id; } - UL_INFO.frame = UL_INFO.rx_ind.sfn;//TODO: Need to check to use UL_info->frame; - UL_INFO.slot = UL_INFO.rx_ind.slot;//TODO: Need to check to use UL_info->slot; + UL_INFO.frame = UL_INFO.rx_ind.sfn; + UL_INFO.slot = UL_INFO.rx_ind.slot; UL_INFO.module_id = UL_info->module_id; UL_INFO.CC_id = UL_info->CC_id; LOG_D(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n", From d51314f57d422fe9b239b148fec10d0b6afaf1b1 Mon Sep 17 00:00:00 2001 From: David Kim Date: Fri, 5 Nov 2021 14:42:39 -0700 Subject: [PATCH 13/16] Updated coding format in unified way. --- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 4a7e36cad4..297dccebee 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -64,7 +64,7 @@ extern uint16_t sl_ahead; void handle_nr_rach(NR_UL_IND_t *UL_info) { if(NFAPI_MODE == NFAPI_MODE_PNF) { - if (UL_info->rach_ind.number_of_pdus>0) { + if (UL_info->rach_ind.number_of_pdus > 0) { LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot); oai_nfapi_nr_rach_indication(&UL_info->rach_ind); UL_info->rach_ind.number_of_pdus = 0; @@ -75,7 +75,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) nfapi_nr_rach_indication_t *rach_ind = NULL; if (get_softmodem_params()->nsa) { - if (gnb_rach_ind_queue.num_items ==0) + if (gnb_rach_ind_queue.num_items == 0) return; LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items); rach_ind = get_queue(&gnb_rach_ind_queue); @@ -139,7 +139,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) void handle_nr_uci(NR_UL_IND_t *UL_info) { if(NFAPI_MODE == NFAPI_MODE_PNF) { - if (UL_info->uci_ind.num_ucis>0) { + if (UL_info->uci_ind.num_ucis > 0) { LOG_D(PHY,"PNF Sending UL_info->num_ucis:%d PDU_type: %d, SFN/SF:%d.%d \n", UL_info->uci_ind.num_ucis, UL_info->uci_ind.uci_list[0].pdu_type ,UL_info->frame, UL_info->slot); oai_nfapi_nr_uci_indication(&UL_info->uci_ind); UL_info->uci_ind.num_ucis = 0; @@ -151,7 +151,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) nfapi_nr_uci_indication_t *uci_ind = NULL; if (get_softmodem_params()->nsa) { - if (gnb_uci_ind_queue.num_items ==0) + if (gnb_uci_ind_queue.num_items == 0) return; LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items); uci_ind = get_queue(&gnb_uci_ind_queue); @@ -249,13 +249,13 @@ static bool crc_sfn_slot_matcher(void *wanted, void *candidate) void handle_nr_ulsch(NR_UL_IND_t *UL_info) { if(NFAPI_MODE == NFAPI_MODE_PNF) { - if (UL_info->crc_ind.number_crcs>0) { + if (UL_info->crc_ind.number_crcs > 0) { LOG_D(PHY,"UL_info->UL_info->crc_ind.number_crcs:%d CRC_IND:SFN/Slot:%d.%d\n", UL_info->crc_ind.number_crcs, UL_info->crc_ind.sfn, UL_info->crc_ind.slot); oai_nfapi_nr_crc_indication(&UL_info->crc_ind); UL_info->crc_ind.number_crcs = 0; } - if (UL_info->rx_ind.number_of_pdus>0) { + if (UL_info->rx_ind.number_of_pdus > 0) { LOG_D(PHY,"UL_info->rx_ind.number_of_pdus:%d RX_IND:SFN/Slot:%d.%d \n", UL_info->rx_ind.number_of_pdus, UL_info->rx_ind.sfn, UL_info->rx_ind.slot); oai_nfapi_nr_rx_data_indication(&UL_info->rx_ind); UL_info->rx_ind.number_of_pdus = 0; From b13fce53854c8134997c0ec9d0de0da301062460 Mon Sep 17 00:00:00 2001 From: David Kim Date: Mon, 8 Nov 2021 16:04:39 -0800 Subject: [PATCH 14/16] Removed NSA mode further in nrUE codes and fixed format. --- openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c | 19 +++---------------- openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c | 5 ++--- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 6 +++--- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 5314db10c1..7dab05115f 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -599,12 +599,6 @@ 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 ((dci->rnti != mac->crnti) && (dci->rnti != mac->ra.ra_rnti) && (get_softmodem_params()->nsa)) { - LOG_D(MAC,"We skip for the received dci indication rnti %4x != mac->crnti %4x frame slot %4d.%2d RA state %d\n", - dci->rnti, mac->crnti, frame, slot, mac->ra.ra_state); - return 0; - } - 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); @@ -733,11 +727,9 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr LOG_W(MAC, "In %s: ul_config request is NULL. Probably due to unexpected UL DCI in frame.slot %d.%d. Ignoring DCI!\n", __FUNCTION__, frame, slot); return -1; } - if (get_softmodem_params()->nsa) { - ul_config->number_pdus = 0; - AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), - "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); - } + ul_config->number_pdus = 0; + AssertFatal(ul_config->number_pdus < sizeof(ul_config->ul_config_list) / sizeof(ul_config->ul_config_list[0]), + "Number of PDUS in ul_config = %d > ul_config_list num elements", ul_config->number_pdus); nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].pusch_config_pdu; fill_ul_config(ul_config, frame_tx, slot_tx, FAPI_NR_UL_CONFIG_TYPE_PUSCH); @@ -3803,11 +3795,6 @@ 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 ((mac->crnti == ra->t_crnti) && (get_softmodem_params()->nsa)) - { - LOG_D(MAC, "Discarding the received RAR.\n"); - return -1; - } while (1) { n_subheaders++; if (rarh->T == 1) { diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c index e6f515a43f..50fcd36607 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c @@ -163,7 +163,7 @@ fapi_nr_ul_config_request_t *get_ul_config_request(NR_UE_MAC_INST_t *mac, int sl num_slots_ul, index); - if(!mac->ul_config_request && get_softmodem_params()->nsa) + if(!mac->ul_config_request) return NULL; return &mac->ul_config_request[index]; } @@ -911,8 +911,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in dcireq.slot = rx_slot; dcireq.dl_config_req.number_pdus = 0; nr_ue_dcireq(&dcireq); //to be replaced with function pointer later - if (get_softmodem_params()->nsa) - mac->dl_config_request = dcireq.dl_config_req; + mac->dl_config_request = dcireq.dl_config_req; fill_scheduled_response(&scheduled_response, &dcireq.dl_config_req, NULL, NULL, mod_id, cc_id, rx_frame, rx_slot, dl_info->thread_id); if(mac->if_module != NULL && mac->if_module->scheduled_response != NULL) diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 297dccebee..251f5cf4fd 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -278,9 +278,9 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot); crc_ind = unqueue_matching(&gnb_crc_ind_queue, - MAX_QUEUE_SIZE, - crc_sfn_slot_matcher, - &sfn_slot); + MAX_QUEUE_SIZE, + crc_sfn_slot_matcher, + &sfn_slot); if (!crc_ind) { LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); From d564d8f94d552cee86d0d99208fdc3987c9f3187 Mon Sep 17 00:00:00 2001 From: David Kim Date: Mon, 8 Nov 2021 21:27:55 -0800 Subject: [PATCH 15/16] Updated to emulate_l1 instead of nsa in gNB indication. --- openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c | 5 +++-- openair2/NR_PHY_INTERFACE/NR_IF_Module.c | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 7b58d0e531..97e97ad036 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -1099,8 +1099,9 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id, const int8_t pid = sched_ctrl->feedback_dl_harq.head; remove_front_nr_list(&sched_ctrl->feedback_dl_harq); /* According to nfapi_nr_interface_scf.h, harq_value = 0 is a pass - (The check below was for harq_value == 1 in the develop branch) */ - if (get_softmodem_params()->nsa) + (The check below was for harq_value == 1 in the develop branch) + TODO: After update in develop branch, the following condition will be updated.*/ + if (get_softmodem_params()->emulate_l1) handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0); else handle_dl_harq(mod_id, UE_id, pid, harq_value == 1 && harq_confidence == 0); diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 251f5cf4fd..7d19f35027 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -73,7 +73,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) } NR_UL_IND_t UL_INFO; nfapi_nr_rach_indication_t *rach_ind = NULL; - if (get_softmodem_params()->nsa) + if (get_softmodem_params()->emulate_l1) { if (gnb_rach_ind_queue.num_items == 0) return; @@ -118,7 +118,7 @@ void handle_nr_rach(NR_UL_IND_t *UL_info) UL_INFO.rach_ind.pdu_list[i].preamble_list[0].timing_advance); } } - if (get_softmodem_params()->nsa) + if (get_softmodem_params()->emulate_l1) { if (rach_ind && rach_ind->number_of_pdus > 0) { @@ -149,7 +149,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) NR_UL_IND_t UL_INFO; nfapi_nr_uci_indication_t *uci_ind = NULL; - if (get_softmodem_params()->nsa) + if (get_softmodem_params()->emulate_l1) { if (gnb_uci_ind_queue.num_items == 0) return; @@ -191,7 +191,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) } } - if (get_softmodem_params()->nsa) + if (get_softmodem_params()->emulate_l1) { for (int i = 0; i < num_ucis; i++) { switch (uci_list[i].pdu_type) { @@ -266,7 +266,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) NR_UL_IND_t UL_INFO; nfapi_nr_rx_data_indication_t *rx_ind = NULL; nfapi_nr_crc_indication_t *crc_ind = NULL; - if (get_softmodem_params()->nsa) + if (get_softmodem_params()->emulate_l1) { rx_ind = get_queue(&gnb_rx_ind_queue); if (!rx_ind) @@ -353,7 +353,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc); break; } // for (j=0;jnsa) + if (get_softmodem_params()->emulate_l1) { int last = UL_INFO.crc_ind.number_crcs - 1; if (j < last) @@ -379,7 +379,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) } } } // for (i=0;insa) + if (get_softmodem_params()->emulate_l1) { if (UL_INFO.crc_ind.number_crcs > 0) { From 361348574916707e2e117ac183aaf83bd70ac41b Mon Sep 17 00:00:00 2001 From: David Kim Date: Mon, 8 Nov 2021 21:30:35 -0800 Subject: [PATCH 16/16] Added new config file for gNB in SA test. --- ...sci_gnb.band78.sa.fr1.106PRB.usrpn310.conf | 325 ++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf 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 new file mode 100644 index 0000000000..740313abfc --- /dev/null +++ b/ci-scripts/conf_files/episci/episci_gnb.band78.sa.fr1.106PRB.usrpn310.conf @@ -0,0 +1,325 @@ +Active_gNBs = ( "gNB-OAI"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +gNBs = +( + { + ////////// Identification parameters: + gNB_ID = 0xe00; + gNB_name = "gNB-OAI"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = 1; + plmn_list = ({ + mcc = 208; + mnc = 99; + mnc_length = 2; + snssaiList = ( + { + sst = 1; + sd = 0x1; // 0 false, else true + }, + { + sst = 1; + sd = 0x112233; // 0 false, else true + } + ); + + }); + + nr_cellid = 12345678L; + + ////////// Physical parameters: + + ssb_SubcarrierOffset = 0; + pdsch_AntennaPorts = 1; + pusch_AntennaPorts = 1; + ul_prbblacklist = "51,52,53,54" + + pdcch_ConfigSIB1 = ( + { + controlResourceSetZero = 12; + searchSpaceZero = 0; + } + ); + + servingCellConfigCommon = ( + { + #spCellConfigCommon + + physCellId = 0; + +# downlinkConfigCommon + #frequencyInfoDL + # this is 3600 MHz + 43 PRBs@30kHz SCS (same as initial BWP) + absoluteFrequencySSB = 641280; + dl_frequencyBand = 78; + # this is 3600 MHz + dl_absoluteFrequencyPointA = 640008; + #scs-SpecificCarrierList + dl_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + dl_subcarrierSpacing = 1; + dl_carrierBandwidth = 106; + #initialDownlinkBWP + #genericParameters + # this is RBstart=27,L=48 (275*(L-1))+RBstart + initialDLBWPlocationAndBandwidth = 12952; # 6366 12925 12956 28875 12952 +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialDLBWPsubcarrierSpacing = 1; + #pdcch-ConfigCommon + initialDLBWPcontrolResourceSetZero = 12; + initialDLBWPsearchSpaceZero = 0; + #pdsch-ConfigCommon + #pdschTimeDomainAllocationList (up to 16 entries) + initialDLBWPk0_0 = 0; #for DL slot + initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB + initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13 + + initialDLBWPk0_1 = 0; #for mixed slot + initialDLBWPmappingType_1 = 0; + initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5 + + #uplinkConfigCommon + #frequencyInfoUL + ul_frequencyBand = 78; + #scs-SpecificCarrierList + ul_offstToCarrier = 0; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + ul_subcarrierSpacing = 1; + ul_carrierBandwidth = 106; + pMax = 20; + #initialUplinkBWP + #genericParameters + initialULBWPlocationAndBandwidth = 12952; +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + initialULBWPsubcarrierSpacing = 1; + #rach-ConfigCommon + #rach-ConfigGeneric + prach_ConfigurationIndex = 98; +#prach_msg1_FDM +#0 = one, 1=two, 2=four, 3=eight + prach_msg1_FDM = 0; + prach_msg1_FrequencyStart = 0; + zeroCorrelationZoneConfig = 13; + preambleReceivedTargetPower = -96; +#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200) + preambleTransMax = 6; +#powerRampingStep +# 0=dB0,1=dB2,2=dB4,3=dB6 + powerRampingStep = 1; +#ra_ReponseWindow +#1,2,4,8,10,20,40,80 + ra_ResponseWindow = 4; +#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR +#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen + ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 4; +#oneHalf (0..15) 4,8,12,16,...60,64 + ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 14; +#ra_ContentionResolutionTimer +#(0..7) 8,16,24,32,40,48,56,64 + ra_ContentionResolutionTimer = 7; + rsrp_ThresholdSSB = 19; +#prach-RootSequenceIndex_PR +#1 = 839, 2 = 139 + prach_RootSequenceIndex_PR = 2; + prach_RootSequenceIndex = 1; + # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex + # + msg1_SubcarrierSpacing = 1, +# restrictedSetConfig +# 0=unrestricted, 1=restricted type A, 2=restricted type B + restrictedSetConfig = 0, + + # pusch-ConfigCommon (up to 16 elements) + initialULBWPk2_0 = 6; # used for UL slot + initialULBWPmappingType_0 = 1 + initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13 + + initialULBWPk2_1 = 6; # used for mixed slot + initialULBWPmappingType_1 = 1; + initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4 + + initialULBWPk2_2 = 7; # used for Msg.3 during RA + initialULBWPmappingType_2 = 1; + initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4 + + msg3_DeltaPreamble = 1; + p0_NominalWithGrant =-90; + +# pucch-ConfigCommon setup : +# pucchGroupHopping +# 0 = neither, 1= group hopping, 2=sequence hopping + pucchGroupHopping = 0; + hoppingId = 40; + p0_nominal = -90; +# ssb_PositionsInBurs_BitmapPR +# 1=short, 2=medium, 3=long + ssb_PositionsInBurst_PR = 2; + ssb_PositionsInBurst_Bitmap = 1; + +# ssb_periodicityServingCell +# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1 + ssb_periodicityServingCell = 2; + +# dmrs_TypeA_position +# 0 = pos2, 1 = pos3 + dmrs_TypeA_Position = 0; + +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + subcarrierSpacing = 1; + + + #tdd-UL-DL-ConfigurationCommon +# subcarrierSpacing +# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 + referenceSubcarrierSpacing = 1; + # pattern1 + # dl_UL_TransmissionPeriodicity + # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10 + dl_UL_TransmissionPeriodicity = 6; + nrofDownlinkSlots = 7; + nrofDownlinkSymbols = 6; + nrofUplinkSlots = 2; + nrofUplinkSymbols = 4; + + ssPBCH_BlockPower = -25; + } + + ); + + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// AMF parameters: + amf_ip_address = ( { ipv4 = "192.168.61.195"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + + NETWORK_INTERFACES : + { + GNB_INTERFACE_NAME_FOR_NG_AMF = "lo:"; + GNB_IPV4_ADDRESS_FOR_NG_AMF = "127.0.0.2"; + GNB_INTERFACE_NAME_FOR_NGU = "lo:"; + GNB_IPV4_ADDRESS_FOR_NGU = "127.0.0.2"; + GNB_PORT_FOR_NGU = 2152; # Spec 2152 + }; + + } +); + +MACRLCs = ( + { + num_cc = 1; + local_s_if_name = "lo:"; + remote_s_address = "127.0.0.1"; // pnf addr [!] + local_s_address = "127.0.0.2"; // vnf addr + local_s_portc = 50601; // vnf p5 port + remote_s_portc = 50600; // pnf p5 port [!] + local_s_portd = 50611; // vnf p7 port [!] + remote_s_portd = 50610; // pnf p7 port [!] + tr_s_preference = "nfapi"; + tr_n_preference = "local_RRC"; + } +); + +L1s = ( + { + num_cc = 1; + tr_n_preference = "local_mac"; + pusch_proc_threads = 8; + prach_dtx_threshold = 120; + pucch0_dtx_threshold = 150; + } +); + +RUs = ( + { + local_rf = "yes" + nb_tx = 1 + nb_rx = 1 + att_tx = 0 + att_rx = 0; + bands = [78]; + max_pdschReferenceSignalPower = -27; + max_rxgain = 75; + eNB_instances = [0]; + #beamforming 1x4 matrix: + bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; + #clock_src = "external"; + sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal" + } +); + +THREAD_STRUCT = ( + { + #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT" + parallel_config = "PARALLEL_SINGLE_THREAD"; + #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE" + worker_config = "WORKER_ENABLE"; + } +); + +rfsimulator : +{ + serveraddr = "server"; + serverport = "4043"; + options = (); #("saviq"); or/and "chanmod" + modelname = "AWGN"; + IQfile = "/tmp/rfsimulator.iqs"; +}; + +security = { + # preferred ciphering algorithms + # the first one of the list that an UE supports in chosen + # valid values: nea0, nea1, nea2, nea3 + ciphering_algorithms = ( "nea0" ); + + # preferred integrity algorithms + # the first one of the list that an UE supports in chosen + # valid values: nia0, nia1, nia2, nia3 + integrity_algorithms = ( "nia2", "nia0" ); + + # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter + # what 'ciphering_algorithms' configures; same thing for 'drb_integrity' + drb_ciphering = "yes"; + drb_integrity = "no"; +}; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + ngap_log_level ="debug"; + ngap_log_verbosity ="medium"; + }; +