Commit a2757c87 authored by Nick Ho's avatar Nick Ho

Debug on initialization procedure

parent 82fbfae5
...@@ -68,7 +68,10 @@ void phy_config_mib_eNB_NB_IoT(int Mod_id, ...@@ -68,7 +68,10 @@ void phy_config_mib_eNB_NB_IoT(int Mod_id,
NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms_NB_IoT; NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms_NB_IoT;
fp = (NB_IoT_DL_FRAME_PARMS*) malloc (sizeof(NB_IoT_DL_FRAME_PARMS));
LOG_I(PHY,"Configuring MIB-NB for instance %d, CCid %d : (band %d,Nid_cell %d,p %d,EARFCN %u)\n",Mod_id, CC_id, eutra_band, Nid_cell, p_eNB,EARFCN); LOG_I(PHY,"Configuring MIB-NB for instance %d, CCid %d : (band %d,Nid_cell %d,p %d,EARFCN %u)\n",Mod_id, CC_id, eutra_band, Nid_cell, p_eNB,EARFCN);
// fp->N_RB_DL // fp->N_RB_DL
// fp->N_RB_UL also this two values need to be known when we are dealing with in-band and guard-band operating mode // fp->N_RB_UL also this two values need to be known when we are dealing with in-band and guard-band operating mode
...@@ -80,13 +83,17 @@ void phy_config_mib_eNB_NB_IoT(int Mod_id, ...@@ -80,13 +83,17 @@ void phy_config_mib_eNB_NB_IoT(int Mod_id,
fp->nb_antenna_ports_eNB = p_eNB; //tx antenna port fp->nb_antenna_ports_eNB = p_eNB; //tx antenna port
fp->dl_CarrierFreq = from_earfcn_NB_IoT(eutra_band,EARFCN,0); fp->dl_CarrierFreq = from_earfcn_NB_IoT(eutra_band,EARFCN,0);
fp->ul_CarrierFreq = fp->dl_CarrierFreq - get_uldl_offset_NB_IoT(eutra_band); fp->ul_CarrierFreq = fp->dl_CarrierFreq - get_uldl_offset_NB_IoT(eutra_band);
fp->operating_mode = operating_mode; //see how are defined by FAPI structure fp->operating_mode = operating_mode; //see how are defined by FAPI structure
fp->NB_IoT_RB_ID = prb_index; //XXX to be better understand how should be managed fp->NB_IoT_RB_ID = prb_index; //XXX to be better understand how should be managed
//fp->nb_rx_antenna_ports_eNB //fp->nb_rx_antenna_ports_eNB
fp->control_region_size = control_region_size; //(assume that this value is negative if not used) fp->control_region_size = control_region_size; //(assume that this value is negative if not used)
fp->eutra_NumCRS_ports = eutra_NumCRS_ports; //(valid only for in-band operating mode with different PCI) fp->eutra_NumCRS_ports = eutra_NumCRS_ports; //(valid only for in-band operating mode with different PCI)
LOG_I(PHY,"Configure-MIB complete\n");
//TODO (new Raymond implementation) in the classic implementation seems to be used only by oaisim //TODO (new Raymond implementation) in the classic implementation seems to be used only by oaisim
//init_frame_parms(fp,1); //init_frame_parms(fp,1);
//init_lte_top(fp); //init_lte_top(fp);
...@@ -196,86 +203,94 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id, ...@@ -196,86 +203,94 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
nfapi_uplink_reference_signal_config_t *ul_nrs_config, nfapi_uplink_reference_signal_config_t *ul_nrs_config,
extra_phyConfig_t *extra_phy_parms) extra_phyConfig_t *extra_phy_parms)
{ {
NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms;
LOG_D(PHY,"[eNB%d] CCid %d: Applying config_NB_IoT from sib2_NB\n",Mod_id,CC_id); NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][CC_id]->frame_parms_NB_IoT;
LOG_I(PHY,"[eNB%d] CCid %d: Applying config_NB_IoT from sib2_NB\n",Mod_id,CC_id);
fp = (NB_IoT_DL_FRAME_PARMS*) malloc (sizeof(NB_IoT_DL_FRAME_PARMS));
/*NPRACH_ConfigSIB_NB_r13----------------------------------------------------------*/ /*NPRACH_ConfigSIB_NB_r13----------------------------------------------------------*/
//MP: FAPI style approach: instead of a list they consider the 3 possible configuration separately //MP: FAPI style approach: instead of a list they consider the 3 possible configuration separately
if(config->nprach_config_0_enabled.value == 1){ if(config->nprach_config_0_enabled.value == 1){
LOG_D(PHY, "NPRACH Config #0 enabled\n"); LOG_I(PHY, "NPRACH Config #0 enabled\n");
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7 fp->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
LOG_D(PHY," config#0: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length); LOG_D(PHY," config#0: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
//FIXME: MP: memory for the list should be allocated? initialization?? //FIXME: MP: memory for the list should be allocated? initialization??
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_Periodicity = config->nprach_config_0_sf_periodicity.value; fp->nprach_config_common.nprach_ParametersList.list[0].nprach_Periodicity = config->nprach_config_0_sf_periodicity.value;
LOG_D(PHY,"config#0: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_Periodicity); LOG_D(PHY,"config#0: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list[0].nprach_Periodicity);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_StartTime = config->nprach_config_0_start_time.value; fp->nprach_config_common.nprach_ParametersList.list[0].nprach_StartTime = config->nprach_config_0_start_time.value;
LOG_D(PHY,"config#0: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_StartTime); LOG_D(PHY,"config#0: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list[0].nprach_StartTime);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset.value; fp->nprach_config_common.nprach_ParametersList.list[0].nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset.value;
LOG_D(PHY,"config#0: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierOffset); LOG_D(PHY,"config#0: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list[0].nprach_SubcarrierOffset);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers.value; fp->nprach_config_common.nprach_ParametersList.list[0].nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers.value;
LOG_D(PHY,"config#0: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_NumSubcarriers); LOG_D(PHY,"config#0: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list[0].nprach_NumSubcarriers);
fp->nprach_config_common.nprach_ParametersList.list.array[0]->numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempt.value; fp->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempt.value;
LOG_D(PHY,"config#0: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[0]->numRepetitionsPerPreambleAttempt); LOG_D(PHY,"config#0: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt);
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed) //missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_0_subcarrier_MSG3_range_start; /*fp->nprach_config_common.nprach_ParametersList.list.array[0]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_0_subcarrier_MSG3_range_start;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_0_npdcch_startSF_CSS_RA; fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_0_npdcch_startSF_CSS_RA;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_0_npdcch_num_repetitions_RA; fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_0_npdcch_num_repetitions_RA;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_Offset_RA = extra_phy_parms->nprach_config_0_npdcch_offset_RA; fp->nprach_config_common.nprach_ParametersList.list.array[0]->npdcch_Offset_RA = extra_phy_parms->nprach_config_0_npdcch_offset_RA;
fp->nprach_config_common.nprach_ParametersList.list.array[0]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_0_max_num_preamble_attempt_CE; fp->nprach_config_common.nprach_ParametersList.list.array[0]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_0_max_num_preamble_attempt_CE;
*/
//fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/ //fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
} }
if(config->nprach_config_1_enabled.value == 1){ if(config->nprach_config_1_enabled.value == 1){
LOG_D(PHY, "NPRACH Config #1 enabled\n"); LOG_I(PHY, "NPRACH Config #1 enabled\n");
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7 fp->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
LOG_D(PHY," config#1: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length); LOG_D(PHY," config#1: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
//FIXME: MP: memory for the list should be allocated? initialization?? //FIXME: MP: memory for the list should be allocated? initialization??
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_Periodicity = config->nprach_config_1_sf_periodicity.value; fp->nprach_config_common.nprach_ParametersList.list[1].nprach_Periodicity = config->nprach_config_1_sf_periodicity.value;
LOG_D(PHY,"config#1: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_Periodicity); LOG_D(PHY,"config#1: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list[1].nprach_Periodicity);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_StartTime = config->nprach_config_1_start_time.value; fp->nprach_config_common.nprach_ParametersList.list[1].nprach_StartTime = config->nprach_config_1_start_time.value;
LOG_D(PHY,"config#1: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_StartTime); LOG_D(PHY,"config#1: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list[1].nprach_StartTime);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset.value; fp->nprach_config_common.nprach_ParametersList.list[1].nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset.value;
LOG_D(PHY,"config#1: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierOffset); LOG_D(PHY,"config#1: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list[1].nprach_SubcarrierOffset);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers.value; fp->nprach_config_common.nprach_ParametersList.list[1].nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers.value;
LOG_D(PHY,"config#1: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_NumSubcarriers); LOG_D(PHY,"config#1: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list[1].nprach_NumSubcarriers);
fp->nprach_config_common.nprach_ParametersList.list.array[1]->numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempt.value; fp->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempt.value;
LOG_D(PHY,"config#1: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[1]->numRepetitionsPerPreambleAttempt); LOG_D(PHY,"config#1: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt);
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed) //missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_1_subcarrier_MSG3_range_start; /*fp->nprach_config_common.nprach_ParametersList.list.array[1]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_1_subcarrier_MSG3_range_start;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_1_npdcch_startSF_CSS_RA; fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_1_npdcch_startSF_CSS_RA;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_1_npdcch_num_repetitions_RA; fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_1_npdcch_num_repetitions_RA;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_Offset_RA = extra_phy_parms->nprach_config_1_npdcch_offset_RA; fp->nprach_config_common.nprach_ParametersList.list.array[1]->npdcch_Offset_RA = extra_phy_parms->nprach_config_1_npdcch_offset_RA;
fp->nprach_config_common.nprach_ParametersList.list.array[1]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_1_max_num_preamble_attempt_CE; fp->nprach_config_common.nprach_ParametersList.list.array[1]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_1_max_num_preamble_attempt_CE;
*/
//fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/ //fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
} }
if(config->nprach_config_2_enabled.value == 1){ if(config->nprach_config_2_enabled.value == 1){
LOG_D(PHY, "NPRACH Config #2 enabled\n"); LOG_I(PHY, "NPRACH Config #2 enabled\n");
fp->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7 fp->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length.value; //NPRACH_ConfigSIB_NB_r13__nprach_CP_Length_r13_us66dot7
LOG_D(PHY," config#2: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length); LOG_D(PHY," config#2: nprach_CP_Length = %d\n",fp->nprach_config_common.nprach_CP_Length);
//FIXME: MP: memory for the list should be allocated? initialization?? where?? //FIXME: MP: memory for the list should be allocated? initialization?? where??
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_Periodicity = config->nprach_config_2_sf_periodicity.value; fp->nprach_config_common.nprach_ParametersList.list[2].nprach_Periodicity = config->nprach_config_2_sf_periodicity.value;
LOG_D(PHY,"config#2: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_Periodicity); LOG_D(PHY,"config#2: nprach_Periodicity = %d\n", fp->nprach_config_common.nprach_ParametersList.list[2].nprach_Periodicity);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_StartTime = config->nprach_config_2_start_time.value; fp->nprach_config_common.nprach_ParametersList.list[2].nprach_StartTime = config->nprach_config_2_start_time.value;
LOG_D(PHY,"config#2: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_StartTime); LOG_D(PHY,"config#2: nprach_StartTime = %d\n",fp->nprach_config_common.nprach_ParametersList.list[2].nprach_StartTime);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset.value; fp->nprach_config_common.nprach_ParametersList.list[2].nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset.value;
LOG_D(PHY,"config#2: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierOffset); LOG_D(PHY,"config#2: nprach_SubcarrierOffset= %d\n", fp->nprach_config_common.nprach_ParametersList.list[2].nprach_SubcarrierOffset);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers.value; fp->nprach_config_common.nprach_ParametersList.list[2].nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers.value;
LOG_D(PHY,"config#2: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_NumSubcarriers); LOG_D(PHY,"config#2: nprach_NumSubcarriers= %d\n",fp->nprach_config_common.nprach_ParametersList.list[2].nprach_NumSubcarriers);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempt.value; fp->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempt.value;
LOG_D(PHY,"config#2: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->numRepetitionsPerPreambleAttempt); LOG_D(PHY,"config#2: numRepetitionsPerPreambleAttempt= %d\n",fp->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt);
//missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed) //missed configuration in FAPI config_request (TS 36.331 pag 610) (may not needed)
fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_2_subcarrier_MSG3_range_start; /*fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierMSG3_RangeStart = extra_phy_parms->nprach_config_2_subcarrier_MSG3_range_start;
LOG_D(PHY,"config#2: nprach_SubcarrierMSG3_RangeStart= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierMSG3_RangeStart); LOG_D(PHY,"config#2: nprach_SubcarrierMSG3_RangeStart= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->nprach_SubcarrierMSG3_RangeStart);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_2_npdcch_startSF_CSS_RA; fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_StartSF_CSS_RA = extra_phy_parms->nprach_config_2_npdcch_startSF_CSS_RA;
LOG_D(PHY,"config#2: npdcch_StartSF_CSS_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_StartSF_CSS_RA); LOG_D(PHY,"config#2: npdcch_StartSF_CSS_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_StartSF_CSS_RA);
...@@ -285,6 +300,7 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id, ...@@ -285,6 +300,7 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
LOG_D(PHY,"config#2: npdcch_Offset_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_Offset_RA); LOG_D(PHY,"config#2: npdcch_Offset_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_Offset_RA);
fp->nprach_config_common.nprach_ParametersList.list.array[2]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_2_max_num_preamble_attempt_CE; fp->nprach_config_common.nprach_ParametersList.list.array[2]->maxNumPreambleAttemptCE = extra_phy_parms->nprach_config_2_max_num_preamble_attempt_CE;
LOG_D(PHY,"config#2: maxNumPreambleAttemptCE= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->maxNumPreambleAttemptCE); LOG_D(PHY,"config#2: maxNumPreambleAttemptCE= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->maxNumPreambleAttemptCE);
*/
//fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/ //fp->nprach_config_common.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
} }
...@@ -332,9 +348,9 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id, ...@@ -332,9 +348,9 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
/*UL Power Control Config Common---------------------------------------------------------*/ /*UL Power Control Config Common---------------------------------------------------------*/
//F nothing has been defined in FAPI specs for this (may because are only UE stuffs) //F nothing has been defined in FAPI specs for this (may because are only UE stuffs)
fp->ul_power_control_config_common.p0_NominalNPUSCH = extra_phy_parms->p0_nominal_npusch; /*fp->ul_power_control_config_common.p0_NominalNPUSCH = extra_phy_parms->p0_nominal_npusch;
fp->ul_power_control_config_common.alpha = extra_phy_parms->alpha; fp->ul_power_control_config_common.alpha = extra_phy_parms->alpha;
fp->ul_power_control_config_common.deltaPreambleMsg3 = extra_phy_parms->delta_preamle_MSG3; fp->ul_power_control_config_common.deltaPreambleMsg3 = extra_phy_parms->delta_preamle_MSG*/
/*DL gap Config - OPTIONAL----------------------------------------------------------------*/ /*DL gap Config - OPTIONAL----------------------------------------------------------------*/
//DL_GapConfig_NB_r13_t a; //DL_GapConfig_NB_r13_t a;
...@@ -344,7 +360,7 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id, ...@@ -344,7 +360,7 @@ void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
fp->DL_gap_config.dl_GapThreshold = config->dl_gap_threshold.value; fp->DL_gap_config.dl_GapThreshold = config->dl_gap_threshold.value;
} }
LOG_I(PHY,"SIB-2 configure complete\n");
} }
......
...@@ -400,7 +400,7 @@ typedef struct NPRACH_Parameters_NB_IoT{ ...@@ -400,7 +400,7 @@ typedef struct NPRACH_Parameters_NB_IoT{
} nprach_parameters_NB_IoT_t; } nprach_parameters_NB_IoT_t;
typedef struct{ typedef struct{
A_SEQUENCE_OF(nprach_parameters_NB_IoT_t) list; nprach_parameters_NB_IoT_t list[3];
}NPRACH_List_NB_IoT_t; }NPRACH_List_NB_IoT_t;
typedef long RSRP_Range_t; typedef long RSRP_Range_t;
......
...@@ -354,10 +354,10 @@ void PHY_config_req_NB_IoT(PHY_Config_NB_IoT_t* config_INFO){ ...@@ -354,10 +354,10 @@ void PHY_config_req_NB_IoT(PHY_Config_NB_IoT_t* config_INFO){
{ {
//Dedicated Configuration //Dedicated Configuration
phy_config_dedicated_eNB_NB_IoT(config_INFO->mod_id, /*phy_config_dedicated_eNB_NB_IoT(config_INFO->mod_id,
config_INFO->CC_id, config_INFO->CC_id,
config_INFO->rnti, config_INFO->rnti,
&config_INFO->extra_phy_parms); &config_INFO->extra_phy_parms);*/
} }
......
...@@ -35,10 +35,10 @@ typedef enum si_Periodicity{ ...@@ -35,10 +35,10 @@ typedef enum si_Periodicity{
}si_Periodicity_NB_IoT; }si_Periodicity_NB_IoT;
typedef enum si_RepetitionPattern{ typedef enum si_RepetitionPattern{
si_RepetitionPattern_every2ndRF=20, si_RepetitionPattern_every2ndRF=0,
si_RepetitionPattern_every4thRF=40, si_RepetitionPattern_every4thRF,
si_RepetitionPattern_every8thRF=80, si_RepetitionPattern_every8thRF,
si_RepetitionPattern_every16thRF=160 si_RepetitionPattern_every16thRF
}si_RepetitionPattern_NB_IoT; }si_RepetitionPattern_NB_IoT;
typedef enum sib_MappingInfo{ typedef enum sib_MappingInfo{
...@@ -51,14 +51,14 @@ typedef enum sib_MappingInfo{ ...@@ -51,14 +51,14 @@ typedef enum sib_MappingInfo{
}sib_MappingInfo_NB_IoT; }sib_MappingInfo_NB_IoT;
typedef enum si_TB{ typedef enum si_TB{
si_TB_56=56, si_TB_56=2,
si_TB_120=120, si_TB_120=2,
si_TB_208=208, si_TB_208=8,
si_TB_256=256, si_TB_256=8,
si_TB_328=328, si_TB_328=8,
si_TB_440=440, si_TB_440=8,
si_TB_552=552, si_TB_552=8,
si_TB_680=680 si_TB_680=8
}si_TB_NB_IoT; }si_TB_NB_IoT;
///RACH_ConfigCommon configuration ///RACH_ConfigCommon configuration
...@@ -92,7 +92,7 @@ typedef enum nprach_Periodicity{ ...@@ -92,7 +92,7 @@ typedef enum nprach_Periodicity{
nprach_Periodicity_ms80=80, nprach_Periodicity_ms80=80,
nprach_Periodicity_ms160=160, nprach_Periodicity_ms160=160,
nprach_Periodicity_ms240=240, nprach_Periodicity_ms240=240,
nprach_Periodicity_ms320=320, nprach_Periodicity_ms320=320,
nprach_Periodicity_ms640=640, nprach_Periodicity_ms640=640,
nprach_Periodicity_ms1280=1280, nprach_Periodicity_ms1280=1280,
nprach_Periodicity_ms2560=2560 nprach_Periodicity_ms2560=2560
...@@ -202,7 +202,7 @@ typedef enum si_periodicity_e{ ...@@ -202,7 +202,7 @@ typedef enum si_periodicity_e{
rf128=1280, rf128=1280,
rf256=2560, rf256=2560,
rf512=5120, rf512=5120,
rf1024=10240, rf1024=10240,
rf2048=20480, rf2048=20480,
rf4096=40960 rf4096=40960
}si_periodicity_t; }si_periodicity_t;
...@@ -210,7 +210,7 @@ typedef enum si_periodicity_e{ ...@@ -210,7 +210,7 @@ typedef enum si_periodicity_e{
typedef enum si_repetition_pattern_e{ typedef enum si_repetition_pattern_e{
every2ndRF=20, every2ndRF=20,
every4thRF=40, every4thRF=40,
every8thRF=80, every8thRF=80,
every16thRF=160 every16thRF=160
}si_repetition_pattern_t; }si_repetition_pattern_t;
...@@ -227,7 +227,7 @@ typedef enum si_tb_e{ ...@@ -227,7 +227,7 @@ typedef enum si_tb_e{
typedef struct sibs_NB_IoT_sched_s{ typedef struct sibs_NB_IoT_sched_s{
si_periodicity_t si_periodicity; si_periodicity_t si_periodicity;
si_repetition_pattern_t si_repetition_pattern; si_repetition_pattern_t si_repetition_pattern;
sib_MappingInfo_NB_IoT sib_mapping_info; //bit vector sib_MappingInfo_NB_IoT sib_mapping_info; //bit vector
si_tb_t si_tb; si_tb_t si_tb;
...@@ -257,10 +257,10 @@ typedef struct { ...@@ -257,10 +257,10 @@ typedef struct {
uint32_t mac_nprach_SubcarrierMSG3_RangeStart_NB_IoT; uint32_t mac_nprach_SubcarrierMSG3_RangeStart_NB_IoT;
uint32_t mac_maxNumPreambleAttemptCE_NB_IoT; uint32_t mac_maxNumPreambleAttemptCE_NB_IoT;
uint32_t mac_numRepetitionsPerPreambleAttempt_NB_IoT; uint32_t mac_numRepetitionsPerPreambleAttempt_NB_IoT;
// css // css
uint32_t mac_npdcch_NumRepetitions_RA_NB_IoT; // rmax uint32_t mac_npdcch_NumRepetitions_RA_NB_IoT; // rmax
uint32_t mac_npdcch_StartSF_CSS_RA_NB_IoT; // G uint32_t mac_npdcch_StartSF_CSS_RA_NB_IoT; // G
uint32_t mac_npdcch_Offset_RA_NB_IoT; // alpha offset uint32_t mac_npdcch_Offset_RA_NB_IoT; // alpha offset
}mac_NPRACH_ConfigSIB_NB_IoT; }mac_NPRACH_ConfigSIB_NB_IoT;
...@@ -281,11 +281,11 @@ typedef struct rrc_config_NB_IoT_s{ ...@@ -281,11 +281,11 @@ typedef struct rrc_config_NB_IoT_s{
///SIB1 ///SIB1
uint32_t cellIdentity_NB_IoT; uint32_t cellIdentity_NB_IoT;
sib1_NB_IoT_sched_t sib1_NB_IoT_sched_config; sib1_NB_IoT_sched_t sib1_NB_IoT_sched_config;
///SIBS ///SIBS
sibs_NB_IoT_sched_t sibs_NB_IoT_sched[NUMBER_OF_SIBS_MAX_NB_IoT]; sibs_NB_IoT_sched_t sibs_NB_IoT_sched[NUMBER_OF_SIBS_MAX_NB_IoT];
si_window_length_t si_window_length; si_window_length_t si_window_length;
uint32_t si_radio_frame_offset; uint32_t si_radio_frame_offset;
///SIB2 mac_RACH_ConfigCommon_NB_IoT ///SIB2 mac_RACH_ConfigCommon_NB_IoT
mac_RACH_ConfigCommon_NB_IoT mac_RACH_ConfigCommon[3]; mac_RACH_ConfigCommon_NB_IoT mac_RACH_ConfigCommon[3];
...@@ -298,4 +298,4 @@ typedef struct rrc_config_NB_IoT_s{ ...@@ -298,4 +298,4 @@ typedef struct rrc_config_NB_IoT_s{
}rrc_config_NB_IoT_t; }rrc_config_NB_IoT_t;
#endif #endif
\ No newline at end of file
...@@ -178,19 +178,17 @@ void Initialize_Resource(void){ ...@@ -178,19 +178,17 @@ void Initialize_Resource(void){
// extend subframe align to si-period // extend subframe align to si-period
void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subframe){ // assume max_subframe is found. void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subframe){ // assume max_subframe is found.
available_resource_DL_t *new_node; available_resource_DL_t *new_node;
//int temp; //int temp;
uint32_t i, i_div_si_window; uint32_t i, i_div_si_window;
//uint32_t si_period_div_window; //uint32_t si_period_div_window;
printf("%d %d\n", max_subframe, mac_inst->schedule_subframe_DL);
if(max_subframe > mac_inst->schedule_subframe_DL){ if(max_subframe > mac_inst->schedule_subframe_DL){
// align to si-period // align to si-period
max_subframe = ((max_subframe%mac_inst->rrc_config.si_window_length)==0)? max_subframe : (((max_subframe/mac_inst->rrc_config.si_window_length)+1)*mac_inst->rrc_config.si_window_length); max_subframe = ((max_subframe%mac_inst->rrc_config.si_window_length)==0)? max_subframe : (((max_subframe/mac_inst->rrc_config.si_window_length)+1)*mac_inst->rrc_config.si_window_length);
printf("max %d last->end %p\n", max_subframe, available_resource_DL_last); //printf("max %d last->end %p\n", max_subframe, available_resource_DL_last);
if(mac_inst->schedule_subframe_DL == available_resource_DL_last->end_subframe){ if(mac_inst->schedule_subframe_DL == available_resource_DL_last->end_subframe){
available_resource_DL_last->end_subframe = max_subframe; available_resource_DL_last->end_subframe = max_subframe;
//available_resource_DL_last->DLSF_num += calculate_DLSF(mac_inst, mac_inst->schedule_subframe_DL+1, max_subframe); //available_resource_DL_last->DLSF_num += calculate_DLSF(mac_inst, mac_inst->schedule_subframe_DL+1, max_subframe);
...@@ -208,13 +206,17 @@ void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subfram ...@@ -208,13 +206,17 @@ void extend_available_resource_DL(eNB_MAC_INST_NB_IoT *mac_inst, int max_subfram
for(i=mac_inst->schedule_subframe_DL;i<max_subframe;i+=mac_inst->rrc_config.si_window_length){ for(i=mac_inst->schedule_subframe_DL;i<max_subframe;i+=mac_inst->rrc_config.si_window_length){
i_div_si_window = i / mac_inst->rrc_config.si_window_length; i_div_si_window = i / mac_inst->rrc_config.si_window_length;
if(-1 != mac_inst->sibs_table[i_div_si_window]){ if(-1 != mac_inst->sibs_table[i_div_si_window]){
printf("[sibs%d] %d\n", mac_inst->sibs_table[i_div_si_window], i); //printf("[sibs%d] %d\n", mac_inst->sibs_table[i_div_si_window], i);
printf("Schedule SIB in \n");
schedule_sibs_NB_IoT(mac_inst, mac_inst->sibs_table[i_div_si_window], i); schedule_sibs_NB_IoT(mac_inst, mac_inst->sibs_table[i_div_si_window], i);
printf("Schedule SIB out \n");
} }
} }
mac_inst->schedule_subframe_DL = max_subframe; mac_inst->schedule_subframe_DL = max_subframe;
} }
LOG_I(MAC,"[NB-IoT] Initialization of the DL Resource grid has been done\n");
return ; return ;
} }
...@@ -323,12 +325,16 @@ available_resource_DL_t *check_sibs_resource(eNB_MAC_INST_NB_IoT *mac_inst, uint ...@@ -323,12 +325,16 @@ available_resource_DL_t *check_sibs_resource(eNB_MAC_INST_NB_IoT *mac_inst, uint
} }
pt = pt->next; pt = pt->next;
} }
//print_available_resource_DL(); //print_available_resource_DL();
//DEBUG("sibs %d", check_start_subframe); //DEBUG("sibs %d", check_start_subframe);
if((available_resource_DL_t *)0 == pt){ if((available_resource_DL_t *)0 == pt){
return (available_resource_DL_t *)0; return (available_resource_DL_t *)0;
} }
num_dlsf = calculate_DLSF(mac_inst, check_start_subframe, pt->end_subframe); num_dlsf = calculate_DLSF(mac_inst, check_start_subframe, pt->end_subframe);
if((available_resource_DL_t *)0 == pt){ if((available_resource_DL_t *)0 == pt){
......
...@@ -318,11 +318,11 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id, ...@@ -318,11 +318,11 @@ uint8_t do_SIB1_NB_IoT(uint8_t Mod_id, int CC_id,
//FIXME //FIXME
(*sib1_NB_IoT)->freqBandIndicator_r13 = (*sib1_NB_IoT)->freqBandIndicator_r13 =
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
configuration->eutra_band; configuration->eutra_band[CC_id];
#else #else
5; //if not configured we use band 5 (UL: 824 MHz - 849MHz / DL: 869 MHz - 894 MHz FDD mode) 5; //if not configured we use band 5 (UL: 824 MHz - 849MHz / DL: 869 MHz - 894 MHz FDD mode)
#endif #endif
//OPTIONAL new parameters, to be used? //OPTIONAL new parameters, to be used?
/* /*
* freqBandInfo_r13 * freqBandInfo_r13
...@@ -556,7 +556,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id, ...@@ -556,7 +556,7 @@ uint8_t do_SIB23_NB_IoT(uint8_t Mod_id,
nprach_parameters[1].nprach_Periodicity_r13 = configuration->nprach_Periodicity[CC_id]; nprach_parameters[1].nprach_Periodicity_r13 = configuration->nprach_Periodicity[CC_id];
nprach_parameters[1].nprach_StartTime_r13 = configuration->nprach_StartTime[CC_id]; nprach_parameters[1].nprach_StartTime_r13 = configuration->nprach_StartTime[CC_id];
nprach_parameters[1].nprach_SubcarrierOffset_r13 = configuration->nprach_SubcarrierOffset[CC_id]; nprach_parameters[1].nprach_SubcarrierOffset_r13 = configuration->nprach_SubcarrierOffset[CC_id];
nprach_parameters[1].nprach_NumSubcarriers_r13 = configuration->nprach_NumSubcarriers[1]; nprach_parameters[1].nprach_NumSubcarriers_r13 = configuration->nprach_NumSubcarriers[CC_id];
nprach_parameters[1].numRepetitionsPerPreambleAttempt_r13 = configuration->numRepetitionsPerPreambleAttempt_NB[CC_id]; nprach_parameters[1].numRepetitionsPerPreambleAttempt_r13 = configuration->numRepetitionsPerPreambleAttempt_NB[CC_id];
nprach_parameters[1].nprach_SubcarrierMSG3_RangeStart_r13 = configuration->nprach_SubcarrierMSG3_RangeStart[CC_id]; nprach_parameters[1].nprach_SubcarrierMSG3_RangeStart_r13 = configuration->nprach_SubcarrierMSG3_RangeStart[CC_id];
nprach_parameters[1].maxNumPreambleAttemptCE_r13 = configuration->maxNumPreambleAttemptCE_NB[CC_id]; nprach_parameters[1].maxNumPreambleAttemptCE_r13 = configuration->maxNumPreambleAttemptCE_NB[CC_id];
......
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