Commit aff8b57c authored by Florian Kaltenberger's avatar Florian Kaltenberger

adding support for N300 to gNB config

parent 83e9908a
Pipeline #10867 failed with stage
in 0 seconds
......@@ -91,6 +91,8 @@ typedef enum {
#define CONFIG_STRING_RU_MAX_RXGAIN "max_rxgain"
#define CONFIG_STRING_RU_IF_COMPRESSION "if_compression"
#define CONFIG_STRING_RU_NBIOTRRC_LIST "NbIoT_RRC_instances"
#define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs"
#define CONFIG_STRING_RU_SDR_CLK_SRC "clock_src"
#define RU_LOCAL_IF_NAME_IDX 0
#define RU_LOCAL_ADDRESS_IDX 1
......
......@@ -1056,7 +1056,7 @@ extern "C" {
#endif
sscanf(uhd::get_version_string().c_str(),"%d.%d.%d",&vers,&subvers,&subsubvers);
LOG_I(PHY,"Checking for USRPs : UHD %s (%d.%d.%d)\n",
LOG_I(PHY,"UHD version %s (%d.%d.%d)\n",
uhd::get_version_string().c_str(),vers,subvers,subsubvers);
std::string args;
......@@ -1064,12 +1064,13 @@ extern "C" {
args = "type=b200";
} else {
args = openair0_cfg[0].sdr_addrs;
LOG_I(PHY,"Checking for USRP with args %s\n",openair0_cfg[0].sdr_addrs);
}
uhd::device_addrs_t device_adds = uhd::device::find(args);
if (device_adds.size() == 0) {
std::cerr<<"No USRP Device Found. " << std::endl;
std::cerr<<"No USRP Device Found. " << args << std::endl;
free(s);
return -1;
} else if (device_adds.size() > 1) {
......
......@@ -254,6 +254,7 @@ RUs = (
max_pdschReferenceSignalPower = -27;
max_rxgain = 114;
eNB_instances = [0];
sdr_addrs = "addr=192.168.30.2";
}
);
......
......@@ -1417,7 +1417,7 @@ static void* ru_thread( void* param ) {
AssertFatal(ru->start_if(ru,NULL) == 0, "Could not start the IF device\n");
if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
else ret = attach_rru(ru);
AssertFatal(ret==0,"Cannot connect to radio\n");
AssertFatal(ret==0,"Cannot connect to remote radio\n");
}
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
fill_rf_config(ru,ru->rf_config_file);
......@@ -1426,6 +1426,7 @@ static void* ru_thread( void* param ) {
nr_phy_init_RU(ru);
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
AssertFatal(ret==0,"Cannot connect to local radio\n");
}
if (setup_RU_buffers(ru)!=0) {
printf("Exiting, cannot initialize RU Buffers\n");
......@@ -2085,6 +2086,7 @@ void set_function_spec_param(RU_t *ru)
ru->start_rf = start_rf; // need to start the local RF interface
ru->stop_rf = stop_rf;
printf("configuring ru_id %d (start_rf %p)\n", ru->idx, start_rf);
/*
if (ru->function == gNodeB_3GPP) { // configure RF parameters only for 3GPP eNodeB, we need to get them from RAU otherwise
fill_rf_config(ru,rf_config_file);
......@@ -2305,6 +2307,24 @@ void RCconfig_RU(void) {
RC.ru[j]->num_gNB = 0;
for (i=0;i<RC.ru[j]->num_gNB;i++) RC.ru[j]->gNB_list[i] = RC.gNB[RUParamList.paramarray[j][RU_ENB_LIST_IDX].iptr[i]][0];
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_ADDRS)) {
RC.ru[j]->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr));
}
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) {
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) {
RC.ru[j]->openair0_cfg.clock_source = internal;
LOG_D(PHY, "RU clock source set as internal\n");
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) {
RC.ru[j]->openair0_cfg.clock_source = external;
LOG_D(PHY, "RU clock source set as external\n");
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) {
RC.ru[j]->openair0_cfg.clock_source = gpsdo;
LOG_D(PHY, "RU clock source set as gpsdo\n");
} else {
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
}
}
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
......
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