Commit 8da1c4b5 authored by knopp's avatar knopp

Note: this commit is work in progress. Contains initial integration of NFAPI...

Note: this commit is work in progress. Contains initial integration of NFAPI data structures which are tested for TX path. RX path to follow.
parent d23697ae
...@@ -27,6 +27,7 @@ cmake_minimum_required (VERSION 2.8) ...@@ -27,6 +27,7 @@ cmake_minimum_required (VERSION 2.8)
# Base directories, compatible with legacy OAI building # Base directories, compatible with legacy OAI building
################################################ ################################################
set (OPENAIR_DIR $ENV{OPENAIR_DIR}) set (OPENAIR_DIR $ENV{OPENAIR_DIR})
set (NFAPI_DIR $ENV{NFAPI_DIR})
set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1) set (OPENAIR1_DIR ${OPENAIR_DIR}/openair1)
set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2) set (OPENAIR2_DIR ${OPENAIR_DIR}/openair2)
set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3) set (OPENAIR3_DIR ${OPENAIR_DIR}/openair3)
...@@ -725,6 +726,7 @@ else() ...@@ -725,6 +726,7 @@ else()
include_directories("${OPENAIR2_DIR}/UTIL") include_directories("${OPENAIR2_DIR}/UTIL")
include_directories("${OPENAIR2_DIR}/UTIL/LOG") include_directories("${OPENAIR2_DIR}/UTIL/LOG")
endif() endif()
include_directories("${NFAPI_DIR}")
include_directories("${OPENAIR1_DIR}") include_directories("${OPENAIR1_DIR}")
include_directories("${OPENAIR2_DIR}/NAS") include_directories("${OPENAIR2_DIR}/NAS")
include_directories("${OPENAIR2_DIR}") include_directories("${OPENAIR2_DIR}")
...@@ -958,7 +960,7 @@ set(SCHED_SRC ...@@ -958,7 +960,7 @@ set(SCHED_SRC
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_ue.c
${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c ${OPENAIR1_DIR}/SCHED/phy_procedures_lte_common.c
${OPENAIR1_DIR}/SCHED/ru_procedures.c ${OPENAIR1_DIR}/SCHED/ru_procedures.c
${OPENAIR1_DIR}/SCHED/phy_mac_stub.c # ${OPENAIR1_DIR}/SCHED/phy_mac_stub.c
${OPENAIR1_DIR}/SCHED/pucch_pc.c ${OPENAIR1_DIR}/SCHED/pucch_pc.c
${OPENAIR1_DIR}/SCHED/pusch_pc.c ${OPENAIR1_DIR}/SCHED/pusch_pc.c
${OPENAIR1_DIR}/SCHED/srs_pc.c ${OPENAIR1_DIR}/SCHED/srs_pc.c
...@@ -1070,6 +1072,7 @@ add_library(PHY ${PHY_SRC}) ...@@ -1070,6 +1072,7 @@ add_library(PHY ${PHY_SRC})
#Layer 2 library #Layer 2 library
##################### #####################
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC) set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE)
set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC) set(RLC_DIR ${OPENAIR2_DIR}/LAYER2/RLC)
set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0) set(RLC_UM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/UM_v9.3.0)
set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0) set(RLC_AM_DIR ${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0)
...@@ -1120,7 +1123,7 @@ set(L2_SRC ...@@ -1120,7 +1123,7 @@ set(L2_SRC
${RRC_DIR}/L2_interface.c ${RRC_DIR}/L2_interface.c
) )
set (MAC_SRC set (MAC_SRC
${MAC_DIR}/lte_transport_init.c ${PHY_INTERFACE_DIR}/IF_Module.c
${MAC_DIR}/main.c ${MAC_DIR}/main.c
${MAC_DIR}/ue_procedures.c ${MAC_DIR}/ue_procedures.c
${MAC_DIR}/ra_procedures.c ${MAC_DIR}/ra_procedures.c
...@@ -1555,6 +1558,7 @@ ${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c ...@@ -1555,6 +1558,7 @@ ${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c
${OPENAIR1_DIR}/SIMULATION/RF/rf.c ${OPENAIR1_DIR}/SIMULATION/RF/rf.c
${OPENAIR1_DIR}/SIMULATION/RF/dac.c ${OPENAIR1_DIR}/SIMULATION/RF/dac.c
${OPENAIR1_DIR}/SIMULATION/RF/adc.c ${OPENAIR1_DIR}/SIMULATION/RF/adc.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
) )
add_library(SIMU_ETH add_library(SIMU_ETH
...@@ -1843,7 +1847,7 @@ add_executable(oaisim ...@@ -1843,7 +1847,7 @@ add_executable(oaisim
target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim target_link_libraries (oaisim
-Wl,-ldl,--start-group -Wl,-ldl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} LIB_NAS_UE SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} LIB_NAS_UE SIMU SECU_OSA ${ITTI_LIB} ${MIH_LIB}
-Wl,--end-group ) -Wl,--end-group )
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES}) target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
...@@ -1884,7 +1888,7 @@ add_executable(oaisim_nos1 ...@@ -1884,7 +1888,7 @@ add_executable(oaisim_nos1
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim_nos1 target_link_libraries (oaisim_nos1
-Wl,--start-group -Wl,--start-group
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-Wl,--end-group ) -Wl,--end-group )
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES}) target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
...@@ -2001,7 +2005,7 @@ if (${T_TRACER}) ...@@ -2001,7 +2005,7 @@ if (${T_TRACER})
oai_eth_transpro oai_eth_transpro
FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO SECU_OSA FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO SECU_OSA
SECU_CN SCHED_LIB PHY L2 default_sched remote_sched RAL MIH CN_UTILS SECU_CN SCHED_LIB PHY L2 default_sched remote_sched RAL MIH CN_UTILS
GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS LFDS7 SIMU SIMU_ETH OPENAIR0_LIB) GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS LFDS7 SIMU OPENAIR0_LIB)
if (TARGET ${i}) if (TARGET ${i})
add_dependencies(${i} generate_T) add_dependencies(${i} generate_T)
endif() endif()
......
...@@ -50,11 +50,17 @@ ...@@ -50,11 +50,17 @@
typedef struct { typedef struct {
/// RAN context config file name /// RAN context config file name
char *config_file_name; char *config_file_name;
/// Number of eNB instances in this node /// Number of RRC instances in this node
int nb_inst; int nb_inst;
/// Number of Component Carriers per instance in this node /// Number of Component Carriers per instance in this node
int *nb_CC; int *nb_CC;
/// Number of radio units /// Number of MACRLC instances in this node
int nb_macrlc_inst;
/// Number of L1 instances in this node
int nb_L1_inst;
/// Number of Component Carriers per instance in this node
int *nb_L1_CC;
/// Number of RU instances in this node
int nb_RU; int nb_RU;
/// eNB context variables /// eNB context variables
struct PHY_VARS_eNB_s ***eNB; struct PHY_VARS_eNB_s ***eNB;
......
...@@ -39,6 +39,13 @@ ...@@ -39,6 +39,13 @@
* @{ * @{
*/ */
/*!
\fn int l1_top_init_eNB(void)
\brief Initialize north interface for L1
@returns 0 on success
*/
int l1_north_init_eNB(void);
/*! /*!
\fn int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms) \fn int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms)
\brief Allocate and Initialize the PHY variables after receiving static configuration \brief Allocate and Initialize the PHY variables after receiving static configuration
...@@ -347,6 +354,7 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, ...@@ -347,6 +354,7 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
\brief Cleanup the PHY variables*/ \brief Cleanup the PHY variables*/
void phy_cleanup(void); void phy_cleanup(void);
void phy_config_request(PHY_Config_t *phy_config);
int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf); int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms); void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
......
...@@ -39,40 +39,53 @@ uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10}; ...@@ -39,40 +39,53 @@ uint8_t dmrs1_tab[8] = {0,2,3,4,6,8,9,10};
int N_RB_DL_array[6] = {6,15,25,50,75,100}; int N_RB_DL_array[6] = {6,15,25,50,75,100};
void phy_config_mib_eNB(int Mod_id, int l1_north_init_eNB() {
int CC_id,
int eutra_band, int i,j;
int dl_Bandwidth, AssertFatal(RC.nb_L1_inst>0,"nb_L1_inst=%d\n",RC.nb_L1_inst);
PHICH_Config_t *phich_config, AssertFatal(RC.nb_L1_CC!=NULL,"nb_L1_CC is null\n");
int Nid_cell, AssertFatal(RC.eNB!=NULL,"RC.eNB is null\n");
int Ncp, for (i=0;i<RC.nb_L1_inst;i++) {
int p_eNB, AssertFatal(RC.eNB[i]!=NULL,"RC.eNB[%d] is null\n",i);
uint32_t dl_CarrierFreq, AssertFatal(RC.nb_L1_CC[i]>0,"RC.nb_L1_CC[%d]=%d\n",i,RC.nb_L1_CC[i]);
uint32_t ul_CarrierFreq) { for (j=0;j<RC.nb_L1_CC[i];j++) {
AssertFatal(RC.eNB[i][j]!=NULL,"RC.eNB[%d][%d] is null\n",i,j);
if ((RC.eNB[i][j]->if_inst = IF_Module_init(i))<0) return(-1);
RC.eNB[i][j]->if_inst->PHY_config_req = phy_config_request;
RC.eNB[i][j]->if_inst->schedule_response = schedule_response;
}
}
return(0);
}
void phy_config_request(PHY_Config_t *phy_config) {
uint8_t Mod_id = phy_config->Mod_id;
int CC_id = phy_config->CC_id;
nfapi_config_request_t *cfg = phy_config->cfg;
LTE_DL_FRAME_PARMS *fp; LTE_DL_FRAME_PARMS *fp;
PHICH_RESOURCE_t phich_resource_table[4]={oneSixth,half,one,two}; PHICH_RESOURCE_t phich_resource_table[4]={oneSixth,half,one,two};
int eutra_band = cfg->nfapi_config.rf_bands.rf_band[0];
int dl_Bandwidth = cfg->rf_config.dl_channel_bandwidth.value;
int Nid_cell = cfg->sch_config.physical_cell_id.value;
int Ncp = cfg->subframe_config.dl_cyclic_prefix_type.value;
int p_eNB = cfg->rf_config.tx_antenna_ports.value;
uint32_t dl_CarrierFreq = cfg->nfapi_config.earfcn.value;
LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d,Nid_cell %d,p %d,Ncp %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
Mod_id, CC_id, eutra_band, N_RB_DL_array[dl_Bandwidth], Nid_cell, p_eNB,Ncp,dl_CarrierFreq,
cfg->phich_config.phich_resource.value,
cfg->phich_config.phich_duration.value);
AssertFatal(RC.eNB != NULL, "PHY instance pointer doesn't exist\n");
AssertFatal(RC.eNB[Mod_id] != NULL, "PHY instance %d doesn't exist\n",Mod_id);
AssertFatal(RC.eNB[Mod_id][CC_id] != NULL, "PHY instance %d, CCid %d doesn't exist\n",Mod_id,CC_id);
LOG_I(PHY,"Configuring MIB for instance %d, CCid %d : (band %d,N_RB_DL %d,Nid_cell %d,p %d,DL freq %u,phich_config.resource %d, phich_config.duration %d)\n",
Mod_id, CC_id, eutra_band, N_RB_DL_array[dl_Bandwidth], Nid_cell, p_eNB,dl_CarrierFreq,phich_config->phich_Resource,phich_config->phich_Duration);
if (RC.eNB == NULL) {
RC.eNB = (PHY_VARS_eNB ***)malloc((1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***));
LOG_I(PHY,"RC.eNB = %p\n",RC.eNB);
memset(RC.eNB,0,(1+NUMBER_OF_eNB_MAX)*sizeof(PHY_VARS_eNB***));
}
if (RC.eNB[Mod_id] == NULL) {
RC.eNB[Mod_id] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**));
LOG_I(PHY,"RC.eNB[%d] = %p\n",Mod_id,RC.eNB[Mod_id]);
memset(RC.eNB[Mod_id],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***));
}
if (RC.eNB[Mod_id][CC_id] == NULL) {
RC.eNB[Mod_id][CC_id] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB));
LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",Mod_id,CC_id,RC.eNB[Mod_id][CC_id]);
RC.eNB[Mod_id][CC_id]->Mod_id = Mod_id;
RC.eNB[Mod_id][CC_id]->CC_id = CC_id;
}
RC.eNB[Mod_id][CC_id]->mac_enabled = 1; RC.eNB[Mod_id][CC_id]->mac_enabled = 1;
...@@ -81,17 +94,18 @@ void phy_config_mib_eNB(int Mod_id, ...@@ -81,17 +94,18 @@ void phy_config_mib_eNB(int Mod_id,
fp->N_RB_DL = N_RB_DL_array[dl_Bandwidth]; fp->N_RB_DL = N_RB_DL_array[dl_Bandwidth];
fp->N_RB_UL = N_RB_DL_array[dl_Bandwidth]; fp->N_RB_UL = N_RB_DL_array[dl_Bandwidth];
fp->Nid_cell = Nid_cell; fp->Nid_cell = Nid_cell;
fp->nushift = Nid_cell%6; fp->nushift = fp->Nid_cell%6;
fp->eutra_band = eutra_band; fp->eutra_band = eutra_band;
fp->Ncp = Ncp; fp->Ncp = Ncp;
fp->nb_antenna_ports_eNB = p_eNB; fp->nb_antenna_ports_eNB = p_eNB;
AssertFatal(phich_config->phich_Resource < 4, "Illegal phich_Resource\n"); AssertFatal(cfg->phich_config.phich_resource.value<4, "Illegal phich_Resource\n");
fp->phich_config_common.phich_resource = phich_resource_table[phich_config->phich_Resource];
fp->phich_config_common.phich_duration = phich_config->phich_Duration; fp->phich_config_common.phich_resource = phich_resource_table[cfg->phich_config.phich_resource.value];
fp->dl_CarrierFreq = dl_CarrierFreq; fp->phich_config_common.phich_duration = cfg->phich_config.phich_duration.value;
fp->ul_CarrierFreq = ul_CarrierFreq; fp->dl_CarrierFreq = from_earfcn(eutra_band,dl_CarrierFreq);
if (dl_CarrierFreq==ul_CarrierFreq) fp->ul_CarrierFreq = fp->dl_CarrierFreq - get_uldl_offset(eutra_band);
if (fp->dl_CarrierFreq==fp->ul_CarrierFreq)
fp->frame_type = TDD; fp->frame_type = TDD;
else else
fp->frame_type = FDD; fp->frame_type = FDD;
...@@ -99,27 +113,80 @@ void phy_config_mib_eNB(int Mod_id, ...@@ -99,27 +113,80 @@ void phy_config_mib_eNB(int Mod_id,
init_frame_parms(fp,1); init_frame_parms(fp,1);
init_lte_top(fp); init_lte_top(fp);
} if (cfg->subframe_config.duplex_mode.value == 0) {
fp->tdd_config = cfg->tdd_frame_structure_config.subframe_assignment.value;
void phy_config_sib1_eNB(uint8_t Mod_id, fp->tdd_config_S = cfg->tdd_frame_structure_config.special_subframe_patterns.value;
int CC_id,
TDD_Config_t *tdd_Config,
uint8_t SIwindowsize,
uint16_t SIPeriod)
{
LTE_DL_FRAME_PARMS *fp = &RC.eNB[Mod_id][CC_id]->frame_parms;
if (tdd_Config) {
fp->tdd_config = tdd_Config->subframeAssignment;
fp->tdd_config_S = tdd_Config->specialSubframePatterns;
fp->frame_type = TDD; fp->frame_type = TDD;
} }
else { else {
fp->frame_type = FDD; fp->frame_type = FDD;
} }
fp->SIwindowsize = SIwindowsize;
fp->SIPeriod = SIPeriod; fp->prach_config_common.rootSequenceIndex = cfg->prach_config.root_sequence_index.value;
LOG_I(PHY,"prach_config_common.rootSequenceIndex = %d\n",cfg->prach_config.root_sequence_index.value);
fp->prach_config_common.prach_Config_enabled=1;
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =cfg->prach_config.configuration_index.value;
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.prach_ConfigIndex = %d\n",cfg->prach_config.configuration_index.value);
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =cfg->prach_config.high_speed_flag.value;
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.highSpeedFlag = %d\n",cfg->prach_config.high_speed_flag.value);
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =cfg->prach_config.zero_correlation_zone_configuration.value;
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = %d\n",cfg->prach_config.zero_correlation_zone_configuration.value);
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =cfg->prach_config.frequency_offset.value;
LOG_I(PHY,"prach_config_common.prach_ConfigInfo.prach_FreqOffset = %d\n",cfg->prach_config.frequency_offset.value);
init_prach_tables(839);
compute_prach_seq(&fp->prach_config_common,fp->frame_type,
RC.eNB[Mod_id][CC_id]->X_u);
fp->pucch_config_common.deltaPUCCH_Shift = 1+cfg->pucch_config.delta_pucch_shift.value;
fp->pucch_config_common.nRB_CQI = cfg->pucch_config.n_cqi_rb.value;
fp->pucch_config_common.nCS_AN = cfg->pucch_config.n_an_cs.value;
fp->pucch_config_common.n1PUCCH_AN = cfg->pucch_config.n1_pucch_an.value;
fp->pdsch_config_common.referenceSignalPower = cfg->rf_config.reference_signal_power.value;
fp->pdsch_config_common.p_b = cfg->subframe_config.pb.value;
fp->pusch_config_common.n_SB = cfg->pusch_config.number_of_subbands.value;
LOG_I(PHY,"pusch_config_common.n_SB = %d\n",fp->pusch_config_common.n_SB );
fp->pusch_config_common.hoppingMode = cfg->pusch_config.hopping_mode.value;
LOG_I(PHY,"pusch_config_common.hoppingMode = %d\n",fp->pusch_config_common.hoppingMode);
fp->pusch_config_common.pusch_HoppingOffset = cfg->pusch_config.hopping_offset.value;
LOG_I(PHY,"pusch_config_common.pusch_HoppingOffset = %d\n",fp->pusch_config_common.pusch_HoppingOffset);
fp->pusch_config_common.enable64QAM = 0;//radioResourceConfigCommon->pusch_ConfigCommon.pusch_ConfigBasic.enable64QAM;
LOG_I(PHY,"pusch_config_common.enable64QAM = %d\n",fp->pusch_config_common.enable64QAM );
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 0;
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
if (cfg->uplink_reference_signal_config.uplink_rs_hopping.value == 1)
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1;
if (cfg->uplink_reference_signal_config.uplink_rs_hopping.value == 2)
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 1;
LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled);
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = cfg->uplink_reference_signal_config.group_assignment.value;
LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH);
LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled);
fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = dmrs1_tab[cfg->uplink_reference_signal_config.cyclic_shift_1_for_drms.value];
LOG_I(PHY,"pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = %d\n",fp->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift);
init_ul_hopping(fp);
fp->soundingrs_ul_config_common.enabled_flag = 1;
fp->soundingrs_ul_config_common.srs_BandwidthConfig = cfg->srs_config.bandwidth_configuration.value;
fp->soundingrs_ul_config_common.srs_SubframeConfig = cfg->srs_config.srs_subframe_configuration.value;
fp->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission = cfg->srs_config.srs_acknack_srs_simultaneous_transmission.value;
fp->soundingrs_ul_config_common.srs_MaxUpPts = cfg->srs_config.max_up_pts.value;
init_ncs_cell(fp,RC.eNB[Mod_id][CC_id]->ncs_cell);
init_ul_hopping(fp);
} }
void phy_config_sib1_ue(uint8_t Mod_id,int CC_id, void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
...@@ -140,6 +207,7 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id, ...@@ -140,6 +207,7 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
fp->SIPeriod = SIperiod; fp->SIPeriod = SIperiod;
} }
/*
void phy_config_sib2_eNB(uint8_t Mod_id, void phy_config_sib2_eNB(uint8_t Mod_id,
int CC_id, int CC_id,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon, RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
...@@ -157,7 +225,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id, ...@@ -157,7 +225,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
LOG_I(PHY,"[eNB%d] CCid %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id); LOG_I(PHY,"[eNB%d] CCid %d: Applying radioResourceConfigCommon\n",Mod_id,CC_id);
fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex; fp->prach_config_common.rootSequenceIndex = radioResourceConfigCommon->prach_Config.rootSequenceIndex;
LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",fp->prach_config_common.rootSequenceIndex ); LOG_D(PHY,"prach_config_common.rootSequenceIndex = %d\n",fp->prach_config_common.rootSequenceIndex );
fp->prach_config_common.prach_Config_enabled=1; fp->prach_config_common.prach_Config_enabled=1;
...@@ -280,7 +348,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id, ...@@ -280,7 +348,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
// //
} }
*/
void phy_config_sib2_ue(uint8_t Mod_id,int CC_id, void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
uint8_t eNB_id, uint8_t eNB_id,
...@@ -700,6 +768,7 @@ void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n ...@@ -700,6 +768,7 @@ void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n
} }
/*
void phy_config_dedicated_eNB(uint8_t Mod_id, void phy_config_dedicated_eNB(uint8_t Mod_id,
int CC_id, int CC_id,
uint16_t rnti, uint16_t rnti,
...@@ -761,6 +830,8 @@ void phy_config_dedicated_eNB(uint8_t Mod_id, ...@@ -761,6 +830,8 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,
} }
} }
*/
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
void phy_config_dedicated_scell_ue(uint8_t Mod_id, void phy_config_dedicated_scell_ue(uint8_t Mod_id,
uint8_t eNB_index, uint8_t eNB_index,
...@@ -769,6 +840,7 @@ void phy_config_dedicated_scell_ue(uint8_t Mod_id, ...@@ -769,6 +840,7 @@ void phy_config_dedicated_scell_ue(uint8_t Mod_id,
{ {
} }
/*
void phy_config_dedicated_scell_eNB(uint8_t Mod_id, void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
uint16_t rnti, uint16_t rnti,
SCellToAddMod_r10_t *sCellToAddMod_r10, SCellToAddMod_r10_t *sCellToAddMod_r10,
...@@ -785,27 +857,41 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, ...@@ -785,27 +857,41 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) { if ((dl_CarrierFreq_r10>=36000) && (dl_CarrierFreq_r10<=36199)) {
carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1 carrier_freq_local = 1900000000 + (dl_CarrierFreq_r10-36000)*100000; //band 33 from 3GPP 36.101 v 10.9 Table 5.7.3-1
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id); LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,
//eNB->frame
0,
CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
} else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) { } else if ((dl_CarrierFreq_r10>=6150) && (dl_CarrierFreq_r10<=6449)) {
carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1 carrier_freq_local = 832000000 + (dl_CarrierFreq_r10-6150)*100000; //band 20 from 3GPP 36.101 v 10.9 Table 5.7.3-1
// this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band // this is actually for the UL only, but we use it for DL too, since there is no TDD mode for this band
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id); LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %ld) for UE %d\n",Mod_id,
//eNB->frame
0,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
} else { } else {
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id,/*eNB->frame*/0,dl_CarrierFreq_r10,CC_id,UE_id); LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %ld of SCell %d for UE %d not supported\n",Mod_id,
//eNB->frame
0,dl_CarrierFreq_r10,CC_id,UE_id);
} }
if (physicalConfigDedicatedSCell_r10) { if (physicalConfigDedicatedSCell_r10) {
//#warning " eNB->physicalConfigDedicatedSCell_r10 does not exist in eNB" //#warning " eNB->physicalConfigDedicatedSCell_r10 does not exist in eNB"
// eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10; // eNB->physicalConfigDedicatedSCell_r10[UE_id] = physicalConfigDedicatedSCell_r10;
LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,/*eNB->frame*/0,CC_id,UE_id); LOG_I(PHY,"[eNB %d] Frame %d: Configured phyConfigDedicatedSCell with CC_id %d for UE %d\n",Mod_id,
//eNB->frame
0,CC_id,UE_id);
} else { } else {
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, /*eNB->frame*/0,CC_id,UE_id); LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id,
//eNB->frame
0,CC_id,UE_id);
return; return;
} }
} }
*/
#endif #endif
void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
uint16_t max_harq_tx ) uint16_t max_harq_tx )
{ {
...@@ -1533,6 +1619,7 @@ int phy_init_RU(RU_t *ru) { ...@@ -1533,6 +1619,7 @@ int phy_init_RU(RU_t *ru) {
} }
ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti ); ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_tti );
return(0);
} }
int phy_init_lte_eNB(PHY_VARS_eNB *eNB, int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
...@@ -1547,7 +1634,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB, ...@@ -1547,7 +1634,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LTE_eNB_SRS* const srs_vars = eNB->srs_vars; LTE_eNB_SRS* const srs_vars = eNB->srs_vars;
LTE_eNB_PRACH* const prach_vars = &eNB->prach_vars; LTE_eNB_PRACH* const prach_vars = &eNB->prach_vars;
int i, j, eNB_id, UE_id; int i, eNB_id, UE_id;
eNB->total_dlsch_bitrate = 0; eNB->total_dlsch_bitrate = 0;
......
...@@ -55,8 +55,7 @@ void lte_param_init(unsigned char N_tx_port_eNB, ...@@ -55,8 +55,7 @@ void lte_param_init(unsigned char N_tx_port_eNB,
UE = malloc(sizeof(PHY_VARS_UE)); UE = malloc(sizeof(PHY_VARS_UE));
memset((void*)eNB,0,sizeof(PHY_VARS_eNB)); memset((void*)eNB,0,sizeof(PHY_VARS_eNB));
memset((void*)UE,0,sizeof(PHY_VARS_UE)); memset((void*)UE,0,sizeof(PHY_VARS_UE));
//PHY_config = malloc(sizeof(PHY_CONFIG));
mac_xface = malloc(sizeof(MAC_xface));
srand(0); srand(0);
randominit(0);