diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index fe03a9c68d76b084b63adf55665566e1f89555c9..3a18a26ec1b0bd79344ce46e03c310987f03e0df 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -454,7 +454,7 @@ set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION}) # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make if (${RU} STREQUAL 0) - execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_" + execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "LTE_" " " "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" RESULT_VARIABLE ret) endif (${RU} STREQUAL 0) @@ -464,7 +464,7 @@ endif (NOT ${ret} STREQUAL 0) file(GLOB rrc_source ${RRC_FULL_DIR}/*.c) add_custom_target ( rrc_flag ALL - ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_" + ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "LTE_" " " "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" DEPENDS ${RRC_GRAMMAR} ) @@ -486,8 +486,9 @@ set (NR_RRC_FULL_DIR ${asn1_generated_dir}/RRC_${NR_RRC_ASN1_VERSION}) # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make if (${RU} STREQUAL 0) - execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice" - RESULT_VARIABLE ret) + execute_process( + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NR_" "-findirect-choice" "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif () @@ -497,7 +498,7 @@ endif (${RU} STREQUAL 0) add_custom_target ( nr_rrc_flag ALL - ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice" + ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NR_" "-findirect-choice" "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" DEPENDS ${NR_RRC_GRAMMAR} ) @@ -523,8 +524,9 @@ set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE}) # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make if (${RU} STREQUAL 0) - execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps - RESULT_VARIABLE ret) + execute_process( + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "S1AP_" -fno-include-deps "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) @@ -533,7 +535,7 @@ endif (${RU} STREQUAL 0) add_custom_target ( s1ap_flag ALL - ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps + ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "S1AP_" -fno-include-deps "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" ) @@ -578,8 +580,9 @@ set(NGAP_ASN_DIR ${NGAP_DIR}/MESSAGES/ASN1/ASN1_files) set(NGAP_C_DIR ${asn1_generated_dir}/NGAP_${NGAP_RELEASE}) # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make -execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps -findirect-choice - RESULT_VARIABLE ret) +execute_process( + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NGAP_" "-fno-include-deps -findirect-choice" "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) @@ -587,7 +590,7 @@ file(GLOB NGAP_source ${NGAP_C_DIR}/*.c) add_custom_target ( ngap_flag ALL - ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps + ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NGAP_" "-fno-include-deps -findirect-choice" "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" DEPENDS "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" ) @@ -645,8 +648,9 @@ set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE}) # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make if (${RU} STREQUAL 0) - execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps -DEMIT_ASN_DEBUG=1 - RESULT_VARIABLE ret) + execute_process( + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) @@ -656,7 +660,7 @@ file(GLOB M2AP_source ${M2AP_C_DIR}/*.c) add_custom_target ( m2_flag ALL - COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" DEPENDS ${M2AP_ASN_DIR}/${M2AP_ASN_FILES} ) @@ -717,8 +721,9 @@ set(M3AP_C_DIR ${asn1_generated_dir}/M3AP_${M3AP_RELEASE}) # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make if (${RU} STREQUAL 0) - execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps - RESULT_VARIABLE ret) + execute_process( + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M3AP_" -fno-include-deps "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) @@ -728,7 +733,7 @@ file(GLOB M3AP_source ${M3AP_C_DIR}/*.c) add_custom_target ( m3_flag ALL - COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M3AP_" -fno-include-deps "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" DEPENDS ${M3AP_ASN_DIR}/${M3AP_ASN_FILES} ) @@ -773,8 +778,9 @@ set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE}) set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE}) # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make if (${RU} STREQUAL 0) - execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps - RESULT_VARIABLE ret) + execute_process( + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "X2AP_" -fno-include-deps "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" + RESULT_VARIABLE ret) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error") endif (NOT ${ret} STREQUAL 0) @@ -784,7 +790,7 @@ file(GLOB X2AP_source ${X2AP_C_DIR}/*.c) add_custom_target ( x2_flag ALL - COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "X2AP_" -fno-include-deps "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES} ) @@ -833,20 +839,25 @@ set(F1AP_ASN_FILES if (${RU} STREQUAL 0) set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR}) message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}") - execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR} - COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES} - RESULT_VARIABLE ret - OUTPUT_QUIET - ERROR_QUIET) + execute_process( + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES} + RESULT_VARIABLE ret + ) if (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "asn1c: error") endif (NOT ${ret} STREQUAL 0) - -file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c) -add_library(F1AP_LIB - ${F1AP_ASN_GENERATED_C_FILES} -) + + add_custom_target ( + f1_flag ALL + COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES} + DEPENDS ${F1AP_ASN_FILES} + ) + file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c) + add_library(F1AP_LIB + ${F1AP_ASN_GENERATED_C_FILES} + ) + add_dependencies (F1AP_LIB f1_flag) include_directories ("${F1AP_ASN_GENERATED_C_DIR}") include_directories ("${F1AP_DIR}") @@ -858,7 +869,6 @@ add_library(F1AP endif (${RU} STREQUAL 0) - # Hardware dependant options ################################### add_list1_option(NB_ANTENNAS_RX "4" "Number of antennas in reception" "1" "2" "4") @@ -866,8 +876,6 @@ add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU") - - add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET") #NOKIA config enhancement set (CONFIG_ROOTDIR @@ -3212,7 +3220,7 @@ target_link_libraries (nr-uesoftmodem NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} NFAPI_USER_LIB S1AP_LIB S1AP_ENB - ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB + ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB ${NAS_SIM_LIB} -Wl,--end-group z dl) target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES}) @@ -3650,6 +3658,9 @@ add_executable(nr-ittisim ${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c + ${OPENAIR_DIR}/common/utils/lte/ue_power.c + ${OPENAIR_DIR}/common/utils/lte/prach_utils.c + ${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c ${XFORMSINTERFACE_SOURCE} ${T_SOURCE} ${CONFIG_SOURCES} @@ -3662,7 +3673,7 @@ target_link_libraries (nr-ittisim ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB} - PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE + PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE -Wl,--end-group z dl) target_link_libraries (nr-ittisim ${LIBXML2_LIBRARIES}) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 07aa150921accef1efe6f0a98de12d95d79adf8f..279b9489e00333f1f5eaa85d1499d5b6389ae20c 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -70,6 +70,7 @@ NR="False" ITTI_SIM="False" SANITIZE_ADDRESS="False" OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc" +RU=0 trap handle_ctrl_c INT function print_help() { diff --git a/cmake_targets/tools/make_asn1c_includes.sh b/cmake_targets/tools/make_asn1c_includes.sh index 1598678a73521b9811939542fbd95ae8c1f2738a..00c88d64977390178c0e79a9af4d2313460476f9 100755 --- a/cmake_targets/tools/make_asn1c_includes.sh +++ b/cmake_targets/tools/make_asn1c_includes.sh @@ -1,13 +1,19 @@ #!/bin/bash -GENERATED_FULL_DIR=$1 +export ASN1C_PREFIX=$1 shift -ASN1_SOURCE_DIR=$1 +options=$1 shift -export ASN1C_PREFIX=$1 +GENERATED_FULL_DIR=$1 shift -options=$* +ASN1_SOURCE_DIR=$* done_flag="$GENERATED_FULL_DIR"/done -if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then +rebuild=0 +for f in $ASN1_SOURCE_DIR ; do + if [ "$done_flag" -ot "$f" ] ; then + rebuild=1 + fi +done +if [ $rebuild -eq 1 ] ; then rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h mkdir -p "$GENERATED_FULL_DIR" asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u diff --git a/common/ran_context.h b/common/ran_context.h index 5a18225329245bdb40891c109a3e7efcabacd475..db981e9182f31405019a5a9ffc767b54dd0d3c48 100644 --- a/common/ran_context.h +++ b/common/ran_context.h @@ -122,5 +122,5 @@ typedef struct { pthread_cond_t ru_cond; } RAN_CONTEXT_t; - +extern RAN_CONTEXT_t RC; #endif diff --git a/common/utils/telnetsrv/telnetsrv.h b/common/utils/telnetsrv/telnetsrv.h index b66641d5c8b9588b8699c93b31326b5a418f5252..59655501d3ed15f26037f18a649303e92141df1b 100644 --- a/common/utils/telnetsrv/telnetsrv.h +++ b/common/utils/telnetsrv/telnetsrv.h @@ -31,6 +31,7 @@ #ifndef TELNETSRV_H #define TELNETSRV_H +#include <common/ran_context.h> #define TELNETSRV_MODNAME "telnetsrv" #define TELNET_PORT 9090 diff --git a/executables/nr-ru.c b/executables/nr-ru.c index c068bef775c578b368cff4bbc2fca17cfe27d5ad..0a042ba9b1d5da8451cca3b6e07a889b44a13cad 100644 --- a/executables/nr-ru.c +++ b/executables/nr-ru.c @@ -112,6 +112,7 @@ void configure_ru(int idx, void *arg); void configure_rru(int idx, void *arg); int attach_rru(RU_t *ru); int connect_rau(RU_t *ru); +static void NRRCconfig_RU(void); uint16_t sf_ahead; uint16_t slot_ahead; @@ -1837,7 +1838,7 @@ void init_NR_RU(char *rf_config_file) pthread_cond_init(&RC.ru_cond,NULL); // read in configuration file) printf("configuring RU from file\n"); - RCconfig_RU(); + NRRCconfig_RU(); LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs()); LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU); @@ -1912,7 +1913,7 @@ void stop_RU(int nb_ru) /* --------------------------------------------------------*/ /* from here function to use configuration module */ -void RCconfig_RU(void) +static void NRRCconfig_RU(void) { int i = 0, j = 0; paramdef_t RUParams[] = RUPARAMS_DESC; diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c index 13a191a18a5e718f4fef82cf74117c201402ba5d..83b3d433aa54d1e3e6f68727acdca399d571e21d 100644 --- a/executables/nr-uesoftmodem.c +++ b/executables/nr-uesoftmodem.c @@ -82,7 +82,6 @@ unsigned short config_frames[4] = {2,9,11,13}; // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) #include "PHY/TOOLS/phy_scope_interface.h" #include "PHY/TOOLS/nr_phy_scope.h" -#define NRUE_MAIN #include <executables/nr-uesoftmodem.h> #include "executables/softmodem-common.h" #include "executables/thread-common.h" @@ -90,6 +89,7 @@ unsigned short config_frames[4] = {2,9,11,13}; extern const char *duplex_mode[]; msc_interface_t msc_interface; THREAD_STRUCT thread_struct; +nrUE_params_t nrUE_params; // Thread variables pthread_cond_t nfapi_sync_cond; diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h index 5902c8cca8b30f1fa7bb410db266790bb7b6c6fc..5c082b7bbbc8c4cc3fcf02261c5ec18801838376 100644 --- a/executables/nr-uesoftmodem.h +++ b/executables/nr-uesoftmodem.h @@ -72,9 +72,6 @@ extern uint64_t get_nrUE_optmask(void); extern uint64_t set_nrUE_optmask(uint64_t bitmask); extern nrUE_params_t *get_nrUE_params(void); -#ifdef NRUE_MAIN -nrUE_params_t nrUE_params; -#endif // In nr-ue.c extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg); diff --git a/openair1/PHY/TOOLS/lte_phy_scope.h b/openair1/PHY/TOOLS/lte_phy_scope.h index af9858ebad97796def7d13b4d007171fd61ca920..1873fabea0e09c82c4a21dd74c04743320d82efc 100644 --- a/openair1/PHY/TOOLS/lte_phy_scope.h +++ b/openair1/PHY/TOOLS/lte_phy_scope.h @@ -28,6 +28,7 @@ #include "PHY/defs_eNB.h" #include "PHY/defs_UE.h" #include "PHY/impl_defs_top.h" +#include <common/ran_context.h> /* Forms and Objects */ diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c index 90a252dc986b7ea69379e7f0ea2a9ed4abc5ab0b..c8401495070b294be0368aff4bfa1a80e21408cc 100644 --- a/openair1/PHY/TOOLS/nr_phy_scope.c +++ b/openair1/PHY/TOOLS/nr_phy_scope.c @@ -240,7 +240,7 @@ static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const in for (int pix=0; pix<graph->w; pix++) { scopeSample_t *end=values+(pix+1)*samplesPerPixel; end-=2; - AssertFatal(end <= values+datasize,"diff : %u", end-values+datasize); + AssertFatal(end <= values+datasize,"diff : %ld", end-values+datasize); double val=0; for (scopeSample_t *s=values+(pix)*samplesPerPixel; diff --git a/openair2/COMMON/mac_rrc_primitives.h b/openair2/COMMON/mac_rrc_primitives.h index 4a0a6027bcabb253c02d8b2d21105909097b9458..5a45f2f19662698027edc215f6d435985c793bea 100644 --- a/openair2/COMMON/mac_rrc_primitives.h +++ b/openair2/COMMON/mac_rrc_primitives.h @@ -189,7 +189,7 @@ typedef struct MEAS_REQ_TABLE_ENTRY { MAC_MEAS_REQ Mac_meas_req; unsigned int Last_report_frame; unsigned int Next_check_frame; - uint8_t Status; + uint8_t StatusMeas; uint8_t Meas_req_status; uint8_t Rx_activity; //uint8_t Meas_Direction;//??? @@ -269,7 +269,7 @@ typedef struct { char Wideband_sinr; uint8_t Forg_fact; unsigned short Rep_interval; - uint8_t Status; + uint8_t StatusMeas; unsigned int Last_report_frame; unsigned int Next_check_frame; uint8_t Active; @@ -299,7 +299,7 @@ typedef struct { unsigned short Rep_interval; unsigned int Last_report_frame; unsigned int Next_check_frame; - uint8_t Status; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok + uint8_t StatusMeas; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok uint8_t Active; } __attribute__ ((__packed__)) DEFAULT_CH_MEAS; #define DEFAULT_eNB_MEAS_SIZE sizeof(DEFAULT_eNB_MEAS) diff --git a/openair2/COMMON/tasks_def.h b/openair2/COMMON/tasks_def.h deleted file mode 100644 index 33b6d5f9d4670223009230f876405917050c3e2c..0000000000000000000000000000000000000000 --- a/openair2/COMMON/tasks_def.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The OpenAirInterface Software Alliance licenses this file to You under - * the OAI Public License, Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.openairinterface.org/?page_id=698 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - *------------------------------------------------------------------------------- - * For more information about the OpenAirInterface (OAI) Software Alliance: - * contact@openairinterface.org - */ - -// This task is mandatory and must always be placed in first position -TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10) - -// Other possible tasks in the process - -// Common tasks: - -/// Bearers Manager task -TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200) - -// eNodeB tasks and sub-tasks: - -/// Radio Resource Control task -TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200) - -// Define here for now -TASK_DEF(TASK_RRC_ENB_NB_IoT, TASK_PRIORITY_MED, 200) - -TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200) - -/// S1ap task -/// RAL task for ENB -TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200) - -// UDP TASK -TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000) -// GTP_V1U task -TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000) -TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200) -TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200) -TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200) -/// M3ap task, acts as both source and target -TASK_DEF(TASK_M3AP, TASK_PRIORITY_MED, 200) -/// M3ap task, acts as both source and target -TASK_DEF(TASK_M3AP_MME, TASK_PRIORITY_MED, 200) -/// M3ap task, acts as both source and target -TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200) -/// M2ap task, acts as both source and target -TASK_DEF(TASK_M2AP_MCE, TASK_PRIORITY_MED, 200) -TASK_DEF(TASK_M2AP_ENB, TASK_PRIORITY_MED, 200) -/// X2ap task, acts as both source and target -TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200) -/// Sctp task (Used by both S1AP and X2AP) -TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200) -/// eNB APP task -TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200) -/// gNB APP task -TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200) -/// eNB Agent task -TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200) -TASK_DEF(TASK_PROTO_AGENT, TASK_PRIORITY_MED, 200) -// UE tasks and sub-tasks: - -/// Radio Resource Control task -TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200) -TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200) -/// Non Access Stratum task -TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200) -TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200) - -//MESSAGE GENERATOR TASK -TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200) - -#ifdef ITTI_SIM -TASK_DEF(TASK_RRC_GNB_SIM, TASK_PRIORITY_MED, 200) -TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200) -#endif - diff --git a/openair2/ENB_APP/flexran_agent_ran_api.c b/openair2/ENB_APP/flexran_agent_ran_api.c index 070ce1be03776f8e04328ba7e91eca7b3bd6d91d..68d1f3311f261ab38f45250c35371b5f53d8cd39 100644 --- a/openair2/ENB_APP/flexran_agent_ran_api.c +++ b/openair2/ENB_APP/flexran_agent_ran_api.c @@ -888,7 +888,7 @@ uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti) { if (!ue_context_p) return RRC_INACTIVE; - return ue_context_p->ue_context.Status; + return ue_context_p->ue_context.StatusRrc; } uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id) { diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.c b/openair2/F1AP/f1ap_du_rrc_message_transfer.c index 74840439e06d48520edb8ad636f8946cbda99547..1d6e729ab2cf2ea450ca2ca632c2e1f6d71f8cbb 100644 --- a/openair2/F1AP/f1ap_du_rrc_message_transfer.c +++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.c @@ -721,7 +721,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance, } else { LOG_I(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti); - ue_context_p->ue_context.Status = RRC_CONNECTED; + ue_context_p->ue_context.StatusRrc = RRC_CONNECTED; } break; diff --git a/openair2/GNB_APP/gnb_config.h b/openair2/GNB_APP/gnb_config.h index 0d965171ef081599c8eb0c37a95209aefccc6701..4f305b1f4d104755de1d250997b678e00aec6663 100644 --- a/openair2/GNB_APP/gnb_config.h +++ b/openair2/GNB_APP/gnb_config.h @@ -92,7 +92,7 @@ typedef struct ru_config_s { uint8_t if_compress; } ru_config_t; */ -extern void RCconfig_RU(void); +extern void NRRCconfig_RU(void); extern void RCconfig_nr_flexran(void); extern void RCconfig_NR_L1(void); extern void RCconfig_nr_macrlc(void); diff --git a/openair2/RRC/LTE/L2_interface.c b/openair2/RRC/LTE/L2_interface.c index d9682b466f2f98148bc920ac221c26d63a93097a..0bc63237b3737a1a2c1e90100fa767c45b9215ea 100644 --- a/openair2/RRC/LTE/L2_interface.c +++ b/openair2/RRC/LTE/L2_interface.c @@ -349,12 +349,12 @@ mac_rrc_data_ind( ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt.module_id],rntiP); if(ue_context_p) { - if (ue_context_p->ue_context.Status != RRC_RECONFIGURED) { - LOG_E(RRC,"[eNB %d] Received C-RNTI ,but UE %x status(%d) not RRC_RECONFIGURED\n",module_idP,rntiP,ue_context_p->ue_context.Status); + if (ue_context_p->ue_context.StatusRrc != RRC_RECONFIGURED) { + LOG_E(RRC,"[eNB %d] Received C-RNTI ,but UE %x status(%d) not RRC_RECONFIGURED\n",module_idP,rntiP,ue_context_p->ue_context.StatusRrc); return (-1); } rrc_eNB_generate_defaultRRCConnectionReconfiguration(&ctxt,ue_context_p,0); - ue_context_p->ue_context.Status = RRC_RECONFIGURED; + ue_context_p->ue_context.StatusRrc = RRC_RECONFIGURED; } } @@ -376,7 +376,7 @@ mac_eNB_get_rrc_status( ue_context_p = rrc_eNB_get_ue_context(RC.rrc[Mod_idP], rntiP); if (ue_context_p != NULL) { - return(ue_context_p->ue_context.Status); + return(ue_context_p->ue_context.StatusRrc); } else { return RRC_INACTIVE; } diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c index e3d28d8a0ff7fe301671dbfb61a9d4a193d3b955..b2230df623cfe1440044c8339d0f797467ae00ba 100644 --- a/openair2/RRC/LTE/rrc_UE.c +++ b/openair2/RRC/LTE/rrc_UE.c @@ -492,7 +492,7 @@ rrc_t310_expiration( UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Srb_info.Srb_id, Rlc_info_um); UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Active = 0; - UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Status = IDLE; + UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].StatusSrb = IDLE; UE_rrc_inst[ctxt_pP->module_id].Srb2[eNB_index].Next_check_frame = 0; } } else { // Restablishment procedure @@ -671,7 +671,7 @@ rrc_ue_establish_srb1( { // add descriptor from RRC PDU UE_rrc_inst[ue_mod_idP].Srb1[eNB_index].Active = 1; - UE_rrc_inst[ue_mod_idP].Srb1[eNB_index].Status = RADIO_CONFIG_OK;//RADIO CFG + UE_rrc_inst[ue_mod_idP].Srb1[eNB_index].StatusSrb = RADIO_CONFIG_OK;//RADIO CFG UE_rrc_inst[ue_mod_idP].Srb1[eNB_index].Srb_info.Srb_id = 1; // copy default configuration for now // memcpy(&UE_rrc_inst[ue_mod_idP].Srb1[eNB_index].Srb_info.Lchan_desc[0],&DCCH_LCHAN_DESC,LCHAN_DESC_SIZE); @@ -695,7 +695,7 @@ rrc_ue_establish_srb2( { // add descriptor from RRC PDU UE_rrc_inst[ue_mod_idP].Srb2[eNB_index].Active = 1; - UE_rrc_inst[ue_mod_idP].Srb2[eNB_index].Status = RADIO_CONFIG_OK;//RADIO CFG + UE_rrc_inst[ue_mod_idP].Srb2[eNB_index].StatusSrb = RADIO_CONFIG_OK;//RADIO CFG UE_rrc_inst[ue_mod_idP].Srb2[eNB_index].Srb_info.Srb_id = 2; // copy default configuration for now // memcpy(&UE_rrc_inst[ue_mod_idP].Srb2[eNB_index].Srb_info.Lchan_desc[0],&DCCH_LCHAN_DESC,LCHAN_DESC_SIZE); diff --git a/openair2/RRC/LTE/rrc_defs.h b/openair2/RRC/LTE/rrc_defs.h index 66155416629149d9d15294c45da01abb72447bdf..1c02c3de46c0a2ed3e559a0e5b99e7aa6ca490f4 100644 --- a/openair2/RRC/LTE/rrc_defs.h +++ b/openair2/RRC/LTE/rrc_defs.h @@ -519,13 +519,13 @@ typedef struct RB_INFO_TABLE_ENTRY_s { RB_INFO Rb_info; uint8_t Active; uint32_t Next_check_frame; - uint8_t Status; + uint8_t StatusRb; } RB_INFO_TABLE_ENTRY; typedef struct SRB_INFO_TABLE_ENTRY_s { SRB_INFO Srb_info; uint8_t Active; - uint8_t Status; + uint8_t StatusSrb; uint32_t Next_check_frame; } SRB_INFO_TABLE_ENTRY; @@ -599,7 +599,7 @@ typedef struct eNB_RRC_UE_s { LTE_CipheringAlgorithm_r12_t ciphering_algorithm; e_LTE_SecurityAlgorithmConfig__integrityProtAlgorithm integrity_algorithm; - uint8_t Status; // RRC status, type enum UE_STATE_t + uint8_t StatusRrc; // RRC status, type enum UE_STATE_t rnti_t rnti; int gnb_rnti; //RNTI of the UE at the gNB if in ENDC connection int gnb_x2_assoc_id; diff --git a/openair2/RRC/LTE/rrc_eNB.c b/openair2/RRC/LTE/rrc_eNB.c index 52c3495948267eb231288b0dcb20c2d319e7b677..f86b0ddbae81defa9452c2a4b63e3bf95710878f 100644 --- a/openair2/RRC/LTE/rrc_eNB.c +++ b/openair2/RRC/LTE/rrc_eNB.c @@ -1202,7 +1202,7 @@ rrc_eNB_process_RRCConnectionSetupComplete( LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" [RAPROC] Logical Channel UL-DCCH, " "processing LTE_RRCConnectionSetupComplete from UE (SRB1 Active)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP)); ue_context_pP->ue_context.Srb1.Active = 1; - ue_context_pP->ue_context.Status = RRC_CONNECTED; + ue_context_pP->ue_context.StatusRrc = RRC_CONNECTED; ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // set rrc inactivity timer when UE goes into RRC_CONNECTED T(T_ENB_RRC_CONNECTION_SETUP_COMPLETE, T_INT(ctxt_pP->module_id), @@ -1578,7 +1578,7 @@ rrc_eNB_process_RRCConnectionReestablishmentComplete( int measurements_enabled; uint8_t next_xid = rrc_eNB_get_next_transaction_identifier(ctxt_pP->module_id); int ret = 0; - ue_context_pP->ue_context.Status = RRC_CONNECTED; + ue_context_pP->ue_context.StatusRrc = RRC_CONNECTED; ue_context_pP->ue_context.ue_rrc_inactivity_timer = 1; // set rrc inactivity when UE goes into RRC_CONNECTED ue_context_pP->ue_context.reestablishment_xid = next_xid; SRB_configList2 = &ue_context_pP->ue_context.SRB_configList2[xid]; @@ -2208,7 +2208,7 @@ rrc_eNB_generate_RRCConnectionRelease( #if 0 if(ue_context_pP != NULL) { - if(ue_context_pP->ue_context.Status == RRC_NR_NSA) { + if(ue_context_pP->ue_context.StatusRrc == RRC_NR_NSA) { //rrc_eNB_generate_SgNBReleaseRequest(ctxt_pP,ue_context_pP); } } @@ -4586,9 +4586,9 @@ rrc_eNB_process_MeasurementReport( /* TODO: improve NR triggering */ if (measResults2->measId == 7) { - if ((ue_context_pP->ue_context.Status != RRC_NR_NSA) && (ue_context_pP->ue_context.Status != RRC_NR_NSA_RECONFIGURED)) { + if ((ue_context_pP->ue_context.StatusRrc != RRC_NR_NSA) && (ue_context_pP->ue_context.StatusRrc != RRC_NR_NSA_RECONFIGURED)) { MessageDef *msg; - ue_context_pP->ue_context.Status = RRC_NR_NSA; + ue_context_pP->ue_context.StatusRrc = RRC_NR_NSA; ue_context_pP->ue_context.gnb_rnti = -1; // set when receiving X2AP_ENDC_SGNB_ADDITION_REQ_ACK ue_context_pP->ue_context.gnb_x2_assoc_id = -1; // set when receiving X2AP_ENDC_SGNB_ADDITION_REQ_ACK @@ -4724,12 +4724,12 @@ rrc_eNB_process_MeasurementReport( LOG_D(RRC, "A3 event is triggered...\n"); /* if the UE is not in handover mode, start handover procedure */ - if (ue_context_pP->ue_context.Status != RRC_HO_EXECUTION) { + if (ue_context_pP->ue_context.StatusRrc != RRC_HO_EXECUTION) { MessageDef *msg; LOG_I(RRC, "Send HO preparation message at frame %d and subframe %d \n", ctxt_pP->frame, ctxt_pP->subframe); /* HO info struct may not be needed anymore */ ue_context_pP->ue_context.handover_info = CALLOC(1, sizeof(*(ue_context_pP->ue_context.handover_info))); - ue_context_pP->ue_context.Status = RRC_HO_EXECUTION; + ue_context_pP->ue_context.StatusRrc = RRC_HO_EXECUTION; ue_context_pP->ue_context.handover_info->state = HO_REQUEST; /* HO Preparation message */ msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_HANDOVER_REQ); @@ -4861,7 +4861,7 @@ void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_re RB_INSERT(rrc_ue_tree_s, &RC.rrc[mod_id]->rrc_ue_head, ue_context_target_p); LOG_D(RRC, "eNB %d: Created new UE context uid %u\n", mod_id, ue_context_target_p->local_uid); ue_context_target_p->ue_context.handover_info = CALLOC(1, sizeof(*(ue_context_target_p->ue_context.handover_info))); - //ue_context_target_p->ue_context.Status = RRC_HO_EXECUTION; + //ue_context_target_p->ue_context.StatusRrc = RRC_HO_EXECUTION; //ue_context_target_p->ue_context.handover_info->state = HO_ACK; ue_context_target_p->ue_context.handover_info->x2_id = m->x2_id; ue_context_target_p->ue_context.handover_info->assoc_id = m->target_assoc_id; @@ -4936,7 +4936,7 @@ void rrc_eNB_process_handoverPreparationInformation(int mod_id, x2ap_handover_re } rrc_eNB_process_X2AP_TUNNEL_SETUP_REQ(mod_id, ue_context_target_p); - ue_context_target_p->ue_context.Status = RRC_HO_EXECUTION; + ue_context_target_p->ue_context.StatusRrc = RRC_HO_EXECUTION; ue_context_target_p->ue_context.handover_info->state = HO_ACK; } @@ -5051,7 +5051,7 @@ flexran_rrc_eNB_trigger_handover (int mod_id, LOG_D(RRC, "Handover is triggered by FlexRAN controller...\n"); /* if the UE is not in handover mode, start handover procedure */ - if (ue_context_pP->ue_context.Status != RRC_HO_EXECUTION) { + if (ue_context_pP->ue_context.StatusRrc != RRC_HO_EXECUTION) { MessageDef *msg; LOG_I(RRC, "Send HO preparation message at frame %d and subframe %d \n", ctxt_pP->frame, ctxt_pP->subframe); /* Check memory leakage for handover info */ @@ -5059,7 +5059,7 @@ flexran_rrc_eNB_trigger_handover (int mod_id, //free(ue_context_pP->ue_context.handover_info); //} ue_context_pP->ue_context.handover_info = CALLOC(1, sizeof(*(ue_context_pP->ue_context.handover_info))); - ue_context_pP->ue_context.Status = RRC_HO_EXECUTION; + ue_context_pP->ue_context.StatusRrc = RRC_HO_EXECUTION; ue_context_pP->ue_context.handover_info->state = HO_REQUEST; /* HO Preparation message */ msg = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_HANDOVER_REQ); @@ -5120,7 +5120,7 @@ check_handovers( RB_FOREACH(ue_context_p, rrc_ue_tree_s, &(RC.rrc[ctxt_pP->module_id]->rrc_ue_head)) { ctxt_pP->rnti = ue_context_p->ue_id_rnti; - if (ue_context_p->ue_context.Status == RRC_HO_EXECUTION && ue_context_p->ue_context.handover_info != NULL) { + if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION && ue_context_p->ue_context.handover_info != NULL) { /* in the source, UE in HO_PREPARE mode */ if (ue_context_p->ue_context.handover_info->state == HO_PREPARE) { LOG_D(RRC, @@ -5171,7 +5171,7 @@ check_handovers( } } - if (ue_context_p->ue_context.Status == RRC_RECONFIGURED + if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED && ue_context_p->ue_context.handover_info != NULL && ue_context_p->ue_context.handover_info->forwarding_state == FORWARDING_NO_EMPTY ) { MessageDef *msg_p; @@ -5237,7 +5237,7 @@ check_handovers( ue_context_p->ue_context.handover_info->forwarding_state = FORWARDING_EMPTY; } - if( ue_context_p->ue_context.Status == RRC_RECONFIGURED && + if( ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED && ue_context_p->ue_context.handover_info != NULL && ue_context_p->ue_context.handover_info->forwarding_state == FORWARDING_EMPTY && ue_context_p->ue_context.handover_info->endmark_state == ENDMARK_NO_EMPTY && @@ -7228,7 +7228,7 @@ rrc_eNB_decode_ccch( } //c-plane not end - if((ue_context_p->ue_context.Status != RRC_RECONFIGURED) && (ue_context_p->ue_context.reestablishment_cause == LTE_ReestablishmentCause_spare1)) { + if((ue_context_p->ue_context.StatusRrc != RRC_RECONFIGURED) && (ue_context_p->ue_context.reestablishment_cause == LTE_ReestablishmentCause_spare1)) { LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" LTE_RRCConnectionReestablishmentRequest (UE %x c-plane is not end), let's reject the UE\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),c_rnti); @@ -7240,9 +7240,9 @@ rrc_eNB_decode_ccch( LOG_E(RRC, PROTOCOL_RRC_CTXT_UE_FMT" RRRCConnectionReconfigurationComplete(Previous) don't receive, delete the Previous UE,\nprevious Status %d, new Status RRC_RECONFIGURED\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP), - ue_context_p->ue_context.Status + ue_context_p->ue_context.StatusRrc ); - ue_context_p->ue_context.Status = RRC_RECONFIGURED; + ue_context_p->ue_context.StatusRrc = RRC_RECONFIGURED; protocol_ctxt_t ctxt_old_p; PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt_old_p, ctxt_pP->instance, @@ -8014,7 +8014,7 @@ rrc_eNB_decode_dcch( int flexran_agent_handover = 0; if (EPC_MODE_ENABLED) { - if (ue_context_p->ue_context.Status == RRC_RECONFIGURED) { + if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { dedicated_DRB = 1; LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n", @@ -8039,7 +8039,7 @@ rrc_eNB_decode_dcch( dedicated_DRB = 2; RC.mac[ctxt_pP->module_id]->UE_info.UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 0; } - } else if (ue_context_p->ue_context.Status == RRC_HO_EXECUTION) { + } else if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION) { int16_t UE_id = find_UE_id(ctxt_pP->module_id, ctxt_pP->rnti); if(UE_id == -1) { @@ -8053,7 +8053,7 @@ rrc_eNB_decode_dcch( RC.rrc[ctxt_pP->module_id]->Nb_ue++; dedicated_DRB = 3; RC.mac[ctxt_pP->module_id]->UE_info.UE_sched_ctrl[UE_id].crnti_reconfigurationcomplete_flag = 0; - ue_context_p->ue_context.Status = RRC_RECONFIGURED; + ue_context_p->ue_context.StatusRrc = RRC_RECONFIGURED; if(ue_context_p->ue_context.handover_info) { ue_context_p->ue_context.handover_info->state = HO_CONFIGURED; @@ -8062,7 +8062,7 @@ rrc_eNB_decode_dcch( LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_HO_EXECUTION (xid %ld)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); - } else if(ue_context_p->ue_context.Status == RRC_NR_NSA) { + } else if(ue_context_p->ue_context.StatusRrc == RRC_NR_NSA) { //Looking for a condition to trigger S1AP E-RAB-Modification-indication, based on the reception of RRCConnectionReconfigurationComplete //including NR specific elements. if(ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.criticalExtensions.choice.rrcConnectionReconfigurationComplete_r8. @@ -8081,7 +8081,7 @@ rrc_eNB_decode_dcch( nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension->nonCriticalExtension ->scg_ConfigResponseNR_r15!=NULL) { dedicated_DRB = -1; /* put a value that does not run anything below */ - ue_context_p->ue_context.Status = RRC_NR_NSA_RECONFIGURED; + ue_context_p->ue_context.StatusRrc = RRC_NR_NSA_RECONFIGURED; /*Trigger E-RAB Modification Indication */ rrc_eNB_send_E_RAB_Modification_Indication(ctxt_pP, ue_context_p); /* send reconfiguration complete to gNB */ @@ -8095,7 +8095,7 @@ rrc_eNB_decode_dcch( } } else { dedicated_DRB = 0; - ue_context_p->ue_context.Status = RRC_RECONFIGURED; + ue_context_p->ue_context.StatusRrc = RRC_RECONFIGURED; LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (default DRB, xid %ld)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); @@ -8104,7 +8104,7 @@ rrc_eNB_decode_dcch( ue_context_p->ue_context.reestablishment_xid = -1; } else { dedicated_DRB = 1; - ue_context_p->ue_context.Status = RRC_RECONFIGURED; + ue_context_p->ue_context.StatusRrc = RRC_RECONFIGURED; LOG_I(RRC, PROTOCOL_RRC_CTXT_UE_FMT" UE State = RRC_RECONFIGURED (dedicated DRB, xid %ld)\n", PROTOCOL_RRC_CTXT_UE_ARGS(ctxt_pP),ul_dcch_msg->message.choice.c1.choice.rrcConnectionReconfigurationComplete.rrc_TransactionIdentifier); @@ -9272,8 +9272,8 @@ void rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { } /* remove UE from gNB if UE is in NSA mode */ - if (ue_to_be_removed[cur_ue]->ue_context.Status == RRC_NR_NSA || - ue_to_be_removed[cur_ue]->ue_context.Status == RRC_NR_NSA_RECONFIGURED) { + if (ue_to_be_removed[cur_ue]->ue_context.StatusRrc == RRC_NR_NSA || + ue_to_be_removed[cur_ue]->ue_context.StatusRrc == RRC_NR_NSA_RECONFIGURED) { MessageDef *message_p; message_p = itti_alloc_new_message(TASK_RRC_ENB, 0, X2AP_ENDC_SGNB_RELEASE_REQUEST); X2AP_ENDC_SGNB_RELEASE_REQUEST(message_p).rnti = ue_to_be_removed[cur_ue]->ue_context.gnb_rnti; @@ -9281,7 +9281,7 @@ void rrc_subframe_process(protocol_ctxt_t *const ctxt_pP, const int CC_id) { X2AP_ENDC_SGNB_RELEASE_REQUEST(message_p).cause = X2AP_CAUSE_RADIO_CONNECTION_WITH_UE_LOST; itti_send_msg_to_task(TASK_X2AP, ctxt_pP->module_id, message_p); /* set state to RRC_NR_NSA_DELETED to avoid sending X2AP_ENDC_SGNB_RELEASE_REQUEST again later */ - ue_to_be_removed[cur_ue]->ue_context.Status = RRC_NR_NSA_DELETED; + ue_to_be_removed[cur_ue]->ue_context.StatusRrc = RRC_NR_NSA_DELETED; } rrc_eNB_free_UE(ctxt_pP->module_id, ue_to_be_removed[cur_ue]); @@ -9451,13 +9451,13 @@ void rrc_eNB_process_ENDC_DC_prep_timeout(module_id_t module_id, x2ap_ENDC_dc_pr return; } - if (ue_context->ue_context.Status != RRC_NR_NSA) { + if (ue_context->ue_context.StatusRrc != RRC_NR_NSA) { LOG_E(RRC, "receiving DC prep timeout for UE rnti %d not in state RRC_NR_NSA\n", m->rnti); return; } LOG_I(RRC, "DC prep timeout for UE rnti %d, put back to RRC_RECONFIGURED mode\n", m->rnti); - ue_context->ue_context.Status = RRC_RECONFIGURED; + ue_context->ue_context.StatusRrc = RRC_RECONFIGURED; } void rrc_eNB_process_ENDC_sgNB_release_required(module_id_t module_id, x2ap_ENDC_sgnb_release_required_t *m) @@ -9478,7 +9478,7 @@ void rrc_eNB_process_ENDC_sgNB_release_required(module_id_t module_id, x2ap_ENDC ue_context->ue_context.ue_release_timer_thres_rrc = 100; ue_context->ue_context.ue_release_timer_rrc = 1; - ue_context->ue_context.Status = RRC_NR_NSA_DELETED; + ue_context->ue_context.StatusRrc = RRC_NR_NSA_DELETED; PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, module_id, /* TODO: should be 'instance' */ @@ -9744,7 +9744,7 @@ void *rrc_enb_process_itti_msg(void *notUsed) { if (X2AP_HANDOVER_CANCEL(msg_p).cause == X2AP_T_RELOC_PREP_TIMEOUT) { /* for prep timeout, simply return to normal state */ /* TODO: be sure that it's correct to set Status to RRC_RECONFIGURED */ - ue_context_p->ue_context.Status = RRC_RECONFIGURED; + ue_context_p->ue_context.StatusRrc = RRC_RECONFIGURED; /* TODO: be sure free is enough here (check memory leaks) */ free(ue_context_p->ue_context.handover_info); ue_context_p->ue_context.handover_info = NULL; diff --git a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c index 64f84ddc4db333346e70f9b52a99ed377b32448f..a6af6a4163a7f941e49ba89079b541799a6d1dc2 100644 --- a/openair2/RRC/LTE/rrc_eNB_GTPV1U.c +++ b/openair2/RRC/LTE/rrc_eNB_GTPV1U.c @@ -188,7 +188,7 @@ boolean_t gtpv_data_req_new ( struct rrc_eNB_ue_context_s *ue_context_p = rrc_eNB_get_ue_context(RC.rrc[ctxt->module_id], ctxt->rnti); if(ue_context_p == NULL || ue_context_p->ue_context.handover_info == NULL || - ue_context_p->ue_context.Status != RRC_HO_EXECUTION) { + ue_context_p->ue_context.StatusRrc != RRC_HO_EXECUTION) { LOG_E(RRC,"incoming GTP-U for X2 in non HO context\n"); return false; } @@ -215,7 +215,7 @@ boolean_t gtpv_data_req_new ( /* target enb */ // We have 2*2=4 cases (data or end marker) * (from source, from EPC) - if (ue_context_p->ue_context.Status == RRC_RECONFIGURED) { + if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { // It should come from remote eNB // case end marker by EPC is not possible ? if (task==TASK_END_MARKER) { diff --git a/openair2/RRC/LTE/rrc_eNB_S1AP.c b/openair2/RRC/LTE/rrc_eNB_S1AP.c index f64a109f75899de9409984c41b6d7f487e61b62e..1cb575d1ddb323877700097692265f82ee28a0f8 100644 --- a/openair2/RRC/LTE/rrc_eNB_S1AP.c +++ b/openair2/RRC/LTE/rrc_eNB_S1AP.c @@ -1072,7 +1072,7 @@ int rrc_eNB_process_S1AP_INITIAL_CONTEXT_SETUP_REQ(MessageDef *msg_p, const char ue_context_p->ue_context.nr_security.kgNB); // in case, send the S1SP initial context response if it is not sent with the attach complete message - if (ue_context_p->ue_context.Status == RRC_RECONFIGURED) { + if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { LOG_I(RRC, "Sending rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP, cause %ld\n", ue_context_p->ue_context.reestablishment_cause); //if(ue_context_p->ue_context.reestablishment_cause == ReestablishmentCause_spare1){} rrc_eNB_send_S1AP_INITIAL_CONTEXT_SETUP_RESP(&ctxt,ue_context_p); diff --git a/openair2/RRC/NR_UE/rrc_UE.c b/openair2/RRC/NR_UE/rrc_UE.c index 191933a80baecd080d86dfddb8e7349bd42fa363..86948230a589a2734ecefbf618c797129a2e224d 100644 --- a/openair2/RRC/NR_UE/rrc_UE.c +++ b/openair2/RRC/NR_UE/rrc_UE.c @@ -1736,13 +1736,13 @@ void nr_rrc_ue_generate_RRCSetupRequest(module_id_t module_id, const uint8_t gNB MessageDef *message_p; uint8_t *message_buffer; message_buffer = itti_malloc (TASK_RRC_NRUE,TASK_RRC_GNB_SIM, - NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size); - memcpy (message_buffer, (uint8_t*)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload, - NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size); + NR_UE_rrc_inst[module_id].Srb0[gNB_index].Tx_buffer.payload_size); + memcpy (message_buffer, (uint8_t*)NR_UE_rrc_inst[module_id].Srb0[gNB_index].Tx_buffer.Payload, + NR_UE_rrc_inst[module_id].Srb0[gNB_index].Tx_buffer.payload_size); message_p = itti_alloc_new_message (TASK_RRC_NRUE, 0, UE_RRC_CCCH_DATA_IND); GNB_RRC_CCCH_DATA_IND (message_p).sdu = message_buffer; - GNB_RRC_CCCH_DATA_IND (message_p).size = NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size; - itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p); + GNB_RRC_CCCH_DATA_IND (message_p).size = NR_UE_rrc_inst[module_id].Srb0[gNB_index].Tx_buffer.payload_size; + itti_send_msg_to_task (TASK_RRC_GNB_SIM, gNB_index, message_p); #endif } } diff --git a/openair2/SIMULATION/NR_RRC/itti_sim.c b/openair2/SIMULATION/NR_RRC/itti_sim.c index d583346a8913576b931c5e05e05ad75b77c31752..82906b45f867aff2a6fa4225ee071c487f26dee6 100644 --- a/openair2/SIMULATION/NR_RRC/itti_sim.c +++ b/openair2/SIMULATION/NR_RRC/itti_sim.c @@ -81,12 +81,13 @@ unsigned short config_frames[4] = {2,9,11,13}; #include "RRC/NR_UE/rrc_proto.h" #include "RRC/NR_UE/rrc_vars.h" #include "openair3/NAS/UE/nas_ue_task.h" +#include <executables/split_headers.h> +#include <executables/nr-uesoftmodem.h> pthread_cond_t nfapi_sync_cond; pthread_mutex_t nfapi_sync_mutex; int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex -uint8_t nfapi_mode = 0; // Default to monolithic mode uint32_t timing_advance = 0; uint64_t num_missed_slots=0; @@ -94,7 +95,18 @@ int split73=0; void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) { AssertFatal(false, "Must not be called in this context\n"); } +void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti, int32_t stat) { + AssertFatal(false, "Must not be called in this context\n"); +} + +nrUE_params_t nrUE_params; +nrUE_params_t *get_nrUE_params(void) { + return &nrUE_params; +} + +void processSlotTX(void *arg) {} +THREAD_STRUCT thread_struct; pthread_cond_t sync_cond; pthread_mutex_t sync_mutex; int sync_var=-1; //!< protected by mutex \ref sync_mutex. diff --git a/openair3/GTPV1-U/gtpv1u_eNB.c b/openair3/GTPV1-U/gtpv1u_eNB.c index e1ea5cb08e2ead6103b3e4b66cd65ad877a86096..0fe2741d7bd1f3bd9d3b3357b64e8d01a32ce807 100644 --- a/openair3/GTPV1-U/gtpv1u_eNB.c +++ b/openair3/GTPV1-U/gtpv1u_eNB.c @@ -281,7 +281,7 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( (ue_context_p->ue_context.handover_info->state < HO_FORWARDING_COMPLETE)) { if(msgType == NW_GTP_END_MARKER) { /* in the source enb, UE in RRC_HO_EXECUTION mode */ - if (ue_context_p->ue_context.Status == RRC_HO_EXECUTION && ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { + if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION && ue_context_p->ue_context.handover_info->state == HO_COMPLETE) { /* set handover state */ //ue_context_p->ue_context.handover_info->state = HO_END_MARKER; MessageDef *msg; @@ -299,10 +299,10 @@ NwGtpv1uRcT gtpv1u_eNB_process_stack_req( } } - if (ue_context_p->ue_context.Status == RRC_HO_EXECUTION || ue_context_p->ue_context.Status == RRC_RECONFIGURED) { + if (ue_context_p->ue_context.StatusRrc == RRC_HO_EXECUTION || ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) { int msgsrc = gtpv1u_eNB_get_msgsource(ue_context_p, teid); LOG_D(GTPU,"UE INFO.ueStatus %d, handover state %d, forwarding state %d, from %s. message type %s\n", - ue_context_p->ue_context.Status, + ue_context_p->ue_context.StatusRrc, ue_context_p->ue_context.handover_info->state, ue_context_p->ue_context.handover_info->forwarding_state, msgsrc == GTPV1U_MSG_FROM_SOURCE_ENB?"Source eNB":"EPC",