Commit 1ae40bac authored by knopp's avatar knopp
Browse files

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5698 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 20df6d26
......@@ -79,29 +79,33 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1. From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
@param Mod_id Instance ID of eNB
@param CC_id Component Carrier index
@param tdd_Config TDD UL/DL and S-subframe configurations
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
void phy_config_sib1_eNB(module_id_t Mod_id,
TDD_Config_t *tdd_Config,
int CC_id,
TDD_Config_t *tdd_Config,
uint8_t SIwindowsize,
uint16_t SIperiod);
/** \brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB1. From a PHY perspective this allows configuration of TDD framing parameters and SI reception.
@param Mod_id Instance ID of UE
@param CC_id Component Carrier index
@param CH_index Index of eNB for this configuration
@param tdd_Config TDD UL/DL and S-subframe configurations
@param SIwindowsize Size of a SI window in frames where repetitions of a unique System Information message block is repeated
@param SIperiod Periodicity of System Information Messages (in multiples of a frame)*/
void phy_config_sib1_ue(module_id_t Mod_id,
uint8_t CH_index,
int CC_id,
uint8_t CH_index,
TDD_Config_t *tdd_Config,
uint8_t SIwindowsize,
uint16_t SIperiod);
/*!
\fn void phy_config_sib2_ue(module_id_t Mod_id,uint8_t CH_index,
\fn void phy_config_sib2_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
......@@ -109,15 +113,18 @@ void phy_config_sib1_ue(module_id_t Mod_id,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
\brief Configure LTE_DL_FRAME_PARMS with components derived after reception of SIB2 (at UE).
@param Mod_id Instance id
@param CC_id
@param CH_index Index of CH to which UE is connected
@param CC_id Component Carrier Index
@param radioResourceConfigCommon Radio Configuration from SIB2
@param ul_CarrierFreq UL carrier ARFCN, null if optional (i.e. implicit from DL)
@param ul_Bandwidth UL bandwidth, null if optional (i.e. same as DL)
@param additionalSpectrumEmission UL parameter (see 36.101)
@param mbsfn_SubframeConfigList MBSFN subframe configuration
*/
void phy_config_sib2_ue(module_id_t Mod_id,
uint8_t CH_index,
void phy_config_sib2_ue(module_id_t Mod_id,
int CC_id,
uint8_t CH_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
......@@ -129,12 +136,14 @@ void phy_config_sib2_ue(module_id_t Mod_id,
\fn phy_config_afterHO_ue
\brief Configure Common PHY parameters from mobilityControlInfo
@param Mod_id
@param CC_id
@param eNB_index
@param mobilityControlInfo pointer to the mobility control information for handover
@param ho_failed flag to indicated whether the ho was successful or not
*/
void phy_config_afterHO_ue(module_id_t Mod_id,
uint8_t eNB_index,
int CC_id,
uint8_t eNB_index,
MobilityControlInfo_t *mobilityControlInfo,
uint8_t ho_failed);
/*!
......@@ -146,14 +155,16 @@ void phy_config_afterHO_ue(module_id_t Mod_id,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
\brief Configure LTE_DL_FRAME_PARMS with components of SIB2 (at eNB).
@param Mod_id Instance id
@param Mod_id Component Carrier index
@param radioResourceConfigCommon Radio Configuration from SIB2
@param ul_CarrierFreq UL carrier ARFCN, null if optional (i.e. implicit from DL)
@param ul_Bandwidth UL bandwidth, null if optional (i.e. same as DL)
@param additionalSpectrumEmission UL parameter (see 36.101)
@param mbsfn_SubframeConfigList MBSFN subframe configuration
*/
void phy_config_sib2_eNB(module_id_t Mod_id,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
void phy_config_sib2_eNB(module_id_t Mod_id,
int CC_id,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
......@@ -161,59 +172,67 @@ void phy_config_sib2_eNB(module_id_t Mod_id,
/*!
\fn void phy_config_dedicated_ue(module_id_t Mod_id,uint8_t CH_index,
\fn void phy_config_dedicated_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated)
\brief Configure UE dedicated parameters. Invoked upon reception of RRCConnectionSetup or RRCConnectionReconfiguration from eNB.
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier index
@param CH_index Index of eNB for this configuration
@param physicalConfigDedicated PHY Configuration information
*/
void phy_config_dedicated_ue(module_id_t Mod_id,
int CC_id,
uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated);
/**
\brief Configure UE MBSFN common parameters. Invoked upon reception of SIB13 from eNB.
@param Mod_id Instance ID for UE
@param CC_id Component Carrier Index
@param CH_index eNB id (for multiple eNB reception)
@param mbsfn_Area_idx Index of MBSFN-Area for which this command operates
@param mbsfn_AreaId_r9 MBSFN-Area Id
*/
void phy_config_sib13_ue(module_id_t Mod_id,
uint8_t CH_index,int mbsfn_Area_idx,
int CC_id,uint8_t CH_index,int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
/**
\brief Configure eNB MBSFN common parameters. Invoked upon transmission of SIB13 from eNB.
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier index
@param mbsfn_Area_idx Index of MBSFN-Area for which this command operates
@param mbsfn_AreaId_r9 MBSFN-Area Id
*/
void phy_config_sib13_eNB(module_id_t Mod_id,
int CC_id,
int mbsfn_Area_idx,
long mbsfn_AreaId_r9);
/**
\brief Configure cba rnti for .
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier Index
@param eNB_flag flag indicating whether the nodeis eNB (1) or UE (0)
@param index index of the node
@param cba_rnti rnti for the cba transmission
@param num_active_cba_groups num active cba group
*/
void phy_config_cba_rnti (module_id_t Mod_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
void phy_config_dedicated_ue(module_id_t Mod_id,
uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated);
void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups);
/** \brief Configure RRC inter-cell measurements procedures
@param Mod_id Index of UE
@param CC_id
@param eNB_index Index of corresponding eNB
@param n_adj_cells Number of adjacent cells on which to perform the measuremnts
@param adj_cell_id Array of cell ids of adjacent cells
*/
void phy_config_meas_ue(module_id_t Mod_id,
uint8_t eNB_index,
int CC_id,
uint8_t eNB_index,
uint8_t n_adj_cells,
uint32_t *adj_cell_id);
......@@ -222,11 +241,13 @@ void phy_config_meas_ue(module_id_t Mod_id,
struct PhysicalConfigDedicated *physicalConfigDedicated)
\brief Prepare for configuration of PHY with dedicated parameters. Invoked just prior to transmission of RRCConnectionSetup or RRCConnectionReconfiguration at eNB.
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier index
@param rnti rnti for UE context
@param physicalConfigDedicated PHY Configuration information
*/
void phy_config_dedicated_eNB(module_id_t Mod_id,
rnti_t rnti,
int CC_id,
rnti_t rnti,
struct PhysicalConfigDedicated *physicalConfigDedicated);
/*!
......
......@@ -44,11 +44,12 @@ void phy_config_mib(LTE_DL_FRAME_PARMS *lte_frame_parms,
}
void phy_config_sib1_eNB(uint8_t Mod_id,
int CC_id,
TDD_Config_t *tdd_Config,
uint8_t SIwindowsize,
uint16_t SIPeriod) {
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id]->lte_frame_parms;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms;
if (tdd_Config) {
lte_frame_parms->tdd_config = tdd_Config->subframeAssignment;
......@@ -58,12 +59,13 @@ void phy_config_sib1_eNB(uint8_t Mod_id,
lte_frame_parms->SIPeriod = SIPeriod;
}
void phy_config_sib1_ue(uint8_t Mod_id,uint8_t CH_index,
TDD_Config_t *tdd_Config,
uint8_t SIwindowsize,
uint16_t SIperiod) {
void phy_config_sib1_ue(uint8_t Mod_id,int CC_id,
uint8_t CH_index,
TDD_Config_t *tdd_Config,
uint8_t SIwindowsize,
uint16_t SIperiod) {
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id]->lte_frame_parms;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms;
if (tdd_Config) {
lte_frame_parms->tdd_config = tdd_Config->subframeAssignment;
lte_frame_parms->tdd_config_S = tdd_Config->specialSubframePatterns;
......@@ -73,16 +75,17 @@ void phy_config_sib1_ue(uint8_t Mod_id,uint8_t CH_index,
}
void phy_config_sib2_eNB(uint8_t Mod_id,
int CC_id,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CArrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList) {
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id]->lte_frame_parms;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms;
int i;
LOG_D(PHY,"[eNB%d] Frame %d: Applying radioResourceConfigCommon\n",Mod_id,PHY_vars_eNB_g[Mod_id]->proc[8].frame_tx);
LOG_D(PHY,"[eNB%d] Frame %d: Applying radioResourceConfigCommon\n",Mod_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[8].frame_tx);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
lte_frame_parms->prach_config_common.prach_Config_enabled=1;
......@@ -92,7 +95,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
lte_frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
compute_prach_seq(&lte_frame_parms->prach_config_common,lte_frame_parms->frame_type,
PHY_vars_eNB_g[Mod_id]->X_u);
PHY_vars_eNB_g[Mod_id][CC_id]->X_u);
lte_frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
lte_frame_parms->pucch_config_common.nRB_CQI = radioResourceConfigCommon->pucch_ConfigCommon.nRB_CQI;
......@@ -163,7 +166,7 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
// PUCCH
init_ncs_cell(lte_frame_parms,PHY_vars_eNB_g[Mod_id]->ncs_cell);
init_ncs_cell(lte_frame_parms,PHY_vars_eNB_g[Mod_id][CC_id]->ncs_cell);
init_ul_hopping(lte_frame_parms);
......@@ -198,19 +201,20 @@ void phy_config_sib2_eNB(uint8_t Mod_id,
}
void phy_config_sib2_ue(uint8_t Mod_id,uint8_t CH_index,
void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
uint8_t CH_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList) {
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id]->lte_frame_parms;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms;
int i;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_CONFIG_SIB2, VCD_FUNCTION_IN);
LOG_I(PHY,"[UE%d] Frame %d: Applying radioResourceConfigCommon from eNB%d\n",Mod_id,PHY_vars_UE_g[Mod_id]->frame,CH_index);
LOG_I(PHY,"[UE%d] Frame %d: Applying radioResourceConfigCommon from eNB%d\n",Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame,CH_index);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
......@@ -220,7 +224,8 @@ void phy_config_sib2_ue(uint8_t Mod_id,uint8_t CH_index,
lte_frame_parms->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
lte_frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
compute_prach_seq(&lte_frame_parms->prach_config_common,lte_frame_parms->frame_type,PHY_vars_UE_g[Mod_id]->X_u);
compute_prach_seq(&lte_frame_parms->prach_config_common,lte_frame_parms->frame_type,PHY_vars_UE_g[Mod_id][CC_id]->X_u);
lte_frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon.deltaPUCCH_Shift;
......@@ -274,7 +279,7 @@ lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioRes
// Now configure some of the Physical Channels
// PUCCH
init_ncs_cell(lte_frame_parms,PHY_vars_UE_g[Mod_id]->ncs_cell);
init_ncs_cell(lte_frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
init_ul_hopping(lte_frame_parms);
......@@ -309,38 +314,38 @@ lte_frame_parms->ul_power_control_config_common.deltaF_PUCCH_Format1 = radioRes
}
void phy_config_sib13_ue(uint8_t Mod_id,uint8_t CH_index,int mbsfn_Area_idx,
void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t CH_index,int mbsfn_Area_idx,
long mbsfn_AreaId_r9) {
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id]->lte_frame_parms;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms;
LOG_I(PHY,"[UE%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_UE_g[Mod_id]->frame,mbsfn_AreaId_r9,mbsfn_Area_idx);
LOG_I(PHY,"[UE%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
lte_frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
}
lte_gold_mbsfn(lte_frame_parms,PHY_vars_UE_g[Mod_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn);
lte_gold_mbsfn(lte_frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn);
}
void phy_config_sib13_eNB(uint8_t Mod_id,int mbsfn_Area_idx,
void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
long mbsfn_AreaId_r9) {
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id]->lte_frame_parms;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_eNB_g[Mod_id][CC_id]->lte_frame_parms;
LOG_I(PHY,"[eNB%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_eNB_g[Mod_id]->proc[8].frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
LOG_I(PHY,"[eNB%d] Frame %d: Applying MBSFN_Area_id %d for index %d\n",Mod_id,PHY_vars_eNB_g[Mod_id][CC_id]->proc[8].frame_tx,mbsfn_AreaId_r9,mbsfn_Area_idx);
if (mbsfn_Area_idx == 0) {
lte_frame_parms->Nid_cell_mbsfn = (uint16_t)mbsfn_AreaId_r9;
LOG_N(PHY,"Fix me: only called when mbsfn_Area_idx == 0)\n");
}
lte_gold_mbsfn(lte_frame_parms,PHY_vars_eNB_g[Mod_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn);
lte_gold_mbsfn(lte_frame_parms,PHY_vars_eNB_g[Mod_id][CC_id]->lte_gold_mbsfn_table,lte_frame_parms->Nid_cell_mbsfn);
}
......@@ -439,24 +444,24 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *phy_vars_eNB) {
/*
* Configures UE MAC and PHY with radioResourceCommon received in mobilityControlInfo IE during Handover
*/
void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t eNB_id, MobilityControlInfo_t *mobilityControlInfo, uint8_t ho_failed) {
void phy_config_afterHO_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, MobilityControlInfo_t *mobilityControlInfo, uint8_t ho_failed) {
if(mobilityControlInfo!=NULL) {
RadioResourceConfigCommon_t *radioResourceConfigCommon = &mobilityControlInfo->radioResourceConfigCommon;
LOG_I(PHY,"radioResourceConfigCommon %p\n", radioResourceConfigCommon);
memcpy((void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms_before_ho,
(void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms,
memcpy((void *)&PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms_before_ho,
(void *)&PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms,
sizeof(LTE_DL_FRAME_PARMS));
PHY_vars_UE_g[Mod_id]->ho_triggered = 1;
PHY_vars_UE_g[Mod_id][CC_id]->ho_triggered = 1;
//PHY_vars_UE_g[UE_id]->UE_mode[0] = PRACH;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id]->lte_frame_parms;
LTE_DL_FRAME_PARMS *lte_frame_parms = &PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms;
// int N_ZC;
// uint8_t prach_fmt;
// int u;
LOG_I(PHY,"[UE%d] Frame %d: Handover triggered: Applying radioResourceConfigCommon from eNB %d\n",
Mod_id,PHY_vars_UE_g[Mod_id]->frame,eNB_id);
Mod_id,PHY_vars_UE_g[Mod_id][CC_id]->frame,eNB_id);
lte_frame_parms->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
lte_frame_parms->prach_config_common.prach_Config_enabled=1;
......@@ -471,9 +476,9 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t eNB_id, MobilityControlInfo_t
// prach_root_sequence_map4[lte_frame_parms->prach_config_common.rootSequenceIndex];
//compute_prach_seq(u,N_ZC, PHY_vars_UE_g[Mod_id]->X_u);
compute_prach_seq(&PHY_vars_UE_g[Mod_id]->lte_frame_parms.prach_config_common,
compute_prach_seq(&PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms.prach_config_common,
lte_frame_parms->frame_type,
PHY_vars_UE_g[Mod_id]->X_u);
PHY_vars_UE_g[Mod_id][CC_id]->X_u);
lte_frame_parms->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
......@@ -533,41 +538,43 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t eNB_id, MobilityControlInfo_t
lte_frame_parms->nushift = lte_frame_parms->Nid_cell%6;
// PUCCH
init_ncs_cell(lte_frame_parms,PHY_vars_UE_g[Mod_id]->ncs_cell);
init_ncs_cell(lte_frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->ncs_cell);
init_ul_hopping(lte_frame_parms);
// RNTI
PHY_vars_UE_g[Mod_id]->lte_ue_pdcch_vars[eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8);
PHY_vars_UE_g[Mod_id][CC_id]->lte_ue_pdcch_vars[eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8);
}
if(ho_failed) {
LOG_D(PHY,"[UE%d] Handover failed, triggering RACH procedure\n",Mod_id);
memcpy((void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms,(void *)&PHY_vars_UE_g[Mod_id]->lte_frame_parms_before_ho, sizeof(LTE_DL_FRAME_PARMS));
PHY_vars_UE_g[Mod_id]->UE_mode[eNB_id] = PRACH;
memcpy((void *)&PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms,(void *)&PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms_before_ho, sizeof(LTE_DL_FRAME_PARMS));
PHY_vars_UE_g[Mod_id][CC_id]->UE_mode[eNB_id] = PRACH;
}
}
void phy_config_meas_ue(uint8_t Mod_id,uint8_t eNB_index,uint8_t n_adj_cells,unsigned int *adj_cell_id) {
void phy_config_meas_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_index,uint8_t n_adj_cells,unsigned int *adj_cell_id) {
PHY_MEASUREMENTS *phy_meas = &PHY_vars_UE_g[Mod_id]->PHY_measurements;
PHY_MEASUREMENTS *phy_meas = &PHY_vars_UE_g[Mod_id][CC_id]->PHY_measurements;
int i;
LOG_I(PHY,"Configuring inter-cell measurements for %d cells, ids: \n",n_adj_cells);
for (i=0;i<n_adj_cells;i++) {
LOG_I(PHY,"%d\n",adj_cell_id[i]);
lte_gold(&PHY_vars_UE_g[Mod_id]->lte_frame_parms,PHY_vars_UE_g[Mod_id]->lte_gold_table[i+1],adj_cell_id[i]);
lte_gold(&PHY_vars_UE_g[Mod_id][CC_id]->lte_frame_parms,PHY_vars_UE_g[Mod_id][CC_id]->lte_gold_table[i+1],adj_cell_id[i]);
}
phy_meas->n_adj_cells = n_adj_cells;
memcpy((void*)phy_meas->adj_cell_id,(void *)adj_cell_id,n_adj_cells*sizeof(unsigned int));
}
void phy_config_dedicated_eNB(uint8_t Mod_id,uint16_t rnti,
void phy_config_dedicated_eNB(uint8_t Mod_id,
int CC_id,
uint16_t rnti,
struct PhysicalConfigDedicated *physicalConfigDedicated) {
PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id];
PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
uint8_t UE_id = find_ue(rnti,phy_vars_eNB);
......@@ -582,11 +589,79 @@ void phy_config_dedicated_eNB(uint8_t Mod_id,uint16_t rnti,
}
}
#ifdef Rel10
void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
uint16_t rnti,
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_id) {
PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[Mod_id][CC_id];
u8 UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][0]);
struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10 = sCellToAddMod_r10->radioResourceConfigDedicatedSCell_r10->physicalConfigDedicatedSCell_r10;
//struct RadioResourceConfigCommonSCell_r10 *physicalConfigCommonSCell_r10 = sCellToAddMod_r10->radioResourceConfigCommonSCell_r10;
PhysCellId_t physCellId_r10 = sCellToAddMod_r10->cellIdentification_r10->physCellId_r10;
ARFCN_ValueEUTRA_t dl_CarrierFreq_r10 = sCellToAddMod_r10->cellIdentification_r10->dl_CarrierFreq_r10;
u32 carrier_freq_local;
#ifdef EXMIMO
#ifdef DRIVER2013
exmimo_config_t *p_exmimo_config = openair0_exmimo_pci[card].exmimo_config_ptr;
#endif
#endif
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
LOG_I(PHY,"[eNB %d] Frame %d: Configured SCell %d to frequency %d (ARFCN %d) for UE %d\n",Mod_id,phy_vars_eNB->frame,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
#ifdef EXMIMO
#ifdef DRIVER2013
carrier_freq[CC_id] = carrier_freq_local;
openair_daq_vars.freq_offset = -6540;
p_exmimo_config->rf.rf_freq_rx[CC_id] = carrier_freq[CC_id]+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.rf_freq_tx[CC_id] = carrier_freq[CC_id]+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.tx_gain[CC_id][0] = 25;
p_exmimo_config->rf.rf_vcocal[CC_id] = 910;
p_exmimo_config->rf.rf_local[CC_id] = 8255063; //this should be taken form calibration file
p_exmimo_config->rf.rffe_band_mode[CC_id] = B19G_TDD;
#endif
#endif
}
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
// 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 %d) for UE %d\n",Mod_id,phy_vars_eNB->frame,CC_id,carrier_freq_local,dl_CarrierFreq_r10,UE_id);
#ifdef EXMIMO
#ifdef DRIVER2013
carrier_freq[CC_id] = carrier_freq_local;
openair_daq_vars.freq_offset = -2000;
p_exmimo_config->rf.rf_freq_rx[CC_id] = carrier_freq[CC_id]+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.rf_freq_tx[CC_id] = carrier_freq[CC_id]+openair_daq_vars.freq_offset2;
p_exmimo_config->rf.tx_gain[CC_id][0] = 10;
p_exmimo_config->rf.rf_vcocal[CC_id] = 2015;
p_exmimo_config->rf.rf_local[CC_id] = 8254992; //this should be taken form calibration file
p_exmimo_config->rf.rffe_band_mode[CC_id] = DD_TDD;
#endif
#endif
}
else {
LOG_E(PHY,"[eNB %d] Frame %d: ARFCN %d of SCell %d for UE %d not supported\n",Mod_id,phy_vars_eNB->frame,dl_CarrierFreq_r10,CC_id,UE_id);
}
if (physicalConfigDedicatedSCell_r10) {
phy_vars_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,phy_vars_eNB->frame,CC_id,UE_id);
}
else {
LOG_E(PHY,"[eNB %d] Frame %d: Received NULL radioResourceConfigDedicated (CC_id %d, UE %d)\n",Mod_id, phy_vars_eNB->frame,CC_id,UE_id);
return;
}
}
#endif
void phy_config_dedicated_ue(uint8_t Mod_id,uint8_t CH_index,
void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated ) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
phy_vars_ue->total_TBS[CH_index]=0;
phy_vars_ue->total_TBS_last[CH_index]=0;
......@@ -692,18 +767,18 @@ void phy_config_dedicated_ue(uint8_t Mod_id,uint8_t CH_index,
}
void phy_config_cba_rnti (module_id_t Mod_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups){
void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups){
// uint8_t i;
if (eNB_flag == 0 ) {
//LOG_D(PHY,"[UE %d] configure cba group %d with rnti %x, num active cba grp %d\n", index, index, cba_rnti, num_active_cba_groups);
PHY_vars_UE_g[Mod_id]->ulsch_ue[index]->num_active_cba_groups=num_active_cba_groups;
PHY_vars_UE_g[Mod_id]->ulsch_ue[index]->cba_rnti[cba_group_id]=cba_rnti;
PHY_vars_UE_g[Mod_id][CC_id]->ulsch_ue[index]->num_active_cba_groups=num_active_cba_groups;
PHY_vars_UE_g[Mod_id][CC_id]->ulsch_ue[index]->cba_rnti[cba_group_id]=cba_rnti;
}else {
//for (i=index; i < NUMBER_OF_UE_MAX; i+=num_active_cba_groups){
// LOG_D(PHY,"[eNB %d] configure cba group %d with rnti %x for UE %d, num active cba grp %d\n",Mod_id, i%num_active_cba_groups, cba_rnti, i, num_active_cba_groups);
PHY_vars_eNB_g[Mod_id]->ulsch_eNB[index]->num_active_cba_groups=num_active_cba_groups;
PHY_vars_eNB_g[Mod_id]->ulsch_eNB[index]->cba_rnti[cba_group_id] = cba_rnti;
PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[index]->num_active_cba_groups=num_active_cba_groups;
PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[index]->cba_rnti[cba_group_id] = cba_rnti;
//}
}
}
......
......@@ -155,14 +155,14 @@ void lte_ue_measurements_emul(PHY_VARS_UE *phy_vars_ue,uint8_t last_slot,uint8_t
@param eNB_index Index of eNB on which to act
@returns Path loss in dB
*/
int16_t get_PL(module_id_t Mod_id,uint8_t eNB_index);
uint8_t get_RSRP(module_id_t Mod_id,uint8_t eNB_index);
uint8_t get_RSRQ(module_id_t Mod_id,uint8_t eNB_index);
uint8_t get_n_adj_cells(module_id_t Mod_id);
int8_t get_rx_total_gain_dB(module_id_t Mod_id);
int8_t get_RSSI(module_id_t Mod_id);
int8_t set_RSRP_filtered(module_id_t Mod_id,uint8_t eNB_index,float rsrp);
int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t eNB_index,float rstq);
int16_t get_PL(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint8_t get_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint8_t get_RSRQ(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint8_t get_n_adj_cells(module_id_t Mod_id,uint8_t CC_id);
int8_t get_rx_total_gain_dB(module_id_t Mod_id,uint8_t CC_id);
int8_t get_RSSI(module_id_t Mod_id,uint8_t CC_id);
int8_t set_RSRP_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rstq);
//! Automatic gain control
void phy_adjust_gain (PHY_VARS_UE *phy_vars_ue,
......
......@@ -480,12 +480,13 @@ int lte_sync_time_eNB_emul(PHY_VARS_eNB *phy_vars_eNB,
int32_t *sync_val) {
uint8_t UE_id;
uint8_t CC_id = phy_vars_eNB->CC_id;
msg("[PHY] EMUL lte_sync_time_eNB_emul eNB %d, sect_id %d\n",phy_vars_eNB->Mod_id,sect_id);
*sync_val = 0;
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
//msg("[PHY] EMUL : eNB %d checking UE %d (PRACH %d) PL %d dB\n",phy_vars_eNB->Mod_id,UE_id,PHY_vars_UE_g[UE_id]->generate_prach,UE2eNB[UE_id][phy_vars_eNB->Mod_id]->path_loss_dB);
if ((PHY_vars_UE_g[UE_id]->generate_prach == 1) && (phy_vars_eNB->Mod_id == (UE_id % NB_eNB_INST))) {
if ((PHY_vars_UE_g[UE_id][CC_id]->generate_prach == 1) && (phy_vars_eNB->Mod_id == (UE_id % NB_eNB_INST))) {
*sync_val = 1;
return(0);
}
......
......@@ -50,9 +50,9 @@ __m128i mmtmpPMI1 __attribute__ ((aligned(16)));
__m128i mmtmpPMI2 __attribute__ ((aligned(16)));
__m128i mmtmpPMI3 __attribute__ ((aligned(16)));
int16_t get_PL(uint8_t Mod_id,uint8_t eNB_index) {
int16_t get_PL(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
int RSoffset;
LOG_D(PHY,"get_PL : Frame %d : rssi %d, eNB power %d\n", phy_vars_ue->frame,
......@@ -69,50 +69,50 @@ int16_t get_PL(uint8_t Mod_id,uint8_t eNB_index) {
}
uint8_t get_n_adj_cells (uint8_t Mod_id){
uint8_t get_n_adj_cells (uint8_t Mod_id,uint8_t CC_id){
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id];
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
if (phy_vars_ue)