diff --git a/.travis.yml b/.travis.yml index 09f1003aa..e53a2a7db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,7 @@ script: fi - mkdir build - cd build - - cmake -DENABLE_5GNR=True -DENABLE_TTCN3=True -DRF_FOUND=True -G Ninja .. + - cmake -DENABLE_TTCN3=True -DRF_FOUND=True -G Ninja .. - ninja - ninja test - sudo ninja install \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index e0065af49..3513a7433 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,6 @@ configure_file( option(ENABLE_SRSUE "Build srsUE application" ON) option(ENABLE_SRSENB "Build srsENB application" ON) option(ENABLE_SRSEPC "Build srsEPC application" ON) -option(ENABLE_5GNR "Build with 5G-NR components" OFF) option(DISABLE_SIMD "Disable SIMD instructions" OFF) option(AUTO_DETECT_ISA "Autodetect supported ISA extensions" ON) @@ -94,9 +93,6 @@ else(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") set(GCC_ARCH native CACHE STRING "GCC compile for specific architecture.") endif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") -if (ENABLE_5GNR) - add_definitions(-DHAVE_5GNR) -endif (ENABLE_5GNR) ######################################################################## # Find dependencies diff --git a/lib/src/asn1/CMakeLists.txt b/lib/src/asn1/CMakeLists.txt index 804f5d12b..f9c6a69d3 100644 --- a/lib/src/asn1/CMakeLists.txt +++ b/lib/src/asn1/CMakeLists.txt @@ -51,18 +51,15 @@ target_compile_options(s1ap_asn1 PRIVATE "-Os") target_link_libraries(s1ap_asn1 asn1_utils srslte_common) INSTALL(TARGETS s1ap_asn1 DESTINATION ${LIBRARY_DIR}) -if (ENABLE_5GNR) - # RRC NR ASN1 - add_library(rrc_nr_asn1 STATIC rrc_nr.cc rrc_nr_utils.cc) - target_compile_options(rrc_nr_asn1 PRIVATE "-Os") - target_link_libraries(rrc_nr_asn1 asn1_utils srslte_common) - INSTALL(TARGETS rrc_nr_asn1 DESTINATION ${LIBRARY_DIR}) - - # NGAP ASN1 - add_library(ngap_nr_asn1 STATIC ngap.cc) - target_compile_options(ngap_nr_asn1 PRIVATE "-Os") - target_link_libraries(ngap_nr_asn1 asn1_utils srslte_common) - INSTALL(TARGETS ngap_nr_asn1 DESTINATION ${LIBRARY_DIR}) -endif(ENABLE_5GNR) +# RRC NR ASN1 +add_library(rrc_nr_asn1 STATIC rrc_nr.cc rrc_nr_utils.cc) +target_compile_options(rrc_nr_asn1 PRIVATE "-Os") +target_link_libraries(rrc_nr_asn1 asn1_utils srslte_common) +INSTALL(TARGETS rrc_nr_asn1 DESTINATION ${LIBRARY_DIR}) +# NGAP ASN1 +add_library(ngap_nr_asn1 STATIC ngap.cc) +target_compile_options(ngap_nr_asn1 PRIVATE "-Os") +target_link_libraries(ngap_nr_asn1 asn1_utils srslte_common) +INSTALL(TARGETS ngap_nr_asn1 DESTINATION ${LIBRARY_DIR}) diff --git a/lib/src/common/CMakeLists.txt b/lib/src/common/CMakeLists.txt index a2ea81698..a265722bd 100644 --- a/lib/src/common/CMakeLists.txt +++ b/lib/src/common/CMakeLists.txt @@ -33,11 +33,8 @@ set(SOURCES arch_select.cc time_prof.cc version.c zuc.cc - s3g.cc) - -if (ENABLE_5GNR) - set(SOURCES ${SOURCES} basic_vnf.cc) -endif(ENABLE_5GNR) + s3g.cc + basic_vnf.cc) # Avoid warnings caused by libmbedtls about deprecated functions set_source_files_properties(security.cc PROPERTIES COMPILE_FLAGS -Wno-deprecated-declarations) diff --git a/lib/src/mac/CMakeLists.txt b/lib/src/mac/CMakeLists.txt index f2dd03f0b..4d73f3327 100644 --- a/lib/src/mac/CMakeLists.txt +++ b/lib/src/mac/CMakeLists.txt @@ -6,11 +6,7 @@ # the distribution. # -SET(SOURCES pdu.cc pdu_queue.cc) - -if (ENABLE_5GNR) - set(SOURCES ${SOURCES} mac_sch_pdu_nr.cc mac_rar_pdu_nr.cc) -endif(ENABLE_5GNR) +SET(SOURCES pdu.cc pdu_queue.cc mac_sch_pdu_nr.cc mac_rar_pdu_nr.cc) add_library(srslte_mac STATIC ${SOURCES}) target_link_libraries(srslte_mac srslte_common) diff --git a/lib/src/upper/CMakeLists.txt b/lib/src/upper/CMakeLists.txt index ac5ce79d8..f3398b63a 100644 --- a/lib/src/upper/CMakeLists.txt +++ b/lib/src/upper/CMakeLists.txt @@ -15,11 +15,10 @@ set(SOURCES gtpu.cc rlc_um_base.cc rlc_um_lte.cc rlc_am_base.cc - rlc_am_lte.cc) - -if (ENABLE_5GNR) - set(SOURCES ${SOURCES} pdcp_entity_nr.cc rlc_um_nr.cc rlc_am_nr.cc) -endif(ENABLE_5GNR) + rlc_am_lte.cc + pdcp_entity_nr.cc + rlc_um_nr.cc + rlc_am_nr.cc) add_library(srslte_upper STATIC ${SOURCES}) target_link_libraries(srslte_upper srslte_common srslte_asn1) diff --git a/lib/src/upper/pdcp.cc b/lib/src/upper/pdcp.cc index 480556dbc..c1fdde916 100644 --- a/lib/src/upper/pdcp.cc +++ b/lib/src/upper/pdcp.cc @@ -11,9 +11,7 @@ */ #include "srslte/upper/pdcp.h" -#ifdef HAVE_5GNR #include "srslte/upper/pdcp_entity_nr.h" -#endif namespace srslte { @@ -99,12 +97,7 @@ void pdcp::add_bearer(uint32_t lcid, pdcp_config_t cfg) if (cfg.sn_len == srslte::PDCP_SN_LEN_18) { // create NR entity for 18bit SN length -#ifdef HAVE_5GNR entity.reset(new pdcp_entity_nr{rlc, rrc, gw, task_sched, logger, lcid, cfg}); -#else - logger.error("Invalid PDCP configuration."); - return; -#endif } else { entity.reset(new pdcp_entity_lte{rlc, rrc, gw, task_sched, logger, lcid, cfg}); } diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index f51cff034..dd0d40ef1 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -417,7 +417,6 @@ void rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg) if (rlc_entity != nullptr) { rlc_entity->set_bsr_callback(bsr_callback); } -#ifdef HAVE_5GNR } else if (cnfg.rat == srslte_rat_t::nr) { switch (cnfg.rlc_mode) { case rlc_mode_t::tm: @@ -430,7 +429,6 @@ void rlc::add_bearer(uint32_t lcid, const rlc_config_t& cnfg) logger.error("Cannot add RLC entity - invalid mode"); return; } -#endif } else { logger.error("RAT not supported"); return; diff --git a/lib/test/asn1/CMakeLists.txt b/lib/test/asn1/CMakeLists.txt index 9bc24d371..99c9d17f2 100644 --- a/lib/test/asn1/CMakeLists.txt +++ b/lib/test/asn1/CMakeLists.txt @@ -15,11 +15,7 @@ target_link_libraries(srslte_asn1_rrc_mcch_test rrc_asn1 srslte_common) add_test(srslte_asn1_rrc_mcch_test srslte_asn1_rrc_mcch_test) add_executable(srslte_asn1_rrc_meas_test srslte_asn1_rrc_meas_test.cc) -if (ENABLE_5GNR) target_link_libraries(srslte_asn1_rrc_meas_test rrc_asn1 rrc_nr_asn1 srslte_common) -else() -target_link_libraries(srslte_asn1_rrc_meas_test rrc_asn1 srslte_common) -endif(ENABLE_5GNR) add_test(srslte_asn1_rrc_meas_test srslte_asn1_rrc_meas_test) add_executable(srslte_asn1_rrc_ul_dcch_test srslte_asn1_rrc_ul_dcch_test.cc) @@ -46,19 +42,17 @@ add_executable(rrc_asn1_test rrc_test.cc) target_link_libraries(rrc_asn1_test rrc_asn1 asn1_utils srslte_common) add_test(rrc_asn1_test rrc_asn1_test) -if (ENABLE_5GNR) - add_executable(srslte_asn1_rrc_nr_test srslte_asn1_rrc_nr_test.cc) - target_link_libraries(srslte_asn1_rrc_nr_test rrc_nr_asn1 asn1_utils srslte_common) - add_test(srslte_asn1_rrc_nr_test srslte_asn1_rrc_nr_test) +add_executable(srslte_asn1_rrc_nr_test srslte_asn1_rrc_nr_test.cc) +target_link_libraries(srslte_asn1_rrc_nr_test rrc_nr_asn1 asn1_utils srslte_common) +add_test(srslte_asn1_rrc_nr_test srslte_asn1_rrc_nr_test) - add_executable(ngap_asn1_test ngap_test.cc) - target_link_libraries(ngap_asn1_test ngap_nr_asn1 srslte_common) - add_test(ngap_asn1_test ngap_asn1_test) +add_executable(ngap_asn1_test ngap_test.cc) +target_link_libraries(ngap_asn1_test ngap_nr_asn1 srslte_common) +add_test(ngap_asn1_test ngap_asn1_test) - add_executable(rrc_nr_utils_test rrc_nr_utils_test.cc) - target_link_libraries(rrc_nr_utils_test ngap_nr_asn1 srslte_common rrc_nr_asn1) - add_test(rrc_nr_utils_test rrc_nr_utils_test) -endif(ENABLE_5GNR) +add_executable(rrc_nr_utils_test rrc_nr_utils_test.cc) +target_link_libraries(rrc_nr_utils_test ngap_nr_asn1 srslte_common rrc_nr_asn1) +add_test(rrc_nr_utils_test rrc_nr_utils_test) add_executable(rrc_asn1_decoder rrc_asn1_decoder.cc) target_link_libraries(rrc_asn1_decoder rrc_asn1) diff --git a/lib/test/common/CMakeLists.txt b/lib/test/common/CMakeLists.txt index 5a44305e4..f78d7b381 100644 --- a/lib/test/common/CMakeLists.txt +++ b/lib/test/common/CMakeLists.txt @@ -83,11 +83,8 @@ add_executable(task_scheduler_test task_scheduler_test.cc) target_link_libraries(task_scheduler_test srslte_common) add_test(task_scheduler_test task_scheduler_test) -if(ENABLE_5GNR) - add_executable(pnf_dummy pnf_dummy.cc) - target_link_libraries(pnf_dummy srslte_common ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) - - add_executable(pnf_bridge pnf_bridge.cc) - target_link_libraries(pnf_bridge srslte_common ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) -endif() +add_executable(pnf_dummy pnf_dummy.cc) +target_link_libraries(pnf_dummy srslte_common ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) +add_executable(pnf_bridge pnf_bridge.cc) +target_link_libraries(pnf_bridge srslte_common ${CMAKE_THREAD_LIBS_INIT} ${Boost_LIBRARIES}) diff --git a/lib/test/mac/CMakeLists.txt b/lib/test/mac/CMakeLists.txt index 9321a971c..6ee3364b3 100644 --- a/lib/test/mac/CMakeLists.txt +++ b/lib/test/mac/CMakeLists.txt @@ -14,8 +14,7 @@ add_executable(mac_pcap_test mac_pcap_test.cc) target_link_libraries(mac_pcap_test srslte_common srslte_mac ${SCTP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) add_test(mac_pcap_test mac_pcap_test) -if (ENABLE_5GNR) - add_executable(mac_pdu_nr_test mac_pdu_nr_test.cc) - target_link_libraries(mac_pdu_nr_test srslte_mac srslte_common ${CMAKE_THREAD_LIBS_INIT}) - add_test(mac_pdu_nr_test mac_pdu_nr_test) -endif (ENABLE_5GNR) +add_executable(mac_pdu_nr_test mac_pdu_nr_test.cc) +target_link_libraries(mac_pdu_nr_test srslte_mac srslte_common ${CMAKE_THREAD_LIBS_INIT}) +add_test(mac_pdu_nr_test mac_pdu_nr_test) + diff --git a/lib/test/upper/CMakeLists.txt b/lib/test/upper/CMakeLists.txt index c16c76f7b..31aff49e5 100644 --- a/lib/test/upper/CMakeLists.txt +++ b/lib/test/upper/CMakeLists.txt @@ -20,20 +20,17 @@ add_executable(rlc_am_test rlc_am_test.cc) target_link_libraries(rlc_am_test srslte_upper srslte_phy srslte_common) add_lte_test(rlc_am_test rlc_am_test) -if (ENABLE_5GNR) - add_executable(rlc_am_nr_pdu_test rlc_am_nr_pdu_test.cc) - target_link_libraries(rlc_am_nr_pdu_test srslte_upper srslte_phy) - add_nr_test(rlc_am_nr_pdu_test rlc_am_nr_pdu_test) -endif(ENABLE_5GNR) +add_executable(rlc_am_nr_pdu_test rlc_am_nr_pdu_test.cc) +target_link_libraries(rlc_am_nr_pdu_test srslte_upper srslte_phy) +add_nr_test(rlc_am_nr_pdu_test rlc_am_nr_pdu_test) add_executable(rlc_stress_test rlc_stress_test.cc) target_link_libraries(rlc_stress_test srslte_upper srslte_mac srslte_phy srslte_common ${Boost_LIBRARIES}) add_lte_test(rlc_am_stress_test rlc_stress_test --mode=AM --loglevel 1 --sdu_gen_delay 250) add_lte_test(rlc_um_stress_test rlc_stress_test --mode=UM --loglevel 1) add_lte_test(rlc_tm_stress_test rlc_stress_test --mode=TM --loglevel 1 --random_opp=false) -if (ENABLE_5GNR) - add_nr_test(rlc_um_nr_stress_test rlc_stress_test --rat NR --mode=UM --loglevel 1) -endif(ENABLE_5GNR) + +add_nr_test(rlc_um_nr_stress_test rlc_stress_test --rat NR --mode=UM --loglevel 1) add_executable(rlc_um_data_test rlc_um_data_test.cc) target_link_libraries(rlc_um_data_test srslte_upper srslte_phy srslte_common) @@ -47,27 +44,25 @@ add_executable(rlc_common_test rlc_common_test.cc) target_link_libraries(rlc_common_test srslte_upper srslte_phy) add_test(rlc_common_test rlc_common_test) -if (ENABLE_5GNR) - add_executable(rlc_um_nr_pdu_test rlc_um_nr_pdu_test.cc) - target_link_libraries(rlc_um_nr_pdu_test srslte_upper srslte_phy) - add_nr_test(rlc_um_nr_pdu_test rlc_um_nr_pdu_test) +add_executable(rlc_um_nr_pdu_test rlc_um_nr_pdu_test.cc) +target_link_libraries(rlc_um_nr_pdu_test srslte_upper srslte_phy) +add_nr_test(rlc_um_nr_pdu_test rlc_um_nr_pdu_test) - add_executable(rlc_um_nr_test rlc_um_nr_test.cc) - target_link_libraries(rlc_um_nr_test srslte_upper srslte_phy) - add_nr_test(rlc_um_nr_test rlc_um_nr_test) +add_executable(rlc_um_nr_test rlc_um_nr_test.cc) +target_link_libraries(rlc_um_nr_test srslte_upper srslte_phy) +add_nr_test(rlc_um_nr_test rlc_um_nr_test) - add_executable(pdcp_nr_test_tx pdcp_nr_test_tx.cc) - target_link_libraries(pdcp_nr_test_tx srslte_upper srslte_common) - add_nr_test(pdcp_nr_test_tx pdcp_nr_test_tx) +add_executable(pdcp_nr_test_tx pdcp_nr_test_tx.cc) +target_link_libraries(pdcp_nr_test_tx srslte_upper srslte_common) +add_nr_test(pdcp_nr_test_tx pdcp_nr_test_tx) - add_executable(pdcp_nr_test_rx pdcp_nr_test_rx.cc) - target_link_libraries(pdcp_nr_test_rx srslte_upper srslte_common) - add_nr_test(pdcp_nr_test_rx pdcp_nr_test_rx) +add_executable(pdcp_nr_test_rx pdcp_nr_test_rx.cc) +target_link_libraries(pdcp_nr_test_rx srslte_upper srslte_common) +add_nr_test(pdcp_nr_test_rx pdcp_nr_test_rx) - add_executable(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu.cc) - target_link_libraries(pdcp_nr_test_discard_sdu srslte_upper srslte_common) - add_nr_test(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu) -endif(ENABLE_5GNR) +add_executable(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu.cc) +target_link_libraries(pdcp_nr_test_discard_sdu srslte_upper srslte_common) +add_nr_test(pdcp_nr_test_discard_sdu pdcp_nr_test_discard_sdu) add_executable(pdcp_lte_test_rx pdcp_lte_test_rx.cc) target_link_libraries(pdcp_lte_test_rx srslte_upper srslte_common) diff --git a/srsenb/src/CMakeLists.txt b/srsenb/src/CMakeLists.txt index 955067692..376e9d6f2 100644 --- a/srsenb/src/CMakeLists.txt +++ b/srsenb/src/CMakeLists.txt @@ -28,10 +28,8 @@ add_executable(srsenb main.cc enb.cc metrics_stdout.cc metrics_csv.cc metrics_js set(SRSENB_SOURCES srsenb_phy srsenb_stack srsenb_upper srsenb_mac srsenb_rrc srslog) set(SRSLTE_SOURCES srslte_common srslte_mac srslte_phy srslte_upper srslte_radio rrc_asn1 s1ap_asn1 enb_cfg_parser srslog) -if(ENABLE_5GNR) - set(SRSENB_SOURCES ${SRSENB_SOURCES} srsgnb_phy srsgnb_stack srsgnb_upper srsgnb_mac srsgnb_rrc) - set(SRSLTE_SOURCES ${SRSLTE_SOURCES} rrc_nr_asn1 ngap_nr_asn1) -endif() +set(SRSENB_SOURCES ${SRSENB_SOURCES} srsgnb_phy srsgnb_stack srsgnb_upper srsgnb_mac srsgnb_rrc) +set(SRSLTE_SOURCES ${SRSLTE_SOURCES} rrc_nr_asn1 ngap_nr_asn1) target_link_libraries(srsenb ${SRSENB_SOURCES} ${SRSLTE_SOURCES} diff --git a/srsenb/src/enb.cc b/srsenb/src/enb.cc index 4ffdc44b3..1aa2546f7 100644 --- a/srsenb/src/enb.cc +++ b/srsenb/src/enb.cc @@ -16,10 +16,8 @@ #include "srslte/build_info.h" #include "srslte/common/enb_events.h" #include "srslte/radio/radio_null.h" -#ifdef HAVE_5GNR #include "srsenb/hdr/phy/vnf_phy_nr.h" #include "srsenb/hdr/stack/gnb_stack_nr.h" -#endif #include namespace srsenb { @@ -101,7 +99,6 @@ int enb::init(const all_args_t& args_, srslte::logger* logger_) radio = std::move(lte_radio); } else if (args.stack.type == "nr") { -#ifdef HAVE_5GNR std::unique_ptr nr_stack(new srsenb::gnb_stack_nr(logger)); std::unique_ptr nr_radio(new srslte::radio_null); std::unique_ptr nr_phy(new srsenb::vnf_phy_nr); @@ -135,10 +132,6 @@ int enb::init(const all_args_t& args_, srslte::logger* logger_) stack = std::move(nr_stack); phy = std::move(nr_phy); radio = std::move(nr_radio); -#else - srslte::console("ERROR: 5G NR stack not compiled. Please, activate CMAKE HAVE_5GNR flag.\n"); - enb_log.error("5G NR stack not compiled. Please, activate CMAKE HAVE_5GNR flag."); -#endif } started = true; // set to true in any case to allow stopping the eNB if an error happened diff --git a/srsenb/src/phy/CMakeLists.txt b/srsenb/src/phy/CMakeLists.txt index b7d400e3b..6742d8110 100644 --- a/srsenb/src/phy/CMakeLists.txt +++ b/srsenb/src/phy/CMakeLists.txt @@ -20,10 +20,8 @@ set(SOURCES txrx.cc) add_library(srsenb_phy STATIC ${SOURCES}) +add_library(srsgnb_phy STATIC vnf_phy_nr.cc) + if(ENABLE_GUI AND SRSGUI_FOUND) target_link_libraries(srsenb_phy ${SRSGUI_LIBRARIES}) endif(ENABLE_GUI AND SRSGUI_FOUND) - -if(ENABLE_5GNR) - add_library(srsgnb_phy STATIC vnf_phy_nr.cc) -endif() \ No newline at end of file diff --git a/srsenb/src/stack/CMakeLists.txt b/srsenb/src/stack/CMakeLists.txt index 391f72077..48f42528c 100644 --- a/srsenb/src/stack/CMakeLists.txt +++ b/srsenb/src/stack/CMakeLists.txt @@ -15,7 +15,5 @@ set(SOURCES enb_stack_lte.cc) add_library(srsenb_stack STATIC ${SOURCES}) target_link_libraries(srsenb_stack) -if(ENABLE_5GNR) - add_library(srsgnb_stack STATIC gnb_stack_nr.cc) - target_link_libraries(srsgnb_stack srsue_upper) -endif() +add_library(srsgnb_stack STATIC gnb_stack_nr.cc) +target_link_libraries(srsgnb_stack srsue_upper) diff --git a/srsenb/src/stack/mac/CMakeLists.txt b/srsenb/src/stack/mac/CMakeLists.txt index 85452ab11..ffda50810 100644 --- a/srsenb/src/stack/mac/CMakeLists.txt +++ b/srsenb/src/stack/mac/CMakeLists.txt @@ -12,7 +12,5 @@ set(SOURCES mac.cc ue.cc sched.cc sched_carrier.cc sched_grid.cc sched_ue_ctrl/s sched_ue_ctrl/sched_lch.cc sched_ue_ctrl/sched_ue_cell.cc sched_phy_ch/sf_cch_allocator.cc sched_helpers.cc) add_library(srsenb_mac STATIC ${SOURCES} $) -if(ENABLE_5GNR) - set(SOURCES mac_nr.cc) - add_library(srsgnb_mac STATIC ${SOURCES}) -endif() +set(SOURCES mac_nr.cc) +add_library(srsgnb_mac STATIC ${SOURCES}) diff --git a/srsenb/src/stack/rrc/CMakeLists.txt b/srsenb/src/stack/rrc/CMakeLists.txt index f955c1dfd..d6ba7f7f5 100644 --- a/srsenb/src/stack/rrc/CMakeLists.txt +++ b/srsenb/src/stack/rrc/CMakeLists.txt @@ -9,7 +9,5 @@ set(SOURCES rrc.cc rrc_ue.cc rrc_mobility.cc rrc_cell_cfg.cc rrc_bearer_cfg.cc mac_controller.cc ue_rr_cfg.cc ue_meas_cfg.cc) add_library(srsenb_rrc STATIC ${SOURCES}) -if (ENABLE_5GNR) - set(SOURCES rrc_nr.cc) - add_library(srsgnb_rrc STATIC ${SOURCES}) -endif () +set(SOURCES rrc_nr.cc) +add_library(srsgnb_rrc STATIC ${SOURCES}) diff --git a/srsenb/src/stack/upper/CMakeLists.txt b/srsenb/src/stack/upper/CMakeLists.txt index 4a64a4936..6e478ad0e 100644 --- a/srsenb/src/stack/upper/CMakeLists.txt +++ b/srsenb/src/stack/upper/CMakeLists.txt @@ -9,8 +9,5 @@ set(SOURCES gtpu.cc pdcp.cc rlc.cc s1ap.cc) add_library(srsenb_upper STATIC ${SOURCES}) -if(ENABLE_5GNR) - set(SOURCES pdcp_nr.cc rlc_nr.cc sdap.cc) - add_library(srsgnb_upper STATIC ${SOURCES}) -endif() - +set(SOURCES pdcp_nr.cc rlc_nr.cc sdap.cc) +add_library(srsgnb_upper STATIC ${SOURCES}) diff --git a/srsenb/test/rrc/CMakeLists.txt b/srsenb/test/rrc/CMakeLists.txt index cbc2d465a..9e4f07e5f 100644 --- a/srsenb/test/rrc/CMakeLists.txt +++ b/srsenb/test/rrc/CMakeLists.txt @@ -6,8 +6,7 @@ # the distribution. # -if (ENABLE_5GNR) - add_executable(rrc_nr_test rrc_nr_test.cc) - target_link_libraries(rrc_nr_test srsgnb_rrc srslte_common rrc_nr_asn1) - add_test(rrc_nr_test rrc_nr_test) -endif () +add_executable(rrc_nr_test rrc_nr_test.cc) +target_link_libraries(rrc_nr_test srsgnb_rrc srslte_common rrc_nr_asn1) +add_test(rrc_nr_test rrc_nr_test) + diff --git a/srsue/hdr/phy/phy.h b/srsue/hdr/phy/phy.h index 48430c9f1..7101e4d42 100644 --- a/srsue/hdr/phy/phy.h +++ b/srsue/hdr/phy/phy.h @@ -67,9 +67,7 @@ private: }; class phy final : public ue_lte_phy_base, -#if HAVE_5GNR public ue_nr_phy_base, -#endif // HAVE_5GNR public srslte::thread { public: @@ -175,7 +173,6 @@ public: std::string get_type() final { return "lte_soft"; } -#ifdef HAVE_5GNR int init(const phy_args_nr_t& args_, stack_interface_phy_nr* stack_, srslte::radio_interface_phy* radio_) final; bool set_config(const srslte::phy_cfg_nr_t& cfg) final; int set_ul_grant(std::array packed_ul_grant) final; @@ -185,7 +182,6 @@ public: const float ta_base_sec = 0.0f) final; int tx_request(const tx_request_t& request) final; void set_earfcn(std::vector earfcns) final; -#endif // HAVE_5GNR private: void run_thread() final; diff --git a/srsue/hdr/stack/rrc/rrc.h b/srsue/hdr/stack/rrc/rrc.h index f64585b9a..755e3093f 100644 --- a/srsue/hdr/stack/rrc/rrc.h +++ b/srsue/hdr/stack/rrc/rrc.h @@ -63,9 +63,7 @@ class rrc : public rrc_interface_nas, public rrc_interface_phy_lte, public rrc_interface_mac, public rrc_interface_pdcp, -#ifdef HAVE_5GNR public rrc_eutra_interface_rrc_nr, -#endif public rrc_interface_rlc, public srslte::timer_callback { @@ -80,9 +78,7 @@ public: nas_interface_rrc* nas_, usim_interface_rrc* usim_, gw_interface_rrc* gw_, -#ifdef HAVE_5GNR rrc_nr_interface_rrc* rrc_nr_, -#endif const rrc_args_t& args_); void stop(); @@ -117,10 +113,8 @@ public: bool has_nr_dc(); // NR interface -#ifdef HAVE_5GNR void new_cell_meas_nr(const std::vector& meas); void nr_rrc_con_reconfig_complete(bool status); -#endif // PHY interface void in_sync() final; @@ -157,9 +151,7 @@ protected: bool is_serving_cell(uint32_t earfcn, uint32_t pci) const; int start_cell_select(); -#ifdef HAVE_5GNR bool has_neighbour_cell_nr(uint32_t earfcn, uint32_t pci) const; -#endif private: typedef struct { @@ -183,9 +175,7 @@ private: nas_interface_rrc* nas = nullptr; usim_interface_rrc* usim = nullptr; gw_interface_rrc* gw = nullptr; -#ifdef HAVE_5GNR rrc_nr_interface_rrc* rrc_nr = nullptr; -#endif srslte::unique_byte_buffer_t dedicated_info_nas; void send_ul_ccch_msg(const asn1::rrc::ul_ccch_msg_s& msg); @@ -254,9 +244,7 @@ private: using unique_cell_t = std::unique_ptr; meas_cell_list meas_cells; -#ifdef HAVE_5GNR meas_cell_list meas_cells_nr; -#endif bool initiated = false; asn1::rrc::reest_cause_e m_reest_cause = asn1::rrc::reest_cause_e::nulltype; @@ -272,21 +260,17 @@ private: float get_cell_rsrq(const uint32_t earfcn, const uint32_t pci); meas_cell_eutra* get_serving_cell(); -#ifdef HAVE_5GNR std::set get_cells_nr(const uint32_t arfcn_nr); float get_cell_rsrp_nr(const uint32_t arfcn_nr, const uint32_t pci_nr); float get_cell_rsrq_nr(const uint32_t arfcn_nr, const uint32_t pci_nr); -#endif void process_cell_meas(); void process_new_cell_meas(const std::vector& meas); srslte::block_queue > cell_meas_q; -#ifdef HAVE_5GNR void process_cell_meas_nr(); void process_new_cell_meas_nr(const std::vector& meas); srslte::block_queue > cell_meas_nr_q; -#endif // Cell selection/reselection functions/variables typedef struct { @@ -415,9 +399,7 @@ private: void set_mac_default(); void set_rrc_default(); -#ifdef HAVE_5GNR bool nr_reconfiguration_proc(const asn1::rrc::rrc_conn_recfg_r8_ies_s& rx_recfg); -#endif // Helpers for nr communicaiton asn1::rrc::ue_cap_rat_container_s get_eutra_nr_capabilities(); diff --git a/srsue/hdr/stack/rrc/rrc_cell.h b/srsue/hdr/stack/rrc/rrc_cell.h index c8a726560..003fe3e39 100644 --- a/srsue/hdr/stack/rrc/rrc_cell.h +++ b/srsue/hdr/stack/rrc/rrc_cell.h @@ -15,10 +15,8 @@ #include "srslte/asn1/rrc.h" #include "srslte/asn1/rrc_utils.h" -#if HAVE_5GNR #include "srslte/asn1/rrc_nr.h" #include "srslte/asn1/rrc_nr_utils.h" -#endif #include "srslte/interfaces/ue_interfaces.h" #include "srslte/srslog/srslog.h" @@ -106,7 +104,6 @@ protected: std::map sib_info_map; ///< map of sib_index to index of schedInfoList in SIB1 }; -#ifdef HAVE_5GNR class meas_cell_nr : public meas_cell { public: @@ -138,7 +135,6 @@ public: asn1::rrc_nr::sib3_s sib3 = {}; asn1::rrc::mcch_msg_s mcch = {}; }; -#endif class meas_cell_eutra : public meas_cell { @@ -193,13 +189,11 @@ inline uint32_t get_pci(const meas_cell_eutra& t) { return t.get_pci(); } -#ifdef HAVE_5GNR template <> inline uint32_t get_pci(const meas_cell_nr& t) { return t.get_pci(); } -#endif template uint32_t get_earfcn(const T& t) { @@ -210,13 +204,11 @@ inline uint32_t get_earfcn(const meas_cell_eutra& t) { return t.get_earfcn(); } -#ifdef HAVE_5GNR template <> inline uint32_t get_earfcn(const meas_cell_nr& t) { return t.get_earfcn(); } -#endif template bool is_same_cell(const T& lhs, const U& rhs) { diff --git a/srsue/hdr/stack/rrc/rrc_meas.h b/srsue/hdr/stack/rrc/rrc_meas.h index 65fbbe0ba..cf54722c2 100644 --- a/srsue/hdr/stack/rrc/rrc_meas.h +++ b/srsue/hdr/stack/rrc/rrc_meas.h @@ -79,9 +79,7 @@ private: private: void generate_report_eutra(meas_results_s* report, const uint32_t measId); -#ifdef HAVE_5GNR void generate_report_interrat(meas_results_s* report, const uint32_t measId); -#endif class var_meas_report { public: @@ -149,7 +147,6 @@ private: void report_triggers_eutra_check_new(int32_t meas_id, report_cfg_eutra_s& report_cfg, meas_obj_eutra_s& meas_obj); void report_triggers_eutra_check_leaving(int32_t meas_id, report_cfg_eutra_s& report_cfg); void report_triggers_eutra_removing_trigger(int32_t meas_id); -#ifdef HAVE_5GNR void eval_triggers_interrat_nr(uint32_t meas_id, report_cfg_inter_rat_s& report_cfg, meas_obj_nr_r15_s& meas_obj); void report_triggers_interrat_nr(uint32_t meas_id, report_cfg_inter_rat_s& report_cfg, meas_obj_nr_r15_s& meas_obj); void report_triggers_interrat_check_new(int32_t meas_id, @@ -157,7 +154,6 @@ private: meas_obj_nr_r15_s& meas_obj); void report_triggers_interrat_check_leaving(int32_t meas_id, report_cfg_inter_rat_s& report_cfg); void report_triggers_interrat_removing_trigger(int32_t meas_id); -#endif class cell_trigger_state { @@ -183,9 +179,7 @@ private: // It is safe to use [] operator in this double-map because all members are uint32_t std::map > trigger_state; -#ifdef HAVE_5GNR std::map > trigger_state_nr; -#endif var_meas_report_list* meas_report = nullptr; srslog::basic_logger& logger; diff --git a/srsue/hdr/stack/ue_stack_lte.h b/srsue/hdr/stack/ue_stack_lte.h index b5c606af2..43eda0bb8 100644 --- a/srsue/hdr/stack/ue_stack_lte.h +++ b/srsue/hdr/stack/ue_stack_lte.h @@ -46,9 +46,7 @@ namespace srsue { class ue_stack_lte final : public ue_stack_base, public stack_interface_phy_lte, -#ifdef HAVE_5GNR public stack_interface_phy_nr, -#endif public stack_interface_gw, public stack_interface_rrc, public srslte::thread @@ -61,13 +59,11 @@ public: int init(const stack_args_t& args_, srslte::logger* logger_); int init(const stack_args_t& args_, srslte::logger* logger_, phy_interface_stack_lte* phy_, gw_interface_stack* gw_); -#ifdef HAVE_5GNR int init(const stack_args_t& args_, srslte::logger* logger_, phy_interface_stack_lte* phy_, phy_interface_stack_nr* phy_nr_, gw_interface_stack* gw_); -#endif bool switch_on() final; bool switch_off() final; bool is_registered() final; @@ -123,7 +119,6 @@ public: void run_tti(uint32_t tti, uint32_t tti_jump) final; -#ifdef HAVE_5GNR // MAC Interface for NR PHY int sf_indication(const uint32_t tti) final { return SRSLTE_SUCCESS; } void tb_decoded(const uint32_t cc_idx, mac_nr_grant_dl_t& grant) final { mac_nr.tb_decoded(cc_idx, grant); } @@ -139,7 +134,6 @@ public: { mac_nr.prach_sent(tti, s_id, t_id, f_id, ul_carrier_id); } -#endif // Interface for GW void write_sdu(uint32_t lcid, srslte::unique_byte_buffer_t sdu) final; @@ -184,9 +178,7 @@ private: // RAT-specific interfaces phy_interface_stack_lte* phy = nullptr; gw_interface_stack* gw = nullptr; -#ifdef HAVE_5GNR - phy_interface_stack_nr* phy_nr = nullptr; -#endif + phy_interface_stack_nr* phy_nr = nullptr; // Thread static const int STACK_MAIN_THREAD_PRIO = 4; // Next lower priority after PHY workers @@ -204,10 +196,8 @@ private: srslte::rlc rlc; srslte::pdcp pdcp; srsue::rrc rrc; -#ifdef HAVE_5GNR srsue::mac_nr mac_nr; srsue::rrc_nr rrc_nr; -#endif srsue::nas nas; std::unique_ptr usim; diff --git a/srsue/src/CMakeLists.txt b/srsue/src/CMakeLists.txt index 83dc46b21..6266394a6 100644 --- a/srsue/src/CMakeLists.txt +++ b/srsue/src/CMakeLists.txt @@ -23,10 +23,8 @@ add_executable(srsue main.cc ue.cc metrics_stdout.cc metrics_csv.cc) set(SRSUE_SOURCES srsue_phy srsue_stack srsue_upper srsue_mac srsue_rrc srslog) set(SRSLTE_SOURCES srslte_common srslte_mac srslte_phy srslte_radio srslte_upper rrc_asn1 srslog) -if(ENABLE_5GNR) - set(SRSUE_SOURCES ${SRSUE_SOURCES} srsue_nr_stack srsue_rrc_nr srsue_mac_nr) - set(SRSLTE_SOURCES ${SRSLTE_SOURCES} rrc_nr_asn1 ngap_nr_asn1) -endif() +set(SRSUE_SOURCES ${SRSUE_SOURCES} srsue_nr_stack srsue_rrc_nr srsue_mac_nr) +set(SRSLTE_SOURCES ${SRSLTE_SOURCES} rrc_nr_asn1 ngap_nr_asn1) target_link_libraries(srsue ${SRSUE_SOURCES} ${SRSLTE_SOURCES} diff --git a/srsue/src/phy/CMakeLists.txt b/srsue/src/phy/CMakeLists.txt index eee1d8b51..ca81af0d7 100644 --- a/srsue/src/phy/CMakeLists.txt +++ b/srsue/src/phy/CMakeLists.txt @@ -13,7 +13,5 @@ if(ENABLE_GUI AND SRSGUI_FOUND) target_link_libraries(srsue_phy ${SRSGUI_LIBRARIES}) endif(ENABLE_GUI AND SRSGUI_FOUND) -if(ENABLE_5GNR) set(SOURCES_NR "../phy/vnf_phy_nr.cc") add_library(srsue_phy_nr STATIC ${SOURCES_NR}) -endif() \ No newline at end of file diff --git a/srsue/src/phy/nr/sf_worker.cc b/srsue/src/phy/nr/sf_worker.cc index a17216eec..4133a832b 100644 --- a/srsue/src/phy/nr/sf_worker.cc +++ b/srsue/src/phy/nr/sf_worker.cc @@ -190,4 +190,4 @@ static void init_plots(srsue::nr::sf_worker* worker) exit(-1); } } -#endif \ No newline at end of file +#endif diff --git a/srsue/src/phy/phy.cc b/srsue/src/phy/phy.cc index c4bd484e2..cb10a171d 100644 --- a/srsue/src/phy/phy.cc +++ b/srsue/src/phy/phy.cc @@ -605,7 +605,6 @@ void phy::set_mch_period_stop(uint32_t stop) common.set_mch_period_stop(stop); } -#ifdef HAVE_5GNR int phy::init(const phy_args_nr_t& args_, stack_interface_phy_nr* stack_, srslte::radio_interface_phy* radio_) { if (!nr_workers.init(args_, &common, stack_, log_sink, WORKERS_THREAD_PRIO)) { @@ -642,6 +641,5 @@ bool phy::set_config(const srslte::phy_cfg_nr_t& cfg) { return nr_workers.set_config(cfg); } -#endif // HAVE_5GNR } // namespace srsue diff --git a/srsue/src/stack/CMakeLists.txt b/srsue/src/stack/CMakeLists.txt index f1e9941d5..f08912efc 100644 --- a/srsue/src/stack/CMakeLists.txt +++ b/srsue/src/stack/CMakeLists.txt @@ -13,8 +13,6 @@ add_subdirectory(upper) set(SOURCES ue_stack_lte.cc) add_library(srsue_stack STATIC ${SOURCES}) -if(ENABLE_5GNR) - add_subdirectory(mac_nr) - set(SOURCES ue_stack_nr.cc) - add_library(srsue_nr_stack STATIC ${SOURCES}) -endif() \ No newline at end of file +add_subdirectory(mac_nr) +set(SOURCES ue_stack_nr.cc) +add_library(srsue_nr_stack STATIC ${SOURCES}) diff --git a/srsue/src/stack/rrc/CMakeLists.txt b/srsue/src/stack/rrc/CMakeLists.txt index 91a1a3633..d51065957 100644 --- a/srsue/src/stack/rrc/CMakeLists.txt +++ b/srsue/src/stack/rrc/CMakeLists.txt @@ -6,15 +6,8 @@ # the distribution. # -set(SOURCES rrc.cc rrc_procedures.cc rrc_meas.cc rrc_cell.cc phy_controller.cc) - -if(ENABLE_5GNR) - set(SOURCES ${SOURCES} rrc_nr.cc) -endif() +set(SOURCES rrc.cc rrc_nr.cc rrc_procedures.cc rrc_meas.cc rrc_cell.cc phy_controller.cc) add_library(srsue_rrc STATIC ${SOURCES}) +add_library(srsue_rrc_nr STATIC ${SOURCES}) -if(ENABLE_5GNR) - set(SOURCES rrc_nr.cc) - add_library(srsue_rrc_nr STATIC ${SOURCES}) -endif() diff --git a/srsue/src/stack/rrc/rrc.cc b/srsue/src/stack/rrc/rrc.cc index 450dbb965..77b9664e0 100644 --- a/srsue/src/stack/rrc/rrc.cc +++ b/srsue/src/stack/rrc/rrc.cc @@ -61,9 +61,7 @@ rrc::rrc(stack_interface_rrc* stack_, srslte::task_sched_handle task_sched_) : connection_reest(this), ho_handler(this), conn_recfg_proc(this), -#ifdef HAVE_5GNR meas_cells_nr(task_sched_), -#endif meas_cells(task_sched_) {} @@ -99,9 +97,7 @@ void rrc::init(phy_interface_rrc_lte* phy_, nas_interface_rrc* nas_, usim_interface_rrc* usim_, gw_interface_rrc* gw_, -#ifdef HAVE_5GNR rrc_nr_interface_rrc* rrc_nr_, -#endif const rrc_args_t& args_) { phy = phy_; @@ -111,9 +107,7 @@ void rrc::init(phy_interface_rrc_lte* phy_, nas = nas_; usim = usim_; gw = gw_; -#ifdef HAVE_5GNR rrc_nr = rrc_nr_; -#endif args = args_; auto on_every_cell_selection = [this](uint32_t earfcn, uint32_t pci, bool csel_result) { @@ -215,9 +209,7 @@ void rrc::run_tti() // Process pending PHY measurements in IDLE/CONNECTED process_cell_meas(); -#ifdef HAVE_5GNR process_cell_meas_nr(); -#endif // Process on-going callbacks, and clear finished callbacks callback_list.run(); @@ -374,7 +366,6 @@ void rrc::set_config_complete(bool status) void rrc::set_scell_complete(bool status) {} -#ifdef HAVE_5GNR /* This function is called from a NR PHY worker thus must return very quickly. * Queue the values of the measurements and process them from the RRC thread */ @@ -426,7 +417,6 @@ void rrc::nr_rrc_con_reconfig_complete(bool status) conn_recfg_proc.trigger(status); } } -#endif /* This function is called from a PHY worker thus must return very quickly. * Queue the values of the measurements and process them from the RRC thread @@ -579,12 +569,10 @@ bool rrc::has_neighbour_cell(uint32_t earfcn, uint32_t pci) const return meas_cells.has_neighbour_cell(earfcn, pci); } -#ifdef HAVE_5GNR bool rrc::has_neighbour_cell_nr(uint32_t earfcn, uint32_t pci) const { return meas_cells_nr.has_neighbour_cell(earfcn, pci); } -#endif bool rrc::is_serving_cell(uint32_t earfcn, uint32_t pci) const { @@ -757,7 +745,6 @@ void rrc::timer_expired(uint32_t timeout_id) } } -#ifdef HAVE_5GNR bool rrc::nr_reconfiguration_proc(const rrc_conn_recfg_r8_ies_s& rx_recfg) { if (!(rx_recfg.non_crit_ext_present && rx_recfg.non_crit_ext.non_crit_ext_present && @@ -812,7 +799,6 @@ bool rrc::nr_reconfiguration_proc(const rrc_conn_recfg_r8_ies_s& rx_recfg) nr_radio_bearer_cfg1_r15_present, nr_radio_bearer_cfg1_r15); } -#endif /******************************************************************************* * * @@ -1215,7 +1201,6 @@ meas_cell_eutra* rrc::get_serving_cell() return &meas_cells.serving_cell(); } -#ifdef HAVE_5GNR std::set rrc::get_cells_nr(const uint32_t arfcn_nr) { return meas_cells_nr.get_neighbour_pcis(arfcn_nr); @@ -1232,7 +1217,6 @@ float rrc::get_cell_rsrq_nr(const uint32_t arfcn_nr, const uint32_t pci_nr) meas_cell_nr* c = meas_cells_nr.get_neighbour_cell_handle(arfcn_nr, pci_nr); return (c != nullptr) ? c->get_rsrq() : NAN; } -#endif /******************************************************************************* * @@ -2074,7 +2058,6 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) rat_idx++; } -#ifdef HAVE_5GNR else if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().ue_cap_request[i] == rat_type_e::eutra_nr && has_nr_dc()) { info->ue_cap_rat_container_list[rat_idx] = get_eutra_nr_capabilities(); logger.info("Including EUTRA-NR capabilities in UE Capability Info (%d B)", @@ -2086,7 +2069,6 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) info->ue_cap_rat_container_list[rat_idx].ue_cap_rat_container.size()); rat_idx++; } -#endif else { logger.error("RAT Type of UE Cap request not supported or not configured"); } @@ -2094,7 +2076,6 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) // resize container back to the actually filled items info->ue_cap_rat_container_list.resize(rat_idx); -#ifdef HAVE_5GNR if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().non_crit_ext_present) { if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().non_crit_ext.non_crit_ext_present) { if (enquiry.crit_exts.c1().ue_cap_enquiry_r8().non_crit_ext.non_crit_ext.non_crit_ext_present) { @@ -2113,7 +2094,6 @@ void rrc::handle_ue_capability_enquiry(const ue_cap_enquiry_s& enquiry) } } } -#endif send_ul_dcch_msg(RB_ID_SRB1, ul_dcch_msg); } @@ -2693,10 +2673,8 @@ uint32_t rrc::get_drb_id_for_eps_bearer(const uint32_t& eps_bearer_id) bool rrc::has_nr_dc() { bool has_nr_dc = false; -#ifdef HAVE_5GNR if (args.release >= 15) has_nr_dc = true; -#endif return has_nr_dc; } @@ -2745,11 +2723,7 @@ asn1::rrc::ue_cap_rat_container_s rrc::get_eutra_nr_capabilities() { srslte::byte_buffer_t caps_buf; asn1::rrc::ue_cap_rat_container_s cap; -#ifdef HAVE_5GNR rrc_nr->get_eutra_nr_capabilities(&caps_buf); -#else - logger.error("Not able to access get_eutra_nr_capabilities function"); -#endif cap.rat_type = asn1::rrc::rat_type_e::eutra_nr; cap.ue_cap_rat_container.resize(caps_buf.N_bytes); memcpy(cap.ue_cap_rat_container.data(), caps_buf.msg, caps_buf.N_bytes); @@ -2760,11 +2734,7 @@ asn1::rrc::ue_cap_rat_container_s rrc::get_nr_capabilities() { srslte::byte_buffer_t caps_buf; asn1::rrc::ue_cap_rat_container_s cap; -#ifdef HAVE_5GNR rrc_nr->get_nr_capabilities(&caps_buf); -#else - logger.error("Not able to access get_nr_capabilities function"); -#endif cap.rat_type = asn1::rrc::rat_type_e::nr; cap.ue_cap_rat_container.resize(caps_buf.N_bytes); memcpy(cap.ue_cap_rat_container.data(), caps_buf.msg, caps_buf.N_bytes); diff --git a/srsue/src/stack/rrc/rrc_cell.cc b/srsue/src/stack/rrc/rrc_cell.cc index 341f0510e..b525e3759 100644 --- a/srsue/src/stack/rrc/rrc_cell.cc +++ b/srsue/src/stack/rrc/rrc_cell.cc @@ -94,7 +94,6 @@ bool meas_cell::has_sib(uint32_t index) const return false; } -#ifdef HAVE_5GNR std::string meas_cell_nr::to_string() const { char buf[256]; @@ -108,7 +107,6 @@ std::string meas_cell_nr::to_string() const get_cfo_hz()); return std::string{buf}; } -#endif std::string meas_cell_eutra::to_string() const { @@ -426,8 +424,6 @@ bool meas_cell_list::process_new_cell_meas(const std::vector& } template class meas_cell_list; -#ifdef HAVE_5GNR template class meas_cell_list; -#endif } // namespace srsue diff --git a/srsue/src/stack/rrc/rrc_meas.cc b/srsue/src/stack/rrc/rrc_meas.cc index 67ed7ecf2..64454a554 100644 --- a/srsue/src/stack/rrc/rrc_meas.cc +++ b/srsue/src/stack/rrc/rrc_meas.cc @@ -73,9 +73,7 @@ void rrc::rrc_meas::update_phy() { std::list objects = meas_cfg.get_active_objects(); rrc_ptr->phy->meas_stop(); -#ifdef HAVE_5GNR rrc_ptr->rrc_nr->phy_meas_stop(); -#endif for (const auto& obj : objects) { switch (obj.meas_obj.type().value) { case meas_obj_to_add_mod_s::meas_obj_c_::types_opts::meas_obj_eutra: { @@ -87,12 +85,10 @@ void rrc::rrc_meas::update_phy() rrc_ptr->phy->set_cells_to_meas(obj.meas_obj.meas_obj_eutra().carrier_freq, neighbour_pcis); break; } -#ifdef HAVE_5GNR case meas_obj_to_add_mod_s::meas_obj_c_::types_opts::meas_obj_nr_r15: { rrc_ptr->rrc_nr->phy_set_cells_to_meas(obj.meas_obj.meas_obj_nr_r15().carrier_freq_r15); break; } -#endif default: logger.error("Not supported"); break; @@ -348,7 +344,6 @@ void rrc::rrc_meas::var_meas_report_list::generate_report_eutra(meas_results_s* } } } -#ifdef HAVE_5GNR void rrc::rrc_meas::var_meas_report_list::generate_report_interrat(meas_results_s* report, const uint32_t measId) { @@ -432,7 +427,6 @@ void rrc::rrc_meas::var_meas_report_list::generate_report_interrat(meas_results_ } } } -#endif /* Generate report procedure 5.5.5 */ void rrc::rrc_meas::var_meas_report_list::generate_report(const uint32_t measId) { @@ -467,13 +461,11 @@ void rrc::rrc_meas::var_meas_report_list::generate_report(const uint32_t measId) generate_report_eutra(report, measId); break; } -#ifdef HAVE_5GNR case inter_rat: { logger.debug("MEAS: Generate INTER RAT NR report"); generate_report_interrat(report, measId); break; } -#endif default: logger.debug("MEAS: Not supported"); break; @@ -666,7 +658,6 @@ void rrc::rrc_meas::var_meas_cfg::report_triggers_eutra(uint32_t meas } } -#ifdef HAVE_5GNR void rrc::rrc_meas::var_meas_cfg::report_triggers_interrat_check_new(int32_t meas_id, report_cfg_inter_rat_s& report_cfg, meas_obj_nr_r15_s& meas_obj) @@ -757,7 +748,6 @@ void rrc::rrc_meas::var_meas_cfg::report_triggers_interrat_nr(uint32_t report_triggers_interrat_removing_trigger(meas_id); } } -#endif void rrc::rrc_meas::var_meas_cfg::report_triggers() { // for each measId included in the measIdList within VarMeasConfig @@ -782,14 +772,12 @@ void rrc::rrc_meas::var_meas_cfg::report_triggers() report_cfg.report_cfg.type().value == report_cfg_to_add_mod_s::report_cfg_c_::types::report_cfg_eutra) { report_triggers_eutra(m.first, report_cfg.report_cfg.report_cfg_eutra(), meas_obj.meas_obj.meas_obj_eutra()); } -#ifdef HAVE_5GNR else if (meas_obj.meas_obj.type().value == meas_obj_to_add_mod_s::meas_obj_c_::types_opts::meas_obj_nr_r15 && report_cfg.report_cfg.type().value == report_cfg_to_add_mod_s::report_cfg_c_::types::report_cfg_inter_rat) { report_triggers_interrat_nr( m.first, report_cfg.report_cfg.report_cfg_inter_rat(), meas_obj.meas_obj.meas_obj_nr_r15()); } -#endif else { logger.error("Unsupported combination of measurement object type %s and report config type %s ", meas_obj.meas_obj.type().to_string().c_str(), @@ -936,7 +924,6 @@ void rrc::rrc_meas::var_meas_cfg::eval_triggers_eutra(uint32_t meas_i } } -#ifdef HAVE_5GNR void rrc::rrc_meas::var_meas_cfg::eval_triggers_interrat_nr(uint32_t meas_id, report_cfg_inter_rat_s& report_cfg, meas_obj_nr_r15_s& meas_obj) @@ -983,7 +970,6 @@ void rrc::rrc_meas::var_meas_cfg::eval_triggers_interrat_nr(uint32_t exit_condition); } } -#endif /* Evaluate event trigger conditions for each cell 5.5.4 */ void rrc::rrc_meas::var_meas_cfg::eval_triggers() { @@ -1032,12 +1018,10 @@ void rrc::rrc_meas::var_meas_cfg::eval_triggers() eval_triggers_eutra( m.first, report_cfg.report_cfg.report_cfg_eutra(), meas_obj.meas_obj.meas_obj_eutra(), serv_cell, Ofs, Ocs); } -#ifdef HAVE_5GNR else if (meas_obj.meas_obj.type().value == meas_obj_to_add_mod_s::meas_obj_c_::types_opts::meas_obj_nr_r15 && report_cfg.report_cfg.type().value == report_cfg_to_add_mod_s::report_cfg_c_::types::report_cfg_inter_rat) eval_triggers_interrat_nr( m.first, report_cfg.report_cfg.report_cfg_inter_rat(), meas_obj.meas_obj.meas_obj_nr_r15()); -#endif else { logger.error("Unsupported combination of measurement object type %s and report config type %s ", meas_obj.meas_obj.type().to_string().c_str(), diff --git a/srsue/src/stack/rrc/rrc_procedures.cc b/srsue/src/stack/rrc/rrc_procedures.cc index 9bad30f14..8b559412b 100644 --- a/srsue/src/stack/rrc/rrc_procedures.cc +++ b/srsue/src/stack/rrc/rrc_procedures.cc @@ -982,14 +982,12 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::init(const asn1::rrc:: } // Apply NR config -#ifdef HAVE_5GNR bool rtn = rrc_ptr->nr_reconfiguration_proc(rx_recfg); if (rtn == false) { rrc_ptr->logger.error("Can not launch NR RRC Reconfiguration procedure"); return proc_outcome_t::error; } has_5g_nr_reconfig = true; -#endif // No phy config was scheduled, run config completion immediately if (rrc_ptr->phy_ctrl->is_config_pending()) { @@ -1010,12 +1008,10 @@ srslte::proc_outcome_t rrc::connection_reconf_no_ho_proc::react(const bool& conf return proc_outcome_t::yield; } -#ifdef HAVE_5GNR // in case there is rrc_nr to configure, wait for rrc nr configuration if (has_5g_nr_reconfig == true && rrc_ptr->rrc_nr->is_config_pending()) { return proc_outcome_t::yield; } -#endif if (has_5g_nr_reconfig == true) { rrc_ptr->send_rrc_con_reconfig_complete(true); diff --git a/srsue/src/stack/ue_stack_lte.cc b/srsue/src/stack/ue_stack_lte.cc index de3e20887..56957d31f 100644 --- a/srsue/src/stack/ue_stack_lte.cc +++ b/srsue/src/stack/ue_stack_lte.cc @@ -38,10 +38,8 @@ ue_stack_lte::ue_stack_lte(srslog::sink& log_sink) : rlc("RLC"), mac("MAC", &task_sched), rrc(this, &task_sched), -#ifdef HAVE_5GNR mac_nr(&task_sched), rrc_nr(&task_sched), -#endif pdcp(&task_sched, "PDCP"), nas(&task_sched), thread("STACK"), @@ -65,7 +63,6 @@ std::string ue_stack_lte::get_type() return "lte"; } -#ifdef HAVE_5GNR int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_, phy_interface_stack_lte* phy_, @@ -78,7 +75,6 @@ int ue_stack_lte::init(const stack_args_t& args_, } return SRSLTE_SUCCESS; } -#endif int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_, @@ -158,11 +154,6 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_) pdcp.init(&rlc, &rrc, gw); nas.init(usim.get(), &rrc, gw, args.nas); -#ifdef HAVE_5GNR - if (phy_nr == nullptr) { - srslte::console("Failed to init as phy_nr is missing.\n"); - return SRSLTE_ERROR; - } mac_nr_args_t mac_nr_args = {}; mac_nr.init(mac_nr_args, phy_nr, &rlc); rrc_nr.init(phy_nr, @@ -176,9 +167,6 @@ int ue_stack_lte::init(const stack_args_t& args_, srslte::logger* logger_) nullptr, args.rrc_nr); rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, &rrc_nr, args.rrc); -#else - rrc.init(phy, &mac, &rlc, &pdcp, &nas, usim.get(), gw, args.rrc); -#endif running = true; start(STACK_MAIN_THREAD_PRIO); diff --git a/srsue/src/ue.cc b/srsue/src/ue.cc index d4777e20c..d9c6e31bd 100644 --- a/srsue/src/ue.cc +++ b/srsue/src/ue.cc @@ -19,10 +19,8 @@ #include "srslte/srslte.h" #include "srsue/hdr/phy/phy.h" #include "srsue/hdr/stack/ue_stack_lte.h" -#ifdef HAVE_5GNR #include "srsue/hdr/phy/vnf_phy_nr.h" #include "srsue/hdr/stack/ue_stack_nr.h" -#endif #include #include #include @@ -96,7 +94,6 @@ int ue::init(const all_args_t& args_, srslte::logger* logger_) ret = SRSLTE_ERROR; } -#ifdef HAVE_5GNR srsue::phy_args_nr_t phy_args_nr = {}; phy_args_nr.nof_prb = args.phy.nr_nof_prb; phy_args_nr.nof_carriers = args.phy.nof_nr_carriers; @@ -107,17 +104,11 @@ int ue::init(const all_args_t& args_, srslte::logger* logger_) srslte::console("Error initializing NR PHY.\n"); ret = SRSLTE_ERROR; } - if (lte_stack->init(args.stack, old_logger, lte_phy.get(), lte_phy.get(), gw_ptr.get())) { - srslte::console("Error initializing stack.\n"); - ret = SRSLTE_ERROR; - } -#else // HAVE_5GNR - if (lte_stack->init(args.stack, old_logger, lte_phy.get(), gw_ptr.get())) { + if (lte_stack->init(args.stack, old_logger, lte_phy.get(), lte_phy.get(), gw_ptr.get())) { srslte::console("Error initializing stack.\n"); ret = SRSLTE_ERROR; } -#endif if (gw_ptr->init(args.gw, old_logger, lte_stack.get())) { srslte::console("Error initializing GW.\n"); @@ -131,7 +122,6 @@ int ue::init(const all_args_t& args_, srslte::logger* logger_) radio = std::move(lte_radio); } else if (args.stack.type == "nr") { logger.info("Initializing NR stack"); -#ifdef HAVE_5GNR std::unique_ptr nr_stack(new srsue::ue_stack_nr(old_logger)); std::unique_ptr nr_radio(new srslte::radio_null); std::unique_ptr nr_phy(new srsue::vnf_phy_nr); @@ -163,10 +153,6 @@ int ue::init(const all_args_t& args_, srslte::logger* logger_) gw_inst = std::move(gw_ptr); phy = std::move(nr_phy); radio = std::move(nr_radio); -#else - srslte::console("ERROR: 5G NR stack not compiled. Please, activate CMAKE HAVE_5GNR flag.\n"); - logger.error("5G NR stack not compiled. Please, activate CMAKE HAVE_5GNR flag."); -#endif } else { srslte::console("Invalid stack type %s. Supported values are [lte].\n", args.stack.type.c_str()); ret = SRSLTE_ERROR; diff --git a/srsue/test/CMakeLists.txt b/srsue/test/CMakeLists.txt index c3f514a9f..307b1b74f 100644 --- a/srsue/test/CMakeLists.txt +++ b/srsue/test/CMakeLists.txt @@ -8,10 +8,7 @@ add_subdirectory(phy) add_subdirectory(upper) - -if (ENABLE_5GNR) - add_subdirectory(mac_nr) -endif (ENABLE_5GNR) +add_subdirectory(mac_nr) if (ENABLE_TTCN3) add_subdirectory(ttcn3) diff --git a/srsue/test/ttcn3/src/CMakeLists.txt b/srsue/test/ttcn3/src/CMakeLists.txt index 10f32eecb..99d87cb6d 100644 --- a/srsue/test/ttcn3/src/CMakeLists.txt +++ b/srsue/test/ttcn3/src/CMakeLists.txt @@ -15,19 +15,18 @@ set(LINK_LIBRARIES srsue_stack srslte_upper srslte_common srslte_mac + srslte_mac srslte_phy srslte_radio srslte_upper srsue_phy srsue_mac + srsue_mac_nr rrc_asn1 + rrc_nr_asn1 sctp ${Boost_LIBRARIES}) -if (ENABLE_5GNR) - set(LINK_LIBRARIES ${LINK_LIBRARIES} rrc_nr_asn1 srsue_mac_nr srslte_mac) -endif (ENABLE_5GNR) - target_link_libraries(ttcn3_dut ${LINK_LIBRARIES}) include_directories(${PROJECT_SOURCE_DIR}/srsue/test/ttcn3/hdr) diff --git a/srsue/test/upper/CMakeLists.txt b/srsue/test/upper/CMakeLists.txt index cd84fa988..630ae27ba 100644 --- a/srsue/test/upper/CMakeLists.txt +++ b/srsue/test/upper/CMakeLists.txt @@ -20,11 +20,7 @@ target_link_libraries(rrc_reconfig_test srsue_upper srslte_upper srslte_phy rrc_ add_test(rrc_reconfig_test rrc_reconfig_test) add_executable(rrc_meas_test rrc_meas_test.cc) -if (ENABLE_5GNR) - target_link_libraries(rrc_meas_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1 rrc_nr_asn1) -else (ENABLE_5GNR) - target_link_libraries(rrc_meas_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1) -endif(ENABLE_5GNR) +target_link_libraries(rrc_meas_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1 rrc_nr_asn1) add_test(rrc_meas_test rrc_meas_test) add_executable(nas_test nas_test.cc) @@ -44,17 +40,11 @@ target_link_libraries(rrc_phy_ctrl_test srslte_common srsue_rrc) add_test(rrc_phy_ctrl_test rrc_phy_ctrl_test) add_executable(rrc_cell_test rrc_cell_test.cc) -if (ENABLE_5GNR) - target_link_libraries(rrc_cell_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1 rrc_nr_asn1) -else (ENABLE_5GNR) - target_link_libraries(rrc_cell_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1) -endif(ENABLE_5GNR) +target_link_libraries(rrc_cell_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1 rrc_nr_asn1) add_test(rrc_cell_test rrc_cell_test) -if (ENABLE_5GNR) - add_executable(ue_rrc_nr_test ue_rrc_nr_test.cc) - target_link_libraries(ue_rrc_nr_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1 rrc_nr_asn1) -endif(ENABLE_5GNR) +add_executable(ue_rrc_nr_test ue_rrc_nr_test.cc) +target_link_libraries(ue_rrc_nr_test srsue_rrc srsue_upper srslte_upper srslte_phy rrc_asn1 rrc_nr_asn1) ######################################################################## # Option to run command after build (useful for remote builds) diff --git a/srsue/test/upper/rrc_meas_test.cc b/srsue/test/upper/rrc_meas_test.cc index 74be7e981..69a9a52ff 100644 --- a/srsue/test/upper/rrc_meas_test.cc +++ b/srsue/test/upper/rrc_meas_test.cc @@ -255,14 +255,10 @@ public: pdcptest = std::unique_ptr(new pdcp_test(log_->get_service_name().c_str(), &stack->task_sched)); rrcnrtest = std::unique_ptr(new rrc_nr_test()); } -#ifdef HAVE_5GNR void init() { rrc::init(&phytest, &mactest, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, rrcnrtest.get(), {}); } -#else - void init() { rrc::init(&phytest, &mactest, nullptr, pdcptest.get(), nastest.get(), nullptr, nullptr, {}); } -#endif void run_tti(uint32_t tti_) { @@ -346,7 +342,6 @@ public: run_tti(1); } -#ifdef HAVE_5GNR void add_neighbour_cell_nr(uint32_t pci, uint32_t earfcn, float rsrp = 0) { std::vector phy_meas = {}; @@ -358,7 +353,6 @@ public: new_cell_meas_nr(phy_meas); run_tti(1); } -#endif using rrc::has_neighbour_cell; using rrc::is_serving_cell; @@ -1248,7 +1242,6 @@ int meas_obj_inter_rat_nr_test() TESTASSERT(rrctest.send_meas_cfg(rrc_conn_recfg)); TESTASSERT(rrctest.phytest.meas_nof_freqs() == 0); -#ifdef HAVE_5GNR rrctest.add_neighbour_cell(2, 300, 2.0); rrctest.set_serving_cell(2, 300); @@ -1260,7 +1253,6 @@ int meas_obj_inter_rat_nr_test() rrctest.add_neighbour_cell_nr(500, 631680, -60.0); } -#endif return SRSLTE_SUCCESS; }