diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 22df6481492c5de90412f5185b1460ac438fba23..cea49525c142301474d75795d59b1418261deb29 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -619,6 +619,8 @@ typedef enum { typedef struct RU_t_s{ /// index of this ru uint32_t idx; + /// Pointer to configuration file + char *rf_config_file; /// southbound interface RU_if_south_t if_south; /// timing @@ -1423,6 +1425,7 @@ typedef struct RRU_capabilities_s { } RRU_capabilities_t; typedef struct RRU_config_s { + /// Fronthaul format RU_if_south_t FH_fmt; /// number of EUTRA bands (<=4) configured in RRU diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index e278a64de2628f4a0d54e50398dca2a3aa8bca5a..07a979aff79cebd05e217a88cf2fab27b240f997 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -463,6 +463,8 @@ void RCconfig_RU() { int num_eNB4RU = 0; libconfig_int eNB_list[256]; int fronthaul_flag = CONFIG_TRUE; + /// TRUE for eNB or RRU, FALSE for RAU + int local_rf_flag = CONFIG_TRUE; load_config_file(&cfg); @@ -488,10 +490,29 @@ void RCconfig_RU() { ) ) { fronthaul_flag = CONFIG_FALSE; + } + + if ( !( + config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) + ) + ) { + local_rf_flag = CONFIG_FALSE; } - if (fronthaul_flag != CONFIG_TRUE) { // no fronthaul + if (local_rf_flag == CONFIG_TRUE) { // eNB or RRU + + if ( !( + config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) + ) + ) { + AssertFatal (0, + "Failed to parse configuration file %s, RU %d config !\n", + RC.config_file_name, j); + continue; + } + + AssertFatal((setting_band = config_setting_get_member(setting_ru, CONFIG_STRING_RU_BAND_LIST))!=NULL,"No allowable LTE bands\n"); if (setting_band != NULL) num_bands = config_setting_length(setting_band); @@ -503,7 +524,8 @@ void RCconfig_RU() { printf("RU %d: band %d\n",j,band[i]); } } // fronthaul_flag == CONFIG_FALSE - else { // fronthaul_flag == CONFIG_TRUE + + if (fronthaul_flag == CONFIG_TRUE) { // fronthaul_flag == CONFIG_TRUE if ( !( config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_ADDRESS, (const char **)&ipv4) && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_REMOTE_ADDRESS, (const char **)&ipv4_remote) @@ -542,7 +564,6 @@ void RCconfig_RU() { if ( !( config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_TX, &nb_tx) && config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_RX, &nb_rx) - && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) )) { AssertFatal (0, "Failed to parse configuration file %s, RU %d config !\n", diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf index 9d966fe31585f84e3786b29477b19f27882ab8af..99d128587a6cff5bb151f9611e52d3a144af92c9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.oaisim.conf @@ -1,8 +1,8 @@ RUs = ( { - local_if_name = "lo"; - remote_address = "127.0.0.2"; - local_address = "127.0.0.1"; + local_if_name = "enp1s0"; + remote_address = "192.168.117.113"; + local_address = "192.168.117.205"; local_portc = 50000; remote_portc = 50000; local_portd = 50001; diff --git a/targets/RT/USER/lte-ru.c b/targets/RT/USER/lte-ru.c index 98a673ade6fdfbf82670aef775c2463f76ad93dd..7519b34e86608f26d47fb44e080dabb5cf537559 100644 --- a/targets/RT/USER/lte-ru.c +++ b/targets/RT/USER/lte-ru.c @@ -1210,6 +1210,17 @@ static void* ru_thread( void* param ) { else ret = attach_rru(ru); AssertFatal(ret==0,"Cannot connect to radio\n"); } +// if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise + fill_rf_config(ru,ru->rf_config_file); + init_frame_parms(&ru->frame_parms,1); + phy_init_RU(ru); + // } + + ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg); + if (setup_RU_buffers(ru)!=0) { + printf("Exiting, cannot initialize RU Buffers\n"); + exit(-1); + } LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx); pthread_mutex_lock(&RC.ru_mutex); @@ -1829,6 +1840,7 @@ void init_RU(const char *rf_config_file) { for (ru_id=0;ru_id<RC.nb_RU;ru_id++) { ru = RC.ru[ru_id]; + ru->rf_config_file = rf_config_file; ru->idx = ru_id; ru->ts_offset = 0; // use eNB_list[0] as a reference for RU frame parameters @@ -1911,7 +1923,7 @@ void init_RU(const char *rf_config_file) { ru->fh_south_out = tx_rf; // local synchronous RF TX ru->start_rf = start_rf; // need to start the local RF interface printf("configuring ru_id %d (start_rf %p)\n",ru_id,start_rf); - +/* if (ru->function == eNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise fill_rf_config(ru,rf_config_file); init_frame_parms(&ru->frame_parms,1); @@ -1922,7 +1934,7 @@ void init_RU(const char *rf_config_file) { if (setup_RU_buffers(ru)!=0) { printf("Exiting, cannot initialize RU Buffers\n"); exit(-1); - } + }*/ break; case REMOTE_IF5: // the remote unit is IF5 RRU