Commit 0e85b51f authored by luis_pereira87's avatar luis_pereira87

Creation of get_dl_bwp_genericParameters and get_ul_bwp_genericParameters...

Creation of get_dl_bwp_genericParameters and get_ul_bwp_genericParameters functions to avoid replicated code
parent 0d929017
...@@ -573,15 +573,9 @@ bool allocate_dl_retransmission(module_id_t module_id, ...@@ -573,15 +573,9 @@ bool allocate_dl_retransmission(module_id_t module_id,
cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig ?
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL;
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp,
if(sched_ctrl->active_bwp) { RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon,
genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
genericParameters = &RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId;
const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
...@@ -828,15 +822,9 @@ void pf_dl(module_id_t module_id, ...@@ -828,15 +822,9 @@ void pf_dl(module_id_t module_id,
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];
const uint16_t rnti = UE_info->rnti[UE_id]; const uint16_t rnti = UE_info->rnti[UE_id];
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp,
if(sched_ctrl->active_bwp) { RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon,
genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId; const int coresetid = (sched_ctrl->active_bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : RC.nrmac[module_id]->sched_ctrlCommon->coreset->controlResourceSetId;
const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const uint16_t bwpSize = coresetid == 0 ? RC.nrmac[module_id]->cset0_bwp_size : NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
...@@ -975,15 +963,9 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t ...@@ -975,15 +963,9 @@ void nr_fr1_dlsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength; const int startSymbolAndLength = tdaList->list.array[tda]->startSymbolAndLength;
SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols); SLIV2SL(startSymbolAndLength, &startSymbolIndex, &nrOfSymbols);
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(sched_ctrl->active_bwp,
if(sched_ctrl->active_bwp) { RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon,
genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
NR_BWP_DownlinkDedicated_t *bwpd = NR_BWP_DownlinkDedicated_t *bwpd =
UE_info->CellGroup[UE_id] && UE_info->CellGroup[UE_id] &&
...@@ -1158,25 +1140,16 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -1158,25 +1140,16 @@ void nr_schedule_ue_spec(module_id_t module_id,
sched_ctrl->tpc1); sched_ctrl->tpc1);
NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp; NR_BWP_Downlink_t *bwp = sched_ctrl->active_bwp;
NR_BWP_t *genericParameters = get_dl_bwp_genericParameters(bwp,
/* look up the PDCCH PDU for this CC, BWP, and CORESET. If it does not RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon,
* exist, create it */ RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
// BWP
NR_BWP_t *genericParameters = NULL;
if(bwp) {
genericParameters = &sched_ctrl->active_bwp->bwp_Common->genericParameters;
} else if(RC.nrmac[module_id]->common_channels[0].ServingCellConfigCommon) {
genericParameters = &scc->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space : gNB_mac->sched_ctrlCommon->search_space; NR_SearchSpace_t *ss = (bwp||bwpd) ? sched_ctrl->search_space : gNB_mac->sched_ctrlCommon->search_space;
const int bwpid = bwp ? bwp->bwp_Id : 0; const int bwpid = bwp ? bwp->bwp_Id : 0;
const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId; const int coresetid = (bwp||bwpd) ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
/* look up the PDCCH PDU for this CC, BWP, and CORESET. If it does not exist, create it */
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][coresetid]; nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][coresetid];
if (!pdcch_pdu) { if (!pdcch_pdu) {
LOG_D(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n"); LOG_D(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n");
......
...@@ -226,6 +226,34 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) { ...@@ -226,6 +226,34 @@ void set_dl_dmrs_ports(NR_pdsch_semi_static_t *ps) {
} }
} }
NR_BWP_t *get_dl_bwp_genericParameters(NR_BWP_Downlink_t *active_bwp,
NR_ServingCellConfigCommon_t *ServingCellConfigCommon,
NR_SIB1_t *sib1) {
NR_BWP_t *genericParameters = NULL;
if (active_bwp) {
genericParameters = &active_bwp->bwp_Common->genericParameters;
} else if (ServingCellConfigCommon) {
genericParameters = &ServingCellConfigCommon->downlinkConfigCommon->initialDownlinkBWP->genericParameters;
} else {
genericParameters = &sib1->servingCellConfigCommon->downlinkConfigCommon.initialDownlinkBWP.genericParameters;
}
return genericParameters;
}
NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp,
NR_ServingCellConfigCommon_t *ServingCellConfigCommon,
NR_SIB1_t *sib1) {
NR_BWP_t *genericParameters = NULL;
if (active_ubwp) {
genericParameters = &active_ubwp->bwp_Common->genericParameters;
} else if (ServingCellConfigCommon) {
genericParameters = &ServingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
return genericParameters;
}
NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_ControlResourceSet_t *get_coreset(module_id_t module_idP,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
void *bwp, void *bwp,
...@@ -936,15 +964,9 @@ void config_uldci(module_id_t module_id, ...@@ -936,15 +964,9 @@ void config_uldci(module_id_t module_id,
int n_ubwp, int n_ubwp,
int bwp_id) { int bwp_id) {
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters((NR_BWP_Uplink_t *)ubwp,
if(ubwp) { (NR_ServingCellConfigCommon_t *)scc,
genericParameters = &ubwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if(scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
const int bw = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const int bw = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
...@@ -1149,15 +1171,9 @@ void nr_configure_pucch(module_id_t module_id, ...@@ -1149,15 +1171,9 @@ 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 = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(bwp,
if (bwp) { scc,
genericParameters = &bwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if (scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
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);
......
...@@ -742,15 +742,9 @@ void nr_csi_meas_reporting(int Mod_idP, ...@@ -742,15 +742,9 @@ void nr_csi_meas_reporting(int Mod_idP,
curr_pucch->csi_bits += curr_pucch->csi_bits +=
nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id); nr_get_csi_bitlen(Mod_idP,UE_id,csi_report_id);
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp,
if(sched_ctrl->active_ubwp) { scc,
genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; RC.nrmac[Mod_idP]->common_channels[0].sib1 ? RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if(scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[Mod_idP]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
...@@ -1762,15 +1756,9 @@ int nr_acknack_scheduling(int mod_id, ...@@ -1762,15 +1756,9 @@ int nr_acknack_scheduling(int mod_id,
pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup; pucch_Config = RC.nrmac[mod_id]->UE_info.CellGroup[UE_id]->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup;
} }
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp,
if(sched_ctrl->active_ubwp) { (NR_ServingCellConfigCommon_t *)scc,
genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; RC.nrmac[mod_id]->common_channels[0].sib1 ? RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if(scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[mod_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); int bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
......
...@@ -990,15 +990,9 @@ bool allocate_ul_retransmission(module_id_t module_id, ...@@ -990,15 +990,9 @@ bool allocate_ul_retransmission(module_id_t module_id,
cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? cg->spCellConfig->spCellConfigDedicated->uplinkConfig ?
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL;
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp,
if (sched_ctrl->active_ubwp) { (NR_ServingCellConfigCommon_t *)scc,
genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if (scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
int rbStart = 0; // wrt BWP start int rbStart = 0; // wrt BWP start
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
...@@ -1163,15 +1157,9 @@ void pf_ul(module_id_t module_id, ...@@ -1163,15 +1157,9 @@ void pf_ul(module_id_t module_id,
LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %d\n",UE_id); LOG_D(NR_MAC,"pf_ul: preparing UL scheduling for UE %d\n",UE_id);
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_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp,
if (sched_ctrl->active_ubwp) { scc,
genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if (scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
int rbStart = 0; // wrt BWP start int rbStart = 0; // wrt BWP start
NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id]; NR_CellGroupConfig_t *cg = UE_info->CellGroup[UE_id];
...@@ -1365,15 +1353,9 @@ void pf_ul(module_id_t module_id, ...@@ -1365,15 +1353,9 @@ void pf_ul(module_id_t module_id,
&& cg->spCellConfig->spCellConfigDedicated->uplinkConfig ? && cg->spCellConfig->spCellConfigDedicated->uplinkConfig ?
cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL; cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP : NULL;
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp,
if (sched_ctrl->active_ubwp) { scc,
genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if (scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0; int rbStart = sched_ctrl->active_ubwp ? NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE) : 0;
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
...@@ -1513,15 +1495,9 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t ...@@ -1513,15 +1495,9 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
uint16_t *vrb_map_UL = uint16_t *vrb_map_UL =
&RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE]; &RC.nrmac[module_id]->common_channels[CC_id].vrb_map_UL[sched_slot * MAX_BWP_SIZE];
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp,
if (sched_ctrl->active_ubwp) { scc,
genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if (scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); const uint16_t bwpSize = NRRIV2BW(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
const uint16_t bwpStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE); const uint16_t bwpStart = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth,MAX_BWP_SIZE);
...@@ -1763,15 +1739,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot) ...@@ -1763,15 +1739,9 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
pusch_pdu->handle = 0; //not yet used pusch_pdu->handle = 0; //not yet used
/* FAPI: BWP */ /* FAPI: BWP */
NR_BWP_t *genericParameters = NULL; NR_BWP_t *genericParameters = get_ul_bwp_genericParameters(sched_ctrl->active_ubwp,
if (sched_ctrl->active_ubwp) { scc,
genericParameters = &sched_ctrl->active_ubwp->bwp_Common->genericParameters; RC.nrmac[module_id]->common_channels[0].sib1 ? RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1 : NULL);
} else if (scc) {
genericParameters = &scc->uplinkConfigCommon->initialUplinkBWP->genericParameters;
} else {
NR_SIB1_t *sib1 = RC.nrmac[module_id]->common_channels[0].sib1->message.choice.c1->choice.systemInformationBlockType1;
genericParameters = &sib1->servingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP.genericParameters;
}
pusch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pusch_pdu->bwp_size = NRRIV2BW(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
pusch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE); pusch_pdu->bwp_start = NRRIV2PRBOFFSET(genericParameters->locationAndBandwidth, MAX_BWP_SIZE);
......
...@@ -300,6 +300,14 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup, ...@@ -300,6 +300,14 @@ void prepare_dci(const NR_CellGroupConfig_t *CellGroup,
nr_dci_format_t format, nr_dci_format_t format,
int bwp_id); int bwp_id);
NR_BWP_t *get_dl_bwp_genericParameters(NR_BWP_Downlink_t *active_bwp,
NR_ServingCellConfigCommon_t *ServingCellConfigCommon,
NR_SIB1_t *sib1);
NR_BWP_t *get_ul_bwp_genericParameters(NR_BWP_Uplink_t *active_ubwp,
NR_ServingCellConfigCommon_t *ServingCellConfigCommon,
NR_SIB1_t *sib1);
/* find coreset within the search space */ /* find coreset within the search space */
NR_ControlResourceSet_t *get_coreset(module_id_t module_idP, NR_ControlResourceSet_t *get_coreset(module_id_t module_idP,
NR_ServingCellConfigCommon_t *scc, NR_ServingCellConfigCommon_t *scc,
......
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