Deleted all HAVE_5GNR in CC and h files

CMakeList and travis yaml
master
David Rupprecht 4 years ago committed by Andre Puschmann
parent c2c05d1e8f
commit 0f1586dd2d

@ -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

@ -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

@ -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})

@ -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)

@ -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)

@ -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)

@ -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});
}

@ -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;

@ -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)

@ -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})

@ -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)

@ -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)

@ -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}

@ -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 <iostream>
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<srsenb::gnb_stack_nr> nr_stack(new srsenb::gnb_stack_nr(logger));
std::unique_ptr<srslte::radio_null> nr_radio(new srslte::radio_null);
std::unique_ptr<srsenb::vnf_phy_nr> 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

@ -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()

@ -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)

@ -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} $<TARGET_OBJECTS:mac_schedulers>)
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})

@ -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})

@ -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})

@ -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)

@ -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<uint8_t, SRSLTE_RAR_UL_GRANT_NBITS> 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<uint32_t> earfcns) final;
#endif // HAVE_5GNR
private:
void run_thread() final;

@ -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<phy_meas_nr_t>& 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_eutra>;
meas_cell_list<meas_cell_eutra> meas_cells;
#ifdef HAVE_5GNR
meas_cell_list<meas_cell_nr> 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<uint32_t> 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<phy_meas_t>& meas);
srslte::block_queue<std::vector<phy_meas_t> > cell_meas_q;
#ifdef HAVE_5GNR
void process_cell_meas_nr();
void process_new_cell_meas_nr(const std::vector<phy_meas_nr_t>& meas);
srslte::block_queue<std::vector<phy_meas_nr_t> > 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();

@ -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<uint32_t, uint32_t> 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 <typename T>
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 <typename T, typename U>
bool is_same_cell(const T& lhs, const U& rhs)
{

@ -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<uint32_t, std::map<uint32_t, cell_trigger_state> > trigger_state;
#ifdef HAVE_5GNR
std::map<uint32_t, std::map<uint32_t, cell_trigger_state> > trigger_state_nr;
#endif
var_meas_report_list* meas_report = nullptr;
srslog::basic_logger& logger;

@ -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
// 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_base> usim;

@ -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}

@ -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()

@ -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

@ -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()
add_subdirectory(mac_nr)
set(SOURCES ue_stack_nr.cc)
add_library(srsue_nr_stack STATIC ${SOURCES})

@ -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()

@ -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<uint32_t> 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);

@ -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<T>::process_new_cell_meas(const std::vector<phy_meas_t>&
}
template class meas_cell_list<meas_cell_eutra>;
#ifdef HAVE_5GNR
template class meas_cell_list<meas_cell_nr>;
#endif
} // namespace srsue

@ -73,9 +73,7 @@ void rrc::rrc_meas::update_phy()
{
std::list<meas_obj_to_add_mod_s> 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(),

@ -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);

@ -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);

@ -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 <algorithm>
#include <iostream>
#include <string>
@ -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<srsue::ue_stack_nr> nr_stack(new srsue::ue_stack_nr(old_logger));
std::unique_ptr<srslte::radio_null> nr_radio(new srslte::radio_null);
std::unique_ptr<srsue::vnf_phy_nr> 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;

@ -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)

@ -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)

@ -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)

@ -255,14 +255,10 @@ public:
pdcptest = std::unique_ptr<pdcp_test>(new pdcp_test(log_->get_service_name().c_str(), &stack->task_sched));
rrcnrtest = std::unique_ptr<rrc_nr_test>(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_nr_t> 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;
}

Loading…
Cancel
Save