Commit fb887794 authored by lfarizav's avatar lfarizav

Enabling multi RRU in large_scale_simulation branch -- RRU side

parent b1750c29
......@@ -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=0;
int do_ofdm_mod = ue->do_ofdm_mod=1;
if (do_ofdm_mod==0)
{
......
......@@ -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);
//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);
......@@ -325,6 +325,7 @@ void enb_config_display(void)
printf( "\ttx_scheduling_advance :\t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_scheduling_advance);
printf( "\ttx_sample_advance : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].tx_sample_advance);
printf( "\tiq_txshift : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].iq_txshift);
printf( "\tRRH associated to eNB : \t%d:\n",enb_properties.properties[i]->rrh_gw_config[j].eNB);
printf( "\ttransport : \t%s Ethernet:\n",(enb_properties.properties[i]->rrh_gw_config[j].raw == 1)? "RAW" : (enb_properties.properties[i]->rrh_gw_config[j].rawif4p5 == 1)? "RAW_IF4p5" : (enb_properties.properties[i]->rrh_gw_config[j].udpif4p5 == 1)? "UDP_IF4p5" : (enb_properties.properties[i]->rrh_gw_config[j].rawif5_mobipass == 1)? "RAW_IF5_MOBIPASS" : "UDP");
if (enb_properties.properties[i]->rrh_gw_config[j].exmimo == 1) {
printf( "\tRF target : \tEXMIMO:\n");
......@@ -2368,6 +2369,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].local_port = local_port;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].remote_port = remote_port;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].iq_txshift = iq_txshift;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].eNB = enb_properties_index;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_sample_advance = tx_sample_advance;
enb_properties.properties[enb_properties_index]->rrh_gw_config[j].tx_scheduling_advance= tx_scheduling_advance;
......
......@@ -93,7 +93,8 @@ typedef struct rrh_gw_config_s {
unsigned usrp_b200:1;
unsigned usrp_x300:1;
unsigned bladerf:1;
unsigned lmssdr:1;
unsigned lmssdr:1;
uint8_t eNB;
} rrh_gw_config_t;
typedef struct Enb_properties_s {
......
......@@ -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);
printf("transport_init device->Mod_id %d, addr %s, addr(ifdevice) %s\n",device->Mod_id,cfg->my_addr,openair0_cfg->my_addr);
if (flag == BBU_LOCAL_RADIO_HEAD) {
lib_handle = dlopen(OAI_RF_LIBNAME, RTLD_LAZY);
if (!lib_handle) {
......@@ -124,6 +124,7 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
tp = dlsym(lib_handle,"transport_init");
if (tp != NULL ) {
printf("device->device->Mod_id %d, cfg->addr %s\n",device->Mod_id,cfg->my_addr);
tp(device,openair0_cfg,cfg);
} else {
fprintf(stderr, "%s %d:oai device intializing function not found %s\n", __FILE__, __LINE__, dlerror());
......@@ -149,8 +150,10 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
return rc;
}
int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params) {
int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params, int eNB) {
int rc;
printf("eNB %d\n",eNB);
printf("device eNB %d, addr %s\n",device->Mod_id,eth_params->my_addr);
rc=load_lib(device, openair0_cfg, eth_params, BBU_REMOTE_RADIO_HEAD);
if ( rc >= 0) {
if ( set_transport(device) < 0) {
......@@ -159,7 +162,6 @@ int openair0_transport_load(openair0_device *device, openair0_config_t *openair0
}
}
return rc;
}
......
......@@ -382,7 +382,7 @@ extern "C"
/*! \brief Initialize openair RF target. It returns 0 if OK */
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg);
/*! \brief Initialize transport protocol . It returns 0 if OK */
int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params);
int openair0_transport_load(openair0_device *device, openair0_config_t *openair0_cfg, eth_params_t * eth_params,int eNB);
/*! \brief Get current timestamp of USRP
......
......@@ -56,7 +56,7 @@ int dest_addr_len[MAX_INST];
int trx_eth_start(openair0_device *device) {
eth_state_t *eth = (eth_state_t*)device->priv;
printf("trx_eth_start device->Mod_id %d\n",device->Mod_id);
/* initialize socket */
if (eth->flags == ETH_RAW_MODE) {
printf("Setting ETHERNET to ETH_RAW_IF5_MODE\n");
......@@ -89,7 +89,7 @@ int trx_eth_start(openair0_device *device) {
if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1;
} else if (eth->flags == ETH_UDP_IF4p5_MODE) {
printf("Setting ETHERNET to UDP_IF4p5_MODE\n");
printf("Setting ETHERNET to UDP_IF4p5_MODE, ifdevice %d, local_if_name %s\n",device->Mod_id,eth->if_name);
if (eth_socket_init_udp(device)!=0) return -1;
if (device->host_type == BBU_HOST) {
if(eth_set_dev_conf_udp(device)!=0) return -1;
......@@ -150,7 +150,7 @@ int trx_eth_request(openair0_device *device, void *msg, ssize_t msg_len) {
eth_state_t *eth = (eth_state_t*)device->priv;
/* BBU sends a message to RRH */
printf("trx_eth_request device->Mod_id %d\n",device->Mod_id);
if (sendto(eth->sockfd,msg,msg_len,0,(struct sockaddr *)&eth->dest_addr,eth->addr_len)==-1) {
perror("ETHERNET: ");
exit(0);
......@@ -391,9 +391,12 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
printf("transport_init: Unknown compression scheme %d - default to ALAW", eth_params->if_compress);
eth->compression = ALAW_COMPRESS;
}
printf("[ETHERNET]: Initializing openair0_device for %s%d ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"),num_devices_eth);
device->Mod_id = +num_devices_eth++;
openair0_cfg[0].my_addr = eth_params->my_addr;
device->openair0_cfg=&openair0_cfg[0];
printf("[ETHERNET]: Initializing openair0_device for %s of eNB %d ...\n", ((device->host_type == BBU_HOST) ? "BBU": "RRH"),num_devices_eth);
device->Mod_id = num_devices_eth;
printf("num_devices_eth %d, device->Mod_id %d, addr %s, local_if_name %s, addr(ifdevice) %s\n",num_devices_eth,device->Mod_id,eth_params->my_addr,eth_params->local_if_name,openair0_cfg->my_addr);
num_devices_eth++;
device->transp_type = ETHERNET_TP;
device->trx_start_func = trx_eth_start;
device->trx_request_func = trx_eth_request;
......@@ -404,7 +407,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);
//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;
......@@ -432,7 +435,7 @@ int transport_init(openair0_device *device, openair0_config_t *openair0_cfg, eth
openair0_cfg[0].iq_rxrescale = 15;//rescale iqs
openair0_cfg[0].iq_txshift = eth_params->iq_txshift;// shift
openair0_cfg[0].tx_sample_advance = eth_params->tx_sample_advance;
//openair0_cfg[1].my_addr = eth_params->my_addr;
/* RRH does not have any information to make this configuration atm */
if (device->host_type == BBU_HOST) {
/*Note scheduling advance values valid only for case 7680000 */
......
Active_eNBs = ("eNB_Eurecom_LTEBox","eNB_Eurecom_LTEBox1");
Active_eNBs = ("eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
......@@ -180,182 +180,5 @@ 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";
};
}
);
......@@ -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
......@@ -222,7 +222,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,18 +149,18 @@ 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 = "enx58ef68b419df";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.14.170/24";
ENB_INTERFACE_NAME_FOR_S1U = "enx58ef68b419df";
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_if_name = "enx58ef68b419df";
remote_address = "192.168.14.171";
local_address = "192.168.14.170";
local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000;
rrh_gw_active = "yes";
......
......@@ -620,12 +620,15 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
* \param param is a \ref eNB_proc_t structure which contains the info what to process.
* \returns a pointer to an int. The storage is not on the heap and must not be freed.
*/
static void* eNB_thread_rxtx( void* param ) {
static void* eNB_thread_rxtx_0( void* param ) {
static int eNB_thread_rxtx_status;
eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
//eNB_proc_t *eNB_proc = &eNB->proc;
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
//int eNB_id=0;
//eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
//PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
char thread_name[100];
......@@ -660,7 +663,49 @@ static void* eNB_thread_rxtx( void* param ) {
eNB_thread_rxtx_status = 0;
return &eNB_thread_rxtx_status;
}
static void* eNB_thread_rxtx_1( void* param ) {
static int eNB_thread_rxtx_status;
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
//eNB_proc_t *eNB_proc = &eNB->proc;
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[1];
//int eNB_id=0;
//eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
//PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
char thread_name[100];
// set default return value
eNB_thread_rxtx_status = 0;
sprintf(thread_name,"RXn_TXnp4_%d\n",&eNB->proc.proc_rxtx[1] == proc ? 0 : 1);
thread_top_init(thread_name,1,850000L,1000000L,2000000L);
while (!oai_exit) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
if (wait_on_condition(&proc->mutex_rxtx,&proc->cond_rxtx,&proc->instance_cnt_rxtx,thread_name)<0) break;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 1 );
if (oai_exit) break;
if (eNB->CC_id==0)
if (rxtx(eNB,proc,thread_name) < 0) break;
} // while !oai_exit
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_eNB_PROC_RXTX0+(proc->subframe_rx&1), 0 );
printf( "Exiting eNB thread RXn_TXnp4\n");
eNB_thread_rxtx_status = 0;
return &eNB_thread_rxtx_status;
}
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
/* Wait for eNB application initialization to be complete (eNB registration to MME) */
static void wait_system_ready (char *message, volatile int *start_flag) {
......@@ -880,9 +925,10 @@ void fh_if4p5_asynch_DL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
static void* eNB_thread_asynch_rxtx( void* param ) {
static int eNB_thread_asynch_rxtx_status;
eNB_proc_t *proc = (eNB_proc_t*)param;
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
eNB_proc_t *proc = &eNB->proc;
//eNB_proc_t *proc = (eNB_proc_t*)param;
//PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
......@@ -1349,7 +1395,7 @@ void rx_fh_if4p5(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
if (eNB->CC_id==0)
proc->frame_offset = 0;
else
proc->frame_offset = PHY_vars_eNB_g[0][0]->proc.frame_rx;
proc->frame_offset = PHY_vars_eNB_g[eNB->Mod_id][eNB->CC_id]->proc.frame_rx;
*frame = proc->frame_rx;//(proc->frame_rx + proc->frame_offset)&1023;
*subframe = proc->subframe_rx;
......@@ -1602,9 +1648,11 @@ int wakeup_synch(PHY_VARS_eNB *eNB){
static void* eNB_thread_FH( void* param ) {
static int eNB_thread_FH_status;
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
eNB_proc_t *proc = &eNB->proc;
eNB_proc_t *proc = (eNB_proc_t*)param;
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
//eNB_proc_t *proc = (eNB_proc_t*)param;
//PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
int subframe=0, frame=0;
......@@ -1685,9 +1733,8 @@ static void* eNB_thread_FH( void* param ) {
*/
static void* eNB_thread_prach( void* param ) {
static int eNB_thread_prach_status;
eNB_proc_t *proc = (eNB_proc_t*)param;
PHY_VARS_eNB *eNB= PHY_vars_eNB_g[0][proc->CC_id];
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
eNB_proc_t *proc = &eNB->proc;
// set default return value
eNB_thread_prach_status = 0;
......@@ -1716,13 +1763,15 @@ static void* eNB_thread_prach( void* param ) {
static void* eNB_thread_single( void* param ) {
static int eNB_thread_single_status;
eNB_proc_t *proc = (eNB_proc_t*)param;
PHY_VARS_eNB *eNB= (PHY_VARS_eNB *)param;
eNB_proc_t *proc = &eNB->proc;
eNB_rxtx_proc_t *proc_rxtx = &proc->proc_rxtx[0];
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
//printf("eNB_thread_single eNB_id = %d\n",eNB_id);
//PHY_VARS_eNB *eNB = PHY_vars_eNB_g[eNB_id][proc->CC_id];
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
eNB->CC_id = proc->CC_id;
int do_ofdm_mod = PHY_vars_UE_g[0][0]->do_ofdm_mod;
int do_ofdm_mod = PHY_vars_UE_g[0][eNB->CC_id]->do_ofdm_mod;
void *rxp[2],*rxp2[2];
void *rxp_freq[2],*rxp2_freq[2];
......@@ -1925,7 +1974,7 @@ static void* eNB_thread_single( void* param ) {
printf( "Exiting eNB_single thread \n");
eNB_thread_single_status = 0;
return &eNB_thread_single_status;
......@@ -2004,24 +2053,24 @@ void init_eNB_proc(int inst) {
#endif
if (eNB->single_thread_flag==0) {
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx, &proc_rxtx[0] );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx, &proc_rxtx[1] );
pthread_create( &proc->pthread_FH, attr_FH, eNB_thread_FH, &eNB->proc );
pthread_create( &proc_rxtx[0].pthread_rxtx, attr0, eNB_thread_rxtx_0, eNB );
pthread_create( &proc_rxtx[1].pthread_rxtx, attr1, eNB_thread_rxtx_1, eNB );
pthread_create( &proc->pthread_FH, attr_FH, eNB_thread_FH, eNB );
}
else {
pthread_create(&proc->pthread_single, attr_single, eNB_thread_single, &eNB->proc);
pthread_create(&proc->pthread_single, attr_single, eNB_thread_single, eNB);
init_fep_thread(eNB,attr_fep);
init_td_thread(eNB,attr_td);
init_te_thread(eNB,attr_te);
}
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, &eNB->proc );
pthread_create( &proc->pthread_prach, attr_prach, eNB_thread_prach, eNB );
pthread_create( &proc->pthread_synch, attr_synch, eNB_thread_synch, eNB);
if ((eNB->node_timing == synch_to_other) ||
(eNB->node_function == NGFI_RRU_IF5) ||
(eNB->node_function == NGFI_RRU_IF4p5))
pthread_create( &proc->pthread_asynch_rxtx, attr_asynch, eNB_thread_asynch_rxtx, &eNB->proc );
pthread_create( &proc->pthread_asynch_rxtx, attr_asynch, eNB_thread_asynch_rxtx, eNB );
char name[16];
if (eNB->single_thread_flag == 0) {
......@@ -2145,7 +2194,7 @@ int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_c
if (openair0_cfg[CC_id].mmapped_dma == 1) {
// replace RX signal buffers with mmaped HW versions
if (PHY_vars_UE_g[0][0]->do_ofdm_mod){
if (PHY_vars_UE_g[0][CC_id]->do_ofdm_mod){
for (i=0; i<frame_parms->nb_antennas_rx; i++) {
card = i/4;
ant = i%4;
......@@ -2279,13 +2328,13 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
int inst;
PHY_VARS_eNB *eNB;
int ret;
for (inst=0;inst<nb_inst;inst++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
printf("Number of inst %d, eNB %d, rfdevice %d, ifdevice %d, addr %s\n",inst,PHY_vars_eNB_g[inst][CC_id]->Mod_id,PHY_vars_eNB_g[inst][CC_id]->rfdevice.Mod_id,PHY_vars_eNB_g[inst][CC_id]->ifdevice.Mod_id,(eth_params+inst+CC_id)->my_addr);
eNB = PHY_vars_eNB_g[inst][CC_id];
eNB->node_function = node_function[CC_id];
eNB->node_timing = node_timing[CC_id];
eNB->eth_params = eth_params+CC_id;
eNB->eth_params = (eth_params+CC_id+inst);
eNB->abstraction_flag = 0;
eNB->single_thread_flag = single_thread_flag;
eNB->ts_offset = 0;
......@@ -2307,7 +2356,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->proc_uespec_rx = NULL;
eNB->proc_tx = NULL;
eNB->tx_fh = NULL;
eNB->rx_fh = (PHY_vars_UE_g[0][0]->do_ofdm_mod)?rx_rf_freq:rx_rf;
eNB->rx_fh = (PHY_vars_UE_g[0][CC_id]->do_ofdm_mod)?rx_rf_freq:rx_rf;
eNB->start_rf = start_rf;
eNB->start_if = start_if;
eNB->fh_asynch = fh_if5_asynch_DL;
......@@ -2320,7 +2369,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
}
eNB->rfdevice.host_type = RRH_HOST;
eNB->ifdevice.host_type = RRH_HOST;
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params);
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params,eNB->Mod_id);
printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
......@@ -2337,11 +2386,11 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->proc_uespec_rx = NULL;
eNB->proc_tx = NULL;//proc_tx_rru_if4p5;
eNB->tx_fh = NULL;
eNB->rx_fh = (PHY_vars_UE_g[0][0]->do_ofdm_mod)?rx_rf_freq:rx_rf;
eNB->rx_fh = (PHY_vars_UE_g[0][CC_id]->do_ofdm_mod)?rx_rf_freq:rx_rf;
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);
printf("oaisim_flag %d, eNB %d, rfdevice %d, ifdevice %d, addr %s\n",oaisim_flag,eNB->Mod_id,eNB->rfdevice.Mod_id,eNB->ifdevice.Mod_id,eNB->eth_params->my_addr);
if (oaisim_flag == 0) {
ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]);
if (ret<0) {
......@@ -2351,8 +2400,8 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
}
eNB->rfdevice.host_type = RRH_HOST;
eNB->ifdevice.host_type = RRH_HOST;
printf("loading transport interface ...\n");
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params);
printf("loading transport interface eNB %d, rfdevice %d, ifdevice %d, addr (ifdevice) ...\n",eNB->Mod_id,eNB->rfdevice.Mod_id,eNB->ifdevice.Mod_id);
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id+inst], eNB->eth_params,eNB->Mod_id);
printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
......@@ -2371,7 +2420,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX;
eNB->proc_tx = proc_tx_full;
eNB->tx_fh = NULL;
eNB->rx_fh = (PHY_vars_UE_g[0][0]->do_ofdm_mod)?rx_rf_freq:rx_rf;
eNB->rx_fh = (PHY_vars_UE_g[0][CC_id]->do_ofdm_mod)?rx_rf_freq:rx_rf;
eNB->start_rf = start_rf;
eNB->start_if = NULL;
eNB->fh_asynch = NULL;
......@@ -2416,7 +2465,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->ifdevice.host_type = BBU_HOST;
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params);
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params,eNB->Mod_id);
printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
......@@ -2439,7 +2488,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->fh_asynch = (eNB->node_timing == synch_to_other) ? fh_if4p5_asynch_UL : NULL;
eNB->rfdevice.host_type = BBU_HOST;
eNB->ifdevice.host_type = BBU_HOST;
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params);
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params,eNB->Mod_id);
printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
......@@ -2465,7 +2514,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst
eNB->rfdevice.host_type = BBU_HOST;
eNB->ifdevice.host_type = BBU_HOST;
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params);
ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params,eNB->Mod_id);
printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id);
if (ret<0) {
printf("Exiting, cannot initialize transport protocol\n");
......
......@@ -1356,7 +1356,7 @@ main (int argc, char **argv)
//oai_emulation.info.oeh_enabled = 1;
if (oai_emulation.info.oeh_enabled == 1)
schedule_events ();
printf("schedule events\n");
// oai performance profiler is enabled
if (oai_emulation.info.opp_enabled == 1)
reset_opp_meas_oaisim ();
......
......@@ -178,7 +178,7 @@ extern int xforms;
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
eth_params_t *eth_params;
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);
......@@ -794,49 +794,51 @@ 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);
printf("OAISIM reads eNB configuration file for %d eNBs\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);
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));
//printf("Read eNB configuration file. enb_properties->number_i %d\n",i);
eth_params = (eth_params_t*)malloc(enb_properties->number * sizeof(eth_params_t));
memset(eth_params, 0, enb_properties->number * sizeof(eth_params_t));
/*For each eNB*/
for (int i = 0; i < enb_properties->number; i++) {
for (int j=0; j<enb_properties->properties[i]->nb_rrh_gw; j++) {
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[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;
(eth_params+i+j)->local_if_name = enb_properties->properties[i]->rrh_gw_config[j].rrh_gw_if_name;
(eth_params+i+j)->my_addr = enb_properties->properties[i]->rrh_gw_config[j].local_address;
(eth_params+i+j)->my_port = enb_properties->properties[i]->rrh_gw_config[j].local_port;
(eth_params+i+j)->remote_addr = enb_properties->properties[i]->rrh_gw_config[j].remote_address;
(eth_params+i+j)->remote_port = enb_properties->properties[i]->rrh_gw_config[j].remote_port;
printf("%d RRH associated to eNB %d and local ip %s, (i,j)(%d,%d)\n",enb_properties->properties[i]->nb_rrh_gw,enb_properties->properties[i]->rrh_gw_config[j].eNB,(eth_params+i+j)->my_addr,i,j);
if (enb_properties->properties[i]->rrh_gw_config[j].raw == 1) {
(eth_params+j)->transp_preference = ETH_RAW_MODE;
(eth_params+i+j)->transp_preference = ETH_RAW_MODE;
} else if (enb_properties->properties[i]->rrh_gw_config[j].rawif4p5 == 1) {
(eth_params+j)->transp_preference = ETH_RAW_IF4p5_MODE;
(eth_params+i+j)->transp_preference = ETH_RAW_IF4p5_MODE;
} else if (enb_properties->properties[i]->rrh_gw_config[j].udpif4p5 == 1) {
(eth_params+j)->transp_preference = ETH_UDP_IF4p5_MODE;
//printf("enb_properties->properties[%d]->rrh_gw_config[%d].udpif4p5 == %d\n",i,j,enb_properties->properties[i]->rrh_gw_config[j].udpif4p5);
(eth_params+i+j)->transp_preference = ETH_UDP_IF4p5_MODE;
} else if (enb_properties->properties[i]->rrh_gw_config[j].rawif5_mobipass == 1) {
(eth_params+j)->transp_preference = ETH_RAW_IF5_MOBIPASS;
(eth_params+i+j)->transp_preference = ETH_RAW_IF5_MOBIPASS;
} else {
(eth_params+j)->transp_preference = ETH_UDP_MODE;
(eth_params+i+j)->transp_preference = ETH_UDP_MODE;
}
}
}
}
/* Update some simulation parameters */
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];
}
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];
}
free(conf_config_file_name);
conf_config_file_name = 0;
......@@ -1315,7 +1317,7 @@ void init_openair0() {
int card;
int i;
printf("init_openair0 MAX_CARDS %d\n",MAX_CARDS);
for (card=0; card<MAX_CARDS; card++) {
openair0_cfg[card].configFilename = NULL;
......@@ -1388,7 +1390,8 @@ void init_openair0() {
void init_devices(void){
module_id_t UE_id, eNB_id;
module_id_t UE_id;
uint8_t eNB_id;
uint8_t CC_id;
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
......@@ -1408,6 +1411,12 @@ void init_devices(void){
current_eNB_rx_timestamp[eNB_id][CC_id] = PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti;
last_eNB_rx_timestamp[eNB_id][CC_id] = 0;
}
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
PHY_vars_eNB_g[eNB_id][CC_id]->ifdevice.Mod_id = eNB_id;
PHY_vars_eNB_g[eNB_id][CC_id]->ifdevice.CC_id = CC_id;
}
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.Mod_id = UE_id;
PHY_vars_UE_g[UE_id][CC_id]->rfdevice.CC_id = CC_id;
......@@ -1430,7 +1439,8 @@ void init_devices(void){
void init_openair1(void)
{
module_id_t UE_id, eNB_id = 0;
module_id_t UE_id;
uint8_t eNB_id = 0;
uint8_t CC_id;
#if ENABLE_RAL
int list_index;
......@@ -1438,25 +1448,25 @@ void init_openair1(void)
// change the nb_connected_eNB
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
for (int i=0;i<enb_properties->number;i++) {
for (eNB_id=0;eNB_id<enb_properties->number;eNB_id++) {
init_lte_vars (&frame_parms[CC_id],
oai_emulation.info.frame_type[CC_id],
oai_emulation.info.tdd_config[CC_id],
oai_emulation.info.tdd_config_S[CC_id],
oai_emulation.info.extended_prefix_flag[CC_id],
oai_emulation.info.N_RB_DL[CC_id],
enb_properties->properties[i]->Nid_cell[CC_id],
enb_properties->properties[eNB_id]->Nid_cell[CC_id],
cooperation_flag,
enb_properties->properties[i]->nb_antenna_ports[CC_id],
enb_properties->properties[eNB_id]->nb_antenna_ports[CC_id],
abstraction_flag,
enb_properties->properties[i]->nb_antennas_rx[CC_id],
enb_properties->properties[i]->nb_antennas_tx[CC_id],
enb_properties->properties[eNB_id]->nb_antennas_rx[CC_id],
enb_properties->properties[eNB_id]->nb_antennas_tx[CC_id],
nb_antennas_rx_ue,
oai_emulation.info.eMBMS_active_state);
// This is for IF4p5 RRU, gets done by RRC configuration of eNB
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = enb_properties->properties[i]->prach_config_index[CC_id];
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = enb_properties->properties[i]->prach_freq_offset[CC_id];
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = enb_properties->properties[eNB_id]->prach_config_index[CC_id];
PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = enb_properties->properties[eNB_id]->prach_freq_offset[CC_id];
}
}
......@@ -1598,15 +1608,17 @@ void init_openair2(void)
{
#ifdef OPENAIR2
int CC_id;
//int eNB_id;
//#warning "eNB index is hard coded to zero"
//for (eNB_id=0; 1/*eNB_id<NB_eNB_INST*/; eNB_id++)
//{
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
l2_init (&PHY_vars_eNB_g[0][CC_id]->frame_parms,
oai_emulation.info.eMBMS_active_state,
NULL,
oai_emulation.info.cba_group_active,
oai_emulation.info.handover_active);
//}
mac_xface->macphy_exit = exit_fun;
#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