Commit 43641bc1 authored by Ting-An Lin's avatar Ting-An Lin

Completely assign common value

parent b159cd37
......@@ -172,7 +172,7 @@ eNBs =
////////// MME parameters:
mme_ip_address = ( { ipv4 = "140.118.122.111"; #"140.118.123.212";
mme_ip_address = ( { ipv4 = "140.118.123.97"; #"140.118.123.212";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
......@@ -189,12 +189,12 @@ eNBs =
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "140.118.121.88/23";
ENB_IPV4_ADDRESS_FOR_S1_MME = "140.118.123.97/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "140.118.121.88/23";
ENB_IPV4_ADDRESS_FOR_S1U = "140.118.123.97/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
ENB_IPV4_ADDRESS_FOR_X2C = "140.118.121.88/24";
ENB_IPV4_ADDRESS_FOR_X2C = "140.118.123.97/24";
ENB_PORT_FOR_X2C = 36422; # Spec 36422
};
......
#include "../impl_defs_lte_NB_IoT.h"
#include "../defs_L1_NB_IoT.h"
#include "phy_init_NB_IoT.h"
......@@ -9,7 +5,11 @@
#include "openair2/ENB_APP/NB_IoT_paramdef.h"
#include "PHY/phy_vars.h"
#include "openair1/PHY/LTE_REFSIG/lte_refsig.h"
#include "openair1/PHY/LTE_REFSIG/defs_NB_IoT.h"
#include "openair1/PHY/CODING/defs_NB_IoT.h"
#include "openair1/PHY/vars_NB_IoT.h"
// #include "openair2/PHY_INTERFACE/nfapi_interface.h"
#include "openair2/COMMON/platform_types.h"
PHY_VARS_eNB_NB_IoT* init_lte_eNB_NB_IoT(NB_IoT_DL_FRAME_PARMS *frame_parms,
uint8_t eNB_id,
......@@ -158,7 +158,7 @@ int phy_init_lte_eNB_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
if (eNB->node_function != NGFI_RRU_IF4p5_NB_IoT) {
// lte_gold_NB_IoT(fp,eNB->lte_gold_table_NB_IoT,fp->Nid_cell); ****** uncomment when this function is used - 16/02/2018
lte_gold_NB_IoT(fp,eNB->lte_gold_table_NB_IoT,fp->Nid_cell); //Ann
// generate_pcfich_reg_mapping(fp);
// generate_phich_reg_mapping(fp);
......@@ -492,3 +492,285 @@ l1_north_init_NB_IoT()
}
return(0);
}
// void phy_config_mib_eNB_NB_IoT(int Mod_id,
// int eutra_band,
// int Nid_cell,
// int Ncp,
// int Ncp_UL,
// int p_eNB,
// uint16_t EARFCN,
// uint16_t prb_index, // NB_IoT_RB_ID,
// uint16_t operating_mode,
// uint16_t control_region_size,
// uint16_t eutra_NumCRS_ports)
// {
// AssertFatal(PHY_vars_eNB_NB_IoT_g != NULL, "PHY_vars_eNB_NB_IoT_g instance pointer doesn't exist\n");
// AssertFatal(PHY_vars_eNB_NB_IoT_g[Mod_id] != NULL, "PHY_vars_eNB_NB_IoT_g instance %d doesn't exist\n",Mod_id);
// AssertFatal(PHY_vars_eNB_NB_IoT_g[Mod_id][0] != NULL, "PHY_vars_eNB_NB_IoT_g instance %d, CCid %d doesn't exist\n",Mod_id,0);
// NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][0]->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, 0, eutra_band, Nid_cell, p_eNB,EARFCN);
// // 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->Nid_cell = Nid_cell;
// fp->nushift = Nid_cell%6;
// fp->eutra_band = eutra_band;
// fp->Ncp = Ncp;
// fp->Ncp_UL = Ncp_UL;
// fp->nb_antenna_ports_eNB = p_eNB; //tx antenna port
// 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->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_rx_antenna_ports_eNB
// 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)
// LOG_I(PHY,"Configure-MIB complete\n");
// //TODO (new Raymond implementation) in the classic implementation seems to be used only by oaisim
// //init_frame_parms(fp,1);
// //init_lte_top(fp);
// }
// #if 0 //Ann //wait for nfapi integration
// void phy_config_sib2_eNB_NB_IoT(uint8_t Mod_id,
// nfapi_config_NB_IoT_t *config,
// nfapi_rf_config_t *rf_config,
// nfapi_uplink_reference_signal_config_t *ul_nrs_config,
// extra_phyConfig_t *extra_phy_parms)
// {
// NB_IoT_DL_FRAME_PARMS *fp = &PHY_vars_eNB_NB_IoT_g[Mod_id][0]->frame_parms_NB_IoT;
// // PHY_VARS_eNB *eNB = &PHY_vars_eNB_g[0][0];
// LOG_I(PHY,"[eNB%d] CCid %d: Applying config_NB_IoT from sib2_NB\n",Mod_id,0);
// fp = (NB_IoT_DL_FRAME_PARMS*) malloc (sizeof(NB_IoT_DL_FRAME_PARMS));
// /*NPRACH_ConfigSIB_NB_r13----------------------------------------------------------*/
// //MP: FAPI style approach: instead of a list they consider the 3 possible configuration separately
// if(config->nprach_config_0_enabled.value == 1){
// 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
// 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??
// 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[0].nprach_Periodicity);
// 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[0].nprach_StartTime);
// 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[0].nprach_SubcarrierOffset);
// 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[0].nprach_NumSubcarriers);
// 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[0].numRepetitionsPerPreambleAttempt);
// //////////////////////////////////////////////////////////////////////////
// /* eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_0_cp_length.value;
// eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_Periodicity = config->nprach_config_0_sf_periodicity.value;
// eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_StartTime = config->nprach_config_0_start_time.value;
// eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_SubcarrierOffset = config->nprach_config_0_subcarrier_offset.value;
// eNB->nprach_config_common.nprach_ParametersList.list[0].nprach_NumSubcarriers = config->nprach_config_0_number_of_subcarriers.value;
// eNB->nprach_config_common.nprach_ParametersList.list[0].numRepetitionsPerPreambleAttempt = config->nprach_config_0_number_of_repetitions_per_attempt.value;
// */
// //////////////////////////////////////////////////////////////////////////
// //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]->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_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.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
// }
// if(config->nprach_config_1_enabled.value == 1){
// 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
// 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??
// 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[1].nprach_Periodicity);
// 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[1].nprach_StartTime);
// 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[1].nprach_SubcarrierOffset);
// 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[1].nprach_NumSubcarriers);
// 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[1].numRepetitionsPerPreambleAttempt);
// ///////////////////////////////////////////////////////////////////////////////////////
// /* eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_1_cp_length.value;
// eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_Periodicity = config->nprach_config_1_sf_periodicity.value;
// eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_StartTime = config->nprach_config_1_start_time.value;
// eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_SubcarrierOffset = config->nprach_config_1_subcarrier_offset.value;
// eNB->nprach_config_common.nprach_ParametersList.list[1].nprach_NumSubcarriers = config->nprach_config_1_number_of_subcarriers.value;
// eNB->nprach_config_common.nprach_ParametersList.list[1].numRepetitionsPerPreambleAttempt = config->nprach_config_1_number_of_repetitions_per_attempt.value;
// */
// //////////////////////////////////////////////////////////////////////////////////////
// //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]->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_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.rsrp_ThresholdsPrachInfoList.list /*OPTIONAL*/
// }
// if(config->nprach_config_2_enabled.value == 1){
// 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
// 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??
// 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[2].nprach_Periodicity);
// 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[2].nprach_StartTime);
// 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[2].nprach_SubcarrierOffset);
// 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[2].nprach_NumSubcarriers);
// 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[2].numRepetitionsPerPreambleAttempt);
// //////////////////////////////////////////////////////////////////////////////////////
// /*
// eNB->nprach_config_common.nprach_CP_Length = config->nprach_config_2_cp_length.value;
// eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_Periodicity = config->nprach_config_2_sf_periodicity.value;
// eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_StartTime = config->nprach_config_2_start_time.value;
// eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_SubcarrierOffset = config->nprach_config_2_subcarrier_offset.value;
// eNB->nprach_config_common.nprach_ParametersList.list[2].nprach_NumSubcarriers = config->nprach_config_2_number_of_subcarriers.value;
// eNB->nprach_config_common.nprach_ParametersList.list[2].numRepetitionsPerPreambleAttempt = config->nprach_config_2_number_of_repetitions_per_attempt.value;
// */
// //////////////////////////////////////////////////////////////////////////////////////
// //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;
// 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;
// LOG_D(PHY,"config#2: npdcch_StartSF_CSS_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_StartSF_CSS_RA);
// fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_NumRepetitions_RA = extra_phy_parms->nprach_config_2_npdcch_num_repetitions_RA;
// LOG_D(PHY,"config#2: npdcch_NumRepetitions_RA= %d\n",fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_NumRepetitions_RA);
// fp->nprach_config_common.nprach_ParametersList.list.array[2]->npdcch_Offset_RA = extra_phy_parms->nprach_config_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;
// 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*/
// }
// //TODO: Should modify to compute_nprach_seq --> nprach.
// //compute_prach_seq(&fp->prach_config_common,fp->frame_type,PHY_vars_eNB_NB_IoT_g[Mod_id][0]->X_u);
// /*NPDSCH ConfigCommon-------------------------------------------------------------------*/
// //NPDSCH_ConfigCommon_NB_r13_t b;
// //FIXME: the FAPI specs pag 140 fix a range of value (0->255) but i don't find any similar correspondence in the 3GPP specs (TS 36.331 pag 608 and TS 36.213 ch 16.2.2)
// fp->npdsch_config_common.nrs_Power = rf_config->reference_signal_power.value;
// /*NPUSCH ConfigCommon-------------------------------------------------------------------*/
// //NPUSCH_ConfigCommon_NB_r13_t c;
// fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence = config->three_tone_base_sequence.value;
// LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.threeTone_BaseSequence);
// fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence = config->six_tone_base_sequence.value;
// LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.sixTone_BaseSequence);
// fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift = config->three_tone_cyclic_shift.value;
// LOG_D(PHY,"npusch_config_common.dmrs_Config.threeTone_CyclicShift = %d\n",fp->npusch_config_common.dmrs_Config.threeTone_CyclicShift);
// fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift = config->six_tone_cyclic_shift.value;
// LOG_D(PHY,"npusch_config_common.dmrs_Config.sixTone_CyclicShift = %d\n",fp->npusch_config_common.dmrs_Config.sixTone_CyclicShift);
// fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence= config->twelve_tone_base_sequence.value;
// LOG_D(PHY,"npusch_config_common.dmrs_Config.twelveTone_BaseSequence = %d\n",fp->npusch_config_common.dmrs_Config.twelveTone_BaseSequence);
// fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled = ul_nrs_config->uplink_rs_hopping.value;
// LOG_D(PHY,"npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled = %d\n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled);
// LOG_D(PHY,"**%s**\n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupHoppingEnabled == 1 ? "RS_GROUP_HOPPING" : "RS_NO_HOPPING");
// fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH = ul_nrs_config->group_assignment.value;
// LOG_D(PHY,"npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH = %d]n",fp->npusch_config_common.ul_ReferenceSignalsNPUSCH.groupAssignmentNPUSCH);
// //MP: FAPI missed parameters (may not needed at eNB side and some of them are optional by the 3GPP specs)
// //fp->npusch_config_common.ack_NACK_NumRepetitions_Msg4 --> list of size maxNPRACH_Resources_NB_r13 (3 elements)
// //fp->npusch_config_common.srs_SubframeConfig /*OPTIONAL*/
// //No Frequency hopping in NULSCH for NB-IoT and not init_ncs_cell used for PUCCH
// /*UL Power Control Config Common---------------------------------------------------------*/
// //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.alpha = extra_phy_parms->alpha;
// fp->ul_power_control_config_common.deltaPreambleMsg3 = extra_phy_parms->delta_preamle_MSG*/
// /*DL gap Config - OPTIONAL----------------------------------------------------------------*/
// //DL_GapConfig_NB_r13_t a;
// if(config->dl_gap_config_enable.value == 1){
// fp->DL_gap_config.dl_GapDurationCoeff= config->dl_gap_periodicity.value;
// fp->DL_gap_config.dl_GapPeriodicity = config->dl_gap_periodicity.value;
// fp->DL_gap_config.dl_GapThreshold = config->dl_gap_threshold.value;
// }
// LOG_I(PHY,"SIB-2 configure complete\n");
// }
// #endif
// void phy_config_dedicated_eNB_NB_IoT(module_id_t Mod_id,
// rnti_t rnti,
// extra_phyConfig_t *extra_parms)
// {
// PHY_VARS_eNB_NB_IoT *eNB = PHY_vars_eNB_NB_IoT_g[Mod_id][0];
// NB_IoT_eNB_NPDCCH_t *npdcch;
// uint8_t UE_id = find_ue_NB_IoT(rnti,eNB);
// if (UE_id == -1) {
// LOG_E( PHY, "[eNB %"PRIu8"] find_ue() returns -1\n", Mod_id);
// return;
// }
// //configure UE specific parameters for NPDCCH Search Space
// if (eNB->npdcch[UE_id]) {
// npdcch = eNB->npdcch[UE_id];
// npdcch->rnti[0] = rnti;
// npdcch->npdcch_NumRepetitions[0] = extra_parms->npdcch_NumRepetitions; //Rmax maybe is the only one needed
// //npdcch->npdcch_Offset_USS = extra_parms->npdcch_Offset_USS;
// //npdcch->npdcch_StartSF_USS = extra_parms->npdcch_StartSF_USS;
// LOG_I(PHY,"phy_config_dedicated_eNB_NB_IoT: npdcch_NumRepetitions = %d\n",npdcch->npdcch_NumRepetitions[0]);
// } else {
// LOG_E(PHY,"[eNB %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id, UE_id);
// return;
// }
// }
\ No newline at end of file
......@@ -144,7 +144,7 @@ extern double cpuf;
void init_eNB(int,int);
void stop_eNB(int nb_inst);
void init_eNB_proc_NB_IoT(int inst , eNBs_t *eNBs);
int wakeup_tx(PHY_VARS_eNB *eNB ,int frame_rx,int subframe_rx,int frame_tx,int subframe_tx,uint64_t timestamp_tx);
int wakeup_txfh(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc,int frame_tx,int subframe_tx,uint64_t timestamp_tx);
void wakeup_prach_eNB(PHY_VARS_eNB *eNB,RU_t *ru,int frame,int subframe);
......@@ -853,8 +853,11 @@ static void *process_stats_thread(void *param) {
return(NULL);
}
/* Samuel
void copy_eNB_content(PHY_VARS_eNB *eNB , PHY_VARS_eNB_NB_IoT *eNB_copy){
}
*/
void init_eNB_proc(int inst) {
/*int i=0;*/
int CC_id;
......@@ -866,7 +869,8 @@ void init_eNB_proc(int inst) {
pthread_attr_t *attr_prach_br=NULL;
#endif
LOG_I(PHY,"%s(inst:%d) RC.nb_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_CC[inst]);
eNBs.eNB_NB_IoT = RC.L1_NB_IoT[inst];//Ann
//eNBs.eNB_NB_IoT = RC.L1_NB_IoT[inst];//Ann
init_eNB_proc_NB_IoT( inst , &eNBs); //Ann
for (CC_id=0; CC_id<RC.nb_CC[inst]; CC_id++) {
eNBs.eNB = RC.eNB[inst][CC_id];
#ifndef OCP_FRAMEWORK
......@@ -980,7 +984,73 @@ void init_eNB_proc(int inst) {
sync_phy_proc.phy_proc_CC_id = 0;
}
void init_eNB_proc_NB_IoT(int inst , eNBs_t *eNBs) { //Ann create
int i=0;
int CC_id;
eNB_proc_NB_IoT_t *proc;
eNB_rxtx_proc_NB_IoT_t *proc_rxtx;
pthread_attr_t *attr0=NULL,*attr1=NULL,*attr_FH=NULL,*attr_prach=NULL,*attr_asynch=NULL,*attr_single=NULL,*attr_fep=NULL,*attr_td=NULL,*attr_te=NULL,*attr_synch=NULL;
eNBs->eNB_NB_IoT = RC.L1_NB_IoT[inst];//Ann
#ifndef OCP_FRAMEWORK
LOG_I(PHY,"Initializing eNB_NB_IoT %d CC_id %d (%s,%s),\n",inst,CC_id,eNB_functions[eNBs->eNB_NB_IoT->node_function],eNB_timing[eNBs->eNB_NB_IoT->node_timing]);
#endif
proc = &eNBs->eNB_NB_IoT->proc;//Ann
proc_rxtx = proc->proc_rxtx;
proc_rxtx[0].instance_cnt_rxtx = -1;
proc_rxtx[1].instance_cnt_rxtx = -1;
proc->instance_cnt_prach = -1;
proc->instance_cnt_FH = -1;
proc->instance_cnt_asynch_rxtx = -1;
proc->CC_id = CC_id;
proc->instance_cnt_synch = -1;
proc->first_rx=1;
proc->first_tx=1;
proc->frame_offset = 0;
for (i=0;i<10;i++) proc->symbol_mask[i]=0;
pthread_mutex_init( &proc_rxtx[0].mutex_rxtx, NULL);
pthread_mutex_init( &proc_rxtx[1].mutex_rxtx, NULL);
pthread_cond_init( &proc_rxtx[0].cond_rxtx, NULL);
pthread_cond_init( &proc_rxtx[1].cond_rxtx, NULL);
pthread_mutex_init( &proc->mutex_prach, NULL);
pthread_mutex_init( &proc->mutex_asynch_rxtx, NULL);
pthread_mutex_init( &proc->mutex_synch,NULL);
pthread_cond_init( &proc->cond_prach, NULL);
pthread_cond_init( &proc->cond_FH, NULL);
pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
pthread_cond_init( &proc->cond_synch,NULL);
pthread_attr_init( &proc->attr_FH);
pthread_attr_init( &proc->attr_prach);
pthread_attr_init( &proc->attr_synch);
pthread_attr_init( &proc->attr_asynch_rxtx);
pthread_attr_init( &proc->attr_single);
pthread_attr_init( &proc->attr_fep);
pthread_attr_init( &proc->attr_td);
pthread_attr_init( &proc->attr_te);
pthread_attr_init( &proc_rxtx[0].attr_rxtx);
pthread_attr_init( &proc_rxtx[1].attr_rxtx);
#ifndef DEADLINE_SCHEDULER
attr0 = &proc_rxtx[0].attr_rxtx;
attr1 = &proc_rxtx[1].attr_rxtx;
attr_FH = &proc->attr_FH;
attr_prach = &proc->attr_prach;
attr_synch = &proc->attr_synch;
attr_asynch = &proc->attr_asynch_rxtx;
attr_single = &proc->attr_single;
attr_fep = &proc->attr_fep;
attr_td = &proc->attr_td;
attr_te = &proc->attr_te;
#endif
}
/*!
* \brief Terminate eNB TX and RX threads.
......
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