Commit 3f0eee50 authored by luis_pereira87's avatar luis_pereira87

Replace module_id by sib1 as input parameter in some functions where only sib1 is required

parent 11334aa4
...@@ -272,7 +272,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -272,7 +272,7 @@ void nr_dlsim_preprocessor(module_id_t module_id,
/* manually set free CCE to 0 */ /* manually set free CCE to 0 */
const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific; const int target_ss = NR_SearchSpace__searchSpaceType_PR_ue_Specific;
sched_ctrl->search_space = get_searchspace(module_id, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss); sched_ctrl->search_space = get_searchspace(NULL, scc, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, target_ss);
uint8_t nr_of_candidates; uint8_t nr_of_candidates;
find_aggregation_candidates(&sched_ctrl->aggregation_level, find_aggregation_candidates(&sched_ctrl->aggregation_level,
&nr_of_candidates, &nr_of_candidates,
...@@ -282,7 +282,7 @@ void nr_dlsim_preprocessor(module_id_t module_id, ...@@ -282,7 +282,7 @@ void nr_dlsim_preprocessor(module_id_t module_id,
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
nr_set_pdsch_semi_static(module_id, nr_set_pdsch_semi_static(NULL,
scc, scc,
UE_info->CellGroup[0], UE_info->CellGroup[0],
sched_ctrl->active_bwp, sched_ctrl->active_bwp,
......
...@@ -654,7 +654,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP, ...@@ -654,7 +654,7 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP; bwpd = (void*)CellGroup->spCellConfig->spCellConfigDedicated->initialDownlinkBWP;
genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters; genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} }
sched_ctrl->search_space = get_searchspace(Mod_idP, scc, bwpd, target_ss); sched_ctrl->search_space = get_searchspace(sib1 ? sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL, scc, bwpd, target_ss);
sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss); sched_ctrl->coreset = get_coreset(Mod_idP, scc, bwpd, sched_ctrl->search_space, target_ss);
sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP], sched_ctrl->sched_pdcch = set_pdcch_structure(RC.nrmac[Mod_idP],
sched_ctrl->search_space, sched_ctrl->search_space,
......
...@@ -869,7 +869,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t ...@@ -869,7 +869,7 @@ void nr_generate_Msg3_retransmission(module_id_t module_idP, int CC_id, frame_t
dci_pdu_rel15_t uldci_payload; dci_pdu_rel15_t uldci_payload;
memset(&uldci_payload, 0, sizeof(uldci_payload)); memset(&uldci_payload, 0, sizeof(uldci_payload));
config_uldci(module_idP, config_uldci(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
ubwp, ubwp,
ubwpd, ubwpd,
scc, scc,
......
...@@ -86,7 +86,11 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t * ...@@ -86,7 +86,11 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
else { else {
target_ss = NR_SearchSpace__searchSpaceType_PR_common; target_ss = NR_SearchSpace__searchSpaceType_PR_common;
} }
NR_SearchSpace_t *search_space = get_searchspace(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, target_ss); NR_SearchSpace_t *search_space = get_searchspace(nrmac->common_channels[0].sib1 ? nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
bwp ? bwp->bwp_Dedicated : NULL,
target_ss);
NR_ControlResourceSet_t *coreset = get_coreset(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, search_space, target_ss); NR_ControlResourceSet_t *coreset = get_coreset(module_id, scc, bwp ? bwp->bwp_Dedicated : NULL, search_space, target_ss);
// get coreset symbol "map" // get coreset symbol "map"
const uint16_t symb_coreset = (1 << coreset->duration) - 1; const uint16_t symb_coreset = (1 << coreset->duration) - 1;
...@@ -554,8 +558,9 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -554,8 +558,9 @@ bool allocate_dl_retransmission(module_id_t module_id,
int UE_id, int UE_id,
int current_harq_pid) { int current_harq_pid) {
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels->ServingCellConfigCommon; gNB_MAC_INST *nr_mac = RC.nrmac[module_id];
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; const NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels->ServingCellConfigCommon;
NR_UE_info_t *UE_info = &nr_mac->UE_info;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch; NR_sched_pdsch_t *retInfo = &sched_ctrl->harq_processes[current_harq_pid].sched_pdsch;
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
...@@ -606,13 +611,29 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -606,13 +611,29 @@ bool allocate_dl_retransmission(module_id_t module_id,
/* check whether we need to switch the TDA allocation since the last /* check whether we need to switch the TDA allocation since the last
* (re-)transmission */ * (re-)transmission */
if (ps->time_domain_allocation != tda) if (ps->time_domain_allocation != tda)
nr_set_pdsch_semi_static(module_id, scc, cg, sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, ps); nr_set_pdsch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
cg,
sched_ctrl->active_bwp,
bwpd,
tda,
ps->nrOfLayers,
sched_ctrl,
ps);
} else { } else {
/* the retransmission will use a different time domain allocation, check /* the retransmission will use a different time domain allocation, check
* that we have enough resources */ * that we have enough resources */
NR_pdsch_semi_static_t temp_ps = *ps; NR_pdsch_semi_static_t temp_ps = *ps;
nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, ps->nrOfLayers, sched_ctrl, &temp_ps); nr_set_pdsch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
UE_info->CellGroup[UE_id],
sched_ctrl->active_bwp,
bwpd,
tda,
ps->nrOfLayers,
sched_ctrl,
&temp_ps);
while (rbStart < bwpSize && while (rbStart < bwpSize &&
!(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols))) !(rballoc_mask[rbStart]&SL_to_bitmap(temp_ps.startSymbolIndex, temp_ps.nrOfSymbols)))
rbStart++; rbStart++;
...@@ -898,7 +919,15 @@ void pf_dl(module_id_t module_id, ...@@ -898,7 +919,15 @@ void pf_dl(module_id_t module_id,
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static; NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda) if (ps->nrOfLayers != layers[UE_id] || ps->time_domain_allocation != tda)
nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, bwpd, tda, layers[UE_id], sched_ctrl, ps); nr_set_pdsch_semi_static(mac->common_channels[0].sib1 ? (const NR_SIB1_t *)mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
UE_info->CellGroup[UE_id],
sched_ctrl->active_bwp,
bwpd,
tda,
layers[UE_id],
sched_ctrl,
ps);
const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols); const uint16_t slbitmap = SL_to_bitmap(ps->startSymbolIndex, ps->nrOfSymbols);
// Freq-demain allocation // Freq-demain allocation
......
...@@ -282,7 +282,7 @@ void nr_preprocessor_phytest(module_id_t module_id, ...@@ -282,7 +282,7 @@ void nr_preprocessor_phytest(module_id_t module_id,
ps->nrOfLayers = target_dl_Nl; ps->nrOfLayers = target_dl_Nl;
if (ps->time_domain_allocation != tda || ps->nrOfLayers != target_dl_Nl) if (ps->time_domain_allocation != tda || ps->nrOfLayers != target_dl_Nl)
nr_set_pdsch_semi_static(module_id, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl, ps); nr_set_pdsch_semi_static(NULL, scc, UE_info->CellGroup[UE_id], sched_ctrl->active_bwp, NULL, tda, target_dl_Nl, sched_ctrl, ps);
/* find largest unallocated chunk */ /* find largest unallocated chunk */
const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE); const int bwpSize = NRRIV2BW(sched_ctrl->active_bwp->bwp_Common->genericParameters.locationAndBandwidth, MAX_BWP_SIZE);
...@@ -465,7 +465,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_ ...@@ -465,7 +465,7 @@ bool nr_ul_preprocessor_phytest(module_id_t module_id, frame_t frame, sub_frame_
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(NULL, scc, sched_ctrl->active_ubwp, NULL,dci_format, tda, num_dmrs_cdm_grps_no_data, ps);
uint16_t rbStart = 0; uint16_t rbStart = 0;
uint16_t rbSize; uint16_t rbSize;
......
...@@ -290,7 +290,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, ...@@ -290,7 +290,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP,
} }
} }
NR_SearchSpace_t *get_searchspace(module_id_t module_id, NR_SearchSpace_t *get_searchspace(NR_SIB1_t *sib1,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
NR_SearchSpace__searchSpaceType_PR target_ss) { NR_SearchSpace__searchSpaceType_PR target_ss) {
...@@ -301,7 +301,6 @@ NR_SearchSpace_t *get_searchspace(module_id_t module_id, ...@@ -301,7 +301,6 @@ NR_SearchSpace_t *get_searchspace(module_id_t module_id,
} else if(scc) { } else if(scc) {
n = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; n = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count;
} else { } else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
n = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count; n = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.count;
} }
...@@ -312,7 +311,6 @@ NR_SearchSpace_t *get_searchspace(module_id_t module_id, ...@@ -312,7 +311,6 @@ NR_SearchSpace_t *get_searchspace(module_id_t module_id,
} else if(scc) { } else if(scc) {
ss = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; ss = scc->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i];
} else { } else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
ss = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i]; ss = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list.array[i];
} }
AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n"); AssertFatal(ss->controlResourceSetId != NULL, "ss->controlResourceSetId is null\n");
...@@ -546,7 +544,7 @@ bool nr_find_nb_rb(uint16_t Qm, ...@@ -546,7 +544,7 @@ bool nr_find_nb_rb(uint16_t Qm,
return *tbs >= bytes && *nb_rb <= nb_rb_max; return *tbs >= bytes && *nb_rb <= nb_rb_max;
} }
void nr_set_pdsch_semi_static(module_id_t module_id, void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
const NR_CellGroupConfig_t *secondaryCellGroup, const NR_CellGroupConfig_t *secondaryCellGroup,
const NR_BWP_Downlink_t *bwp, const NR_BWP_Downlink_t *bwp,
...@@ -595,7 +593,6 @@ void nr_set_pdsch_semi_static(module_id_t module_id, ...@@ -595,7 +593,6 @@ void nr_set_pdsch_semi_static(module_id_t module_id,
} else if(scc) { } else if(scc) {
tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; tdaList = scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
} else { } else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList; tdaList = sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList;
} }
AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count); AssertFatal(tda < tdaList->list.count, "time_domain_allocation %d>=%d\n", tda, tdaList->list.count);
...@@ -651,7 +648,7 @@ void nr_set_pdsch_semi_static(module_id_t module_id, ...@@ -651,7 +648,7 @@ void nr_set_pdsch_semi_static(module_id_t module_id,
LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT); LOG_D(NR_MAC,"bwpd0 %p, bwpd %p : Filling dmrs info, ps->N_PRB_DMRS %d, ps->dl_dmrs_symb_pos %x, ps->N_DMRS_SLOT %d\n",bwpd0,bwpd,ps->N_PRB_DMRS,ps->dl_dmrs_symb_pos,ps->N_DMRS_SLOT);
} }
void nr_set_pusch_semi_static(module_id_t module_id, void nr_set_pusch_semi_static(const NR_SIB1_t *sib1,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
const NR_BWP_Uplink_t *ubwp, const NR_BWP_Uplink_t *ubwp,
const NR_BWP_UplinkDedicated_t *ubwpd, const NR_BWP_UplinkDedicated_t *ubwpd,
...@@ -668,7 +665,6 @@ void nr_set_pusch_semi_static(module_id_t module_id, ...@@ -668,7 +665,6 @@ void nr_set_pusch_semi_static(module_id_t module_id,
} else if(scc) { } else if(scc) {
tdaList = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; tdaList = scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
} else { } else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
tdaList = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList; tdaList = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
} }
...@@ -952,7 +948,7 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu, ...@@ -952,7 +948,7 @@ void nr_configure_css_dci_initial(nfapi_nr_dl_tti_pdcch_pdu_rel15_t* pdcch_pdu,
} }
void config_uldci(module_id_t module_id, void config_uldci(const NR_SIB1_t *sib1,
const NR_BWP_Uplink_t *ubwp, const NR_BWP_Uplink_t *ubwp,
const NR_BWP_UplinkDedicated_t *ubwpd, const NR_BWP_UplinkDedicated_t *ubwpd,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
...@@ -966,7 +962,7 @@ void config_uldci(module_id_t module_id, ...@@ -966,7 +962,7 @@ void config_uldci(module_id_t module_id,
NR_BWP_t *genericParameters = get_ul_bwp_genericParameters((NR_BWP_Uplink_t *)ubwp, NR_BWP_t *genericParameters = get_ul_bwp_genericParameters((NR_BWP_Uplink_t *)ubwp,
(NR_ServingCellConfigCommon_t *)scc, (NR_ServingCellConfigCommon_t *)scc,
RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL); (NR_SIB1_t *)sib1);
const int bw = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const int bw = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
...@@ -1091,7 +1087,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, ...@@ -1091,7 +1087,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset,
} }
// This function configures pucch pdu fapi structure // This function configures pucch pdu fapi structure
void nr_configure_pucch(module_id_t module_id, void nr_configure_pucch(NR_SIB1_t *sib1,
nfapi_nr_pucch_pdu_t* pucch_pdu, nfapi_nr_pucch_pdu_t* pucch_pdu,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_CellGroupConfig_t *CellGroup, NR_CellGroupConfig_t *CellGroup,
...@@ -1141,7 +1137,6 @@ void nr_configure_pucch(module_id_t module_id, ...@@ -1141,7 +1137,6 @@ void nr_configure_pucch(module_id_t module_id,
} else if(scc) { } else if(scc) {
pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup; pucch_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup;
} else { } else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
pucch_ConfigCommon = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup; pucch_ConfigCommon = sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.pucch_ConfigCommon->choice.setup;
} }
...@@ -1171,9 +1166,7 @@ void nr_configure_pucch(module_id_t module_id, ...@@ -1171,9 +1166,7 @@ void nr_configure_pucch(module_id_t module_id,
else else
pucch_pdu->hopping_id = *scc->physCellId; pucch_pdu->hopping_id = *scc->physCellId;
NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(bwp, NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(bwp,scc, sib1);
scc,
RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
pucch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pucch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); pucch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
...@@ -2247,8 +2240,9 @@ int get_ul_bwp_id(const NR_ServingCellConfig_t *servingCellConfig) ...@@ -2247,8 +2240,9 @@ int get_ul_bwp_id(const NR_ServingCellConfig_t *servingCellConfig)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellGroup) int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellGroup)
{ {
NR_ServingCellConfigCommon_t *scc = RC.nrmac[mod_idP]->common_channels[0].ServingCellConfigCommon; gNB_MAC_INST *nr_mac = RC.nrmac[mod_idP];
NR_UE_info_t *UE_info = &RC.nrmac[mod_idP]->UE_info; NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels[0].ServingCellConfigCommon;
NR_UE_info_t *UE_info = &nr_mac->UE_info;
LOG_I(NR_MAC, "[gNB %d] Adding UE with rnti 0x%04x (num_UEs %d)\n", LOG_I(NR_MAC, "[gNB %d] Adding UE with rnti 0x%04x (num_UEs %d)\n",
mod_idP, mod_idP,
rntiP, rntiP,
...@@ -2307,7 +2301,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG ...@@ -2307,7 +2301,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
&sched_ctrl->active_bwp->bwp_Common->genericParameters: &sched_ctrl->active_bwp->bwp_Common->genericParameters:
&scc->uplinkConfigCommon->initialUplinkBWP->genericParameters; &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common; const int target_ss = sched_ctrl->active_bwp ? NR_SearchSpace__searchSpaceType_PR_ue_Specific : NR_SearchSpace__searchSpaceType_PR_common;
sched_ctrl->search_space = get_searchspace(mod_idP, scc, sched_ctrl->search_space = get_searchspace(nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL, sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Dedicated : NULL,
target_ss); target_ss);
sched_ctrl->coreset = get_coreset(mod_idP, scc, sched_ctrl->coreset = get_coreset(mod_idP, scc,
......
...@@ -44,7 +44,8 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, ...@@ -44,7 +44,8 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
const NR_sched_pucch_t *pucch, const NR_sched_pucch_t *pucch,
int UE_id) int UE_id)
{ {
NR_UE_info_t *UE_info = &RC.nrmac[mod_id]->UE_info; gNB_MAC_INST *nr_mac = RC.nrmac[mod_id];
NR_UE_info_t *UE_info = &nr_mac->UE_info;
nfapi_nr_ul_tti_request_t *future_ul_tti_req = nfapi_nr_ul_tti_request_t *future_ul_tti_req =
&RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot]; &RC.nrmac[mod_id]->UL_tti_req_ahead[0][pucch->ul_slot];
...@@ -81,7 +82,7 @@ void nr_fill_nfapi_pucch(module_id_t mod_id, ...@@ -81,7 +82,7 @@ void nr_fill_nfapi_pucch(module_id_t mod_id,
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL;
LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot); LOG_D(NR_MAC,"pucch_acknak: %d.%d Calling nr_configure_pucch (ubwpd %p,r_pucch %d) pucch in %d.%d\n",frame,slot,ubwpd,pucch->r_pucch,pucch->frame,pucch->ul_slot);
nr_configure_pucch(mod_id, nr_configure_pucch(nr_mac->common_channels[0].sib1 ? nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
pucch_pdu, pucch_pdu,
scc, scc,
UE_info->CellGroup[UE_id], UE_info->CellGroup[UE_id],
......
...@@ -980,8 +980,9 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -980,8 +980,9 @@ bool allocate_ul_retransmission(module_id_t module_id,
int harq_pid) int harq_pid)
{ {
const int CC_id = 0; const int CC_id = 0;
const NR_ServingCellConfigCommon_t *scc = RC.nrmac[module_id]->common_channels[CC_id].ServingCellConfigCommon; gNB_MAC_INST *nr_mac = RC.nrmac[module_id];
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; const NR_ServingCellConfigCommon_t *scc = nr_mac->common_channels[CC_id].ServingCellConfigCommon;
NR_UE_info_t *UE_info = &nr_mac->UE_info;
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
NR_sched_pusch_t *retInfo = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch; NR_sched_pusch_t *retInfo = &sched_ctrl->ul_harq_processes[harq_pid].sched_pusch;
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
...@@ -1018,7 +1019,14 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -1018,7 +1019,14 @@ bool allocate_ul_retransmission(module_id_t module_id,
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
sched_ctrl->active_ubwp,
ubwpd,
dci_format,
tda,
num_dmrs_cdm_grps_no_data,
ps);
LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size); LOG_D(NR_MAC, "%s(): retransmission keeping TDA %d and TBS %d\n", __func__, tda, retInfo->tb_size);
} else { } else {
/* the retransmission will use a different time domain allocation, check /* the retransmission will use a different time domain allocation, check
...@@ -1030,7 +1038,14 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -1030,7 +1038,14 @@ bool allocate_ul_retransmission(module_id_t module_id,
rbSize++; rbSize++;
NR_pusch_semi_static_t temp_ps; NR_pusch_semi_static_t temp_ps;
int dci_format = get_dci_format(sched_ctrl); int dci_format = get_dci_format(sched_ctrl);
nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp,ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, &temp_ps); nr_set_pusch_semi_static(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
sched_ctrl->active_ubwp,
ubwpd,
dci_format,
tda,
num_dmrs_cdm_grps_no_data,
&temp_ps);
uint32_t new_tbs; uint32_t new_tbs;
uint16_t new_rbSize; uint16_t new_rbSize;
bool success = nr_find_nb_rb(retInfo->Qm, bool success = nr_find_nb_rb(retInfo->Qm,
...@@ -1262,7 +1277,14 @@ void pf_ul(module_id_t module_id, ...@@ -1262,7 +1277,14 @@ void pf_ul(module_id_t module_id,
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
sched_ctrl->active_ubwp,
ubwpd,
dci_format,
tda,
num_dmrs_cdm_grps_no_data,
ps);
NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch; NR_sched_pusch_t *sched_pusch = &sched_ctrl->sched_pusch;
sched_pusch->mcs = 9; sched_pusch->mcs = 9;
update_ul_ue_R_Qm(sched_pusch, ps); update_ul_ue_R_Qm(sched_pusch, ps);
...@@ -1385,7 +1407,14 @@ void pf_ul(module_id_t module_id, ...@@ -1385,7 +1407,14 @@ void pf_ul(module_id_t module_id,
if (ps->time_domain_allocation != tda if (ps->time_domain_allocation != tda
|| ps->dci_format != dci_format || ps->dci_format != dci_format
|| ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data) || ps->num_dmrs_cdm_grps_no_data != num_dmrs_cdm_grps_no_data)
nr_set_pusch_semi_static(module_id, scc, sched_ctrl->active_ubwp, ubwpd, dci_format, tda, num_dmrs_cdm_grps_no_data, ps); nr_set_pusch_semi_static(nrmac->common_channels[0].sib1 ? (const NR_SIB1_t *)nrmac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
scc,
sched_ctrl->active_ubwp,
ubwpd,
dci_format,
tda,
num_dmrs_cdm_grps_no_data,
ps);
update_ul_ue_R_Qm(sched_pusch, ps); update_ul_ue_R_Qm(sched_pusch, ps);
/* Calculate the current scheduling bytes and the necessary RBs */ /* Calculate the current scheduling bytes and the necessary RBs */
...@@ -1892,7 +1921,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ...@@ -1892,7 +1921,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count; n_ubwp = cg->spCellConfig->spCellConfigDedicated->uplinkConfig->uplinkBWP_ToAddModList->list.count;
} }
config_uldci(module_id, config_uldci(nr_mac->common_channels[0].sib1 ? (const NR_SIB1_t *)nr_mac->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL,
sched_ctrl->active_ubwp, sched_ctrl->active_ubwp,
ubwpd, ubwpd,
scc, scc,
......
...@@ -177,7 +177,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id, ...@@ -177,7 +177,7 @@ void handle_nr_uci_pucch_2_3_4(module_id_t mod_id,
const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234); const nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_234);
void config_uldci(module_id_t module_id, void config_uldci(const NR_SIB1_t *sib1,
const NR_BWP_Uplink_t *ubwp, const NR_BWP_Uplink_t *ubwp,
const NR_BWP_UplinkDedicated_t *ubwpd, const NR_BWP_UplinkDedicated_t *ubwpd,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
...@@ -242,7 +242,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset, ...@@ -242,7 +242,7 @@ int nr_get_pucch_resource(NR_ControlResourceSet_t *coreset,
NR_BWP_UplinkDedicated_t *bwpd, NR_BWP_UplinkDedicated_t *bwpd,
int CCEIndex); int CCEIndex);
void nr_configure_pucch(module_id_t module_id, void nr_configure_pucch(NR_SIB1_t *sib1,
nfapi_nr_pucch_pdu_t* pucch_pdu, nfapi_nr_pucch_pdu_t* pucch_pdu,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_CellGroupConfig_t *CellGroup, NR_CellGroupConfig_t *CellGroup,
...@@ -316,7 +316,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, ...@@ -316,7 +316,7 @@ NR_ControlResourceSet_t *get_coreset(module_id_t module_idP,
NR_SearchSpace__searchSpaceType_PR ss_type); NR_SearchSpace__searchSpaceType_PR ss_type);
/* find a search space within a BWP */ /* find a search space within a BWP */
NR_SearchSpace_t *get_searchspace(module_id_t module_id, NR_SearchSpace_t *get_searchspace(NR_SIB1_t *sib1,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
NR_BWP_DownlinkDedicated_t *bwp_Dedicated, NR_BWP_DownlinkDedicated_t *bwp_Dedicated,
NR_SearchSpace__searchSpaceType_PR target_ss); NR_SearchSpace__searchSpaceType_PR target_ss);
...@@ -327,7 +327,7 @@ long get_K2(NR_ServingCellConfigCommon_t *scc, ...@@ -327,7 +327,7 @@ long get_K2(NR_ServingCellConfigCommon_t *scc,
int time_domain_assignment, int time_domain_assignment,
int mu); int mu);
void nr_set_pdsch_semi_static(module_id_t module_id, void nr_set_pdsch_semi_static(const NR_SIB1_t *sib1,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
const NR_CellGroupConfig_t *secondaryCellGroup, const NR_CellGroupConfig_t *secondaryCellGroup,
const NR_BWP_Downlink_t *bwp, const NR_BWP_Downlink_t *bwp,
...@@ -337,7 +337,7 @@ void nr_set_pdsch_semi_static(module_id_t module_id, ...@@ -337,7 +337,7 @@ void nr_set_pdsch_semi_static(module_id_t module_id,
NR_UE_sched_ctrl_t *sched_ctrl, NR_UE_sched_ctrl_t *sched_ctrl,
NR_pdsch_semi_static_t *ps); NR_pdsch_semi_static_t *ps);
void nr_set_pusch_semi_static(module_id_t module_id, void nr_set_pusch_semi_static(const NR_SIB1_t *sib1,
const NR_ServingCellConfigCommon_t *scc, const NR_ServingCellConfigCommon_t *scc,
const NR_BWP_Uplink_t *ubwp, const NR_BWP_Uplink_t *ubwp,
const NR_BWP_UplinkDedicated_t *ubwpd, const NR_BWP_UplinkDedicated_t *ubwpd,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment