Commit 0625461f authored by frtabu's avatar frtabu

cleanup in CMakelist.txt and build_oai

parent 1b3c2a32
......@@ -184,7 +184,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
#########################
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2")
......@@ -231,7 +231,7 @@ add_definitions("-DPACKAGE_BUGREPORT=\"openair4g-devel@lists.eurecom.fr\"")
# Debug related options
#########################################
add_boolean_option(ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(EMIT_ASN_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(ASN_EMIT_DEBUG False "ASN1 coder/decoder Debug")
add_boolean_option(MSG_PRINT False "print debug messages")
add_boolean_option(DISABLE_XER_PRINT False "print XER Format")
add_boolean_option(XER_PRINT False "print XER Format")
......@@ -244,15 +244,11 @@ add_boolean_option(TEST_OMG False "???")
add_boolean_option(DEBUG_OMG False "???")
add_boolean_option(PRINT_STATS False "This adds the possibility to see the status")
add_boolean_option(T_TRACER True "Activate the T tracer, a debugging/monitoring framework" )
add_boolean_option(ENABLE_VCD True "always true now, time measurements of proc calls and var displays")
add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs")
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DISABLE_LOG_X False "Deactivate all LOG_* macros")
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode")
add_boolean_option(UE_NAS_USE_TUN False "Enable UE NAS TUN device instead of ue_ip.ko")
add_boolean_option(NOS1 False "Allows to run without a EPC")
add_boolean_option(BASIC_SIMULATOR False "Has to be True when building the basic simulator, False otherwise")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
add_boolean_option(ENABLE_ITTI True "ITTI is internal messaging, should remain enabled for most targets")
......@@ -496,10 +492,7 @@ add_library(F1AP
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR" "OAI_SIMU")
if (NOT ${RF_BOARD} STREQUAL "None")
add_definitions(-DMANAGED_RF=1)
endif()
add_list2_option(RF_BOARD "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR" "OAI_SIMU")
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
......@@ -516,7 +509,6 @@ set (CONFIG_LIBCONFIG_SOURCES
${CONFIG_ROOTDIR}/libconfig/config_libconfig.c
)
add_library(CONFIG_LIB ${CONFIG_SOURCES})
set(CONFIG_LIBRARIES CONFIG_LIB)
add_library(params_libconfig MODULE ${CONFIG_LIBCONFIG_SOURCES} )
target_link_libraries(params_libconfig config)
# shared library loader
......@@ -613,6 +605,7 @@ add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmes
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_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name")
add_boolean_option(MESSAGE_CHART_GENERATOR False "For generating sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchanges in sequence diagrams")
......@@ -1416,7 +1409,6 @@ if (${SMBV})
endif (${SMBV})
if (${COMPILATION_AVX2} STREQUAL "True")
#set(PHY_SRC ${PHY_SRC} ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dlsch_llr_computation_avx2.c)
set(PHY_SRC_UE ${PHY_SRC_UE} ${OPENAIR1_DIR}/PHY/LTE_UE_TRANSPORT/dlsch_llr_computation_avx2.c)
endif ()
......@@ -1637,7 +1629,7 @@ set (MAC_SRC
${MAC_DIR}/eNB_scheduler_phytest.c
${MAC_DIR}/pre_processor.c
${MAC_DIR}/config.c
${MAC_DIR}/config_ue.c
#${MAC_DIR}/config_ue.c
)
set (MAC_NR_SRC
......@@ -1709,11 +1701,6 @@ add_library(L2_UE
${L2_SRC_UE}
${MAC_SRC_UE}
)
if (NOT ${NOS1})
target_compile_definitions(L2_UE PUBLIC -DPDCP_USE_NETLINK)
endif()
add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag)
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
......@@ -2317,7 +2304,7 @@ add_executable(measurement_display
${OPENAIR_DIR}/common/utils/threadPool/measurement_display.c)
target_link_libraries (measurement_display minimal_lib)
# lte-softmodem is both eNB and UE implementation
# lte-softmodem
###################################################
add_executable(lte-softmodem
......@@ -2342,7 +2329,6 @@ add_executable(lte-softmodem
${GTPU_need_ITTI}
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag)
......@@ -2355,7 +2341,7 @@ target_link_libraries (lte-softmodem
-Wl,--end-group z dl)
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem ${T_LIB})
......@@ -2410,7 +2396,6 @@ add_executable(lte-uesoftmodem
${OPENAIR_DIR}/common/utils/system.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
......@@ -2427,7 +2412,7 @@ target_link_libraries (lte-uesoftmodem
-Wl,--end-group z dl)
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 ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-uesoftmodem ${T_LIB})
......@@ -2453,7 +2438,6 @@ add_executable(nr-softmodem
${GTPU_need_ITTI}
${XFORMS_SOURCE_NR}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
......@@ -2466,7 +2450,7 @@ target_link_libraries (nr-softmodem
-Wl,--end-group z dl)
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (nr-softmodem 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 (nr-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-softmodem ${T_LIB})
......@@ -2492,7 +2476,6 @@ add_executable(nr-uesoftmodem
${XFORMS_SOURCE_NR}
${T_SOURCE}
${UTIL_SRC}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
......@@ -2504,7 +2487,7 @@ target_link_libraries (nr-uesoftmodem
-Wl,--end-group z dl)
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
target_link_libraries (nr-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 (nr-uesoftmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${T_LIB})
......@@ -2550,7 +2533,7 @@ add_executable(dlsim_tm4
)
target_link_libraries (dlsim_tm4
-Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ${ITTI_LIB} -Wl,--end-group
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${T_LIB}
pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${T_LIB}
)
add_executable(polartest
......@@ -2667,13 +2650,12 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
${OPENAIR_DIR}/common/utils/system.c
${XFORMS_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
${NFAPI_USER_DIR}/nfapi.c
)
target_link_libraries (${myExe}
-Wl,--start-group SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY PHY_UE PHY_RU LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group
pthread m rt ${CONFIG_LIBRARIES} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
)
endforeach(myExe)
......@@ -2686,7 +2668,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} CONFIG_LIB}
)
add_executable(test_epc_play_scenario
......@@ -2705,7 +2687,7 @@ add_executable(test_epc_play_scenario
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} CONFIG_LIB}
)
......@@ -2725,7 +2707,7 @@ foreach(myExe s1ap
${OPENAIR3_DIR}/TEST/test_${myExe}.c
)
target_link_libraries (test_${myExe}
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIBRARIES}
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} CONFIG_LIB}
)
endforeach(myExe)
......@@ -2860,3 +2842,7 @@ ADD_CUSTOM_TARGET(oarf
)
include (${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_CMakeLists.txt)
......@@ -26,12 +26,14 @@
set -e
# Include helper functions
################################
# include helper functions
################################
ORIGIN_PATH=$PWD
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/tools/build_helper
# Set environment variables (OPENAIR_HOME, ...)
# set environment variables (OPENAIR_HOME, ...)
set_openair_env
# Variables for UE data generation
......@@ -44,8 +46,9 @@ UE_EXPANSION="False"
UESIM_EXPANSION="False"
PRINT_STATS="False"
VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="False" #Only valid when low-latency flag is set to False
DEADLINE_SCHEDULER_FLAG_USER="False"
FORCE_DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False
REL="Rel15"
HW="None"
TP="None"
......@@ -133,7 +136,6 @@ Options
Enable deadline scheduler of Linux kernel (>=3.14.x).
--disable-cpu-affinity
Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads
--enable-cpu-affinity
--disable-T-Tracer
Disables the T tracer.
--disable-hardware-dependency
......@@ -307,10 +309,6 @@ function main() {
DEADLINE_SCHEDULER_FLAG_USER="True"
echo_info "Enabling the usage of deadline scheduler"
shift 1;;
--enable-cpu-affinity)
CPU_AFFINITY_FLAG_USER="True"
echo_info "Enabling CPU Affinity (only valid when not using deadline scheduler)"
shift 1;;
--disable-cpu-affinity)
CPU_AFFINITY_FLAG_USER="False"
echo_info "Disabling CPU Affinity (only valid when not using deadline scheduler)"
......@@ -428,7 +426,6 @@ function main() {
;;
esac
fi
#Disable CPU Affinity for deadline scheduler
if [ "$DEADLINE_SCHEDULER_FLAG_USER" = "True" ] ; then
CPU_AFFINITY_FLAG_USER="False"
......@@ -520,15 +517,6 @@ function main() {
build_dir=ran_build
fi
if [ "$gNB" = "1" ] ; then
exec=nr-softmodem
elif [ "$nrUE" = "1" ] ; then
exec=nr-uesoftmodem
elif [ "$eNB" = "1" ] ; then
exec=lte-softmodem
elif [ "$UE" = "1" ] ; then
exec=lte-uesoftmodem
fi
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib=params_libconfig
......@@ -563,27 +551,29 @@ function main() {
eval $CMAKE_CMD
fi
if [ "$eNB" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" ] ; then
echo_info "Compiling $exec"
compilations \
$build_dir $exec \
$exec $dbin/$exec.$REL
# if --eNB --UE are both provided together as build options
if [ "$eNB" = "1" -a "$UE" = "1" ] ; then
echo_info "Compiling lte-uesoftmodem"
compilations \
$build_dir lte-uesoftmodem \
lte-uesoftmodem $dbin/lte-uesoftmodem.$REL
execlist=""
if [ "$eNB" = "1" ] ; then
execlist="$execlist lte-softmodem"
fi
if [ "$gNB" = "1" ] ; then
execlist="$execlist nr-softmodem"
fi
if [ "$UE" = 1 ] ; then
execlist="$execlist lte-uesoftmodem"
fi
if [ "$nrUE" = 1 ] ; then
execlist="$execlist nr-uesoftmodem"
fi
# if --gNB --nrUE are both provided together as build options
if [ "$gNB" = "1" -a "$nrUE" = "1" ] ; then
echo_info "Compiling nr-uesoftmodem"
for f in $execlist ; do
echo_info "Compiling $f..."
compilations \
$build_dir nr-uesoftmodem \
nr-uesoftmodem $dbin/nr-uesoftmodem.$REL
fi
$build_dir $f \
$f $dbin/$f.$REL
done
# mandatory shared libraries common to UE and (e/g)NB
......@@ -603,10 +593,9 @@ function main() {
$build_dir rb_tool \
rb_tool $dbin/rb_tool
cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
fi
if [ "$UE" = 1 ] ; then
# ue_ip driver compilation
echo_info "Compiling UE specific part"
compilations \
$build_dir ue_ip \
......
......@@ -18,7 +18,7 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "executables/thread-common.h"
#include "executables/nr-uesoftmodem.h"
#include "LAYER2/NR_MAC_UE/mac.h"
......@@ -142,10 +142,8 @@ PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms,
ue = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
memset(ue,0,sizeof(PHY_VARS_NR_UE));
memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS));
ue->Mod_id = UE_id;
ue->mac_enabled = 1;
// initialize all signal buffers
init_nr_ue_signal(ue,1,abstraction_flag);
// intialize transport
......@@ -172,7 +170,6 @@ static void UE_synch(void *arg) {
int freq_offset=0;
UE->is_synchronized = 0;
if (UE->UE_scan == 0) {
get_band(downlink_frequency[CC_id][0], &UE->frame_parms.eutra_band, &uplink_frequency_offset[CC_id][0], &UE->frame_parms.frame_type);
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu32", UL %"PRIu32" (oai_exit %d, rx_num_channels %d)\n",
......@@ -353,7 +350,6 @@ static void UE_synch(void *arg) {
}
void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
nr_dcireq_t dcireq;
nr_scheduled_response_t scheduled_response;
uint32_t nb_rb, start_rb;
......@@ -369,7 +365,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
dcireq.frame = proc->frame_rx;
dcireq.slot = proc->nr_tti_rx;
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
scheduled_response.dl_config = &dcireq.dl_config_req;
scheduled_response.ul_config = &dcireq.ul_config_req;
scheduled_response.tx_request = NULL;
......@@ -377,7 +372,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
scheduled_response.CC_id = 0;
scheduled_response.frame = proc->frame_rx;
scheduled_response.slot = proc->nr_tti_rx;
//--------------------------Temporary configuration-----------------------------//
n_rnti = 0x1234;
nb_rb = 50;
......@@ -389,7 +383,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
harq_pid = 0;
rvidx = 0;
//------------------------------------------------------------------------------//
scheduled_response.ul_config->sfn_slot = NR_UPLINK_SLOT;
scheduled_response.ul_config->number_pdus = 1;
scheduled_response.ul_config->ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
......@@ -404,7 +397,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
nr_ue_scheduled_response(&scheduled_response);
#ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#else
......@@ -413,7 +405,8 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
//printf(">>> nr_ue_pdcch_procedures ended\n");
#endif
if(IS_SOFTMODEM_NOS1){ //&& proc->nr_tti_rx==1
if(IS_SOFTMODEM_NOS1) { //&& proc->nr_tti_rx==1
//Hardcoded rnti value
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO,
......@@ -424,7 +417,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
}
}
// no UL for now
/*
if (UE->mac_enabled==1) {
......@@ -463,29 +455,24 @@ void UE_processing(void *arg) {
processSlotRX(UE, proc);
//printf(">>> mac ended\n");
// Prepare the future Tx data
/*
#ifndef NO_RAT_NR
/*
#ifndef NO_RAT_NR
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT)
#else
#else
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
(UE->frame_parms.frame_type == FDD) )
#endif
*/
if (proc->nr_tti_tx == NR_UPLINK_SLOT || UE->frame_parms.frame_type == FDD){
#endif
*/
if (proc->nr_tti_tx == NR_UPLINK_SLOT || UE->frame_parms.frame_type == FDD) {
thread_id = PHY_vars_UE_g[UE->Mod_id][0]->current_thread_id[proc->nr_tti_tx];
if (UE->mode != loop_through_memory)
phy_procedures_nrUE_TX(UE,proc,0,thread_id);
}
//phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
#if 0
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
......@@ -551,7 +538,6 @@ void trashFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
}
void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
LOG_I(PHY,"Resynchronizing RX by %d samples (mode = %d)\n",UE->rx_offset,UE->mode);
void *dummy_tx[UE->frame_parms.nb_antennas_tx];
......@@ -570,7 +556,6 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
free(dummy_tx[i]);
}
int computeSamplesShift(PHY_VARS_NR_UE *UE) {
......@@ -673,7 +658,6 @@ void *UE_thread(void *arg) {
continue;
}
absolute_slot++;
// whatever means thread_idx
// Fix me: will be wrong when slot 1 is slow, as slot 2 finishes
......@@ -696,14 +680,15 @@ void *UE_thread(void *arg) {
curMsg->proc.frame_tx = ( (absolute_slot + DURATION_RX_TO_TX) /nb_slot_frame ) % MAX_FRAME_NUMBER;
curMsg->proc.decoded_frame_rx=-1;
//LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB);
#ifdef OAI_ADRV9371_ZC706
/*uint32_t total_gain_dB_prev = 0;
if (total_gain_dB_prev != UE->rx_total_gain_dB) {
total_gain_dB_prev = UE->rx_total_gain_dB;
openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB;
UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]);
}*/
#endif
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
......@@ -834,12 +819,10 @@ void init_NR_UE(int nb_inst) {
mac_inst->initial_bwp_ul.cyclic_prefix = UE->frame_parms.Ncp;
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
threadCreate(&threads[inst], UE_thread, (void *)UE, "UEthread", -1, OAI_PRIORITY_RT_MAX);
#ifdef UE_DLSCH_PARALLELISATION
pthread_t dlsch0_threads;
threadCreate(&dlsch0_threads, dlsch_thread, (void *)UE, "DLthread", -1, OAI_PRIORITY_RT_MAX-1);
#endif
}
printf("UE threads created by %ld\n", gettid());
......
......@@ -135,13 +135,6 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
} // PDCP_USE_NETLINK
AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s)\n", errno, strerror(errno));
#if defined(ENABLE_PDCP_PAYLOAD_DEBUG)
LOG_I(PDCP, "Printing first bytes of PDCP SDU before removing it from the list: \n");
for (int i=0; i<30; i++){
LOG_I(PDCP, "%x", sdu_p->data[i]);
}
#endif
list_remove_head (&pdcp_sdu_list);
free_mem_block (sdu_p, __func__);
pdcp_nb_sdu_sent ++;
......@@ -173,7 +166,7 @@ int pdcp_fifo_read_input_sdus_fromtun (const protocol_ctxt_t *const ctxt_pP) {
ctxt.rnti=pdcp_eNB_UE_instance_to_rnti[0];
ctxt.enb_flag=ENB_FLAG_YES;
ctxt.module_id=0;
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_NO);
key = PDCP_COLL_KEY_VALUE(ctxt.module_id, ctxt.rnti, ctxt.enb_flag, rab_id, SRB_FLAG_YES);
h_rc = hashtable_get(pdcp_coll_p, key, (void **)&pdcp_p);
}
......@@ -688,6 +681,7 @@ void pdcp_fifo_read_input_sdus_frompc5s (const protocol_ctxt_t *const ctxt_pP)
break;
} /* end of switch */
}/* end of bytes_received > 0 */
if (pc5s_header != NULL) {
free(pc5s_header);
pc5s_header = NULL;
......@@ -722,7 +716,7 @@ void pdcp_fifo_read_input_sdus_from_otg (const protocol_ctxt_t *const ctxt_pP)
ctxt_pP->subframe,
ctxt_pP->module_id);
for (dst_id = 0; dst_id<NUMBER_OF_UE_MAX; dst_id++) {
for (dst_id = 0; dst_id<MAX_MOBILES_PER_ENB; dst_id++) {
ctxt.rnti = oai_emulation.info.eNB_ue_module_id_to_rnti[ctxt.module_id][dst_id];
}
}
......
......@@ -46,26 +46,17 @@ void nas_COMMON_receive(uint16_t dlen,
void *pdcp_sdu,
int inst,
struct classifier_entity *rclass,
nasRadioBearerId_t rb_id)
{
nasRadioBearerId_t rb_id) {
//---------------------------------------------------------------------------
struct sk_buff *skb;
struct ipversion *ipv;
struct nas_priv *gpriv=netdev_priv(nasdev[inst]);
//int i;
unsigned char protocol;
//struct udphdr *uh;
//struct tcphdr *th;
struct iphdr *network_header;
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_RECEIVE: begin RB %d Inst %d Length %d bytes\n",rb_id,inst,dlen);
#endif
skb = dev_alloc_skb( dlen + 2 );
......@@ -78,18 +69,13 @@ void nas_COMMON_receive(uint16_t dlen,
skb_reserve(skb,2);
memcpy(skb_put(skb, dlen), pdcp_sdu,dlen);
skb->dev = nasdev[inst];
skb_reset_mac_header(skb);
//printk("[NAC_COMMIN_RECEIVE]: Packet Type %d (%d,%d)",skb->pkt_type,PACKET_HOST,PACKET_BROADCAST);
skb->pkt_type = PACKET_HOST;
if (rclass->version != NAS_MPLS_VERSION_CODE) { // This is an IP packet
skb->ip_summed = CHECKSUM_NONE;
ipv = (struct ipversion *)skb->data;
switch (ipv->version) {
......@@ -97,20 +83,15 @@ void nas_COMMON_receive(uint16_t dlen,
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_RECEIVE: receive IPv6 message\n");
#endif
skb_reset_network_header(skb);
skb->protocol = htons(ETH_P_IPV6);
// printk("Writing packet with protocol %x\n",ntohs(skb->protocol));
break;
case 4:
#ifdef NAS_ADDRESS_FIX
// Make the third byte of both the source and destination equal to the fourth of the destination
unsigned char * ifaddr, *saddr, daddr;
unsigned char *ifaddr, *saddr, daddr;
uint32_t odaddr = 0, osaddr;
daddr = (unsigned char *)&((struct iphdr *)skb->data)->daddr;
odaddr = ((struct iphdr *)skb->data)->daddr;
......@@ -152,13 +133,10 @@ void nas_COMMON_receive(uint16_t dlen,
}
printk("[NAS][COMMON][RECEIVE] protocol %d\n",((struct iphdr *)skb->data)->protocol);
#endif
skb_reset_network_header(skb);
network_header = (struct iphdr *)skb_network_header(skb);
protocol = network_header->protocol;
#ifdef NAS_DEBUG_RECEIVE
switch (protocol) {
......@@ -187,9 +165,7 @@ void nas_COMMON_receive(uint16_t dlen,
}
#endif
#ifdef NAS_ADDRESS_FIX
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_RECEIVE: dumping the packet before the csum recalculation (len %d)\n",skb->len);
......@@ -198,8 +174,6 @@ void nas_COMMON_receive(uint16_t dlen,
printk("\n");
#endif //NAS_DEBUG_RECEIVE
network_header->check = 0;
network_header->check = ip_fast_csum((unsigned char *) network_header,
network_header->ihl);
......@@ -209,17 +183,11 @@ void nas_COMMON_receive(uint16_t dlen,
// if (!(skb->nh.iph->frag_off & htons(IP_OFFSET))) {
switch(protocol) {
case IPPROTO_TCP:
uint16_t *cksum,check;
cksum = (uint16_t*)&(((struct tcphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
cksum = (uint16_t *)&(((struct tcphdr *)(((char *)network_header + (network_header->ihl<<2))))->check);
//check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, tcp_hdrlen(skb), IPPROTO_TCP, ~(*cksum));
#ifdef NAS_DEBUG_RECEIVE
printk("[NAS][COMMON] Inst %d TCP packet calculated CS %x, CS = %x (before), SA (%x)%x, DA (%x)%x\n",
inst,
......@@ -232,7 +200,6 @@ void nas_COMMON_receive(uint16_t dlen,
#endif
check = csum_tcpudp_magic(((struct iphdr *)skb->data)->saddr, ((struct iphdr *)skb->data)->daddr,0,0, ~(*cksum));
*cksum = csum_tcpudp_magic(~osaddr, ~odaddr, 0, 0, ~check);
#ifdef NAS_DEBUG_RECEIVE
printk("[NAS][COMMON] Inst %d TCP packet NEW CS %x\n",
inst,
......@@ -241,8 +208,7 @@ void nas_COMMON_receive(uint16_t dlen,
break;
case IPPROTO_UDP:
cksum = (uint16_t*)&(((struct udphdr*)(((char *)network_header + (network_header->ihl<<2))))->check);
cksum = (uint16_t *)&(((struct udphdr *)(((char *)network_header + (network_header->ihl<<2))))->check);
// check = csum_tcpudp_magic(((struct iphdr *)network_header)->saddr, ((struct iphdr *)network_header)->daddr, udp_hdr(skb)->len, IPPROTO_UDP, ~(*cksum));
#ifdef NAS_DEBUG_RECEIVE
printk("[NAS][COMMON] Inst %d UDP packet CS = %x (before), SA (%x)%x, DA (%x)%x\n",
......@@ -256,7 +222,6 @@ void nas_COMMON_receive(uint16_t dlen,
check = csum_tcpudp_magic(((struct iphdr *)skb->data)->saddr, ((struct iphdr *)skb->data)->daddr, 0,0, ~(*cksum));
*cksum= csum_tcpudp_magic(~osaddr, ~odaddr,0,0, ~check);
//*cksum= csum_tcpudp_magic(~osaddr, ~odaddr,udp_hdr(skb)->len, IPPROTO_UDP, ~check);
#ifdef NAS_DEBUG_RECEIVE
printk("[NAS][COMMON] Inst %d UDP packet NEW CS %x\n",
inst,
......@@ -264,10 +229,7 @@ void nas_COMMON_receive(uint16_t dlen,
#endif
// if ((check = *cksum) != 0) {
// src, dst, len, proto, sum
// }
break;
default:
......@@ -275,26 +237,20 @@ void nas_COMMON_receive(uint16_t dlen,
}
// }
#endif //NAS_ADDRESS_FIX
skb->protocol = htons(ETH_P_IP);
// printk("[NAS][COMMON] Writing packet with protocol %x\n",ntohs(skb->protocol));
break;
default:
printk("NAS_COMMON_RECEIVE: begin RB %d Inst %d Length %d bytes\n",rb_id,inst,dlen);
printk("[NAS][COMMON] Inst %d: receive unknown message (version=%d)\n",inst,ipv->version);
}
} else { // This is an MPLS packet
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_RECEIVE: Received an MPLS packet on RB %d\n",rb_id);
#endif
skb->protocol = htons(ETH_P_MPLS_UC);
}
++gpriv->stats.rx_packets;
......@@ -315,8 +271,7 @@ void nas_COMMON_receive(uint16_t dlen,
//---------------------------------------------------------------------------
// Delete the data
void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *sp,int inst,struct nas_priv *gpriv)
{
void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *sp,int inst,struct nas_priv *gpriv) {
struct nas_priv *priv=netdev_priv(nasdev[inst]);
//---------------------------------------------------------------------------
++priv->stats.tx_dropped;
......@@ -325,8 +280,7 @@ void nas_COMMON_del_send(struct sk_buff *skb, struct cx_entity *cx, struct class
//---------------------------------------------------------------------------
// Request the transfer of data (QoS SAP)
void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst, struct nas_priv *gpriv)
{
void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct classifier_entity *gc,int inst, struct nas_priv *gpriv) {
//---------------------------------------------------------------------------
struct pdcp_data_req_header_s pdcph;
struct nas_priv *priv=netdev_priv(nasdev[inst]);
......@@ -388,9 +342,6 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
pdcph.inst = inst;
pdcph.sourceL2Id = 0;
pdcph.destinationL2Id = 0;
#ifdef PDCP_USE_NETLINK
bytes_wrote = nas_netlink_send((char *)&pdcph,NAS_PDCPH_SIZE);
#ifdef NAS_DEBUG_SEND
......@@ -407,7 +358,7 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
if (bytes_wrote != NAS_PDCPH_SIZE) {
printk("NAS_COMMON_QOS_SEND: problem while writing PDCP's header (bytes wrote = %d )\n",bytes_wrote);
printk("rb_id %d, Wrote %d, Header Size %lu\n", pdcph.rb_id , bytes_wrote, NAS_PDCPH_SIZE);
printk("rb_id %d, Wrote %d, Header Size %lu\n", pdcph.rb_id, bytes_wrote, NAS_PDCPH_SIZE);
#ifndef PDCP_USE_NETLINK
rtf_reset(NAS2PDCP_FIFO);
#endif //PDCP_USE_NETLINK
......@@ -441,7 +392,6 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
printk("\n");
#endif
priv->stats.tx_bytes += skb->len;
priv->stats.tx_packets ++;
#ifdef NAS_DEBUG_SEND
......@@ -451,8 +401,7 @@ void nas_COMMON_QOS_send(struct sk_buff *skb, struct cx_entity *cx, struct class
#ifndef PDCP_USE_NETLINK
//---------------------------------------------------------------------------
void nas_COMMON_QOS_receive()
{
void nas_COMMON_QOS_receive() {
//---------------------------------------------------------------------------
uint8_t sapi;
struct pdcp_data_ind_header_s pdcph;
......@@ -460,14 +409,11 @@ void nas_COMMON_QOS_receive()
struct classifier_entity *rclass;
struct nas_priv *priv;
int bytes_read;
// Start debug information
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_QOS_RECEIVE - begin \n");
#endif
// End debug information
bytes_read = rtf_get(PDCP2PDCP_USE_RT_FIFO,&pdcph, NAS_PDCPH_SIZE);
while (bytes_read>0) {
......@@ -478,11 +424,9 @@ void nas_COMMON_QOS_receive()
priv=netdev_priv(nasdev[pdcph.inst]);
rclass = nas_COMMON_search_class_for_rb(pdcph.rb_id,priv);
bytes_read+= rtf_get(PDCP2PDCP_USE_RT_FIFO,
data_buffer,
pdcph.data_size);
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_QOS_RECEIVE - Got header for RB %d, Inst %d \n",
pdcph.rb_id,
......@@ -493,7 +437,6 @@ void nas_COMMON_QOS_receive()
#ifdef NAS_DEBUG_RECEIVE
printk("[NAS][COMMON] Found corresponding connection in classifier for RAB\n");
#endif //NAS_DEBUG_RECEIVE
nas_COMMON_receive(pdcph.data_size,
(void *)data_buffer,
pdcph.inst,
......@@ -504,49 +447,38 @@ void nas_COMMON_QOS_receive()
bytes_read = rtf_get(PDCP2PDCP_USE_RT_FIFO, &pdcph, NAS_PDCPH_SIZE);
}
#ifdef NAS_DEBUG_RECEIVE
printk("NAS_COMMON_QOS_RECEIVE - end \n");
#endif
}
#else
void nas_COMMON_QOS_receive(struct nlmsghdr *nlh)
{
void nas_COMMON_QOS_receive(struct nlmsghdr *nlh) {
struct pdcp_data_ind_header_s *pdcph = (struct pdcp_data_ind_header_s *)NLMSG_DATA(nlh);
struct classifier_entity *rclass;
struct nas_priv *priv;
priv = netdev_priv(nasdev[pdcph->inst]);
#ifdef NAS_DEBUG_RECEIVE
printk("[NAS][COMMON][NETLINK] QOS receive from PDCP, size %d, rab %d, inst %d\n",
pdcph->data_size,pdcph->rb_id,pdcph->inst);
#endif //NAS_DEBUG_RECEIVE
rclass = nas_COMMON_search_class_for_rb(pdcph->rb_id,priv);
if (rclass) {
#ifdef NAS_DEBUG_RECEIVE
printk("[NAS][COMMON][NETLINK] Found corresponding connection in classifier for RAB\n");
#endif //NAS_DEBUG_RECEIVE
nas_COMMON_receive(pdcph->data_size,
(unsigned char *)NLMSG_DATA(nlh) + NAS_PDCPH_SIZE,
pdcph->inst,
rclass,
pdcph->rb_id);
}
}
#endif //PDCP_USE_NETLINK
//---------------------------------------------------------------------------
struct cx_entity *nas_COMMON_search_cx(nasLocalConnectionRef_t lcr,struct nas_priv *priv)
{
struct cx_entity *nas_COMMON_search_cx(nasLocalConnectionRef_t lcr,struct nas_priv *priv) {
//---------------------------------------------------------------------------
#ifdef NAS_DEBUG_CLASS
printk("NAS_COMMON_SEARCH_CX - lcr %d\n",lcr);
......@@ -560,8 +492,7 @@ struct cx_entity *nas_COMMON_search_cx(nasLocalConnectionRef_t lcr,struct nas_pr
//---------------------------------------------------------------------------
// Search a Radio Bearer
struct rb_entity *nas_COMMON_search_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id)
{
struct rb_entity *nas_COMMON_search_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id) {
//---------------------------------------------------------------------------
struct rb_entity *rb;
#ifdef NAS_DEBUG_CLASS
......@@ -586,22 +517,18 @@ struct rb_entity *nas_COMMON_search_rb(struct cx_entity *cx, nasRadioBearerId_t
return NULL;
}
//
// Search for a classifier with corresponding radio bearer
struct classifier_entity *nas_COMMON_search_class_for_rb(nasRadioBearerId_t rab_id,struct nas_priv *priv)
{
//
// Search for a classifier with corresponding radio bearer
struct classifier_entity *nas_COMMON_search_class_for_rb(nasRadioBearerId_t rab_id,struct nas_priv *priv) {
//struct rb_entity *rb;
int dscp;
struct classifier_entity *rclass;
#ifdef NAS_DEBUG_CLASS
printk("[NAS][COMMON] NAS_COMMON_SEARCH_CLASS_FOR_RB - rab_id %d\n", rab_id);
#endif
for (dscp=0; dscp<NAS_DSCP_MAX; dscp++) {
// printk("[NAS][COMMON] priv->rclassifier[%d] = %p\n",dscp,priv->rclassifier[dscp]);
for (rclass=priv->rclassifier[dscp]; rclass!=NULL; rclass=rclass->next) {
#ifdef NAS_DEBUG_CLASS
......@@ -614,12 +541,10 @@ struct rb_entity *nas_COMMON_search_rb(struct cx_entity *cx, nasRadioBearerId_t
}
return NULL;
}
//---------------------------------------------------------------------------
struct rb_entity *nas_COMMON_add_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id, nasQoSTrafficClass_t qos)
{
struct rb_entity *nas_COMMON_add_rb(struct cx_entity *cx, nasRadioBearerId_t rab_id, nasQoSTrafficClass_t qos) {
//--------------------------------------------------------------------------
struct rb_entity *rb;
#ifdef NAS_DEBUG_CLASS
......@@ -663,8 +588,7 @@ struct rb_entity *nas_COMMON_add_rb(struct cx_entity *cx, nasRadioBearerId_t rab
}
//---------------------------------------------------------------------------
void nas_COMMON_flush_rb(struct cx_entity *cx)
{
void nas_COMMON_flush_rb(struct cx_entity *cx) {
//---------------------------------------------------------------------------
struct rb_entity *rb;
struct classifier_entity *gc;
......
......@@ -30,9 +30,9 @@
#include <stdio.h>
#include <uhd/version.hpp>
#if UHD_VERSION < 3110000
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/thread_priority.hpp>
#else
#include <uhd/utils/thread.hpp>
#include <uhd/utils/thread.hpp>
#endif
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/version.hpp>
......@@ -52,15 +52,15 @@
#include <sys/resource.h>
#ifdef __SSE4_1__
# include <smmintrin.h>
#include <smmintrin.h>
#endif
#ifdef __AVX2__
# include <immintrin.h>
#include <immintrin.h>
#endif
#ifdef __arm__
# include <arm_neon.h>
#include <arm_neon.h>
#endif
/** @addtogroup _USRP_PHY_RF_INTERFACE_
......@@ -258,41 +258,41 @@ static int sync_to_gps(openair0_device *device) {
}
#if defined(USRP_REC_PLAY)
#include "usrp_lib.h"
static FILE *pFile = NULL;
int mmapfd = 0;
int iqfd = 0;
int use_mmap = 1; // default is to use mmap
struct stat sb;
iqrec_t *ms_sample = NULL; // memory for all subframes
unsigned int nb_samples = 0;
unsigned int cur_samples = 0;
int64_t wrap_count = 0;
int64_t wrap_ts = 0;
unsigned int u_sf_mode = 0; // 1=record, 2=replay
unsigned int u_sf_record = 0; // record mode
unsigned int u_sf_replay = 0; // replay mode
char u_sf_filename[1024] = ""; // subframes file path
unsigned int u_sf_max = DEF_NB_SF; // max number of recorded subframes
unsigned int u_sf_loops = DEF_SF_NB_LOOP; // number of loops in replay mode
unsigned int u_sf_read_delay = DEF_SF_DELAY_READ; // read delay in replay mode
unsigned int u_sf_write_delay = DEF_SF_DELAY_WRITE; // write delay in replay mode
char config_opt_sf_file[] = CONFIG_OPT_SF_FILE;
char config_def_sf_file[] = DEF_SF_FILE;
char config_hlp_sf_file[] = CONFIG_HLP_SF_FILE;
char config_opt_sf_rec[] = CONFIG_OPT_SF_REC;
char config_hlp_sf_rec[] = CONFIG_HLP_SF_REC;
char config_opt_sf_rep[] = CONFIG_OPT_SF_REP;
char config_hlp_sf_rep[] = CONFIG_HLP_SF_REP;
char config_opt_sf_max[] = CONFIG_OPT_SF_MAX;
char config_hlp_sf_max[] = CONFIG_HLP_SF_MAX;
char config_opt_sf_loops[] = CONFIG_OPT_SF_LOOPS;
char config_hlp_sf_loops[] = CONFIG_HLP_SF_LOOPS;
char config_opt_sf_rdelay[] = CONFIG_OPT_SF_RDELAY;
char config_hlp_sf_rdelay[] = CONFIG_HLP_SF_RDELAY;
char config_opt_sf_wdelay[] = CONFIG_OPT_SF_WDELAY;
char config_hlp_sf_wdelay[] = CONFIG_HLP_SF_WDELAY;
#include "usrp_lib.h"
static FILE *pFile = NULL;
int mmapfd = 0;
int iqfd = 0;
int use_mmap = 1; // default is to use mmap
struct stat sb;
iqrec_t *ms_sample = NULL; // memory for all subframes
unsigned int nb_samples = 0;
unsigned int cur_samples = 0;
int64_t wrap_count = 0;
int64_t wrap_ts = 0;
unsigned int u_sf_mode = 0; // 1=record, 2=replay
unsigned int u_sf_record = 0; // record mode
unsigned int u_sf_replay = 0; // replay mode
char u_sf_filename[1024] = ""; // subframes file path
unsigned int u_sf_max = DEF_NB_SF; // max number of recorded subframes
unsigned int u_sf_loops = DEF_SF_NB_LOOP; // number of loops in replay mode
unsigned int u_sf_read_delay = DEF_SF_DELAY_READ; // read delay in replay mode
unsigned int u_sf_write_delay = DEF_SF_DELAY_WRITE; // write delay in replay mode
char config_opt_sf_file[] = CONFIG_OPT_SF_FILE;
char config_def_sf_file[] = DEF_SF_FILE;
char config_hlp_sf_file[] = CONFIG_HLP_SF_FILE;
char config_opt_sf_rec[] = CONFIG_OPT_SF_REC;
char config_hlp_sf_rec[] = CONFIG_HLP_SF_REC;
char config_opt_sf_rep[] = CONFIG_OPT_SF_REP;
char config_hlp_sf_rep[] = CONFIG_HLP_SF_REP;
char config_opt_sf_max[] = CONFIG_OPT_SF_MAX;
char config_hlp_sf_max[] = CONFIG_HLP_SF_MAX;
char config_opt_sf_loops[] = CONFIG_OPT_SF_LOOPS;
char config_hlp_sf_loops[] = CONFIG_HLP_SF_LOOPS;
char config_opt_sf_rdelay[] = CONFIG_OPT_SF_RDELAY;
char config_hlp_sf_rdelay[] = CONFIG_HLP_SF_RDELAY;
char config_opt_sf_wdelay[] = CONFIG_OPT_SF_WDELAY;
char config_hlp_sf_wdelay[] = CONFIG_HLP_SF_WDELAY;
#endif
......@@ -351,7 +351,6 @@ static void trx_usrp_end(openair0_device *device) {
done = 1;
if (u_sf_mode != 2) { // not subframes replay
#endif
usrp_state_t *s = (usrp_state_t *)device->priv;
......@@ -441,20 +440,19 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
#endif
usrp_state_t *s = (usrp_state_t *)device->priv;
int nsamps2; // aligned to upper 32 or 16 byte boundary
#if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__
#ifdef __AVX2__
nsamps2 = (nsamps+7)>>3;
__m256i buff_tx[2][nsamps2];
#else
#else
nsamps2 = (nsamps+3)>>2;
__m128i buff_tx[2][nsamps2];
#endif
#endif
#elif defined(__arm__)
nsamps2 = (nsamps+3)>>2;
int16x8_t buff_tx[2][nsamps2];
#else
#error Unsupported CPU architecture, USRP device cannot be built
#error Unsupported CPU architecture, USRP device cannot be built
#endif
// bring RX data into 12 LSBs for softmodem RX
......@@ -1061,8 +1059,8 @@ extern "C" {
sscanf(uhd::get_version_string().c_str(),"%d.%d.%d",&vers,&subvers,&subsubvers);
LOG_I(PHY,"Checking for USRPs : UHD %s (%d.%d.%d)\n",
uhd::get_version_string().c_str(),vers,subvers,subsubvers);
std::string args;
if (openair0_cfg[0].sdr_addrs == NULL) {
args = "type=b200";
} else {
......@@ -1091,6 +1089,7 @@ extern "C" {
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=7680, recv_frame_size=7680" ;
}
if (device_adds[0].get("type") == "n3xx") {
printf("Found USRP n300\n");
device->type=USRP_X300_DEV; //treat it as X300 for now
......@@ -1111,11 +1110,11 @@ extern "C" {
if (openair0_cfg[0].clock_source == internal) {
s->usrp->set_clock_source("internal");
printf("Setting clock source to internal\n");
}
else {
} else {
s->usrp->set_clock_source("external");
printf("Setting clock source to external\n");
}
if (device->type==USRP_X300_DEV) {
openair0_cfg[0].rx_gain_calib_table = calib_table_x310;
#if defined(USRP_REC_PLAY)
......
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