Commit 41f864ef authored by knopp's avatar knopp

modicaitions for rru, initial configuration exchage

parent ec6236f8
......@@ -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
......
......@@ -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",
......
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;
......
......@@ -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
......
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