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}")
##############################################################
# ???!!! 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(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
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(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")
......@@ -2401,9 +2400,6 @@ add_executable(lte-uesoftmodem
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
-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
......
......@@ -510,14 +510,17 @@ function main() {
echo_info "3. building the compilation directives ..."
DIR=$OPENAIR_DIR/cmake_targets
if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then
build_dir=phy_simulators
else
if [ "$T_TRACER" = "False" ] ; then
build_dir=ran_build_noLOG
else
build_dir=ran_build
fi
fi
[ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build
mkdir -p $DIR/$build_dir/build
# configuration module libraries, one currently available, using libconfig
config_libconfig_shlib=params_libconfig
......@@ -525,8 +528,7 @@ function main() {
if [ "$eNB" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" ] ; then
# softmodem compilation
[ "$CLEAN" = "1" ] && rm -rf $DIR/$build_dir/build
mkdir -p $DIR/$build_dir/build
cmake_file=$DIR/$build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
......@@ -549,7 +551,7 @@ function main() {
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$build_dir/build
eval $CMAKE_CMD
fi
execlist=""
if [ "$eNB" = "1" ] ; then
......@@ -634,15 +636,12 @@ function main() {
echo_warning "not generated UE NAS files: binaries not found"
fi
fi
fi
if [ "$SIMUS_PHY" = "1" -o "$SIMUS_CORE" = "1" ] ; then
cd $OPENAIR_DIR/cmake_targets/phy_simulators
[ "$CLEAN" = "1" ] && rm -rf build
mkdir -p build
cd build
rm -f *sim
cd $DIR/$build_dir/build
eval $CMAKE_CMD
fi
##################
# PHY simulators #
......@@ -663,7 +662,7 @@ function main() {
# lte-simulators $config_libconfig_shlib \
# lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
fi
fi
###################
# Core simulators #
###################
......
This diff is collapsed.
......@@ -103,14 +103,8 @@ static int DEFENBS[] = {0};
#include "UTIL/OTG/otg_extern.h"
#endif
#if defined(ENABLE_ITTI)
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#endif
#endif
#endif
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "T.h"
#include "nfapi_interface.h"
......@@ -143,8 +137,7 @@ extern int numerology;
extern void wait_gNBs(void);
int attach_rru(RU_t *ru)
{
int attach_rru(RU_t *ru) {
ssize_t msg_len,len;
RRU_CONFIG_msg_t rru_config_msg;
int received_capabilities=0;
......@@ -201,8 +194,7 @@ int attach_rru(RU_t *ru)
return 0;
}
int connect_rau(RU_t *ru)
{
int connect_rau(RU_t *ru) {
RRU_CONFIG_msg_t rru_config_msg;
ssize_t msg_len;
int tick_received = 0;
......@@ -299,24 +291,21 @@ int connect_rau(RU_t *ru)
/* Southbound Fronthaul functions, RCC/RAU */
// 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 );
send_IF5(ru, timestamp, slot, &ru->seqno, IF5_RRH_GW_DL);
}
// 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 );
send_IF5(ru, timestamp, slot, &ru->seqno, IF5_MOBIPASS);
}
// 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 );
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
// Synchronous if5 from south
void fh_if5_south_in(RU_t *ru,
int *frame,
int *tti)
{
int *tti) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc;
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
......@@ -360,8 +348,7 @@ void fh_if5_south_in(RU_t *ru,
// Synchronous if4p5 from south
void fh_if4p5_south_in(RU_t *ru,
int *frame,
int *slot)
{
int *slot) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc;
int f,sl;
......@@ -655,7 +642,6 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
ru->nb_rx);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 0 );
proc->timestamp_rx = ts-ru->ts_offset;
......@@ -734,6 +720,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
(slot == 1) || IS_SOFTMODEM_RFSIM ) {
int siglen=fp->samples_per_slot;
int flags;
if (slot==0)
flags = 2;
else if (slot==1)
......@@ -1103,8 +1090,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg->samples_per_frame = 460800;
cfg->tx_bw = 40e6;
cfg->rx_bw = 40e6;
}
else {
} else {
cfg->sample_rate=61.44e6;
cfg->samples_per_frame = 614400;
cfg->tx_bw = 40e6;
......@@ -1156,7 +1142,7 @@ int setup_RU_buffers(RU_t *ru) {
frame_parms = ru->nr_frame_parms;
printf("setup_RU_buffers: frame_parms = %p\n",frame_parms);
} else {
printf("RU[%d] not initialized\n", ru->idx);
printf("RU not initialized\n");
return(-1);
}
......@@ -1237,14 +1223,10 @@ static void *ru_thread_tx( void *param ) {
int print_frame = 8;
int i = 0;
int ret;
wait_on_condition(&proc->mutex_FH1,&proc->cond_FH1,&proc->instance_cnt_FH1,"ru_thread_tx");
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");
ru->rfdevice.uhd_set_thread_priority();
}
......@@ -1255,13 +1237,11 @@ static void *ru_thread_tx( void *param ) {
LOG_D(PHY,"ru_thread_tx: Waiting for TX processing\n");
// 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");
ret = pthread_mutex_lock(&proc->mutex_gNBs);
AssertFatal(ret == 0,"mutex_lock return %d\n",ret);
int frame_tx=proc->frame_tx;
int tti_tx =proc->tti_tx;
uint64_t timestamp_tx = proc->timestamp_tx;
ret = pthread_mutex_unlock(&proc->mutex_gNBs);
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
......@@ -1334,14 +1314,15 @@ static void *ru_thread_tx( void *param ) {
gNB_proc->RU_mask_tx = 0;
ret = pthread_mutex_unlock(&gNB_proc->mutex_RU_tx);
AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret);
ret = pthread_mutex_lock(&L1_proc->mutex_RUs_tx);
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
// the thread can now be woken up
if (L1_proc->instance_cnt_RUs==-1) {
AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
"ERROR pthread_cond_signal for gNB_L1_thread\n");
} //else AssertFatal(1==0,"gNB TX thread is not ready\n");
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);
ret = pthread_mutex_unlock(&L1_proc->mutex_RUs_tx);
......@@ -1366,13 +1347,10 @@ static void *ru_thread( void *param ) {
int print_frame = 8;
int i = 0;
int aa;
// set default return value
ru_thread_status = 0;
// set default return value
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]);
if(emulate_rf) {
......@@ -1460,6 +1438,7 @@ static void *ru_thread( void *param ) {
// 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);
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot);
else AssertFatal(1==0, "No fronthaul interface at south port");
......@@ -1486,17 +1465,15 @@ static void *ru_thread( void *param ) {
// do RX front-end processing (frequency-shift, dft) if needed
if (proc->tti_rx == NR_UPLINK_SLOT || fp->frame_type == FDD) {
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,"Copying rxdataF from RU to gNB\n");
for (aa=0;aa<ru->nb_rx;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));
for (aa=0; aa<ru->nb_rx; 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));
// At this point, all information for subframe has been received on FH interface
......@@ -1802,8 +1779,7 @@ void kill_NR_RU_proc(int inst) {
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;
int i;
int found_band=0;
......@@ -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"};
void configure_ru(int idx,
void *arg)
{
void *arg) {
RU_t *ru = RC.ru[idx];
RRU_config_t *config = (RRU_config_t *)arg;
RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg;
......@@ -2112,8 +2087,7 @@ void set_function_spec_param(RU_t *ru) {
extern void RCconfig_RU(void);
void init_NR_RU(char *rf_config_file)
{
void init_NR_RU(char *rf_config_file) {
int ru_id;
RU_t *ru;
PHY_VARS_gNB *gNB_RC;
......@@ -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++) {
LOG_I(PHY, "Stopping RU %d processing threads\n", inst);
kill_NR_RU_proc(inst);
......@@ -2206,8 +2179,7 @@ void stop_RU(int nb_ru)
/* --------------------------------------------------------*/
/* from here function to use configuration module */
void RCconfig_RU(void)
{
void RCconfig_RU(void) {
int i = 0, j = 0;
paramdef_t RUParams[] = RUPARAMS_DESC;
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
......
......@@ -2,7 +2,7 @@
#define NR_SOFTMODEM_COMMON_H
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <execinfo.h>
......@@ -30,12 +30,9 @@
#include "PHY/types.h"
#include <threadPool/thread-pool.h>
#if defined(ENABLE_USE_MME)
#include "s1ap_eNB.h"
#ifdef PDCP_USE_NETLINK
#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 */
#define CONFIG_HLP_RFCFGF "Configuration file for front-end (e.g. LMS7002M)\n"
......
......@@ -479,9 +479,6 @@ static void get_options(void) {
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL);
if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) {
......@@ -513,7 +510,6 @@ static void get_options(void) {
if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config);
}
......@@ -526,8 +522,7 @@ static void get_options(void) {
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++) {
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));
......@@ -840,13 +835,12 @@ void init_pdcp(void) {
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(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");
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
}
pdcp_module_init(pdcp_initmask);
/*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);
} else {*/
......@@ -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;
start_background_system();
......@@ -887,7 +880,6 @@ int main( int argc, char **argv )
}
openair0_cfg[0].threequarter_fs = threequarter_fs;
#if T_TRACER
T_Config_Init();
#endif
......@@ -905,26 +897,8 @@ int main( int argc, char **argv )
// initialize mscgen log after ITTI
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif
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
init_opt();
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
#if defined(ENABLE_ITTI)
if (RC.nb_nr_inst > 0) {
// don't create if node doesn't connect to RRC/S1/GTP
......@@ -934,7 +908,6 @@ init_opt();
RCconfig_L1();
}
#endif
/* Start the agent. If it is turned off in the configuration, it won't start */
RCconfig_nr_flexran();
......@@ -951,7 +924,7 @@ init_opt();
mlockall(MCL_CURRENT | MCL_FUTURE);
pthread_cond_init(&sync_cond,NULL);
pthread_mutex_init(&sync_mutex, NULL);
/*#ifdef XFORMS
/*#ifdef XFORMS
int UE_id;
if (do_forms==1) {
......@@ -981,7 +954,7 @@ init_opt();
printf("Scope thread created, ret=%d\n",ret);
}
#endif*/
#endif*/
usleep(10*1000);
if (nfapi_mode) {
......@@ -1086,7 +1059,7 @@ init_opt();
printf("Terminating application - oai_exit=%d\n",oai_exit);
#endif
// stop threads
/*#ifdef XFORMS
/*#ifdef XFORMS
printf("waiting for XFORMS thread\n");
......@@ -1106,7 +1079,7 @@ init_opt();
}
}
#endif*/
#endif*/
printf("stopping MODEM threads\n");
// cleanup
stop_gNB(NB_gNB_INST);
......@@ -1142,7 +1115,6 @@ init_opt();
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
}
logClean();
printf("Bye.\n");
return 0;
......
......@@ -318,7 +318,6 @@ void init_scope(void) {
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);
}
}
......@@ -379,7 +378,6 @@ static void get_options(void) {
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL);
if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) {
......@@ -543,7 +541,7 @@ void init_openair0(void) {
LOG_E(PHY,"Unsupported numerology!\n");
exit(-1);
}
}else if(frame_parms[0]->N_RB_DL == 106) {
} else if(frame_parms[0]->N_RB_DL == 106) {
if (numerology==0) {
if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=23.04e6;
......@@ -620,7 +618,6 @@ void init_openair0(void) {
}
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
}
}
......@@ -676,8 +673,8 @@ int main( int argc, char **argv ) {
initTpool(params, Tpool, false);
cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
init_opt() ;
if(IS_SOFTMODEM_NOS1)
init_pdcp();
......@@ -685,15 +682,7 @@ int main( int argc, char **argv ) {
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
}
/*
#ifdef PDCP_USE_NETLINK
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
#endif
#endif
*/
#ifndef PACKAGE_VERSION
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
......@@ -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);
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
if (phy_test==1)
UE[CC_id]->mac_enabled = 0;
else
......
......@@ -37,46 +37,31 @@
#include "common/utils/LOG/log.h"
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# endif
# include "PHY/INIT/phy_init.h"
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
# endif
/*------------------------------------------------------------------------------*/
static void configure_nr_rrc(uint32_t gnb_id)
{
static void configure_nr_rrc(uint32_t gnb_id) {
MessageDef *msg_p = NULL;
// int CC_id;
msg_p = itti_alloc_new_message (TASK_GNB_APP, NRRRC_CONFIGURATION_REQ);
if (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");
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)//,
}
# endif
*/
#endif
/*------------------------------------------------------------------------------*/
void *gNB_app_task(void *args_p)
{
#if defined(ENABLE_ITTI)
void *gNB_app_task(void *args_p) {
uint32_t gnb_nb = RC.nb_nr_inst;
uint32_t gnb_id_start = 0;
uint32_t gnb_id_end = gnb_id_start + gnb_nb;
# if defined(ENABLE_USE_MME)
//uint32_t register_gnb_pending;
//uint32_t registered_gnb;
//long gnb_register_retry_timer_id;
# endif
uint32_t gnb_id;
MessageDef *msg_p = NULL;
const char *msg_name = NULL;
......@@ -137,15 +118,10 @@ void *gNB_app_task(void *args_p)
int result;
/* for no gcc warnings */
(void)instance;
itti_mark_task_ready (TASK_GNB_APP);
LOG_I(PHY, "%s() Task ready initialise structures\n", __FUNCTION__);
RCconfig_NR_L1();
RCconfig_nr_macrlc();
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");
......@@ -153,33 +129,24 @@ void *gNB_app_task(void *args_p)
AssertFatal (gnb_nb <= RC.nb_nr_inst,
"Number of gNB is greater than gNB defined in configuration file (%d/%d)!",
gnb_nb, 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 *));
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++) {
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);
memset((void *)RC.nrrrc[gnb_id],0,sizeof(gNB_RRC_INST));
configure_nr_rrc(gnb_id);
}
# if defined(ENABLE_USE_MME)
/* Try to register each gNB */
//registered_gnb = 0;
//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 {
// Wait for a message
itti_receive_msg (TASK_GNB_APP, &msg_p);
msg_name = ITTI_MSG_NAME (msg_p);
instance = ITTI_MSG_INSTANCE (msg_p);
......@@ -193,8 +160,7 @@ void *gNB_app_task(void *args_p)
LOG_I(GNB_APP, "Received %s\n", ITTI_MSG_NAME(msg_p));
break;
# if defined(ENABLE_USE_MME)
/*
/*
case S1AP_REGISTER_ENB_CNF:
LOG_I(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_REGISTER_ENB_CNF(msg_p).nb_mme);
......@@ -236,25 +202,21 @@ void *gNB_app_task(void *args_p)
}
break;
*/
*/
case S1AP_DEREGISTERED_ENB_IND:
LOG_W(GNB_APP, "[gNB %d] Received %s: associated MME %d\n", instance, msg_name,
S1AP_DEREGISTERED_ENB_IND(msg_p).nb_mme);
/* TODO handle recovering of registration */
break;
case TIMER_HAS_EXPIRED:
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) {
/* Restart the registration process */
// registered_gnb = 0;
// register_gnb_pending = gNB_app_register(gnb_id_start, gnb_id_end);//, gnb_properties_p);
//}
break;
# endif
default:
LOG_E(GNB_APP, "Received unexpected message %s\n", msg_name);
......@@ -265,8 +227,5 @@ void *gNB_app_task(void *args_p)
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} while (1);
#endif
return NULL;
}
......@@ -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 defined(ENABLE_USE_MME)
&& (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
#endif
) {
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0);
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
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].SIB1systemInfoValueTag_MBMS = sib1_MBMS->systemInfoValueTag_r14;
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
/*
{
int cell_valid = 0;
......@@ -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 );
return 0;
}
......
......@@ -19,34 +19,32 @@
* contact@openairinterface.org
*/
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# include "create_nr_tasks.h"
# include "common/utils/LOG/log.h"
# ifdef OPENAIR2
# if defined(ENABLE_USE_MME)
# include "sctp_eNB_task.h"
# include "s1ap_eNB.h"
# include "nas_ue_task.h"
# include "udp_eNB_task.h"
# include "gtpv1u_eNB_task.h"
# endif
# if ENABLE_RAL
# include "lteRALue.h"
# include "lteRALenb.h"
# endif
# include "RRC/NR/nr_rrc_defs.h"
# endif
#ifdef OPENAIR2
#if defined(ENABLE_USE_MME)
#include "sctp_eNB_task.h"
#include "s1ap_eNB.h"
#include "nas_ue_task.h"
#include "udp_eNB_task.h"
#include "gtpv1u_eNB_task.h"
#endif
#if ENABLE_RAL
#include "lteRALue.h"
#include "lteRALenb.h"
#endif
#include "RRC/NR/nr_rrc_defs.h"
#endif
# include "gnb_app.h"
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);
itti_wait_ready(1);
if (itti_create_task (TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(PDCP, "Create task for L2L1 failed\n");
return -1;
......@@ -60,8 +58,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
}
}
/*
# if defined(ENABLE_USE_MME)
/*
if (gnb_nb > 0) {
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(SCTP, "Create task for SCTP failed\n");
......@@ -84,9 +81,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
return -1;
}
}
# endif
*/
*/
if (gnb_nb > 0) {
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
......@@ -97,9 +92,7 @@ int create_gNB_tasks(uint32_t gnb_nb)
}
}
itti_wait_ready(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