diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c index c5461610a1c2716d3f22fdd393b02d4f69160db7..c22ecf964a0e99d6734cd7c97c3b20e6bcd8cde5 100644 --- a/common/config/config_cmdline.c +++ b/common/config/config_cmdline.c @@ -37,27 +37,31 @@ int processoption(paramdef_t *cfgoptions, char *value) { -int optisset=0; -int noarg=0; - if ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) { - if (value == NULL) { - noarg=1; - } else if ( value[0] == '-') { - noarg = 1; - } - if (noarg == 1) { +int argok=1; +char *tmpval = value; +int optisset; +char defbool[2]="1"; + if (value == NULL) { + argok=0; + } else if ( value[0] == '-') { + argok = 0; + } + if ((cfgoptions->paramflags &PARAMFLAG_BOOL) == 0) { /* not a boolean, argument required */ + if (argok == 0) { fprintf(stderr,"[CONFIG] command line, option %s requires an argument\n",cfgoptions->optname); return 0; - } - } - + } + } else { /* boolean value */ + tmpval = defbool; + } + printf("cc 0x%08x, %i\n",tmpval,argok); switch(cfgoptions->type) { case TYPE_STRING: config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *)); - config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(value+1)); - sprintf(*(cfgoptions->strptr), "%s",value); - printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, value); + config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(tmpval+1)); + sprintf(*(cfgoptions->strptr), "%s",tmpval); + printf_cmdl("[CONFIG] %s set to %s from command line\n", cfgoptions->optname, tmpval); optisset=1; break; @@ -70,13 +74,13 @@ int noarg=0; case TYPE_UINT8: case TYPE_INT8: config_check_valptr(cfgoptions, (char **)&(cfgoptions->iptr),sizeof(int32_t)); - config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(value,NULL,0)); + config_assign_int(cfgoptions,cfgoptions->optname,(int32_t)strtol(tmpval,NULL,0)); optisset=1; break; case TYPE_UINT64: case TYPE_INT64: config_check_valptr(cfgoptions, (char **)&(cfgoptions->i64ptr),sizeof(uint64_t)); - *(cfgoptions->i64ptr)=strtoll(value,NULL,0); + *(cfgoptions->i64ptr)=strtoll(tmpval,NULL,0); printf_cmdl("[CONFIG] %s set to %lli from command line\n", cfgoptions->optname, (long long)*(cfgoptions->i64ptr)); optisset=1; break; @@ -86,7 +90,7 @@ int noarg=0; break; case TYPE_DOUBLE: config_check_valptr(cfgoptions, (char **)&(cfgoptions->dblptr),sizeof(double)); - *(cfgoptions->dblptr) = strtof(value,NULL); + *(cfgoptions->dblptr) = strtof(tmpval,NULL); printf_cmdl("[CONFIG] %s set to %lf from command line\n", cfgoptions->optname, *(cfgoptions->dblptr)); optisset=1; break; @@ -103,7 +107,7 @@ int noarg=0; cfgoptions->paramflags = cfgoptions->paramflags | PARAMFLAG_PARAMSET; } - return optisset; + return argok; } int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) @@ -123,7 +127,7 @@ char *cfgpath; j=0; p++; c--; - while (c >= 0 && *p != NULL) { + while (c > 0 && *p != NULL) { if (strcmp(*p, "-h") == 0 || strcmp(*p, "--help") == 0 ) { config_printhelp(cfgoptions,numoptions); } @@ -138,9 +142,19 @@ char *cfgpath; } if ( ((strlen(*p) == 2) && (strcmp(*p + 1,cfgpath) == 0)) || ((strlen(*p) > 2) && (strcmp(*p + 2,cfgpath ) == 0 )) ) { - p++; - j =+ processoption(&(cfgoptions[i]), *p); - c--; + + if (c > 1) { + p++; + c--; + j = processoption(&(cfgoptions[i]), *p); + if ( j== 0) { + c++; + p--; + } + } else { + j = processoption(&(cfgoptions[i]), NULL); + } + } } p++; diff --git a/common/config/config_load_configmodule.c b/common/config/config_load_configmodule.c index 753659129e71e7f273e837b81c922eb7ba5b6d4c..60bcefad5ea74f0ecb9b0ca717dccfa491e2ebc3 100644 --- a/common/config/config_load_configmodule.c +++ b/common/config/config_load_configmodule.c @@ -139,11 +139,10 @@ int i; modeparams = strdup("oaisoftmodem.conf"); } else if ( i == 1 ) { - /* -O argument doesn't contain ":" separator, legacy -O <conf file> option, default cfgmode to libconfig + /* -O argument doesn't contain ":" separator, assume -O <conf file> option, default cfgmode to libconfig with one parameter, the path to the configuration file */ modeparams=cfgmode; cfgmode=strdup("libconfig"); - tmpflags = tmpflags | CONFIG_LEGACY;/* temporary, legacy mode */ } cfgptr = malloc(sizeof(configmodule_interface_t)); diff --git a/common/config/config_load_configmodule.h b/common/config/config_load_configmodule.h index e9f1f7050fedfe2e992d6277fcd4cb8a0264d639..71c642f68054180bf521dfcd8a7e0f12bc39e57b 100644 --- a/common/config/config_load_configmodule.h +++ b/common/config/config_load_configmodule.h @@ -46,8 +46,7 @@ #define CONFIG_DEBUGCMDLINE 4 // print command line processing messages #define CONFIG_HELP 8 // print help message #define CONFIG_ABORT 16 // config failed,abort execution -/* temporary flag to be able to use legacy config mechanism */ -#define CONFIG_LEGACY (1 << 10) + typedef int(*configmodule_initfunc_t)(char *cfgP[],int numP); typedef int(*configmodule_getfunc_t)(paramdef_t *,int numparams, char *prefix); diff --git a/common/config/config_userapi.h b/common/config/config_userapi.h index 9cb4ff5773f44893f15848c5515dc202adad9f4c..6acaacf7166b3e3dcac77c46bff4bef5b7d4d807 100644 --- a/common/config/config_userapi.h +++ b/common/config/config_userapi.h @@ -54,7 +54,6 @@ extern int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *p #define config_getlist config_get_if()->getlist #define CONFIG_GETCONFFILE (config_get_if()->cfgP[0]) - #ifdef __cplusplus } #endif diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index 01318b8b91ec0ef293f6def6850559020e060a50..b4b6247104293f12e02e14aee6f462b8b8a22f2d 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -645,7 +645,8 @@ typedef enum { REMOTE_IF5 =1, REMOTE_MBP_IF5 =2, REMOTE_IF4p5 =3, - MAX_RU_IF_TYPES =4 + REMOTE_IF1pp =4, + MAX_RU_IF_TYPES =5 } RU_if_south_t; typedef struct RU_t_s{ diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 4e2491fe8576950c784d2c37b4667243bcbeeb8c..55a99ef03e991e834c2c55f3e90e16711dc55090 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -28,7 +28,6 @@ */ #include <string.h> -#include <libconfig.h> #include <inttypes.h> #include "log.h" @@ -55,2732 +54,63 @@ #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "enb_paramdef.h" #include "common/config/config_userapi.h" -/* those macros are here to help diagnose problems in configuration files - * if the lookup fails, a warning is printed - * (yes we can use the function name for the macro itself, the C preprocessor - * won't die in an infinite loop) - */ -#define config_setting_lookup_int(setting, name, value) \ - (config_setting_lookup_int(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_int64(setting, name, value) \ - (config_setting_lookup_int64(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_float(setting, name, value) \ - (config_setting_lookup_float(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_bool(setting, name, value) \ - (config_setting_lookup_bool(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) -#define config_setting_lookup_string(setting, name, value) \ - (config_setting_lookup_string(setting, name, value) || \ - (printf("WARNING: setting '%s' not found in configuration file\n", name), 0)) - - -/* temporary code to switch to Eurecom config mechanism */ -static int donotuse_configmodule = 1; -static int enb_check_band_frequencies(char* lib_config_file_name_pP, - int ind, - int16_t band, - uint32_t downlink_frequency, - int32_t uplink_frequency_offset, - lte_frame_type_t frame_type) -{ - int errors = 0; - - if (band > 0) { - int band_index; - - for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) { - if (band == eutra_bands[band_index].band) { - uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset; - - AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++, - "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too low (%u) for band %d!", - lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_min, band); - AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++, - "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too high (%u) for band %d!", - lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_max, band); - - AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++, - "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too low (%u) for band %d!", - lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_min, band); - AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++, - "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too high (%u) for band %d!", - lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_max, band); - - AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++, - "Failed to parse eNB configuration file %s, enb %d invalid frame type (%d/%d) for band %d!", - lib_config_file_name_pP, ind, eutra_bands[band_index].frame_type, frame_type, band); - } - } - } - - return errors; -} - -void RCconfig_RU(void); -void RCconfig_L1(void); -void RCconfig_macrlc(void); -int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); -int RCconfig_S1(MessageDef *msg_p, uint32_t i); - -void Eurecom_RCconfig_RU(void); -void Eurecom_RCconfig_L1(void); -void Eurecom_RCconfig_macrlc(void); -int Eurecom_RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); -int Eurecom_RCconfig_S1(MessageDef *msg_p, uint32_t i); - - - - -int load_config_file(config_t *cfg) { - - config_init(cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(cfg, RC.config_file_name)) { - config_destroy(cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - -} -void Eurecom_RCconfig_RU() { - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_ru = NULL; - config_setting_t *setting_band = NULL; - config_setting_t *setting_band_elem = NULL; - config_setting_t *setting_eNB_list = NULL; - config_setting_t *setting_eNB_list_elem = NULL; - char* if_name = NULL; - char* ipv4 = NULL; - char* ipv4_remote = NULL; - char *local_rf = NULL; - - char* tr_preference = NULL; - libconfig_int local_portc = 0; - libconfig_int remote_portc = 0; - libconfig_int local_portd = 0; - libconfig_int remote_portd = 0; - - libconfig_int nb_tx = 0; - libconfig_int nb_rx = 0; - libconfig_int att_tx = 0; - libconfig_int att_rx = 0; - libconfig_int max_pdschReferenceSignalPower = 0; - libconfig_int max_rxgain = 0; - int j = 0; - int i = 0; - int num_bands = 0; - libconfig_int band[256]; - int num_eNB4RU = 0; - libconfig_int eNB_list[256]; - int fronthaul_flag = CONFIG_TRUE; - /// TRUE for eNB or RRU, FALSE for RAU - int local_rf_flag = CONFIG_TRUE; - - load_config_file(&cfg); - - // Output a list of all RUs. - setting = config_lookup(&cfg, CONFIG_STRING_RU_LIST); - - if (setting != NULL) { - - - RC.ru = (RU_t**)malloc(RC.nb_RU*sizeof(RU_t*)); - - RC.ru_mask=(1<<NB_RU) - 1; - - - for (j = 0; j < RC.nb_RU; j++) { - - setting_ru = config_setting_get_elem(setting, j); - printf("rru %d/%d\n",j,RC.nb_RU); - - - if ( !( - config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_IF_NAME,(const char **)&if_name) - ) - ) { - fronthaul_flag = CONFIG_FALSE; - } - - if ( !( - config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_RF,(const char **)&local_rf) - ) - ) { - local_rf_flag = CONFIG_FALSE; - } - else { - if (strcmp(local_rf, "no") == 0) - local_rf_flag = CONFIG_FALSE; - } - if (local_rf_flag == CONFIG_TRUE) { // eNB or RRU - - - if ( !( - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RS_EPRE, &max_pdschReferenceSignalPower) && - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_MAX_RXGAIN, &max_rxgain) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, RU %d config !\n", - RC.config_file_name, j); - continue; - } - - - AssertFatal((setting_band = config_setting_get_member(setting_ru, CONFIG_STRING_RU_BAND_LIST))!=NULL,"No allowable LTE bands\n"); - - if (setting_band != NULL) num_bands = config_setting_length(setting_band); - else num_bands=0; - - for (i=0;i<num_bands;i++) { - setting_band_elem = config_setting_get_elem(setting_band,i); - band[i] = config_setting_get_int(setting_band_elem); - printf("RU %d: band %d\n",j,band[i]); - } - } // local_rf_flag == CONFIG_TRUE - - if (fronthaul_flag == CONFIG_TRUE) { - if ( !( - config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_LOCAL_ADDRESS, (const char **)&ipv4) - && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_REMOTE_ADDRESS, (const char **)&ipv4_remote) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_LOCAL_PORTC, &local_portc) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_REMOTE_PORTC, &remote_portc) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_LOCAL_PORTD, &local_portd) - && config_setting_lookup_int (setting_ru, CONFIG_STRING_RU_REMOTE_PORTD, &remote_portd) - && config_setting_lookup_string(setting_ru, CONFIG_STRING_RU_TRANSPORT_PREFERENCE, (const char **)&tr_preference) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, RU %d config !\n", - RC.config_file_name, j); - continue; - } - - } // fronthaul_flag == CONFIG_TRUE - - if (RC.nb_L1_inst>0) { - AssertFatal((setting_eNB_list = config_setting_get_member(setting_ru, CONFIG_STRING_RU_ENB_LIST))!=NULL,"No RU<->eNB mappings\n"); - - if (setting_eNB_list != NULL) num_eNB4RU = config_setting_length(setting_eNB_list); - else num_eNB4RU=0; - AssertFatal(num_eNB4RU>0,"Number of eNBs is zero\n"); - - for (i=0;i<num_eNB4RU;i++) { - setting_eNB_list_elem = config_setting_get_elem(setting_eNB_list,i); - eNB_list[i] = config_setting_get_int(setting_eNB_list_elem); - printf("RU %d: eNB %d\n",j,eNB_list[i]); - } - } - - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_TX, &att_tx); - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_ATT_RX, &att_rx); - - if ( !( - config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_TX, &nb_tx) - && config_setting_lookup_int(setting_ru, CONFIG_STRING_RU_NB_RX, &nb_rx) - )) { - AssertFatal (0, - "Failed to parse configuration file %s, RU %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - RC.ru[j] = (RU_t*)malloc(sizeof(RU_t)); - memset((void*)RC.ru[j],0,sizeof(RU_t)); - - RC.ru[j]->idx = j; - - RC.ru[j]->if_timing = synch_to_ext_device; - RC.ru[j]->num_eNB = num_eNB4RU; - - for (i=0;i<num_eNB4RU;i++) RC.ru[j]->eNB_list[i] = RC.eNB[eNB_list[i]][0]; - - if (strcmp(local_rf, "yes") == 0) { - if (fronthaul_flag == CONFIG_FALSE) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = eNodeB_3GPP; - printf("Setting function for RU %d to eNodeB_3GPP\n",j); - } - else { - RC.ru[j]->eth_params.local_if_name = strdup(if_name); - RC.ru[j]->eth_params.my_addr = strdup(ipv4); - RC.ru[j]->eth_params.remote_addr = strdup(ipv4_remote); - RC.ru[j]->eth_params.my_portc = local_portc; - RC.ru[j]->eth_params.remote_portc = remote_portc; - RC.ru[j]->eth_params.my_portd = local_portd; - RC.ru[j]->eth_params.remote_portd = remote_portd; - - if (strcmp(tr_preference, "udp") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j); - } else if (strcmp(tr_preference, "raw") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j); - } else if (strcmp(tr_preference, "udp_if4p5") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j); - } else if (strcmp(tr_preference, "raw_if4p5") == 0) { - RC.ru[j]->if_south = LOCAL_RF; - RC.ru[j]->function = NGFI_RRU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; - printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j); - } - } - - RC.ru[j]->max_pdschReferenceSignalPower = max_pdschReferenceSignalPower; - RC.ru[j]->max_rxgain = max_rxgain; - RC.ru[j]->num_bands = num_bands; - for (i=0;i<num_bands;i++) RC.ru[j]->band[i] = band[i]; - } //strcmp(local_rf, "yes") == 0 - else { - printf("RU %d: Transport %s\n",j,tr_preference); - - RC.ru[j]->eth_params.local_if_name = strdup(if_name); - RC.ru[j]->eth_params.my_addr = strdup(ipv4); - RC.ru[j]->eth_params.remote_addr = strdup(ipv4_remote); - RC.ru[j]->eth_params.my_portc = local_portc; - RC.ru[j]->eth_params.remote_portc = remote_portc; - RC.ru[j]->eth_params.my_portd = local_portd; - RC.ru[j]->eth_params.remote_portd = remote_portd; - - if (strcmp(tr_preference, "udp") == 0) { - RC.ru[j]->if_south = REMOTE_IF5; - RC.ru[j]->function = NGFI_RAU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; - } else if (strcmp(tr_preference, "raw") == 0) { - RC.ru[j]->if_south = REMOTE_IF5; - RC.ru[j]->function = NGFI_RAU_IF5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; - } else if (strcmp(tr_preference, "udp_if4p5") == 0) { - RC.ru[j]->if_south = REMOTE_IF4p5; - RC.ru[j]->function = NGFI_RAU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; - } else if (strcmp(tr_preference, "raw_if4p5") == 0) { - RC.ru[j]->if_south = REMOTE_IF4p5; - RC.ru[j]->function = NGFI_RAU_IF4p5; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; - } else if (strcmp(tr_preference, "raw_if5_mobipass") == 0) { - RC.ru[j]->if_south = REMOTE_IF5; - RC.ru[j]->function = NGFI_RAU_IF5; - RC.ru[j]->if_timing = synch_to_other; - RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF5_MOBIPASS; - } - RC.ru[j]->att_tx = att_tx; - RC.ru[j]->att_rx = att_rx; - }// strcmp(local_rf, "yes") != 0 - - RC.ru[j]->nb_tx = nb_tx; - RC.ru[j]->nb_rx = nb_rx; - - }// j=0..num_rus - } else { - RC.nb_RU = 0; - } // setting != NULL - - return; - -} - -void Eurecom_RCconfig_L1() { - - int i,j; - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_l1 = NULL; - - char* if_name_n = NULL; - char* ipv4_n = NULL; - char* ipv4_n_remote = NULL; - - char* tr_n_preference = NULL; - libconfig_int local_n_portc = 0; - libconfig_int remote_n_portc = 0; - libconfig_int local_n_portd = 0; - libconfig_int remote_n_portd = 0; - - load_config_file(&cfg); - - setting = config_lookup(&cfg, CONFIG_STRING_L1_LIST); - - if (setting != NULL) { - - if (RC.eNB == NULL) { - RC.eNB = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); - LOG_I(PHY,"RC.eNB = %p\n",RC.eNB); - memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***)); - RC.nb_L1_CC = malloc((1+RC.nb_L1_inst)*sizeof(int)); - } - - for (j = 0; j < RC.nb_L1_inst; j++) { - - setting_l1 = config_setting_get_elem(setting, j); - if (!config_setting_lookup_int (setting_l1,CONFIG_STRING_L1_CC,&RC.nb_L1_CC[j])) - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - - if (RC.eNB[j] == NULL) { - RC.eNB[j] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**)); - LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]); - memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***)); - } - - - for (i=0;i<RC.nb_L1_CC[j];i++) { - if (RC.eNB[j][i] == NULL) { - RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB)); - memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB)); - LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]); - RC.eNB[j][i]->Mod_id = j; - RC.eNB[j][i]->CC_id = i; - } - } - - - - printf("l1 %d/%d (nb CC %d)\n",j,RC.nb_inst,RC.nb_L1_CC[j]); - - - printf("RU %d: Transport %s\n",j,tr_n_preference); - if (!(config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_TRANSPORT_N_PREFERENCE, (const char **)&tr_n_preference))) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - } - - if (strcmp(tr_n_preference, "local_mac") == 0) { - - } - else if (strcmp(tr_n_preference, "nfapi") == 0) { - if ( !( - config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_LOCAL_N_IF_NAME, (const char **)&if_name_n) - && config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_LOCAL_N_ADDRESS, (const char **)&ipv4_n) - && config_setting_lookup_string(setting_l1, CONFIG_STRING_L1_REMOTE_N_ADDRESS, (const char **)&ipv4_n_remote) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_LOCAL_N_PORTC, &local_n_portc) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_REMOTE_N_PORTC, &remote_n_portc) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_LOCAL_N_PORTD, &local_n_portd) - && config_setting_lookup_int (setting_l1, CONFIG_STRING_L1_REMOTE_N_PORTD, &remote_n_portd) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - RC.eNB[j][0]->eth_params_n.local_if_name = strdup(if_name_n); - RC.eNB[j][0]->eth_params_n.my_addr = strdup(ipv4_n); - RC.eNB[j][0]->eth_params_n.remote_addr = strdup(ipv4_n_remote); - RC.eNB[j][0]->eth_params_n.my_portc = local_n_portc; - RC.eNB[j][0]->eth_params_n.remote_portc = remote_n_portc; - RC.eNB[j][0]->eth_params_n.my_portd = local_n_portd; - RC.eNB[j][0]->eth_params_n.remote_portd = remote_n_portd; - RC.eNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - } - }// j=0..num_inst - printf("Initializing northbound interface for L1\n"); - l1_north_init_eNB(); - } - return; -} - -void Eurecom_RCconfig_macrlc() { - - int j; - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_macrlc = NULL; - char* if_name_s = NULL; - char* ipv4_s = NULL; - char* ipv4_s_remote = NULL; - - char* tr_s_preference = NULL; - libconfig_int local_s_portc = 0; - libconfig_int remote_s_portc = 0; - libconfig_int local_s_portd = 0; - libconfig_int remote_s_portd = 0; - char* if_name_n = NULL; - char* ipv4_n = NULL; - char* ipv4_n_remote = NULL; - - char* tr_n_preference = NULL; - libconfig_int local_n_portc = 0; - libconfig_int remote_n_portc = 0; - libconfig_int local_n_portd = 0; - libconfig_int remote_n_portd = 0; - - load_config_file(&cfg); - - setting = config_lookup(&cfg, CONFIG_STRING_MACRLC_LIST); - - if (setting != NULL) { - - - - if ((RC.nb_macrlc_inst=config_setting_length(setting))>0) mac_top_init_eNB(); - else AssertFatal(1==0,"improper macrlc setting\n"); - - for (j=0;j<RC.nb_macrlc_inst;j++) { - setting_macrlc = config_setting_get_elem(setting, j); - - printf("macrlc %d/%d \n",j,RC.nb_macrlc_inst); - - if (!(config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_TRANSPORT_N_PREFERENCE, (const char **)&tr_n_preference))) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - } - - printf("MACRLC %d: Northbound Transport %s\n",j,tr_n_preference); - - if (strcmp(tr_n_preference, "local_RRC") == 0) { - // check number of instances is same as RRC/PDCP - - } - else if (strcmp(tr_n_preference, "cudu") == 0) { - if ( !( - config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_IF_NAME, (const char **)&if_name_n) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_ADDRESS, (const char **)&ipv4_n) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_N_ADDRESS, (const char **)&ipv4_n_remote) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_PORTC, &local_n_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_N_PORTC, &remote_n_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_N_PORTD, &local_n_portd) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_N_PORTD, &remote_n_portd) - ) - ) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - RC.mac[j]->eth_params_n.local_if_name = strdup(if_name_n); - RC.mac[j]->eth_params_n.my_addr = strdup(ipv4_n); - RC.mac[j]->eth_params_n.remote_addr = strdup(ipv4_n_remote); - RC.mac[j]->eth_params_n.my_portc = local_n_portc; - RC.mac[j]->eth_params_n.remote_portc = remote_n_portc; - RC.mac[j]->eth_params_n.my_portd = local_n_portd; - RC.mac[j]->eth_params_n.remote_portd = remote_n_portd; - RC.mac[j]->eth_params_n.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - AssertFatal(1==0,"MACRLC %d: unknown northbound midhaul\n",j); - } - - if (!(config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_TRANSPORT_S_PREFERENCE, (const char **)&tr_s_preference))) { - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - printf("MACRLC %d: Southbound Transport %s\n",j,tr_s_preference); - - if (strcmp(tr_s_preference, "local_L1") == 0) { - - - } - else if (strcmp(tr_s_preference, "nfapi") == 0) { - if ( !( - config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_IF_NAME, (const char **)&if_name_s) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_ADDRESS, (const char **)&ipv4_s) - && config_setting_lookup_string(setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_S_ADDRESS, (const char **)&ipv4_s_remote) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_PORTC, &local_s_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_S_PORTC, &remote_s_portc) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_LOCAL_S_PORTD, &local_s_portd) - && config_setting_lookup_int (setting_macrlc, CONFIG_STRING_MACRLC_REMOTE_S_PORTD, &remote_s_portd) - )){ - AssertFatal (0, - "Failed to parse configuration file %s, L1 %d config !\n", - RC.config_file_name, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - RC.mac[j]->eth_params_s.local_if_name = strdup(if_name_s); - RC.mac[j]->eth_params_s.my_addr = strdup(ipv4_s); - RC.mac[j]->eth_params_s.remote_addr = strdup(ipv4_s_remote); - RC.mac[j]->eth_params_s.my_portc = local_s_portc; - RC.mac[j]->eth_params_s.remote_portc = remote_s_portc; - RC.mac[j]->eth_params_s.my_portd = local_s_portd; - RC.mac[j]->eth_params_s.remote_portd = remote_s_portd; - RC.mac[j]->eth_params_s.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - AssertFatal(1==0,"MACRLC %d: unknown southbound midhaul\n",j); - } - }// j=0..num_inst - } - return; -} - -int Eurecom_RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_component_carriers = NULL; - config_setting_t *component_carrier = NULL; - config_setting_t *setting_srb1 = NULL; - config_setting_t *setting_enb = NULL; - int num_enbs = 0; - int num_component_carriers = 0; - int j = 0; - libconfig_int enb_id = 0; - int nb_cc = 0; - - char* if_name_s = NULL; - char* ipv4_s = NULL; - char* ipv4_s_remote = NULL; - - char* tr_s_preference = NULL; - libconfig_int local_s_portc = 0; - libconfig_int remote_s_portc = 0; - libconfig_int local_s_portd = 0; - libconfig_int remote_s_portd = 0; - - const char* cell_type = NULL; - const char* tac = 0; - const char* enb_name = NULL; - const char* mcc = 0; - const char* mnc = 0; - const char* frame_type = NULL; - libconfig_int tdd_config = 0; - libconfig_int tdd_config_s = 0; - const char* prefix_type = NULL; - const char* pbch_repetition = NULL; - libconfig_int eutra_band = 0; - long long int downlink_frequency = 0; - libconfig_int uplink_frequency_offset = 0; - libconfig_int Nid_cell = 0; - libconfig_int Nid_cell_mbsfn = 0; - libconfig_int N_RB_DL = 0; - libconfig_int nb_antenna_ports = 0; - libconfig_int prach_root = 0; - libconfig_int prach_config_index = 0; - const char* prach_high_speed = NULL; - libconfig_int prach_zero_correlation = 0; - libconfig_int prach_freq_offset = 0; - libconfig_int pucch_delta_shift = 0; - libconfig_int pucch_nRB_CQI = 0; - libconfig_int pucch_nCS_AN = 0; -#if !defined(Rel10) && !defined(Rel14) - libconfig_int pucch_n1_AN = 0; -#endif - libconfig_int pdsch_referenceSignalPower = 0; - libconfig_int pdsch_p_b = 0; - libconfig_int pusch_n_SB = 0; - const char * pusch_hoppingMode = NULL; - libconfig_int pusch_hoppingOffset = 0; - const char* pusch_enable64QAM = NULL; - const char* pusch_groupHoppingEnabled = NULL; - libconfig_int pusch_groupAssignment = 0; - const char* pusch_sequenceHoppingEnabled = NULL; - libconfig_int pusch_nDMRS1 = 0; - const char* phich_duration = NULL; - const char* phich_resource = NULL; - const char* srs_enable = NULL; - libconfig_int srs_BandwidthConfig = 0; - libconfig_int srs_SubframeConfig = 0; - const char* srs_ackNackST = NULL; - const char* srs_MaxUpPts = NULL; - libconfig_int pusch_p0_Nominal = 0; - const char* pusch_alpha = NULL; - libconfig_int pucch_p0_Nominal = 0; - libconfig_int msg3_delta_Preamble = 0; - //libconfig_int ul_CyclicPrefixLength = 0; - const char* pucch_deltaF_Format1 = NULL; - //const char* pucch_deltaF_Format1a = NULL; - const char* pucch_deltaF_Format1b = NULL; - const char* pucch_deltaF_Format2 = NULL; - const char* pucch_deltaF_Format2a = NULL; - const char* pucch_deltaF_Format2b = NULL; - libconfig_int rach_numberOfRA_Preambles = 0; - const char* rach_preamblesGroupAConfig = NULL; - libconfig_int rach_sizeOfRA_PreamblesGroupA = 0; - libconfig_int rach_messageSizeGroupA = 0; - const char* rach_messagePowerOffsetGroupB = NULL; - libconfig_int rach_powerRampingStep = 0; - libconfig_int rach_preambleInitialReceivedTargetPower = 0; - libconfig_int rach_preambleTransMax = 0; - libconfig_int rach_raResponseWindowSize = 0; - libconfig_int rach_macContentionResolutionTimer = 0; - libconfig_int rach_maxHARQ_Msg3Tx = 0; - libconfig_int pcch_defaultPagingCycle = 0; - const char* pcch_nB = NULL; - libconfig_int bcch_modificationPeriodCoeff = 0; - libconfig_int ue_TimersAndConstants_t300 = 0; - libconfig_int ue_TimersAndConstants_t301 = 0; - libconfig_int ue_TimersAndConstants_t310 = 0; - libconfig_int ue_TimersAndConstants_t311 = 0; - libconfig_int ue_TimersAndConstants_n310 = 0; - libconfig_int ue_TimersAndConstants_n311 = 0; - libconfig_int ue_TransmissionMode = 0; - - - libconfig_int srb1_timer_poll_retransmit = 0; - libconfig_int srb1_timer_reordering = 0; - libconfig_int srb1_timer_status_prohibit = 0; - libconfig_int srb1_poll_pdu = 0; - libconfig_int srb1_poll_byte = 0; - libconfig_int srb1_max_retx_threshold = 0; - - libconfig_int my_int; - - - const char* active_enb[MAX_ENB]; - char *astring = NULL; - - - // for no gcc warnings - (void)astring; - (void)my_int; - - memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); - - config_init(&cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(&cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - -#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) - - if ( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) { - if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { - asn_debug = 0; - asn1_xer_print = 0; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) { - asn_debug = 1; - asn1_xer_print = 1; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) { - asn_debug = 1; - asn1_xer_print = 2; - } else { - asn_debug = 0; - asn1_xer_print = 0; - } - } - -#endif - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - setting_enb = config_setting_get_elem(setting, i); - active_enb[i] = config_setting_get_string (setting_enb); - AssertFatal (active_enb[i] != NULL, - "Failed to parse config file %s, %uth attribute %s \n", - RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS); - active_enb[i] = strdup(active_enb[i]); - } - - - if (num_enbs>0) { - // Output a list of all eNBs. - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - - - setting_enb = config_setting_get_elem(setting, i); - - if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) { - // Calculate a default eNB ID -# if defined(ENABLE_USE_MME) - uint32_t hash; - - hash = s1ap_generate_eNB_id (); - enb_id = i + (hash & 0xFFFF8); -# else - enb_id = i; -# endif - } - - if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRANSPORT_S_PREFERENCE, (const char **)&tr_s_preference) - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb\n", - RC.config_file_name, i); - } - - printf("RRC %d: Southbound Transport %s\n",j,tr_s_preference); - - if (strcmp(tr_s_preference, "local_mac") == 0) { - - - - } - else if (strcmp(tr_s_preference, "cudu") == 0) { - if ( !(config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_LOCAL_S_IF_NAME, (const char **)&if_name_s) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_LOCAL_S_ADDRESS, (const char **)&ipv4_s) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_REMOTE_S_ADDRESS, (const char **)&ipv4_s_remote) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_LOCAL_S_PORTC, &local_s_portc) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_REMOTE_S_PORTC, &remote_s_portc) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_LOCAL_S_PORTD, &local_s_portd) - && config_setting_lookup_int (setting_enb, ENB_CONFIG_STRING_REMOTE_S_PORTD, &remote_s_portd) - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb\n", - RC.config_file_name, i); - } - rrc->eth_params_s.local_if_name = strdup(if_name_s); - rrc->eth_params_s.my_addr = strdup(ipv4_s); - rrc->eth_params_s.remote_addr = strdup(ipv4_s_remote); - rrc->eth_params_s.my_portc = local_s_portc; - rrc->eth_params_s.remote_portc = remote_s_portc; - rrc->eth_params_s.my_portd = local_s_portd; - rrc->eth_params_s.remote_portd = remote_s_portd; - rrc->eth_params_s.transp_preference = ETH_UDP_MODE; - } - - else { // other midhaul - } - - // search if in active list - - for (j=0; j < num_enbs; j++) { - if (strcmp(active_enb[j], enb_name) == 0) { - - RRC_CONFIGURATION_REQ (msg_p).cell_identity = enb_id; - - - RRC_CONFIGURATION_REQ (msg_p).tac = (uint16_t)atoi(tac); - RRC_CONFIGURATION_REQ (msg_p).mcc = (uint16_t)atoi(mcc); - RRC_CONFIGURATION_REQ (msg_p).mnc = (uint16_t)atoi(mnc); - RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length = strlen(mnc); - AssertFatal((RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length == 2) || - (RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length == 3), - "BAD MNC DIGIT LENGTH %d", - RRC_CONFIGURATION_REQ (msg_p).mnc_digit_length); - - LOG_I(RRC,"RRC config (%s,%s,%s)\n",mcc,mnc,tac); - // Parse optional physical parameters - - - setting_component_carriers = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_COMPONENT_CARRIERS); - nb_cc = 0; - - if (setting_component_carriers != NULL) { - - num_component_carriers = config_setting_length(setting_component_carriers); - LOG_I(RRC,"num component carriers %d \n", num_component_carriers); - - //enb_properties_loc.properties[enb_properties_loc_index]->nb_cc = num_component_carriers; - for (j = 0; j < num_component_carriers ;j++) { // && j < MAX_NUM_CCs; j++) { - component_carrier = config_setting_get_elem(setting_component_carriers, j); - - //printf("Component carrier %d\n",component_carrier); - if (!(config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_FRAME_TYPE, &frame_type) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG, &tdd_config) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_TDD_CONFIG_S, &tdd_config_s) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PREFIX_TYPE, &prefix_type) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PBCH_REPETITION, &pbch_repetition) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_EUTRA_BAND, &eutra_band) - && config_setting_lookup_int64(component_carrier, ENB_CONFIG_STRING_DOWNLINK_FREQUENCY, &downlink_frequency) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET, &uplink_frequency_offset) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NID_CELL, &Nid_cell) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_N_RB_DL, &N_RB_DL) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_CELL_MBSFN, &Nid_cell_mbsfn) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_NB_ANT_PORTS, &nb_antenna_ports) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_ROOT, &prach_root) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_CONFIG_INDEX, &prach_config_index) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PRACH_HIGH_SPEED, &prach_high_speed) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_ZERO_CORRELATION, &prach_zero_correlation) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PRACH_FREQ_OFFSET, &prach_freq_offset) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTA_SHIFT, &pucch_delta_shift) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_NRB_CQI, &pucch_nRB_CQI) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_NCS_AN, &pucch_nCS_AN) -#if !defined(Rel10) && !defined(Rel14) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_N1_AN, &pucch_n1_AN) -#endif - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PDSCH_RS_EPRE, &pdsch_referenceSignalPower) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PDSCH_PB, &pdsch_p_b) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_N_SB, &pusch_n_SB) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE, &pusch_hoppingMode) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_HOPPINGOFFSET, &pusch_hoppingOffset) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM, &pusch_enable64QAM) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN, &pusch_groupHoppingEnabled) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_GROUP_ASSIGNMENT, &pusch_groupAssignment) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN, &pusch_sequenceHoppingEnabled) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_NDMRS1, &pusch_nDMRS1) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PHICH_DURATION, &phich_duration) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PHICH_RESOURCE, &phich_resource) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_ENABLE, &srs_enable) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUSCH_PO_NOMINAL, &pusch_p0_Nominal) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUSCH_ALPHA, &pusch_alpha) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PUCCH_PO_NOMINAL, &pucch_p0_Nominal) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_MSG3_DELTA_PREAMBLE, &msg3_delta_Preamble) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1, &pucch_deltaF_Format1) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT1b, &pucch_deltaF_Format1b) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2, &pucch_deltaF_Format2) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2A, &pucch_deltaF_Format2a) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PUCCH_DELTAF_FORMAT2B, &pucch_deltaF_Format2b) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_NUM_RA_PREAMBLES, &rach_numberOfRA_Preambles) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLESGROUPACONFIG, &rach_preamblesGroupAConfig) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_POWERRAMPINGSTEP, &rach_powerRampingStep) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLEINITIALRECEIVEDTARGETPOWER, &rach_preambleInitialReceivedTargetPower) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_PREAMBLETRANSMAX, &rach_preambleTransMax) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_RARESPONSEWINDOWSIZE, &rach_raResponseWindowSize) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MACCONTENTIONRESOLUTIONTIMER, &rach_macContentionResolutionTimer) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, &rach_maxHARQ_Msg3Tx) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MAXHARQMSG3TX, &bcch_modificationPeriodCoeff) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_PCCH_DEFAULT_PAGING_CYCLE, &pcch_defaultPagingCycle) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_PCCH_NB, &pcch_nB) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_BCCH_MODIFICATIONPERIODCOEFF, &bcch_modificationPeriodCoeff) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T300, &ue_TimersAndConstants_t300) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T301, &ue_TimersAndConstants_t301) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T310, &ue_TimersAndConstants_t310) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_T311, &ue_TimersAndConstants_t311) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N310, &ue_TimersAndConstants_n310) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UETIMERS_N311, &ue_TimersAndConstants_n311) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, &ue_TransmissionMode) - -#if defined(Rel10) || defined(Rel14) - - -#endif - )) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, Component Carrier %d!\n", - RC.config_file_name, nb_cc++); - continue; // FIXME this prevents segfaults below, not sure what happens after function exit - } - - nb_cc++; - - - RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = tdd_config; - - AssertFatal (tdd_config <= TDD_Config__subframeAssignment_sa6, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config, TDD_Config__subframeAssignment_sa6); - - RRC_CONFIGURATION_REQ (msg_p).tdd_config_s[j] = tdd_config_s; - AssertFatal (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8); - - if (!prefix_type) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE); - else if (strcmp(prefix_type, "NORMAL") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL; - } else if (strcmp(prefix_type, "EXTENDED") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", - RC.config_file_name, i, prefix_type); - } -#ifdef Rel14 - if (!pbch_repetition) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: TRUE,FALSE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PBCH_REPETITION); - else if (strcmp(pbch_repetition, "TRUE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 1; - } else if (strcmp(pbch_repetition, "FALSE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pbch_repetition[j] = 0; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pbch_repetition choice: TRUE or FALSE !\n", - RC.config_file_name, i, pbch_repetition); - } -#endif - - RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = eutra_band; - RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) downlink_frequency; - RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset; - RRC_CONFIGURATION_REQ (msg_p).Nid_cell[j]= Nid_cell; - - if (Nid_cell>503) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for Nid_cell choice: 0...503 !\n", - RC.config_file_name, i, Nid_cell); - } - - RRC_CONFIGURATION_REQ (msg_p).N_RB_DL[j]= N_RB_DL; - - if ((N_RB_DL!=6) && (N_RB_DL!=15) && (N_RB_DL!=25) && (N_RB_DL!=50) && (N_RB_DL!=75) && (N_RB_DL!=100)) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for N_RB_DL choice: 6,15,25,50,75,100 !\n", - RC.config_file_name, i, N_RB_DL); - } - - if (strcmp(frame_type, "FDD") == 0) { - RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = FDD; - } else if (strcmp(frame_type, "TDD") == 0) { - RRC_CONFIGURATION_REQ (msg_p).frame_type[j] = TDD; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for frame_type choice: FDD or TDD !\n", - RC.config_file_name, i, frame_type); - } - - - RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = tdd_config; - AssertFatal (tdd_config <= TDD_Config__subframeAssignment_sa6, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config, TDD_Config__subframeAssignment_sa6); - - - RRC_CONFIGURATION_REQ (msg_p).tdd_config_s[j] = tdd_config_s; - AssertFatal (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, - "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!", - RC.config_file_name, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8); - - - - if (!prefix_type) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PREFIX_TYPE); - else if (strcmp(prefix_type, "NORMAL") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = NORMAL; - } else if (strcmp(prefix_type, "EXTENDED") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prefix_type[j] = EXTENDED; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", - RC.config_file_name, i, prefix_type); - } - - - - RRC_CONFIGURATION_REQ (msg_p).eutra_band[j] = eutra_band; - // printf( "\teutra band:\t%d\n",RRC_CONFIGURATION_REQ (msg_p).eutra_band); - - - - RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j] = (uint32_t) downlink_frequency; - //printf( "\tdownlink freq:\t%u\n",RRC_CONFIGURATION_REQ (msg_p).downlink_frequency); - - - RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j] = (unsigned int) uplink_frequency_offset; - - if (enb_check_band_frequencies(RC.config_file_name, - j, - RRC_CONFIGURATION_REQ (msg_p).eutra_band[j], - RRC_CONFIGURATION_REQ (msg_p).downlink_frequency[j], - RRC_CONFIGURATION_REQ (msg_p).uplink_frequency_offset[j], - RRC_CONFIGURATION_REQ (msg_p).frame_type[j])) { - AssertFatal(0, "error calling enb_check_band_frequencies\n"); - } - - if ((nb_antenna_ports <1) || (nb_antenna_ports > 2)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for nb_antenna_ports choice: 1..2 !\n", - RC.config_file_name, i, nb_antenna_ports); - - RRC_CONFIGURATION_REQ (msg_p).nb_antenna_ports[j] = nb_antenna_ports; - - - RRC_CONFIGURATION_REQ (msg_p).prach_root[j] = prach_root; - - if ((prach_root <0) || (prach_root > 1023)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_root choice: 0..1023 !\n", - RC.config_file_name, i, prach_root); - - RRC_CONFIGURATION_REQ (msg_p).prach_config_index[j] = prach_config_index; - - if ((prach_config_index <0) || (prach_config_index > 63)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_config_index choice: 0..1023 !\n", - RC.config_file_name, i, prach_config_index); - - if (!prach_high_speed) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PRACH_HIGH_SPEED); - else if (strcmp(prach_high_speed, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prach_high_speed[j] = TRUE; - } else if (strcmp(prach_high_speed, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).prach_high_speed[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prach_config choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, prach_high_speed); - - RRC_CONFIGURATION_REQ (msg_p).prach_zero_correlation[j] =prach_zero_correlation; - - if ((prach_zero_correlation <0) || (prach_zero_correlation > 15)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_zero_correlation choice: 0..15!\n", - RC.config_file_name, i, prach_zero_correlation); - - RRC_CONFIGURATION_REQ (msg_p).prach_freq_offset[j] = prach_freq_offset; - - if ((prach_freq_offset <0) || (prach_freq_offset > 94)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 0..94!\n", - RC.config_file_name, i, prach_freq_offset); - - - RRC_CONFIGURATION_REQ (msg_p).pucch_delta_shift[j] = pucch_delta_shift-1; - - if ((pucch_delta_shift <1) || (pucch_delta_shift > 3)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_delta_shift choice: 1..3!\n", - RC.config_file_name, i, pucch_delta_shift); - - RRC_CONFIGURATION_REQ (msg_p).pucch_nRB_CQI[j] = pucch_nRB_CQI; - - if ((pucch_nRB_CQI <0) || (pucch_nRB_CQI > 98)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nRB_CQI choice: 0..98!\n", - RC.config_file_name, i, pucch_nRB_CQI); - - RRC_CONFIGURATION_REQ (msg_p).pucch_nCS_AN[j] = pucch_nCS_AN; - - if ((pucch_nCS_AN <0) || (pucch_nCS_AN > 7)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n", - RC.config_file_name, i, pucch_nCS_AN); - -#if !defined(Rel10) && !defined(Rel14) - RRC_CONFIGURATION_REQ (msg_p).pucch_n1_AN[j] = pucch_n1_AN; - - if ((pucch_n1_AN <0) || (pucch_n1_AN > 2047)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_n1_AN choice: 0..2047!\n", - RC.config_file_name, i, pucch_n1_AN); - -#endif - RRC_CONFIGURATION_REQ (msg_p).pdsch_referenceSignalPower[j] = pdsch_referenceSignalPower; - - if ((pdsch_referenceSignalPower <-60) || (pdsch_referenceSignalPower > 50)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_referenceSignalPower choice:-60..50!\n", - RC.config_file_name, i, pdsch_referenceSignalPower); - - RRC_CONFIGURATION_REQ (msg_p).pdsch_p_b[j] = pdsch_p_b; - - if ((pdsch_p_b <0) || (pdsch_p_b > 3)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pdsch_p_b choice: 0..3!\n", - RC.config_file_name, i, pdsch_p_b); - - RRC_CONFIGURATION_REQ (msg_p).pusch_n_SB[j] = pusch_n_SB; - - if ((pusch_n_SB <1) || (pusch_n_SB > 4)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_n_SB choice: 1..4!\n", - RC.config_file_name, i, pusch_n_SB); - - if (!pusch_hoppingMode) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: interSubframe,intraAndInterSubframe!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_HOPPINGMODE); - else if (strcmp(pusch_hoppingMode,"interSubFrame")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_interSubFrame; - } else if (strcmp(pusch_hoppingMode,"intraAndInterSubFrame")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingMode[j] = PUSCH_ConfigCommon__pusch_ConfigBasic__hoppingMode_intraAndInterSubFrame; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingMode choice: interSubframe,intraAndInterSubframe!\n", - RC.config_file_name, i, pusch_hoppingMode); - - RRC_CONFIGURATION_REQ (msg_p).pusch_hoppingOffset[j] = pusch_hoppingOffset; - - if ((pusch_hoppingOffset<0) || (pusch_hoppingOffset>98)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_hoppingOffset choice: 0..98!\n", - RC.config_file_name, i, pusch_hoppingMode); - - if (!pusch_enable64QAM) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_ENABLE64QAM); - else if (strcmp(pusch_enable64QAM, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_enable64QAM[j] = TRUE; - } else if (strcmp(pusch_enable64QAM, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_enable64QAM[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_enable64QAM choice: ENABLE,DISABLE!\n", - RC.config_file_name, i, pusch_enable64QAM); - - if (!pusch_groupHoppingEnabled) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_GROUP_HOPPING_EN); - else if (strcmp(pusch_groupHoppingEnabled, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_groupHoppingEnabled[j] = TRUE; - } else if (strcmp(pusch_groupHoppingEnabled, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_groupHoppingEnabled[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_groupHoppingEnabled choice: ENABLE,DISABLE!\n", - RC.config_file_name, i, pusch_groupHoppingEnabled); - - - RRC_CONFIGURATION_REQ (msg_p).pusch_groupAssignment[j] = pusch_groupAssignment; - - if ((pusch_groupAssignment<0)||(pusch_groupAssignment>29)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_groupAssignment choice: 0..29!\n", - RC.config_file_name, i, pusch_groupAssignment); - - if (!pusch_sequenceHoppingEnabled) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d define %s: ENABLE,DISABLE!\n", - RC.config_file_name, i, ENB_CONFIG_STRING_PUSCH_SEQUENCE_HOPPING_EN); - else if (strcmp(pusch_sequenceHoppingEnabled, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_sequenceHoppingEnabled[j] = TRUE; - } else if (strcmp(pusch_sequenceHoppingEnabled, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_sequenceHoppingEnabled[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pusch_sequenceHoppingEnabled choice: ENABLE,DISABLE!\n", - RC.config_file_name, i, pusch_sequenceHoppingEnabled); - - RRC_CONFIGURATION_REQ (msg_p).pusch_nDMRS1[j] = pusch_nDMRS1; //cyclic_shift in RRC! - - if ((pusch_nDMRS1 <0) || (pusch_nDMRS1>7)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_nDMRS1 choice: 0..7!\n", - RC.config_file_name, i, pusch_nDMRS1); - - if (strcmp(phich_duration,"NORMAL")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_duration[j] = PHICH_Config__phich_Duration_normal; - } else if (strcmp(phich_duration,"EXTENDED")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_duration[j] = PHICH_Config__phich_Duration_extended; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_duration choice: NORMAL,EXTENDED!\n", - RC.config_file_name, i, phich_duration); - - if (strcmp(phich_resource,"ONESIXTH")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_oneSixth ; - } else if (strcmp(phich_resource,"HALF")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_half; - } else if (strcmp(phich_resource,"ONE")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_one; - } else if (strcmp(phich_resource,"TWO")==0) { - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j] = PHICH_Config__phich_Resource_two; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for phich_resource choice: ONESIXTH,HALF,ONE,TWO!\n", - RC.config_file_name, i, phich_resource); - - printf("phich.resource %ld (%s), phich.duration %ld (%s)\n", - RRC_CONFIGURATION_REQ (msg_p).phich_resource[j],phich_resource, - RRC_CONFIGURATION_REQ (msg_p).phich_duration[j],phich_duration); - - if (strcmp(srs_enable, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] = TRUE; - } else if (strcmp(srs_enable, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, srs_enable); - - if (RRC_CONFIGURATION_REQ (msg_p).srs_enable[j] == TRUE) { - if (!(config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_SRS_BANDWIDTH_CONFIG, &srs_BandwidthConfig) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_SRS_SUBFRAME_CONFIG, &srs_SubframeConfig) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_ACKNACKST_CONFIG, &srs_ackNackST) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_SRS_MAXUPPTS, &srs_MaxUpPts) - )) - AssertFatal(0, - "Failed to parse eNB configuration file %s, enb %d unknown values for srs_BandwidthConfig, srs_SubframeConfig, srs_ackNackST, srs_MaxUpPts\n", - RC.config_file_name, i); - - RRC_CONFIGURATION_REQ (msg_p).srs_BandwidthConfig[j] = srs_BandwidthConfig; - - if ((srs_BandwidthConfig < 0) || (srs_BandwidthConfig >7)) - AssertFatal (0, "Failed to parse eNB configuration file %s, enb %d unknown value %d for srs_BandwidthConfig choice: 0...7\n", - RC.config_file_name, i, srs_BandwidthConfig); - - RRC_CONFIGURATION_REQ (msg_p).srs_SubframeConfig[j] = srs_SubframeConfig; - - if ((srs_SubframeConfig<0) || (srs_SubframeConfig>15)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for srs_SubframeConfig choice: 0..15 !\n", - RC.config_file_name, i, srs_SubframeConfig); - - if (strcmp(srs_ackNackST, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_ackNackST[j] = TRUE; - } else if (strcmp(srs_ackNackST, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_ackNackST[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_BandwidthConfig choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, srs_ackNackST); - - if (strcmp(srs_MaxUpPts, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_MaxUpPts[j] = TRUE; - } else if (strcmp(srs_MaxUpPts, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).srs_MaxUpPts[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for srs_MaxUpPts choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, srs_MaxUpPts); - } - - RRC_CONFIGURATION_REQ (msg_p).pusch_p0_Nominal[j] = pusch_p0_Nominal; - - if ((pusch_p0_Nominal<-126) || (pusch_p0_Nominal>24)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pusch_p0_Nominal choice: -126..24 !\n", - RC.config_file_name, i, pusch_p0_Nominal); - -#ifndef Rel14 - if (strcmp(pusch_alpha,"AL0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al0; - } else if (strcmp(pusch_alpha,"AL04")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al04; - } else if (strcmp(pusch_alpha,"AL05")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al05; - } else if (strcmp(pusch_alpha,"AL06")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al06; - } else if (strcmp(pusch_alpha,"AL07")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al07; - } else if (strcmp(pusch_alpha,"AL08")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al08; - } else if (strcmp(pusch_alpha,"AL09")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al09; - } else if (strcmp(pusch_alpha,"AL1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = UplinkPowerControlCommon__alpha_al1; - } -#else - if (strcmp(pusch_alpha,"AL0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al0; - } else if (strcmp(pusch_alpha,"AL04")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al04; - } else if (strcmp(pusch_alpha,"AL05")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al05; - } else if (strcmp(pusch_alpha,"AL06")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al06; - } else if (strcmp(pusch_alpha,"AL07")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al07; - } else if (strcmp(pusch_alpha,"AL08")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al08; - } else if (strcmp(pusch_alpha,"AL09")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al09; - } else if (strcmp(pusch_alpha,"AL1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pusch_alpha[j] = Alpha_r12_al1; - } -#endif - else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_Alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n", - RC.config_file_name, i, pusch_alpha); - - RRC_CONFIGURATION_REQ (msg_p).pucch_p0_Nominal[j] = pucch_p0_Nominal; - - if ((pucch_p0_Nominal<-127) || (pucch_p0_Nominal>-96)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_p0_Nominal choice: -127..-96 !\n", - RC.config_file_name, i, pucch_p0_Nominal); - - RRC_CONFIGURATION_REQ (msg_p).msg3_delta_Preamble[j] = msg3_delta_Preamble; - - if ((msg3_delta_Preamble<-1) || (msg3_delta_Preamble>6)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for msg3_delta_Preamble choice: -1..6 !\n", - RC.config_file_name, i, msg3_delta_Preamble); - - - if (strcmp(pucch_deltaF_Format1,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF_2; - } else if (strcmp(pucch_deltaF_Format1,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF0; - } else if (strcmp(pucch_deltaF_Format1,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1 choice: deltaF_2,dltaF0,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format1); - - if (strcmp(pucch_deltaF_Format1b,"deltaF1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF1; - } else if (strcmp(pucch_deltaF_Format1b,"deltaF3")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF3; - } else if (strcmp(pucch_deltaF_Format1b,"deltaF5")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format1b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format1b_deltaF5; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format1b choice: deltaF1,dltaF3,deltaF5!\n", - RC.config_file_name, i, pucch_deltaF_Format1b); - - - if (strcmp(pucch_deltaF_Format2,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF_2; - } else if (strcmp(pucch_deltaF_Format2,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF0; - } else if (strcmp(pucch_deltaF_Format2,"deltaF1")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF1; - } else if (strcmp(pucch_deltaF_Format2,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2 choice: deltaF_2,dltaF0,deltaF1,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format2); - - if (strcmp(pucch_deltaF_Format2a,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF_2; - } else if (strcmp(pucch_deltaF_Format2a,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF0; - } else if (strcmp(pucch_deltaF_Format2a,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2a[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2a_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2a choice: deltaF_2,dltaF0,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format2a); - - if (strcmp(pucch_deltaF_Format2b,"deltaF_2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF_2; - } else if (strcmp(pucch_deltaF_Format2b,"deltaF0")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF0; - } else if (strcmp(pucch_deltaF_Format2b,"deltaF2")==0) { - RRC_CONFIGURATION_REQ (msg_p).pucch_deltaF_Format2b[j] = DeltaFList_PUCCH__deltaF_PUCCH_Format2b_deltaF2; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for pucch_deltaF_Format2b choice: deltaF_2,dltaF0,deltaF2!\n", - RC.config_file_name, i, pucch_deltaF_Format2b); - - - - - RRC_CONFIGURATION_REQ (msg_p).rach_numberOfRA_Preambles[j] = (rach_numberOfRA_Preambles/4)-1; - - if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>64) || ((rach_numberOfRA_Preambles&3)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_numberOfRA_Preambles choice: 4,8,12,...,64!\n", - RC.config_file_name, i, rach_numberOfRA_Preambles); - - if (strcmp(rach_preamblesGroupAConfig, "ENABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).rach_preamblesGroupAConfig[j] = TRUE; - - if (!(config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_SIZEOFRA_PREAMBLESGROUPA, &rach_sizeOfRA_PreamblesGroupA) - && config_setting_lookup_int(component_carrier, ENB_CONFIG_STRING_RACH_MESSAGESIZEGROUPA, &rach_messageSizeGroupA) - && config_setting_lookup_string(component_carrier, ENB_CONFIG_STRING_RACH_MESSAGEPOWEROFFSETGROUPB, &rach_messagePowerOffsetGroupB))) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d rach_sizeOfRA_PreamblesGroupA, messageSizeGroupA,messagePowerOffsetGroupB!\n", - RC.config_file_name, i); - - RRC_CONFIGURATION_REQ (msg_p).rach_sizeOfRA_PreamblesGroupA[j] = (rach_sizeOfRA_PreamblesGroupA/4)-1; - - if ((rach_numberOfRA_Preambles <4) || (rach_numberOfRA_Preambles>60) || ((rach_numberOfRA_Preambles&3)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_sizeOfRA_PreamblesGroupA choice: 4,8,12,...,60!\n", - RC.config_file_name, i, rach_sizeOfRA_PreamblesGroupA); - - - switch (rach_messageSizeGroupA) { - case 56: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b56; - break; - - case 144: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b144; - break; - - case 208: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b208; - break; - - case 256: - RRC_CONFIGURATION_REQ (msg_p).rach_messageSizeGroupA[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messageSizeGroupA_b256; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_messageSizeGroupA choice: 56,144,208,256!\n", - RC.config_file_name, i, rach_messageSizeGroupA); - break; - } - - if (strcmp(rach_messagePowerOffsetGroupB,"minusinfinity")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_minusinfinity; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB0")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB0; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB5")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB5; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB8")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB8; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB10")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB10; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB12")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB12; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB15")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB15; - } - - else if (strcmp(rach_messagePowerOffsetGroupB,"dB18")==0) { - RRC_CONFIGURATION_REQ (msg_p).rach_messagePowerOffsetGroupB[j] = RACH_ConfigCommon__preambleInfo__preamblesGroupAConfig__messagePowerOffsetGroupB_dB18; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_messagePowerOffsetGroupB choice: minusinfinity,dB0,dB5,dB8,dB10,dB12,dB15,dB18!\n", - RC.config_file_name, i, rach_messagePowerOffsetGroupB); - - } else if (strcmp(rach_preamblesGroupAConfig, "DISABLE") == 0) { - RRC_CONFIGURATION_REQ (msg_p).rach_preamblesGroupAConfig[j] = FALSE; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for rach_preamblesGroupAConfig choice: ENABLE,DISABLE !\n", - RC.config_file_name, i, rach_preamblesGroupAConfig); - - RRC_CONFIGURATION_REQ (msg_p).rach_preambleInitialReceivedTargetPower[j] = (rach_preambleInitialReceivedTargetPower+120)/2; - - if ((rach_preambleInitialReceivedTargetPower<-120) || (rach_preambleInitialReceivedTargetPower>-90) || ((rach_preambleInitialReceivedTargetPower&1)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleInitialReceivedTargetPower choice: -120,-118,...,-90 !\n", - RC.config_file_name, i, rach_preambleInitialReceivedTargetPower); - - - RRC_CONFIGURATION_REQ (msg_p).rach_powerRampingStep[j] = rach_powerRampingStep/2; - - if ((rach_powerRampingStep<0) || (rach_powerRampingStep>6) || ((rach_powerRampingStep&1)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_powerRampingStep choice: 0,2,4,6 !\n", - RC.config_file_name, i, rach_powerRampingStep); - - - - switch (rach_preambleTransMax) { -#ifndef Rel14 - case 3: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n4; - break; - - case 5: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n5; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n6; - break; - - case 7: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n7; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n10; - break; - - case 20: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n20; - break; - - case 50: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n50; - break; - - case 100: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = RACH_ConfigCommon__ra_SupervisionInfo__preambleTransMax_n200; - break; - -#else - - case 3: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n4; - break; - - case 5: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n5; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n6; - break; - - case 7: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n7; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n10; - break; - - case 20: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n20; - break; - - case 50: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n50; - break; - - case 100: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).rach_preambleTransMax[j] = PreambleTransMax_n200; - break; -#endif - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_preambleTransMax choice: 3,4,5,6,7,8,10,20,50,100,200!\n", - RC.config_file_name, i, rach_preambleTransMax); - break; - } - - RRC_CONFIGURATION_REQ (msg_p).rach_raResponseWindowSize[j] = (rach_raResponseWindowSize==10)?7:rach_raResponseWindowSize-2; - - if ((rach_raResponseWindowSize<0)||(rach_raResponseWindowSize==9)||(rach_raResponseWindowSize>10)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_raResponseWindowSize choice: 2,3,4,5,6,7,8,10!\n", - RC.config_file_name, i, rach_preambleTransMax); - - - RRC_CONFIGURATION_REQ (msg_p).rach_macContentionResolutionTimer[j] = (rach_macContentionResolutionTimer/8)-1; - - if ((rach_macContentionResolutionTimer<8) || (rach_macContentionResolutionTimer>64) || ((rach_macContentionResolutionTimer&7)!=0)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_macContentionResolutionTimer choice: 8,16,...,56,64!\n", - RC.config_file_name, i, rach_preambleTransMax); - - RRC_CONFIGURATION_REQ (msg_p).rach_maxHARQ_Msg3Tx[j] = rach_maxHARQ_Msg3Tx; - - if ((rach_maxHARQ_Msg3Tx<0) || (rach_maxHARQ_Msg3Tx>8)) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for rach_maxHARQ_Msg3Tx choice: 1..8!\n", - RC.config_file_name, i, rach_preambleTransMax); - - - switch (pcch_defaultPagingCycle) { - case 32: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf32; - break; - - case 64: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf64; - break; - - case 128: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf128; - break; - - case 256: - RRC_CONFIGURATION_REQ (msg_p).pcch_defaultPagingCycle[j] = PCCH_Config__defaultPagingCycle_rf256; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_defaultPagingCycle choice: 32,64,128,256!\n", - RC.config_file_name, i, pcch_defaultPagingCycle); - break; - } - - if (strcmp(pcch_nB, "fourT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_fourT; - } else if (strcmp(pcch_nB, "twoT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_twoT; - } else if (strcmp(pcch_nB, "oneT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneT; - } else if (strcmp(pcch_nB, "halfT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_halfT; - } else if (strcmp(pcch_nB, "quarterT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_quarterT; - } else if (strcmp(pcch_nB, "oneEighthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneEighthT; - } else if (strcmp(pcch_nB, "oneSixteenthT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneSixteenthT; - } else if (strcmp(pcch_nB, "oneThirtySecondT") == 0) { - RRC_CONFIGURATION_REQ (msg_p).pcch_nB[j] = PCCH_Config__nB_oneThirtySecondT; - } else - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pcch_nB choice: fourT,twoT,oneT,halfT,quarterT,oneighthT,oneSixteenthT,oneThirtySecondT !\n", - RC.config_file_name, i, pcch_defaultPagingCycle); - - - - switch (bcch_modificationPeriodCoeff) { - case 2: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n2; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n4; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n8; - break; - - case 16: - RRC_CONFIGURATION_REQ (msg_p).bcch_modificationPeriodCoeff[j] = BCCH_Config__modificationPeriodCoeff_n16; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for bcch_modificationPeriodCoeff choice: 2,4,8,16", - RC.config_file_name, i, bcch_modificationPeriodCoeff); - - break; - } - - - switch (ue_TimersAndConstants_t300) { - case 100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms200; - break; - - case 300: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms300; - break; - - case 400: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms400; - break; - - case 600: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms600; - break; - - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1000; - break; - - case 1500: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms1500; - break; - - case 2000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t300[j] = UE_TimersAndConstants__t300_ms2000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t300 choice: 100,200,300,400,600,1000,1500,2000 ", - RC.config_file_name, i, ue_TimersAndConstants_t300); - break; - - } - - switch (ue_TimersAndConstants_t301) { - case 100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms200; - break; - - case 300: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms300; - break; - - case 400: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms400; - break; - - case 600: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms600; - break; - - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1000; - break; - - case 1500: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms1500; - break; - - case 2000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t301[j] = UE_TimersAndConstants__t301_ms2000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t301 choice: 100,200,300,400,600,1000,1500,2000 ", - RC.config_file_name, i, ue_TimersAndConstants_t301); - break; - - } - - switch (ue_TimersAndConstants_t310) { - case 0: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms0; - break; - - case 50: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms50; - break; - - case 100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms100; - break; - - case 200: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms200; - break; - - case 500: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms500; - break; - - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms1000; - break; - - case 2000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t310[j] = UE_TimersAndConstants__t310_ms2000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t310 choice: 0,50,100,200,500,1000,1500,2000 ", - RC.config_file_name, i, ue_TimersAndConstants_t310); - break; - - } - - switch (ue_TimersAndConstants_t311) { - case 1000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms1000; - break; - - case 3110: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms3000; - break; - - case 5000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms5000; - break; - - case 10000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms10000; - break; - - case 15000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms15000; - break; - - case 20000: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms20000; - break; - - case 31100: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_t311[j] = UE_TimersAndConstants__t311_ms30000; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1000,3000,5000,10000,150000,20000,30000", - RC.config_file_name, i, ue_TimersAndConstants_t311); - break; - - } - - switch (ue_TimersAndConstants_n310) { - case 1: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n1; - break; - - case 2: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n2; - break; - - case 3: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n4; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n6; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n10; - break; - - case 20: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n310[j] = UE_TimersAndConstants__n310_n20; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_n310 choice: 1,2,3,4,6,6,8,10,20", - RC.config_file_name, i, ue_TimersAndConstants_n311); - break; - - } - - switch (ue_TimersAndConstants_n311) { - case 1: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n1; - break; - - case 2: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n2; - break; - - case 3: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n3; - break; - - case 4: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n4; - break; - - case 5: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n5; - break; - - case 6: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n6; - break; - - case 8: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n8; - break; - - case 10: - RRC_CONFIGURATION_REQ (msg_p).ue_TimersAndConstants_n311[j] = UE_TimersAndConstants__n311_n10; - break; - - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TimersAndConstants_t311 choice: 1,2,3,4,5,6,8,10", - RC.config_file_name, i, ue_TimersAndConstants_t311); - break; - - } - - switch (ue_TransmissionMode) { - case 1: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm1; - break; - case 2: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm2; - break; - case 3: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm3; - break; - case 4: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm4; - break; - case 5: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm5; - break; - case 6: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm6; - break; - case 7: - RRC_CONFIGURATION_REQ (msg_p).ue_TransmissionMode[j] = AntennaInfoDedicated__transmissionMode_tm7; - break; - default: - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for ue_TransmissionMode choice: 1,2,3,4,5,6,7", - RC.config_file_name, i, ue_TransmissionMode); - break; - } - } - } - - setting_srb1 = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SRB1); - - if (setting_srb1 != NULL) { - if (!(config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT, &srb1_timer_poll_retransmit) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_REORDERING, &srb1_timer_reordering) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_TIMER_STATUS_PROHIBIT, &srb1_timer_status_prohibit) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_MAX_RETX_THRESHOLD, &srb1_max_retx_threshold) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_POLL_PDU, &srb1_poll_pdu) - && config_setting_lookup_int(setting_srb1, ENB_CONFIG_STRING_SRB1_POLL_BYTE, &srb1_poll_byte))) - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d timer_poll_retransmit, timer_reordering, " - "timer_status_prohibit, poll_pdu, poll_byte, max_retx_threshold !\n", - RC.config_file_name, i); - - switch (srb1_max_retx_threshold) { - case 1: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t1; - break; - - case 2: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t2; - break; - - case 3: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t3; - break; - - case 4: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t4; - break; - - case 6: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t6; - break; - - case 8: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8; - break; - - case 16: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t16; - break; - - case 32: - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t32; - break; - - default: - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_max_retx_threshold %u!\n", - RC.config_file_name, i, srb1_max_retx_threshold); - } - - - switch (srb1_poll_pdu) { - case 4: - rrc->srb1_poll_pdu = PollPDU_p4; - break; - - case 8: - rrc->srb1_poll_pdu = PollPDU_p8; - break; - - case 16: - rrc->srb1_poll_pdu = PollPDU_p16; - break; - - case 32: - rrc->srb1_poll_pdu = PollPDU_p32; - break; - - case 64: - rrc->srb1_poll_pdu = PollPDU_p64; - break; - - case 128: - rrc->srb1_poll_pdu = PollPDU_p128; - break; - - case 256: - rrc->srb1_poll_pdu = PollPDU_p256; - break; - - default: - if (srb1_poll_pdu >= 10000) - rrc->srb1_poll_pdu = PollPDU_pInfinity; - else - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_poll_pdu %u!\n", - RC.config_file_name, i, srb1_poll_pdu); - } - - rrc->srb1_poll_byte = srb1_poll_byte; - - switch (srb1_poll_byte) { - case 25: - rrc->srb1_poll_byte = PollByte_kB25; - break; - - case 50: - rrc->srb1_poll_byte = PollByte_kB50; - break; - - case 75: - rrc->srb1_poll_byte = PollByte_kB75; - break; - - case 100: - rrc->srb1_poll_byte = PollByte_kB100; - break; - - case 125: - rrc->srb1_poll_byte = PollByte_kB125; - break; - - case 250: - rrc->srb1_poll_byte = PollByte_kB250; - break; - - case 375: - rrc->srb1_poll_byte = PollByte_kB375; - break; - - case 500: - rrc->srb1_poll_byte = PollByte_kB500; - break; - - case 750: - rrc->srb1_poll_byte = PollByte_kB750; - break; - - case 1000: - rrc->srb1_poll_byte = PollByte_kB1000; - break; - - case 1250: - rrc->srb1_poll_byte = PollByte_kB1250; - break; - - case 1500: - rrc->srb1_poll_byte = PollByte_kB1500; - break; - - case 2000: - rrc->srb1_poll_byte = PollByte_kB2000; - break; - - case 3000: - rrc->srb1_poll_byte = PollByte_kB3000; - break; - - default: - if (srb1_poll_byte >= 10000) - rrc->srb1_poll_byte = PollByte_kBinfinity; - else - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_poll_byte %u!\n", - RC.config_file_name, i, srb1_poll_byte); - } - - if (srb1_timer_poll_retransmit <= 250) { - rrc->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 5)/5; - } else if (srb1_timer_poll_retransmit <= 500) { - rrc->srb1_timer_poll_retransmit = (srb1_timer_poll_retransmit - 300)/50 + 50; - } else { - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_poll_retransmit %u!\n", - RC.config_file_name, i, srb1_timer_poll_retransmit); - } - - if (srb1_timer_status_prohibit <= 250) { - rrc->srb1_timer_status_prohibit = srb1_timer_status_prohibit/5; - } else if ((srb1_timer_poll_retransmit >= 300) && (srb1_timer_poll_retransmit <= 500)) { - rrc->srb1_timer_status_prohibit = (srb1_timer_status_prohibit - 300)/50 + 51; - } else { - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_status_prohibit %u!\n", - RC.config_file_name, i, srb1_timer_status_prohibit); - } - - switch (srb1_timer_reordering) { - case 0: - rrc->srb1_timer_reordering = T_Reordering_ms0; - break; - - case 5: - rrc->srb1_timer_reordering = T_Reordering_ms5; - break; - - case 10: - rrc->srb1_timer_reordering = T_Reordering_ms10; - break; - - case 15: - rrc->srb1_timer_reordering = T_Reordering_ms15; - break; - - case 20: - rrc->srb1_timer_reordering = T_Reordering_ms20; - break; - - case 25: - rrc->srb1_timer_reordering = T_Reordering_ms25; - break; - - case 30: - rrc->srb1_timer_reordering = T_Reordering_ms30; - break; - - case 35: - rrc->srb1_timer_reordering = T_Reordering_ms35; - break; - - case 40: - rrc->srb1_timer_reordering = T_Reordering_ms40; - break; - - case 45: - rrc->srb1_timer_reordering = T_Reordering_ms45; - break; - - case 50: - rrc->srb1_timer_reordering = T_Reordering_ms50; - break; - - case 55: - rrc->srb1_timer_reordering = T_Reordering_ms55; - break; - - case 60: - rrc->srb1_timer_reordering = T_Reordering_ms60; - break; - - case 65: - rrc->srb1_timer_reordering = T_Reordering_ms65; - break; - - case 70: - rrc->srb1_timer_reordering = T_Reordering_ms70; - break; - - case 75: - rrc->srb1_timer_reordering = T_Reordering_ms75; - break; - - case 80: - rrc->srb1_timer_reordering = T_Reordering_ms80; - break; - - case 85: - rrc->srb1_timer_reordering = T_Reordering_ms85; - break; - - case 90: - rrc->srb1_timer_reordering = T_Reordering_ms90; - break; - - case 95: - rrc->srb1_timer_reordering = T_Reordering_ms95; - break; - - case 100: - rrc->srb1_timer_reordering = T_Reordering_ms100; - break; - - case 110: - rrc->srb1_timer_reordering = T_Reordering_ms110; - break; - - case 120: - rrc->srb1_timer_reordering = T_Reordering_ms120; - break; - - case 130: - rrc->srb1_timer_reordering = T_Reordering_ms130; - break; - - case 140: - rrc->srb1_timer_reordering = T_Reordering_ms140; - break; - - case 150: - rrc->srb1_timer_reordering = T_Reordering_ms150; - break; - - case 160: - rrc->srb1_timer_reordering = T_Reordering_ms160; - break; - - case 170: - rrc->srb1_timer_reordering = T_Reordering_ms170; - break; - - case 180: - rrc->srb1_timer_reordering = T_Reordering_ms180; - break; - - case 190: - rrc->srb1_timer_reordering = T_Reordering_ms190; - break; - - case 200: - rrc->srb1_timer_reordering = T_Reordering_ms200; - break; - - default: - AssertFatal (0, - "Bad config value when parsing eNB configuration file %s, enb %d srb1_timer_reordering %u!\n", - RC.config_file_name, i, srb1_timer_reordering); - } - - } else { - rrc->srb1_timer_poll_retransmit = T_PollRetransmit_ms80; - rrc->srb1_timer_reordering = T_Reordering_ms35; - rrc->srb1_timer_status_prohibit = T_StatusProhibit_ms0; - rrc->srb1_poll_pdu = PollPDU_p4; - rrc->srb1_poll_byte = PollByte_kBinfinity; - rrc->srb1_max_retx_threshold = UL_AM_RLC__maxRetxThreshold_t8; - } - - break; - } - } - } - } -} - -int Eurecom_RCconfig_gtpu() { - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *subsetting = NULL; - config_setting_t *setting_enb = NULL; - int num_enbs = 0; - - - - char* enb_interface_name_for_S1U = NULL; - char* enb_ipv4_address_for_S1U = NULL; - libconfig_int enb_port_for_S1U = 0; - char *address = NULL; - char *cidr = NULL; - char *astring = NULL; - - // for no gcc warnings - (void)astring; - - - LOG_I(GTPU,"Configuring GTPu\n"); - - config_init(&cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(&cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - if (setting != NULL) { - num_enbs = config_setting_length(setting); - setting_enb = config_setting_get_elem(setting, 0); - } - - if (num_enbs>0) { - // Output a list of all eNBs. - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { +RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc); +RCconfig_S1(MessageDef *msg_p, uint32_t i); - setting_enb = config_setting_get_elem(setting, 0); - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); - if (subsetting != NULL) { - if ( (config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, - (const char **)&enb_interface_name_for_S1U) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, - (const char **)&enb_ipv4_address_for_S1U) - && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, - &enb_port_for_S1U) - ) - ) { +static int enb_check_band_frequencies(char* lib_config_file_name_pP, + int ind, + int16_t band, + uint32_t downlink_frequency, + int32_t uplink_frequency_offset, + lte_frame_type_t frame_type) +{ + int errors = 0; - cidr = enb_ipv4_address_for_S1U; - address = strtok(cidr, "/"); - - if (address) { - IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" ); + if (band > 0) { + int band_index; - LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up); + for (band_index = 0; band_index < sizeof (eutra_bands) / sizeof (eutra_bands[0]); band_index++) { + if (band == eutra_bands[band_index].band) { + uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset; - } + AssertError (eutra_bands[band_index].dl_min < downlink_frequency, errors ++, + "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too low (%u) for band %d!", + lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_min, band); + AssertError (downlink_frequency < eutra_bands[band_index].dl_max, errors ++, + "Failed to parse eNB configuration file %s, enb %d downlink frequency %u too high (%u) for band %d!", + lib_config_file_name_pP, ind, downlink_frequency, eutra_bands[band_index].dl_max, band); - RC.gtpv1u_data_g->enb_port_for_S1u_S12_S4_up = enb_port_for_S1U; + AssertError (eutra_bands[band_index].ul_min < uplink_frequency, errors ++, + "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too low (%u) for band %d!", + lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_min, band); + AssertError (uplink_frequency < eutra_bands[band_index].ul_max, errors ++, + "Failed to parse eNB configuration file %s, enb %d uplink frequency %u too high (%u) for band %d!", + lib_config_file_name_pP, ind, uplink_frequency, eutra_bands[band_index].ul_max, band); - } + AssertError (eutra_bands[band_index].frame_type == frame_type, errors ++, + "Failed to parse eNB configuration file %s, enb %d invalid frame type (%d/%d) for band %d!", + lib_config_file_name_pP, ind, eutra_bands[band_index].frame_type, frame_type, band); } } } -} - - -int Eurecom_RCconfig_S1(MessageDef *msg_p, uint32_t i) { - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *subsetting = NULL; - config_setting_t *setting_mme_addresses = NULL; - config_setting_t *setting_mme_address = NULL; - config_setting_t *setting_enb = NULL; - int num_mme_address = 0; - int j = 0; - libconfig_int enb_id = 0; - int num_enbs = 0; - - const char* cell_type = NULL; - const char* tac = 0; - const char* enb_name = NULL; - const char* mcc = 0; - const char* mnc = 0; - - libconfig_int my_int; - - - char* ipv4 = NULL; - char* ipv6 = NULL; - char* preference = NULL; - char* active = NULL; - const char* active_enb[MAX_ENB]; - char* enb_interface_name_for_S1U = NULL; - char* enb_ipv4_address_for_S1U = NULL; - libconfig_int enb_port_for_S1U = 0; - char* enb_interface_name_for_S1_MME = NULL; - char* enb_ipv4_address_for_S1_MME = NULL; - char *address = NULL; - char *cidr = NULL; - char *astring = NULL; - - // for no gcc warnings - (void)astring; - (void)my_int; - - memset((char*)active_enb, 0 , MAX_ENB * sizeof(char*)); - - config_init(&cfg); - - if (RC.config_file_name != NULL) { - // Read the file. If there is an error, report it and exit. - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - } else { - config_destroy(&cfg); - AssertFatal (0, "No eNB configuration file provided!\n"); - } - -#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) - - if ( (config_lookup_string( &cfg, ENB_CONFIG_STRING_ASN1_VERBOSITY, (const char **)&astring) )) { - if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_NONE) == 0) { - asn_debug = 0; - asn1_xer_print = 0; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_INFO) == 0) { - asn_debug = 1; - asn1_xer_print = 1; - } else if (strcasecmp(astring , ENB_CONFIG_STRING_ASN1_VERBOSITY_ANNOYING) == 0) { - asn_debug = 1; - asn1_xer_print = 2; - } else { - asn_debug = 0; - asn1_xer_print = 0; - } - } - -#endif - - // Get list of active eNBs, (only these will be configured) - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - setting_enb = config_setting_get_elem(setting, i); - active_enb[i] = config_setting_get_string (setting_enb); - AssertFatal (active_enb[i] != NULL, - "Failed to parse config file %s, %uth attribute %s \n", - RC.config_file_name, i, ENB_CONFIG_STRING_ACTIVE_ENBS); - active_enb[i] = strdup(active_enb[i]); - } - - - if (num_enbs>0) { - // Output a list of all eNBs. - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - - if (setting != NULL) { - num_enbs = config_setting_length(setting); - - for (i = 0; i < num_enbs; i++) { - setting_enb = config_setting_get_elem(setting, i); - - if (! config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_ENB_ID, &enb_id)) { - // Calculate a default eNB ID - -# if defined(ENABLE_USE_MME) - uint32_t hash; - - hash = s1ap_generate_eNB_id (); - enb_id = i + (hash & 0xFFFF8); -# else - enb_id = i; -# endif - } - - if ( !( config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_CELL_TYPE, &cell_type) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_ENB_NAME, &enb_name) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_TRACKING_AREA_CODE, &tac) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_COUNTRY_CODE, &mcc) - && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_MOBILE_NETWORK_CODE, &mnc) - - - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb\n", - RC.config_file_name, i); - continue; // FIXME this prevents segfaults below, not sure what happens after function exit - } - - // search if in active list - for (j=0; j < num_enbs; j++) { - if (strcmp(active_enb[j], enb_name) == 0) { - - S1AP_REGISTER_ENB_REQ (msg_p).eNB_id = enb_id; - - if (strcmp(cell_type, "CELL_MACRO_ENB") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_MACRO_ENB; - } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).cell_type = CELL_HOME_ENB; - } else { - AssertFatal (0, - "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", - RC.config_file_name, i, cell_type); - } - - S1AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(enb_name); - S1AP_REGISTER_ENB_REQ (msg_p).tac = (uint16_t)atoi(tac); - S1AP_REGISTER_ENB_REQ (msg_p).mcc = (uint16_t)atoi(mcc); - S1AP_REGISTER_ENB_REQ (msg_p).mnc = (uint16_t)atoi(mnc); - S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length = strlen(mnc); - S1AP_REGISTER_ENB_REQ (msg_p).default_drx = 0; - AssertFatal((S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 2) || - (S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length == 3), - "BAD MNC DIGIT LENGTH %d", - S1AP_REGISTER_ENB_REQ (msg_p).mnc_digit_length); - - - - setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); - num_mme_address = config_setting_length(setting_mme_addresses); - S1AP_REGISTER_ENB_REQ (msg_p).nb_mme = 0; - - for (j = 0; j < num_mme_address; j++) { - setting_mme_address = config_setting_get_elem(setting_mme_addresses, j); - - if ( !( - config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV4_ADDRESS, (const char **)&ipv4) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IPV6_ADDRESS, (const char **)&ipv6) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_ACTIVE, (const char **)&active) - && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference) - ) - ) { - AssertFatal (0, - "Failed to parse eNB configuration file %s, %u th enb %u th mme address !\n", - RC.config_file_name, i, j); - continue; // FIXME will prevent segfaults below, not sure what happens at function exit... - } - - S1AP_REGISTER_ENB_REQ (msg_p).nb_mme += 1; - - strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4_address,ipv4); - strcpy(S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6_address,ipv6); - - if (strcmp(active, "yes") == 0) { -#if defined(ENABLE_USE_MME) - EPC_MODE_ENABLED = 1; -#endif - } - if (strcmp(preference, "ipv4") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; - } else if (strcmp(preference, "ipv6") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; - } else if (strcmp(preference, "no") == 0) { - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv4 = 1; - S1AP_REGISTER_ENB_REQ (msg_p).mme_ip_address[j].ipv6 = 1; - } - } - - - // SCTP SETTING - S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS; - S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = SCTP_IN_STREAMS; -# if defined(ENABLE_USE_MME) - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SCTP_CONFIG); - - if (subsetting != NULL) { - if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_INSTREAMS, &my_int) )) { - S1AP_REGISTER_ENB_REQ (msg_p).sctp_in_streams = (uint16_t)my_int; - } - - if ( (config_setting_lookup_int( subsetting, ENB_CONFIG_STRING_SCTP_OUTSTREAMS, &my_int) )) { - S1AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = (uint16_t)my_int; - } - } -#endif - - // NETWORK_INTERFACES - subsetting = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_NETWORK_INTERFACES_CONFIG); - - if (subsetting != NULL) { - if ( ( - config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1_MME, - (const char **)&enb_interface_name_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDRESS_FOR_S1_MME, - (const char **)&enb_ipv4_address_for_S1_MME) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_INTERFACE_NAME_FOR_S1U, - (const char **)&enb_interface_name_for_S1U) - && config_setting_lookup_string( subsetting, ENB_CONFIG_STRING_ENB_IPV4_ADDR_FOR_S1U, - (const char **)&enb_ipv4_address_for_S1U) - && config_setting_lookup_int(subsetting, ENB_CONFIG_STRING_ENB_PORT_FOR_S1U, - &enb_port_for_S1U) - ) - ) { - // S1AP_REGISTER_ENB_REQ (msg_p).enb_interface_name_for_S1U = strdup(enb_interface_name_for_S1U); - cidr = enb_ipv4_address_for_S1U; - address = strtok(cidr, "/"); - - S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv6 = 0; - S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4 = 1; - - strcpy(S1AP_REGISTER_ENB_REQ (msg_p).enb_ip_address.ipv4_address, address); - - } - } - - - break; - } - } - } - } - } - return 0; + return errors; } -void Eurecom_RCConfig(const char *config_file_name) { - - config_t cfg; - config_setting_t *setting = NULL; - config_setting_t *setting_enb = NULL; - config_setting_t *setting_component_carriers = NULL; - - - config_init(&cfg); - if (config_file_name != NULL) { - RC.config_file_name = config_file_name; - if (! config_read_file(&cfg, RC.config_file_name)) { - config_destroy(&cfg); - AssertFatal (0, "Failed to parse eNB configuration file %s!\n", RC.config_file_name); - } - // Get num eNB instances - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ACTIVE_ENBS); - - if (setting != NULL) RC.nb_inst = config_setting_length(setting); - if (RC.nb_inst > 0) { - printf("Number of eNB RRC instances %d\n",RC.nb_inst); - setting = config_lookup(&cfg, ENB_CONFIG_STRING_ENB_LIST); - RC.nb_CC = (int *)malloc((1+RC.nb_inst)*sizeof(int)); - for (int i=0;i<RC.nb_inst;i++) { - setting_enb = config_setting_get_elem(setting, i); - setting_component_carriers = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_COMPONENT_CARRIERS); - AssertFatal(setting_component_carriers != NULL, "No component carrier definitions in %s\n",RC.config_file_name); - RC.nb_CC[i] = config_setting_length(setting_component_carriers); - printf("Setting nb_CC to %d for instance %d\n",RC.nb_CC[i],i); - - } - } - // Get num MACRLC instances - setting = config_lookup(&cfg, CONFIG_STRING_MACRLC_LIST); - if (setting != NULL) RC.nb_macrlc_inst = config_setting_length(setting); - // Get num L1 instances - setting = config_lookup(&cfg, CONFIG_STRING_L1_LIST); - if (setting != NULL) RC.nb_L1_inst = config_setting_length(setting); - // Get num RU instances - setting = config_lookup(&cfg, CONFIG_STRING_RU_LIST); - if (setting != NULL) RC.nb_RU = config_setting_length(setting); - } - else { - config_destroy(&cfg); - AssertFatal(0,"Configuration file is null\n"); - } - return; -} /* --------------------------------------------------------*/ /* from here function to use configuration module */ -void RCconfig_RU() { +void RCconfig_RU(void) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_RU(); - } -/*------------------------------------------*/ - int j = 0; int i = 0; int num_bands = 0; @@ -2816,7 +146,7 @@ void RCconfig_RU() { if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) { - if (RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr == NULL) { + if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) { RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->function = eNodeB_3GPP; printf("Setting function for RU %d to eNodeB_3GPP\n",j); @@ -2906,11 +236,6 @@ void RCconfig_RU() { } void RCconfig_L1() { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_L1(); - } -/*------------------------------------------*/ int i,j; paramdef_t L1_Params[] = L1PARAMS_DESC; paramlist_def_t L1_ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; @@ -2973,11 +298,6 @@ void RCconfig_L1() { } void RCconfig_macrlc() { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_macrlc(); - } -/*------------------------------------------*/ int j; @@ -3032,11 +352,7 @@ void RCconfig_macrlc() { } int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_RRC(msg_p, i, rrc); - } -/*------------------------------------------*/ + int num_enbs = 0; int num_component_carriers = 0; @@ -5022,11 +2338,7 @@ return 0; } int RCconfig_gtpu(void ) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_gtpu(); - } -/*------------------------------------------*/ + int num_enbs = 0; @@ -5073,12 +2385,6 @@ return 0; int RCconfig_S1(MessageDef *msg_p, uint32_t i) { -/* temporary code to use Eurecom configuration mechanism */ - if ( donotuse_configmodule== 1){ - return Eurecom_RCconfig_S1(msg_p, i); - } -/*------------------------------------------*/ - int j,k = 0; @@ -5272,16 +2578,8 @@ int RCconfig_S1(MessageDef *msg_p, uint32_t i) { return 0; } -void RCConfig(const char *config_file_name) { +void RCConfig(void) { -/* temporary code to use Eurecom configuration mechanism */ - if ( config_file_name != NULL ) { - Eurecom_RCConfig(config_file_name); - return; - } else { - donotuse_configmodule=0; - } -/*------------------------------------------*/ paramlist_def_t MACRLCParamList = {CONFIG_STRING_MACRLC_LIST,NULL,0}; paramlist_def_t L1ParamList = {CONFIG_STRING_L1_LIST,NULL,0}; paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index a3f0cc786b087995c5ed483c9a2207692bc0021b..b41545bcecea1036cb271d9ac27947e6af8de079 100644 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -91,7 +91,11 @@ typedef struct ru_config_s { uint8_t if_compress; } ru_config_t; - +extern void RCconfig_RU(void); +extern void RCconfig_L1(void); +extern void RCconfig_macrlc(void); +extern int RCconfig_gtpu(void ); +extern void RCConfig(void); void enb_config_display(void); void ru_config_display(void); diff --git a/openair2/ENB_APP/enb_paramdef.h b/openair2/ENB_APP/enb_paramdef.h index 8f4c06330f3c29cb23d2660c571563707c733b60..309f8f4f00a49f5ed3743abbc7f9d469001f5d70 100755 --- a/openair2/ENB_APP/enb_paramdef.h +++ b/openair2/ENB_APP/enb_paramdef.h @@ -212,7 +212,7 @@ static int DEFENBS[] = {0}; {CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \ -{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if4p5", TYPE_STRING, 0}, \ +{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \ {CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ {CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf index 11abf64431734d84b34b7a3752cfcdd086c88270..dfc836e6b239831e6fe673596143dc18efe28ebe 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -1,10 +1,9 @@ -Active_eNBs = ( "eNB_Eurecom_LTEBox"); -# Asn1_verbosity, choice in: none, info, annoying -Asn1_verbosity = "none"; - eNBs = ( { + # real_time choice in {hard, rt-preempt, no} + real_time = "no"; + ////////// Identification parameters: eNB_ID = 0xe00; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index b78e989b3af3f88c76be9d93731079d8b5cab8a4..3002370ad9d120d5f1ea2a2daccd4798001b9709 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -136,7 +136,7 @@ uint32_t downlink_frequency[MAX_NUM_CCs][4]; int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; -static char *conf_config_file_name = NULL; + #if defined(ENABLE_ITTI) static char *itti_dump_file = NULL; #endif @@ -402,7 +402,6 @@ static void *scope_thread(void *arg) { # ifdef ENABLE_XFORMS_WRITE_STATS FILE *UE_stats, *eNB_stats; # endif - int len = 0; struct sched_param sched_param; int UE_id, CC_id; int ue_cnt=0; @@ -423,7 +422,7 @@ static void *scope_thread(void *arg) { while (!oai_exit) { if (UE_flag==1) { - len = dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); + dump_ue_stats (PHY_vars_UE_g[0][0], &PHY_vars_UE_g[0][0]->proc.proc_rxtx[0],stats_buffer, 0, mode,rx_input_level_dBm); //fl_set_object_label(form_stats->stats_text, stats_buffer); fl_clear_browser(form_stats->stats_text); fl_add_browser_line(form_stats->stats_text, stats_buffer); @@ -578,17 +577,12 @@ void *l2l1_task(void *arg) { static void get_options(void) { int CC_id; - int clock_src; int tddflag; char *loopfile=NULL; int dumpframe; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); - if (tddflag > 0) { - for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) - frame_parms[CC_id]->frame_type = TDD; - } if (strlen(in_path) > 0) { opt_type = OPT_PCAP; @@ -603,6 +597,9 @@ static void get_options(void) { if (UE_flag > 0) { paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; + + + config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); if (loopfile != NULL) { @@ -629,6 +626,10 @@ static void get_options(void) { UE_scan=0; } + if (tddflag > 0) { + for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) + frame_parms[CC_id]->frame_type = TDD; + } if (frame_parms[0]->N_RB_DL !=0) { if ( frame_parms[0]->N_RB_DL < 6 ) { @@ -913,11 +914,14 @@ int main( int argc, char **argv ) logInit(); printf("Reading in command-line options\n"); - // get options and fill parameters from configuration file - // temporary test to allow legacy config or config module */ - + get_options (); - + if (CONFIG_ISFLAGSET(CONFIG_ABORT)) { + fprintf(stderr,"Getting configuration failed\n"); + exit(-1); + } + + #if T_TRACER T_init(T_port, T_wait, T_dont_fork); diff --git a/targets/RT/USER/lte-softmodem.h b/targets/RT/USER/lte-softmodem.h index 676908d423135294a0c5567f3af0c71c1497dd01..7a68d236549ded0b8b98964c3109d35f89ce0cc9 100644 --- a/targets/RT/USER/lte-softmodem.h +++ b/targets/RT/USER/lte-softmodem.h @@ -158,7 +158,7 @@ extern int16_t dlsch_demod_shift; {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"C" , CONFIG_HLP_DLF, 0, uptr:&(downlink_frequency[0][0]), defuintval:2680000000, TYPE_UINT, 0}, \ {"a" , CONFIG_HLP_CHOFF, 0, iptr:&chain_offset, defintval:0, TYPE_INT, 0}, \ -{"d" , CONFIG_HLP_SOFTS, 0, i8ptr:&do_forms, defintval:0, TYPE_INT8, 0}, \ +{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ {"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \ {"U" , CONFIG_HLP_UE, PARAMFLAG_BOOL, i8ptr:&UE_flag, defintval:0, TYPE_INT8, 0}, \