Merge branch 'RU-RAU-split' of https://gitlab.eurecom.fr/raymond.knopp/openairinterface5g into RU-RAU-split

Conflicts:
	openair1/PHY/LTE_TRANSPORT/edci.c
	openair2/LAYER2/MAC/eNB_scheduler_RA.c
This commit is contained in:
Raymond Knopp
2017-11-05 05:26:01 -08:00
7 changed files with 8230 additions and 9041 deletions
+94 -126
View File
@@ -39,7 +39,9 @@ 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 };
int l1_north_init_eNB() { int
l1_north_init_eNB ()
{
int i, j; int i, j;
AssertFatal (RC.nb_L1_inst > 0, "nb_L1_inst=%d\n", RC.nb_L1_inst); AssertFatal (RC.nb_L1_inst > 0, "nb_L1_inst=%d\n", RC.nb_L1_inst);
@@ -50,7 +52,8 @@ int l1_north_init_eNB() {
AssertFatal (RC.nb_L1_CC[i] > 0, "RC.nb_L1_CC[%d]=%d\n", i, RC.nb_L1_CC[i]); AssertFatal (RC.nb_L1_CC[i] > 0, "RC.nb_L1_CC[%d]=%d\n", i, RC.nb_L1_CC[i]);
for (j = 0; j < RC.nb_L1_CC[i]; j++) { 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); 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); 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->PHY_config_req = phy_config_request;
RC.eNB[i][j]->if_inst->schedule_response = schedule_response; RC.eNB[i][j]->if_inst->schedule_response = schedule_response;
} }
@@ -60,7 +63,9 @@ int l1_north_init_eNB() {
void phy_config_request(PHY_Config_t *phy_config) { void
phy_config_request (PHY_Config_t * phy_config)
{
uint8_t Mod_id = phy_config->Mod_id; uint8_t Mod_id = phy_config->Mod_id;
int CC_id = phy_config->CC_id; int CC_id = phy_config->CC_id;
@@ -77,9 +82,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
uint32_t dl_CarrierFreq = cfg->nfapi_config.earfcn.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", 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, 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);
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 != 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] != NULL, "PHY instance %d doesn't exist\n", Mod_id);
@@ -125,8 +128,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
fp->tdd_config = cfg->tdd_frame_structure_config.subframe_assignment.value; fp->tdd_config = cfg->tdd_frame_structure_config.subframe_assignment.value;
fp->tdd_config_S = cfg->tdd_frame_structure_config.special_subframe_patterns.value; fp->tdd_config_S = cfg->tdd_frame_structure_config.special_subframe_patterns.value;
fp->frame_type = TDD; fp->frame_type = TDD;
} } else {
else {
fp->frame_type = FDD; fp->frame_type = FDD;
} }
@@ -148,10 +150,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
init_prach_tables (839); init_prach_tables (839);
compute_prach_seq (fp->prach_config_common.rootSequenceIndex, compute_prach_seq (fp->prach_config_common.rootSequenceIndex,
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u);
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag,
fp->frame_type,
RC.eNB[Mod_id][CC_id]->X_u);
#ifdef Rel14 #ifdef Rel14
if (cfg->emtc_config.prach_ce_level_0_enable.value == 1) { if (cfg->emtc_config.prach_ce_level_0_enable.value == 1) {
@@ -178,9 +177,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex, compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[3]);
fp->frame_type,
RC.eNB[Mod_id][CC_id]->X_u_br[3]);
// CE Level 2 parameters // CE Level 2 parameters
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] = cfg->emtc_config.prach_ce_level_2_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[2] = cfg->emtc_config.prach_ce_level_2_enable.value;
@@ -196,9 +193,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex, compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[2]);
fp->frame_type,
RC.eNB[Mod_id][CC_id]->X_u_br[2]);
// CE Level 1 parameters // CE Level 1 parameters
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] = cfg->emtc_config.prach_ce_level_1_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[1] = cfg->emtc_config.prach_ce_level_1_enable.value;
@@ -215,9 +210,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex, compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[1]);
fp->frame_type,
RC.eNB[Mod_id][CC_id]->X_u_br[1]);
// CE Level 0 parameters // CE Level 0 parameters
fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] = cfg->emtc_config.prach_ce_level_0_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] = cfg->emtc_config.prach_ce_level_0_enable.value;
@@ -225,23 +218,20 @@ void phy_config_request(PHY_Config_t *phy_config) {
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] = cfg->emtc_config.prach_ce_level_0_number_of_repetitions_per_attempt.value;
AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] >= fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0] >= fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0],
"prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n", "prach_starting_subframe_periodicity[0] %d < prach_numPetitionPerPreambleAttempt[0] %d\n",
fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], fp->prach_emtc_config_common.prach_ConfigInfo.prach_starting_subframe_periodicity[0], fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]);
fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]); AssertFatal (fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0, "prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n");
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0,
"prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n");
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value;
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value;
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_enable[0] = cfg->emtc_config.prach_ce_level_0_hopping_enable.value;
fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0] = cfg->emtc_config.prach_ce_level_0_hopping_offset.value; fp->prach_emtc_config_common.prach_ConfigInfo.prach_hopping_offset[0] = cfg->emtc_config.prach_ce_level_0_hopping_offset.value;
if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) if (fp->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) {
compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex, compute_prach_seq (fp->prach_emtc_config_common.rootSequenceIndex,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3], fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[3],
fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, RC.eNB[Mod_id][CC_id]->X_u_br[0]);
fp->frame_type, init_mpdcch5tab_normal_regular_subframe_evenNRBDL (RC.eNB[Mod_id][CC_id],3);
RC.eNB[Mod_id][CC_id]->X_u_br[0]); }
} }
#endif #endif
@@ -298,11 +288,8 @@ void phy_config_request(PHY_Config_t *phy_config) {
LOG_I (PHY, "eNB %d/%d configured\n", Mod_id, CC_id); LOG_I (PHY, "eNB %d/%d configured\n", Mod_id, CC_id);
} }
void phy_config_sib1_ue(uint8_t Mod_id,int CC_id, void
uint8_t eNB_id, phy_config_sib1_ue (uint8_t Mod_id, int CC_id, uint8_t eNB_id, TDD_Config_t * tdd_Config, uint8_t SIwindowsize, uint16_t SIperiod)
TDD_Config_t *tdd_Config,
uint8_t SIwindowsize,
uint16_t SIperiod)
{ {
LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms; LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
@@ -459,13 +446,11 @@ void phy_config_sib1_ue(uint8_t Mod_id,int CC_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,
RadioResourceConfigCommonSIB_t * radioResourceConfigCommon, RadioResourceConfigCommonSIB_t * radioResourceConfigCommon,
ARFCN_ValueEUTRA_t *ul_CarrierFreq, ARFCN_ValueEUTRA_t * ul_CarrierFreq, long *ul_Bandwidth, AdditionalSpectrumEmission_t * additionalSpectrumEmission, struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList)
{ {
PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id]; PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
@@ -486,9 +471,7 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
compute_prach_seq (fp->prach_config_common.rootSequenceIndex, compute_prach_seq (fp->prach_config_common.rootSequenceIndex,
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, fp->prach_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, ue->X_u);
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag,
fp->frame_type,ue->X_u);
@@ -564,17 +547,14 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) { if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame) {
fp->MBSFN_config[i].fourFrames_flag = 0; fp->MBSFN_config[i].fourFrames_flag = 0;
fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration fp->MBSFN_config[i].mbsfn_SubframeConfig = mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0]; // 6-bit subframe configuration
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, LOG_I (PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, fp->MBSFN_config[i].mbsfn_SubframeConfig);
fp->MBSFN_config[i].mbsfn_SubframeConfig);
} else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration } else if (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.present == MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames) { // 24-bit subframe configuration
fp->MBSFN_config[i].fourFrames_flag = 1; fp->MBSFN_config[i].fourFrames_flag = 1;
fp->MBSFN_config[i].mbsfn_SubframeConfig = fp->MBSFN_config[i].mbsfn_SubframeConfig =
mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0] | mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[0] |
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1]<<8)| (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[1] << 8) | (mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2] << 16);
(mbsfn_SubframeConfigList->list.array[i]->subframeAllocation.choice.oneFrame.buf[2]<<16);
LOG_I(PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, LOG_I (PHY, "[CONFIG] MBSFN_SubframeConfig[%d] pattern is %d\n", i, fp->MBSFN_config[i].mbsfn_SubframeConfig);
fp->MBSFN_config[i].mbsfn_SubframeConfig);
} }
} }
} }
@@ -583,8 +563,8 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
} }
void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_Area_idx, void
long mbsfn_AreaId_r9) phy_config_sib13_ue (uint8_t Mod_id, int CC_id, uint8_t eNB_id, int mbsfn_Area_idx, long mbsfn_AreaId_r9)
{ {
LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms; LTE_DL_FRAME_PARMS *fp = &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms;
@@ -602,8 +582,8 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_Area_
} }
void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx, void
long mbsfn_AreaId_r9) phy_config_sib13_eNB (uint8_t Mod_id, int CC_id, int mbsfn_Area_idx, long mbsfn_AreaId_r9)
{ {
LTE_DL_FRAME_PARMS *fp = &RC.eNB[Mod_id][CC_id]->frame_parms; LTE_DL_FRAME_PARMS *fp = &RC.eNB[Mod_id][CC_id]->frame_parms;
@@ -620,7 +600,8 @@ void phy_config_sib13_eNB(uint8_t Mod_id,int CC_id,int mbsfn_Area_idx,
} }
void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB) void
phy_config_dedicated_eNB_step2 (PHY_VARS_eNB * eNB)
{ {
uint8_t UE_id; uint8_t UE_id;
@@ -743,15 +724,14 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
/* /*
* Configures UE MAC and PHY with radioResourceCommon received in mobilityControlInfo IE during Handover * Configures UE MAC and PHY with radioResourceCommon received in mobilityControlInfo IE during Handover
*/ */
void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, MobilityControlInfo_t *mobilityControlInfo, uint8_t ho_failed) void
phy_config_afterHO_ue (uint8_t Mod_id, uint8_t CC_id, uint8_t eNB_id, MobilityControlInfo_t * mobilityControlInfo, uint8_t ho_failed)
{ {
if (mobilityControlInfo != NULL) { if (mobilityControlInfo != NULL) {
RadioResourceConfigCommon_t *radioResourceConfigCommon = &mobilityControlInfo->radioResourceConfigCommon; RadioResourceConfigCommon_t *radioResourceConfigCommon = &mobilityControlInfo->radioResourceConfigCommon;
LOG_I (PHY, "radioResourceConfigCommon %p\n", radioResourceConfigCommon); LOG_I (PHY, "radioResourceConfigCommon %p\n", radioResourceConfigCommon);
memcpy((void *)&PHY_vars_UE_g[Mod_id][CC_id]->frame_parms_before_ho, memcpy ((void *) &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms_before_ho, (void *) &PHY_vars_UE_g[Mod_id][CC_id]->frame_parms, sizeof (LTE_DL_FRAME_PARMS));
(void *)&PHY_vars_UE_g[Mod_id][CC_id]->frame_parms,
sizeof(LTE_DL_FRAME_PARMS));
PHY_vars_UE_g[Mod_id][CC_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; //PHY_vars_UE_g[UE_id]->UE_mode[0] = PRACH;
@@ -760,8 +740,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
// uint8_t prach_fmt; // uint8_t prach_fmt;
// int u; // int u;
LOG_I(PHY,"[UE%d] Handover triggered: Applying radioResourceConfigCommon from eNB %d\n", LOG_I (PHY, "[UE%d] Handover triggered: Applying radioResourceConfigCommon from eNB %d\n", Mod_id, eNB_id);
Mod_id,eNB_id);
fp->prach_config_common.rootSequenceIndex = radioResourceConfigCommon->prach_Config.rootSequenceIndex; fp->prach_config_common.rootSequenceIndex = radioResourceConfigCommon->prach_Config.rootSequenceIndex;
fp->prach_config_common.prach_Config_enabled = 1; fp->prach_config_common.prach_Config_enabled = 1;
@@ -779,9 +758,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
compute_prach_seq (PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.rootSequenceIndex, compute_prach_seq (PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.rootSequenceIndex,
PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig, PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag, PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag, fp->frame_type, PHY_vars_UE_g[Mod_id][CC_id]->X_u);
fp->frame_type,
PHY_vars_UE_g[Mod_id][CC_id]->X_u);
fp->pucch_config_common.deltaPUCCH_Shift = 1 + radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift; fp->pucch_config_common.deltaPUCCH_Shift = 1 + radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
@@ -839,7 +816,6 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
fp->phich_config_common.phich_resource = radioResourceConfigCommon->phich_Config->phich_Resource; fp->phich_config_common.phich_resource = radioResourceConfigCommon->phich_Config->phich_Resource;
fp->phich_config_common.phich_duration = radioResourceConfigCommon->phich_Config->phich_Duration; fp->phich_config_common.phich_duration = radioResourceConfigCommon->phich_Config->phich_Duration;
} }
//Target CellId //Target CellId
fp->Nid_cell = mobilityControlInfo->targetPhysCellId; fp->Nid_cell = mobilityControlInfo->targetPhysCellId;
fp->nushift = fp->Nid_cell % 6; fp->nushift = fp->Nid_cell % 6;
@@ -855,8 +831,7 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0] | (mobilityControlInfo->newUE_Identity.buf[1] << 8); PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0] | (mobilityControlInfo->newUE_Identity.buf[1] << 8);
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0] | (mobilityControlInfo->newUE_Identity.buf[1] << 8); PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0] | (mobilityControlInfo->newUE_Identity.buf[1] << 8);
LOG_I(PHY,"SET C-RNTI %x %x\n",PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti, LOG_I (PHY, "SET C-RNTI %x %x\n", PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti, PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti);
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti);
} }
if (ho_failed) { if (ho_failed) {
@@ -866,7 +841,8 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
} }
} }
void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n_adj_cells,unsigned int *adj_cell_id) void
phy_config_meas_ue (uint8_t Mod_id, uint8_t 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][CC_id]->measurements; PHY_MEASUREMENTS *phy_meas = &PHY_vars_UE_g[Mod_id][CC_id]->measurements;
@@ -949,13 +925,12 @@ void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n
*/ */
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
void phy_config_dedicated_scell_ue(uint8_t Mod_id, void
uint8_t eNB_index, phy_config_dedicated_scell_ue (uint8_t Mod_id, uint8_t eNB_index, SCellToAddMod_r10_t * sCellToAddMod_r10, int CC_id)
SCellToAddMod_r10_t *sCellToAddMod_r10,
int CC_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,
@@ -1008,8 +983,8 @@ void phy_config_dedicated_scell_ue(uint8_t Mod_id,
#endif #endif
void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, void
uint16_t max_harq_tx ) phy_config_harq_ue (uint8_t Mod_id, int CC_id, uint8_t eNB_id, uint16_t max_harq_tx)
{ {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
@@ -1018,8 +993,8 @@ void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
extern uint16_t beta_cqi[16]; extern uint16_t beta_cqi[16];
void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, void
struct PhysicalConfigDedicated *physicalConfigDedicated ) phy_config_dedicated_ue (uint8_t Mod_id, int CC_id, uint8_t eNB_id, struct PhysicalConfigDedicated *physicalConfigDedicated)
{ {
static uint8_t first_dedicated_configuration = 0; static uint8_t first_dedicated_configuration = 0;
@@ -1074,7 +1049,8 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
LOG_D (PHY, "pusch_config_dedicated.betaOffset_ACK_Index %d\n", phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index); LOG_D (PHY, "pusch_config_dedicated.betaOffset_ACK_Index %d\n", phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index);
LOG_D (PHY, "pusch_config_dedicated.betaOffset_RI_Index %d\n", phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index); LOG_D (PHY, "pusch_config_dedicated.betaOffset_RI_Index %d\n", phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index);
LOG_D(PHY,"pusch_config_dedicated.betaOffset_CQI_Index %d => %d)\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index,beta_cqi[phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index]); LOG_D (PHY, "pusch_config_dedicated.betaOffset_CQI_Index %d => %d)\n", phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index,
beta_cqi[phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index]);
LOG_D (PHY, "\n"); LOG_D (PHY, "\n");
@@ -1173,8 +1149,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
// configure PUSCH CQI reporting // configure PUSCH CQI reporting
phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic; phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
if ((phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm12) && if ((phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm12) &&
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm30) && (phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm30) && (phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm31))
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm31))
LOG_E (PHY, "Unsupported Aperiodic CQI Feedback Mode : %d\n", phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic); LOG_E (PHY, "Unsupported Aperiodic CQI Feedback Mode : %d\n", phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic);
} }
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) { if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) {
@@ -1184,25 +1159,21 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex; phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex;
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex) if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex; phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex;
} } else if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_release) {
else if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_release) {
// handle release // handle release
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1; phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1; phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
} }
} }
} }
#ifdef CBA #ifdef CBA
if (physicalConfigDedicated->pusch_CBAConfigDedicated_vlola) { if (physicalConfigDedicated->pusch_CBAConfigDedicated_vlola) {
phy_vars_ue->pusch_ca_config_dedicated[eNB_id].betaOffset_CA_Index = (uint16_t) * physicalConfigDedicated->pusch_CBAConfigDedicated_vlola->betaOffset_CBA_Index; phy_vars_ue->pusch_ca_config_dedicated[eNB_id].betaOffset_CA_Index = (uint16_t) * physicalConfigDedicated->pusch_CBAConfigDedicated_vlola->betaOffset_CBA_Index;
phy_vars_ue->pusch_ca_config_dedicated[eNB_id].cShift = (uint16_t) * physicalConfigDedicated->pusch_CBAConfigDedicated_vlola->cShift_CBA; phy_vars_ue->pusch_ca_config_dedicated[eNB_id].cShift = (uint16_t) * physicalConfigDedicated->pusch_CBAConfigDedicated_vlola->cShift_CBA;
LOG_D (PHY, "[UE %d ] physicalConfigDedicated pusch CBA config dedicated: beta offset %d cshift %d \n", Mod_id, LOG_D (PHY, "[UE %d ] physicalConfigDedicated pusch CBA config dedicated: beta offset %d cshift %d \n", Mod_id,
phy_vars_ue->pusch_ca_config_dedicated[eNB_id].betaOffset_CA_Index, phy_vars_ue->pusch_ca_config_dedicated[eNB_id].betaOffset_CA_Index, phy_vars_ue->pusch_ca_config_dedicated[eNB_id].cShift);
phy_vars_ue->pusch_ca_config_dedicated[eNB_id].cShift);
} }
#endif #endif
} else { } else {
LOG_D (PHY, "[PHY][UE %d] Received NULL radioResourceConfigDedicated from eNB %d\n", Mod_id, eNB_id); LOG_D (PHY, "[PHY][UE %d] Received NULL radioResourceConfigDedicated from eNB %d\n", Mod_id, eNB_id);
@@ -1214,8 +1185,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
// disable MIB SIB decoding once we are on connected mode // disable MIB SIB decoding once we are on connected mode
first_dedicated_configuration++; first_dedicated_configuration++;
if(first_dedicated_configuration > 1) if (first_dedicated_configuration > 1) {
{
LOG_I (PHY, "Disable SIB MIB decoding \n"); LOG_I (PHY, "Disable SIB MIB decoding \n");
phy_vars_ue->decode_SIB = 0; phy_vars_ue->decode_SIB = 0;
phy_vars_ue->decode_MIB = 0; phy_vars_ue->decode_MIB = 0;
@@ -1226,12 +1196,12 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
else else
phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti; phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
LOG_I(PHY,"C-RNTI %x %x \n", phy_vars_ue->pdcch_vars[0][eNB_id]->crnti, LOG_I (PHY, "C-RNTI %x %x \n", phy_vars_ue->pdcch_vars[0][eNB_id]->crnti, phy_vars_ue->pdcch_vars[1][eNB_id]->crnti);
phy_vars_ue->pdcch_vars[1][eNB_id]->crnti);
} }
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) 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; // uint8_t i;
@@ -1248,7 +1218,8 @@ void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uin
} }
} }
void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) void
init_lte_top (LTE_DL_FRAME_PARMS * frame_parms)
{ {
crcTableInit (); crcTableInit ();
@@ -1289,7 +1260,8 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure. * \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
* \note This function is optimistic in that it expects malloc() to succeed. * \note This function is optimistic in that it expects malloc() to succeed.
*/ */
void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS* const fp ) void
phy_init_lte_ue__PDSCH (LTE_UE_PDSCH * const pdsch, const LTE_DL_FRAME_PARMS * const fp)
{ {
AssertFatal (pdsch, "pdsch==0"); AssertFatal (pdsch, "pdsch==0");
@@ -1336,9 +1308,8 @@ void phy_init_lte_ue__PDSCH( LTE_UE_PDSCH* const pdsch, const LTE_DL_FRAME_PARMS
} }
} }
int init_lte_ue_signal(PHY_VARS_UE *ue, int
int nb_connected_eNB, init_lte_ue_signal (PHY_VARS_UE * ue, int nb_connected_eNB, uint8_t abstraction_flag)
uint8_t abstraction_flag)
{ {
// create shortcuts // create shortcuts
@@ -1429,7 +1400,8 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
for (j = 0; j < 4; j++) { for (j = 0; j < 4; j++) {
int idx = (j << 1) + i; int idx = (j << 1) + i;
for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) { for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates[eNB_id][idx] = (int32_t*)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) ); common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates[eNB_id][idx] =
(int32_t *) malloc16_clear (sizeof (int32_t) * fp->symbols_per_tti * (fp->ofdm_symbol_size + LTE_CE_FILTER_LENGTH));
common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates_time[eNB_id][idx] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size * 2); common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates_time[eNB_id][idx] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size * 2);
} }
} }
@@ -1644,14 +1616,17 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
return 0; return 0;
} }
void init_lte_ue_transport(PHY_VARS_UE *ue,int abstraction_flag) { void
init_lte_ue_transport (PHY_VARS_UE * ue, int abstraction_flag)
{
int i, j, k; int i, j, k;
for (i = 0; i < NUMBER_OF_CONNECTED_eNB_MAX; i++) { for (i = 0; i < NUMBER_OF_CONNECTED_eNB_MAX; i++) {
for (j = 0; j < 2; j++) { for (j = 0; j < 2; j++) {
for (k = 0; k < 2; k++) { for (k = 0; k < 2; k++) {
AssertFatal((ue->dlsch[k][i][j] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_TURBO_ITERATIONS,ue->frame_parms.N_RB_DL, abstraction_flag))!=NULL,"Can't get ue dlsch structures\n"); AssertFatal ((ue->dlsch[k][i][j] =
new_ue_dlsch (1, NUMBER_OF_HARQ_PID_MAX, NSOFT, MAX_TURBO_ITERATIONS, ue->frame_parms.N_RB_DL, abstraction_flag)) != NULL, "Can't get ue dlsch structures\n");
LOG_D (PHY, "dlsch[%d][%d][%d] => %p\n", k, i, j, ue->dlsch[i][j]); LOG_D (PHY, "dlsch[%d][%d][%d] => %p\n", k, i, j, ue->dlsch[i][j]);
} }
@@ -1671,7 +1646,9 @@ void init_lte_ue_transport(PHY_VARS_UE *ue,int abstraction_flag) {
} }
int phy_init_RU(RU_t *ru) { int
phy_init_RU (RU_t * ru)
{
LTE_DL_FRAME_PARMS *fp = &ru->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->frame_parms;
int i, j; int i, j;
@@ -1690,8 +1667,7 @@ int phy_init_RU(RU_t *ru) {
// Allocate 10 subframes of I/Q TX signal data (time) if not // Allocate 10 subframes of I/Q TX signal data (time) if not
ru->common.txdata[i] = (int32_t *) malloc16_clear (fp->samples_per_tti * 10 * sizeof (int32_t)); ru->common.txdata[i] = (int32_t *) malloc16_clear (fp->samples_per_tti * 10 * sizeof (int32_t));
LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes)\n",i,ru->common.txdata[i], LOG_I (PHY, "[INIT] common.txdata[%d] = %p (%lu bytes)\n", i, ru->common.txdata[i], fp->samples_per_tti * 10 * sizeof (int32_t));
fp->samples_per_tti*10*sizeof(int32_t));
} }
for (i = 0; i < ru->nb_rx; i++) { for (i = 0; i < ru->nb_rx; i++) {
@@ -1715,8 +1691,7 @@ int phy_init_RU(RU_t *ru) {
// allocate IFFT input buffers (TX) // allocate IFFT input buffers (TX)
ru->common.txdataF_BF = (int32_t **) malloc16 (ru->nb_tx * sizeof (int32_t *)); ru->common.txdataF_BF = (int32_t **) malloc16 (ru->nb_tx * sizeof (int32_t *));
LOG_I(PHY,"[INIT] common.txdata_BF= %p (%lu bytes)\n",ru->common.txdataF_BF, LOG_I (PHY, "[INIT] common.txdata_BF= %p (%lu bytes)\n", ru->common.txdataF_BF, ru->nb_tx * sizeof (int32_t *));
ru->nb_tx*sizeof(int32_t*));
for (i = 0; i < ru->nb_tx; i++) { for (i = 0; i < ru->nb_tx; i++) {
ru->common.txdataF_BF[i] = (int32_t *) malloc16_clear (fp->symbols_per_tti * fp->ofdm_symbol_size * sizeof (int32_t)); ru->common.txdataF_BF[i] = (int32_t *) malloc16_clear (fp->symbols_per_tti * fp->ofdm_symbol_size * sizeof (int32_t));
LOG_I (PHY, "txdataF_BF[%d] %p for RU %d\n", i, ru->common.txdataF_BF[i], ru->idx); LOG_I (PHY, "txdataF_BF[%d] %p for RU %d\n", i, ru->common.txdataF_BF[i], ru->idx);
@@ -1730,10 +1705,10 @@ int phy_init_RU(RU_t *ru) {
} }
/* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */ /* number of elements of an array X is computed as sizeof(X) / sizeof(X[0]) */
AssertFatal(ru->nb_rx <= sizeof(ru->prach_rxsigF) / sizeof(ru->prach_rxsigF[0]), AssertFatal (ru->nb_rx <= sizeof (ru->prach_rxsigF) / sizeof (ru->prach_rxsigF[0]), "nb_antennas_rx too large");
"nb_antennas_rx too large");
ru->prach_rxsigF = (int16_t **) malloc (ru->nb_rx * sizeof (int16_t *)); ru->prach_rxsigF = (int16_t **) malloc (ru->nb_rx * sizeof (int16_t *));
for (j=0;j<4;j++) ru->prach_rxsigF_br[j] = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*)); for (j = 0; j < 4; j++)
ru->prach_rxsigF_br[j] = (int16_t **) malloc (ru->nb_rx * sizeof (int16_t *));
for (i = 0; i < ru->nb_rx; i++) { for (i = 0; i < ru->nb_rx; i++) {
ru->prach_rxsigF[i] = (int16_t *) malloc16_clear (fp->ofdm_symbol_size * 12 * 2 * sizeof (int16_t)); ru->prach_rxsigF[i] = (int16_t *) malloc16_clear (fp->ofdm_symbol_size * 12 * 2 * sizeof (int16_t));
@@ -1746,8 +1721,7 @@ int phy_init_RU(RU_t *ru) {
#endif #endif
} }
AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n", AssertFatal (RC.nb_L1_inst <= NUMBER_OF_eNB_MAX, "eNB instances %d > %d\n", RC.nb_L1_inst, NUMBER_OF_eNB_MAX);
RC.nb_L1_inst,NUMBER_OF_eNB_MAX);
for (i = 0; i < RC.nb_L1_inst; i++) { for (i = 0; i < RC.nb_L1_inst; i++) {
for (p = 0; p < 15; p++) { for (p = 0; p < 15; p++) {
@@ -1761,14 +1735,11 @@ int phy_init_RU(RU_t *ru) {
if (((p < 4) && (p == j)) || ((p == 4) && (j == 0))) { if (((p < 4) && (p == j)) || ((p == 4) && (j == 0))) {
for (re = 0; re < fp->ofdm_symbol_size; re++) for (re = 0; re < fp->ofdm_symbol_size; re++)
ru->beam_weights[i][p][j][re] = 0x00007fff; ru->beam_weights[i][p][j][re] = 0x00007fff;
} } else if (p > 4) {
else if (p>4) {
for (re = 0; re < fp->ofdm_symbol_size; re++) for (re = 0; re < fp->ofdm_symbol_size; re++)
ru->beam_weights[i][p][j][re] = 0x00007fff / ru->nb_tx; ru->beam_weights[i][p][j][re] = 0x00007fff / ru->nb_tx;
} }
LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d] = %p (%lu bytes)\n", LOG_D (PHY, "[INIT] lte_common_vars->beam_weights[%d][%d] = %p (%lu bytes)\n", i, j, ru->beam_weights[i][p][j], fp->ofdm_symbol_size * sizeof (int32_t));
i,j,ru->beam_weights[i][p][j],
fp->ofdm_symbol_size*sizeof(int32_t));
} }
} }
} }
@@ -1779,9 +1750,8 @@ int phy_init_RU(RU_t *ru) {
return (0); return (0);
} }
int phy_init_lte_eNB(PHY_VARS_eNB *eNB, int
unsigned char is_secondary_eNB, phy_init_lte_eNB (PHY_VARS_eNB * eNB, unsigned char is_secondary_eNB, unsigned char abstraction_flag)
unsigned char abstraction_flag)
{ {
// shortcuts // shortcuts
@@ -1801,12 +1771,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
eNB->total_system_throughput = 0; eNB->total_system_throughput = 0;
eNB->check_for_MUMIMO_transmissions = 0; eNB->check_for_MUMIMO_transmissions = 0;
while(eNB->configured == 0) usleep(10000); while (eNB->configured == 0)
usleep (10000);
LOG_I (PHY, "[eNB %" PRIu8 "] Initializing DL_FRAME_PARMS : N_RB_DL %" PRIu8 ", PHICH Resource %d, PHICH Duration %d\n", LOG_I (PHY, "[eNB %" PRIu8 "] Initializing DL_FRAME_PARMS : N_RB_DL %" PRIu8 ", PHICH Resource %d, PHICH Duration %d\n",
eNB->Mod_id, eNB->Mod_id, fp->N_RB_DL, fp->phich_config_common.phich_resource, fp->phich_config_common.phich_duration);
fp->N_RB_DL,fp->phich_config_common.phich_resource,
fp->phich_config_common.phich_duration);
LOG_D (PHY, "[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02" PRIu8 "][]\n", eNB->Mod_id); LOG_D (PHY, "[MSC_NEW][FRAME 00000][PHY_eNB][MOD %02" PRIu8 "][]\n", eNB->Mod_id);
@@ -1815,8 +1784,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
generate_phich_reg_mapping (fp); generate_phich_reg_mapping (fp);
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
eNB->first_run_timing_advance[UE_id] = eNB->first_run_timing_advance[UE_id] = 1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
// clear whole structure // clear whole structure
bzero (&eNB->UE_stats[UE_id], sizeof (LTE_eNB_UE_stats)); bzero (&eNB->UE_stats[UE_id], sizeof (LTE_eNB_UE_stats));
@@ -1837,9 +1805,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
if (i < fp->nb_antenna_ports_eNB || i == 5) { if (i < fp->nb_antenna_ports_eNB || i == 5) {
common_vars->txdataF[i] = (int32_t *) malloc16_clear (fp->ofdm_symbol_size * fp->symbols_per_tti * 10 * sizeof (int32_t)); common_vars->txdataF[i] = (int32_t *) malloc16_clear (fp->ofdm_symbol_size * fp->symbols_per_tti * 10 * sizeof (int32_t));
LOG_D(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n", LOG_D (PHY, "[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n", i, common_vars->txdataF[i], fp->ofdm_symbol_size * fp->symbols_per_tti * 10 * sizeof (int32_t));
i,common_vars->txdataF[i],
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
} }
} }
@@ -1871,7 +1837,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// assume maximum of 64 RX antennas for PRACH receiver // assume maximum of 64 RX antennas for PRACH receiver
prach_vars->prach_ifft[0] = (int32_t **) malloc16_clear (64 * sizeof (int32_t *)); prach_vars->prach_ifft[0] = (int32_t **) malloc16_clear (64 * sizeof (int32_t *));
for (i=0;i<64;i++) prach_vars->prach_ifft[0][i] = (int32_t*)malloc16_clear(1024*2*sizeof(int32_t)); for (i = 0; i < 64; i++)
prach_vars->prach_ifft[0][i] = (int32_t *) malloc16_clear (1024 * 2 * sizeof (int32_t));
prach_vars->rxsigF[0] = (int16_t **) malloc16_clear (64 * sizeof (int16_t *)); prach_vars->rxsigF[0] = (int16_t **) malloc16_clear (64 * sizeof (int16_t *));
// PRACH BR // PRACH BR
@@ -1881,7 +1848,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
// assume maximum of 64 RX antennas for PRACH receiver // assume maximum of 64 RX antennas for PRACH receiver
for (int ce_level = 0; ce_level < 4; ce_level++) { for (int ce_level = 0; ce_level < 4; ce_level++) {
prach_vars_br->prach_ifft[ce_level] = (int32_t **) malloc16_clear (64 * sizeof (int32_t *)); prach_vars_br->prach_ifft[ce_level] = (int32_t **) malloc16_clear (64 * sizeof (int32_t *));
for (i=0;i<64;i++) prach_vars_br->prach_ifft[ce_level][i] = (int32_t*)malloc16_clear(1024*2*sizeof(int32_t)); for (i = 0; i < 64; i++)
prach_vars_br->prach_ifft[ce_level][i] = (int32_t *) malloc16_clear (1024 * 2 * sizeof (int32_t));
prach_vars->rxsigF[ce_level] = (int16_t **) malloc16_clear (64 * sizeof (int16_t *)); prach_vars->rxsigF[ce_level] = (int16_t **) malloc16_clear (64 * sizeof (int16_t *));
} }
#endif #endif
File diff suppressed because it is too large Load Diff
+22 -18
View File
@@ -49,15 +49,14 @@
//#define DEBUG_PHY //#define DEBUG_PHY
#ifdef Rel14 #ifdef Rel14
void generate_edci_top(PHY_VARS_eNB *eNB, int frame, int subframe) { void
generate_edci_top (PHY_VARS_eNB * eNB, int frame, int subframe)
{
} }
void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms, void
mDCI_ALLOC_t *mdci, mpdcch_scrambling (LTE_DL_FRAME_PARMS * frame_parms, mDCI_ALLOC_t * mdci, uint16_t i, uint8_t * e, uint32_t length)
uint16_t i,
uint8_t *e,
uint32_t length)
{ {
int n; int n;
uint8_t reset; uint8_t reset;
@@ -71,13 +70,15 @@ void mpdcch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
reset = 1; reset = 1;
// x1 is set in lte_gold_generic // x1 is set in lte_gold_generic
if ((mdci->rnti == 0xFFFE) || if ((mdci->rnti == 0xFFFE) || (mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI
(mdci->ce_mode == 2)) // CEModeB Note: also for mdci->rnti==SC_RNTI
Nacc = frame_parms->frame_type == FDD ? 4 : 10; Nacc = frame_parms->frame_type == FDD ? 4 : 10;
else Nacc=1; else
Nacc = 1;
if (frame_parms->frame_type == FDD || Nacc == 1) idelta = 0; if (frame_parms->frame_type == FDD || Nacc == 1)
else idelta = Nacc-2; idelta = 0;
else
idelta = Nacc - 2;
j0 = (i0 + idelta) / Nacc; j0 = (i0 + idelta) / Nacc;
j = (i - i0) / Nacc; j = (i - i0) / Nacc;
@@ -189,7 +190,9 @@ extern uint8_t *generate_dci0(uint8_t *dci,
uint8_t aggregation_level, uint8_t aggregation_level,
uint16_t rnti); uint16_t rnti);
void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe,int16_t amp,int32_t **txdataF) { void
generate_mdci_top (PHY_VARS_eNB * eNB, int frame, int subframe, int16_t amp, int32_t ** txdataF)
{
LTE_eNB_MPDCCH *mpdcch= &eNB->mpdcch_vars[subframe&2]; LTE_eNB_MPDCCH *mpdcch= &eNB->mpdcch_vars[subframe&2];
mDCI_ALLOC_t *mdci; mDCI_ALLOC_t *mdci;
@@ -235,9 +238,7 @@ void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe,int16_t amp,in
// scrambling // scrambling
uint16_t absSF = (frame * 10) + subframe; uint16_t absSF = (frame * 10) + subframe;
AssertFatal(absSF < 1024, AssertFatal (absSF < 1024, "Absolute subframe %d = %d*10 + %d > 1023\n", absSF, frame, subframe);
"Absolute subframe %d = %d*10 + %d > 1023\n",
absSF,frame,subframe);
mpdcch_scrambling(fp, mpdcch_scrambling(fp,
mdci, mdci,
@@ -262,14 +263,17 @@ void generate_mdci_top(PHY_VARS_eNB *eNB, int frame, int subframe,int16_t amp,in
int re_offset = fp->first_carrier_offset + 1 + ((fp->N_RB_DL == 100) ? 1 : 0) + mdci->narrowband * 12 * 6; int re_offset = fp->first_carrier_offset + 1 + ((fp->N_RB_DL == 100) ? 1 : 0) + mdci->narrowband * 12 * 6;
if (re_offset>fp->ofdm_symbol_size) re_offset-=(fp->ofdm_symbol_size-1); if (re_offset > fp->ofdm_symbol_size)
re_offset -= (fp->ofdm_symbol_size - 1);
int32_t *txF = &txdataF[0][re_offset]; int32_t *txF = &txdataF[0][re_offset];
int32_t yIQ; int32_t yIQ;
for (i = 0; i < (coded_bits >> 1); i++) { for (i = 0; i < (coded_bits >> 1); i++) {
// QPSK modulation to yIQ // QPSK modulation to yIQ
((int16_t*)&yIQ)[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK; e_ptr++; ((int16_t *) & yIQ)[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
((int16_t*)&yIQ)[1] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK; e_ptr++; e_ptr++;
((int16_t *) & yIQ)[1] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
e_ptr++;
txF[mpdcch5tab[i + (36 * mdci->firstCCE)]] = yIQ; txF[mpdcch5tab[i + (36 * mdci->firstCCE)]] = yIQ;
} }
+4
View File
@@ -1677,6 +1677,10 @@ void init_ul_hopping(LTE_DL_FRAME_PARMS *frame_parms);
@param nB nB from 36.304 (0=4T,1=2T,2=T,3=T/2,4=T/4,5=T/8,6=T/16,7=T/32*/ @param nB nB from 36.304 (0=4T,1=2T,2=T,3=T/2,4=T/4,5=T/8,6=T/16,7=T/32*/
int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB); int init_ue_paging_info(PHY_VARS_UE *ue, long defaultPagingCycle, long nB);
#ifdef Rel14
void init_mpdcch5tab_normal_regular_subframe_evenNRBDL(PHY_VARS_eNB *eNB,int l_MPDCCH_start);
#endif
int32_t compareints (const void * a, const void * b); int32_t compareints (const void * a, const void * b);
+4 -2
View File
@@ -59,7 +59,7 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
LTE_eNB_MPDCCH *mpdcch_vars = &eNB->mpdcch_vars[idx]; LTE_eNB_MPDCCH *mpdcch_vars = &eNB->mpdcch_vars[idx];
nfapi_dl_config_mpdcch_pdu *pdu = &dl_config_pdu->mpdcch_pdu; nfapi_dl_config_mpdcch_pdu *pdu = &dl_config_pdu->mpdcch_pdu;
LOG_D(PHY,"Frame %d, Subframe %d: MDCI processing\n",proc->frame_tx,proc->subframe_tx); LOG_I(PHY,"Frame %d, Subframe %d: MDCI processing\n",proc->frame_tx,proc->subframe_tx);
// copy dci configuration into eNB structure // copy dci configuration into eNB structure
fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu); fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu);
@@ -147,7 +147,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
dlsch0_harq = dlsch0->harq_processes[0]; dlsch0_harq = dlsch0->harq_processes[0];
dlsch0_harq->pdu = sdu; dlsch0_harq->pdu = sdu;
if (proc->frame_tx < 200) LOG_I(PHY,"NFAPI: frame %d, subframe %d: Programming SI-BR (%d) => %d\n",proc->frame_tx,proc->subframe_tx,rel13->pdsch_payload_type,UE_id); if (proc->frame_tx < 200) LOG_D(PHY,"NFAPI: frame %d, subframe %d: Programming SI-BR (%d) => %d\n",proc->frame_tx,proc->subframe_tx,rel13->pdsch_payload_type,UE_id);
dlsch0->rnti = 0xFFFF; dlsch0->rnti = 0xFFFF;
dlsch0->Kmimo = 1; dlsch0->Kmimo = 1;
@@ -156,6 +156,8 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
dlsch0->i0 = rel13->initial_transmission_sf_io; dlsch0->i0 = rel13->initial_transmission_sf_io;
dlsch0_harq->pdsch_start = rel10->pdsch_start; dlsch0_harq->pdsch_start = rel10->pdsch_start;
dlsch0->harq_ids[proc->subframe_tx] = 0; dlsch0->harq_ids[proc->subframe_tx] = 0;
dlsch0_harq->frame = proc->frame_tx;
dlsch0_harq->subframe = proc->subframe_tx;
if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1; if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1;
File diff suppressed because it is too large Load Diff
+114 -174
View File
@@ -62,7 +62,9 @@
#include "T.h" #include "T.h"
void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_t frameP, sub_frame_t subframeP) { void
add_msg3 (module_id_t module_idP, int CC_id, RA_TEMPLATE * RA_template, frame_t frameP, sub_frame_t subframeP)
{
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = &eNB->common_channels[CC_id]; COMMON_channels_t *cc = &eNB->common_channels[CC_id];
@@ -84,8 +86,7 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_
#ifdef Rel14 #ifdef Rel14
if (RA_template->rach_resource_type > 0) { if (RA_template->rach_resource_type > 0) {
LOG_D (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d CE level %d is active, Msg3 in (%d,%d)\n", LOG_D (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d CE level %d is active, Msg3 in (%d,%d)\n",
module_idP,frameP,subframeP,CC_id,RA_template->rach_resource_type-1, module_idP, frameP, subframeP, CC_id, RA_template->rach_resource_type - 1, RA_template->Msg3_frame, RA_template->Msg3_subframe);
RA_template->Msg3_frame,RA_template->Msg3_subframe);
LOG_D (MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d)\n", LOG_D (MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d)\n",
frameP, subframeP, RA_template->Msg3_frame, RA_template->Msg3_subframe, RA_template->msg3_nb_rb, RA_template->msg3_round); frameP, subframeP, RA_template->Msg3_frame, RA_template->Msg3_subframe, RA_template->msg3_nb_rb, RA_template->msg3_round);
@@ -108,8 +109,7 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.ul_tx_mode = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.current_tx_nb = 0;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.n_srs = 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL(RA_template->msg3_mcs, ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL (RA_template->msg3_mcs, RA_template->msg3_nb_rb);
RA_template->msg3_nb_rb);
// Re13 fields // Re13 fields
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = RA_template->rach_resource_type > 2 ? 2 : 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.ue_type = RA_template->rach_resource_type > 2 ? 2 : 1;
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1; ul_config_pdu->ulsch_pdu.ulsch_pdu_rel13.total_number_of_repetitions = 1;
@@ -120,12 +120,10 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_
else else
#endif #endif
{ {
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", LOG_D (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA is active, Msg3 in (%d,%d)\n", module_idP, frameP, subframeP, CC_id, RA_template->Msg3_frame, RA_template->Msg3_subframe);
module_idP,frameP,subframeP,CC_id,RA_template->Msg3_frame,RA_template->Msg3_subframe);
LOG_D (MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d)\n", LOG_D (MAC, "Frame %d, Subframe %d Adding Msg3 UL Config Request for (%d,%d) : (%d,%d,%d)\n",
frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe, frameP, subframeP, RA_template->Msg3_frame, RA_template->Msg3_subframe, RA_template->msg3_nb_rb, RA_template->msg3_first_rb, RA_template->msg3_round);
RA_template->msg3_nb_rb,RA_template->msg3_first_rb,RA_template->msg3_round);
ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus]; ul_config_pdu = &ul_req_body->ul_config_pdu_list[ul_req_body->number_of_pdus];
@@ -150,7 +148,8 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_
ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL (10, RA_template->msg3_nb_rb); ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8.size = get_TBS_UL (10, RA_template->msg3_nb_rb);
ul_req_body->number_of_pdus++; ul_req_body->number_of_pdus++;
// save UL scheduling information for preprocessor // save UL scheduling information for preprocessor
for (j=0;j<RA_template->msg3_nb_rb;j++) cc->vrb_map_UL[RA_template->msg3_first_rb+j]=1; for (j = 0; j < RA_template->msg3_nb_rb; j++)
cc->vrb_map_UL[RA_template->msg3_first_rb + j] = 1;
if (RA_template->msg3_round != 0) { // program HI too if (RA_template->msg3_round != 0) { // program HI too
@@ -163,17 +162,18 @@ void add_msg3(module_id_t module_idP,int CC_id, RA_TEMPLATE *RA_template, frame_
hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0; hi_dci0_pdu->hi_pdu.hi_pdu_rel8.hi_value = 0;
hi_dci0_req->number_of_hi++; hi_dci0_req->number_of_hi++;
// save UL scheduling information for preprocessor // save UL scheduling information for preprocessor
for (j=0;j<RA_template->msg3_nb_rb;j++) cc->vrb_map_UL[RA_template->msg3_first_rb+j]=1; for (j = 0; j < RA_template->msg3_nb_rb; j++)
cc->vrb_map_UL[RA_template->msg3_first_rb + j] = 1;
LOG_D (MAC, "[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA (mcs %d, first rb %d, nb_rb %d,round %d)\n", LOG_D (MAC, "[eNB %d][PUSCH-RA %x] CC_id %d Frame %d subframeP %d Scheduled (PHICH) RA (mcs %d, first rb %d, nb_rb %d,round %d)\n",
module_idP,RA_template->rnti,CC_id,frameP,subframeP,10, module_idP, RA_template->rnti, CC_id, frameP, subframeP, 10, 1, 1, RA_template->msg3_round - 1);
1,1,
RA_template->msg3_round-1);
} // if (RA_template->msg3_round != 0) { // program HI too } // if (RA_template->msg3_round != 0) { // program HI too
} // non-BL/CE UE case } // non-BL/CE UE case
} }
void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template) { void
generate_Msg2 (module_id_t module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, RA_TEMPLATE * RA_template)
{
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = eNB->common_channels; COMMON_channels_t *cc = eNB->common_channels;
@@ -204,7 +204,8 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
uint16_t absSF = (10 * frameP) + subframeP; uint16_t absSF = (10 * frameP) + subframeP;
uint16_t absSF_Msg2 = (10 * RA_template->Msg2_frame) + RA_template->Msg2_subframe; uint16_t absSF_Msg2 = (10 * RA_template->Msg2_frame) + RA_template->Msg2_subframe;
if (absSF>absSF_Msg2) return; // we're not ready yet, need to be to start == if (absSF > absSF_Msg2)
return; // we're not ready yet, need to be to start ==
if (cc[CC_idP].radioResourceConfigCommon_BR) { if (cc[CC_idP].radioResourceConfigCommon_BR) {
@@ -249,11 +250,9 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
RA_template->msg2_narrowband = *p[RA_template->rach_resource_type - 1]->mpdcch_NarrowbandsToMonitor_r13.list.array[RA_template->preamble_index % num_nb]; RA_template->msg2_narrowband = *p[RA_template->rach_resource_type - 1]->mpdcch_NarrowbandsToMonitor_r13.list.array[RA_template->preamble_index % num_nb];
first_rb = narrowband_to_first_rb (&cc[CC_idP], RA_template->msg2_narrowband); first_rb = narrowband_to_first_rb (&cc[CC_idP], RA_template->msg2_narrowband);
if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && if ((RA_template->msg2_mpdcch_repetition_cnt == 0) && (mpdcch_sf_condition (eNB, CC_idP, frameP, subframeP, rmax, TYPE2, -1) > 0)) {
(mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){
// MPDCCH configuration for RAR // MPDCCH configuration for RAR
LOG_D(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n", LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming MPDCCH %d repetitions\n", module_idP, frameP, subframeP, reps);
module_idP,frameP,subframeP,reps);
memset ((void *) dl_config_pdu, 0, sizeof (nfapi_dl_config_request_pdu_t)); memset ((void *) dl_config_pdu, 0, sizeof (nfapi_dl_config_request_pdu_t));
@@ -264,8 +263,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; // imposed (9.1.5 in 213) for Type 2 Common search space
AssertFatal(cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13!=NULL, AssertFatal (cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 != NULL, "cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
"cc[CC_id].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
@@ -304,32 +302,34 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_tx_antenna_ports = 1;
RA_template->msg2_mpdcch_repetition_cnt++; RA_template->msg2_mpdcch_repetition_cnt++;
dl_req->number_pdu++; dl_req->number_pdu++;
RA_template->Msg2_subframe = (RA_template->Msg2_subframe + 9) % 10;
} //repetition_count==0 && SF condition met } //repetition_count==0 && SF condition met
if (RA_template->msg2_mpdcch_repetition_cnt > 0) { // we're in a stream of repetitions if (RA_template->msg2_mpdcch_repetition_cnt > 0) { // we're in a stream of repetitions
if (RA_template->msg2_mpdcch_repetition_cnt == reps) { // this is the last mpdcch repetition if (RA_template->msg2_mpdcch_repetition_cnt == reps) { // this is the last mpdcch repetition
if (cc[CC_idP].tdd_Config == NULL) { // FDD case if (cc[CC_idP].tdd_Config == NULL) { // FDD case
// wait 2 subframes for PDSCH transmission // wait 2 subframes for PDSCH transmission
if (subframeP>7) RA_template->Msg2_frame = (frameP+1)&1023; if (subframeP > 7)
else RA_template->Msg2_frame = frameP; RA_template->Msg2_frame = (frameP + 1) & 1023;
else
RA_template->Msg2_frame = frameP;
RA_template->Msg2_subframe = (subframeP + 2) % 10; // +2 is the "n+x" from Section 7.1.11 in 36.213 RA_template->Msg2_subframe = (subframeP + 2) % 10; // +2 is the "n+x" from Section 7.1.11 in 36.213
LOG_I(MAC,"[eNB %d][RAPROC] SFN %d.%d : Set Msg2 in %d.%d\n",frameP,subframeP,RA_template->Msg2_frame,RA_template->Msg2_subframe); LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, programmed Msg2 for %d.%d\n", module_idP, frameP, subframeP, RA_template->Msg2_frame,RA_template->Msg2_subframe);
} } else {
else {
AssertFatal (1 == 0, "TDD case not done yet\n"); AssertFatal (1 == 0, "TDD case not done yet\n");
} }
} // mpdcch_repetition_count == reps } // mpdcch_repetition_count == reps
else { else {
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n", LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, MPDCCH repetition %d\n", module_idP, frameP, subframeP, RA_template->msg2_mpdcch_repetition_cnt);
module_idP,frameP,subframeP,RA_template->msg2_mpdcch_repetition_cnt);
RA_template->msg2_mpdcch_repetition_cnt++; RA_template->msg2_mpdcch_repetition_cnt++;
} }
if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) {
// Program PDSCH // Program PDSCH
LOG_I(MAC,"[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH %d\n", LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : In generate_Msg2, Programming PDSCH %d\n", module_idP, frameP, subframeP);
module_idP,frameP,subframeP);
RA_template->generate_rar = 0; RA_template->generate_rar = 0;
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
@@ -384,18 +384,13 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
} }
} }
} } else
else
#endif #endif
{ {
if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) { if ((RA_template->Msg2_frame == frameP) && (RA_template->Msg2_subframe == subframeP)) {
LOG_I (MAC, "[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n", LOG_I (MAC, "[eNB %d] CC_id %d Frame %d, subframeP %d: Generating RAR DCI, RA_active %d format 1A (%d,%d))\n",
module_idP, CC_idP, frameP, subframeP, module_idP, CC_idP, frameP, subframeP, RA_template->RA_active, RA_template->RA_dci_fmt1, RA_template->RA_dci_size_bits1);
RA_template->RA_active,
RA_template->RA_dci_fmt1,
RA_template->RA_dci_size_bits1);
// Allocate 4 PRBS starting in RB 0 // Allocate 4 PRBS starting in RB 0
first_rb = 0; first_rb = 0;
@@ -424,8 +419,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// This checks if the above DCI allocation is feasible in current subframe // This checks if the above DCI allocation is feasible in current subframe
if (!CCE_allocation_infeasible (module_idP, CC_idP, 0, subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, RA_template->RA_rnti)) { if (!CCE_allocation_infeasible (module_idP, CC_idP, 0, subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, RA_template->RA_rnti)) {
LOG_D(MAC,"Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", LOG_D (MAC, "Frame %d: Subframe %d : Adding common DCI for RA_RNTI %x\n", frameP, subframeP, RA_template->RA_rnti);
frameP,subframeP,RA_template->RA_rnti);
dl_req->number_dci++; dl_req->number_dci++;
dl_req->number_pdu++; dl_req->number_pdu++;
@@ -459,8 +453,7 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// Program UL processing for Msg3 // Program UL processing for Msg3
get_Msg3alloc (&cc[CC_idP], subframeP, frameP, &RA_template->Msg3_frame, &RA_template->Msg3_subframe); get_Msg3alloc (&cc[CC_idP], subframeP, frameP, &RA_template->Msg3_frame, &RA_template->Msg3_subframe);
LOG_D(MAC,"Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", LOG_D (MAC, "Frame %d, Subframe %d: Setting Msg3 reception for Frame %d Subframe %d\n", frameP, subframeP, RA_template->Msg3_frame, RA_template->Msg3_subframe);
frameP,subframeP,RA_template->Msg3_frame,RA_template->Msg3_subframe);
fill_rar (module_idP, CC_idP, frameP, cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7); fill_rar (module_idP, CC_idP, frameP, cc[CC_idP].RAR_pdu.payload, N_RB_DL, 7);
add_msg3 (module_idP, CC_idP, RA_template, frameP, subframeP); add_msg3 (module_idP, CC_idP, RA_template, frameP, subframeP);
@@ -479,7 +472,9 @@ void generate_Msg2(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
} // else BL/CE } // else BL/CE
} }
void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template){ void
generate_Msg4 (module_id_t module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, RA_TEMPLATE * RA_template)
{
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
@@ -527,8 +522,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
AssertFatal (prach_ParametersListCE_r13 != NULL, "prach_ParametersListCE_r13 is null\n"); AssertFatal (prach_ParametersListCE_r13 != NULL, "prach_ParametersListCE_r13 is null\n");
AssertFatal (pucch_N1PUCCH_AN_InfoList_r13 != NULL, "pucch_N1PUCCH_AN_InfoList_r13 is null\n"); AssertFatal (pucch_N1PUCCH_AN_InfoList_r13 != NULL, "pucch_N1PUCCH_AN_InfoList_r13 is null\n");
// check to verify CE-Level compatibility in SIB2_BR // check to verify CE-Level compatibility in SIB2_BR
AssertFatal(prach_ParametersListCE_r13->list.count == pucch_N1PUCCH_AN_InfoList_r13->list.count, AssertFatal (prach_ParametersListCE_r13->list.count == pucch_N1PUCCH_AN_InfoList_r13->list.count, "prach_ParametersListCE_r13->list.count!= pucch_N1PUCCH_AN_InfoList_r13->list.count\n");
"prach_ParametersListCE_r13->list.count!= pucch_N1PUCCH_AN_InfoList_r13->list.count\n");
switch (prach_ParametersListCE_r13->list.count) { switch (prach_ParametersListCE_r13->list.count) {
case 4: case 4:
@@ -569,27 +563,20 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// set HARQ process round to 0 for this UE // set HARQ process round to 0 for this UE
if (cc->tdd_Config) RA_template->harq_pid = ((frameP*10)+subframeP)%10; if (cc->tdd_Config)
else RA_template->harq_pid = ((frameP*10)+subframeP)&7; RA_template->harq_pid = ((frameP * 10) + subframeP) % 10;
else
RA_template->harq_pid = ((frameP * 10) + subframeP) & 7;
// Get RRCConnectionSetup for Piggyback // Get RRCConnectionSetup for Piggyback
rrc_sdu_length = mac_rrc_data_req(module_idP, rrc_sdu_length = mac_rrc_data_req (module_idP, CC_idP, frameP, CCCH, 1, // 1 transport block
CC_idP, &cc[CC_idP].CCCH_pdu.payload[0], ENB_FLAG_YES, module_idP, 0); // not used in this case
frameP,
CCCH,
1, // 1 transport block
&cc[CC_idP].CCCH_pdu.payload[0],
ENB_FLAG_YES,
module_idP,
0); // not used in this case
AssertFatal(rrc_sdu_length>0, AssertFatal (rrc_sdu_length > 0, "[MAC][eNB Scheduler] CCCH not allocated\n");
"[MAC][eNB Scheduler] CCCH not allocated\n");
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: UE_id %d, rrc_sdu_length %d\n", module_idP, CC_idP, frameP, subframeP, UE_id, rrc_sdu_length);
module_idP, CC_idP, frameP, subframeP,UE_id, rrc_sdu_length);
#ifdef Rel14 #ifdef Rel14
@@ -615,8 +602,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// get first narrowband // get first narrowband
first_rb = narrowband_to_first_rb (&cc[CC_idP], RA_template->msg34_narrowband); first_rb = narrowband_to_first_rb (&cc[CC_idP], RA_template->msg34_narrowband);
if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && if ((RA_template->msg4_mpdcch_repetition_cnt == 0) && (mpdcch_sf_condition (eNB, CC_idP, frameP, subframeP, rmax, TYPE2, -1) > 0)) {
(mpdcch_sf_condition(eNB,CC_idP,frameP,subframeP,rmax,TYPE2,-1)>0)){
// MPDCCH configuration for RAR // MPDCCH configuration for RAR
memset ((void *) dl_config_pdu, 0, sizeof (nfapi_dl_config_request_pdu_t)); memset ((void *) dl_config_pdu, 0, sizeof (nfapi_dl_config_request_pdu_t));
@@ -627,8 +613,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.number_of_prb_pairs = 6;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.resource_block_assignment = 0; // Note: this can be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.mpdcch_tansmission_type = 1;
AssertFatal(cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13!=NULL, AssertFatal (cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 != NULL, "cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
"cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13 is null\n");
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13; dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.start_symbol = cc[CC_idP].sib1_v13ext->bandwidthReducedAccessRelatedInfo_r13->startSymbolBR_r13;
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.ecce_index = 0; // Note: this should be dynamic
dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4 dl_config_pdu->mpdcch_pdu.mpdcch_pdu_rel13.aggregation_level = 16; // OK for CEModeA r1-3 (9.1.5-1b) or CEModeB r1-4
@@ -674,11 +659,12 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
if (RA_template->msg4_mpdcch_repetition_cnt == reps) { // this is the last mpdcch repetition if (RA_template->msg4_mpdcch_repetition_cnt == reps) { // this is the last mpdcch repetition
if (cc[CC_idP].tdd_Config == NULL) { // FDD case if (cc[CC_idP].tdd_Config == NULL) { // FDD case
// wait 2 subframes for PDSCH transmission // wait 2 subframes for PDSCH transmission
if (subframeP>7) RA_template->Msg4_frame = (frameP+1)&1023; if (subframeP > 7)
else RA_template->Msg4_frame = frameP; RA_template->Msg4_frame = (frameP + 1) & 1023;
else
RA_template->Msg4_frame = frameP;
RA_template->Msg4_subframe = (subframeP + 2) % 10; RA_template->Msg4_subframe = (subframeP + 2) % 10;
} } else {
else {
AssertFatal (1 == 0, "TDD case not done yet\n"); AssertFatal (1 == 0, "TDD case not done yet\n");
} }
} // mpdcch_repetition_count == reps } // mpdcch_repetition_count == reps
@@ -745,8 +731,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
module_idP, CC_idP, frameP, subframeP, RA_template->msg4_TBsize, rrc_sdu_length, msg4_header, msg4_padding, msg4_post_padding); module_idP, CC_idP, frameP, subframeP, RA_template->msg4_TBsize, rrc_sdu_length, msg4_header, msg4_padding, msg4_post_padding);
DevAssert (UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return DevAssert (UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return
// CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0]
offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], offset = generate_dlsch_header ((unsigned char *) eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], 1, //num_sdus
1, //num_sdus
(unsigned short *) &rrc_sdu_length, // (unsigned short *) &rrc_sdu_length, //
&lcid, // sdu_lcid &lcid, // sdu_lcid
255, // no drx 255, // no drx
@@ -755,9 +740,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
msg4_padding, // no padding msg4_padding, // no padding
msg4_post_padding); msg4_post_padding);
memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], memcpy ((void *) &eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][(unsigned char) offset], &cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length);
&cc[CC_idP].CCCH_pdu.payload[0],
rrc_sdu_length);
// DL request // DL request
eNB->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP; eNB->TX_req[CC_idP].sfn_sf = (frameP << 4) + subframeP;
@@ -793,8 +776,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// higher in the MPDCCH configuration, N_ECCE_q is hard-coded to 0, and harq resource offset to 0 => // higher in the MPDCCH configuration, N_ECCE_q is hard-coded to 0, and harq resource offset to 0 =>
// Delta_ARO = 0 from Table 10.1.2.1-1 // Delta_ARO = 0 from Table 10.1.2.1-1
ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.harq_size = 1; // 1-bit ACK/NAK ul_config_pdu->uci_harq_pdu.harq_information.harq_information_rel8_fdd.harq_size = 1; // 1-bit ACK/NAK
} } else {
else {
AssertFatal (1 == 0, "PUCCH configuration for ACK/NAK not handled yet for TDD BL/CE case\n"); AssertFatal (1 == 0, "PUCCH configuration for ACK/NAK not handled yet for TDD BL/CE case\n");
} }
ul_req->number_of_pdus++; ul_req->number_of_pdus++;
@@ -802,11 +784,8 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->msg4_TBsize)); T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->msg4_TBsize));
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], trace_pdu (1, (uint8_t *) eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], rrc_sdu_length, UE_id, 3, UE_RNTI (module_idP, UE_id), eNB->frame, eNB->subframe, 0, 0);
rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), LOG_D (OPT, "[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", module_idP, CC_idP, frameP, UE_RNTI (module_idP, UE_id), rrc_sdu_length);
eNB->frame, eNB->subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n",
module_idP, CC_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
} }
} // Msg4 frame/subframe } // Msg4 frame/subframe
} // msg4_mpdcch_repetition_count } // msg4_mpdcch_repetition_count
@@ -815,8 +794,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
#endif #endif
{ // This is normal LTE case { // This is normal LTE case
if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) {
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n", module_idP, CC_idP, frameP, subframeP, RA_template->rnti);
module_idP, CC_idP, frameP, subframeP,RA_template->rnti);
/// Choose first 4 RBs for Msg4, should really check that these are free! /// Choose first 4 RBs for Msg4, should really check that these are free!
first_rb = 0; first_rb = 0;
@@ -850,8 +828,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
RA_template->msg4_TBsize = 57; RA_template->msg4_TBsize = 57;
} }
fill_nfapi_dl_dci_1A(dl_config_pdu, fill_nfapi_dl_dci_1A (dl_config_pdu, 4, // aggregation_level
4, // aggregation_level
RA_template->rnti, // rnti RA_template->rnti, // rnti
1, // rnti_type, CRNTI 1, // rnti_type, CRNTI
RA_template->harq_pid, // harq_process RA_template->harq_pid, // harq_process
@@ -867,15 +844,9 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
dl_req->number_pdu, dl_req->number_pdu,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process, &dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding);
&dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding, AssertFatal (dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding < 8192, "resource_block_coding %u < 8192\n", dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding);
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding); if (!CCE_allocation_infeasible (module_idP, CC_idP, 1, subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, RA_template->rnti)) {
AssertFatal(dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding < 8192,
"resource_block_coding %u < 8192\n",
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding);
if (!CCE_allocation_infeasible(module_idP,CC_idP,1,
subframeP,dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
RA_template->rnti)) {
dl_req->number_dci++; dl_req->number_dci++;
dl_req->number_pdu++; dl_req->number_pdu++;
@@ -883,18 +854,19 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
RA_template->wait_ack_Msg4 = 1; RA_template->wait_ack_Msg4 = 1;
// increment Absolute subframe by 8 for Msg4 retransmission // increment Absolute subframe by 8 for Msg4 retransmission
LOG_D(MAC,"Frame %d, Subframe %d: Preparing for Msg4 retransmission currently %d.%d\n", LOG_D (MAC, "Frame %d, Subframe %d: Preparing for Msg4 retransmission currently %d.%d\n", frameP, subframeP, RA_template->Msg4_frame, RA_template->Msg4_subframe);
frameP,subframeP,RA_template->Msg4_frame,RA_template->Msg4_subframe); if (RA_template->Msg4_subframe > 1)
if (RA_template->Msg4_subframe > 1) RA_template->Msg4_frame++; RA_template->Msg4_frame++;
RA_template->Msg4_frame &= 1023; RA_template->Msg4_frame &= 1023;
RA_template->Msg4_subframe = (RA_template->Msg4_subframe + 8) % 10; RA_template->Msg4_subframe = (RA_template->Msg4_subframe + 8) % 10;
LOG_D(MAC,"Frame %d, Subframe %d: Msg4 retransmission in %d.%d\n", LOG_D (MAC, "Frame %d, Subframe %d: Msg4 retransmission in %d.%d\n", frameP, subframeP, RA_template->Msg4_frame, RA_template->Msg4_subframe);
frameP,subframeP,RA_template->Msg4_frame,RA_template->Msg4_subframe);
lcid = 0; lcid = 0;
// put HARQ process round to 0 // put HARQ process round to 0
if (cc->tdd_Config) RA_template->harq_pid = ((frameP*10)+subframeP)%10; if (cc->tdd_Config)
else RA_template->harq_pid = ((frameP*10)+subframeP)&7; RA_template->harq_pid = ((frameP * 10) + subframeP) % 10;
else
RA_template->harq_pid = ((frameP * 10) + subframeP) & 7;
UE_list->UE_sched_ctrl[UE_id].round[CC_idP][RA_template->harq_pid] = 0; UE_list->UE_sched_ctrl[UE_id].round[CC_idP][RA_template->harq_pid] = 0;
if ((RA_template->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) { if ((RA_template->msg4_TBsize - rrc_sdu_length - msg4_header) <= 2) {
@@ -909,8 +881,7 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
module_idP, CC_idP, frameP, subframeP, RA_template->msg4_TBsize, rrc_sdu_length, msg4_header, msg4_padding, msg4_post_padding); module_idP, CC_idP, frameP, subframeP, RA_template->msg4_TBsize, rrc_sdu_length, msg4_header, msg4_padding, msg4_post_padding);
DevAssert (UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return DevAssert (UE_id != UE_INDEX_INVALID); // FIXME not sure how to gracefully return
// CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0] // CHECK THIS: &cc[CC_idP].CCCH_pdu.payload[0]
offset = generate_dlsch_header((unsigned char*)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], offset = generate_dlsch_header ((unsigned char *) eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], 1, //num_sdus
1, //num_sdus
(unsigned short *) &rrc_sdu_length, // (unsigned short *) &rrc_sdu_length, //
&lcid, // sdu_lcid &lcid, // sdu_lcid
255, // no drx 255, // no drx
@@ -919,17 +890,10 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
msg4_padding, // no padding msg4_padding, // no padding
msg4_post_padding); msg4_post_padding);
memcpy((void*)&eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0][(unsigned char)offset], memcpy ((void *) &eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0][(unsigned char) offset], &cc[CC_idP].CCCH_pdu.payload[0], rrc_sdu_length);
&cc[CC_idP].CCCH_pdu.payload[0],
rrc_sdu_length);
// DLSCH Config // DLSCH Config
fill_nfapi_dlsch_config(eNB, fill_nfapi_dlsch_config (eNB, dl_req, RA_template->msg4_TBsize, eNB->pdu_index[CC_idP], RA_template->rnti, 2, // resource_allocation_type : format 1A/1B/1D
dl_req,
RA_template->msg4_TBsize,
eNB->pdu_index[CC_idP],
RA_template->rnti,
2, // resource_allocation_type : format 1A/1B/1D
0, // virtual_resource_block_assignment_flag : localized 0, // virtual_resource_block_assignment_flag : localized
getRIV (N_RB_DL, first_rb, 4), // resource_block_coding : RIV, 4 PRB getRIV (N_RB_DL, first_rb, 4), // resource_block_coding : RIV, 4 PRB
2, // modulation: QPSK 2, // modulation: QPSK
@@ -952,31 +916,21 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
// DL request // DL request
eNB->TX_req[CC_idP].sfn_sf = fill_nfapi_tx_req (&eNB->TX_req[CC_idP].tx_request_body, eNB->TX_req[CC_idP].sfn_sf = fill_nfapi_tx_req (&eNB->TX_req[CC_idP].tx_request_body,
(frameP*10)+subframeP, (frameP * 10) + subframeP, rrc_sdu_length, eNB->pdu_index[CC_idP], eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0]);
rrc_sdu_length,
eNB->pdu_index[CC_idP],
eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0]);
eNB->pdu_index[CC_idP]++; eNB->pdu_index[CC_idP]++;
LOG_D (MAC, "Filling UCI ACK/NAK information, cce_idx %d\n", dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx); LOG_D (MAC, "Filling UCI ACK/NAK information, cce_idx %d\n", dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
// Program PUCCH1a for ACK/NAK // Program PUCCH1a for ACK/NAK
// Program ACK/NAK for Msg4 PDSCH // Program ACK/NAK for Msg4 PDSCH
fill_nfapi_uci_acknak(module_idP, fill_nfapi_uci_acknak (module_idP, CC_idP, RA_template->rnti, (frameP * 10) + subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
CC_idP,
RA_template->rnti,
(frameP*10)+subframeP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
T (T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT (module_idP), T_INT (CC_idP), T_INT (RA_template->rnti), T_INT (frameP), T_INT (subframeP), T (T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT (module_idP), T_INT (CC_idP), T_INT (RA_template->rnti), T_INT (frameP), T_INT (subframeP),
T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->msg4_TBsize)); T_INT (0 /*harq_pid always 0? */ ), T_BUFFER (&eNB->UE_list.DLSCH_pdu[CC_idP][0][UE_id].payload[0], RA_template->msg4_TBsize));
if (opt_enabled == 1) { if (opt_enabled == 1) {
trace_pdu(1, (uint8_t *)eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char)UE_id].payload[0], trace_pdu (1, (uint8_t *) eNB->UE_list.DLSCH_pdu[CC_idP][0][(unsigned char) UE_id].payload[0], rrc_sdu_length, UE_id, 3, UE_RNTI (module_idP, UE_id), eNB->frame, eNB->subframe, 0, 0);
rrc_sdu_length, UE_id, 3, UE_RNTI(module_idP, UE_id), LOG_D (OPT, "[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n", module_idP, CC_idP, frameP, UE_RNTI (module_idP, UE_id), rrc_sdu_length);
eNB->frame, eNB->subframe,0,0);
LOG_D(OPT,"[eNB %d][DLSCH] CC_id %d Frame %d trace pdu for rnti %x with size %d\n",
module_idP, CC_idP, frameP, UE_RNTI(module_idP,UE_id), rrc_sdu_length);
} }
} // CCE Allocation feasible } // CCE Allocation feasible
@@ -984,7 +938,9 @@ void generate_Msg4(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t
} // else rach_resource_type } // else rach_resource_type
} }
void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,sub_frame_t subframeP,RA_TEMPLATE *RA_template) { void
check_Msg4_retransmission (module_id_t module_idP, int CC_idP, frame_t frameP, sub_frame_t subframeP, RA_TEMPLATE * RA_template)
{
eNB_MAC_INST *eNB = RC.mac[module_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = eNB->common_channels; COMMON_channels_t *cc = eNB->common_channels;
@@ -1044,16 +1000,14 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu]; dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
N_RB_DL = to_prb (cc[CC_idP].mib->message.dl_Bandwidth); N_RB_DL = to_prb (cc[CC_idP].mib->message.dl_Bandwidth);
LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 for harq_pid %d was acknowledged (round %d)\n", LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Checking if Msg4 for harq_pid %d was acknowledged (round %d)\n", module_idP, CC_idP, frameP, subframeP, RA_template->harq_pid, round);
module_idP,CC_idP,frameP,subframeP,RA_template->harq_pid,round);
if (round != 8) { if (round != 8) {
#ifdef Rel14 #ifdef Rel14
if (RA_template->rach_resource_type > 0) { if (RA_template->rach_resource_type > 0) {
AssertFatal (1 == 0, "Msg4 Retransmissions not handled yet for BL/CE UEs\n"); AssertFatal (1 == 0, "Msg4 Retransmissions not handled yet for BL/CE UEs\n");
} } else
else
#endif #endif
{ {
if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) { if ((RA_template->Msg4_frame == frameP) && (RA_template->Msg4_subframe == subframeP)) {
@@ -1067,8 +1021,7 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,
vrb_map[first_rb + 2] = 1; vrb_map[first_rb + 2] = 1;
vrb_map[first_rb + 3] = 1; vrb_map[first_rb + 3] = 1;
fill_nfapi_dl_dci_1A(dl_config_pdu, fill_nfapi_dl_dci_1A (dl_config_pdu, 4, // aggregation_level
4, // aggregation_level
RA_template->rnti, // rnti RA_template->rnti, // rnti
1, // rnti_type, CRNTI 1, // rnti_type, CRNTI
RA_template->harq_pid, // harq_process RA_template->harq_pid, // harq_process
@@ -1085,12 +1038,8 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,
LOG_D (MAC, "msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP); LOG_D (MAC, "msg4 retransmission for rnti %x (round %d) fsf %d/%d\n", RA_template->rnti, round, frameP, subframeP);
// DLSCH Config // DLSCH Config
fill_nfapi_dlsch_config(eNB, fill_nfapi_dlsch_config (eNB, dl_req, RA_template->msg4_TBsize, -1 /* retransmission, no pdu_index */ ,
dl_req, RA_template->rnti, 2, // resource_allocation_type : format 1A/1B/1D
RA_template->msg4_TBsize,
-1 /* retransmission, no pdu_index */,
RA_template->rnti,
2, // resource_allocation_type : format 1A/1B/1D
0, // virtual_resource_block_assignment_flag : localized 0, // virtual_resource_block_assignment_flag : localized
getRIV (N_RB_DL, first_rb, 4), // resource_block_coding : RIV, 4 PRB getRIV (N_RB_DL, first_rb, 4), // resource_block_coding : RIV, 4 PRB
2, // modulation: QPSK 2, // modulation: QPSK
@@ -1109,21 +1058,18 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,
(cc->p_eNB == 1) ? 1 : 2, // transmission mode (cc->p_eNB == 1) ? 1 : 2, // transmission mode
1, // num_bf_prb_per_subband 1, // num_bf_prb_per_subband
1); // num_bf_vector 1); // num_bf_vector
} } else
else
LOG_D (MAC, "msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP); LOG_D (MAC, "msg4 retransmission for rnti %x (round %d) fsf %d/%d CCE allocation failed!\n", RA_template->rnti, round, frameP, subframeP);
// Program PUCCH1a for ACK/NAK // Program PUCCH1a for ACK/NAK
fill_nfapi_uci_acknak(module_idP,CC_idP, fill_nfapi_uci_acknak (module_idP, CC_idP, RA_template->rnti, (frameP * 10) + subframeP, dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
RA_template->rnti,
(frameP*10)+subframeP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx);
// prepare frame for retransmission // prepare frame for retransmission
if (RA_template->Msg4_subframe>1) RA_template->Msg4_frame++; if (RA_template->Msg4_subframe > 1)
RA_template->Msg4_frame++;
RA_template->Msg4_frame &= 1023; RA_template->Msg4_frame &= 1023;
RA_template->Msg4_subframe = (RA_template->Msg4_subframe + 8) % 10; RA_template->Msg4_subframe = (RA_template->Msg4_subframe + 8) % 10;
@@ -1142,7 +1088,8 @@ void check_Msg4_retransmission(module_id_t module_idP,int CC_idP,frame_t frameP,
} }
} }
void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP) void
schedule_RA (module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
{ {
int CC_id; int CC_id;
@@ -1156,7 +1103,8 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
// skip UL component carriers if TDD // skip UL component carriers if TDD
if (is_UL_sf(&cc[CC_id],subframeP)==1) continue; if (is_UL_sf (&cc[CC_id], subframeP) == 1)
continue;
for (i = 0; i < NB_RA_PROC_MAX; i++) { for (i = 0; i < NB_RA_PROC_MAX; i++) {
@@ -1168,9 +1116,12 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n", LOG_I (MAC, "[eNB %d][RAPROC] Frame %d, Subframe %d : CC_id %d RA %d is active (generate RAR %d, generate_Msg4 %d, wait_ack_Msg4 %d, rnti %x)\n",
module_idP, frameP, subframeP, CC_id, i, RA_template->generate_rar, RA_template->generate_Msg4, RA_template->wait_ack_Msg4, RA_template->rnti); module_idP, frameP, subframeP, CC_id, i, RA_template->generate_rar, RA_template->generate_Msg4, RA_template->wait_ack_Msg4, RA_template->rnti);
if (RA_template->generate_rar == 1) generate_Msg2(module_idP,CC_id,frameP,subframeP,RA_template); if (RA_template->generate_rar == 1)
else if (RA_template->generate_Msg4 == 1) generate_Msg4(module_idP,CC_id,frameP,subframeP,RA_template); generate_Msg2 (module_idP, CC_id, frameP, subframeP, RA_template);
else if (RA_template->wait_ack_Msg4==1) check_Msg4_retransmission(module_idP,CC_id,frameP,subframeP,RA_template); else if (RA_template->generate_Msg4 == 1)
generate_Msg4 (module_idP, CC_id, frameP, subframeP, RA_template);
else if (RA_template->wait_ack_Msg4 == 1)
check_Msg4_retransmission (module_idP, CC_id, frameP, subframeP, RA_template);
} // RA_active == TRUE } // RA_active == TRUE
@@ -1182,16 +1133,10 @@ void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP)
// handles the event of MSG1 reception // handles the event of MSG1 reception
void initiate_ra_proc(module_id_t module_idP, void
int CC_id, initiate_ra_proc (module_id_t module_idP, int CC_id, frame_t frameP, sub_frame_t subframeP, uint16_t preamble_index, int16_t timing_offset, uint16_t ra_rnti
frame_t frameP,
sub_frame_t subframeP,
uint16_t preamble_index,
int16_t timing_offset,
uint16_t ra_rnti
#ifdef Rel14 #ifdef Rel14
, , uint8_t rach_resource_type
uint8_t rach_resource_type
#endif #endif
) )
{ {
@@ -1213,12 +1158,9 @@ void initiate_ra_proc(module_id_t module_idP,
LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n", module_idP, CC_id, frameP, subframeP, rach_resource_type); LOG_D (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n", module_idP, CC_id, frameP, subframeP, rach_resource_type);
#endif #endif
if (prach_ParametersListCE_r13 && if (prach_ParametersListCE_r13 && prach_ParametersListCE_r13->list.count < rach_resource_type) {
prach_ParametersListCE_r13->list.count<rach_resource_type) {
LOG_E (MAC, "[eNB %d][RAPROC] CC_id %d Received impossible PRACH resource type %d, only %d CE levels configured\n", LOG_E (MAC, "[eNB %d][RAPROC] CC_id %d Received impossible PRACH resource type %d, only %d CE levels configured\n",
module_idP,CC_id, module_idP, CC_id, rach_resource_type, (int) prach_ParametersListCE_r13->list.count);
rach_resource_type,
(int)prach_ParametersListCE_r13->list.count);
return; return;
} }
@@ -1226,8 +1168,7 @@ void initiate_ra_proc(module_id_t module_idP,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME (VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME (VCD_SIGNAL_DUMPER_FUNCTIONS_INITIATE_RA_PROC, 0);
for (i = 0; i < NB_RA_PROC_MAX; i++) { for (i = 0; i < NB_RA_PROC_MAX; i++) {
if (RA_template[i].RA_active==FALSE && if (RA_template[i].RA_active == FALSE && RA_template[i].wait_ack_Msg4 == 0) {
RA_template[i].wait_ack_Msg4 == 0) {
int loop = 0; int loop = 0;
LOG_D (MAC, "Frame %d, Subframe %d: Activating RA process %d\n", frameP, subframeP, i); LOG_D (MAC, "Frame %d, Subframe %d: Activating RA process %d\n", frameP, subframeP, i);
RA_template[i].RA_active = TRUE; RA_template[i].RA_active = TRUE;
@@ -1254,16 +1195,15 @@ void initiate_ra_proc(module_id_t module_idP,
!(find_UE_id (module_idP, RA_template[i].rnti) == -1 && !(find_UE_id (module_idP, RA_template[i].rnti) == -1 &&
/* 1024 and 60000 arbirarily chosen, not coming from standard */ /* 1024 and 60000 arbirarily chosen, not coming from standard */
RA_template[i].rnti >= 1024 && RA_template[i].rnti < 60000)); RA_template[i].rnti >= 1024 && RA_template[i].rnti < 60000));
if (loop == 100) { printf("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__); abort(); } if (loop == 100) {
printf ("%s:%d:%s: FATAL ERROR! contact the authors\n", __FILE__, __LINE__, __FUNCTION__);
abort ();
}
RA_template[i].RA_rnti = ra_rnti; RA_template[i].RA_rnti = ra_rnti;
RA_template[i].preamble_index = preamble_index; RA_template[i].preamble_index = preamble_index;
LOG_I (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, RA_active %d\n", LOG_I (MAC, "[eNB %d][RAPROC] CC_id %d Frame %d Activating RAR generation in Frame %d, subframe %d for process %d, rnti %x, RA_active %d\n",
module_idP,CC_id,frameP, module_idP, CC_id, frameP, RA_template[i].Msg2_frame, RA_template[i].Msg2_subframe, i, RA_template[i].rnti, RA_template[i].RA_active);
RA_template[i].Msg2_frame,
RA_template[i].Msg2_subframe,
i,RA_template[i].rnti,
RA_template[i].RA_active);
return; return;
} }
@@ -1272,7 +1212,8 @@ void initiate_ra_proc(module_id_t module_idP,
LOG_E (MAC, "[eNB %d][RAPROC] FAILURE: CC_id %d Frame %d Initiating RA procedure for preamble index %d\n", module_idP, CC_id, frameP, preamble_index); LOG_E (MAC, "[eNB %d][RAPROC] FAILURE: CC_id %d Frame %d Initiating RA procedure for preamble index %d\n", module_idP, CC_id, frameP, preamble_index);
} }
void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rnti) void
cancel_ra_proc (module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rnti)
{ {
unsigned char i; unsigned char i;
RA_TEMPLATE *RA_template = (RA_TEMPLATE *) & RC.mac[module_idP]->common_channels[CC_id].RA_template[0]; RA_TEMPLATE *RA_template = (RA_TEMPLATE *) & RC.mac[module_idP]->common_channels[CC_id].RA_template[0];
@@ -1293,4 +1234,3 @@ void cancel_ra_proc(module_id_t module_idP, int CC_id, frame_t frameP, rnti_t rn
} }
} }
} }