diff --git a/openair2/COMMON/rrc_messages_types.h b/openair2/COMMON/rrc_messages_types.h index f99a53060a93c644e29d6bc1ce3245e0dfddd91b..ebf2668b653d8215190806145c1095be41af1fd3 100644 --- a/openair2/COMMON/rrc_messages_types.h +++ b/openair2/COMMON/rrc_messages_types.h @@ -68,6 +68,7 @@ typedef struct RrcConfigurationReq_s { paging_drx_t default_drx; lte_frame_type_t frame_type; + int16_t eutra_band; } RrcConfigurationReq; // UE: NAS -> RRC messages diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c index 583e3e1c8ab450a70d55e2f6575901f41f81b835..20706f5b708a0df5477f22647dea6511418ea4e4 100644 --- a/openair2/ENB_APP/enb_app.c +++ b/openair2/ENB_APP/enb_app.c @@ -86,6 +86,7 @@ static void configure_rrc(uint32_t enb_id, const Enb_properties_array_t *enb_pro RRC_CONFIGURATION_REQ (msg_p).mnc = enb_properties->properties[enb_id]->mnc; RRC_CONFIGURATION_REQ (msg_p).default_drx = enb_properties->properties[enb_id]->default_drx; RRC_CONFIGURATION_REQ (msg_p).frame_type = enb_properties->properties[enb_id]->frame_type; + RRC_CONFIGURATION_REQ (msg_p).eutra_band = enb_properties->properties[enb_id]->eutra_band; itti_send_msg_to_task (TASK_RRC_ENB, enb_id, msg_p); } diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index bddab86d643932cca96d6ba9190c9370c2399ad9..9f8634ba2fbd779526b4f072426c2e58a3099f20 100755 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -61,6 +61,8 @@ #define ENB_CONFIG_STRING_DEFAULT_PAGING_DRX "default_paging_drx" #define ENB_CONFIG_STRING_FRAME_TYPE "frame_type" +#define ENB_CONFIG_STRING_TDD_CONFIG "tdd_config" +#define ENB_CONFIG_STRING_TDD_CONFIG_S "tdd_config_s" #define ENB_CONFIG_STRING_PREFIX_TYPE "prefix_type" #define ENB_CONFIG_STRING_EUTRA_BAND "eutra_band" #define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency" @@ -129,7 +131,7 @@ static int enb_check_band_frequencies(char* lib_config_file_name_pP, int32_t uplink_frequency_offset, lte_frame_type_t frame_type) { - int result = 0; + int errors = 0; if (band > 0) { @@ -140,26 +142,28 @@ static int enb_check_band_frequencies(char* lib_config_file_name_pP, if (band == eutra_bands[band_index].band) { uint32_t uplink_frequency = downlink_frequency + uplink_frequency_offset; - result = 1; - AssertError (eutra_bands[band_index].dl_min < downlink_frequency, result = 0, "Downlink frequency %u too low (%u) for band %d!", - downlink_frequency, eutra_bands[band_index].dl_min, band); - AssertError (downlink_frequency < eutra_bands[band_index].dl_max, result = 0, "Downlink frequency %u too high (%u) for band %d!", - downlink_frequency, eutra_bands[band_index].dl_max, band); - - AssertError (eutra_bands[band_index].ul_min < uplink_frequency, result = 0, "Uplink frequency %u too low (%u) for band %d!", - uplink_frequency, eutra_bands[band_index].ul_min, band); - AssertError (uplink_frequency < eutra_bands[band_index].ul_max, result = 0, "Uplink frequency %u too high (%u) for band %d!", - uplink_frequency, eutra_bands[band_index].ul_max, band); - - AssertError (eutra_bands[band_index].frame_type == frame_type, result = 0, "Invalid frame type (%d/%d) for band %d!", - eutra_bands[band_index].frame_type, frame_type, band); - - AssertFatal (result == 1, "Invalid settings for eNB %d in file %s!", enb_properties_index, lib_config_file_name_pP); + 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, enb_properties_index, 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, enb_properties_index, 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, enb_properties_index, 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, enb_properties_index, 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, enb_properties_index, eutra_bands[band_index].frame_type, frame_type, band); } } } - return result; + return errors; } const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { @@ -174,7 +178,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { int num_mme_address; int i; int j; - int parse_error = 0; + int parse_errors = 0; long int enb_id; const char* cell_type; long int tac; @@ -183,6 +187,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { long int mnc; const char* default_drx; const char* frame_type; + long int tdd_config; + long int tdd_config_s; const char* prefix_type; long int eutra_band; double downlink_frequency; @@ -234,7 +240,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { if(setting != NULL) { enb_properties_index = 0; - parse_error = 0; + parse_errors = 0; num_enbs = config_setting_length(setting); for (i = 0; i < num_enbs; i++) { setting_enb = config_setting_get_elem(setting, i); @@ -259,7 +265,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { && config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_DEFAULT_PAGING_DRX, &default_drx) ) ) { - AssertError (0, parse_error ++, + AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, %u th enb\n", lib_config_file_name_pP, i); } @@ -274,7 +280,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { } else if (strcmp(cell_type, "CELL_HOME_ENB") == 0) { enb_properties.properties[enb_properties_index]->cell_type = CELL_HOME_ENB; } else { - AssertError (0, parse_error ++, + AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for cell_type choice: CELL_MACRO_ENB or CELL_HOME_ENB !\n", lib_config_file_name_pP, i, cell_type); } @@ -292,7 +298,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { } else if (strcmp(default_drx, "PAGING_DRX_256") == 0) { enb_properties.properties[enb_properties_index]->default_drx = PAGING_DRX_256; } else { - AssertError (0, parse_error ++, + AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for default_drx choice: PAGING_DRX_32..PAGING_DRX_256 !\n", lib_config_file_name_pP, i, default_drx); } @@ -304,7 +310,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { } else if (strcmp(frame_type, "TDD") == 0) { enb_properties.properties[enb_properties_index]->frame_type = TDD; } else { - AssertError (0, parse_error ++, + AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for frame_type choice: FDD or TDD !\n", lib_config_file_name_pP, i, frame_type); } @@ -312,13 +318,31 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { enb_properties.properties[enb_properties_index]->frame_type = FDD; // Default frame type } + if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_TDD_CONFIG, &tdd_config)) { + enb_properties.properties[enb_properties_index]->tdd_config = tdd_config; + AssertError (tdd_config <= TDD_Config__subframeAssignment_sa6, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d illegal tdd_config %ld (should be 0-%d)!", + lib_config_file_name_pP, i, tdd_config, TDD_Config__subframeAssignment_sa6); + } else { + enb_properties.properties[enb_properties_index]->tdd_config = 3; // Default TDD sub-frame configuration + } + + if(config_setting_lookup_int(setting_enb, ENB_CONFIG_STRING_TDD_CONFIG_S, &tdd_config_s)) { + enb_properties.properties[enb_properties_index]->tdd_config_s = tdd_config_s; + AssertError (tdd_config_s <= TDD_Config__specialSubframePatterns_ssp8, parse_errors ++, + "Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %ld (should be 0-%d)!", + lib_config_file_name_pP, i, tdd_config_s, TDD_Config__specialSubframePatterns_ssp8); + } else { + enb_properties.properties[enb_properties_index]->tdd_config_s = 0; // Default TDD S-sub-frame configuration + } + if(config_setting_lookup_string(setting_enb, ENB_CONFIG_STRING_PREFIX_TYPE, &prefix_type)) { if (strcmp(prefix_type, "NORMAL") == 0) { enb_properties.properties[enb_properties_index]->prefix_type = NORMAL; } else if (strcmp(prefix_type, "EXTENDED") == 0) { enb_properties.properties[enb_properties_index]->prefix_type = EXTENDED; } else { - AssertError (0, parse_error ++, + AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for prefix_type choice: NORMAL or EXTENDED !\n", lib_config_file_name_pP, i, prefix_type); } @@ -349,12 +373,12 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { } } - enb_check_band_frequencies(lib_config_file_name_pP, - enb_properties_index, - enb_properties.properties[enb_properties_index]->eutra_band, - enb_properties.properties[enb_properties_index]->downlink_frequency, - enb_properties.properties[enb_properties_index]->uplink_frequency_offset, - enb_properties.properties[enb_properties_index]->frame_type); + parse_errors += enb_check_band_frequencies(lib_config_file_name_pP, + enb_properties_index, + enb_properties.properties[enb_properties_index]->eutra_band, + enb_properties.properties[enb_properties_index]->downlink_frequency, + enb_properties.properties[enb_properties_index]->uplink_frequency_offset, + enb_properties.properties[enb_properties_index]->frame_type); setting_mme_addresses = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_MME_IP_ADDRESS); num_mme_address = config_setting_length(setting_mme_addresses); @@ -368,7 +392,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { && config_setting_lookup_string(setting_mme_address, ENB_CONFIG_STRING_MME_IP_ADDRESS_PREFERENCE, (const char **)&preference) ) ) { - AssertError (0, parse_error ++, + AssertError (0, parse_errors ++, "Failed to parse eNB configuration file %s, %u th enb %u th mme address !\n", lib_config_file_name_pP, i, j); } @@ -400,13 +424,13 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) { } enb_properties.number = num_enb_properties; - AssertError (enb_properties_index == num_enb_properties, parse_error ++, + AssertError (enb_properties_index == num_enb_properties, parse_errors ++, "Failed to parse eNB configuration file %s, mismatch between %u active eNBs and %u corresponding defined eNBs !\n", lib_config_file_name_pP, num_enb_properties, enb_properties_index); - AssertFatal (parse_error == 0, + AssertFatal (parse_errors == 0, "Failed to parse eNB configuration file %s, found %d error%s !\n", - lib_config_file_name_pP, parse_error, parse_error > 1 ? "s" : ""); + lib_config_file_name_pP, parse_errors, parse_errors > 1 ? "s" : ""); return &enb_properties; } diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h index cecb1927bbbd46d4a0c1f2678e085094b35e5466..92b56bc8a7d2765e66f5613d7cc79293515acf73 100755 --- a/openair2/ENB_APP/enb_config.h +++ b/openair2/ENB_APP/enb_config.h @@ -85,6 +85,8 @@ typedef struct Enb_properties_s { /* Physical parameters */ lte_frame_type_t frame_type; + uint8_t tdd_config; + uint8_t tdd_config_s; lte_prefix_type_t prefix_type; int16_t eutra_band; uint32_t downlink_frequency; diff --git a/openair2/RRC/LITE/MESSAGES/asn1_msg.c b/openair2/RRC/LITE/MESSAGES/asn1_msg.c index 06549b55f0ad0664741a375bd57c16dadb208dd7..aa842400fbf35ac9ffc0153c88b3e09906873ba4 100644 --- a/openair2/RRC/LITE/MESSAGES/asn1_msg.c +++ b/openair2/RRC/LITE/MESSAGES/asn1_msg.c @@ -503,7 +503,12 @@ uint8_t do_SIB1(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer (*sib1)->cellSelectionInfo.q_RxLevMin=-65; (*sib1)->cellSelectionInfo.q_RxLevMinOffset=NULL; - (*sib1)->freqBandIndicator = 7; + (*sib1)->freqBandIndicator = +#if defined(ENABLE_ITTI) + configuration->eutra_band; +#else + 7; +#endif schedulingInfo.si_Periodicity=SchedulingInfo__si_Periodicity_rf8; @@ -518,11 +523,11 @@ uint8_t do_SIB1(uint8_t Mod_id, LTE_DL_FRAME_PARMS *frame_parms, uint8_t *buffer if (configuration->frame_type == TDD) #endif { - (*sib1)->tdd_Config = CALLOC(1,sizeof(struct TDD_Config)); + (*sib1)->tdd_Config = CALLOC(1,sizeof(struct TDD_Config)); - (*sib1)->tdd_Config->subframeAssignment=frame_parms->tdd_config; //TDD_Config__subframeAssignment_sa3; + (*sib1)->tdd_Config->subframeAssignment = frame_parms->tdd_config; - (*sib1)->tdd_Config->specialSubframePatterns=0;//frame_parms->tdd_config_S;//TDD_Config__specialSubframePatterns_ssp0; + (*sib1)->tdd_Config->specialSubframePatterns = frame_parms->tdd_config_S; } (*sib1)->si_WindowLength=SystemInformationBlockType1__si_WindowLength_ms20; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf index a69a4bc35a4051792b8cc6e5245278c09179df20..ced4b6899d590f2212e6b5a9f8dc08dda2fbb2eb 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf @@ -23,6 +23,8 @@ eNBs = ////////// Physical parameters: frame_type = "TDD"; + tdd_config = 3; + tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 33; downlink_frequency = 1907.6e6; diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index dd553f6358bafac902b08f1e505a4fc75ab348bb..11cf2a4ff0bc0ae43f8f975c81ebba2ae3486fc2 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -325,10 +325,8 @@ void get_simulation_options(int argc, char *argv[]) { case 'C': oai_emulation.info.tdd_config = atoi (optarg); - if (oai_emulation.info.tdd_config > 6) { - printf("Illegal tdd_config %d (should be 0-6)\n", oai_emulation.info.tdd_config); - exit (-1); - } + AssertFatal (oai_emulation.info.tdd_config <= TDD_Config__subframeAssignment_sa6, "Illegal tdd_config %d (should be 0-%d)!", + oai_emulation.info.tdd_config, TDD_Config__subframeAssignment_sa6); break; case 'D': @@ -601,8 +599,9 @@ void get_simulation_options(int argc, char *argv[]) { /* Update some simulation parameters */ oai_emulation.info.frame_type = enb_properties->properties[0]->frame_type; + oai_emulation.info.tdd_config = enb_properties->properties[0]->tdd_config; + oai_emulation.info.tdd_config_S = enb_properties->properties[0]->tdd_config_s; oai_emulation.info.extended_prefix_flag = enb_properties->properties[0]->prefix_type; - } }