Commit 18695eb2 authored by Eric's avatar Eric

fix enb_config.c enb_config_NB_IoT.c

parent 4be075b1
......@@ -40,7 +40,6 @@
#include "sctp_eNB_task.h"
#include "common/ran_context.h"
#include "sctp_default_values.h"
#include "LTE_SystemInformationBlockType2.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac_proto.h"
......@@ -83,7 +82,6 @@ void RCconfig_flexran() {
num_enbs, sizeof(flexran_agent_info_t *));
}
for (uint16_t i = 0; i < num_enbs; i++) {
RC.flexran[i] = calloc(1, sizeof(flexran_agent_info_t));
AssertFatal(RC.flexran[i],
......@@ -202,13 +200,11 @@ void RCconfig_L1(void) {
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;
}
}
}
}
void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
int j;
paramdef_t MacRLC_Params[] = MACRLCPARAMS_DESC;
......@@ -246,7 +242,6 @@ void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
AssertFatal(1==0,"MACRLC %d: %s unknown northbound midhaul\n",j, *(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr));
}
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_L1") == 0) {
} else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_S_PREFERENCE_IDX].strptr), "nfapi") == 0) {
RC.mac[j]->eth_params_s.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_S_IF_NAME_IDX].strptr));
......@@ -294,9 +289,14 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
ccparams_lte_t ccparams_lte;
ccparams_sidelink_t SLconfig;
ccparams_eMTC_t eMTCconfig;
// for NB-IoT
ccparams_NB_IoT_t NBconfig;
memset((void *)&NBconfig,0,sizeof(ccparams_NB_IoT_t));
memset((void *)&ccparams_lte,0,sizeof(ccparams_lte_t));
memset((void *)&SLconfig,0,sizeof(ccparams_sidelink_t));
memset((void *)&eMTCconfig,0,sizeof(ccparams_eMTC_t));
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
paramdef_t ENBParams[] = ENBPARAMS_DESC;
paramlist_def_t ENBParamList = {ENB_CONFIG_STRING_ENB_LIST,NULL,0};
......@@ -309,6 +309,8 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
memset((void *)&srb1_params,0,sizeof(srb1_params_t));
paramdef_t SRB1Params[] = SRB1PARAMS_DESC(srb1_params);
paramdef_t SLParams[] = CCPARAMS_SIDELINK_DESC(SLconfig);
// for NB-IoT
paramdef_t NBIOTParams[] = CCPARAMS_NB_IOT_DESC((&NBconfig));
/* map parameter checking array instances to parameter definition array instances */
for (int I=0; I< ( sizeof(CCsParams)/ sizeof(paramdef_t) ) ; I++) {
......@@ -329,11 +331,9 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
// Output a list of all eNBs.
config_getlist( &ENBParamList,ENBParams,sizeof(ENBParams)/sizeof(paramdef_t),NULL);
if (ENBParamList.paramarray[i][ENB_ENB_ID_IDX].uptr == NULL) {
// Calculate a default eNB ID
if (EPC_MODE_ENABLED) {
uint32_t hash;
hash = s1ap_generate_eNB_id ();
enb_id = i + (hash & 0xFFFF8);
......@@ -344,7 +344,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
enb_id = *(ENBParamList.paramarray[i][ENB_ENB_ID_IDX].uptr);
}
LOG_I(RRC,"Instance %d: Southbound Transport %s\n",i,*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr));
if (strcmp(*(ENBParamList.paramarray[i][ENB_TRANSPORT_S_PREFERENCE_IDX].strptr), "f1") == 0) {
......@@ -376,7 +375,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
} else {
rrc->node_type = ngran_eNB_DU;
LOG_I(RRC,"Setting node_type to ngran_eNB_DU\n");
}
}
......@@ -428,7 +426,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RRC_CONFIGURATION_REQ(msg_p).mnc[l]);
}
/* measurement reports enabled? */
if (ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr != NULL &&
*(ENBParamList.paramarray[i][ENB_ENABLE_MEASUREMENT_REPORTS].strptr) != NULL &&
......@@ -459,7 +456,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
//printf("Component carrier %d\n",component_carrier);
nb_cc++;
if (1 || !NODE_IS_CU(rrc->node_type)) {
// Cell params, MIB/SIB1 in DU
RRC_CONFIGURATION_REQ (msg_p).tdd_config[j] = ccparams_lte.tdd_config;
AssertFatal (ccparams_lte.tdd_config <= LTE_TDD_Config__subframeAssignment_sa6,
......@@ -470,7 +466,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
"Failed to parse eNB configuration file %s, enb %d illegal tdd_config_s %d (should be 0-%d)!",
RC.config_file_name, i, ccparams_lte.tdd_config_s, LTE_TDD_Config__specialSubframePatterns_ssp8);
if (!ccparams_lte.prefix_type)
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d define %s: NORMAL,EXTENDED!\n",
......@@ -550,7 +545,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
RC.config_file_name, i, ccparams_lte.nb_antenna_ports);
RRC_CONFIGURATION_REQ (msg_p).nb_antenna_ports[j] = ccparams_lte.nb_antenna_ports;
}
if (!NODE_IS_DU(rrc->node_type)) { //this is CU or eNB, SIB2-20 in CU
// Radio Resource Configuration (SIB2)
......@@ -1661,6 +1655,15 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
if (eMTCconfig.eMTC_configured > 0) fill_eMTC_configuration(msg_p,&eMTCconfig, i,j,RC.config_file_name,brparamspath);
else printf("No eMTC configuration, skipping it\n");
// NB-IoT configuration
char NBparamspath[MAX_OPTNAME_SIZE*2 + 16];
sprintf(NBparamspath,"%s.%s", ccspath, ENB_CONFIG_STRING_NB_IoT_PARAMETERS);
config_get(NBIOTParams, sizeof(NBIOTParams)/sizeof(paramdef_t), NBparamspath);
NBIOTRRC_CONFIGURATION_REQ(msg_p).NB_IoT_configured = NBconfig.NB_IoT_configured&1;
if (NBconfig.NB_IoT_configured > 0) fill_NB_IoT_configuration(msg_p,&NBconfig, i,j,RC.config_file_name,NBparamspath);
else printf("No NB-IoT configuration, skipping it\n");
// Sidelink configuration
char SLparamspath[MAX_OPTNAME_SIZE*2 + 16];
sprintf(SLparamspath,"%s.%s", ccspath, ENB_CONFIG_STRING_SL_PARAMETERS);
......@@ -1747,7 +1750,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
break;
default:
if (srb1_params.srb1_poll_pdu >= 10000)
rrc->srb1_poll_pdu = LTE_PollPDU_pInfinity;
else
......@@ -1881,7 +1883,6 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
rrc->srb1_timer_reordering = LTE_T_Reordering_ms40;
break;
case 45:
rrc->srb1_timer_reordering = LTE_T_Reordering_ms45;
break;
......@@ -2247,7 +2248,6 @@ int RCconfig_S1(
*(ENBParamList.paramarray[k][ENB_CELL_TYPE_IDX].strptr));
}
S1AP_REGISTER_ENB_REQ (msg_p).eNB_name = strdup(*(ENBParamList.paramarray[k][ENB_ENB_NAME_IDX].strptr));
S1AP_REGISTER_ENB_REQ(msg_p).tac = *ENBParamList.paramarray[k][ENB_TRACKING_AREA_CODE_IDX].uptr;
AssertFatal(!ENBParamList.paramarray[k][ENB_MOBILE_COUNTRY_CODE_IDX_OLD].strptr
......@@ -2276,7 +2276,6 @@ int RCconfig_S1(
|| S1AP_REGISTER_ENB_REQ(msg_p).mnc[l] < 100,
"MNC %d cannot be encoded in two digits as requested (change mnc_digit_length to 3)\n",
S1AP_REGISTER_ENB_REQ(msg_p).mnc[l]);
}
/* Default DRX param */
......@@ -2305,13 +2304,11 @@ int RCconfig_S1(
break;
}
case 256: {
S1AP_REGISTER_ENB_REQ(msg_p).default_drx = 3;
break;
}
default: {
LOG_E(S1AP, "Default I-DRX value in conf file is invalid (%i). Should be 32, 64, 128 or 256. \
Default DRX set to 32 in MME configuration\n",
......@@ -2956,13 +2953,11 @@ void read_config_and_init(void) {
"Number of MACRLC instances %d != number of RRC instances %d\n",
RC.nb_macrlc_inst, RC.nb_inst);
RCconfig_L1();
LOG_I(PHY, "%s() RC.nb_L1_inst: %d\n", __FUNCTION__, RC.nb_L1_inst);
RCconfig_macrlc(macrlc_has_f1);
LOG_I(MAC, "%s() RC.nb_macrlc_inst: %d\n", __FUNCTION__, RC.nb_macrlc_inst);
if (RC.nb_L1_inst > 0)
AssertFatal(l1_north_init_eNB() == 0, "could not initialize L1 north interface\n");
......
......@@ -44,12 +44,14 @@
#include "LTE_SystemInformationBlockType2-NB-r13.h"
void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int cell_idx, int cc_idx, char *config_fname)
void fill_NB_IoT_configuration(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int cell_idx, int cc_idx, char *config_fname, char *NBparamspath)
{
printf("Found parameters for NB-IoT from %s : %s\n",config_fname,NBparamspath);
//************************************ NB-IoT part ***************************************************************
switch (NBconfig.rach_raResponseWindowSize_NB) {
switch (NBconfig->rach_raResponseWindowSize_NB) {
case 2:
NBIOTRRC_CONFIGURATION_REQ(msg_p).rach_raResponseWindowSize_NB[cc_idx] = RACH_Info_NB_r13__ra_ResponseWindowSize_r13_pp2;
break;
......@@ -90,7 +92,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.rach_macContentionResolutionTimer_NB) {
switch (NBconfig->rach_macContentionResolutionTimer_NB) {
case 1:
NBIOTRRC_CONFIGURATION_REQ(msg_p).rach_macContentionResolutionTimer_NB[cc_idx] = RACH_Info_NB_r13__mac_ContentionResolutionTimer_r13_pp1;
break;
......@@ -131,7 +133,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.rach_powerRampingStep_NB) {
switch (NBconfig->rach_powerRampingStep_NB) {
case 0:
NBIOTRRC_CONFIGURATION_REQ(msg_p).rach_powerRampingStep_NB[cc_idx] = PowerRampingParameters__powerRampingStep_dB0;
break;
......@@ -156,7 +158,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.rach_preambleInitialReceivedTargetPower_NB) {
switch (NBconfig->rach_preambleInitialReceivedTargetPower_NB) {
case -120:
NBIOTRRC_CONFIGURATION_REQ(msg_p).rach_preambleInitialReceivedTargetPower_NB[cc_idx] = PowerRampingParameters__preambleInitialReceivedTargetPower_dBm_120;
break;
......@@ -229,7 +231,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.rach_preambleTransMax_CE_NB) {
switch (NBconfig->rach_preambleTransMax_CE_NB) {
case 3:
NBIOTRRC_CONFIGURATION_REQ(msg_p).rach_preambleTransMax_CE_NB[cc_idx] = PreambleTransMax_n3;
break;
......@@ -282,7 +284,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.bcch_modificationPeriodCoeff_NB) {
switch (NBconfig->bcch_modificationPeriodCoeff_NB) {
case 16:
NBIOTRRC_CONFIGURATION_REQ(msg_p).bcch_modificationPeriodCoeff_NB[cc_idx] = BCCH_Config_NB_r13__modificationPeriodCoeff_r13_n16;
break;
......@@ -307,7 +309,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.pcch_defaultPagingCycle_NB) {
switch (NBconfig->pcch_defaultPagingCycle_NB) {
case 128:
NBIOTRRC_CONFIGURATION_REQ(msg_p).pcch_defaultPagingCycle_NB[cc_idx] = PCCH_Config_NB_r13__defaultPagingCycle_r13_rf128;
break;
......@@ -332,7 +334,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.nprach_CP_Length) {
switch (NBconfig->nprach_CP_Length) {
case 0:
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_CP_Length[cc_idx] = NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7;
break;
......@@ -365,7 +367,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
config_fname, cell_idx, npdsch_nrs_Power);
switch (NBconfig.npusch_ack_nack_numRepetitions_NB) {
switch (NBconfig->npusch_ack_nack_numRepetitions_NB) {
case 1:
NBIOTRRC_CONFIGURATION_REQ(msg_p).npusch_ack_nack_numRepetitions_NB[cc_idx] = ACK_NACK_NumRepetitions_NB_r13_r1;
break;
......@@ -406,7 +408,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.npusch_srs_SubframeConfig_NB) {
switch (NBconfig->npusch_srs_SubframeConfig_NB) {
case 0:
NBIOTRRC_CONFIGURATION_REQ(msg_p).npusch_srs_SubframeConfig_NB[cc_idx] = NPUSCH_ConfigCommon_NB_r13__srs_SubframeConfig_r13_sc0;
break;
......@@ -514,7 +516,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for npusch_groupAssignmentNPUSCH_r13 choice: 0..29!\n",
config_fname, cell_idx, npusch_groupAssignmentNPUSCH_r13);
switch (NBconfig.dl_GapThreshold_NB) {
switch (NBconfig->dl_GapThreshold_NB) {
case 32:
NBIOTRRC_CONFIGURATION_REQ(msg_p).dl_GapThreshold_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapThreshold_r13_n32;
break;
......@@ -539,7 +541,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.dl_GapPeriodicity_NB) {
switch (NBconfig->dl_GapPeriodicity_NB) {
case 64:
NBIOTRRC_CONFIGURATION_REQ(msg_p).dl_GapPeriodicity_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapPeriodicity_r13_sf64;
break;
......@@ -564,18 +566,18 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
if (strcmp(NBconfig.dl_GapDurationCoeff_NB, "oneEighth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_oneEighth;
} else if (strcmp(NBconfig.dl_GapDurationCoeff_NB, "oneFourth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_oneFourth;
} else if (strcmp(NBconfig.dl_GapDurationCoeff_NB, "threeEighth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_threeEighth;
} else if (strcmp(NBconfig.dl_GapDurationCoeff_NB, "oneHalf") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_oneHalf;
if (strcmp(NBconfig->dl_GapDurationCoeff_NB, "oneEighth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_oneEighth;
} else if (strcmp(NBconfig->dl_GapDurationCoeff_NB, "oneFourth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_oneFourth;
} else if (strcmp(NBconfig->dl_GapDurationCoeff_NB, "threeEighth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_threeEighth;
} else if (strcmp(NBconfig->dl_GapDurationCoeff_NB, "oneHalf") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->dl_GapDurationCoeff_NB[cc_idx] = DL_GapConfig_NB_r13__dl_GapDurationCoeff_r13_oneHalf;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for NBconfig.dl_GapDurationCoeff_NB choice: oneEighth,oneFourth,threeEighth,oneHalf !\n",
config_fname, cell_idx, NBconfig.dl_GapDurationCoeff_NB);
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for NBconfig->dl_GapDurationCoeff_NB choice: oneEighth,oneFourth,threeEighth,oneHalf !\n",
config_fname, cell_idx, NBconfig->dl_GapDurationCoeff_NB);
NBIOTRRC_CONFIGURATION_REQ(msg_p).npusch_p0_NominalNPUSCH[cc_idx] = npusch_p0_NominalNPUSCH;
......@@ -584,26 +586,26 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for npusch_p0_NominalNPUSCH choice: -126..24 !\n",
config_fname, cell_idx, npusch_p0_NominalNPUSCH);
if (strcmp(NBconfig.npusch_alpha,"AL0")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al0;
} else if (strcmp(NBconfig.npusch_alpha,"AL04")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al04;
} else if (strcmp(NBconfig.npusch_alpha,"AL05")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al05;
} else if (strcmp(NBconfig.npusch_alpha,"AL06")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al06;
} else if (strcmp(NBconfig.npusch_alpha,"AL07")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al07;
} else if (strcmp(NBconfig.npusch_alpha,"AL08")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al08;
} else if (strcmp(NBconfig.npusch_alpha,"AL09")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al09;
} else if (strcmp(NBconfig.npusch_alpha,"AL1")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig.npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al1;
if (strcmp(NBconfig->npusch_alpha,"AL0")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al0;
} else if (strcmp(NBconfig->npusch_alpha,"AL04")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al04;
} else if (strcmp(NBconfig->npusch_alpha,"AL05")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al05;
} else if (strcmp(NBconfig->npusch_alpha,"AL06")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al06;
} else if (strcmp(NBconfig->npusch_alpha,"AL07")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al07;
} else if (strcmp(NBconfig->npusch_alpha,"AL08")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al08;
} else if (strcmp(NBconfig->npusch_alpha,"AL09")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al09;
} else if (strcmp(NBconfig->npusch_alpha,"AL1")==0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).NBconfig->npusch_alpha[cc_idx] = UplinkPowerControlCommon_NB_r13__alpha_r13_al1;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for NBconfig.npusch_alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n",
config_fname, cell_idx, NBconfig.npusch_alpha);
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for NBconfig->npusch_alpha choice: AL0,AL04,AL05,AL06,AL07,AL08,AL09,AL1!\n",
config_fname, cell_idx, NBconfig->npusch_alpha);
NBIOTRRC_CONFIGURATION_REQ(msg_p).deltaPreambleMsg3[cc_idx] = deltaPreambleMsg3;
......@@ -614,7 +616,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
//************************************************************************* NB-IoT Timer ************************************************************
switch (NBconfig.ue_TimersAndConstants_t300_NB) {
switch (NBconfig->ue_TimersAndConstants_t300_NB) {
case 2500:
NBIOTRRC_CONFIGURATION_REQ(msg_p).ue_TimersAndConstants_t300_NB[cc_idx] = UE_TimersAndConstants_NB_r13__t300_r13_ms2500;
break;
......@@ -654,7 +656,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
switch (NBconfig.ue_TimersAndConstants_t301_NB) {
switch (NBconfig->ue_TimersAndConstants_t301_NB) {
case 2500:
NBIOTRRC_CONFIGURATION_REQ(msg_p).ue_TimersAndConstants_t301_NB[cc_idx] = UE_TimersAndConstants_NB_r13__t301_r13_ms2500;
break;
......@@ -695,7 +697,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.ue_TimersAndConstants_t310_NB) {
switch (NBconfig->ue_TimersAndConstants_t310_NB) {
case 0:
NBIOTRRC_CONFIGURATION_REQ(msg_p).ue_TimersAndConstants_t310_NB[cc_idx] = UE_TimersAndConstants_NB_r13__t310_r13_ms0;
break;
......@@ -732,7 +734,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.ue_TimersAndConstants_t311_NB) {
switch (NBconfig->ue_TimersAndConstants_t311_NB) {
case 1000:
NBIOTRRC_CONFIGURATION_REQ(msg_p).ue_TimersAndConstants_t311_NB[cc_idx] = UE_TimersAndConstants_NB_r13__t311_r13_ms1000;
break;
......@@ -769,7 +771,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.ue_TimersAndConstants_n310_NB) {
switch (NBconfig->ue_TimersAndConstants_n310_NB) {
case 1:
NBIOTRRC_CONFIGURATION_REQ(msg_p).ue_TimersAndConstants_n310_NB[cc_idx] = UE_TimersAndConstants_NB_r13__n310_r13_n1;
break;
......@@ -810,7 +812,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
switch (NBconfig.ue_TimersAndConstants_n311_NB) {
switch (NBconfig->ue_TimersAndConstants_n311_NB) {
case 1:
NBIOTRRC_CONFIGURATION_REQ(msg_p).ue_TimersAndConstants_n311_NB[cc_idx] = UE_TimersAndConstants_NB_r13__n311_r13_n1;
break;
......@@ -852,7 +854,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
}
//************************************************************************** NBPRACH NB-IoT *****************************************************
switch (NBconfig.nprach_Periodicity) {
switch (NBconfig->nprach_Periodicity) {
case 40:
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_Periodicity[cc_idx] = NPRACH_Parameters_NB_r13__nprach_Periodicity_r13_ms40;
break;
......@@ -893,7 +895,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
switch (NBconfig.nprach_StartTime) {
switch (NBconfig->nprach_StartTime) {
case 8:
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_StartTime[cc_idx] = NPRACH_Parameters_NB_r13__nprach_StartTime_r13_ms8;
break;
......@@ -934,7 +936,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
switch (NBconfig.nprach_SubcarrierOffset) {
switch (NBconfig->nprach_SubcarrierOffset) {
case 40:
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_SubcarrierOffset[cc_idx] = NPRACH_Parameters_NB_r13__nprach_SubcarrierOffset_r13_n0;
break;
......@@ -975,7 +977,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
switch (NBconfig.nprach_NumSubcarriers) {
switch (NBconfig->nprach_NumSubcarriers) {
case 12:
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_NumSubcarriers[cc_idx] = NPRACH_Parameters_NB_r13__nprach_NumSubcarriers_r13_n12;
break;
......@@ -1000,20 +1002,20 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
if (strcmp(NBconfig.nprach_SubcarrierMSG3_RangeStart, "zero") == 0) {
if (strcmp(NBconfig->nprach_SubcarrierMSG3_RangeStart, "zero") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_SubcarrierMSG3_RangeStart[cc_idx] = NPRACH_Parameters_NB_r13__nprach_SubcarrierMSG3_RangeStart_r13_zero;
} else if (strcmp(NBconfig.nprach_SubcarrierMSG3_RangeStart, "oneThird") == 0) {
} else if (strcmp(NBconfig->nprach_SubcarrierMSG3_RangeStart, "oneThird") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_SubcarrierMSG3_RangeStart[cc_idx] = NPRACH_Parameters_NB_r13__nprach_SubcarrierMSG3_RangeStart_r13_oneThird;
} else if (strcmp(NBconfig.nprach_SubcarrierMSG3_RangeStart, "twoThird") == 0) {
} else if (strcmp(NBconfig->nprach_SubcarrierMSG3_RangeStart, "twoThird") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_SubcarrierMSG3_RangeStart[cc_idx] = NPRACH_Parameters_NB_r13__nprach_SubcarrierMSG3_RangeStart_r13_twoThird;
} else if (strcmp(NBconfig.nprach_SubcarrierMSG3_RangeStart, "one") == 0) {
} else if (strcmp(NBconfig->nprach_SubcarrierMSG3_RangeStart, "one") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).nprach_SubcarrierMSG3_RangeStart[cc_idx] = NPRACH_Parameters_NB_r13__nprach_SubcarrierMSG3_RangeStart_r13_one;
} else
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%s\" for nprach_SubcarrierMSG3_RangeStart choice: zero,oneThird,twoThird,one !\n",
config_fname, cell_idx, nprach_SubcarrierMSG3_RangeStart);
switch (NBconfig.maxNumPreambleAttemptCE_NB) {
switch (NBconfig->maxNumPreambleAttemptCE_NB) {
case 3:
NBIOTRRC_CONFIGURATION_REQ(msg_p).maxNumPreambleAttemptCE_NB[cc_idx] = NPRACH_Parameters_NB_r13__maxNumPreambleAttemptCE_r13_n3;
break;
......@@ -1050,7 +1052,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
switch (NBconfig.numRepetitionsPerPreambleAttempt) {
switch (NBconfig->numRepetitionsPerPreambleAttempt) {
case 1:
NBIOTRRC_CONFIGURATION_REQ(msg_p).numRepetitionsPerPreambleAttempt[cc_idx] = NPRACH_Parameters_NB_r13__numRepetitionsPerPreambleAttempt_r13_n1;
break;
......@@ -1091,7 +1093,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
switch (NBconfig.npdcch_NumRepetitions_RA) {
switch (NBconfig->npdcch_NumRepetitions_RA) {
case 1:
NBIOTRRC_CONFIGURATION_REQ(msg_p).npdcch_NumRepetitions_RA[cc_idx] = NPRACH_Parameters_NB_r13__npdcch_NumRepetitions_RA_r13_r1;
break;
......@@ -1148,7 +1150,7 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
switch (NBconfig.npdcch_StartSF_CSS_RA) {
switch (NBconfig->npdcch_StartSF_CSS_RA) {
case 1:
NBIOTRRC_CONFIGURATION_REQ(msg_p).npdcch_StartSF_CSS_RA[cc_idx] = NPRACH_Parameters_NB_r13__npdcch_StartSF_CSS_RA_r13_v1dot5;
break;
......@@ -1189,13 +1191,13 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
break;
}
if (strcmp(NBconfig.npdcch_Offset_RA, "zero") == 0) {
if (strcmp(NBconfig->npdcch_Offset_RA, "zero") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).npdcch_Offset_RA[cc_idx] = NPRACH_Parameters_NB_r13__npdcch_Offset_RA_r13_zero;
} else if (strcmp(NBconfig.npdcch_Offset_RA, "oneEighth") == 0) {
} else if (strcmp(NBconfig->npdcch_Offset_RA, "oneEighth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).npdcch_Offset_RA[cc_idx] = NPRACH_Parameters_NB_r13__npdcch_Offset_RA_r13_oneEighth;
} else if (strcmp(NBconfig.npdcch_Offset_RA, "oneFourth") == 0) {
} else if (strcmp(NBconfig->npdcch_Offset_RA, "oneFourth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).npdcch_Offset_RA[cc_idx] = NPRACH_Parameters_NB_r13__npdcch_Offset_RA_r13_oneFourth;
} else if (strcmp(NBconfig.npdcch_Offset_RA, "threeEighth") == 0) {
} else if (strcmp(NBconfig->npdcch_Offset_RA, "threeEighth") == 0) {
NBIOTRRC_CONFIGURATION_REQ(msg_p).npdcch_Offset_RA[cc_idx] = NPRACH_Parameters_NB_r13__npdcch_Offset_RA_r13_threeEighth;
} else
AssertFatal (0,
......@@ -1207,7 +1209,6 @@ void enb_config_init_NB_IoT(MessageDef *msg_p, ccparams_NB_IoT_t *NBconfig, int
//****************************************************************************************************************
//****************************************************************************************************************
}
}
......@@ -32,7 +32,7 @@
#include "common/config/config_paramdesc.h"
#include "RRC_paramsvalues.h"
#include <libconfig.h>
#define ENB_CONFIG_STRING_NB_IoT_PARAMETERS "NBparameters"
//RRC parameters in the config file of merge branch
......@@ -90,45 +90,45 @@
typedef struct ccparams_NB_IoT_s {
int32_t NB_IoT_configured;
//RRC parameters in the config file of merge branch
libconfig_int rach_raResponseWindowSize_NB;
libconfig_int rach_macContentionResolutionTimer_NB;
libconfig_int rach_powerRampingStep_NB;
libconfig_int rach_preambleInitialReceivedTargetPower_NB;
libconfig_int rach_preambleTransMax_CE_NB;
libconfig_int bcch_modificationPeriodCoeff_NB;
libconfig_int pcch_defaultPagingCycle_NB;
libconfig_int nprach_CP_Length;
libconfig_int nprach_rsrp_range;
libconfig_int npdsch_nrs_Power;
libconfig_int npusch_ack_nack_numRepetitions_NB;
libconfig_int npusch_srs_SubframeConfig_NB;
libconfig_int npusch_threeTone_CyclicShift_r13;
libconfig_int npusch_sixTone_CyclicShift_r13;
int rach_raResponseWindowSize_NB;
int rach_macContentionResolutionTimer_NB;
int rach_powerRampingStep_NB;
int rach_preambleInitialReceivedTargetPower_NB;
int rach_preambleTransMax_CE_NB;
int bcch_modificationPeriodCoeff_NB;
int pcch_defaultPagingCycle_NB;
int nprach_CP_Length;
int nprach_rsrp_range;
int npdsch_nrs_Power;
int npusch_ack_nack_numRepetitions_NB;
int npusch_srs_SubframeConfig_NB;
int npusch_threeTone_CyclicShift_r13;
int npusch_sixTone_CyclicShift_r13;
const char* npusch_groupHoppingEnabled;
libconfig_int npusch_groupAssignmentNPUSCH_r13;
libconfig_int dl_GapThreshold_NB;
libconfig_int dl_GapPeriodicity_NB;
int npusch_groupAssignmentNPUSCH_r13;
int dl_GapThreshold_NB;
int dl_GapPeriodicity_NB;
const char* dl_GapDurationCoeff_NB;
libconfig_int npusch_p0_NominalNPUSCH;
int npusch_p0_NominalNPUSCH;
const char* npusch_alpha;
libconfig_int deltaPreambleMsg3;
int deltaPreambleMsg3;
libconfig_int ue_TimersAndConstants_t300_NB;
libconfig_int ue_TimersAndConstants_t301_NB;
libconfig_int ue_TimersAndConstants_t310_NB;
libconfig_int ue_TimersAndConstants_t311_NB;
libconfig_int ue_TimersAndConstants_n310_NB;
libconfig_int ue_TimersAndConstants_n311_NB;
int ue_TimersAndConstants_t300_NB;
int ue_TimersAndConstants_t301_NB;
int ue_TimersAndConstants_t310_NB;
int ue_TimersAndConstants_t311_NB;
int ue_TimersAndConstants_n310_NB;
int ue_TimersAndConstants_n311_NB;
libconfig_int nprach_Periodicity;
libconfig_int nprach_StartTime;
libconfig_int nprach_SubcarrierOffset;
libconfig_int nprach_NumSubcarriers;
int nprach_Periodicity;
int nprach_StartTime;
int nprach_SubcarrierOffset;
int nprach_NumSubcarriers;
const char* nprach_SubcarrierMSG3_RangeStart;
libconfig_int maxNumPreambleAttemptCE_NB;
libconfig_int numRepetitionsPerPreambleAttempt;
libconfig_int npdcch_NumRepetitions_RA;
libconfig_int npdcch_StartSF_CSS_RA;
int maxNumPreambleAttemptCE_NB;
int numRepetitionsPerPreambleAttempt;
int npdcch_NumRepetitions_RA;
int npdcch_StartSF_CSS_RA;
const char* npdcch_Offset_RA;
} ccparams_NB_IoT_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment