Commit c1bbb1b2 authored by laurent's avatar laurent Committed by frtabu

fix compilation, still no attach complete

parent ee0e6bc4
...@@ -251,6 +251,7 @@ add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace") ...@@ -251,6 +251,7 @@ 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(DISABLE_LOG_X False "Deactivate all LOG_* macros")
add_boolean_option(USRP_REC_PLAY False "Enable USRP record playback mode") 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(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(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(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
...@@ -618,11 +619,6 @@ add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION w ...@@ -618,11 +619,6 @@ add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION w
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE") add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE") add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
########################
# Include order
##########################
add_boolean_option(ENB_MODE True "Swap the include directories between openair2 and openair3" )
########################## ##########################
# SCHEDULING/REAL-TIME/PERF options # SCHEDULING/REAL-TIME/PERF options
########################## ##########################
...@@ -722,19 +718,13 @@ include_directories("${OPENAIR_BIN_DIR}") ...@@ -722,19 +718,13 @@ include_directories("${OPENAIR_BIN_DIR}")
#include_directories("${include_dirs_all}") #include_directories("${include_dirs_all}")
# Legacy exact order # Legacy exact order
if(ENB_MODE)
include_directories("${OPENAIR2_DIR}/COMMON") include_directories("${OPENAIR2_DIR}/COMMON")
include_directories("${OPENAIR2_DIR}/UTIL") include_directories("${OPENAIR2_DIR}/UTIL")
include_directories("${OPENAIR2_DIR}/UTIL/LOG") include_directories("${OPENAIR2_DIR}/UTIL/LOG")
include_directories("${OPENAIR3_DIR}/COMMON") include_directories("${OPENAIR3_DIR}/COMMON")
include_directories("${OPENAIR3_DIR}/UTILS") include_directories("${OPENAIR3_DIR}/UTILS")
else()
include_directories("${OPENAIR3_DIR}/COMMON")
include_directories("${OPENAIR3_DIR}/UTILS")
include_directories("${OPENAIR2_DIR}/COMMON")
include_directories("${OPENAIR2_DIR}/UTIL")
include_directories("${OPENAIR2_DIR}/UTIL/LOG")
endif()
include_directories("${NFAPI_DIR}/nfapi/public_inc") include_directories("${NFAPI_DIR}/nfapi/public_inc")
include_directories("${NFAPI_DIR}/common/public_inc") include_directories("${NFAPI_DIR}/common/public_inc")
include_directories("${NFAPI_DIR}/pnf/public_inc") include_directories("${NFAPI_DIR}/pnf/public_inc")
...@@ -1388,6 +1378,10 @@ add_library(L2_UE ...@@ -1388,6 +1378,10 @@ add_library(L2_UE
${L2_SRC_UE} ${L2_SRC_UE}
${MAC_SRC_UE} ${MAC_SRC_UE}
) )
if (NOT ${NOS1})
target_compile_definitions(L2_UE INTERFACE -DPDCP_USE_NETLINK)
endif()
add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag) add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag)
include_directories(${NFAPI_USER_DIR}) include_directories(${NFAPI_USER_DIR})
...@@ -2041,6 +2035,9 @@ add_executable(lte-uesoftmodem ...@@ -2041,6 +2035,9 @@ add_executable(lte-uesoftmodem
) )
add_dependencies(lte-uesoftmodem rrc_flag s1ap_flag x2_flag) add_dependencies(lte-uesoftmodem rrc_flag s1ap_flag x2_flag)
if (NOT ${NOS1})
target_compile_definitions(lte-uesoftmodem PRIVATE -DPDCP_USE_NETLINK)
endif()
target_link_libraries (lte-uesoftmodem target_link_libraries (lte-uesoftmodem
-Wl,--start-group -Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_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 RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_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
...@@ -2239,6 +2236,16 @@ endif (${T_TRACER}) ...@@ -2239,6 +2236,16 @@ endif (${T_TRACER})
# this is documented as https://www.kernel.org/doc/Documentation/kbuild/modules.txt # this is documented as https://www.kernel.org/doc/Documentation/kbuild/modules.txt
###################################### ######################################
# retrieve the compiler options to send it to gccxml
get_directory_property(DirDefs COMPILE_DEFINITIONS )
foreach( d ${DirDefs} )
set(module_cc_opt "${module_cc_opt} -D${d}")
endforeach()
get_directory_property( DirDefs INCLUDE_DIRECTORIES )
foreach( d ${DirDefs} )
set(module_cc_opt "${module_cc_opt} -I${d}")
endforeach()
EXECUTE_PROCESS(COMMAND uname -r EXECUTE_PROCESS(COMMAND uname -r
OUTPUT_VARIABLE os_release OUTPUT_VARIABLE os_release
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
...@@ -2265,6 +2272,7 @@ endfunction(make_driver name dir src) ...@@ -2265,6 +2272,7 @@ endfunction(make_driver name dir src)
# nashmesh module # nashmesh module
################ ################
list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c) list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK")
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag # legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere # so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
if (OAI_NW_DRIVER_USE_NETLINK) if (OAI_NW_DRIVER_USE_NETLINK)
......
...@@ -52,7 +52,7 @@ CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False ...@@ -52,7 +52,7 @@ CPU_AFFINITY_FLAG_USER="False" #Only valid when lowlatecy flag is set to False
REL="Rel14" REL="Rel14"
HW="None" HW="None"
TP="None" TP="None"
NOS1=0 NOS1="False"
EPC=0 EPC=0
VERBOSE_COMPILE=0 VERBOSE_COMPILE=0
CFLAGS_PROCESSOR_USER="" CFLAGS_PROCESSOR_USER=""
...@@ -289,7 +289,7 @@ function main() { ...@@ -289,7 +289,7 @@ function main() {
echo_info "Will copy OpenAirInterface files in Linux directories" echo_info "Will copy OpenAirInterface files in Linux directories"
shift;; shift;;
--noS1) --noS1)
NOS1=1 NOS1="True"
echo_info "Will compile without S1 interface" echo_info "Will compile without S1 interface"
shift;; shift;;
--verbose-compile) --verbose-compile)
...@@ -495,7 +495,7 @@ function main() { ...@@ -495,7 +495,7 @@ function main() {
if [ "$T_TRACER" = "False" ] ; then if [ "$T_TRACER" = "False" ] ; then
noLOGDirsuffix="_noLOG" noLOGDirsuffix="_noLOG"
fi fi
if [ "$NOS1" = "1" ] ; then if [ "$NOS1" = "True" ] ; then
noS1Dir="_noS1" noS1Dir="_noS1"
bin_suffix="-nos1" bin_suffix="-nos1"
else else
...@@ -515,7 +515,7 @@ function main() { ...@@ -515,7 +515,7 @@ function main() {
mkdir -p $DIR/$lte_build_dir/build mkdir -p $DIR/$lte_build_dir/build
cmake_file=$DIR/$lte_build_dir/CMakeLists.txt cmake_file=$DIR/$lte_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
if [ "$NOS1" = "1" ] ; then if [ "$NOS1" = "True" ] ; then
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
fi fi
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
...@@ -536,10 +536,8 @@ function main() { ...@@ -536,10 +536,8 @@ function main() {
echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file echo "set (UE_TIMING_TRACE $UE_TIMING_TRACE)" >> $cmake_file
echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file echo "set (DISABLE_LOG_X $DISABLE_LOG_X)" >> $cmake_file
echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file echo "set (USRP_REC_PLAY $USRP_REC_PLAY)" >> $cmake_file
if [ "$UE" = 1 -a "$NOS1" = "0" ] ; then echo "set (UE_NAS_USE_TUN $UE_NAS_USE_TUN)" >> $cmake_file
echo_info "Compiling UE S1 build : enabling NETLINK" echo "set (NOS1 $NOS1)" >> $cmake_file
echo "set (PDCP_USE_NETLINK True )" >> $cmake_file
fi
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$lte_build_dir/build cd $DIR/$lte_build_dir/build
eval $CMAKE_CMD eval $CMAKE_CMD
...@@ -560,7 +558,7 @@ function main() { ...@@ -560,7 +558,7 @@ function main() {
$lte_build_dir coding \ $lte_build_dir coding \
libcoding.so $dbin/libcoding.so libcoding.so $dbin/libcoding.so
if [ "$NOS1" = "1" ] ; then if [ "$NOS1" = "True" ] ; then
compilations \ compilations \
$lte_build_dir nasmesh \ $lte_build_dir nasmesh \
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
...@@ -585,7 +583,7 @@ function main() { ...@@ -585,7 +583,7 @@ function main() {
$lte_build_dir coding \ $lte_build_dir coding \
libcoding.so $dbin/libcoding.so libcoding.so $dbin/libcoding.so
if [ "$NOS1" = "1" ] ; then if [ "$NOS1" = "True" ] ; then
compilations \ compilations \
$lte_build_dir nasmesh \ $lte_build_dir nasmesh \
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
...@@ -596,9 +594,11 @@ function main() { ...@@ -596,9 +594,11 @@ function main() {
else else
# ue_ip driver compilation # ue_ip driver compilation
echo_info "Compiling UE specific part" echo_info "Compiling UE specific part"
if [ "$UE_NAS_USE_TUN" = "False" ] ; then
compilations \ compilations \
$lte_build_dir ue_ip \ $lte_build_dir ue_ip \
CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko CMakeFiles/ue_ip/ue_ip.ko $dbin/ue_ip.ko
fi
# mkdir -p $DIR/at_commands/build # mkdir -p $DIR/at_commands/build
# cd $DIR/at_commands/build # cd $DIR/at_commands/build
...@@ -774,7 +774,7 @@ function main() { ...@@ -774,7 +774,7 @@ function main() {
fi fi
# build trasport protocol libraries (currently only ETHERNET is available) # build transport protocol libraries (currently only ETHERNET is available)
if [ "$TP" != "None" ] ; then if [ "$TP" != "None" ] ; then
rm -f liboai_transpro.so rm -f liboai_transpro.so
rm -f $dbin/liboai_transpro.so rm -f $dbin/liboai_transpro.so
......
...@@ -23,9 +23,16 @@ ...@@ -23,9 +23,16 @@
#ifndef BACKTRACE_H_ #ifndef BACKTRACE_H_
#define BACKTRACE_H_ #define BACKTRACE_H_
#ifdef __cplusplus
extern "C" {
#endif
void display_backtrace(void); void display_backtrace(void);
void backtrace_handle_signal(siginfo_t *info); void backtrace_handle_signal(siginfo_t *info);
#ifdef __cplusplus
}
#endif
#endif /* BACKTRACE_H_ */ #endif /* BACKTRACE_H_ */
...@@ -3436,7 +3436,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t ...@@ -3436,7 +3436,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) { SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) {
mac_rlc_status_resp_t rlc_status; //, rlc_status_data; mac_rlc_status_resp_t rlc_status={0}; //, rlc_status_data;
uint32_t absSF = (frameP*10)+subframeP; uint32_t absSF = (frameP*10)+subframeP;
UE_MAC_INST *ue = &UE_mac_inst[module_idP]; UE_MAC_INST *ue = &UE_mac_inst[module_idP];
int rvtab[4] = {0,2,3,1}; int rvtab[4] = {0,2,3,1};
...@@ -3476,7 +3476,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -3476,7 +3476,7 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
(ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC (ue->sltx_active == 1)) { // every 4th subframe, check for new data from RLC
// 10 PRBs, mcs 19 // 10 PRBs, mcs 19
int TBS = 4584/8; int TBS = 4584/8;
int req; int req=0;
if (TBS <= rlc_status.bytes_in_buffer) req = TBS; if (TBS <= rlc_status.bytes_in_buffer) req = TBS;
......
...@@ -38,34 +38,35 @@ ...@@ -38,34 +38,35 @@
#include "common_lib.h" #include "common_lib.h"
#include "common/utils/load_module_shlib.h" #include "common/utils/load_module_shlib.h"
#include <common/utils/LOG/log.h>
int set_device(openair0_device *device) { int set_device(openair0_device *device) {
switch (device->type) { switch (device->type) {
case EXMIMO_DEV: case EXMIMO_DEV:
printf("[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_I(HW,"[%s] has loaded EXPRESS MIMO device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break; break;
case USRP_B200_DEV: case USRP_B200_DEV:
printf("[%s] has loaded USRP B200 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_I(HW,"[%s] has loaded USRP B200 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break; break;
case USRP_X300_DEV: case USRP_X300_DEV:
printf("[%s] has loaded USRP X300 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_I(HW,"[%s] has loaded USRP X300 device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break; break;
case BLADERF_DEV: case BLADERF_DEV:
printf("[%s] has loaded BLADERF device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_I(HW,"[%s] has loaded BLADERF device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break; break;
case LMSSDR_DEV: case LMSSDR_DEV:
printf("[%s] has loaded LMSSDR device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_I(HW,"[%s] has loaded LMSSDR device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break; break;
case IRIS_DEV: case IRIS_DEV:
printf("[%s] has loaded Iris device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_I(HW,"[%s] has loaded Iris device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break; break;
case NONE_DEV: case NONE_DEV:
printf("[%s] has not loaded a HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_W(HW,"[%s] has not loaded a HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
break; break;
default: default:
printf("[%s] invalid HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_E(HW,"[%s] invalid HW device.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return -1; return -1;
} }
return 0; return 0;
...@@ -76,15 +77,15 @@ int set_transport(openair0_device *device) { ...@@ -76,15 +77,15 @@ int set_transport(openair0_device *device) {
switch (device->transp_type) { switch (device->transp_type) {
case ETHERNET_TP: case ETHERNET_TP:
printf("[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_I(HW,"[%s] has loaded ETHERNET trasport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return 0; return 0;
break; break;
case NONE_TP: case NONE_TP:
printf("[%s] has not loaded a transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_W(HW,"[%s] has not loaded a transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return 0; return 0;
break; break;
default: default:
printf("[%s] invalid transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU")); LOG_E(HW,"[%s] invalid transport protocol.\n",((device->host_type == RAU_HOST) ? "RAU": "RRU"));
return -1; return -1;
break; break;
} }
...@@ -109,7 +110,7 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param ...@@ -109,7 +110,7 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
} }
ret=load_module_shlib(libname,shlib_fdesc,1,NULL); ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
if (ret < 0) { if (ret < 0) {
fprintf(stderr,"Library %s couldn't be loaded\n",libname); LOG_E(HW,"Library %s couldn't be loaded\n",libname);
} else { } else {
ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg); ret=((devfunc_t)shlib_fdesc[0].fptr)(device,openair0_cfg,cfg);
} }
...@@ -125,7 +126,7 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf ...@@ -125,7 +126,7 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
if ( rc >= 0) { if ( rc >= 0) {
if ( set_device(device) < 0) { if ( set_device(device) < 0) {
fprintf(stderr, "%s %d:Unsupported radio head\n",__FILE__, __LINE__); LOG_E(HW,"Unsupported radio head\n");
return -1; return -1;
} }
} }
...@@ -137,7 +138,7 @@ int openair0_transport_load(openair0_device *device, openair0_config_t *openair0 ...@@ -137,7 +138,7 @@ int openair0_transport_load(openair0_device *device, openair0_config_t *openair0
rc=load_lib(device, openair0_cfg, eth_params, RAU_REMOTE_RADIO_HEAD); rc=load_lib(device, openair0_cfg, eth_params, RAU_REMOTE_RADIO_HEAD);
if ( rc >= 0) { if ( rc >= 0) {
if ( set_transport(device) < 0) { if ( set_transport(device) < 0) {
fprintf(stderr, "%s %d:Unsupported transport protocol\n",__FILE__, __LINE__); LOG_E(HW,"Unsupported transport protocol\n");
return -1; return -1;
} }
} }
......
...@@ -785,18 +785,11 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -785,18 +785,11 @@ static void *UE_thread_rxn_txnp4(void *arg) {
threadname); threadname);
while (!oai_exit) { while (!oai_exit) {
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) { AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error locking mutex for UE RXTX\n" );
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" ); while (proc->instance_cnt_rxtx < 0)
exit_fun("nothing to add");
}
while (proc->instance_cnt_rxtx < 0) {
// most of the time, the thread is waiting here // most of the time, the thread is waiting here
pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx ); pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx );
} AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" );
if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RXn_TXnp4\n" );
exit_fun("nothing to add");
}
initRefTimes(t2); initRefTimes(t2);
initRefTimes(t3); initRefTimes(t3);
...@@ -870,18 +863,12 @@ static void *UE_thread_rxn_txnp4(void *arg) { ...@@ -870,18 +863,12 @@ static void *UE_thread_rxn_txnp4(void *arg) {
phy_procedures_UE_S_TX(UE,0,0); phy_procedures_UE_S_TX(UE,0,0);
updateTimes(current, &t3, 10000, "Delay to process sub-frame (case 3)"); updateTimes(current, &t3, 10000, "Delay to process sub-frame (case 3)");
if (pthread_mutex_lock(&proc->mutex_rxtx) != 0) { AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error locking mutex for UE RXTX\n" );
LOG_E( PHY, "[SCHED][UE] error locking mutex for UE RXTX\n" );
exit_fun("noting to add");
}
proc->instance_cnt_rxtx--; proc->instance_cnt_rxtx--;
#if BASIC_SIMULATOR #if BASIC_SIMULATOR
if (pthread_cond_signal(&proc->cond_rxtx) != 0) abort(); AssertFatal (pthread_cond_signal(&proc->cond_rxtx) == 0, "");
#endif #endif
if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) { AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, "[SCHED][UE] error unlocking mutex for UE RXTX\n" );
LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RXTX\n" );
exit_fun("noting to add");
}
} }
// thread finished // thread finished
...@@ -1025,7 +1012,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) { ...@@ -1025,7 +1012,6 @@ static void *UE_phy_stub_single_thread_rxn_txnp4(void *arg) {
} }
while (phy_stub_ticking->ticking_var < 0) { while (phy_stub_ticking->ticking_var < 0) {
// most of the time, the thread is waiting here // most of the time, the thread is waiting here
//pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx )
LOG_D(MAC,"Waiting for ticking_var\n"); LOG_D(MAC,"Waiting for ticking_var\n");
pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking); pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking);
} }
...@@ -1377,7 +1363,6 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) { ...@@ -1377,7 +1363,6 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg) {
} }
while (phy_stub_ticking->ticking_var < 0) { while (phy_stub_ticking->ticking_var < 0) {
// most of the time, the thread is waiting here // most of the time, the thread is waiting here
//pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx )
LOG_D(MAC,"Waiting for ticking_var\n"); LOG_D(MAC,"Waiting for ticking_var\n");
pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking); pthread_cond_wait( &phy_stub_ticking->cond_ticking, &phy_stub_ticking->mutex_ticking);
} }
...@@ -1742,7 +1727,7 @@ void *UE_thread(void *arg) { ...@@ -1742,7 +1727,7 @@ void *UE_thread(void *arg) {
// compute TO compensation that should be applied for this frame // compute TO compensation that should be applied for this frame
if (UE->no_timing_correction == 0) { if (UE->no_timing_correction == 0) {
if ( getenv(RFSIMULATOR) != NULL && UE->rx_offset) { if ( getenv("RFSIMULATOR") != NULL && UE->rx_offset) {
//LOG_E(HW,"in simu, rx_offset is not null (impossible): %d\n", UE->rx_offset); //LOG_E(HW,"in simu, rx_offset is not null (impossible): %d\n", UE->rx_offset);
UE->rx_offset=0; UE->rx_offset=0;
} }
...@@ -1817,6 +1802,14 @@ void *UE_thread(void *arg) { ...@@ -1817,6 +1802,14 @@ void *UE_thread(void *arg) {
proc->instance_cnt_rxtx++; proc->instance_cnt_rxtx++;
LOG_D( PHY, "[SCHED][UE %d] UE RX instance_cnt_rxtx %d subframe %d !!\n", UE->Mod_id, proc->instance_cnt_rxtx,proc->subframe_rx); LOG_D( PHY, "[SCHED][UE %d] UE RX instance_cnt_rxtx %d subframe %d !!\n", UE->Mod_id, proc->instance_cnt_rxtx,proc->subframe_rx);
if (proc->instance_cnt_rxtx != 0) { if (proc->instance_cnt_rxtx != 0) {
if ( getenv("RFSIMULATOR") != NULL ) {
do {
AssertFatal (pthread_mutex_unlock(&proc->mutex_rxtx) == 0, "");
usleep(100);
AssertFatal (pthread_mutex_lock(&proc->mutex_rxtx) == 0, "");
} while ( proc->instance_cnt_rxtx >= 0);
} else
LOG_E( PHY, "[SCHED][UE %d] UE RX thread busy (IC %d)!!\n", UE->Mod_id, proc->instance_cnt_rxtx); LOG_E( PHY, "[SCHED][UE %d] UE RX thread busy (IC %d)!!\n", UE->Mod_id, proc->instance_cnt_rxtx);
if (proc->instance_cnt_rxtx > 2) if (proc->instance_cnt_rxtx > 2)
exit_fun("instance_cnt_rxtx > 2"); exit_fun("instance_cnt_rxtx > 2");
......
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