Commit eb363157 authored by Raymond Knopp's avatar Raymond Knopp

moved simulation target into lte-uesoftmodem with --simL1 option

parent 4b943d4b
...@@ -621,9 +621,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d ...@@ -621,9 +621,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the d
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????") add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14") add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs") add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????") add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????")
add_boolean_option(OAISIM False "specific to oaisim")
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????") add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c") add_boolean_option(USE_MME False "this flag is used only one time in lte-softmodem.c")
...@@ -652,9 +650,7 @@ add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true") ...@@ -652,9 +650,7 @@ add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
# PHY options # PHY options
########################## ##########################
add_boolean_option(DRIVER2013 True "only relevant for EXMIMO") add_boolean_option(DRIVER2013 True "only relevant for EXMIMO")
add_boolean_option(ENABLE_NEW_MULTICAST False "specific to oaisim")
add_boolean_option(EXMIMO_IOT True "????") add_boolean_option(EXMIMO_IOT True "????")
add_boolean_option(LARGE_SCALE False "specific to oaisim: defines max eNB=2 and max UE=120")
add_boolean_option(LOCALIZATION False "???") add_boolean_option(LOCALIZATION False "???")
add_integer_option(MAX_NUM_CCs 1 "????") add_integer_option(MAX_NUM_CCs 1 "????")
add_boolean_option(MU_RECEIVER False "????") add_boolean_option(MU_RECEIVER False "????")
...@@ -677,7 +673,6 @@ add_boolean_option(NAS_UE True "NAS UE INSTANCE (<> NAS_MME)") ...@@ -677,7 +673,6 @@ add_boolean_option(NAS_UE True "NAS UE INSTANCE (<> NAS_MME)")
########################## ##########################
# ACCESS STRATUM LAYER2 OPTIONS # ACCESS STRATUM LAYER2 OPTIONS
########################## ##########################
add_boolean_option(MAC_CONTEXT True "specific to oaisim")
add_boolean_option(JUMBO_FRAME True "ENABLE LARGE SDU in ACCESS STRATUM (larger than common MTU)") add_boolean_option(JUMBO_FRAME True "ENABLE LARGE SDU in ACCESS STRATUM (larger than common MTU)")
########################## ##########################
...@@ -1720,12 +1715,14 @@ ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ...@@ -1720,12 +1715,14 @@ ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_channel.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_channel.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/abstraction.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/abstraction.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/channel_sim.c
${OPENAIR1_DIR}/SIMULATION/RF/rf.c ${OPENAIR1_DIR}/SIMULATION/RF/rf.c
${OPENAIR1_DIR}/SIMULATION/RF/dac.c ${OPENAIR1_DIR}/SIMULATION/RF/dac.c
${OPENAIR1_DIR}/SIMULATION/RF/adc.c ${OPENAIR1_DIR}/SIMULATION/RF/adc.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
) )
add_library(SIMU_ETH add_library(SIMU_ETH
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
...@@ -1982,6 +1979,8 @@ add_executable(lte-uesoftmodem ...@@ -1982,6 +1979,8 @@ add_executable(lte-uesoftmodem
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
...@@ -2000,13 +1999,13 @@ add_executable(lte-uesoftmodem ...@@ -2000,13 +1999,13 @@ add_executable(lte-uesoftmodem
target_link_libraries (lte-uesoftmodem target_link_libraries (lte-uesoftmodem
-Wl,--start-group -Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl) -Wl,--end-group z dl)
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${T_LIB}) target_link_libraries (lte-uesoftmodem ${T_LIB})
...@@ -2019,6 +2018,8 @@ add_executable(lte-uesoftmodem-nos1 ...@@ -2019,6 +2018,8 @@ add_executable(lte-uesoftmodem-nos1
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/RT/USER/lte-ue.c ${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c ${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c ${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c ${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
...@@ -2038,13 +2039,13 @@ add_executable(lte-uesoftmodem-nos1 ...@@ -2038,13 +2039,13 @@ add_executable(lte-uesoftmodem-nos1
target_link_libraries (lte-uesoftmodem-nos1 target_link_libraries (lte-uesoftmodem-nos1
-Wl,--start-group -Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE SIMU ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB}
${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl ) -Wl,--end-group z dl )
target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES}) target_link_libraries (lte-uesoftmodem-nos1 ${LIBXML2_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES}) target_link_libraries (lte-uesoftmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES}) target_link_libraries (lte-uesoftmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB}) target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
...@@ -2075,96 +2076,6 @@ target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB}) ...@@ -2075,96 +2076,6 @@ target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
# Addexecutables for tests # Addexecutables for tests
#################################### ####################################
# A all in one network simulator
################
add_executable(oaisim
${rrc_h}
${s1ap_h}
${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
# ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
${OPENAIR_TARGETS}/SIMU/USER/sinr_sim.c
${OPENAIR_TARGETS}/SIMU/USER/cor_SF_sim.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim_functions.c
${OPENAIR_TARGETS}/SIMU/USER/event_handler.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${XFORMS_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim
-Wl,-ldl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS L2_UE ${MSC_LIB} LIB_NAS_UE SIMU SECU_OSA ${ITTI_LIB} ${MIH_LIB}
${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-Wl,--end-group z dl)
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp z
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
#Force link with forms, regardless XFORMS option
target_link_libraries (oaisim forms)
target_link_libraries (oaisim ${T_LIB})
# A all in one network simulator
################
add_executable(oaisim_nos1
${rrc_h}
${s1ap_h}
${x2ap_h}
${OPENAIR_BIN_DIR}/messages_xml.h
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-ru.c
${OPENAIR1_DIR}/SCHED/prach_procedures.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/SIMU/USER/channel_sim.c
# ${OPENAIR_TARGETS}/SIMU/USER/oaisim_config.c
${OPENAIR_TARGETS}/SIMU/USER/sinr_sim.c
${OPENAIR_TARGETS}/SIMU/USER/cor_SF_sim.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim_functions.c
${OPENAIR_TARGETS}/SIMU/USER/event_handler.c
${OPENAIR_TARGETS}/SIMU/USER/oaisim.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_DIR}/common/utils/system.c
${XFORMS_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim_nos1
-Wl,--start-group
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_UE PHY_RU LFDS ${MSC_LIB} ${ITTI_LIB} SIMU L2_UE ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7
-Wl,--end-group z dl )
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES}
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
#Force link with forms, regardless XFORMS option
target_link_libraries (oaisim_nos1 forms)
#message("protobuflib is ${PROTOBUF_LIB}")
target_link_libraries (oaisim_nos1 ${T_LIB})
# Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator # Unitary tests for each piece of L1: example, mbmssim is MBMS L1 simulator
##################################### #####################################
...@@ -2262,7 +2173,7 @@ endforeach(myExe) ...@@ -2262,7 +2173,7 @@ endforeach(myExe)
if (${T_TRACER}) if (${T_TRACER})
foreach(i foreach(i
#all "add_executable" definitions (except tests, rb_tool, updatefw) #all "add_executable" definitions (except tests, rb_tool, updatefw)
lte-softmodem lte-softmodem-nos1 oaisim oaisim_nos1 lte-softmodem lte-softmodem-nos1
dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
pdcchsim pucchsim prachsim syncsim pdcchsim pucchsim prachsim syncsim
#all "add_library" definitions #all "add_library" definitions
......
...@@ -42,8 +42,8 @@ ...@@ -42,8 +42,8 @@
#include "log.h" #include "log.h"
#if defined (LOG_D) && defined (LOG_E) #if defined (LOG_D) && defined (LOG_E)
# define SIG_DEBUG(x, args...) LOG_D(EMU, x, ##args) # define SIG_DEBUG(x, args...) LOG_D(SIM, x, ##args)
# define SIG_ERROR(x, args...) LOG_E(EMU, x, ##args) # define SIG_ERROR(x, args...) LOG_E(SIM, x, ##args)
#endif #endif
#ifndef SIG_DEBUG #ifndef SIG_DEBUG
......
...@@ -70,7 +70,6 @@ extern char mode_string[4][20]; ...@@ -70,7 +70,6 @@ extern char mode_string[4][20];
extern unsigned char NB_RU;
#ifndef OPENAIR2 #ifndef OPENAIR2
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
......
...@@ -65,7 +65,6 @@ extern int flagMag; ...@@ -65,7 +65,6 @@ extern int flagMag;
extern char mode_string[4][20]; extern char mode_string[4][20];
extern unsigned char NB_RU;
#ifndef OPENAIR2 #ifndef OPENAIR2
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
......
...@@ -67,7 +67,6 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"}; ...@@ -67,7 +67,6 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
#include "SIMULATION/ETH_TRANSPORT/vars.h" #include "SIMULATION/ETH_TRANSPORT/vars.h"
unsigned char NB_RU=0;
#ifndef OPENAIR2 #ifndef OPENAIR2
unsigned char NB_eNB_INST=0; unsigned char NB_eNB_INST=0;
......
...@@ -61,7 +61,6 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"}; ...@@ -61,7 +61,6 @@ char mode_string[4][20] = {"NOT SYNCHED","PRACH","RAR","PUSCH"};
#include "SIMULATION/ETH_TRANSPORT/vars.h" #include "SIMULATION/ETH_TRANSPORT/vars.h"
unsigned char NB_RU=0;
#ifndef OPENAIR2 #ifndef OPENAIR2
unsigned char NB_eNB_INST=0; unsigned char NB_eNB_INST=0;
......
...@@ -99,7 +99,7 @@ multicast_link_init(void) ...@@ -99,7 +99,7 @@ multicast_link_init(void)
SOCK_DGRAM, SOCK_DGRAM,
&group_list[group].port, &sin); &group_list[group].port, &sin);
LOG_D(EMU, "multicast_link_init(): Created socket %d for group %d, port %d\n", LOG_D(SIM, "multicast_link_init(): Created socket %d for group %d, port %d\n",
group_list[group].socket,group,group_list[group].port); group_list[group].socket,group,group_list[group].port);
/* Used so we can re-bind to our port while a previous connection is still /* Used so we can re-bind to our port while a previous connection is still
...@@ -107,17 +107,17 @@ multicast_link_init(void) ...@@ -107,17 +107,17 @@ multicast_link_init(void)
*/ */
if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR, if (setsockopt(group_list[group].socket, SOL_SOCKET, SO_REUSEADDR,
&reuse_addr, sizeof (reuse_addr)) < 0) { &reuse_addr, sizeof (reuse_addr)) < 0) {
LOG_E(EMU, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ..."); LOG_E(SIM, "[MULTICAST] ERROR : setsockopt:SO_REUSEADDR, exiting ...");
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
if (multicast_if != NULL) { if (multicast_if != NULL) {
if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE, if (setsockopt(group_list[group].socket, SOL_SOCKET,SO_BINDTODEVICE,
multicast_if, strlen(multicast_if)) < 0) { multicast_if, strlen(multicast_if)) < 0) {
LOG_E(EMU, LOG_E(SIM,
"[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n", "[MULTICAST] ERROR : setsockopt:SO_BINDTODEVICE on interface %s, exiting ...\n",
multicast_if); multicast_if);
LOG_E(EMU, LOG_E(SIM,
"[MULTICAST] make sure that you have a root privilage or run with sudo -E \n"); "[MULTICAST] make sure that you have a root privilage or run with sudo -E \n");
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
...@@ -132,7 +132,7 @@ multicast_link_init(void) ...@@ -132,7 +132,7 @@ multicast_link_init(void)
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP, if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_MULTICAST_LOOP,
&multicast_loop, sizeof (multicast_loop)) < 0) { &multicast_loop, sizeof (multicast_loop)) < 0) {
LOG_E(EMU, LOG_E(SIM,
"[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m", "[MULTICAST] ERROR: %s line %d multicast_link_main_loop() IP_MULTICAST_LOOP %m",
__FILE__, __LINE__); __FILE__, __LINE__);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
...@@ -143,13 +143,13 @@ multicast_link_init(void) ...@@ -143,13 +143,13 @@ multicast_link_init(void)
command.imr_interface.s_addr = htonl (INADDR_ANY); command.imr_interface.s_addr = htonl (INADDR_ANY);
if (command.imr_multiaddr.s_addr == -1) { if (command.imr_multiaddr.s_addr == -1) {
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__); LOG_E(SIM, "[MULTICAST] ERROR: %s line %d NO MULTICAST", __FILE__, __LINE__);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP, if (setsockopt (group_list[group].socket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
&command, sizeof (command)) < 0) { &command, sizeof (command)) < 0) {
LOG_E(EMU, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__, LOG_E(SIM, "[MULTICAST] ERROR: %s line %d IP_ADD_MEMBERSHIP %m", __FILE__,
__LINE__); __LINE__);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
...@@ -202,13 +202,13 @@ multicast_link_read_data (int groupP) ...@@ -202,13 +202,13 @@ multicast_link_read_data (int groupP)
if ((groupP < MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) { if ((groupP < MULTICAST_LINK_NUM_GROUPS) && (groupP >= 0)) {
if ((num_bytes = recvfrom (group_list[groupP].socket, if ((num_bytes = recvfrom (group_list[groupP].socket,
group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) { group_list[groupP].rx_buffer, 40000, 0, 0, 0)) < 0) {
LOG_E(EMU, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n", LOG_E(SIM, "[MULTICAST] recvfrom has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno), __FILE__, __LINE__); errno, strerror(errno), __FILE__, __LINE__);
} else { } else {
rx_handler(num_bytes,group_list[groupP].rx_buffer); rx_handler(num_bytes,group_list[groupP].rx_buffer);
} }
} else { } else {
LOG_E(EMU, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP); LOG_E(SIM, "[MULTICAST] ERROR: groupP out of bounds %d\n", groupP);
} }
} }
...@@ -242,7 +242,7 @@ multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP) ...@@ -242,7 +242,7 @@ multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP)
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0, if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
(struct sockaddr *) &group_list[groupP].sock_remote_addr, (struct sockaddr *) &group_list[groupP].sock_remote_addr,
sizeof (group_list[groupP].sock_remote_addr))) < 0) { sizeof (group_list[groupP].sock_remote_addr))) < 0) {
LOG_E(EMU, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n", LOG_E(SIM, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno), errno, strerror(errno),
__FILE__, __LINE__); __FILE__, __LINE__);
} }
...@@ -274,22 +274,22 @@ int multicast_link_read_data_from_sock(uint8_t is_master) ...@@ -274,22 +274,22 @@ int multicast_link_read_data_from_sock(uint8_t is_master)
multicast_link_build_select_list (); multicast_link_build_select_list ();
LOG_D(EMU, "Stuck on select with timeout %s\n", LOG_D(SIM, "Stuck on select with timeout %s\n",
timeout_p == NULL ? "infinite" : "15000 usecs"); timeout_p == NULL ? "infinite" : "15000 usecs");
readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p); readsocks = select(highsock + 1, &socks, (fd_set *) 0, (fd_set *) 0, timeout_p);
if (readsocks < 0) { if (readsocks < 0) {
LOG_E(EMU, "Multicast select failed (%d:%s)\n", errno, strerror(errno)); LOG_E(SIM, "Multicast select failed (%d:%s)\n", errno, strerror(errno));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} else if (readsocks > 0) { } else if (readsocks > 0) {
#ifdef DEBUG_EMU #ifdef DEBUG_SIM
LOG_D(EMU, "Multicast Normal read\n"); LOG_D(SIM, "Multicast Normal read\n");
#endif #endif
multicast_link_read(); multicast_link_read();
} else { } else {
/* Timeout */ /* Timeout */
LOG_I(EMU, "Multicast select time-out\n"); LOG_I(SIM, "Multicast select time-out\n");
return 1; return 1;
} }
...@@ -311,21 +311,21 @@ void multicast_link_start(void (*rx_handlerP) (unsigned int, char *), ...@@ -311,21 +311,21 @@ void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
rx_handler = rx_handlerP; rx_handler = rx_handlerP;
multicast_group = _multicast_group; multicast_group = _multicast_group;
multicast_if = multicast_ifname; multicast_if = multicast_ifname;
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n", LOG_I(SIM, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group, (multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
rx_handler); rx_handler);
multicast_link_init (); multicast_link_init ();
#if ! defined(ENABLE_NEW_MULTICAST) #if ! defined(ENABLE_NEW_MULTICAST)
LOG_D(EMU, "[MULTICAST] multicast link start thread\n"); LOG_D(SIM, "[MULTICAST] multicast link start thread\n");
if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop, if (pthread_create (&main_loop_thread, NULL, multicast_link_main_loop,
NULL) != 0) { NULL) != 0) {
LOG_E(EMU, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n", LOG_E(SIM, "[MULTICAST LINK] Error in pthread_create (%d:%s)\n",
errno, strerror(errno)); errno, strerror(errno));
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} else { } else {
pthread_detach(main_loop_thread); // disassociate from parent pthread_detach(main_loop_thread); // disassociate from parent
LOG_I(EMU, "[MULTICAST LINK] Thread detached\n"); LOG_I(SIM, "[MULTICAST LINK] Thread detached\n");
} }
#endif #endif
......
This diff is collapsed.
...@@ -212,13 +212,13 @@ int logInit (void) ...@@ -212,13 +212,13 @@ int logInit (void)
g_log->log_component[RRC].filelog = 0; g_log->log_component[RRC].filelog = 0;
g_log->log_component[RRC].filelog_name = "/tmp/rrc.log"; g_log->log_component[RRC].filelog_name = "/tmp/rrc.log";
g_log->log_component[EMU].name = "EMU"; g_log->log_component[SIM].name = "SIM";
g_log->log_component[EMU].level = LOG_EMERG; g_log->log_component[SIM].level = LOG_EMERG;
g_log->log_component[EMU].flag = LOG_MED; g_log->log_component[SIM].flag = LOG_MED;
g_log->log_component[EMU].interval = 1; g_log->log_component[SIM].interval = 1;
g_log->log_component[EMU].fd = 0; g_log->log_component[SIM].fd = 0;
g_log->log_component[EMU].filelog = 0; g_log->log_component[SIM].filelog = 0;
g_log->log_component[EMU].filelog_name = ""; g_log->log_component[SIM].filelog_name = "";
g_log->log_component[OMG].name = "OMG"; g_log->log_component[OMG].name = "OMG";
g_log->log_component[OMG].level = LOG_EMERG; g_log->log_component[OMG].level = LOG_EMERG;
...@@ -474,7 +474,7 @@ int logInit (void) ...@@ -474,7 +474,7 @@ int logInit (void)
if (g_log->syslog) { if (g_log->syslog) {
#if ! defined(CN_BUILD) #if ! defined(CN_BUILD)
openlog(g_log->log_component[EMU].name, LOG_PID, g_log->config.facility); openlog(g_log->log_component[SIM].name, LOG_PID, g_log->config.facility);
#endif // ! defined(CN_BUILD) #endif // ! defined(CN_BUILD)
} }
log_getconfig(g_log); log_getconfig(g_log);
...@@ -1737,16 +1737,16 @@ int main(int argc, char *argv[]) ...@@ -1737,16 +1737,16 @@ int main(int argc, char *argv[])
int test_log(void) int test_log(void)
{ {
LOG_ENTER(MAC); // because the default level is DEBUG LOG_ENTER(MAC); // because the default level is DEBUG
LOG_I(EMU, "1 Starting OAI logs version %s Build date: %s on %s\n", LOG_I(SIM, "1 Starting OAI logs version %s Build date: %s on %s\n",
BUILD_VERSION, BUILD_DATE, BUILD_HOST); BUILD_VERSION, BUILD_DATE, BUILD_HOST);
LOG_D(MAC, "1 debug MAC \n"); LOG_D(MAC, "1 debug MAC \n");
LOG_N(MAC, "1 notice MAC \n"); LOG_N(MAC, "1 notice MAC \n");
LOG_W(MAC, "1 warning MAC \n"); LOG_W(MAC, "1 warning MAC \n");
set_comp_log(EMU, LOG_INFO, FLAG_ONLINE); set_comp_log(SIM, LOG_INFO, FLAG_ONLINE);
set_comp_log(MAC, LOG_WARNING, 0); set_comp_log(MAC, LOG_WARNING, 0);
LOG_I(EMU, "2 Starting OAI logs version %s Build date: %s on %s\n", LOG_I(SIM, "2 Starting OAI logs version %s Build date: %s on %s\n",
BUILD_VERSION, BUILD_DATE, BUILD_HOST); BUILD_VERSION, BUILD_DATE, BUILD_HOST);
LOG_E(MAC, "2 emerge MAC\n"); LOG_E(MAC, "2 emerge MAC\n");
LOG_D(MAC, "2 debug MAC \n"); LOG_D(MAC, "2 debug MAC \n");
...@@ -1758,7 +1758,7 @@ int test_log(void) ...@@ -1758,7 +1758,7 @@ int test_log(void)
set_comp_log(MAC, LOG_NOTICE, 1); set_comp_log(MAC, LOG_NOTICE, 1);
LOG_ENTER(MAC); LOG_ENTER(MAC);
LOG_I(EMU, "3 Starting OAI logs version %s Build date: %s on %s\n", LOG_I(SIM, "3 Starting OAI logs version %s Build date: %s on %s\n",
BUILD_VERSION, BUILD_DATE, BUILD_HOST); BUILD_VERSION, BUILD_DATE, BUILD_HOST);
LOG_D(MAC, "3 debug MAC \n"); LOG_D(MAC, "3 debug MAC \n");
LOG_N(MAC, "3 notice MAC \n"); LOG_N(MAC, "3 notice MAC \n");
...@@ -1766,10 +1766,10 @@ int test_log(void) ...@@ -1766,10 +1766,10 @@ int test_log(void)
LOG_I(MAC, "3 info MAC \n"); LOG_I(MAC, "3 info MAC \n");
set_comp_log(MAC, LOG_DEBUG,1); set_comp_log(MAC, LOG_DEBUG,1);
set_comp_log(EMU, LOG_DEBUG,1); set_comp_log(SIM, LOG_DEBUG,1);
LOG_ENTER(MAC); LOG_ENTER(MAC);
LOG_I(EMU, "4 Starting OAI logs version %s Build date: %s on %s\n", LOG_I(SIM, "4 Starting OAI logs version %s Build date: %s on %s\n",
BUILD_VERSION, BUILD_DATE, BUILD_HOST); BUILD_VERSION, BUILD_DATE, BUILD_HOST);
LOG_D(MAC, "4 debug MAC \n"); LOG_D(MAC, "4 debug MAC \n");
LOG_N(MAC, "4 notice MAC \n"); LOG_N(MAC, "4 notice MAC \n");
...@@ -1778,7 +1778,7 @@ int test_log(void) ...@@ -1778,7 +1778,7 @@ int test_log(void)
set_comp_log(MAC, LOG_DEBUG,0); set_comp_log(MAC, LOG_DEBUG,0);
set_comp_log(EMU, LOG_DEBUG,0); set_comp_log(SIM, LOG_DEBUG,0);
LOG_I(LOG, "5 Starting OAI logs version %s Build date: %s on %s\n", LOG_I(LOG, "5 Starting OAI logs version %s Build date: %s on %s\n",
BUILD_VERSION, BUILD_DATE, BUILD_HOST); BUILD_VERSION, BUILD_DATE, BUILD_HOST);
...@@ -1789,7 +1789,7 @@ int test_log(void) ...@@ -1789,7 +1789,7 @@ int test_log(void)
set_comp_log(MAC, LOG_TRACE,0X07F); set_comp_log(MAC, LOG_TRACE,0X07F);
set_comp_log(EMU, LOG_TRACE,0X07F); set_comp_log(SIM, LOG_TRACE,0X07F);
LOG_ENTER(MAC); LOG_ENTER(MAC);
LOG_I(LOG, "6 Starting OAI logs version %s Build date: %s on %s\n", LOG_I(LOG, "6 Starting OAI logs version %s Build date: %s on %s\n",
......
...@@ -150,7 +150,7 @@ typedef enum { ...@@ -150,7 +150,7 @@ typedef enum {
MIN_LOG_COMPONENTS = 0, MIN_LOG_COMPONENTS = 0,
PHY = MIN_LOG_COMPONENTS, PHY = MIN_LOG_COMPONENTS,
MAC, MAC,
EMU, SIM,
OCG, OCG,
OMG, OMG,
OPT, OPT,
......
...@@ -2467,7 +2467,7 @@ void RCconfig_RU(void) { ...@@ -2467,7 +2467,7 @@ void RCconfig_RU(void) {
RC.ru_mask=(1<<NB_RU) - 1; RC.ru_mask=(1<<RC.nb_RU) - 1;
printf("Set RU mask to %lx\n",RC.ru_mask); printf("Set RU mask to %lx\n",RC.ru_mask);
for (j = 0; j < RC.nb_RU; j++) { for (j = 0; j < RC.nb_RU; j++) {
......
...@@ -459,7 +459,7 @@ void *l2l1_task(void *arg) { ...@@ -459,7 +459,7 @@ void *l2l1_task(void *arg) {
switch (ITTI_MSG_ID(message_p)) { switch (ITTI_MSG_ID(message_p)) {
case INITIALIZE_MESSAGE: case INITIALIZE_MESSAGE:
/* Start eNB thread */ /* Start eNB thread */
LOG_D(EMU, "L2L1 TASK received %s\n", ITTI_MSG_NAME(message_p)); printf("L2L1 TASK received %s\n", ITTI_MSG_NAME(message_p));
start_eNB = 1; start_eNB = 1;
break; break;
...@@ -471,7 +471,7 @@ void *l2l1_task(void *arg) { ...@@ -471,7 +471,7 @@ void *l2l1_task(void *arg) {
break; break;
default: default:
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p)); printf("Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
break; break;
} }
} while (ITTI_MSG_ID(message_p) != INITIALIZE_MESSAGE); } while (ITTI_MSG_ID(message_p) != INITIALIZE_MESSAGE);
...@@ -498,11 +498,11 @@ void *l2l1_task(void *arg) { ...@@ -498,11 +498,11 @@ void *l2l1_task(void *arg) {
break; break;
case MESSAGE_TEST: case MESSAGE_TEST:
LOG_I(EMU, "Received %s\n", ITTI_MSG_NAME(message_p)); printf("Received %s\n", ITTI_MSG_NAME(message_p));
break; break;
default: default:
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p)); printf("Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
break; break;
} }
...@@ -564,8 +564,7 @@ static void get_options(void) { ...@@ -564,8 +564,7 @@ static void get_options(void) {
/* Read RC configuration file */ /* Read RC configuration file */
RCConfig(); RCConfig();
NB_eNB_INST = RC.nb_inst; NB_eNB_INST = RC.nb_inst;
NB_RU = RC.nb_RU; printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_eNB_INST,RC.nb_L1_inst,RC.nb_RU);
printf("Configuration: nb_rrc_inst %d, nb_L1_inst %d, nb_ru %d\n",NB_eNB_INST,RC.nb_L1_inst,NB_RU);
if (nonbiotflag <= 0) { if (nonbiotflag <= 0) {
load_NB_IoT(); load_NB_IoT();
printf(" nb_nbiot_rrc_inst %d, nb_nbiot_L1_inst %d, nb_nbiot_macrlc_inst %d\n", printf(" nb_nbiot_rrc_inst %d, nb_nbiot_L1_inst %d, nb_nbiot_macrlc_inst %d\n",
...@@ -1285,7 +1284,7 @@ int main( int argc, char **argv ) ...@@ -1285,7 +1284,7 @@ int main( int argc, char **argv )
// cleanup // cleanup
stop_eNB(NB_eNB_INST); stop_eNB(NB_eNB_INST);
stop_RU(NB_RU); stop_RU(RC.nb_RU);
/* release memory used by the RU/eNB threads (incomplete), after all /* release memory used by the RU/eNB threads (incomplete), after all
* threads have been stopped (they partially use the same memory) */ * threads have been stopped (they partially use the same memory) */
for (int inst = 0; inst < NB_eNB_INST; inst++) { for (int inst = 0; inst < NB_eNB_INST; inst++) {
...@@ -1294,7 +1293,7 @@ int main( int argc, char **argv ) ...@@ -1294,7 +1293,7 @@ int main( int argc, char **argv )
phy_free_lte_eNB(RC.eNB[inst][cc_id]); phy_free_lte_eNB(RC.eNB[inst][cc_id]);
} }
} }
for (int inst = 0; inst < NB_RU; inst++) { for (int inst = 0; inst < RC.nb_RU; inst++) {
phy_free_RU(RC.ru[inst]); phy_free_RU(RC.ru[inst]);
} }
free_lte_top(); free_lte_top();
...@@ -1313,7 +1312,7 @@ int main( int argc, char **argv ) ...@@ -1313,7 +1312,7 @@ int main( int argc, char **argv )
// *** Handle per CC_id openair0 // *** Handle per CC_id openair0
for(ru_id=0; ru_id<NB_RU; ru_id++) { for(ru_id=0; ru_id<RC.nb_RU; ru_id++) {
if (RC.ru[ru_id]->rfdevice.trx_end_func) if (RC.ru[ru_id]->rfdevice.trx_end_func)
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice); RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
if (RC.ru[ru_id]->ifdevice.trx_end_func) if (RC.ru[ru_id]->ifdevice.trx_end_func)
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#define CONFIG_HLP_DBGUEPR "UE run normal prach power ramping, but don't continue random-access\n" #define CONFIG_HLP_DBGUEPR "UE run normal prach power ramping, but don't continue random-access\n"
#define CONFIG_HLP_CALPRACH "UE run normal prach with maximum power, but don't continue random-access\n" #define CONFIG_HLP_CALPRACH "UE run normal prach with maximum power, but don't continue random-access\n"
#define CONFIG_HLP_NOL2CN "bypass L2 and upper layers\n" #define CONFIG_HLP_NOL2CN "bypass L2 and upper layers\n"
#define CONFIG_HLP_SIML1 "activate RF simulator instead of HW\n"
#define CONFIG_HLP_UERXG "set UE RX gain\n" #define CONFIG_HLP_UERXG "set UE RX gain\n"
#define CONFIG_HLP_UERXGOFF "external UE amplifier offset\n" #define CONFIG_HLP_UERXGOFF "external UE amplifier offset\n"
#define CONFIG_HLP_UETXG "set UE TX gain\n" #define CONFIG_HLP_UETXG "set UE TX gain\n"
...@@ -131,6 +132,7 @@ ...@@ -131,6 +132,7 @@
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*--------------------------------------------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_UEPARAMS_DESC { \ #define CMDLINE_UEPARAMS_DESC { \
{"siml1", CONFIG_HLP_SIML1, PARAMFLAG_BOOL, iptr:&simL1flag, defintval:0, TYPE_INT, 0}, \
{"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \ {"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE, 0}, \
{"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \ {"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE, 0}, \
...@@ -138,8 +140,8 @@ ...@@ -138,8 +140,8 @@
{"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \ {"ue-nb-ant-tx", CONFIG_HLP_UENANTT, 0, u8ptr:&nb_antenna_tx, defuintval:1, TYPE_UINT8, 0}, \
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \ {"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \ {"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
{"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \ {"emul-iface", CONFIG_HLP_EMULIFACE, 0, strptr:&emul_iface, defstrval:"lo", TYPE_STRING, 100}, \
{"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \ {"L2-emul", NULL, 0, u8ptr:&nfapi_mode, defuintval:3, TYPE_UINT8, 0}, \
{"num-ues", NULL, 0, u8ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT8, 0}, \ {"num-ues", NULL, 0, u8ptr:&(NB_UE_INST), defuintval:1, TYPE_UINT8, 0}, \
{"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \ {"r" , CONFIG_HLP_PRB, 0, u8ptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT8, 0}, \
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
...@@ -272,7 +274,7 @@ extern void set_function_spec_param(RU_t *ru); ...@@ -272,7 +274,7 @@ extern void set_function_spec_param(RU_t *ru);
extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg); extern int setup_ue_buffers(PHY_VARS_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
extern void fill_ue_band_info(void); extern void fill_ue_band_info(void);
extern void init_UE(int,int,int,int); extern void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction, int phy_test, int UE_scan, int UE_scan_carrier, runmode_t mode,int rxgain,int txpowermax, int nb_rx, int nb_tx);
extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char * name); extern void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_t *cpuset, char * name);
extern void reset_opp_meas(void); extern void reset_opp_meas(void);
......
...@@ -79,7 +79,7 @@ void init_UE_threads(int); ...@@ -79,7 +79,7 @@ void init_UE_threads(int);
void init_UE_threads_stub(int); void init_UE_threads_stub(int);
void init_UE_single_thread_stub(int); void init_UE_single_thread_stub(int);
void *UE_thread(void *arg); void *UE_thread(void *arg);
void init_UE(int nb_inst,int,int,int); void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction, int phy_test, int UE_scan, int UE_scan_carrier, runmode_t mode,int rxgain,int txpowermax,int nb_rx,int nb_tx);
void init_UE_stub(int nb_inst,int,int,char*); void init_UE_stub(int nb_inst,int,int,char*);
void init_UE_stub_single_thread(int nb_inst,int,int,char*); void init_UE_stub_single_thread(int nb_inst,int,int,char*);
int init_timer_thread(void); int init_timer_thread(void);
...@@ -93,6 +93,8 @@ extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind); ...@@ -93,6 +93,8 @@ extern int oai_nfapi_sr_indication(nfapi_sr_indication_t *ind);
extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind); extern int oai_nfapi_rx_ind(nfapi_rx_indication_t *ind);
extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP); extern int multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP);
extern int simL1flag;
//extern int tx_req_UE_MAC1(); //extern int tx_req_UE_MAC1();
void ue_stub_rx_handler(unsigned int, char *); void ue_stub_rx_handler(unsigned int, char *);
...@@ -236,7 +238,7 @@ void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_ ...@@ -236,7 +238,7 @@ void init_thread(int sched_runtime, int sched_deadline, int sched_fifo, cpu_set_
} }
void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction) { void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correction, int phy_test, int UE_scan, int UE_scan_carrier, runmode_t mode,int rxgain,int txpowermax,int nb_rx,int nb_tx) {
PHY_VARS_UE *UE; PHY_VARS_UE *UE;
int inst; int inst;
...@@ -248,18 +250,58 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti ...@@ -248,18 +250,58 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
0,// cba_group_active 0,// cba_group_active
0); // HO flag 0); // HO flag
if (PHY_vars_UE_g==NULL) PHY_vars_UE_g = (PHY_VARS_UE***)calloc(1+nb_inst,sizeof(PHY_VARS_UE**));
for (inst=0;inst<nb_inst;inst++) { for (inst=0;inst<nb_inst;inst++) {
if (PHY_vars_UE_g[inst]==NULL) PHY_vars_UE_g[inst] = (PHY_VARS_UE**)calloc(1+MAX_NUM_CCs,sizeof(PHY_VARS_UE*));
LOG_I(PHY,"Initializing memory for UE instance %d (%p)\n",inst,PHY_vars_UE_g[inst]); if (simL1flag == 0) PHY_vars_UE_g[inst][0] = init_ue_vars(NULL,inst,0);
PHY_vars_UE_g[inst][0] = init_ue_vars(NULL,inst,0); else PHY_vars_UE_g[inst][0] = init_ue_vars(&RC.ru[0]->frame_parms,inst,0);
// turn off timing control loop in UE // turn off timing control loop in UE
PHY_vars_UE_g[inst][0]->no_timing_correction = timing_correction; PHY_vars_UE_g[inst][0]->no_timing_correction = timing_correction;
UE = PHY_vars_UE_g[inst][0];
printf("PHY_vars_UE_g[0][0] = %p\n",UE);
if (phy_test==1)
UE->mac_enabled = 0;
else
UE->mac_enabled = 1;
if (UE->mac_enabled == 0) { //set default UL parameters for testing mode
for (int i=0; i<NUMBER_OF_CONNECTED_eNB_MAX; i++) {
UE->pusch_config_dedicated[i].betaOffset_ACK_Index = 0;
UE->pusch_config_dedicated[i].betaOffset_RI_Index = 0;
UE->pusch_config_dedicated[i].betaOffset_CQI_Index = 2;
UE->scheduling_request_config[i].sr_PUCCH_ResourceIndex = 0;
UE->scheduling_request_config[i].sr_ConfigIndex = 7+(0%3);
UE->scheduling_request_config[i].dsr_TransMax = sr_n4;
}
}
UE->UE_scan = UE_scan;
UE->UE_scan_carrier = UE_scan_carrier;
UE->mode = mode;
printf("UE->mode = %d\n",mode);
if (UE->mac_enabled == 1) {
UE->pdcch_vars[0][0]->crnti = 0x1234;
UE->pdcch_vars[1][0]->crnti = 0x1234;
}else {
UE->pdcch_vars[0][0]->crnti = 0x1235;
UE->pdcch_vars[1][0]->crnti = 0x1235;
}
UE->rx_total_gain_dB = rxgain;
UE->tx_power_max_dBm = txpowermax;
UE->frame_parms.nb_antennas_tx = nb_tx;
UE->frame_parms.nb_antennas_rx = nb_rx;
if (simL1flag == 1) init_ue_devices();
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
init_UE_threads(inst); init_UE_threads(inst);
UE = PHY_vars_UE_g[inst][0];
if (oaisim_flag == 0) { if (simL1flag == 0) {
ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]); ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]);
if (ret !=0){ if (ret !=0){
exit_fun("Error loading device library"); exit_fun("Error loading device library");
...@@ -443,9 +485,12 @@ static void *UE_thread_synch(void *arg) ...@@ -443,9 +485,12 @@ static void *UE_thread_synch(void *arg)
} }
} }
/*
while (sync_var<0) while (sync_var<0)
pthread_cond_wait(&sync_cond, &sync_mutex); pthread_cond_wait(&sync_cond, &sync_mutex);
pthread_mutex_unlock(&sync_mutex); pthread_mutex_unlock(&sync_mutex);
*/
wait_sync("UE_thread_sync");
printf("Started device, unlocked sync_mutex (UE_sync_thread)\n"); printf("Started device, unlocked sync_mutex (UE_sync_thread)\n");
...@@ -1425,6 +1470,14 @@ void *UE_thread(void *arg) { ...@@ -1425,6 +1470,14 @@ void *UE_thread(void *arg) {
init_thread(100000, 500000, FIFO_PRIORITY, &cpuset, init_thread(100000, 500000, FIFO_PRIORITY, &cpuset,
"UHD Threads"); "UHD Threads");
/*
while (sync_var<0)
pthread_cond_wait(&sync_cond, &sync_mutex);
pthread_mutex_unlock(&sync_mutex);
*/
wait_sync("UE thread\n");
LOG_I(PHY,"UE_thread Got sync\n");
#ifdef NAS_UE #ifdef NAS_UE
MessageDef *message_p; MessageDef *message_p;
message_p = itti_alloc_new_message(TASK_NAS_UE, INITIALIZE_MESSAGE); message_p = itti_alloc_new_message(TASK_NAS_UE, INITIALIZE_MESSAGE);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment