diff --git a/ci-scripts/conf_files/nr-ue.nfapi.conf b/ci-scripts/conf_files/nr-ue.nfapi.conf index 6ae6e160aebc5e7f9de0075cc3bdfa616d512695..652e3d9dbf212b5c866e22afdfac401786842d76 100644 --- a/ci-scripts/conf_files/nr-ue.nfapi.conf +++ b/ci-scripts/conf_files/nr-ue.nfapi.conf @@ -20,9 +20,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "CI_ENB_IP_ADDR"; - local_n_address = "CI_UE_IP_ADDR"; + local_n_if_name = "lo:"; + remote_n_address = "127.0.0.2"; + local_n_address = "127.0.0.1"; local_n_portc = 50600; remote_n_portc = 50601; local_n_portd = 50610; diff --git a/ci-scripts/conf_files/ue.nfapi.conf b/ci-scripts/conf_files/ue.nfapi.conf index 2b602cbcf292902e6702f134aeabfaa012956185..3f227d573ce08d877303567177ace3a1fb3611b0 100644 --- a/ci-scripts/conf_files/ue.nfapi.conf +++ b/ci-scripts/conf_files/ue.nfapi.conf @@ -20,9 +20,9 @@ L1s = ( { num_cc = 1; tr_n_preference = "nfapi"; - local_n_if_name = "ens3"; - remote_n_address = "CI_ENB_IP_ADDR"; - local_n_address = "CI_UE_IP_ADDR"; + local_n_if_name = "lo"; + remote_n_address = "127.0.0.1"; + local_n_address = "127.0.0.1"; local_n_portc = 50000; remote_n_portc = 50001; local_n_portd = 50010; diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 71285e0d8d790c234c320cdd7f546d5503d721b1..f9fc1bda3f2c53185268f7c3dd0892e46321f377 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -306,7 +306,7 @@ endif() # set(CMAKE_C_FLAGS - "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -pipe -std=gnu99 -Wall -Werror -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC") + "${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -pipe -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC") # add autotools definitions that were maybe used! if (CUDA_FOUND) set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'") @@ -314,14 +314,14 @@ if (CUDA_FOUND) "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D CUDA_FLAG" ) set(CUDA_CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -Werror -fno-strict-aliasing -rdynamic -std=c++11 -D CUDA_FLAG" + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D CUDA_FLAG" ) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER} -D CUDA_FLAG" ) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -Werror -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER} -D CUDA_FLAG" + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER} -D CUDA_FLAG" ) else (CUDA_FOUND) set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'") @@ -329,7 +329,7 @@ else (CUDA_FOUND) "${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER}" ) set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -Werror -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER}" + "${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D${MKVER}" ) endif () @@ -2905,6 +2905,7 @@ add_executable(lte-softmodem ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c + ${PHY_INTERFACE_DIR}/queue.c ${GTPU_need_ITTI} ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} @@ -3059,6 +3060,7 @@ add_executable(nr-softmodem ${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c + ${PHY_INTERFACE_DIR}/queue.c ${GTPU_need_ITTI} ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c index 8d39c314f780c0ae69cf65e79b8f66dfb194f745..df2f6478557924f027f1fe19277a5dbe74fda6c3 100644 --- a/executables/nr-gnb.c +++ b/executables/nr-gnb.c @@ -443,6 +443,7 @@ static void *gNB_L1_thread( void *param ) { if (gNB->CC_id==0) { int next_slot; next_slot = (slot_rx + 1) % 20; + LOG_I(PHY, "Calling rxtx1\n"); if (rxtx(gNB,frame_rx,next_slot,frame_tx,next_slot,thread_name) < 0) break; } if (wait_on_condition(&L1_proc->mutex,&L1_proc->cond,&L1_proc->instance_cnt,thread_name)<0) break; @@ -457,6 +458,7 @@ static void *gNB_L1_thread( void *param ) { if (oai_exit) break; if (gNB->CC_id==0) { + LOG_I(PHY, "Calling rxtx2\n"); if (rxtx(gNB,frame_rx,slot_rx,frame_tx,slot_tx,thread_name) < 0) break; } diff --git a/executables/nr-ue.c b/executables/nr-ue.c index cfb8636b8215dc6bc15b3c97f89f922ce204769e..2154230013b1b35ffaa096398bc46a87347079e7 100644 --- a/executables/nr-ue.c +++ b/executables/nr-ue.c @@ -178,15 +178,6 @@ static void L1_nsa_prach_procedures(frame_t frame, int slot, fapi_nr_ul_config_p LOG_I(NR_MAC, "Melissa, We have successfully filled the rach_ind queue with the recently filled rach ind\n"); } -static void reset_queue(queue_t *q) -{ - void *p; - while ((p = get_queue(q)) != NULL) - { - free(p); - } -} - static bool sfn_slot_matcher(void *wanted, void *candidate) { nfapi_p7_message_header_t *msg = candidate; diff --git a/nfapi/oai_integration/nfapi_vnf.c b/nfapi/oai_integration/nfapi_vnf.c index 485169c67a53bc36b8259c678283c053e71d208f..e6f528cd38d5940af150be66bdd266e92e776dbc 100644 --- a/nfapi/oai_integration/nfapi_vnf.c +++ b/nfapi/oai_integration/nfapi_vnf.c @@ -42,12 +42,12 @@ #include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h" #include "common/ran_context.h" +#include "openair2/PHY_INTERFACE/queue.h" #define TEST extern RAN_CONTEXT_t RC; extern UL_RCC_IND_t UL_RCC_INFO; -extern NR_UL_IND_t UL_INFO; typedef struct { uint8_t enabled; @@ -171,6 +171,11 @@ typedef struct { } vnf_info; +queue_t gnb_rach_ind_queue; +queue_t gnb_rx_ind_queue; +queue_t gnb_crc_ind_queue; +queue_t gnb_uci_ind_queue; + int vnf_pack_vendor_extension_tlv(void *ve, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t *codec) { //NFAPI_TRACE(NFAPI_TRACE_INFO, "vnf_pack_vendor_extension_tlv\n"); nfapi_tl_t *tlv = (nfapi_tl_t *)ve; @@ -704,7 +709,43 @@ int phy_nr_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_nr_rach_ind { if(NFAPI_MODE == NFAPI_MODE_VNF) { - UL_INFO.rach_ind = *ind; + //UL_INFO.rach_ind = *ind; + nfapi_nr_rach_indication_t *rach_ind = CALLOC(1, sizeof(*rach_ind)); + rach_ind->header.message_id = ind->header.message_id; + rach_ind->number_of_pdus = ind->number_of_pdus; + rach_ind->sfn = ind->sfn; + rach_ind->slot = ind->slot; + rach_ind->pdu_list = CALLOC(1, sizeof(*rach_ind->pdu_list)); + if (rach_ind->pdu_list == NULL) { + LOG_I(NR_MAC, "Memory not allocated for rach_ind->pdu_list of phy_nr_rach_indication in nfapi_vnf.c.\n"); + exit(0); + } + for (int i = 0; i < ind->number_of_pdus; i++) + { + rach_ind->pdu_list[i].num_preamble = ind->pdu_list[i].num_preamble; + rach_ind->pdu_list[i].freq_index = ind->pdu_list[i].freq_index; + rach_ind->pdu_list[i].symbol_index = ind->pdu_list[i].symbol_index; + rach_ind->pdu_list[i].preamble_list = CALLOC(ind->pdu_list[i].num_preamble, sizeof(nfapi_nr_prach_indication_preamble_t)); + if (rach_ind->pdu_list[i].preamble_list == NULL) { + LOG_I(NR_MAC, "Memory not allocated for rach_ind->pdu_list[i].preamble_list of phy_nr_rach_indication in nfapi_vnf.c.\n"); + exit(0); + } + for (int j = 0; j < ind->number_of_pdus; j++) + { + rach_ind->pdu_list[i].preamble_list[j].preamble_index = ind->pdu_list[i].preamble_list[j].preamble_index; + rach_ind->pdu_list[i].preamble_list[j].timing_advance = ind->pdu_list[i].preamble_list[j].timing_advance; + } + } + if (!put_queue(&gnb_rach_ind_queue, rach_ind)) + { + LOG_E(NR_MAC, "Put_queue failed for rach_ind\n"); + for (int i = 0; i < ind->number_of_pdus; i++) + { + free(rach_ind->pdu_list[i].preamble_list); + } + free(rach_ind->pdu_list); + free(rach_ind); + } } else { LOG_E(NR_MAC, "NFAPI_MODE = %d not NFAPI_MODE_VNF(2)\n", nfapi_getmode()); @@ -719,7 +760,104 @@ int phy_nr_uci_indication(struct nfapi_vnf_p7_config *config, nfapi_nr_uci_indic __FUNCTION__,ind->sfn, ind->slot, ind->num_ucis); if(NFAPI_MODE == NFAPI_MODE_VNF) { - UL_INFO.uci_ind = *ind; + nfapi_nr_uci_indication_t *uci_ind = CALLOC(1, sizeof(*uci_ind)); + if (uci_ind == NULL) { + LOG_E(NR_MAC,"Memory not allocated for uci_ind of phy_nr_uci_indication in nfapi_vnf.c.\n"); + exit(0); + } + + *uci_ind = *ind; + + uci_ind->uci_list = CALLOC(NFAPI_NR_UCI_IND_MAX_PDU, sizeof(nfapi_nr_uci_t)); + if (uci_ind->uci_list == NULL) { + LOG_E(NR_MAC,"Memory not allocated for uci_ind->uci_list of phy_nr_uci_indication in nfapi_vnf.c.\n"); + exit(0); + } + + for (int i = 0; i < ind->num_ucis; i++) + { + uci_ind->uci_list[i] = ind->uci_list[i]; + + switch (uci_ind->uci_list[i].pdu_type) { + case NFAPI_NR_UCI_PUSCH_PDU_TYPE: + LOG_E(MAC, "%s(): unhandled NFAPI_NR_UCI_PUSCH_PDU_TYPE\n", __func__); + break; + + case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: { + nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_0_1; + nfapi_nr_uci_pucch_pdu_format_0_1_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_0_1; + + uci_ind_pdu->harq = CALLOC(1, sizeof(*uci_ind_pdu->harq)); + if (uci_ind_pdu->harq == NULL) { + LOG_E(NR_MAC,"Memory not allocated for uci_ind_pdu->harq of phy_nr_uci_indication in nfapi_vnf.c.\n"); + exit(0); + } + + *uci_ind_pdu->harq = *ind_pdu->harq; + + uci_ind_pdu->harq->harq_list = CALLOC(uci_ind_pdu->harq->num_harq, sizeof(*uci_ind_pdu->harq->harq_list)); + if (uci_ind_pdu->harq->harq_list == NULL) { + LOG_E(NR_MAC,"Memory not allocated for uci_ind_pdu->harq->harq_list of phy_nr_uci_indication in nfapi_vnf.c.\n"); + exit(0); + } + for (int j = 0; j < uci_ind_pdu->harq->num_harq; j++) + uci_ind_pdu->harq->harq_list[j].harq_value = ind_pdu->harq->harq_list[j].harq_value; + + break; + } + + case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE: { + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_ind_pdu = &uci_ind->uci_list[i].pucch_pdu_format_2_3_4; + nfapi_nr_uci_pucch_pdu_format_2_3_4_t *ind_pdu = &ind->uci_list[i].pucch_pdu_format_2_3_4; + + uci_ind_pdu->harq.harq_payload = CALLOC(1, sizeof(*uci_ind_pdu->harq.harq_payload)); + if (uci_ind_pdu->harq.harq_payload == NULL) { + LOG_E(NR_MAC,"Memory not allocated for uci_ind_pdu->harq.harq_payload of phy_nr_uci_indication in nfapi_vnf.c.\n"); + exit(0); + } + *uci_ind_pdu->harq.harq_payload = *ind_pdu->harq.harq_payload; + + + uci_ind_pdu->csi_part1.csi_part1_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part1.csi_part1_payload)); + if (uci_ind_pdu->csi_part1.csi_part1_payload == NULL) { + LOG_E(NR_MAC,"Memory not allocated for uci_ind_pdu->csi_part1->csi_part1_payload of phy_nr_uci_indication in nfapi_vnf.c.\n"); + exit(0); + } + *uci_ind_pdu->csi_part1.csi_part1_payload = *ind_pdu->csi_part1.csi_part1_payload; + + + uci_ind_pdu->csi_part2.csi_part2_payload = CALLOC(1, sizeof(*uci_ind_pdu->csi_part2.csi_part2_payload)); + if (uci_ind_pdu->csi_part2.csi_part2_payload == NULL) { + LOG_E(NR_MAC,"Memory not allocated for uci_ind_pdu->csi_part2->csi_part2_payload of phy_nr_uci_indication in nfapi_vnf.c.\n"); + exit(0); + } + *uci_ind_pdu->csi_part2.csi_part2_payload = *ind_pdu->csi_part2.csi_part2_payload; + + break; + } + } + } + + if (!put_queue(&gnb_uci_ind_queue, uci_ind)) + { + LOG_E(NR_MAC, "Put_queue failed for uci_ind\n"); + for (int i = 0; i < ind->num_ucis; i++) + { + if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE) + { + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list); + free(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq); + } + if (uci_ind->uci_list[i].pdu_type == NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE) + { + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload); + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload); + free(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload); + } + } + free(uci_ind->uci_list); + free(uci_ind); + } } else { LOG_E(NR_MAC, "NFAPI_MODE = %d not NFAPI_MODE_VNF(2)\n", nfapi_getmode()); @@ -819,7 +957,34 @@ int phy_nr_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_nr_crc_indic if(NFAPI_MODE == NFAPI_MODE_VNF) { - UL_INFO.crc_ind = *ind; + nfapi_nr_crc_indication_t *crc_ind = CALLOC(1, sizeof(*crc_ind)); + crc_ind->header.message_id = ind->header.message_id; + crc_ind->number_crcs = ind->number_crcs; + crc_ind->sfn = ind->sfn; + crc_ind->slot = ind->slot; + if (ind->number_crcs > 0) { + crc_ind->crc_list = CALLOC(NFAPI_NR_CRC_IND_MAX_PDU, sizeof(nfapi_nr_crc_t)); + if (crc_ind->crc_list == NULL) { + LOG_I(NR_MAC, "Memory not allocated for crc_ind->crc_list of phy_nr_crc_indication in nfapi_vnf.c.\n"); + exit(0); + } + } + for (int j = 0; j < ind->number_crcs; j++) + { + crc_ind->crc_list[j].handle = ind->crc_list[j].handle; + crc_ind->crc_list[j].harq_id = ind->crc_list[j].harq_id; + crc_ind->crc_list[j].num_cb = ind->crc_list[j].num_cb; + crc_ind->crc_list[j].rnti = ind->crc_list[j].rnti; + crc_ind->crc_list[j].tb_crc_status = ind->crc_list[j].tb_crc_status; + crc_ind->crc_list[j].timing_advance = ind->crc_list[j].timing_advance; + crc_ind->crc_list[j].ul_cqi = ind->crc_list[j].ul_cqi; + } + if (!put_queue(&gnb_crc_ind_queue, crc_ind)) + { + LOG_E(NR_MAC, "Put_queue failed for crc_ind\n"); + free(crc_ind->crc_list); + free(crc_ind); + } } else { @@ -912,7 +1077,35 @@ int phy_nr_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_nr_rx_data_in if(NFAPI_MODE == NFAPI_MODE_VNF) { - UL_INFO.rx_ind = *ind; + nfapi_nr_rx_data_indication_t *rx_ind = CALLOC(1, sizeof(*rx_ind)); + rx_ind->header.message_id = ind->header.message_id; + rx_ind->sfn = ind->sfn; + rx_ind->slot = ind->slot; + rx_ind->number_of_pdus = ind->number_of_pdus; + + if (ind->number_of_pdus > 0) { + rx_ind->pdu_list = CALLOC(NFAPI_NR_RX_DATA_IND_MAX_PDU, sizeof(nfapi_nr_rx_data_pdu_t)); + if (rx_ind->pdu_list == NULL) { + LOG_I(NR_MAC,"Memory not allocated for rx_ind->pdu_list of phy_nr_rx_indication in nfapi_vnf.c.\n"); + exit(0); + } + } + for (int j = 0; j < ind->number_of_pdus; j++) + { + rx_ind->pdu_list[j].handle = ind->pdu_list[j].handle; + rx_ind->pdu_list[j].harq_id = ind->pdu_list[j].harq_id; + rx_ind->pdu_list[j].pdu = ind->pdu_list[j].pdu; + rx_ind->pdu_list[j].pdu_length = ind->pdu_list[j].pdu_length; + rx_ind->pdu_list[j].rnti = ind->pdu_list[j].rnti; + rx_ind->pdu_list[j].timing_advance = ind->pdu_list[j].timing_advance; + rx_ind->pdu_list[j].ul_cqi = ind->pdu_list[j].ul_cqi; + } + if (!put_queue(&gnb_rx_ind_queue, rx_ind)) + { + LOG_E(NR_MAC, "Put_queue failed for rx_ind\n"); + free(rx_ind->pdu_list); + free(rx_ind); + } } else { @@ -1202,6 +1395,12 @@ void set_thread_priority(int priority); void *vnf_nr_p7_thread_start(void *ptr) { set_thread_priority(79); + LOG_I(MAC, "Clearing Queues\n"); + reset_queue(&gnb_rach_ind_queue); + reset_queue(&gnb_rx_ind_queue); + reset_queue(&gnb_crc_ind_queue); + reset_queue(&gnb_uci_ind_queue); + vnf_p7_info *p7_vnf = (vnf_p7_info *)ptr; p7_vnf->config->port = p7_vnf->local_port; p7_vnf->config->sync_indication = &phy_sync_indication; @@ -1591,7 +1790,6 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) { config->codec_config.allocate = &vnf_allocate; config->codec_config.deallocate = &vnf_deallocate; memset(&UL_RCC_INFO,0,sizeof(UL_RCC_IND_t)); - memset(&UL_INFO, 0, sizeof(NR_UL_IND_t)); NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Creating VNF NFAPI start thread %s\n", __FUNCTION__); pthread_create(&vnf_start_pthread, NULL, (void *)&vnf_nr_start_thread, config); NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Created VNF NFAPI start thread %s\n", __FUNCTION__); diff --git a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h index bd4a52e55a03b7122f17d60e4db1bc711c4a2d6f..d148fc8ef2205090cec59682bd27eb18a845b230 100644 --- a/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h +++ b/nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h @@ -1501,7 +1501,7 @@ typedef enum { //section 3.4.7 rx_data_indication //table 3-61 - +#define NFAPI_NR_RX_DATA_IND_MAX_PDU 100 typedef struct { uint32_t handle; @@ -1528,6 +1528,7 @@ typedef struct //3.4.8 crc_indication //table 3-62 +#define NFAPI_NR_CRC_IND_MAX_PDU 100 typedef struct { uint32_t handle; @@ -1669,6 +1670,7 @@ typedef enum { NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE = 2, } nfapi_nr_uci_pdu_type_e; +#define NFAPI_NR_UCI_IND_MAX_PDU 100 typedef struct { uint16_t pdu_type; // 0 for PDU on PUSCH, 1 for PUCCH format 0 or 1, 2 for PUCCH format 2 to 4 @@ -1705,7 +1707,7 @@ typedef struct nfapi_nr_srs_indication_reported_symbol_resource_block_t* rb_list; }nfapi_nr_srs_indication_reported_symbol_t; - +#define NFAPI_NR_SRS_IND_MAX_PDU 100 typedef struct { uint32_t handle; diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 24c633c1f01e17ab00670901dd1dbe22ea04609f..f57c11e28f9d1cb3d37cd250b90dc191518cfa5c 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -544,7 +544,7 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) { VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,1); - LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx); + LOG_I(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx); if (gNB->frame_parms.frame_type == TDD) if(NFAPI_MODE != NFAPI_MODE_VNF) diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c index 0c9d48025329b9222b88bd93903c8a60bae4e3a1..3c8d40568a1810dd302a113a132f38f3d0be1782 100644 --- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c +++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c @@ -59,8 +59,8 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response "Too many ul_config pdus %d", ul_config->number_pdus); for (int i = 0; i < ul_config->number_pdus; ++i) { - LOG_I(PHY, "In %s: processing %s PDU of %d total UL PDUs (ul_config %p) \n", - __FUNCTION__, ul_pdu_type[ul_config->ul_config_list[i].pdu_type - 1], ul_config->number_pdus, ul_config); + //LOG_I(PHY, "In %s: processing %s PDU of %d total UL PDUs (ul_config %p) \n", + // __FUNCTION__, ul_pdu_type[ul_config->ul_config_list[i].pdu_type - 1], ul_config->number_pdus, ul_config); uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type; switch (pdu_type) diff --git a/openair2/LAYER2/NR_MAC_UE/config_ue.c b/openair2/LAYER2/NR_MAC_UE/config_ue.c index b8b24f9b7c80fa3650273fcbcac108d343a86ae7..1e8326a961108be88517c73f8168403863738430 100755 --- a/openair2/LAYER2/NR_MAC_UE/config_ue.c +++ b/openair2/LAYER2/NR_MAC_UE/config_ue.c @@ -538,7 +538,7 @@ int nr_rrc_mac_config_req_ue( mac->ul_config_request = calloc(num_slots, sizeof(*mac->ul_config_request)); config_common_ue(mac,module_id,cc_idP); mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity; - LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti); + LOG_I(MAC,"Configuring CRNTI %x, with module_id = %d\n",mac->crnti, (int)module_id); } // Setup the SSB to Rach Occasions mapping according to the config diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c index 865db8c81c62dd8c7aa83de4bedc4a4be985c640..3effafa90f862336e84078cf4b237ffad898de40 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ra_procedures.c @@ -737,7 +737,7 @@ void nr_ra_succeeded(module_id_t mod_id, frame_t frame, int slot){ if (ra->cfra) { - LOG_I(MAC, "[UE %d][%d.%d][RAPROC] RA procedure succeeded. CF-RA: RAR successfully received.\n", mod_id, frame, slot); + LOG_I(MAC, "[UE %d][%d.%d][RAPROC] RA procedure succeeded. CF-RA: RAR successfully received, t_crnti = %x\n", mod_id, frame, slot, ra->t_crnti); ra->RA_window_cnt = -1; diff --git a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c index 8cfc51cdd4a280b63aa972c541a5628d2f5e0be3..fcb1785955de312e1a908ee8f2a76fe89c78d8eb 100644 --- a/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c +++ b/openair2/LAYER2/NR_MAC_UE/nr_ue_procedures.c @@ -69,7 +69,7 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){ RA_config_t *ra = &mac->ra; - int rnti_type; + int rnti_type = NR_RNTI_C; if (rnti == ra->ra_rnti) { rnti_type = NR_RNTI_RA; @@ -82,7 +82,7 @@ int get_rnti_type(NR_UE_MAC_INST_t *mac, uint16_t rnti){ } else if (rnti == 0xFFFF) { rnti_type = NR_RNTI_SI; } else { - AssertFatal(1 == 0, "In %s: Not identified/handled rnti %d \n", __FUNCTION__, rnti); + //AssertFatal(1 == 0, "In %s: Not identified/handled rnti %x \n", __FUNCTION__, rnti); } LOG_D(MAC, "In %s: returning rnti_type %s \n", __FUNCTION__, rnti_types[rnti_type]); @@ -446,7 +446,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); - LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n", + LOG_I(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); uint32_t dci_format = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15); @@ -2187,8 +2187,13 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t NR_MAC_RAR *rar = (NR_MAC_RAR *) (dlsch_buffer + 1); // RAR subPDU pointer uint8_t preamble_index = mac->ra.rach_ConfigDedicated->cfra->resources.choice.ssb->ssb_ResourceList.list.array[0]->ra_PreambleIndex; - LOG_D(MAC, "In %s:[%d.%d]: [UE %d][RAPROC] invoking MAC for received RAR (current preamble %d)\n", __FUNCTION__, frame, slot, mod_id, preamble_index); + LOG_I(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 ) + { + LOG_I(MAC, "Discarding the received RAR.\n"); + return -1; + } while (1) { n_subheaders++; if (rarh->T == 1) { @@ -2201,7 +2206,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t LOG_D(MAC, "[UE %d][RAPROC] Got BI RAR subPDU %d\n", mod_id, ra->RA_backoff_indicator); } if (rarh->RAPID == preamble_index) { - LOG_I(MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID); + LOG_I(MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d, CRNTI %x, t_crnti = %x\n", mod_id, frame, slot, rarh->RAPID, mac->crnti, ra->t_crnti); rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR)); ra->RA_RAPID_found = 1; break; @@ -2229,7 +2234,16 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t #endif // TC-RNTI + LOG_I(MAC, "Found RAR_01 with t_crnti %x\n", ra->t_crnti); + //if (ra->t_crnti == mac->crnti ) + // return -1; + + //rar->TCRNTI_1 = (uint8_t) (mac->crnti >> 8); // 8 MSBs of rnti + //rar->TCRNTI_2 = (uint8_t) (mac->crnti & 0xff); // 8 LSBs of rnti + ra->t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8); + LOG_I(MAC, "Found RAR_02 with t_crnti %x\n", rar->TCRNTI_2 + (rar->TCRNTI_1 << 8)); + // TA command ul_time_alignment->apply_ta = 1; @@ -2318,13 +2332,16 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t // Config Msg3 PDU nr_config_pusch_pdu(mac, pusch_config_pdu, NULL, &rar_grant, rnti, NULL); + LOG_I(MAC, "Found RAR_0 with t_crnti %x\n", ra->t_crnti); } + LOG_I(MAC, "Found RAR_1 with t_crnti %x\n", ra->t_crnti); } else { ra->t_crnti = 0; ul_time_alignment->ta_command = (0xffff); + LOG_I(MAC, "Found RAR_2 with t_crnti %x\n", ra->t_crnti); } diff --git a/openair2/LAYER2/NR_MAC_gNB/config.c b/openair2/LAYER2/NR_MAC_gNB/config.c index bce07195562851925fb7901b74f79f6c9bb9a55a..a4442c81267902386b690e9079df01585a94b5fc 100644 --- a/openair2/LAYER2/NR_MAC_gNB/config.c +++ b/openair2/LAYER2/NR_MAC_gNB/config.c @@ -434,7 +434,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, } } } - LOG_I(PHY,"Added new RA process for UE RNTI %04x with initial secondaryCellGroup\n", rnti); + LOG_I(PHY,"Added new RA process for UE RNTI %04x with initial secondaryCellGroup, ra_index %u, rnti %x\n", + rnti, + ra_index, + cc->ra[ra_index].rnti + ); } else { // secondaryCellGroup has been updated const int UE_id = find_nr_UE_id(Mod_idP,rnti); UE_info->secondaryCellGroup[UE_id] = secondaryCellGroup; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c index 806952ac03fcf9ca62c5ecc8c462c4e1c2f409b0..0583cebdfbffdcdb9898c3086ae6147b1ba5490d 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_RA.c @@ -456,7 +456,7 @@ void nr_schedule_msg2(uint16_t rach_frame, uint16_t rach_slot, } } - +uint16_t temp_preamble_index = 0; void nr_initiate_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, @@ -486,13 +486,24 @@ void nr_initiate_ra_proc(module_id_t module_idP, total_RApreambles = total_RApreambles/num_ssb_per_RO ; } + for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) { + NR_RA_t *ra = &cc->ra[i]; + LOG_I(MAC, + "[gNB %d][RAPROC] CC_id %d Frame %d, Slot %d Checking all rnti : preamble index %d, rnti %x\n", + module_idP, + CC_id, + frameP, + slotP, + preamble_index, + ra->rnti); + } for (int i = 0; i < NR_NB_RA_PROC_MAX; i++) { NR_RA_t *ra = &cc->ra[i]; pr_found = 0; 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]) { + if (preamble_index == ra->preambles.preamble_list[j] && ra->rnti != 0) { pr_found=1; break; } @@ -520,12 +531,14 @@ void nr_initiate_ra_proc(module_id_t module_idP, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 1); LOG_I(MAC, - "[gNB %d][RAPROC] CC_id %d Frame %d, Slot %d Initiating RA procedure for preamble index %d\n", + "[gNB %d][RAPROC] CC_id %d Frame %d, Slot %d Initiating RA procedure for preamble index %d, rnti %x, ra_index %d\n", module_idP, CC_id, frameP, slotP, - preamble_index); + preamble_index, + ra->rnti, + i); uint8_t beam_index = ssb_index_from_prach(module_idP, frameP, slotP, preamble_index, freq_index, symbol); @@ -716,7 +729,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t vrb_map_UL[i + ra->msg3_first_rb] = 1; } - LOG_I(MAC, "[gNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP, frameP, slotP, CC_id, ra->Msg3_frame, ra->Msg3_slot); + LOG_I(MAC, "[gNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA is active, Msg3 in (%d,%d), crnti %x\n", module_idP, frameP, slotP, CC_id, ra->Msg3_frame, ra->Msg3_slot, ra->rnti); nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_idP]->UL_tti_req_ahead[CC_id][ra->Msg3_slot]; AssertFatal(future_ul_tti_req->SFN == ra->Msg3_frame @@ -738,7 +751,7 @@ void nr_add_msg3(module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t AssertFatal(ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count == 1, "downlinkBWP_ToAddModList has %d BWP!\n", ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.count); NR_BWP_Uplink_t *ubwp = ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[ra->bwp_id - 1]; - LOG_D(MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %d\n", + LOG_I(MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d) for rnti: %x\n", frameP, slotP, ra->Msg3_frame, @@ -915,11 +928,19 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra dl_req->nPDUs+=1; nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdsch_pdu->pdsch_pdu.pdsch_pdu_rel15; - LOG_I(MAC,"[gNB %d] [RAPROC] CC_id %d Frame %d, slotP %d: Generating RAR DCI, state %d\n", module_idP, CC_id, frameP, slotP, ra->state); + LOG_I(MAC,"[gNB %d] [RAPROC] CC_id %d Frame %d, slotP %d: Generating RAR DCI, state %d, rnti %x, new rnti %x\n", + module_idP, + CC_id, + frameP, + slotP, + ra->state, + ra->rnti, + ra->secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity + ); NR_BWP_Uplink_t *ubwp=ra->secondaryCellGroup->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.array[ra->bwp_id-1]; - LOG_I(MAC, "[RAPROC] Scheduling common search space DCI type 1 dlBWP BW %d\n", dci10_bw); + LOG_I(MAC, "[RAPROC] Scheduling common search space DCI type 1 dlBWP BW %d, rnit %x\n", dci10_bw, ra->rnti); // Qm>2 not allowed for RAR if (get_softmodem_params()->do_ra) @@ -1022,13 +1043,14 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra const int rnti_type = NR_RNTI_RA; LOG_I(MAC, - "[RAPROC] DCI params: rnti %d, rnti_type %d, dci_format %d coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d\n", + "[RAPROC] DCI params: RA rnti %x, rnti_type %d, dci_format %d coreset params: FreqDomainResource %llx, start_symbol %d n_symb %d, crnti %x\n", pdcch_pdu_rel15->dci_pdu[0].RNTI, rnti_type, dci_format, (unsigned long long)pdcch_pdu_rel15->FreqDomainResource, pdcch_pdu_rel15->StartSymbolIndex, - pdcch_pdu_rel15->DurationSymbols); + pdcch_pdu_rel15->DurationSymbols, + ra->rnti); fill_dci_pdu_rel15(scc, ra->secondaryCellGroup, @@ -1050,11 +1072,12 @@ void nr_generate_Msg2(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra nr_mac->TX_req[CC_id].Slot = slotP; // Program UL processing for Msg3 + LOG_I(MAC, "Before Program UL processing for Msg3: rnti %x\n", ra->rnti); nr_get_Msg3alloc(module_idP, CC_id, scc, ubwp, slotP, frameP, ra); - LOG_I(MAC, "Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot); + LOG_I(MAC, "Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d, crnti %x\n", frameP, slotP, ra->Msg3_frame, ra->Msg3_slot, ra->rnti); nr_add_msg3(module_idP, CC_id, frameP, slotP, ra, (uint8_t *) &tx_req->TLVs[0].value.direct[0]); ra->state = WAIT_Msg3; - LOG_I(MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d\n", module_idP, frameP, slotP, ra->state); + LOG_I(MAC,"[gNB %d][RAPROC] Frame %d, Subframe %d: RA state %d, crnti %x\n", module_idP, frameP, slotP, ra->state, ra->rnti); x_Overhead = 0; nr_get_tbs_dl(&dl_tti_pdsch_pdu->pdsch_pdu, x_Overhead, pdsch_pdu_rel15->numDmrsCdmGrpsNoData, dci_payload.tb_scaling); @@ -1116,7 +1139,7 @@ void nr_fill_rar(uint8_t Mod_idP, uint8_t * dlsch_buffer, nfapi_nr_pusch_pdu_t *pusch_pdu){ - LOG_I(MAC, "[gNB] Generate RAR MAC PDU frame %d slot %d preamble index %u TA command %d \n", ra->Msg2_frame, ra-> Msg2_slot, ra->preamble_index, ra->timing_offset); + LOG_D(MAC, "[gNB] Generate RAR MAC PDU frame %d slot %d preamble index %u TA command %d \n", ra->Msg2_frame, ra-> Msg2_slot, ra->preamble_index, ra->timing_offset); NR_RA_HEADER_RAPID *rarh = (NR_RA_HEADER_RAPID *) dlsch_buffer; NR_MAC_RAR *rar = (NR_MAC_RAR *) (dlsch_buffer + 1); unsigned char csi_req = 0, tpc_command; @@ -1144,7 +1167,7 @@ void nr_fill_rar(uint8_t Mod_idP, // TC-RNTI rar->TCRNTI_1 = (uint8_t) (ra->rnti >> 8); // 8 MSBs of rnti rar->TCRNTI_2 = (uint8_t) (ra->rnti & 0xff); // 8 LSBs of rnti - + LOG_I(MAC, "[gNB] Generate RAR MAC PDU frame %d slot %d preamble index %u TA command %d with rnti = %x <---------------NOTICE in nr_fill_rar() \n", ra->Msg2_frame, ra-> Msg2_slot, ra->preamble_index, ra->timing_offset, ra->rnti); // UL grant ra->msg3_TPC = tpc_command; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c index 28998dbf66475aecabde8db5dc8d5ce59a8f29b7..bf39f358a0dfd90b4b6bd5d2476a5507c0c53117 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c @@ -721,11 +721,12 @@ void nr_schedule_ue_spec(module_id_t module_id, if (current_harq_pid < 0) { /* PP has not selected a specific HARQ Process, get a new one */ current_harq_pid = sched_ctrl->available_dl_harq.head; - AssertFatal(current_harq_pid >= 0, - "no free HARQ process available for UE %d\n", - UE_id); + //AssertFatal(current_harq_pid >= 0, + // "no free HARQ process available for UE %d\n", + // UE_id); remove_front_nr_list(&sched_ctrl->available_dl_harq); sched_ctrl->dl_harq_pid = current_harq_pid; + return; } else { /* PP selected a specific HARQ process. Check whether it will be a new * transmission or a retransmission, and remove from the corresponding diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c index 00e53dd21eb7ac945ba040d26050cb0afc572bb9..771ee502b7c1ed4bd0456fd9d580f94e2547dc04 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_primitives.c @@ -1542,6 +1542,7 @@ void add_front_nr_list(NR_list_t *listP, int id) */ void remove_front_nr_list(NR_list_t *listP) { + if (listP->head < 0 ) return; AssertFatal(listP->head >= 0, "Nothing to remove\n"); const int ohead = listP->head; listP->head = listP->next[ohead]; @@ -1630,6 +1631,9 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon UE_info->num_UEs); dump_nr_list(&UE_info->list); + for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) + LOG_I(MAC, "add_new_nr_ue UE_info->active[%d] = %d\n", i, UE_info->active[i]); + for (int i = 0; i < MAX_MOBILES_PER_GNB; i++) { if (UE_info->active[i]) continue; @@ -1696,7 +1700,7 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon } // printf("MAC: cannot add new UE for rnti %x\n", rntiP); - LOG_E(MAC, "error in add_new_ue(), could not find space in UE_info, Dumping UE list\n"); + LOG_E(MAC, "error in add_new_nr_ue(), could not find space in UE_info, Dumping UE list\n"); dump_nr_list(&UE_info->list); return -1; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c index 298c6c42222abae712e86ba1d035cf9f4fa360d7..41faed6f6312004b57ba2ca149ae55962f63041a 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_uci.c @@ -521,7 +521,7 @@ int nr_acknack_scheduling(int mod_id, get_pdsch_to_harq_feedback(mod_id, UE_id, ss_type, pdsch_to_harq_feedback); /* there is a HARQ. Check whether we can use it for this ACKNACK */ - if (pucch->dai_c > 0) { + if (pucch->dai_c > 0 && pucch->frame == frame ) { /* this UE already has a PUCCH occasion */ DevAssert(pucch->frame == frame); @@ -557,12 +557,14 @@ int nr_acknack_scheduling(int mod_id, * scheduled a lot and used all AckNacks, pucch->frame might have been * wrapped around to next frame */ if (frame != pucch->frame || pucch->ul_slot < first_ul_slot_tdd) { + /* AssertFatal(pucch->sr_flag + pucch->dai_c == 0, "expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n", UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot); AssertFatal(frame + 1 != pucch->frame, "frame wrap around not handled in %s() yet\n", __func__); + */ pucch->frame = frame; pucch->ul_slot = first_ul_slot_tdd; } diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c index 3d7c5bd773a63bd0e3e520b645cc5ef04e869a72..273c38dade9235ee7e9b6d44088bd1199448c9e5 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c @@ -405,6 +405,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, const int current_rnti = rntiP; const int UE_id = find_nr_UE_id(gnb_mod_idP, current_rnti); const int target_snrx10 = gNB_mac->pusch_target_snrx10; + LOG_I(NR_MAC, "nr_rx_sdu entered\n"); if (UE_id != -1) { NR_UE_sched_ctrl_t *UE_scheduling_control = &UE_info->UE_sched_ctrl[UE_id]; @@ -416,7 +417,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, T_BUFFER(sduP, sdu_lenP)); UE_info->mac_stats[UE_id].ulsch_total_bytes_rx += sdu_lenP; - LOG_D(NR_MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d sduP %p\n", + LOG_I(NR_MAC, "[gNB %d][PUSCH %d] CC_id %d %d.%d Received ULSCH sdu from PHY (rnti %x, UE_id %d) ul_cqi %d sduP %p\n", gnb_mod_idP, harq_pid, CC_idP, @@ -484,8 +485,11 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, * it. */ for (int i = 0; i < NR_NB_RA_PROC_MAX; ++i) { NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[i]; - if (ra->state != WAIT_Msg3) + if (ra->state != WAIT_Msg3 || ra->rnti == 0) + { + LOG_I(NR_MAC, "Notice ra->state = %d (if it is 2, it is WAIT_Msg3. Else we continue), ra->rnti %x\n", ra->state, ra->rnti); continue; + } if(no_sig) { LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state); @@ -493,8 +497,13 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP); } else { + LOG_I(NR_MAC, + "expected TC_RNTI %04x to match current RNTI %04x\n", + ra->rnti, + current_rnti); // random access pusch with TC-RNTI if (ra->rnti != current_rnti) { + //ra->rnti = current_rnti; LOG_W(NR_MAC, "expected TC_RNTI %04x to match current RNTI %04x\n", ra->rnti, @@ -961,6 +970,7 @@ void nr_schedule_ulsch(module_id_t module_id, continue; uint16_t rnti = UE_info->rnti[UE_id]; + LOG_D(NR_MAC, "nr_schedule_ulsch UE_id_checking UE_id = %d, rnti = %x \n", UE_id, rnti); int8_t harq_id = sched_pusch->ul_harq_pid; if (harq_id < 0) { diff --git a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c index 0beb9f74e0f8c419af714720aba13c0107811a33..f0b58a66cef36d73108dec6f1a198d32a14f3b97 100644 --- a/openair2/NR_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_PHY_INTERFACE/NR_IF_Module.c @@ -37,6 +37,7 @@ #include "common/ran_context.h" #include "executables/softmodem-common.h" #include "nfapi/oai_integration/vendor_ext.h" +#include "openair2/PHY_INTERFACE/queue.h" #define MAX_IF_MODULES 100 //#define UL_HARQ_PRINT @@ -52,14 +53,29 @@ extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); extern uint8_t nfapi_mode; extern uint16_t sf_ahead; extern uint16_t sl_ahead; -extern NR_UL_IND_t UL_INFO; + +extern queue_t gnb_rach_ind_queue; +extern queue_t gnb_rx_ind_queue; +extern queue_t gnb_crc_ind_queue; +extern queue_t gnb_uci_ind_queue; + void handle_nr_rach(NR_UL_IND_t *UL_info) { - // Melissa: TODO come back and differentiate between global UL_info and passed in arg + 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 = unqueue(&gnb_rach_ind_queue); + 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; + if (UL_INFO.rach_ind.number_of_pdus>0) { - LOG_I(MAC,"UL_INFO[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", - UL_INFO.frame,UL_INFO.slot, UL_INFO.rach_ind.sfn,UL_INFO.rach_ind.slot); + LOG_I(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n", + UL_info->frame, UL_info->slot, UL_INFO.rach_ind.sfn, UL_INFO.rach_ind.slot); int npdus = UL_INFO.rach_ind.number_of_pdus; for(int i = 0; i < npdus; i++) { UL_INFO.rach_ind.number_of_pdus--; @@ -77,12 +93,26 @@ 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) + { + for(int i = 0; i < rach_ind->number_of_pdus; i++) + free(rach_ind->pdu_list[i].preamble_list); + free(rach_ind->pdu_list); + } + free(rach_ind); } void handle_nr_uci(NR_UL_IND_t *UL_info) { - const module_id_t mod_id = UL_INFO.module_id; + 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 = unqueue(&gnb_uci_ind_queue); + NR_UL_IND_t UL_INFO; + UL_INFO.uci_ind = *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; int num_ucis = UL_INFO.uci_ind.num_ucis; @@ -109,24 +139,92 @@ void handle_nr_uci(NR_UL_IND_t *UL_info) } } - UL_INFO.uci_ind.num_ucis = 0; if(NFAPI_MODE != NFAPI_MODE_PNF) // mark corresponding PUCCH resources as free // NOTE: we just assume it is BWP ID 1, to be revised for multiple BWPs RC.nrmac[mod_id]->pucch_index_used[1][slot] = 0; + + 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; + } + } + if (uci_ind && num_ucis > 0) + free(uci_list); + free(uci_ind); } +static bool crc_sfn_slot_matcher(void *wanted, void *candidate) +{ + nfapi_p7_message_header_t *msg = candidate; + int sfn_sf = *(int*)wanted; + + switch (msg->message_id) + { + case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION: + { + nfapi_nr_crc_indication_t *ind = candidate; + return NFAPI_SFNSLOT2SFN(sfn_sf) == ind->sfn && NFAPI_SFNSLOT2SLOT(sfn_sf) == ind->slot; + } + + default: + LOG_E(NR_MAC, "sfn_slot_match bad ID: %d\n", msg->message_id); + + } + return false; +} -void handle_nr_ulsch(NR_UL_IND_t *UL_info) +void handle_nr_ulsch(NR_UL_IND_t *UL_info) { - // Melissa: TODO come back and differentiate between global UL_info and passed in arg - if (UL_INFO.rx_ind.number_of_pdus > 0 && UL_INFO.crc_ind.number_crcs > 0) { + if (gnb_rx_ind_queue.num_items == 0 || gnb_crc_ind_queue.num_items == 0) + return; + LOG_I(NR_MAC, "gnb_rx_ind_queue size and gnb_crc_ind_queue size = %zu and %zu\n", + gnb_rx_ind_queue.num_items, + gnb_crc_ind_queue.num_items + ); + nfapi_nr_rx_data_indication_t *rx_ind = unqueue(&gnb_rx_ind_queue); + 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_I(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot); + requeue(&gnb_rx_ind_queue, rx_ind); + 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; + 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", + UL_info->frame, UL_info->slot, + rx_ind->sfn, rx_ind->slot, + crc_ind->sfn, crc_ind->slot + ); + + if (rx_ind && UL_INFO.rx_ind.number_of_pdus > 0 && crc_ind && UL_INFO.crc_ind.number_crcs > 0) { for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) { for (int j = 0; j < UL_INFO.crc_ind.number_crcs; j++) { // find crc_indication j corresponding rx_indication i const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i]; const nfapi_nr_crc_t *crc = &UL_INFO.crc_ind.crc_list[j]; - LOG_D(NR_PHY, + LOG_I(NR_PHY, "UL_INFO.crc_ind.pdu_list[%d].rnti:%04x " "UL_INFO.rx_ind.pdu_list[%d].rnti:%04x\n", j, @@ -135,7 +233,10 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) rx->rnti); if (crc->rnti != rx->rnti) + { + LOG_I(NR_MAC, "mis-match between CRC rnti %04x and RX rnit %04x\n", crc->rnti, rx->rnti); continue; + } LOG_D(NR_MAC, "%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n", @@ -144,7 +245,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) crc->tb_crc_status ? "error" : "ok", crc->tb_crc_status); - /* if CRC passes, pass PDU, otherwise pass NULL as error indication */ + // if CRC passes, pass PDU, otherwise pass NULL as error indication nr_rx_sdu(UL_INFO.module_id, UL_INFO.CC_id, UL_INFO.rx_ind.sfn, @@ -160,11 +261,15 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) } // for (j=0;j<UL_INFO.crc_ind.number_crcs;j++) } // for (i=0;i<UL_INFO.rx_ind.number_of_pdus;i++) - 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) { - LOG_E(NR_PHY, + if (crc_ind && crc_ind->number_crcs > 0) + free(crc_ind->crc_list); + free(crc_ind); + if (rx_ind && rx_ind->number_of_pdus > 0) + free(rx_ind->pdu_list); + free(rx_ind); + } else if ((rx_ind && UL_INFO.rx_ind.number_of_pdus != 0) + || (crc_ind && 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 " "rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n", @@ -172,11 +277,12 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) UL_INFO.rx_ind.sfn, UL_INFO.rx_ind.slot, UL_INFO.crc_ind.number_crcs, - UL_INFO.rx_ind.sfn, - UL_INFO.rx_ind.slot); + UL_INFO.crc_ind.sfn, + UL_INFO.crc_ind.slot); } } + void NR_UL_indication(NR_UL_IND_t *UL_info) { AssertFatal(UL_info!=NULL,"UL_INFO is null\n"); #ifdef DUMP_FAPI @@ -187,7 +293,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) { NR_Sched_Rsp_t *sched_info = &Sched_INFO[module_id][CC_id]; NR_IF_Module_t *ifi = if_inst[module_id]; gNB_MAC_INST *mac = RC.nrmac[module_id]; - LOG_D(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rach_pdus:%d rx_ind:%d crcs:%d]\n", + LOG_I(PHY,"SFN/SF:%d%d module_id:%d CC_id:%d UL_info[rach_pdus:%d rx_ind:%d crcs:%d]\n", UL_info->frame,UL_info->slot, module_id,CC_id, UL_info->rach_ind.number_of_pdus, UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs); diff --git a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c index 60ff96365eb1baacfcd7a914c2108c2be6e5b933..ddd186a2718e18fe8783ac60a7c821c1ded71c02 100644 --- a/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c +++ b/openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.c @@ -284,6 +284,18 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi { nfapi_nr_pdu_t *pdu_list = &tx_data_request->pdu_list[i]; AssertFatal(pdu_list->num_TLV < sizeof(pdu_list->TLVs) / sizeof(pdu_list->TLVs[0]), "Num TLVs exceeds TLV array size"); + + if (tx_data_request->Slot == 7) { //Melissa this means we have an RAR, sorta hacky though + if( get_mac_inst(dl_info->module_id)->crnti == get_mac_inst(dl_info->module_id)->ra.t_crnti ) + { LOG_I(MAC, "Discarding tx_data_requested since it includes useless RAR.\n"); + continue; + } + dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_RAR; + } + else if (tx_data_request->Slot != 7 && get_softmodem_params()->nsa) { + dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH; + } + for (int j = 0; j < pdu_list->num_TLV; j++) { if (pdu_list->TLVs[j].tag) @@ -291,12 +303,6 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi else if (!pdu_list->TLVs[j].tag) dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu = (void*) pdu_list->TLVs[j].value.direct; // Melissa, fix me! dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = pdu_list->TLVs[j].length; - if (tx_data_request->Slot == 7) { //Melissa this means we have an RAR, sorta hacky though - dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_RAR; - } - else if (tx_data_request->Slot != 7 && get_softmodem_params()->nsa) { - dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_DLSCH; - } } } dl_info->slot = tx_data_request->Slot; @@ -316,6 +322,8 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n { nfapi_nr_ul_dci_request_pdus_t *pdu_list = &ul_dci_req->ul_dci_pdu_list[i]; AssertFatal(pdu_list->PDUType == 0, "ul_dci_req pdu type != PUCCH"); + if( pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu->RNTI != get_mac_inst(0)->crnti) + continue; LOG_I(NR_PHY, "[%d %d] PUCCH PDU in ul_dci for rnti %x\n", ul_dci_req->SFN, ul_dci_req->Slot, pdu_list->pdcch_pdu.pdcch_pdu_rel15.dci_pdu->RNTI); uint16_t num_dci = pdu_list->pdcch_pdu.pdcch_pdu_rel15.numDlDci; if (num_dci > 0) diff --git a/openair2/PHY_INTERFACE/queue.c b/openair2/PHY_INTERFACE/queue.c index 94b6598dc34b3b5c09aba3d494778bf597088c15..c6e1fb6d2fd4060f24e5227b8571dfab0858cb8f 100644 --- a/openair2/PHY_INTERFACE/queue.c +++ b/openair2/PHY_INTERFACE/queue.c @@ -16,6 +16,15 @@ void init_queue(queue_t *q) pthread_mutex_init(&q->mutex, NULL); } +void reset_queue(queue_t *q) +{ + void *p; + while ((p = get_queue(q)) != NULL) + { + free(p); + } +} + bool put_queue(queue_t *q, void *item) { assert(item != NULL); @@ -156,4 +165,4 @@ void *unqueue_matching(queue_t *q, size_t max_depth, queue_matcher_t *matcher, v pthread_mutex_unlock(&q->mutex); return item; -} \ No newline at end of file +} diff --git a/openair2/PHY_INTERFACE/queue.h b/openair2/PHY_INTERFACE/queue.h index ab8d44490d81138121ae1da67b2d2f451668a702..d274f7b0cd967426312e936d1b24b088ce347840 100644 --- a/openair2/PHY_INTERFACE/queue.h +++ b/openair2/PHY_INTERFACE/queue.h @@ -41,6 +41,7 @@ typedef struct queue_t } queue_t; void init_queue(queue_t *q); +void reset_queue(queue_t *q); bool put_queue(queue_t *q, void *item); void *get_queue(queue_t *q); diff --git a/openair2/RRC/NR/rrc_gNB_reconfig.c b/openair2/RRC/NR/rrc_gNB_reconfig.c index ab3f19227622cbcb9b26f3339bfc448fcdc32997..99a2505e741da6b133fd13ca715e45acbdba840b 100644 --- a/openair2/RRC/NR/rrc_gNB_reconfig.c +++ b/openair2/RRC/NR/rrc_gNB_reconfig.c @@ -141,7 +141,7 @@ void fill_default_searchSpaceZero(NR_SearchSpace_t *ss0) { ss0->searchSpaceType->present = NR_SearchSpace__searchSpaceType_PR_common; } - +static int unique_preamble_index_gNB; void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellconfigcommon, NR_CellGroupConfig_t *secondaryCellGroup, int scg_id, diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index faa2e7273890c0f969f47e1deb2dd1ede57c9c7b..0d2ac48f2640c9642df1e11e98dbabae5e879b57 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -974,16 +974,6 @@ uint64_t clock_usec(void) } return (uint64_t)t.tv_sec * 1000000 + (t.tv_nsec / 1000); } - -static void reset_queue(queue_t *q) -{ - void *p; - while ((p = get_queue(q)) != NULL) - { - free(p); - } -} - /*! * \brief This is the UE thread for RX subframe n and TX subframe n+4. * This thread performs the phy_procedures_UE_RX() on every received slot.