Commit 6b615410 authored by Navid Nikaein's avatar Navid Nikaein

add configuration for component carriers

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5707 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5c3e0c95
...@@ -141,7 +141,7 @@ enum transmission_access_mode{ ...@@ -141,7 +141,7 @@ enum transmission_access_mode{
/// Context data structure for eNB subframe processing /// Context data structure for eNB subframe processing
typedef struct { typedef struct {
/// Component Carrier index /// Component Carrier index
int CC_id; uint8_t CC_id;
/// subframe index /// subframe index
int subframe; int subframe;
/// subframe to act upon for transmission /// subframe to act upon for transmission
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
/* /*
enb_config.c enb_config.c
------------------- -------------------
AUTHOR : Lionel GAUTHIER, Laurent Winckel AUTHOR : Lionel GAUTHIER, navid nikaein, Laurent Winckel
COMPANY : EURECOM COMPANY : EURECOM
EMAIL : Lionel.Gauthier@eurecom.fr EMAIL : Lionel.Gauthier@eurecom.fr, navid.nikaein@eurecom.fr
*/ */
#include <string.h> #include <string.h>
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <inttypes.h> #include <inttypes.h>
#include "log.h" #include "log.h"
#include "log_extern.h"
#include "assertions.h" #include "assertions.h"
#include "enb_config.h" #include "enb_config.h"
#if defined(OAI_EMU) #if defined(OAI_EMU)
...@@ -77,6 +78,10 @@ ...@@ -77,6 +78,10 @@
#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency" #define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset" #define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
#define ENB_CONFIG_STRING_COMPONENT_CARRIERS "component_carriers"
#define ENB_CONFIG_STRING_CELL_ID "cell_id"
#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL"
#define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address" #define ENB_CONFIG_STRING_MME_IP_ADDRESS "mme_ip_address"
#define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4" #define ENB_CONFIG_STRING_MME_IPV4_ADDRESS "ipv4"
#define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6" #define ENB_CONFIG_STRING_MME_IPV6_ADDRESS "ipv6"
...@@ -96,6 +101,26 @@ ...@@ -96,6 +101,26 @@
#define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info" #define ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO "info"
// per eNB configuration
#define ENB_CONFIG_STRING_LOG_CONFIG "log_config"
#define ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL "global_log_level"
#define ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY "global_log_verbosity"
#define ENB_CONFIG_STRING_HW_LOG_LEVEL "hw_log_level"
#define ENB_CONFIG_STRING_HW_LOG_VERBOSITY "hw_log_verbosity"
#define ENB_CONFIG_STRING_PHY_LOG_LEVEL "phy_log_level"
#define ENB_CONFIG_STRING_PHY_LOG_VERBOSITY "phy_log_verbosity"
#define ENB_CONFIG_STRING_MAC_LOG_LEVEL "mac_log_level"
#define ENB_CONFIG_STRING_MAC_LOG_VERBOSITY "mac_log_verbosity"
#define ENB_CONFIG_STRING_RLC_LOG_LEVEL "rlc_log_level"
#define ENB_CONFIG_STRING_RLC_LOG_VERBOSITY "rlc_log_verbosity"
#define ENB_CONFIG_STRING_PDCP_LOG_LEVEL "pdcp_log_level"
#define ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY "pdcp_log_verbosity"
#define ENB_CONFIG_STRING_RRC_LOG_LEVEL "rrc_log_level"
#define ENB_CONFIG_STRING_RRC_LOG_VERBOSITY "rrc_log_verbosity"
#define KHz (1000UL) #define KHz (1000UL)
#define MHz (1000 * KHz) #define MHz (1000 * KHz)
...@@ -141,13 +166,13 @@ static const eutra_band_t eutra_bands[] = ...@@ -141,13 +166,13 @@ static const eutra_band_t eutra_bands[] =
static Enb_properties_array_t enb_properties; static Enb_properties_array_t enb_properties;
static void enb_config_display(void) { static void enb_config_display(void) {
int i; int i,j;
printf( "\n----------------------------------------------------------------------\n"); printf( "\n----------------------------------------------------------------------\n");
printf( " ENB CONFIG FILE CONTENT LOADED (TBC):\n"); printf( " ENB CONFIG FILE CONTENT LOADED (TBC):\n");
printf( "----------------------------------------------------------------------\n"); printf( "----------------------------------------------------------------------\n");
for (i = 0; i < enb_properties.number; i++) { for (i = 0; i < enb_properties.number; i++) {
printf( "ENB CONFIG no %u:\n\n", i); printf( "ENB CONFIG for instance %u:\n\n", i);
printf( "\teNB name: \t%s:\n",enb_properties.properties[i]->eNB_name); printf( "\teNB name: \t%s:\n",enb_properties.properties[i]->eNB_name);
printf( "\teNB ID: \t%u:\n",enb_properties.properties[i]->eNB_id); printf( "\teNB ID: \t%u:\n",enb_properties.properties[i]->eNB_id);
printf( "\tCell type: \t%s:\n",enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB"); printf( "\tCell type: \t%s:\n",enb_properties.properties[i]->cell_type == CELL_MACRO_ENB ? "CELL_MACRO_ENB":"CELL_HOME_ENB");
...@@ -155,9 +180,22 @@ static void enb_config_display(void) { ...@@ -155,9 +180,22 @@ static void enb_config_display(void) {
printf( "\tMCC: \t%u:\n",enb_properties.properties[i]->mcc); printf( "\tMCC: \t%u:\n",enb_properties.properties[i]->mcc);
printf( "\tMNC: \t%u:\n",enb_properties.properties[i]->mnc); printf( "\tMNC: \t%u:\n",enb_properties.properties[i]->mnc);
printf( "\teutra band: \t%d:\n",enb_properties.properties[i]->eutra_band); printf( "\teutra band: \t%d:\n",enb_properties.properties[i]->eutra_band);
printf( "\tdownlink freq:\t%u:\n",enb_properties.properties[i]->downlink_frequency); printf( "\tdownlink freq: \t%u:\n",enb_properties.properties[i]->downlink_frequency);
printf( "\tuplink freq: \t%d:\n",enb_properties.properties[i]->uplink_frequency_offset); printf( "\tuplink freq: \t%d:\n",enb_properties.properties[i]->uplink_frequency_offset);
for (j=0; j< enb_properties.properties[i]->nb_cc; j++) {
printf( "\n\tCell ID for CC %d:\t%d:\n",j,enb_properties.properties[i]->cell_id[j]);
printf( "\tN_RB_DL for CC %d:\t%d:\n",j,enb_properties.properties[i]->N_RB_DL[j]);
}
printf( "\n\tGlobal log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->glog_level));
printf( "\tHW log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->hw_log_level));
printf( "\tPHY log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->phy_log_level));
printf( "\tMAC log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->mac_log_level));
printf( "\tRLC log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->rlc_log_level));
printf( "\tPDCP log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->pdcp_log_level));
printf( "\tRRC log level: \t%s\n", map_int_to_str(log_level_names,enb_properties.properties[i]->rrc_log_level));
printf( "\n--------------------------------------------------------\n"); printf( "\n--------------------------------------------------------\n");
} }
} }
...@@ -214,6 +252,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -214,6 +252,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
config_t cfg; config_t cfg;
config_setting_t *setting = NULL; config_setting_t *setting = NULL;
config_setting_t *subsetting = NULL; config_setting_t *subsetting = NULL;
config_setting_t *setting_component_carriers = NULL;
config_setting_t *component_carrier = NULL;
config_setting_t *setting_mme_addresses = NULL; config_setting_t *setting_mme_addresses = NULL;
config_setting_t *setting_mme_address = NULL; config_setting_t *setting_mme_address = NULL;
config_setting_t *setting_enb = NULL; config_setting_t *setting_enb = NULL;
...@@ -221,6 +261,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -221,6 +261,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
int enb_properties_index = 0; int enb_properties_index = 0;
int num_enbs; int num_enbs;
int num_mme_address; int num_mme_address;
int num_component_carriers =0;
int i; int i;
int j; int j;
int parse_errors = 0; int parse_errors = 0;
...@@ -238,6 +279,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -238,6 +279,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
long int eutra_band; long int eutra_band;
long long int downlink_frequency; long long int downlink_frequency;
long int uplink_frequency_offset; long int uplink_frequency_offset;
long int cell_id[MAX_NUM_CCs];
long int N_RB_DL[MAX_NUM_CCs];
char* ipv4 = NULL; char* ipv4 = NULL;
char* ipv6 = NULL; char* ipv6 = NULL;
char* active = NULL; char* active = NULL;
...@@ -250,6 +293,20 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -250,6 +293,20 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
char *address = NULL; char *address = NULL;
char *cidr = NULL; char *cidr = NULL;
char *astring = NULL; char *astring = NULL;
char* glog_level = NULL;
char* glog_verbosity = NULL;
char* hw_log_level = NULL;
char* hw_log_verbosity = NULL;
char* phy_log_level = NULL;
char* phy_log_verbosity = NULL;
char* mac_log_level = NULL;
char* mac_log_verbosity = NULL;
char* rlc_log_level = NULL;
char* rlc_log_verbosity = NULL;
char* pdcp_log_level = NULL;
char* pdcp_log_verbosity = NULL;
char* rrc_log_level = NULL;
char* rrc_log_verbosity = NULL;
memset((char*) (enb_properties.properties), 0 , MAX_ENB * sizeof(Enb_properties_t *)); memset((char*) (enb_properties.properties), 0 , MAX_ENB * sizeof(Enb_properties_t *));
memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*));
...@@ -423,22 +480,22 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -423,22 +480,22 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_EUTRA_BAND, &eutra_band)) { if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_EUTRA_BAND, &eutra_band)) {
enb_properties.properties[enb_properties_index]->eutra_band = eutra_band; enb_properties.properties[enb_properties_index]->eutra_band = eutra_band;
printf( "\teutra band:\t%d\n",enb_properties.properties[enb_properties_index]->eutra_band); // printf( "\teutra band:\t%d\n",enb_properties.properties[enb_properties_index]->eutra_band);
} else { } else {
enb_properties.properties[enb_properties_index]->eutra_band = 7; // Default band enb_properties.properties[enb_properties_index]->eutra_band = 7; // Default band
printf( "\teutra band:\t%d (default)\n",enb_properties.properties[enb_properties_index]->eutra_band); //printf( "\teutra band:\t%d (default)\n",enb_properties.properties[enb_properties_index]->eutra_band);
} }
if(config_setting_lookup_int64(setting_enb, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)) { if(config_setting_lookup_int64(setting_enb, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency)) {
enb_properties.properties[enb_properties_index]->downlink_frequency = (uint32_t) downlink_frequency; enb_properties.properties[enb_properties_index]->downlink_frequency = (uint32_t) downlink_frequency;
printf( "\tdownlink freq:\t%u\n",enb_properties.properties[enb_properties_index]->downlink_frequency); //printf( "\tdownlink freq:\t%u\n",enb_properties.properties[enb_properties_index]->downlink_frequency);
} else { } else {
enb_properties.properties[enb_properties_index]->downlink_frequency = 2680000000UL; // Default downlink frequency enb_properties.properties[enb_properties_index]->downlink_frequency = 2680000000UL; // Default downlink frequency
printf( "\tdownlink freq:\t%u (default)\n",enb_properties.properties[enb_properties_index]->downlink_frequency); // printf( "\tdownlink freq:\t%u (default)\n",enb_properties.properties[enb_properties_index]->downlink_frequency);
} }
if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset)) { if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset)) {
enb_properties.properties[enb_properties_index]->uplink_frequency_offset = (unsigned int) uplink_frequency_offset; enb_properties.properties[enb_properties_index]->uplink_frequency_offset = (unsigned int) uplink_frequency_offset;
printf( "\tuplink freq offset:\t%ld\n",enb_properties.properties[enb_properties_index]->uplink_frequency_offset); //printf( "\tuplink freq offset:\t%ld\n",enb_properties.properties[enb_properties_index]->uplink_frequency_offset);
} else { } else {
// Default uplink frequency offset // Default uplink frequency offset
if (enb_properties.properties[enb_properties_index]->frame_type == FDD) { if (enb_properties.properties[enb_properties_index]->frame_type == FDD) {
...@@ -446,7 +503,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -446,7 +503,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
} else { } else {
enb_properties.properties[enb_properties_index]->uplink_frequency_offset = 0; enb_properties.properties[enb_properties_index]->uplink_frequency_offset = 0;
} }
printf( "\tuplink freq offset:\t%ld (default)\n",enb_properties.properties[enb_properties_index]->uplink_frequency_offset); //printf( "\tuplink freq offset:\t%ld (default)\n",enb_properties.properties[enb_properties_index]->uplink_frequency_offset);
} }
parse_errors += enb_check_band_frequencies(lib_config_file_name_pP, parse_errors += enb_check_band_frequencies(lib_config_file_name_pP,
...@@ -456,6 +513,36 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -456,6 +513,36 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
enb_properties.properties[enb_properties_index]->uplink_frequency_offset, enb_properties.properties[enb_properties_index]->uplink_frequency_offset,
enb_properties.properties[enb_properties_index]->frame_type); enb_properties.properties[enb_properties_index]->frame_type);
setting_component_carriers = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_COMPONENT_CARRIERS);
enb_properties.properties[enb_properties_index]->nb_cc = 0;
if(setting_component_carriers != NULL) {
num_component_carriers = config_setting_length(setting_component_carriers);
//printf("num component carrier %d \n", num_component_carriers);
//enb_properties.properties[enb_properties_index]->nb_cc = num_component_carriers;
for (j = 0; j < num_component_carriers /*&& j < MAX_NUM_CCs*/; j++) {
component_carrier = config_setting_get_elem(setting_component_carriers, j);
if(!(config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_CELL_ID, &cell_id[j]) &&
config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_N_RB_DL, &N_RB_DL[j]) )
){
AssertError (0, parse_errors ++,
"Failed to parse eNB configuration file %s, Component Carrier!\n",
lib_config_file_name_pP);
}
enb_properties.properties[enb_properties_index]->nb_cc++;
enb_properties.properties[enb_properties_index]->cell_id[j]= cell_id[j];
enb_properties.properties[enb_properties_index]->N_RB_DL[j]= N_RB_DL[j];
//printf("adding component carrier %d\n", j);
}
} else {
for (j=0; j< MAX_NUM_CCs; j++) {
enb_properties.properties[enb_properties_index]->nb_cc +=1;
enb_properties.properties[enb_properties_index]->cell_id[j]=j;
enb_properties.properties[enb_properties_index]->N_RB_DL[j]=25;
}
}
setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS);
num_mme_address = config_setting_length(setting_mme_addresses); num_mme_address = config_setting_length(setting_mme_addresses);
enb_properties.properties[enb_properties_index]->nb_mme = 0; enb_properties.properties[enb_properties_index]->nb_mme = 0;
...@@ -492,6 +579,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -492,6 +579,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1; enb_properties.properties[enb_properties_index]->mme_ip_address[j].ipv6 = 1;
} }
} }
// NETWORK_INTERFACES
subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG);
if(subsetting != NULL) { if(subsetting != NULL) {
if( ( if( (
...@@ -520,6 +608,131 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { ...@@ -520,6 +608,131 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) {
} }
} }
} }
// log_config
subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_LOG_CONFIG);
if(subsetting != NULL) {
// global
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_LEVEL, (const char **) &glog_level)) {
if ((enb_properties.properties[enb_properties_index]->glog_level = map_str_to_int(log_level_names, glog_level)) == -1)
enb_properties.properties[enb_properties_index]->glog_level = LOG_INFO;
//printf( "\tGlobal log level :\t%s->%d\n",glog_level, enb_properties.properties[enb_properties_index]->glog_level);
} else {
enb_properties.properties[enb_properties_index]->glog_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_GLOBAL_LOG_VERBOSITY,(const char **) &glog_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->glog_verbosity = map_str_to_int(log_verbosity_names, glog_verbosity)) == -1)
enb_properties.properties[enb_properties_index]->glog_verbosity = LOG_MED;
//printf( "\tGlobal log verbosity:\t%s->%d\n",glog_verbosity, enb_properties.properties[enb_properties_index]->glog_verbosity);
} else {
enb_properties.properties[enb_properties_index]->glog_verbosity = LOG_MED;
}
// HW
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_LEVEL, (const char **) &hw_log_level)) {
if ((enb_properties.properties[enb_properties_index]->hw_log_level = map_str_to_int(log_level_names,hw_log_level)) == -1)
enb_properties.properties[enb_properties_index]->hw_log_level = LOG_INFO;
//printf( "\tHW log level :\t%s->%d\n",hw_log_level,enb_properties.properties[enb_properties_index]->hw_log_level);
} else {
enb_properties.properties[enb_properties_index]->hw_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_HW_LOG_VERBOSITY, (const char **) &hw_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->hw_log_verbosity = map_str_to_int(log_verbosity_names,hw_log_verbosity)) == -1)
enb_properties.properties[enb_properties_index]->hw_log_verbosity = LOG_MED;
//printf( "\tHW log verbosity:\t%s->%d\n",hw_log_verbosity, enb_properties.properties[enb_properties_index]->hw_log_verbosity);
} else {
enb_properties.properties[enb_properties_index]->hw_log_verbosity = LOG_MED;
}
// phy
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_LEVEL,(const char **) &phy_log_level)) {
if ((enb_properties.properties[enb_properties_index]->phy_log_level = map_str_to_int(log_level_names,phy_log_level)) == -1)
enb_properties.properties[enb_properties_index]->phy_log_level = LOG_INFO;
//printf( "\tPHY log level :\t%s->%d\n",phy_log_level,enb_properties.properties[enb_properties_index]->phy_log_level);
} else {
enb_properties.properties[enb_properties_index]->phy_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PHY_LOG_VERBOSITY, (const char **)&phy_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->phy_log_verbosity = map_str_to_int(log_verbosity_names,phy_log_verbosity)) == -1)
enb_properties.properties[enb_properties_index]->phy_log_verbosity = LOG_MED;
//printf( "\tPHY log verbosity:\t%s->%d\n",phy_log_level,enb_properties.properties[enb_properties_index]->phy_log_verbosity);
} else {
enb_properties.properties[enb_properties_index]->phy_log_verbosity = LOG_MED;
}
//mac
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_LEVEL, (const char **)&mac_log_level)) {
if ((enb_properties.properties[enb_properties_index]->mac_log_level = map_str_to_int(log_level_names,mac_log_level)) == -1 )
enb_properties.properties[enb_properties_index]->mac_log_level = LOG_INFO;
//printf( "\tMAC log level :\t%s->%d\n",mac_log_level,enb_properties.properties[enb_properties_index]->mac_log_level);
} else {
enb_properties.properties[enb_properties_index]->mac_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_MAC_LOG_VERBOSITY, (const char **)&mac_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->mac_log_verbosity = map_str_to_int(log_verbosity_names,mac_log_verbosity)) == -1)
enb_properties.properties[enb_properties_index]->mac_log_verbosity = LOG_MED;
//printf( "\tMAC log verbosity:\t%s->%d\n",mac_log_verbosity,enb_properties.properties[enb_properties_index]->mac_log_verbosity);
} else {
enb_properties.properties[enb_properties_index]->mac_log_verbosity = LOG_MED;
}
//rlc
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_LEVEL, (const char **)&rlc_log_level)) {
if ((enb_properties.properties[enb_properties_index]->rlc_log_level = map_str_to_int(log_level_names,rlc_log_level)) == -1)
enb_properties.properties[enb_properties_index]->rlc_log_level = LOG_INFO;
//printf( "\tRLC log level :\t%s->%d\n",rlc_log_level, enb_properties.properties[enb_properties_index]->rlc_log_level);
} else {
enb_properties.properties[enb_properties_index]->rlc_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RLC_LOG_VERBOSITY, (const char **)&rlc_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->rlc_log_verbosity = map_str_to_int(log_verbosity_names,rlc_log_verbosity)) == -1)
enb_properties.properties[enb_properties_index]->rlc_log_verbosity = LOG_MED;
//printf( "\tRLC log verbosity:\t%s->%d\n",rlc_log_verbosity, enb_properties.properties[enb_properties_index]->rlc_log_verbosity);
} else {
enb_properties.properties[enb_properties_index]->rlc_log_verbosity = LOG_MED;
}
//pdcp
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_LEVEL, (const char **)&pdcp_log_level)) {
if ((enb_properties.properties[enb_properties_index]->pdcp_log_level = map_str_to_int(log_level_names,pdcp_log_level)) == -1)
enb_properties.properties[enb_properties_index]->pdcp_log_level = LOG_INFO;
//printf( "\tPDCP log level :\t%s->%d\n",pdcp_log_level, enb_properties.properties[enb_properties_index]->pdcp_log_level);
} else {
enb_properties.properties[enb_properties_index]->pdcp_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_PDCP_LOG_VERBOSITY, (const char **)&pdcp_log_verbosity)) {
enb_properties.properties[enb_properties_index]->pdcp_log_verbosity = map_str_to_int(log_verbosity_names,pdcp_log_verbosity);
//printf( "\tPDCP log verbosity:\t%s->%d\n",pdcp_log_verbosity, enb_properties.properties[enb_properties_index]->pdcp_log_verbosity);
} else {
enb_properties.properties[enb_properties_index]->pdcp_log_verbosity = LOG_MED;
}
//rrc
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_LEVEL, (const char **)&rrc_log_level)) {
if ((enb_properties.properties[enb_properties_index]->rrc_log_level = map_str_to_int(log_level_names,rrc_log_level)) == -1 )
enb_properties.properties[enb_properties_index]->rrc_log_level = LOG_INFO;
//printf( "\tRRC log level :\t%s->%d\n",rrc_log_level,enb_properties.properties[enb_properties_index]->rrc_log_level);
} else {
enb_properties.properties[enb_properties_index]->rrc_log_level = LOG_INFO;
}
if(config_setting_lookup_string(subsetting, ENB_CONFIG_STRING_RRC_LOG_VERBOSITY, (const char **)&rrc_log_verbosity)) {
if ((enb_properties.properties[enb_properties_index]->rrc_log_verbosity = map_str_to_int(log_verbosity_names,rrc_log_verbosity)) == -1)
enb_properties.properties[enb_properties_index]->rrc_log_verbosity = LOG_MED;
//printf( "\tRRC log verbosity:\t%s->%d\n",rrc_log_verbosity,enb_properties.properties[enb_properties_index]->rrc_log_verbosity);
} else {
enb_properties.properties[enb_properties_index]->rrc_log_verbosity = LOG_MED;
}
} else { // not configuration is given
enb_properties.properties[enb_properties_index]->glog_level = LOG_INFO;
enb_properties.properties[enb_properties_index]->glog_verbosity = LOG_MED;
enb_properties.properties[enb_properties_index]->hw_log_level = LOG_INFO;
enb_properties.properties[enb_properties_index]->hw_log_verbosity = LOG_MED;
enb_properties.properties[enb_properties_index]->phy_log_level = LOG_INFO;
enb_properties.properties[enb_properties_index]->phy_log_verbosity = LOG_MED;
enb_properties.properties[enb_properties_index]->mac_log_level = LOG_INFO;
enb_properties.properties[enb_properties_index]->mac_log_verbosity = LOG_MED;
enb_properties.properties[enb_properties_index]->rlc_log_level = LOG_INFO;
enb_properties.properties[enb_properties_index]->rlc_log_verbosity = LOG_MED;
enb_properties.properties[enb_properties_index]->pdcp_log_level = LOG_INFO;
enb_properties.properties[enb_properties_index]->pdcp_log_verbosity = LOG_MED;
enb_properties.properties[enb_properties_index]->rrc_log_level = LOG_INFO;
enb_properties.properties[enb_properties_index]->rrc_log_verbosity = LOG_MED;
}
enb_properties_index += 1; enb_properties_index += 1;
break; break;
} }
......
...@@ -101,6 +101,11 @@ typedef struct Enb_properties_s { ...@@ -101,6 +101,11 @@ typedef struct Enb_properties_s {
uint32_t downlink_frequency; uint32_t downlink_frequency;
int32_t uplink_frequency_offset; int32_t uplink_frequency_offset;
/* Nb of component carrier for a given enb */
int16_t nb_cc;
int16_t cell_id[2];//cell_id[MAX_NUM_CCs];// for testing, change later
int16_t N_RB_DL[2];//N_RB_DL[MAX_NUM_CCs];// for testing, change later
/* Nb of MME to connect to */ /* Nb of MME to connect to */
uint8_t nb_mme; uint8_t nb_mme;
/* List of MME to connect to */ /* List of MME to connect to */
...@@ -112,6 +117,22 @@ typedef struct Enb_properties_s { ...@@ -112,6 +117,22 @@ typedef struct Enb_properties_s {
char *enb_interface_name_for_S1_MME; char *enb_interface_name_for_S1_MME;
in_addr_t enb_ipv4_address_for_S1_MME; in_addr_t enb_ipv4_address_for_S1_MME;
// log config
int16_t glog_level;
int16_t glog_verbosity;
int16_t hw_log_level;
int16_t hw_log_verbosity;
int16_t phy_log_level;
int16_t phy_log_verbosity;
int16_t mac_log_level;
int16_t mac_log_verbosity;
int16_t rlc_log_level;
int16_t rlc_log_verbosity;
int16_t pdcp_log_level;
int16_t pdcp_log_verbosity;
int16_t rrc_log_level;
int16_t rrc_log_verbosity;
} Enb_properties_t; } Enb_properties_t;
typedef struct Enb_properties_array_s { typedef struct Enb_properties_array_s {
......
...@@ -30,8 +30,20 @@ eNBs = ...@@ -30,8 +30,20 @@ eNBs =
downlink_frequency = 2680000000L; downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
component_carriers = (
{
cell_id = 0;
N_RB_DL = 25;
},
{
cell_id = 1;
N_RB_DL = 50;
}
);
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.14.11"; mme_ip_address = ( { ipv4 = "192.168.13.11";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
active = "yes"; active = "yes";
preference = "ipv4"; preference = "ipv4";
...@@ -41,10 +53,29 @@ eNBs = ...@@ -41,10 +53,29 @@ eNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.14.10/24"; ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0"; ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.14.10/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24";
};
# available options for level: error, warn, notice, info, debug, trace
# available options for verbosity: none, low, medium, high, full
log_config :
{
global_log_level ="debug";
global_log_verbosity ="medium";
hw_log_level ="debug";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="debug";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
}; };
} }
......
...@@ -32,6 +32,17 @@ eNBs = ...@@ -32,6 +32,17 @@ eNBs =
downlink_frequency = 2680000000; downlink_frequency = 2680000000;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
component_carriers = (
{
cell_id = 0;
N_RB_DL = 25;
},
{
cell_id = 1;
N_RB_DL = 50;
}
);
////////// MME parameters: ////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.13.11"; mme_ip_address = ( { ipv4 = "192.168.13.11";
ipv6 = "192:168:30::17"; ipv6 = "192:168:30::17";
...@@ -49,5 +60,23 @@ eNBs = ...@@ -49,5 +60,23 @@ eNBs =
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24"; ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24";
}; };
log_config :
{
global_log_level ="debug";
global_log_verbosity ="medium";
hw_log_level ="debug";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="debug";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
} }
); );
...@@ -24,6 +24,8 @@ endif ...@@ -24,6 +24,8 @@ endif
CFLAGS += -O2 CFLAGS += -O2
CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/COMMON CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/COMMON
CFLAGS += -DMAX_NUM_CCs=1
ifeq ($(USRP),0) ifeq ($(USRP),0)
CFLAGS += -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO CFLAGS += -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO
endif endif
......
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
/*! \file lte-softmodem.c /*! \file lte-softmodem.c
* \brief main program to control HW and scheduling * \brief main program to control HW and scheduling
* \author R. Knopp, F. Kaltenberger * \author R. Knopp, F. Kaltenberger, Navid Nikaein
* \date 2012 * \date 2012
* \version 0.1 * \version 0.1
* \company Eurecom * \company Eurecom
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr * \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
* \note * \note
* \warning * \warning
*/ */
...@@ -306,6 +306,21 @@ static LTE_DL_FRAME_PARMS *frame_parms; ...@@ -306,6 +306,21 @@ static LTE_DL_FRAME_PARMS *frame_parms;
int multi_thread=1; int multi_thread=1;
int N_RB_DL=25; int N_RB_DL=25;
int16_t glog_level=LOG_DEBUG;
int16_t glog_verbosity=LOG_MED;
int16_t hw_log_level=LOG_DEBUG;
int16_t hw_log_verbosity=LOG_MED;
int16_t phy_log_level=LOG_DEBUG;
int16_t phy_log_verbosity=LOG_MED;
int16_t mac_log_level=LOG_DEBUG;
int16_t mac_log_verbosity=LOG_MED;
int16_t rlc_log_level=LOG_DEBUG;
int16_t rlc_log_verbosity=LOG_MED;
int16_t pdcp_log_level=LOG_DEBUG;
int16_t pdcp_log_verbosity=LOG_MED;
int16_t rrc_log_level=LOG_DEBUG;
int16_t rrc_log_verbosity=LOG_MED;
unsigned int build_rflocal(int txi, int txq, int rxi, int rxq) unsigned int build_rflocal(int txi, int txq, int rxi, int rxq)
{ {
return (txi + (txq<<6) + (rxi<<12) + (rxq<<18)); return (txi + (txq<<6) + (rxi<<12) + (rxq<<18));
...@@ -1695,6 +1710,7 @@ static void get_options (int argc, char **argv) { ...@@ -1695,6 +1710,7 @@ static void get_options (int argc, char **argv) {
int c; int c;
// char line[1000]; // char line[1000];
// int l; // int l;
int i,j,k;
#ifdef USRP #ifdef USRP
int clock_src; int clock_src;
#endif #endif
...@@ -1722,7 +1738,7 @@ static void get_options (int argc, char **argv) { ...@@ -1722,7 +1738,7 @@ static void get_options (int argc, char **argv) {
{"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT}, {"no-L2-connect", no_argument, NULL, LONG_OPTION_NO_L2_CONNECT},
{NULL, 0, NULL, 0}}; {NULL, 0, NULL, 0}};
while ((c = getopt_long (argc, argv, "C:dK:qO:SUVRMr:s:",long_options,NULL)) != -1) { while ((c = getopt_long (argc, argv, "C:dK:g:G:qO:SUVRMr:s:",long_options,NULL)) != -1) {
switch (c) { switch (c) {
case LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS: case LONG_OPTION_ULSCH_MAX_CONSECUTIVE_ERRORS:
ULSCH_max_consecutive_errors = atoi(optarg); ULSCH_max_consecutive_errors = atoi(optarg);
...@@ -1834,6 +1850,12 @@ static void get_options (int argc, char **argv) { ...@@ -1834,6 +1850,12 @@ static void get_options (int argc, char **argv) {
printf("Note: -s not defined for ExpressMIMO2\n"); printf("Note: -s not defined for ExpressMIMO2\n");
#endif #endif
break; break;
case 'g':
glog_level=atoi(optarg); // value between 1 - 9
break;
case 'G':
glog_verbosity=atoi(optarg);// value from 0, 0x5, 0x15, 0x35, 0x75
break;
default: default:
break; break;
} }
...@@ -1852,14 +1874,41 @@ static void get_options (int argc, char **argv) { ...@@ -1852,14 +1874,41 @@ static void get_options (int argc, char **argv) {
conf_config_file_name, NB_eNB_INST, enb_properties->number); conf_config_file_name, NB_eNB_INST, enb_properties->number);
/* Update some simulation parameters */ /* Update some simulation parameters */
frame_parms->frame_type = enb_properties->properties[0]->frame_type; for (i=0; i < enb_properties->number; i++) {
frame_parms->tdd_config = enb_properties->properties[0]->tdd_config;
frame_parms->tdd_config_S = enb_properties->properties[0]->tdd_config_s; frame_parms->frame_type = enb_properties->properties[i]->frame_type;
for (i = 0 ; i < (sizeof(downlink_frequency) / sizeof (downlink_frequency[0])); i++) { frame_parms->tdd_config = enb_properties->properties[i]->tdd_config;
downlink_frequency[i] = enb_properties->properties[0]->downlink_frequency; frame_parms->tdd_config_S = enb_properties->properties[i]->tdd_config_s;
printf("Downlink frequency set to %u\n", downlink_frequency[i]);
uplink_frequency_offset[i] = enb_properties->properties[0]->uplink_frequency_offset; for (j=0; j < enb_properties->properties[i]->nb_cc; j++ ){
} frame_parms->Nid_cell = enb_properties->properties[i]->cell_id;
frame_parms->N_RB_DL = enb_properties->properties[i]->N_RB_DL;
} // j
glog_level = enb_properties->properties[i]->glog_level;
glog_verbosity = enb_properties->properties[i]->glog_verbosity;
hw_log_level = enb_properties->properties[i]->hw_log_level;
hw_log_verbosity = enb_properties->properties[i]->hw_log_verbosity ;
phy_log_level = enb_properties->properties[i]->phy_log_level;
phy_log_verbosity = enb_properties->properties[i]->phy_log_verbosity;
mac_log_level = enb_properties->properties[i]->mac_log_level;
mac_log_verbosity = enb_properties->properties[i]->mac_log_verbosity;
rlc_log_level = enb_properties->properties[i]->rlc_log_level;
rlc_log_verbosity = enb_properties->properties[i]->rlc_log_verbosity;
pdcp_log_level = enb_properties->properties[i]->pdcp_log_level;
pdcp_log_verbosity = enb_properties->properties[i]->pdcp_log_verbosity;
rrc_log_level = enb_properties->properties[i]->rrc_log_level;
rrc_log_verbosity = enb_properties->properties[i]->rrc_log_verbosity;
// adjust the log
for (k = 0 ; k < (sizeof(downlink_frequency) / sizeof (downlink_frequency[0])); k++) {
downlink_frequency[k] = enb_properties->properties[i]->downlink_frequency;
printf("Downlink frequency set to %u\n", downlink_frequency[k]);
uplink_frequency_offset[k] = enb_properties->properties[i]->uplink_frequency_offset;
} // k
}// i
} }
} }
...@@ -1916,7 +1965,7 @@ int main(int argc, char **argv) { ...@@ -1916,7 +1965,7 @@ int main(int argc, char **argv) {
// initialize the log (see log.h for details) // initialize the log (see log.h for details)
logInit(); logInit();
set_glog(LOG_DEBUG, LOG_MED); set_glog(glog_level, glog_verbosity);
if (UE_flag==1) if (UE_flag==1)
{ {
printf("configuring for UE\n"); printf("configuring for UE\n");
...@@ -1943,17 +1992,16 @@ int main(int argc, char **argv) { ...@@ -1943,17 +1992,16 @@ int main(int argc, char **argv) {
{ {
printf("configuring for eNB\n"); printf("configuring for eNB\n");
set_comp_log(HW, LOG_DEBUG, LOG_HIGH, 1); set_comp_log(HW, hw_log_level, hw_log_verbosity, 1);
#ifdef OPENAIR2 #ifdef OPENAIR2
set_comp_log(PHY, LOG_DEBUG, LOG_HIGH, 1); set_comp_log(PHY, phy_log_level, phy_log_verbosity, 1);
#else #else
set_comp_log(PHY, LOG_INFO, LOG_HIGH, 1); set_comp_log(PHY, LOG_INFO, LOG_HIGH, 1);
#endif #endif
set_comp_log(MAC, LOG_INFO, LOG_HIGH, 1); set_comp_log(MAC, mac_log_level, mac_log_verbosity, 1);
set_comp_log(RLC, LOG_TRACE, LOG_HIGH, 1); set_comp_log(RLC, rlc_log_level, rlc_log_verbosity, 1);
set_comp_log(PDCP, LOG_DEBUG, LOG_HIGH, 1); set_comp_log(PDCP, pdcp_log_level, pdcp_log_verbosity, 1);
set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1); set_comp_log(RRC, rrc_log_level, rrc_log_verbosity, 1);
set_comp_log(RRC, LOG_DEBUG, LOG_HIGH, 1);
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
set_comp_log(EMU, LOG_INFO, LOG_MED, 1); set_comp_log(EMU, LOG_INFO, LOG_MED, 1);
# if defined(ENABLE_USE_MME) # if defined(ENABLE_USE_MME)
...@@ -1967,6 +2015,7 @@ int main(int argc, char **argv) { ...@@ -1967,6 +2015,7 @@ int main(int argc, char **argv) {
#endif #endif
#endif #endif
set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1); set_comp_log(ENB_APP, LOG_INFO, LOG_HIGH, 1);
set_comp_log(OTG, LOG_INFO, LOG_HIGH, 1);
if (online_log_messages == 1) { if (online_log_messages == 1) {
set_component_filelog(RRC); set_component_filelog(RRC);
set_component_filelog(PDCP); set_component_filelog(PDCP);
......
...@@ -223,6 +223,7 @@ static void * dlsch_thread(void *param) { ...@@ -223,6 +223,7 @@ static void * dlsch_thread(void *param) {
#ifdef OPENAIR2 #ifdef OPENAIR2
mac_xface->ue_send_sdu(phy_vars_ue->Mod_id, mac_xface->ue_send_sdu(phy_vars_ue->Mod_id,
0, // CC_id
phy_vars_ue->frame, phy_vars_ue->frame,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->b, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->b,
phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS>>3, phy_vars_ue->dlsch_ue[eNB_id][0]->harq_processes[harq_pid]->TBS>>3,
......
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