Commit 4b63bc05 authored by lfarizav's avatar lfarizav

Fixing bug in oaisim_functions. const Enb_properties_array_t *enb_properties...

Fixing bug in oaisim_functions. const Enb_properties_array_t *enb_properties -> static const Enb_properties_array_t *enb_properties
parent 5be8ee8d
......@@ -1116,7 +1116,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
AssertFatal( ue->n_connected_eNB <= NUMBER_OF_CONNECTED_eNB_MAX, "n_connected_eNB is too large" );
// do_ofdm_mod for frequency analysis
int do_ofdm_mod = ue->do_ofdm_mod=1;
int do_ofdm_mod = ue->do_ofdm_mod=0;
if (do_ofdm_mod==0)
{
......
......@@ -2936,7 +2936,7 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
if (do_ofdm_mod)
T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0),
T_BUFFER(&eNB->common_vars.rxdataF[0][0][subframe*eNB->frame_parms.ofdm_symbol_size*eNB->frame_parms.symbols_per_tti],
NB->frame_parms.ofdm_symbol_size*eNB->frame_parms.symbols_per_tti * 4));
eNB->frame_parms.ofdm_symbol_size*eNB->frame_parms.symbols_per_tti * 4));
else
T(T_ENB_PHY_INPUT_SIGNAL, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe), T_INT(0),
T_BUFFER(&eNB->common_vars.rxdata[0][0][subframe*eNB->frame_parms.samples_per_tti],
......
......@@ -313,7 +313,7 @@ void enb_config_display(void)
} else {
printf( "\tMNC: \t%02"PRIu16":\n",enb_properties.properties[i]->mnc);
}
printf("Number of RRH %d\n",enb_properties.properties[i]->nb_rrh_gw);
for (j=0; j< enb_properties.properties[i]->nb_rrh_gw; j++) {
if (enb_properties.properties[i]->rrh_gw_config[j].active == 1 ){
printf( "\n\tRRH GW %d config for eNB %u:\n\n", j, i);
......@@ -2336,6 +2336,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->nb_rrh_gw = 0;
for (j = 0; j < num_rrh_gw; j++) {
printf("num_rrh_gw is %d\n",num_rrh_gw);
setting_rrh_gw = config_setting_get_elem(setting_rrh_gws, j);
if ( !(
......@@ -2360,7 +2361,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
enb_properties.properties[enb_properties_index]->nb_rrh_gw += 1;
printf("nb_rrh_gw is %d\n",enb_properties.properties[enb_properties_index]->nb_rrh_gw);
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].rrh_gw_if_name = strdup(if_name);
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_address = strdup(ipv4);
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_address = strdup(ipv4_remote);
......@@ -2800,7 +2801,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
}
enb_properties.number = num_enb_properties;
printf("num_enb_properties %d\n",num_enb_properties);
printf("enb_properties.number %d\n",enb_properties.number);
AssertFatal (enb_properties_index == num_enb_properties,
"Failed to parse eNB configuration file %s, mismatch between %u active eNBs and %u corresponding defined eNBs !\n",
lib_config_file_name_pP, num_enb_properties, enb_properties_index);
......
......@@ -157,7 +157,7 @@ typedef struct Enb_properties_s {
} Enb_properties_t;
typedef struct Enb_properties_array_s {
int number;
int number;
Enb_properties_t *properties[MAX_ENB];
} Enb_properties_array_t;
......
......@@ -93,7 +93,7 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
oai_device_initfunc_t dp ;
oai_transport_initfunc_t tp ;
int ret=0;
printf("transport_init device->device->Mod_id %d\n",device->Mod_id);
if (flag == BBU_LOCAL_RADIO_HEAD) {
lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY);
if (!lib_handle) {
......
......@@ -67,7 +67,8 @@ int eth_socket_init_udp(openair0_device *device) {
int sock_type=0;
int sock_proto=0;
int enable=1;
printf("RRH %d\n",device->Mod_id);
printf("local %s, remote %s\n",device->openair0_cfg->my_addr,device->openair0_cfg->remote_addr);
if (device->host_type == RRH_HOST ) {
local_ip = device->openair0_cfg->my_addr;
local_port = device->openair0_cfg->my_port;
......
......@@ -392,8 +392,8 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
eth->compression = ALAW_COMPRESS;
}
printf("[ETHERNET]: Initializing openair0_device for %s ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"));
device->Mod_id = 0;//num_devices_eth++;
printf("[ETHERNET]: Initializing openair0_device for %s%d ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"),num_devices_eth);
device->Mod_id = 0;//+num_devices_eth++;
device->transp_type = ETHERNET_TP;
device->trx_start_func = trx_eth_start;
device->trx_request_func = trx_eth_request;
......@@ -404,7 +404,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
device->trx_stop_func = trx_eth_stop;
device->trx_set_freq_func = trx_eth_set_freq;
device->trx_set_gains_func = trx_eth_set_gains;
printf("Device->Mod_id %d\n",device->Mod_id);
if (eth->flags == ETH_RAW_MODE) {
device->trx_write_func = trx_eth_write_raw;
device->trx_read_func = trx_eth_read_raw;
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
Active_eNBs = ("eNB_Eurecom_LTEBox","eNB_Eurecom_LTEBox1");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -180,5 +180,182 @@ eNBs =
};
},
{
////////// Identification parameters:
eNB_ID = 0xe01;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox1";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "93";
////////// Physical parameters:
component_carriers = (
{
node_function = "eNodeB_3GPP";
node_timing = "synch_to_ext_device";
node_synch_ref = 0;
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 2;
nb_antennas_tx = 2;
nb_antennas_rx = 2;
tx_gain = 25;
rx_gain = 20;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = 0;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 0;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -108;
pusch_alpha = "AL1";
pucch_p0_Nominal = -108;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 2;
rach_preambleInitialReceivedTargetPower = -100;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
ue_TransmissionMode = 2;
}
);
srb1_parameters :
{
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
timer_poll_retransmit = 80;
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
timer_reordering = 35;
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
timer_status_prohibit = 0;
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
poll_pdu = 4;
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
poll_byte = 99999;
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
max_retx_threshold = 4;
}
# ------- SCTP definitions
SCTP :
{
# Number of streams to use in input/output
SCTP_INSTREAMS = 2;
SCTP_OUTSTREAMS = 2;
};
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.13.11";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "enx58ef68b419df";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.13/24";
ENB_INTERFACE_NAME_FOR_S1U = "enx58ef68b419df";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.13/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
log_config :
{
global_log_level ="trace";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="trace";
phy_log_verbosity ="medium";
mac_log_level ="trace";
mac_log_verbosity ="medium";
rlc_log_level ="trace";
rlc_log_verbosity ="medium";
pdcp_log_level ="trace";
pdcp_log_verbosity ="medium";
rrc_log_level ="trace";
rrc_log_verbosity ="medium";
gtpu_log_level ="debug";
gtpu_log_verbosity ="medium";
udp_log_level ="debug";
udp_log_verbosity ="medium";
osa_log_level ="debug";
osa_log_verbosity ="low";
};
}
);
......@@ -149,16 +149,16 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eno2";
ENB_INTERFACE_NAME_FOR_S1_MME = "enx58ef68b419df";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "eno2";
ENB_INTERFACE_NAME_FOR_S1U = "enx58ef68b419df";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
rrh_gw_config = (
{
local_if_name = "eno2";
local_if_name = "enx58ef68b419df";
remote_address = "192.168.12.171";
local_address = "192.168.12.170";
local_port = 50000; #for raw option local port must be the same to remote
......@@ -337,20 +337,20 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eno2";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "eno2";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24";
ENB_INTERFACE_NAME_FOR_S1_MME = "enxd8eb97b9c06c";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.14.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "enxd8eb97b9c06c";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.14.170/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
rrh_gw_config = (
{
local_if_name = "eno2";
remote_address = "192.168.12.171";
local_address = "192.168.12.170";
local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000;
local_if_name = "enxd8eb97b9c06c";
remote_address = "192.168.14.171";
local_address = "192.168.14.170";
local_port = 50001; #for raw option local port must be the same to remote
remote_port = 50001;
rrh_gw_active = "yes";
tr_preference = "udp_if4p5";
rf_preference = "usrp_b200";
......
......@@ -34,7 +34,7 @@ eNBs =
downlink_frequency = 2685000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 50;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antenna_ports = 1;
nb_antennas_tx = 1;
......@@ -149,16 +149,16 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "enx58ef68b419df";
ENB_INTERFACE_NAME_FOR_S1_MME = "eno2";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "enx58ef68b419df";
ENB_INTERFACE_NAME_FOR_S1U = "eno2";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.170/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
rrh_gw_config = (
{
local_if_name = "enx58ef68b419df";
local_if_name = "eno2";
remote_address = "192.168.12.171";
local_address = "192.168.12.170";
local_port = 50000; #for raw option local port must be the same to remote
......
......@@ -2341,6 +2341,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->fh_asynch = fh_if4p5_asynch_DL;
eNB->start_rf = start_rf;
eNB->start_if = start_if;
printf("oaisim_flag %d, eNB %d\n",oaisim_flag,eNB->Mod_id);
if (oaisim_flag == 0) {
ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]);
if (ret<0) {
......
......@@ -183,15 +183,13 @@ eth_params_t *eth_params;
void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *,int,int);
void stop_eNB(int nb_inst);
const Enb_properties_array_t *enb_properties;
static const Enb_properties_array_t *enb_properties;
int oaisim_flag=1;
void get_simulation_options(int argc, char *argv[])
{
int option;
char *conf_config_file_name = NULL;
enum long_option_e {
LONG_OPTION_START = 0x100, /* Start after regular single char options */
......@@ -796,31 +794,31 @@ void get_simulation_options(int argc, char *argv[])
if ((oai_emulation.info.nb_enb_local > 0) && (conf_config_file_name != NULL)) {
/* Read eNB configuration file */
enb_properties = enb_config_init(conf_config_file_name);
printf("Read eNB configuration file. enb_properties->number %d\n",(int)(*enb_properties).number);
AssertFatal (oai_emulation.info.nb_enb_local <= enb_properties->number,
"Number of eNB is greater than eNB defined in configuration file %s (%d/%d)!",
conf_config_file_name, oai_emulation.info.nb_enb_local, enb_properties->number);
eth_params = (eth_params_t*)malloc(enb_properties->properties[0]->nb_rrh_gw * sizeof(eth_params_t));
memset(eth_params, 0, enb_properties->properties[0]->nb_rrh_gw * sizeof(eth_params_t));
for (int i = 0; i < enb_properties->number; i++) {
eth_params = (eth_params_t*)malloc(enb_properties->properties[i]->nb_rrh_gw * sizeof(eth_params_t));
memset(eth_params, 0, enb_properties->properties[i]->nb_rrh_gw * sizeof(eth_params_t));
for (int j=0; j<enb_properties->properties[0]->nb_rrh_gw; j++) {
for (int j=0; j<enb_properties->properties[i]->nb_rrh_gw; j++) {
if (enb_properties->properties[0]->rrh_gw_config[j].active == 1 ) {
if (enb_properties->properties[i]->rrh_gw_config[j].active == 1 ) {
// local_remote_radio = BBU_REMOTE_RADIO_HEAD;
(eth_params+j)->local_if_name = enb_properties->properties[0]->rrh_gw_config[j].rrh_gw_if_name;
(eth_params+j)->my_addr = enb_properties->properties[0]->rrh_gw_config[j].local_address;
(eth_params+j)->my_port = enb_properties->properties[0]->rrh_gw_config[j].local_port;
(eth_params+j)->remote_addr = enb_properties->properties[0]->rrh_gw_config[j].remote_address;
(eth_params+j)->remote_port = enb_properties->properties[0]->rrh_gw_config[j].remote_port;
(eth_params+j)->local_if_name = enb_properties->properties[i]->rrh_gw_config[j].rrh_gw_if_name;
(eth_params+j)->my_addr = enb_properties->properties[i]->rrh_gw_config[j].local_address;
(eth_params+j)->my_port = enb_properties->properties[i]->rrh_gw_config[j].local_port;
(eth_params+j)->remote_addr = enb_properties->properties[i]->rrh_gw_config[j].remote_address;
(eth_params+j)->remote_port = enb_properties->properties[i]->rrh_gw_config[j].remote_port;
if (enb_properties->properties[0]->rrh_gw_config[j].raw == 1) {
if (enb_properties->properties[i]->rrh_gw_config[j].raw == 1) {
(eth_params+j)->transp_preference = ETH_RAW_MODE;
} else if (enb_properties->properties[0]->rrh_gw_config[j].rawif4p5 == 1) {
} else if (enb_properties->properties[i]->rrh_gw_config[j].rawif4p5 == 1) {
(eth_params+j)->transp_preference = ETH_RAW_IF4p5_MODE;
} else if (enb_properties->properties[0]->rrh_gw_config[j].udpif4p5 == 1) {
} else if (enb_properties->properties[i]->rrh_gw_config[j].udpif4p5 == 1) {
(eth_params+j)->transp_preference = ETH_UDP_IF4p5_MODE;
} else if (enb_properties->properties[0]->rrh_gw_config[j].rawif5_mobipass == 1) {
} else if (enb_properties->properties[i]->rrh_gw_config[j].rawif5_mobipass == 1) {
(eth_params+j)->transp_preference = ETH_RAW_IF5_MOBIPASS;
} else {
(eth_params+j)->transp_preference = ETH_UDP_MODE;
......@@ -828,18 +826,18 @@ void get_simulation_options(int argc, char *argv[])
}
}
/* Update some simulation parameters */
oai_emulation.info.frame_type[0] = enb_properties->properties[0]->frame_type[0];
oai_emulation.info.tdd_config[0] = enb_properties->properties[0]->tdd_config[0];
oai_emulation.info.tdd_config_S[0] = enb_properties->properties[0]->tdd_config_s[0];
oai_emulation.info.extended_prefix_flag[0] = enb_properties->properties[0]->prefix_type[0];
oai_emulation.info.node_function[0] = enb_properties->properties[0]->cc_node_function[0];
oai_emulation.info.node_timing[0] = enb_properties->properties[0]->cc_node_timing[0];
downlink_frequency[0][0] = enb_properties->properties[0]->downlink_frequency[0];
uplink_frequency_offset[0][0] = enb_properties->properties[0]->uplink_frequency_offset[0];
oai_emulation.info.N_RB_DL[0] = enb_properties->properties[0]->N_RB_DL[0];
oai_emulation.info.frame_type[0] = enb_properties->properties[i]->frame_type[0];
oai_emulation.info.tdd_config[0] = enb_properties->properties[i]->tdd_config[0];
oai_emulation.info.tdd_config_S[0] = enb_properties->properties[i]->tdd_config_s[0];
oai_emulation.info.extended_prefix_flag[0] = enb_properties->properties[i]->prefix_type[0];
oai_emulation.info.node_function[0] = enb_properties->properties[i]->cc_node_function[0];
oai_emulation.info.node_timing[0] = enb_properties->properties[i]->cc_node_timing[0];
downlink_frequency[0][0] = enb_properties->properties[i]->downlink_frequency[0];
uplink_frequency_offset[0][0] = enb_properties->properties[i]->uplink_frequency_offset[0];
oai_emulation.info.N_RB_DL[0] = enb_properties->properties[i]->N_RB_DL[0];
}
}
free(conf_config_file_name);
conf_config_file_name = 0;
}
......
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