Fix indentation and improve function nr_mac_enable_ue_rrc_processing_timer
This commit is contained in:
@@ -450,22 +450,23 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts
|
|||||||
}
|
}
|
||||||
|
|
||||||
int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, rnti_t rnti, NR_SubcarrierSpacing_t subcarrierSpacing, uint32_t rrc_reconfiguration_delay) {
|
int nr_mac_enable_ue_rrc_processing_timer(module_id_t Mod_idP, rnti_t rnti, NR_SubcarrierSpacing_t subcarrierSpacing, uint32_t rrc_reconfiguration_delay) {
|
||||||
if (rrc_reconfiguration_delay > 0) {
|
|
||||||
const int UE_id = find_nr_UE_id(Mod_idP,rnti);
|
if (rrc_reconfiguration_delay == 0) {
|
||||||
if (UE_id >= 0) {
|
return -1;
|
||||||
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
|
||||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
|
||||||
if (sched_ctrl->rrc_processing_timer == 0) {
|
|
||||||
const uint16_t sf_ahead = (uint16_t) ceil(6.0/(float)(0x01<<subcarrierSpacing));
|
|
||||||
const uint16_t sl_ahead = sf_ahead * (0x01<<subcarrierSpacing);
|
|
||||||
sched_ctrl->rrc_processing_timer = (rrc_reconfiguration_delay<<subcarrierSpacing) + sl_ahead;
|
|
||||||
LOG_I(NR_MAC, "Activating RRC processing timer for UE %d\n", UE_id);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LOG_W(NR_MAC, "Could not find UE for RNTI 0x%04x\n", rnti);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
const int UE_id = find_nr_UE_id(Mod_idP,rnti);
|
||||||
|
if (UE_id < 0) {
|
||||||
|
LOG_W(NR_MAC, "Could not find UE for RNTI 0x%04x\n", rnti);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
NR_UE_info_t *UE_info = &RC.nrmac[Mod_idP]->UE_info;
|
||||||
|
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||||
|
const uint16_t sf_ahead = 6/(0x01<<subcarrierSpacing) + ((6%(0x01<<subcarrierSpacing))>0);
|
||||||
|
const uint16_t sl_ahead = sf_ahead * (0x01<<subcarrierSpacing);
|
||||||
|
sched_ctrl->rrc_processing_timer = (rrc_reconfiguration_delay<<subcarrierSpacing) + sl_ahead;
|
||||||
|
LOG_I(NR_MAC, "Activating RRC processing timer for UE %d\n", UE_id);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1059,14 +1059,13 @@ nr_pp_impl_dl nr_init_fr1_dlsch_preprocessor(module_id_t module_id, int CC_id) {
|
|||||||
const uint8_t Qm = nr_get_Qm_dl(mcs, mcsTableIdx);
|
const uint8_t Qm = nr_get_Qm_dl(mcs, mcsTableIdx);
|
||||||
const uint16_t R = nr_get_code_rate_dl(mcs, mcsTableIdx);
|
const uint16_t R = nr_get_code_rate_dl(mcs, mcsTableIdx);
|
||||||
pf_tbs[mcsTableIdx][mcs] = nr_compute_tbs(Qm,
|
pf_tbs[mcsTableIdx][mcs] = nr_compute_tbs(Qm,
|
||||||
R,
|
R,
|
||||||
1, /* rbSize */
|
1, /* rbSize */
|
||||||
10, /* hypothetical number of slots */
|
10, /* hypothetical number of slots */
|
||||||
0, /* N_PRB_DMRS * N_DMRS_SLOT */
|
0, /* N_PRB_DMRS * N_DMRS_SLOT */
|
||||||
0 /* N_PRB_oh, 0 for initialBWP */,
|
0 /* N_PRB_oh, 0 for initialBWP */,
|
||||||
0 /* tb_scaling */,
|
0 /* tb_scaling */,
|
||||||
1 /* nrOfLayers */)
|
1 /* nrOfLayers */) >> 3;
|
||||||
>> 3;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1274,15 +1273,15 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
|||||||
|
|
||||||
if (phaseTrackingRS) {
|
if (phaseTrackingRS) {
|
||||||
bool valid_ptrs_setup = set_dl_ptrs_values(phaseTrackingRS->choice.setup,
|
bool valid_ptrs_setup = set_dl_ptrs_values(phaseTrackingRS->choice.setup,
|
||||||
pdsch_pdu->rbSize,
|
pdsch_pdu->rbSize,
|
||||||
pdsch_pdu->mcsIndex[0],
|
pdsch_pdu->mcsIndex[0],
|
||||||
pdsch_pdu->mcsTable[0],
|
pdsch_pdu->mcsTable[0],
|
||||||
&pdsch_pdu->PTRSFreqDensity,
|
&pdsch_pdu->PTRSFreqDensity,
|
||||||
&pdsch_pdu->PTRSTimeDensity,
|
&pdsch_pdu->PTRSTimeDensity,
|
||||||
&pdsch_pdu->PTRSPortIndex,
|
&pdsch_pdu->PTRSPortIndex,
|
||||||
&pdsch_pdu->nEpreRatioOfPDSCHToPTRS,
|
&pdsch_pdu->nEpreRatioOfPDSCHToPTRS,
|
||||||
&pdsch_pdu->PTRSReOffset,
|
&pdsch_pdu->PTRSReOffset,
|
||||||
pdsch_pdu->NrOfSymbols);
|
pdsch_pdu->NrOfSymbols);
|
||||||
|
|
||||||
if (valid_ptrs_setup)
|
if (valid_ptrs_setup)
|
||||||
pdsch_pdu->pduBitmap |= 0x1; // Bit 0: pdschPtrs - Indicates PTRS included (FR2)
|
pdsch_pdu->pduBitmap |= 0x1; // Bit 0: pdschPtrs - Indicates PTRS included (FR2)
|
||||||
|
|||||||
Reference in New Issue
Block a user