Commit afa984a1 authored by frtabu's avatar frtabu

fix build_oai, align nr files to lte files (noS1 macros...)

parent 21c6624f
...@@ -594,7 +594,7 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}") ...@@ -594,7 +594,7 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
############################################################## ##############################################################
# ???!!! TO BE DOCUMENTED OPTIONS !!!??? # ???!!! TO BE DOCUMENTED OPTIONS !!!???
############################################################## ##############################################################
add_boolean_option(ENABLE_USE_MME True "eNB connected to MME (INTERFACE S1-C), not standalone eNB")
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO") add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer") add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer")
...@@ -604,7 +604,6 @@ add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only vali ...@@ -604,7 +604,6 @@ add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only vali
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(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_list_string_option(PACKAGE_NAME "NotDefined" "As per attribute name") 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 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_RLC_MAC False "trace RLC-MAC exchanges in sequence diagrams")
...@@ -2401,9 +2400,6 @@ add_executable(lte-uesoftmodem ...@@ -2401,9 +2400,6 @@ 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 F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB F1AP F1AP_LIB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
......
...@@ -510,14 +510,17 @@ function main() { ...@@ -510,14 +510,17 @@ function main() {
echo_info "3. building the compilation directives ..." echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets DIR=$OPENAIR_DIR/cmake_targets
if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then
build_dir=phy_simulators
else
if [ "$T_TRACER" = "False" ] ; then if [ "$T_TRACER" = "False" ] ; then
build_dir=ran_build_noLOG build_dir=ran_build_noLOG
else else
build_dir=ran_build build_dir=ran_build
fi fi
fi
[ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build
mkdir -p $DIR/$build_dir/build
# configuration module libraries, one currently available, using libconfig # configuration module libraries, one currently available, using libconfig
config_libconfig_shlib=params_libconfig config_libconfig_shlib=params_libconfig
...@@ -525,8 +528,7 @@ function main() { ...@@ -525,8 +528,7 @@ function main() {
if [ "$eNB" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" ] ; then if [ "$eNB" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" ] ; then
# softmodem compilation # softmodem compilation
[ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build
mkdir -p $DIR/$build_dir/build
cmake_file=$DIR/$build_dir/CMakeLists.txt cmake_file=$DIR/$build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
...@@ -549,7 +551,7 @@ function main() { ...@@ -549,7 +551,7 @@ function main() {
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$build_dir/build cd $DIR/$build_dir/build
eval $CMAKE_CMD eval $CMAKE_CMD
fi
execlist="" execlist=""
if [ "$eNB" = "1" ] ; then if [ "$eNB" = "1" ] ; then
...@@ -634,15 +636,12 @@ function main() { ...@@ -634,15 +636,12 @@ function main() {
echo_warning "not generated UE NAS files: binaries not found" echo_warning "not generated UE NAS files: binaries not found"
fi fi
fi fi
fi
if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then
cd $OPENAIR_DIR/cmake_targets/phy_simulators cd $DIR/$build_dir/build
[ "$CLEAN" = "1" ] && rm -rf build
mkdir -p build
cd build
rm -f *sim
eval $CMAKE_CMD eval $CMAKE_CMD
fi
################## ##################
# PHY simulators # # PHY simulators #
...@@ -663,7 +662,7 @@ function main() { ...@@ -663,7 +662,7 @@ function main() {
# lte-simulators $config_libconfig_shlib \ # lte-simulators $config_libconfig_shlib \
# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so # lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi fi
fi
################### ###################
# Core simulators # # Core simulators #
################### ###################
......
This diff is collapsed.
...@@ -103,14 +103,8 @@ static int DEFENBS[] = {0}; ...@@ -103,14 +103,8 @@ static int DEFENBS[] = {0};
#include "UTIL/OTG/otg_extern.h" #include "UTIL/OTG/otg_extern.h"
#endif #endif
#if defined(ENABLE_ITTI) #include "s1ap_eNB.h"
#if defined(ENABLE_USE_MME) #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif
#endif
#include "T.h" #include "T.h"
#include "nfapi_interface.h" #include "nfapi_interface.h"
...@@ -143,8 +137,7 @@ extern int numerology; ...@@ -143,8 +137,7 @@ extern int numerology;
extern void wait_gNBs(void); extern void wait_gNBs(void);
int attach_rru(RU_t *ru) int attach_rru(RU_t *ru) {
{
ssize_t msg_len,len; ssize_t msg_len,len;
RRU_CONFIG_msg_t rru_config_msg; RRU_CONFIG_msg_t rru_config_msg;
int received_capabilities=0; int received_capabilities=0;
...@@ -201,8 +194,7 @@ int attach_rru(RU_t *ru) ...@@ -201,8 +194,7 @@ int attach_rru(RU_t *ru)
return 0; return 0;
} }
int connect_rau(RU_t *ru) int connect_rau(RU_t *ru) {
{
RRU_CONFIG_msg_t rru_config_msg; RRU_CONFIG_msg_t rru_config_msg;
ssize_t msg_len; ssize_t msg_len;
int tick_received = 0; int tick_received = 0;
...@@ -299,24 +291,21 @@ int connect_rau(RU_t *ru) ...@@ -299,24 +291,21 @@ int connect_rau(RU_t *ru)
/* Southbound Fronthaul functions, RCC/RAU */ /* Southbound Fronthaul functions, RCC/RAU */
// southbound IF5 fronthaul for 16-bit OAI format // southbound IF5 fronthaul for 16-bit OAI format
static inline void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) static inline void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
{
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff ); if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
send_IF5(ru, timestamp, slot, &ru->seqno, IF5_RRH_GW_DL); send_IF5(ru, timestamp, slot, &ru->seqno, IF5_RRH_GW_DL);
} }
// southbound IF5 fronthaul for Mobipass packet format // southbound IF5 fronthaul for Mobipass packet format
static inline void fh_if5_mobipass_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) static inline void fh_if5_mobipass_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
{
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff ); if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
send_IF5(ru, timestamp, slot, &ru->seqno, IF5_MOBIPASS); send_IF5(ru, timestamp, slot, &ru->seqno, IF5_MOBIPASS);
} }
// southbound IF4p5 fronthaul // southbound IF4p5 fronthaul
static inline void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) static inline void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
{
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff ); if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
LOG_D(PHY,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.tti_tx); LOG_D(PHY,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.tti_tx);
...@@ -330,8 +319,7 @@ static inline void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t ti ...@@ -330,8 +319,7 @@ static inline void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t ti
// Synchronous if5 from south // Synchronous if5 from south
void fh_if5_south_in(RU_t *ru, void fh_if5_south_in(RU_t *ru,
int *frame, int *frame,
int *tti) int *tti) {
{
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL); recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
...@@ -360,8 +348,7 @@ void fh_if5_south_in(RU_t *ru, ...@@ -360,8 +348,7 @@ void fh_if5_south_in(RU_t *ru,
// Synchronous if4p5 from south // Synchronous if4p5 from south
void fh_if4p5_south_in(RU_t *ru, void fh_if4p5_south_in(RU_t *ru,
int *frame, int *frame,
int *slot) int *slot) {
{
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc; RU_proc_t *proc = &ru->proc;
int f,sl; int f,sl;
...@@ -655,7 +642,6 @@ void rx_rf(RU_t *ru,int *frame,int *slot) { ...@@ -655,7 +642,6 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
ru->nb_rx); ru->nb_rx);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
proc->timestamp_rx = ts-ru->ts_offset; proc->timestamp_rx = ts-ru->ts_offset;
...@@ -734,6 +720,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -734,6 +720,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
(slot == 1) || IS_SOFTMODEM_RFSIM ) { (slot == 1) || IS_SOFTMODEM_RFSIM ) {
int siglen=fp->samples_per_slot; int siglen=fp->samples_per_slot;
int flags; int flags;
if (slot==0) if (slot==0)
flags = 2; flags = 2;
else if (slot==1) else if (slot==1)
...@@ -1103,8 +1090,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { ...@@ -1103,8 +1090,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg->samples_per_frame = 460800; cfg->samples_per_frame = 460800;
cfg->tx_bw = 40e6; cfg->tx_bw = 40e6;
cfg->rx_bw = 40e6; cfg->rx_bw = 40e6;
} } else {
else {
cfg->sample_rate=61.44e6; cfg->sample_rate=61.44e6;
cfg->samples_per_frame = 614400; cfg->samples_per_frame = 614400;
cfg->tx_bw = 40e6; cfg->tx_bw = 40e6;
...@@ -1156,7 +1142,7 @@ int setup_RU_buffers(RU_t *ru) { ...@@ -1156,7 +1142,7 @@ int setup_RU_buffers(RU_t *ru) {
frame_parms = ru->nr_frame_parms; frame_parms = ru->nr_frame_parms;
printf("setup_RU_buffers: frame_parms = %p\n",frame_parms); printf("setup_RU_buffers: frame_parms = %p\n",frame_parms);
} else { } else {
printf("RU[%d] not initialized\n", ru->idx); printf("RU not initialized\n");
return(-1); return(-1);
} }
...@@ -1237,14 +1223,10 @@ static void *ru_thread_tx( void *param ) { ...@@ -1237,14 +1223,10 @@ static void *ru_thread_tx( void *param ) {
int print_frame = 8; int print_frame = 8;
int i = 0; int i = 0;
int ret; int ret;
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx"); wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
printf( "ru_thread_tx ready\n"); printf( "ru_thread_tx ready\n");
if(ru->rfdevice.uhd_set_thread_priority != NULL) {
if(ru->rfdevice.uhd_set_thread_priority != NULL)
{
LOG_I(PHY,"set ru_thread_tx uhd priority \n"); LOG_I(PHY,"set ru_thread_tx uhd priority \n");
ru->rfdevice.uhd_set_thread_priority(); ru->rfdevice.uhd_set_thread_priority();
} }
...@@ -1255,13 +1237,11 @@ static void *ru_thread_tx( void *param ) { ...@@ -1255,13 +1237,11 @@ static void *ru_thread_tx( void *param ) {
LOG_D(PHY,"ru_thread_tx: Waiting for TX processing\n"); LOG_D(PHY,"ru_thread_tx: Waiting for TX processing\n");
// wait until eNBs are finished subframe RX n and TX n+4 // wait until eNBs are finished subframe RX n and TX n+4
wait_on_condition(&proc->mutex_gNBs,&proc->cond_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx"); wait_on_condition(&proc->mutex_gNBs,&proc->cond_gNBs,&proc->instance_cnt_gNBs,"ru_thread_tx");
ret = pthread_mutex_lock(&proc->mutex_gNBs); ret = pthread_mutex_lock(&proc->mutex_gNBs);
AssertFatal(ret == 0,"mutex_lock return %d\n",ret); AssertFatal(ret == 0,"mutex_lock return %d\n",ret);
int frame_tx=proc->frame_tx; int frame_tx=proc->frame_tx;
int tti_tx =proc->tti_tx; int tti_tx =proc->tti_tx;
uint64_t timestamp_tx = proc->timestamp_tx; uint64_t timestamp_tx = proc->timestamp_tx;
ret = pthread_mutex_unlock(&proc->mutex_gNBs); ret = pthread_mutex_unlock(&proc->mutex_gNBs);
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret); AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
...@@ -1334,14 +1314,15 @@ static void *ru_thread_tx( void *param ) { ...@@ -1334,14 +1314,15 @@ static void *ru_thread_tx( void *param ) {
gNB_proc->RU_mask_tx = 0; gNB_proc->RU_mask_tx = 0;
ret = pthread_mutex_unlock(&gNB_proc->mutex_RU_tx); ret = pthread_mutex_unlock(&gNB_proc->mutex_RU_tx);
AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret); AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret);
ret = pthread_mutex_lock(&L1_proc->mutex_RUs_tx); ret = pthread_mutex_lock(&L1_proc->mutex_RUs_tx);
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret); AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
// the thread can now be woken up // the thread can now be woken up
if (L1_proc->instance_cnt_RUs==-1) { if (L1_proc->instance_cnt_RUs==-1) {
AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0, AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
"ERROR pthread_cond_signal for gNB_L1_thread\n"); "ERROR pthread_cond_signal for gNB_L1_thread\n");
} //else AssertFatal(1==0,"gNB TX thread is not ready\n"); } //else AssertFatal(1==0,"gNB TX thread is not ready\n");
L1_proc->instance_cnt_RUs = 0; L1_proc->instance_cnt_RUs = 0;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs);
ret = pthread_mutex_unlock(&L1_proc->mutex_RUs_tx); ret = pthread_mutex_unlock(&L1_proc->mutex_RUs_tx);
...@@ -1366,13 +1347,10 @@ static void *ru_thread( void *param ) { ...@@ -1366,13 +1347,10 @@ static void *ru_thread( void *param ) {
int print_frame = 8; int print_frame = 8;
int i = 0; int i = 0;
int aa; int aa;
// set default return value // set default return value
ru_thread_status = 0; ru_thread_status = 0;
// set default return value // set default return value
sprintf(threadname,"ru_thread %d",ru->idx); sprintf(threadname,"ru_thread %d",ru->idx);
LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]); LOG_I(PHY,"Starting RU %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]);
if(emulate_rf) { if(emulate_rf) {
...@@ -1460,6 +1438,7 @@ static void *ru_thread( void *param ) { ...@@ -1460,6 +1438,7 @@ static void *ru_thread( void *param ) {
// synchronization on input FH interface, acquire signals/data and block // synchronization on input FH interface, acquire signals/data and block
LOG_D(PHY,"[RU_thread] read data: frame_rx = %d, tti_rx = %d\n", frame, slot); LOG_D(PHY,"[RU_thread] read data: frame_rx = %d, tti_rx = %d\n", frame, slot);
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot); if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot);
else AssertFatal(1==0, "No fronthaul interface at south port"); else AssertFatal(1==0, "No fronthaul interface at south port");
...@@ -1486,17 +1465,15 @@ static void *ru_thread( void *param ) { ...@@ -1486,17 +1465,15 @@ static void *ru_thread( void *param ) {
// do RX front-end processing (frequency-shift, dft) if needed // do RX front-end processing (frequency-shift, dft) if needed
if (proc->tti_rx == NR_UPLINK_SLOT || fp->frame_type == FDD) { if (proc->tti_rx == NR_UPLINK_SLOT || fp->frame_type == FDD) {
if (ru->feprx) ru->feprx(ru,proc->tti_rx); if (ru->feprx) ru->feprx(ru,proc->tti_rx);
} }
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx); LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
LOG_D(PHY,"Copying rxdataF from RU to gNB\n"); LOG_D(PHY,"Copying rxdataF from RU to gNB\n");
for (aa=0;aa<ru->nb_rx;aa++) for (aa=0; aa<ru->nb_rx; aa++)
memcpy((void*)RC.gNB[0][0]->common_vars.rxdataF[aa], memcpy((void *)RC.gNB[0][0]->common_vars.rxdataF[aa],
(void*)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t)); (void *)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
// At this point, all information for subframe has been received on FH interface // At this point, all information for subframe has been received on FH interface
...@@ -1802,8 +1779,7 @@ void kill_NR_RU_proc(int inst) { ...@@ -1802,8 +1779,7 @@ void kill_NR_RU_proc(int inst) {
pthread_cond_destroy(&proc->cond_gNBs); pthread_cond_destroy(&proc->cond_gNBs);
} }
int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
{
FH_fmt_options_t fmt = cap->FH_fmt; FH_fmt_options_t fmt = cap->FH_fmt;
int i; int i;
int found_band=0; int found_band=0;
...@@ -1859,8 +1835,7 @@ char rru_formats[3][20] = {"OAI_IF5","MBP_IF5","OAI_IF4p5"}; ...@@ -1859,8 +1835,7 @@ char rru_formats[3][20] = {"OAI_IF5","MBP_IF5","OAI_IF4p5"};
char ru_if_formats[4][20] = {"LOCAL_RF","REMOTE_OAI_IF5","REMOTE_MBP_IF5","REMOTE_OAI_IF4p5"}; char ru_if_formats[4][20] = {"LOCAL_RF","REMOTE_OAI_IF5","REMOTE_MBP_IF5","REMOTE_OAI_IF4p5"};
void configure_ru(int idx, void configure_ru(int idx,
void *arg) void *arg) {
{
RU_t *ru = RC.ru[idx]; RU_t *ru = RC.ru[idx];
RRU_config_t *config = (RRU_config_t *)arg; RRU_config_t *config = (RRU_config_t *)arg;
RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg; RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg;
...@@ -2112,8 +2087,7 @@ void set_function_spec_param(RU_t *ru) { ...@@ -2112,8 +2087,7 @@ void set_function_spec_param(RU_t *ru) {
extern void RCconfig_RU(void); extern void RCconfig_RU(void);
void init_NR_RU(char *rf_config_file) void init_NR_RU(char *rf_config_file) {
{
int ru_id; int ru_id;
RU_t *ru; RU_t *ru;
PHY_VARS_gNB *gNB_RC; PHY_VARS_gNB *gNB_RC;
...@@ -2195,8 +2169,7 @@ void init_NR_RU(char *rf_config_file) ...@@ -2195,8 +2169,7 @@ void init_NR_RU(char *rf_config_file)
} }
void stop_RU(int nb_ru) void stop_RU(int nb_ru) {
{
for (int inst = 0; inst < nb_ru; inst++) { for (int inst = 0; inst < nb_ru; inst++) {
LOG_I(PHY, "Stopping RU %d processing threads\n", inst); LOG_I(PHY, "Stopping RU %d processing threads\n", inst);
kill_NR_RU_proc(inst); kill_NR_RU_proc(inst);
...@@ -2206,8 +2179,7 @@ void stop_RU(int nb_ru) ...@@ -2206,8 +2179,7 @@ void stop_RU(int nb_ru)
/* --------------------------------------------------------*/ /* --------------------------------------------------------*/
/* from here function to use configuration module */ /* from here function to use configuration module */
void RCconfig_RU(void) void RCconfig_RU(void) {
{
int i = 0, j = 0; int i = 0, j = 0;
paramdef_t RUParams[] = RUPARAMS_DESC; paramdef_t RUParams[] = RUPARAMS_DESC;
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#define NR_SOFTMODEM_COMMON_H #define NR_SOFTMODEM_COMMON_H
#ifndef _GNU_SOURCE #ifndef _GNU_SOURCE
#define _GNU_SOURCE #define _GNU_SOURCE
#endif #endif
#include <execinfo.h> #include <execinfo.h>
...@@ -30,12 +30,9 @@ ...@@ -30,12 +30,9 @@
#include "PHY/types.h" #include "PHY/types.h"
#include <threadPool/thread-pool.h> #include <threadPool/thread-pool.h>
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h" #include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h" #include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */ /* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n" #define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
......
...@@ -479,9 +479,6 @@ static void get_options(void) { ...@@ -479,9 +479,6 @@ static void get_options(void) {
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ; paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC_NR ; paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL);
if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) { if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) {
...@@ -513,7 +510,6 @@ static void get_options(void) { ...@@ -513,7 +510,6 @@ static void get_options(void) {
if(parallel_config != NULL) set_parallel_conf(parallel_config); if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config); if(worker_config != NULL) set_worker_conf(worker_config);
} }
...@@ -526,8 +522,7 @@ static void get_options(void) { ...@@ -526,8 +522,7 @@ static void get_options(void) {
void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs],
NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
{
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS)); frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS));
config[CC_id] = (nfapi_nr_config_request_t *) malloc(sizeof(nfapi_nr_config_request_t)); config[CC_id] = (nfapi_nr_config_request_t *) malloc(sizeof(nfapi_nr_config_request_t));
...@@ -840,13 +835,12 @@ void init_pdcp(void) { ...@@ -840,13 +835,12 @@ void init_pdcp(void) {
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ? uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT; (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_NOS1){ if (IS_SOFTMODEM_NOS1) {
printf("IS_SOFTMODEM_NOS1 option enabled \n"); printf("IS_SOFTMODEM_NOS1 option enabled \n");
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ; pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
} }
pdcp_module_init(pdcp_initmask); pdcp_module_init(pdcp_initmask);
/*if (NODE_IS_CU(RC.rrc[0]->node_type)) { /*if (NODE_IS_CU(RC.rrc[0]->node_type)) {
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req); pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
} else {*/ } else {*/
...@@ -858,8 +852,7 @@ void init_pdcp(void) { ...@@ -858,8 +852,7 @@ void init_pdcp(void) {
}*/ }*/
} }
int main( int argc, char **argv ) int main( int argc, char **argv ) {
{
int i, ru_id, CC_id = 0; int i, ru_id, CC_id = 0;
start_background_system(); start_background_system();
...@@ -887,7 +880,6 @@ int main( int argc, char **argv ) ...@@ -887,7 +880,6 @@ int main( int argc, char **argv )
} }
openair0_cfg[0].threequarter_fs = threequarter_fs; openair0_cfg[0].threequarter_fs = threequarter_fs;
#if T_TRACER #if T_TRACER
T_Config_Init(); T_Config_Init();
#endif #endif
...@@ -905,26 +897,8 @@ int main( int argc, char **argv ) ...@@ -905,26 +897,8 @@ int main( int argc, char **argv )
// initialize mscgen log after ITTI // initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX); MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif #endif
init_opt();
init_opt();
#ifdef PDCP_USE_NETLINK
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
#endif
#endif
#if !defined(ENABLE_ITTI)
// to make a graceful exit when ctrl-c is pressed
signal(SIGSEGV, signal_handler);
signal(SIGINT, signal_handler);
#endif
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
#if defined(ENABLE_ITTI)
if (RC.nb_nr_inst > 0) { if (RC.nb_nr_inst > 0) {
// don't create if node doesn't connect to RRC/S1/GTP // don't create if node doesn't connect to RRC/S1/GTP
...@@ -934,7 +908,6 @@ init_opt(); ...@@ -934,7 +908,6 @@ init_opt();
RCconfig_L1(); RCconfig_L1();
} }
#endif
/* Start the agent. If it is turned off in the configuration, it won't start */ /* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_nr_flexran(); RCconfig_nr_flexran();
...@@ -951,7 +924,7 @@ init_opt(); ...@@ -951,7 +924,7 @@ init_opt();
mlockall(MCL_CURRENT | MCL_FUTURE); mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL); pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL); pthread_mutex_init(&sync_mutex, NULL);
/*#ifdef XFORMS /*#ifdef XFORMS
int UE_id; int UE_id;
if (do_forms==1) { if (do_forms==1) {
...@@ -981,7 +954,7 @@ init_opt(); ...@@ -981,7 +954,7 @@ init_opt();
printf("Scope thread created, ret=%d\n",ret); printf("Scope thread created, ret=%d\n",ret);
} }
#endif*/ #endif*/
usleep(10*1000); usleep(10*1000);
if (nfapi_mode) { if (nfapi_mode) {
...@@ -1086,7 +1059,7 @@ init_opt(); ...@@ -1086,7 +1059,7 @@ init_opt();
printf("Terminating application - oai_exit=%d\n",oai_exit); printf("Terminating application - oai_exit=%d\n",oai_exit);
#endif #endif
// stop threads // stop threads
/*#ifdef XFORMS /*#ifdef XFORMS
printf("waiting for XFORMS thread\n"); printf("waiting for XFORMS thread\n");
...@@ -1106,7 +1079,7 @@ init_opt(); ...@@ -1106,7 +1079,7 @@ init_opt();
} }
} }
#endif*/ #endif*/
printf("stopping MODEM threads\n"); printf("stopping MODEM threads\n");
// cleanup // cleanup
stop_gNB(NB_gNB_INST); stop_gNB(NB_gNB_INST);
...@@ -1142,7 +1115,6 @@ init_opt(); ...@@ -1142,7 +1115,6 @@ init_opt();
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice); RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
} }
logClean(); logClean();
printf("Bye.\n"); printf("Bye.\n");
return 0; return 0;
......
...@@ -318,7 +318,6 @@ void init_scope(void) { ...@@ -318,7 +318,6 @@ void init_scope(void) {
fl_show_form (form_nrue[UE_id]->phy_scope_nrue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title); fl_show_form (form_nrue[UE_id]->phy_scope_nrue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
threadCreate(&forms_thread, scope_thread, NULL, "scope", -1, OAI_PRIORITY_RT_LOW); threadCreate(&forms_thread, scope_thread, NULL, "scope", -1, OAI_PRIORITY_RT_LOW);
} }
} }
...@@ -379,7 +378,6 @@ static void get_options(void) { ...@@ -379,7 +378,6 @@ static void get_options(void) {
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC_NR ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL);
if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) { if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) {
...@@ -543,7 +541,7 @@ void init_openair0(void) { ...@@ -543,7 +541,7 @@ void init_openair0(void) {
LOG_E(PHY,"Unsupported numerology!\n"); LOG_E(PHY,"Unsupported numerology!\n");
exit(-1); exit(-1);
} }
}else if(frame_parms[0]->N_RB_DL == 106) { } else if(frame_parms[0]->N_RB_DL == 106) {
if (numerology==0) { if (numerology==0) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=23.04e6; openair0_cfg[card].sample_rate=23.04e6;
...@@ -620,7 +618,6 @@ void init_openair0(void) { ...@@ -620,7 +618,6 @@ void init_openair0(void) {
} }
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args; if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
} }
} }
...@@ -676,8 +673,8 @@ int main( int argc, char **argv ) { ...@@ -676,8 +673,8 @@ int main( int argc, char **argv ) {
initTpool(params, Tpool, false); initTpool(params, Tpool, false);
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
init_opt() ; init_opt() ;
if(IS_SOFTMODEM_NOS1) if(IS_SOFTMODEM_NOS1)
init_pdcp(); init_pdcp();
...@@ -685,15 +682,7 @@ int main( int argc, char **argv ) { ...@@ -685,15 +682,7 @@ int main( int argc, char **argv ) {
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd"); vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
} }
/* #ifndef PACKAGE_VERSION
#ifdef PDCP_USE_NETLINK
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
#endif
#endif
*/
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" # define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif #endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
...@@ -719,7 +708,6 @@ int main( int argc, char **argv ) { ...@@ -719,7 +708,6 @@ int main( int argc, char **argv ) {
PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag); PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag);
UE[CC_id] = PHY_vars_UE_g[0][CC_id]; UE[CC_id] = PHY_vars_UE_g[0][CC_id];
if (phy_test==1) if (phy_test==1)
UE[CC_id]->mac_enabled = 0; UE[CC_id]->mac_enabled = 0;
else else
......
...@@ -37,46 +37,31 @@ ...@@ -37,46 +37,31 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h" # include "s1ap_eNB.h"
# include "sctp_eNB_task.h" # include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h" # include "gtpv1u_eNB_task.h"
# endif
# include "PHY/INIT/phy_init.h" # include "PHY/INIT/phy_init.h"
extern unsigned char NB_gNB_INST; extern unsigned char NB_gNB_INST;
#endif
extern RAN_CONTEXT_t RC;
#if defined(ENABLE_ITTI) extern RAN_CONTEXT_t RC;
/*------------------------------------------------------------------------------*/
# if defined(ENABLE_USE_MME)
# define GNB_REGISTER_RETRY_DELAY 10 # define GNB_REGISTER_RETRY_DELAY 10
# endif
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
static void configure_nr_rrc(uint32_t gnb_id) static void configure_nr_rrc(uint32_t gnb_id) {
{
MessageDef *msg_p = NULL; MessageDef *msg_p = NULL;
// int CC_id; // int CC_id;
msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ); msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ);
if (RC.nrrrc[gnb_id]) { if (RC.nrrrc[gnb_id]) {
RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]); RCconfig_NRRRC(msg_p,gnb_id, RC.nrrrc[gnb_id]);
LOG_I(GNB_APP,"Sending configuration message to NR_RRC task\n"); LOG_I(GNB_APP,"Sending configuration message to NR_RRC task\n");
itti_send_msg_to_task (TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p); itti_send_msg_to_task (TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
} else AssertFatal(0,"NRRRC context for gNB %d not allocated\n",gnb_id);
}
else AssertFatal(0,"NRRRC context for gNB %d not allocated\n",gnb_id);
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
...@@ -115,21 +100,17 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, ...@@ -115,21 +100,17 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//,
} }
# endif # endif
*/ */
#endif
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void *gNB_app_task(void *args_p) void *gNB_app_task(void *args_p) {
{
#if defined(ENABLE_ITTI)
uint32_t gnb_nb = RC.nb_nr_inst; uint32_t gnb_nb = RC.nb_nr_inst;
uint32_t gnb_id_start = 0; uint32_t gnb_id_start = 0;
uint32_t gnb_id_end = gnb_id_start + gnb_nb; uint32_t gnb_id_end = gnb_id_start + gnb_nb;
# if defined(ENABLE_USE_MME)
//uint32_t register_gnb_pending; //uint32_t register_gnb_pending;
//uint32_t registered_gnb; //uint32_t registered_gnb;
//long gnb_register_retry_timer_id; //long gnb_register_retry_timer_id;
# endif
uint32_t gnb_id; uint32_t gnb_id;
MessageDef *msg_p = NULL; MessageDef *msg_p = NULL;
const char *msg_name = NULL; const char *msg_name = NULL;
...@@ -137,15 +118,10 @@ void *gNB_app_task(void *args_p) ...@@ -137,15 +118,10 @@ void *gNB_app_task(void *args_p)
int result; int result;
/* for no gcc warnings */ /* for no gcc warnings */
(void)instance; (void)instance;
itti_mark_task_ready (TASK_GNB_APP); itti_mark_task_ready (TASK_GNB_APP);
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__); LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
RCconfig_NR_L1(); RCconfig_NR_L1();
RCconfig_nr_macrlc(); RCconfig_nr_macrlc();
LOG_I(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst); LOG_I(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
if (RC.nb_nr_L1_inst>0) AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n"); if (RC.nb_nr_L1_inst>0) AssertFatal(l1_north_init_gNB()==0,"could not initialize L1 north interface\n");
...@@ -153,33 +129,24 @@ void *gNB_app_task(void *args_p) ...@@ -153,33 +129,24 @@ void *gNB_app_task(void *args_p)
AssertFatal (gnb_nb <= RC.nb_nr_inst, AssertFatal (gnb_nb <= RC.nb_nr_inst,
"Number of gNB is greater than gNB defined in configuration file (%d/%d)!", "Number of gNB is greater than gNB defined in configuration file (%d/%d)!",
gnb_nb, RC.nb_nr_inst); gnb_nb, RC.nb_nr_inst);
LOG_I(GNB_APP,"Allocating gNB_RRC_INST for %d instances\n",RC.nb_nr_inst); LOG_I(GNB_APP,"Allocating gNB_RRC_INST for %d instances\n",RC.nb_nr_inst);
RC.nrrrc = (gNB_RRC_INST **)malloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *)); RC.nrrrc = (gNB_RRC_INST **)malloc(RC.nb_nr_inst*sizeof(gNB_RRC_INST *));
LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.nrrrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.nrrrc); LOG_I(PHY, "%s() RC.nb_nr_inst:%d RC.nrrrc:%p\n", __FUNCTION__, RC.nb_nr_inst, RC.nrrrc);
for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) { for (gnb_id = gnb_id_start; (gnb_id < gnb_id_end) ; gnb_id++) {
RC.nrrrc[gnb_id] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST)); RC.nrrrc[gnb_id] = (gNB_RRC_INST *)malloc(sizeof(gNB_RRC_INST));
LOG_I(PHY, "%s() Creating RRC instance RC.nrrrc[%d]:%p (%d of %d)\n", __FUNCTION__, gnb_id, RC.nrrrc[gnb_id], gnb_id+1, gnb_id_end); LOG_I(PHY, "%s() Creating RRC instance RC.nrrrc[%d]:%p (%d of %d)\n", __FUNCTION__, gnb_id, RC.nrrrc[gnb_id], gnb_id+1, gnb_id_end);
memset((void *)RC.nrrrc[gnb_id],0,sizeof(gNB_RRC_INST)); memset((void *)RC.nrrrc[gnb_id],0,sizeof(gNB_RRC_INST));
configure_nr_rrc(gnb_id); configure_nr_rrc(gnb_id);
} }
# if defined(ENABLE_USE_MME)
/* Try to register each gNB */ /* Try to register each gNB */
//registered_gnb = 0; //registered_gnb = 0;
//register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p); //register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
# else
/* Start L2L1 task */
msg_p = itti_alloc_new_message(TASK_GNB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task(TASK_L2L1, INSTANCE_DEFAULT, msg_p);
# endif
do { do {
// Wait for a message // Wait for a message
itti_receive_msg (TASK_GNB_APP, &msg_p); itti_receive_msg (TASK_GNB_APP, &msg_p);
msg_name = ITTI_MSG_NAME (msg_p); msg_name = ITTI_MSG_NAME (msg_p);
instance = ITTI_MSG_INSTANCE (msg_p); instance = ITTI_MSG_INSTANCE (msg_p);
...@@ -193,8 +160,7 @@ void *gNB_app_task(void *args_p) ...@@ -193,8 +160,7 @@ void *gNB_app_task(void *args_p)
LOG_I(GNB_APP, "Received %s\n", ITTI_MSG_NAME(msg_p)); LOG_I(GNB_APP, "Received %s\n", ITTI_MSG_NAME(msg_p));
break; break;
# if defined(ENABLE_USE_MME) /*
/*
case S1AP_REGISTER_ENB_CNF: case S1AP_REGISTER_ENB_CNF:
LOG_I(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name, LOG_I(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme); S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
...@@ -236,25 +202,21 @@ void *gNB_app_task(void *args_p) ...@@ -236,25 +202,21 @@ void *gNB_app_task(void *args_p)
} }
break; break;
*/ */
case S1AP_DEREGISTERED_ENB_IND: case S1AP_DEREGISTERED_ENB_IND:
LOG_W(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name, LOG_W(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme); S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
/* TODO handle recovering of registration */ /* TODO handle recovering of registration */
break; break;
case TIMER_HAS_EXPIRED: case TIMER_HAS_EXPIRED:
LOG_I(GNB_APP, " Received %s: timer_id %ld\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id); LOG_I(GNB_APP, " Received %s: timer_id %ld\n", msg_name, TIMER_HAS_EXPIRED(msg_p).timer_id);
//if (TIMER_HAS_EXPIRED (msg_p).timer_id == gnb_register_retry_timer_id) { //if (TIMER_HAS_EXPIRED (msg_p).timer_id == gnb_register_retry_timer_id) {
/* Restart the registration process */ /* Restart the registration process */
// registered_gnb = 0; // registered_gnb = 0;
// register_gnb_pending = gNB_app_register(gnb_id_start, gnb_id_end);//, gnb_properties_p); // register_gnb_pending = gNB_app_register(gnb_id_start, gnb_id_end);//, gnb_properties_p);
//} //}
break; break;
# endif
default: default:
LOG_E(GNB_APP, "Received unexpected message %s\n", msg_name); LOG_E(GNB_APP, "Received unexpected message %s\n", msg_name);
...@@ -265,8 +227,5 @@ void *gNB_app_task(void *args_p) ...@@ -265,8 +227,5 @@ void *gNB_app_task(void *args_p)
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} while (1); } while (1);
#endif
return NULL; return NULL;
} }
...@@ -2455,9 +2455,7 @@ int decode_BCCH_MBMS_DLSCH_Message( ...@@ -2455,9 +2455,7 @@ int decode_BCCH_MBMS_DLSCH_Message(
} }
}*/ }*/
/*if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE) /*if ((rrc_get_sub_state(ctxt_pP->module_id) == RRC_SUB_STATE_IDLE_SIB_COMPLETE)
#if defined(ENABLE_USE_MME)
&& (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL) && (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
#endif
) { ) {
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0); rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING ); rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
...@@ -2724,7 +2722,6 @@ int decode_SIB1_MBMS( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_in ...@@ -2724,7 +2722,6 @@ int decode_SIB1_MBMS( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_in
LOG_I(RRC,"Setting SIStatus bit 0 to 1\n"); LOG_I(RRC,"Setting SIStatus bit 0 to 1\n");
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus_MBMS = 1; UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus_MBMS = 1;
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIB1systemInfoValueTag_MBMS = sib1_MBMS->systemInfoValueTag_r14; UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIB1systemInfoValueTag_MBMS = sib1_MBMS->systemInfoValueTag_r14;
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
/* /*
{ {
int cell_valid = 0; int cell_valid = 0;
...@@ -2782,7 +2779,6 @@ int decode_SIB1_MBMS( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_in ...@@ -2782,7 +2779,6 @@ int decode_SIB1_MBMS( const protocol_ctxt_t *const ctxt_pP, const uint8_t eNB_in
} }
} }
*/ */
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SIB1, VCD_FUNCTION_OUT ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SIB1, VCD_FUNCTION_OUT );
return 0; return 0;
} }
......
...@@ -19,34 +19,32 @@ ...@@ -19,34 +19,32 @@
* contact@openairinterface.org * contact@openairinterface.org
*/ */
#if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
# include "create_nr_tasks.h" # include "create_nr_tasks.h"
# include "common/utils/LOG/log.h" # include "common/utils/LOG/log.h"
# ifdef OPENAIR2 #ifdef OPENAIR2
# if defined(ENABLE_USE_MME) #if defined(ENABLE_USE_MME)
# include "sctp_eNB_task.h" #include "sctp_eNB_task.h"
# include "s1ap_eNB.h" #include "s1ap_eNB.h"
# include "nas_ue_task.h" #include "nas_ue_task.h"
# include "udp_eNB_task.h" #include "udp_eNB_task.h"
# include "gtpv1u_eNB_task.h" #include "gtpv1u_eNB_task.h"
# endif #endif
# if ENABLE_RAL #if ENABLE_RAL
# include "lteRALue.h" #include "lteRALue.h"
# include "lteRALenb.h" #include "lteRALenb.h"
# endif #endif
# include "RRC/NR/nr_rrc_defs.h" #include "RRC/NR/nr_rrc_defs.h"
# endif #endif
# include "gnb_app.h" # include "gnb_app.h"
extern int emulate_rf; extern int emulate_rf;
int create_gNB_tasks(uint32_t gnb_nb) int create_gNB_tasks(uint32_t gnb_nb) {
{
LOG_D(GNB_APP, "%s(gnb_nb:%d\n", __FUNCTION__, gnb_nb); LOG_D(GNB_APP, "%s(gnb_nb:%d\n", __FUNCTION__, gnb_nb);
itti_wait_ready(1); itti_wait_ready(1);
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) { if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(PDCP, "Create task for L2L1 failed\n"); LOG_E(PDCP, "Create task for L2L1 failed\n");
return -1; return -1;
...@@ -60,8 +58,7 @@ int create_gNB_tasks(uint32_t gnb_nb) ...@@ -60,8 +58,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
} }
} }
/* /*
# if defined(ENABLE_USE_MME)
if (gnb_nb > 0) { if (gnb_nb > 0) {
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) { if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n"); LOG_E(SCTP, "Create task for SCTP failed\n");
...@@ -84,9 +81,7 @@ int create_gNB_tasks(uint32_t gnb_nb) ...@@ -84,9 +81,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
return -1; return -1;
} }
} }
*/
# endif
*/
if (gnb_nb > 0) { if (gnb_nb > 0) {
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n"); LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
...@@ -97,9 +92,7 @@ int create_gNB_tasks(uint32_t gnb_nb) ...@@ -97,9 +92,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
} }
} }
itti_wait_ready(0); itti_wait_ready(0);
return 0; return 0;
} }
#endif
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