X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Flwr_mac_fsm.c;h=bbc67cc13f156198d663e5a84d3c3b725a6f7ae8;hb=95d4c229dc30cec27c98ee66b5b689779a48dcc9;hp=a03b69ad00c64953469c3e64925040e89e595ffe;hpb=dbd113538c5ed4ee5499902ce6e8bea0eb2b9db1;p=o-du%2Fl2.git diff --git a/src/5gnrmac/lwr_mac_fsm.c b/src/5gnrmac/lwr_mac_fsm.c index a03b69ad0..bbc67cc13 100644 --- a/src/5gnrmac/lwr_mac_fsm.c +++ b/src/5gnrmac/lwr_mac_fsm.c @@ -2546,8 +2546,8 @@ void fillSib1DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *sib1PdcchInfo) * Spec 38.214 Sec 5.1.2.2.2 */ coreset0Size= sib1PdcchInfo->coresetCfg.coreSetSize; - rbStart = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb; - rbLen = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb; + rbStart = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb; + rbLen = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb; if((rbLen >=1) && (rbLen <= coreset0Size - rbStart)) { @@ -2561,10 +2561,10 @@ void fillSib1DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *sib1PdcchInfo) } /* Fetching DCI field values */ - timeDomResAssign = sib1PdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex -1; - VRB2PRBMap = sib1PdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping; - modNCodScheme = sib1PdcchInfo->dci.pdschCfg->codeword[0].mcsIndex; - redundancyVer = sib1PdcchInfo->dci.pdschCfg->codeword[0].rvIndex; + timeDomResAssign = sib1PdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex -1; + VRB2PRBMap = sib1PdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping; + modNCodScheme = sib1PdcchInfo->dci.pdschCfg.codeword[0].mcsIndex; + redundancyVer = sib1PdcchInfo->dci.pdschCfg.codeword[0].rvIndex; sysInfoInd = 0; /* 0 for SIB1; 1 for SI messages */ reserved = 0; @@ -2635,7 +2635,7 @@ void fillSib1DlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *sib1PdcchInfo) * ******************************************************************/ -void fillPageDlDciPdu(fapi_dl_dci_t *dlDciPtr, DlPageAlloc *dlPageAlloc) +void fillPageDlDciPdu(fapi_dl_dci_t *dlDciPtr, DlPageAlloc *dlPageAlloc, MacCellCfg *macCellCfg) { if(dlDciPtr != NULLP) { @@ -2666,18 +2666,18 @@ void fillPageDlDciPdu(fapi_dl_dci_t *dlDciPtr, DlPageAlloc *dlPageAlloc) uint8_t tbScalingSize = 2; uint8_t reservedSize = 6; - dlDciPtr->rnti = dlPageAlloc->pagePdcchCfg.dci.rnti; - dlDciPtr->scramblingId = dlPageAlloc->pagePdcchCfg.dci.scramblingId; - dlDciPtr->scramblingRnti = dlPageAlloc->pagePdcchCfg.dci.scramblingRnti; - dlDciPtr->cceIndex = dlPageAlloc->pagePdcchCfg.dci.cceIndex; - dlDciPtr->aggregationLevel = dlPageAlloc->pagePdcchCfg.dci.aggregLevel; - dlDciPtr->pc_and_bform.numPrgs = dlPageAlloc->pagePdcchCfg.dci.beamPdcchInfo.numPrgs; - dlDciPtr->pc_and_bform.prgSize = dlPageAlloc->pagePdcchCfg.dci.beamPdcchInfo.prgSize; - dlDciPtr->pc_and_bform.digBfInterfaces = dlPageAlloc->pagePdcchCfg.dci.beamPdcchInfo.digBfInterfaces; - dlDciPtr->pc_and_bform.pmi_bfi[0].pmIdx = dlPageAlloc->pagePdcchCfg.dci.beamPdcchInfo.prg[0].pmIdx; - dlDciPtr->pc_and_bform.pmi_bfi[0].beamIdx[0].beamidx = dlPageAlloc->pagePdcchCfg.dci.beamPdcchInfo.prg[0].beamIdx[0]; - dlDciPtr->beta_pdcch_1_0 = dlPageAlloc->pagePdcchCfg.dci.txPdcchPower.beta_pdcch_1_0; - dlDciPtr->powerControlOffsetSS = dlPageAlloc->pagePdcchCfg.dci.txPdcchPower.powerControlOffsetSS; + dlDciPtr->rnti = P_RNTI; + dlDciPtr->scramblingId = macCellCfg->cellCfg.phyCellId; + dlDciPtr->scramblingRnti = 0; + dlDciPtr->cceIndex = dlPageAlloc->pageDlDci.cceIndex; + dlDciPtr->aggregationLevel = dlPageAlloc->pageDlDci.aggregLevel; + dlDciPtr->pc_and_bform.numPrgs = 1; + dlDciPtr->pc_and_bform.prgSize = 1; + dlDciPtr->pc_and_bform.digBfInterfaces = 0; + dlDciPtr->pc_and_bform.pmi_bfi[0].pmIdx = 0; + dlDciPtr->pc_and_bform.pmi_bfi[0].beamIdx[0].beamidx = 0; + dlDciPtr->beta_pdcch_1_0 = 0; + dlDciPtr->powerControlOffsetSS = 0; /* Calculating freq domain resource allocation field value and size * coreset0Size = Size of coreset 0 @@ -2685,9 +2685,9 @@ void fillPageDlDciPdu(fapi_dl_dci_t *dlDciPtr, DlPageAlloc *dlPageAlloc) * RBLen = length of contiguously allocted RBs * Spec 38.214 Sec 5.1.2.2.2 */ - coreset0Size = dlPageAlloc->pagePdcchCfg.coresetCfg.coreSetSize; - rbStart = dlPageAlloc->pagePdcchCfg.dci.pdschCfg->pdschFreqAlloc.startPrb; - rbLen = dlPageAlloc->pagePdcchCfg.dci.pdschCfg->pdschFreqAlloc.numPrb; + coreset0Size = dlPageAlloc->pageDlDci.coreSetSize; + rbStart = dlPageAlloc->pageDlSch.freqAlloc.startPrb; + rbLen = dlPageAlloc->pageDlSch.freqAlloc.numPrb; if((rbLen >=1) && (rbLen <= coreset0Size - rbStart)) { @@ -2712,7 +2712,7 @@ void fillPageDlDciPdu(fapi_dl_dci_t *dlDciPtr, DlPageAlloc *dlPageAlloc) else { /*Short Msg is Present*/ - if(dlPageAlloc->dlPagePduLen == 0 || dlPageAlloc->dlPagePdu == NULLP) + if(dlPageAlloc->pageDlSch.dlPagePduLen == 0 || dlPageAlloc->pageDlSch.dlPagePdu == NULLP) { /*When Paging Msg is absent*/ shortMsgInd = 2; @@ -2725,9 +2725,9 @@ void fillPageDlDciPdu(fapi_dl_dci_t *dlDciPtr, DlPageAlloc *dlPageAlloc) shortMsg = dlPageAlloc->shortMsg; } - timeDomResAssign = dlPageAlloc->pagePdcchCfg.dci.pdschCfg->pdschTimeAlloc.rowIndex -1; - VRB2PRBMap = dlPageAlloc->pagePdcchCfg.dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping; - modNCodScheme = dlPageAlloc->pagePdcchCfg.dci.pdschCfg->codeword[0].mcsIndex; + timeDomResAssign = 0; + VRB2PRBMap = dlPageAlloc->pageDlSch.vrbPrbMapping; + modNCodScheme = dlPageAlloc->pageDlSch.tbInfo.mcs; tbScaling = 0; reserved = 0; @@ -2852,8 +2852,8 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo) /* TODO: Fill values of coreset0Size, rbStart and rbLen */ coreset0Size= rarPdcchInfo->coresetCfg.coreSetSize; - rbStart = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb; - rbLen = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb; + rbStart = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb; + rbLen = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb; if((rbLen >=1) && (rbLen <= coreset0Size - rbStart)) { @@ -2867,9 +2867,9 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo) } /* Fetching DCI field values */ - timeDomResAssign = rarPdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex; - VRB2PRBMap = rarPdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping; - modNCodScheme = rarPdcchInfo->dci.pdschCfg->codeword[0].mcsIndex; + timeDomResAssign = rarPdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex; + VRB2PRBMap = rarPdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping; + modNCodScheme = rarPdcchInfo->dci.pdschCfg.codeword[0].mcsIndex; tbScaling = 0; /* configured to 0 scaling */ reserved = 0; @@ -2934,7 +2934,7 @@ void fillRarDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *rarPdcchInfo) * ******************************************************************/ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\ - DlMsgInfo *dlMsgInfo) + DlMsgSchInfo *dlMsgSchInfo) { if(dlDciPtr != NULLP) { @@ -2992,8 +2992,8 @@ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\ * Spec 38.214 Sec 5.1.2.2.2 */ coresetSize = pdcchInfo->coresetCfg.coreSetSize; - rbStart = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.startPrb; - rbLen = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.numPrb; + rbStart = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.startPrb; + rbLen = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.numPrb; if((rbLen >=1) && (rbLen <= coresetSize - rbStart)) { @@ -3007,17 +3007,17 @@ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\ } /* Fetching DCI field values */ - dciFormatId = dlMsgInfo->dciFormatId; /* Always set to 1 for DL */ - timeDomResAssign = pdcchInfo->dci.pdschCfg->pdschTimeAlloc.rowIndex -1; - VRB2PRBMap = pdcchInfo->dci.pdschCfg->pdschFreqAlloc.vrbPrbMapping; - modNCodScheme = pdcchInfo->dci.pdschCfg->codeword[0].mcsIndex; - ndi = dlMsgInfo->ndi; - redundancyVer = pdcchInfo->dci.pdschCfg->codeword[0].rvIndex; - harqProcessNum = dlMsgInfo->harqProcNum; - dlAssignmentIdx = dlMsgInfo->dlAssignIdx; - pucchTpc = dlMsgInfo->pucchTpc; - pucchResoInd = dlMsgInfo->pucchResInd; - harqFeedbackInd = dlMsgInfo->harqFeedbackInd; + dciFormatId = dlMsgSchInfo->dciFormatId; /* Always set to 1 for DL */ + timeDomResAssign = pdcchInfo->dci.pdschCfg.pdschTimeAlloc.rowIndex -1; + VRB2PRBMap = pdcchInfo->dci.pdschCfg.pdschFreqAlloc.vrbPrbMapping; + modNCodScheme = pdcchInfo->dci.pdschCfg.codeword[0].mcsIndex; + ndi = dlMsgSchInfo->transportBlock[0].ndi; + redundancyVer = pdcchInfo->dci.pdschCfg.codeword[0].rvIndex; + harqProcessNum = dlMsgSchInfo->harqProcNum; + dlAssignmentIdx = dlMsgSchInfo->dlAssignIdx; + pucchTpc = dlMsgSchInfo->pucchTpc; + pucchResoInd = dlMsgSchInfo->pucchResInd; + harqFeedbackInd = dlMsgSchInfo->harqFeedbackInd; /* Reversing bits in each DCI field */ dciFormatId = reverseBits(dciFormatId, dciFormatIdSize); @@ -3087,6 +3087,62 @@ void fillDlMsgDlDciPdu(fapi_dl_dci_t *dlDciPtr, PdcchCfg *pdcchInfo,\ } } +/******************************************************************* + * + * @brief fills Dl PDCCH Info from DL PageAlloc + * + * @details + * + * Function : fillPdcchInfoFrmPageAlloc + * + * Functionality: + * -Fills the PdcchInfo + * + * @params[in] Pointer to DlPageAlloc + * Pointer to PdcchCfg + * @return ROK + * + ******************************************************************/ +void fillPagePdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, fapi_vendor_dl_tti_req_pdu_t *dlTtiVendorPdu, DlPageAlloc *pageAlloc, MacCellCfg *macCellCfg) +{ + if(dlTtiReqPdu != NULLP) + { + BwpCfg *bwp = NULLP; + + memset(&dlTtiReqPdu->pdu.pdcch_pdu, 0, sizeof(fapi_dl_pdcch_pdu_t)); + bwp = &pageAlloc->bwp; + fillPageDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pageAlloc, macCellCfg); + + dlTtiReqPdu->pduType = PDCCH_PDU_TYPE; + + dlTtiReqPdu->pdu.pdcch_pdu.bwpSize = bwp->freqAlloc.numPrb; + dlTtiReqPdu->pdu.pdcch_pdu.bwpStart = bwp->freqAlloc.startPrb; + dlTtiReqPdu->pdu.pdcch_pdu.subCarrierSpacing = bwp->subcarrierSpacing; + dlTtiReqPdu->pdu.pdcch_pdu.cyclicPrefix = bwp->cyclicPrefix; + + dlTtiReqPdu->pdu.pdcch_pdu.startSymbolIndex = pageAlloc->pageDlDci.ssStartSymbolIndex; + dlTtiReqPdu->pdu.pdcch_pdu.durationSymbols = pageAlloc->pageDlDci.durationSymbols; + memcpy(dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource, pageAlloc->pageDlDci.freqDomainResource, 6*sizeof(uint8_t)); + dlTtiReqPdu->pdu.pdcch_pdu.cceRegMappingType = pageAlloc->pageDlDci.cceRegMappingType; + dlTtiReqPdu->pdu.pdcch_pdu.regBundleSize = pageAlloc->pageDlDci.cceReg.interleaved.regBundleSize; + dlTtiReqPdu->pdu.pdcch_pdu.interleaverSize = pageAlloc->pageDlDci.cceReg.interleaved.interleaverSize; + dlTtiReqPdu->pdu.pdcch_pdu.shiftIndex = pageAlloc->pageDlDci.cceReg.interleaved.shiftIndex; + dlTtiReqPdu->pdu.pdcch_pdu.precoderGranularity = pageAlloc->pageDlDci.precoderGranularity; + dlTtiReqPdu->pdu.pdcch_pdu.numDlDci = 1; + dlTtiReqPdu->pdu.pdcch_pdu.coreSetType = CORESET_TYPE0; + + /* Calculating PDU length. Considering only one dl dci pdu for now */ + dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdcch_pdu_t); + + /* Filling Vendor message PDU */ + dlTtiVendorPdu->pdu_type = FAPI_PDCCH_PDU_TYPE; + dlTtiVendorPdu->pdu_size = sizeof(fapi_vendor_dl_pdcch_pdu_t); + dlTtiVendorPdu->pdu.pdcch_pdu.num_dl_dci = dlTtiReqPdu->pdu.pdcch_pdu.numDlDci; + dlTtiVendorPdu->pdu.pdcch_pdu.dl_dci[0].epre_ratio_of_pdcch_to_ssb = 0; + dlTtiVendorPdu->pdu.pdcch_pdu.dl_dci[0].epre_ratio_of_dmrs_to_ssb = 0; + } +} + /******************************************************************* * * @brief fills PDCCH PDU required for DL TTI info in MAC @@ -3115,39 +3171,35 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, fapi_vendor_dl_tti_req_ memset(&dlTtiReqPdu->pdu.pdcch_pdu, 0, sizeof(fapi_dl_pdcch_pdu_t)); if(rntiType == SI_RNTI_TYPE) { - pdcchInfo = &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg; + pdcchInfo = dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg; bwp = &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp; fillSib1DlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo); } - else if(rntiType == P_RNTI_TYPE) - { - pdcchInfo = &dlSlot->pageAllocInfo->pagePdcchCfg; - bwp = &dlSlot->pageAllocInfo->bwp; - fillPageDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, dlSlot->pageAllocInfo); - } else if(rntiType == RA_RNTI_TYPE) { - pdcchInfo = &dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg; + pdcchInfo = dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg; bwp = &dlSlot->dlInfo.rarAlloc[ueIdx]->bwp; fillRarDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo); } else if(rntiType == TC_RNTI_TYPE || rntiType == C_RNTI_TYPE) { - pdcchInfo = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgPdcchCfg; - bwp = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].bwp; + pdcchInfo = dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg; + bwp = &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->bwp; fillDlMsgDlDciPdu(dlTtiReqPdu->pdu.pdcch_pdu.dlDci, pdcchInfo,\ - &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[dlMsgSchInfoIdx].dlMsgInfo); + dlSlot->dlInfo.dlMsgAlloc[ueIdx]); } else { DU_LOG("\nERROR --> LWR_MAC: Failed filling PDCCH Pdu"); return RFAILED; } + dlTtiReqPdu->pduType = PDCCH_PDU_TYPE; dlTtiReqPdu->pdu.pdcch_pdu.bwpSize = bwp->freqAlloc.numPrb; dlTtiReqPdu->pdu.pdcch_pdu.bwpStart = bwp->freqAlloc.startPrb; dlTtiReqPdu->pdu.pdcch_pdu.subCarrierSpacing = bwp->subcarrierSpacing; dlTtiReqPdu->pdu.pdcch_pdu.cyclicPrefix = bwp->cyclicPrefix; + dlTtiReqPdu->pdu.pdcch_pdu.startSymbolIndex = pdcchInfo->coresetCfg.startSymbolIndex; dlTtiReqPdu->pdu.pdcch_pdu.durationSymbols = pdcchInfo->coresetCfg.durationSymbols; memcpy(dlTtiReqPdu->pdu.pdcch_pdu.freqDomainResource, pdcchInfo->coresetCfg.freqDomainResource, 6); @@ -3173,6 +3225,91 @@ uint8_t fillPdcchPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, fapi_vendor_dl_tti_req_ return ROK; } +/******************************************************************* + * + * @brief fills PDSCH PDU from PageAlloc required for DL TTI info in MAC + * + * @details + * + * Function : fillPagePdschPdu + * + * Functionality: + * -Fills the Pdsch PDU info + * stored in MAC + * + * @params[in] Pointer to FAPI DL TTI Req + * Pointer to PdschCfg + * Pointer to msgLen of DL TTI Info + * @return ROK + * + ******************************************************************/ +void fillPagePdschPdu(fapi_dl_tti_req_pdu_t *dlTtiReqPdu, fapi_vendor_dl_tti_req_pdu_t *dlTtiVendorPdu, DlPageAlloc *pageAlloc, + uint16_t pduIndex, MacCellCfg *macCellCfg) +{ + uint8_t idx; + + if(dlTtiReqPdu != NULLP) + { + dlTtiReqPdu->pduType = PDSCH_PDU_TYPE; + memset(&dlTtiReqPdu->pdu.pdsch_pdu, 0, sizeof(fapi_dl_pdsch_pdu_t)); + dlTtiReqPdu->pdu.pdsch_pdu.pduBitMap = 0; /* PTRS and CBG params are excluded */ + dlTtiReqPdu->pdu.pdsch_pdu.rnti = P_RNTI; + dlTtiReqPdu->pdu.pdsch_pdu.pdu_index = pduIndex; + dlTtiReqPdu->pdu.pdsch_pdu.bwpSize = pageAlloc->bwp.freqAlloc.numPrb; + dlTtiReqPdu->pdu.pdsch_pdu.bwpStart = pageAlloc->bwp.freqAlloc.startPrb; + dlTtiReqPdu->pdu.pdsch_pdu.subCarrierSpacing = pageAlloc->bwp.subcarrierSpacing; + dlTtiReqPdu->pdu.pdsch_pdu.cyclicPrefix = pageAlloc->bwp.cyclicPrefix; + dlTtiReqPdu->pdu.pdsch_pdu.nrOfCodeWords = 1; + for(idx = 0; idx < MAX_CODEWORDS ; idx++) + { + dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].targetCodeRate = 308; + dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].qamModOrder = 2; + dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].mcsIndex = pageAlloc->pageDlSch.tbInfo.mcs; + dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].mcsTable = 0; + dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].rvIndex = 0; + dlTtiReqPdu->pdu.pdsch_pdu.cwInfo[idx].tbSize = pageAlloc->pageDlSch.tbInfo.tbSize; + } + dlTtiReqPdu->pdu.pdsch_pdu.dataScramblingId = macCellCfg->cellCfg.phyCellId; + dlTtiReqPdu->pdu.pdsch_pdu.nrOfLayers = 1; + dlTtiReqPdu->pdu.pdsch_pdu.transmissionScheme = 0; + dlTtiReqPdu->pdu.pdsch_pdu.refPoint = 0; + dlTtiReqPdu->pdu.pdsch_pdu.dlDmrsSymbPos = DL_DMRS_SYMBOL_POS; + dlTtiReqPdu->pdu.pdsch_pdu.dmrsConfigType = pageAlloc->pageDlSch.dmrs.dmrsType; + dlTtiReqPdu->pdu.pdsch_pdu.dlDmrsScramblingId = macCellCfg->cellCfg.phyCellId; + dlTtiReqPdu->pdu.pdsch_pdu.scid = 0; + dlTtiReqPdu->pdu.pdsch_pdu.numDmrsCdmGrpsNoData = 1; + dlTtiReqPdu->pdu.pdsch_pdu.dmrsPorts = 0x0001; + dlTtiReqPdu->pdu.pdsch_pdu.resourceAlloc = 1; + /* since we are using type-1, hence rbBitmap excluded */ + dlTtiReqPdu->pdu.pdsch_pdu.rbStart = pageAlloc->pageDlSch.freqAlloc.startPrb; + dlTtiReqPdu->pdu.pdsch_pdu.rbSize = pageAlloc->pageDlSch.freqAlloc.numPrb; + dlTtiReqPdu->pdu.pdsch_pdu.vrbToPrbMapping = pageAlloc->pageDlSch.vrbPrbMapping; + dlTtiReqPdu->pdu.pdsch_pdu.startSymbIndex = pageAlloc->pageDlSch.timeAlloc.startSymb; + dlTtiReqPdu->pdu.pdsch_pdu.nrOfSymbols = pageAlloc->pageDlSch.timeAlloc.numSymb; + dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.numPrgs = 1; + dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.prgSize = 0; + dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.digBfInterfaces = 0; + dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0].pmIdx = 0; + dlTtiReqPdu->pdu.pdsch_pdu.preCodingAndBeamforming.pmi_bfi[0].beamIdx[0].beamidx = 0; + dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffset = 0; + dlTtiReqPdu->pdu.pdsch_pdu.powerControlOffsetSS = 0; + dlTtiReqPdu->pdu.pdsch_pdu.mappingType = pageAlloc->pageDlSch.timeAlloc.mappingType; + dlTtiReqPdu->pdu.pdsch_pdu.nrOfDmrsSymbols = pageAlloc->pageDlSch.dmrs.nrOfDmrsSymbols; + dlTtiReqPdu->pdu.pdsch_pdu.dmrsAddPos = pageAlloc->pageDlSch.dmrs.dmrsAddPos; + + dlTtiReqPdu->pduSize = sizeof(fapi_dl_pdsch_pdu_t); + + /* DL TTI Request vendor message */ + dlTtiVendorPdu->pdu_type = FAPI_PDSCH_PDU_TYPE; + dlTtiVendorPdu->pdu_size = sizeof(fapi_vendor_dl_pdsch_pdu_t); + dlTtiVendorPdu->pdu.pdsch_pdu.nr_of_antenna_ports = 1; + for(int i =0; i< FAPI_VENDOR_MAX_TXRU_NUM; i++) + { + dlTtiVendorPdu->pdu.pdsch_pdu.tx_ru_idx[i] =0; + } + } +} + /******************************************************************* * * @brief fills PDSCH PDU required for DL TTI info in MAC @@ -3309,7 +3446,7 @@ uint8_t calcDlTtiReqPduCount(MacDlSlot *dlSlot) if(dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP) { /* PDCCH and PDSCH PDU is filled */ - if(dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) + if(dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg && dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg) count += 2; else count += 1; @@ -3317,14 +3454,11 @@ uint8_t calcDlTtiReqPduCount(MacDlSlot *dlSlot) if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP) { - for(idx=0; idxdlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++) - { - /* PDCCH and PDSCH PDU is filled */ - if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) - count += 2; - else if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres != NONE) - count += 1; - } + /* PDCCH and PDSCH PDU is filled */ + if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg) + count += 1; + if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg) + count += 1; } } return count; @@ -3347,7 +3481,7 @@ uint8_t calcDlTtiReqPduCount(MacDlSlot *dlSlot) * ********************************************************************/ uint8_t calcTxDataReqPduCount(MacDlSlot *dlSlot) { - uint8_t idx = 0, count = 0, ueIdx=0; + uint8_t count = 0, ueIdx=0; if(dlSlot->dlInfo.isBroadcastPres && dlSlot->dlInfo.brdcstAlloc.sib1TransmissionMode) { @@ -3360,18 +3494,13 @@ uint8_t calcTxDataReqPduCount(MacDlSlot *dlSlot) for(ueIdx=0; ueIdxdlInfo.rarAlloc[ueIdx] != NULLP) && \ - ((dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || (dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU))) + if((dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP) && (dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg)) count++; if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP) { - for(idx=0; idxdlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++) - { - if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH || \ - dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU) - count++; - } + if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg) + count++; } } return count; @@ -3457,8 +3586,7 @@ uint8_t fillSib1TxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, MacCel * @return ROK * * ********************************************************************/ -uint8_t fillPageTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlPageAlloc *pageAllocInfo, - PdschCfg pdschCfg) +uint8_t fillPageTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlPageAlloc *pageAllocInfo) { uint32_t payloadSize = 0; uint8_t *pagePayload = NULLP; @@ -3471,7 +3599,7 @@ uint8_t fillPageTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlPage pduDesc[pduIndex].num_tlvs = 1; /* fill the TLV */ - payloadSize = pdschCfg.codeword[0].tbSize; + payloadSize = pageAllocInfo->pageDlSch.tbInfo.tbSize; pduDesc[pduIndex].tlvs[0].tl.tag = ((payloadSize & 0xff0000) >> 8) | FAPI_TX_DATA_PTR_TO_PAYLOAD_64; pduDesc[pduIndex].tlvs[0].tl.length = (payloadSize & 0x0000ffff); LWR_MAC_ALLOC(pagePayload, payloadSize); @@ -3481,8 +3609,8 @@ uint8_t fillPageTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlPage } payloadElem = (fapi_api_queue_elem_t *)pagePayload; FILL_FAPI_LIST_ELEM(payloadElem, NULLP, FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ, 1, \ - pageAllocInfo->dlPagePduLen); - memcpy(pagePayload + TX_PAYLOAD_HDR_LEN, pageAllocInfo->dlPagePdu, pageAllocInfo->dlPagePduLen); + pageAllocInfo->pageDlSch.dlPagePduLen); + memcpy(pagePayload + TX_PAYLOAD_HDR_LEN, pageAllocInfo->pageDlSch.dlPagePdu, pageAllocInfo->pageDlSch.dlPagePduLen); #ifdef INTEL_WLS_MEM mtGetWlsHdl(&wlsHdlr); @@ -3519,7 +3647,7 @@ uint8_t fillPageTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlPage * @return ROK * * ********************************************************************/ -uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo *rarInfo, PdschCfg pdschCfg) +uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo *rarInfo, PdschCfg *pdschCfg) { uint16_t payloadSize; uint8_t *rarPayload = NULLP; @@ -3532,7 +3660,7 @@ uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo pduDesc[pduIndex].num_tlvs = 1; /* fill the TLV */ - payloadSize = pdschCfg.codeword[0].tbSize; + payloadSize = pdschCfg->codeword[0].tbSize; pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64; pduDesc[pduIndex].tlvs[0].tl.length = payloadSize; LWR_MAC_ALLOC(rarPayload, payloadSize); @@ -3578,7 +3706,7 @@ uint8_t fillRarTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, RarInfo * @return ROK * * ********************************************************************/ -uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsgInfo *dlMsgInfo, PdschCfg pdschCfg) +uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsgSchInfo *dlMsgSchInfo, PdschCfg *pdschCfg) { uint16_t payloadSize; uint8_t *dlMsgPayload = NULLP; @@ -3591,7 +3719,7 @@ uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsg pduDesc[pduIndex].num_tlvs = 1; /* fill the TLV */ - payloadSize = pdschCfg.codeword[0].tbSize; + payloadSize = pdschCfg->codeword[0].tbSize; pduDesc[pduIndex].tlvs[0].tl.tag = FAPI_TX_DATA_PTR_TO_PAYLOAD_64; pduDesc[pduIndex].tlvs[0].tl.length = payloadSize; LWR_MAC_ALLOC(dlMsgPayload, payloadSize); @@ -3600,8 +3728,8 @@ uint8_t fillDlMsgTxDataReq(fapi_tx_pdu_desc_t *pduDesc, uint16_t pduIndex, DlMsg return RFAILED; } payloadElem = (fapi_api_queue_elem_t *)dlMsgPayload; - FILL_FAPI_LIST_ELEM(payloadElem, NULLP, FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ, 1, dlMsgInfo->dlMsgPduLen); - memcpy(dlMsgPayload + TX_PAYLOAD_HDR_LEN, dlMsgInfo->dlMsgPdu, dlMsgInfo->dlMsgPduLen); + FILL_FAPI_LIST_ELEM(payloadElem, NULLP, FAPI_VENDOR_MSG_PHY_ZBC_BLOCK_REQ, 1, dlMsgSchInfo->dlMsgPduLen); + memcpy(dlMsgPayload + TX_PAYLOAD_HDR_LEN, dlMsgSchInfo->dlMsgPdu, dlMsgSchInfo->dlMsgPduLen); #ifdef INTEL_WLS_MEM mtGetWlsHdl(&wlsHdlr); @@ -3754,7 +3882,7 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) /* PDSCH PDU */ fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], - currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg, + &currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg->dci.pdschCfg, currDlSlot->dlInfo.brdcstAlloc.sib1Alloc.bwp, pduIndex); dlTtiReq->ue_grp_info[dlTtiReq->nGroup].pduIdx[pduIndex] = pduIndex; @@ -3773,13 +3901,11 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) if(numPduEncoded != nPdu) { rntiType = P_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], currDlSlot, -1, \ - rntiType, CORESET_TYPE0, MAX_NUM_UE); + fillPagePdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \ + currDlSlot->pageAllocInfo, &macCellCfg); numPduEncoded++; - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], - &currDlSlot->pageAllocInfo->pagePdschCfg, - currDlSlot->pageAllocInfo->bwp, - pduIndex); + fillPagePdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + currDlSlot->pageAllocInfo, pduIndex, &macCellCfg); dlTtiReq->ue_grp_info[dlTtiReq->nGroup].pduIdx[pduIndex] = pduIndex; pduIndex++; numPduEncoded++; @@ -3795,24 +3921,23 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) { /* Filling RAR param */ rntiType = RA_RNTI_TYPE; - if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \ - (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDCCH_PDU)) - { + if(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg) + { fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], currDlSlot, -1, rntiType, CORESET_TYPE0, ueIdx); numPduEncoded++; - } - if((currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || \ - (currDlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU)) + MAC_FREE(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdcchCfg, sizeof(PdcchCfg)); + } + if(currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg) { fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], - &currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg, + currDlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg, currDlSlot->dlInfo.rarAlloc[ueIdx]->bwp, pduIndex); numPduEncoded++; pduIndex++; - DU_LOG("\033[1;32m"); + DU_LOG("\033[1;32m"); DU_LOG("\nDEBUG --> LWR_MAC: RAR sent..."); DU_LOG("\033[0m"); } @@ -3820,59 +3945,45 @@ uint16_t fillDlTtiReq(SlotTimingInfo currTimingInfo) if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP) { - for(idx=0; idxdlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; idx++) - { - /* Filling Msg4 param */ - if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ - (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDCCH_PDU)) - { - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) - { - rntiType = TC_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], - currDlSlot, idx, rntiType, CORESET_TYPE0, ueIdx); - } - else - { - /* Filling other DL msg params */ - rntiType = C_RNTI_TYPE; - fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], - currDlSlot, idx, rntiType, CORESET_TYPE1, ueIdx); - } - numPduEncoded++; - } - - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.dlMsgPdu != NULLP) - { - if((currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == BOTH) || \ - (currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].pduPres == PDSCH_PDU)) - { - fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \ - &currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgPdschCfg,\ - currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].bwp, pduIndex); - numPduEncoded++; - pduIndex++; - - DU_LOG("\033[1;32m"); - if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[idx].dlMsgInfo.isMsg4Pdu) - { - DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent..."); - } - else - { - DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent..."); - } - DU_LOG("\033[0m"); - } - - } - /* else - { - MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); - currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP; - } - */ - } + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg) \ + { + rntiType = C_RNTI_TYPE; + fillPdcchPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], + currDlSlot, idx, rntiType, currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg->coresetCfg.coreSetType, ueIdx); + numPduEncoded++; + } + + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu != NULLP) + { + if(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg) + { + fillPdschPdu(&dlTtiReq->pdus[numPduEncoded], &vendorMsg->p7_req_vendor.dl_tti_req.pdus[numPduEncoded], \ + currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg,\ + currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->bwp, pduIndex); + numPduEncoded++; + pduIndex++; + + DU_LOG("\033[1;32m"); + if((macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status)) + { + DU_LOG("\nDEBUG --> LWR_MAC: MSG4 sent..."); + MAC_FREE(macCb.macCell[cellIdx]->macRaCb[ueIdx].macMsg4Status, sizeof(bool)); + } + else + { + DU_LOG("\nDEBUG --> LWR_MAC: DL MSG sent..."); + } + DU_LOG("\033[0m"); + } + + } + MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdcchCfg,sizeof(PdcchCfg)); + /* else + { + MAC_FREE(currDlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); + currDlSlot->dlInfo.dlMsgAlloc[ueIdx] = NULLP; + } + */ } } @@ -3971,7 +4082,6 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_ uint8_t nPdu = 0; uint8_t ueIdx=0; - uint8_t schInfoIdx = 0; uint16_t cellIdx=0; uint16_t pduIndex = 0; fapi_tx_data_req_t *txDataReq =NULLP; @@ -4003,17 +4113,17 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_ if(dlSlot->dlInfo.brdcstAlloc.sib1TransmissionMode) { fillSib1TxDataReq(txDataReq->pdu_desc, pduIndex, &macCb.macCell[cellIdx]->macCellCfg, \ - dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg.dci.pdschCfg); + &dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg->dci.pdschCfg); pduIndex++; + MAC_FREE(dlSlot->dlInfo.brdcstAlloc.sib1Alloc.sib1PdcchCfg,sizeof(PdcchCfg)); txDataReq->num_pdus++; } if(dlSlot->pageAllocInfo != NULLP) { - fillPageTxDataReq(txDataReq->pdu_desc, pduIndex, dlSlot->pageAllocInfo, \ - dlSlot->pageAllocInfo->pagePdschCfg); + fillPageTxDataReq(txDataReq->pdu_desc, pduIndex, dlSlot->pageAllocInfo); pduIndex++; txDataReq->num_pdus++; - MAC_FREE(dlSlot->pageAllocInfo->dlPagePdu, sizeof(dlSlot->pageAllocInfo->dlPagePduLen)); + MAC_FREE(dlSlot->pageAllocInfo->pageDlSch.dlPagePdu, sizeof(dlSlot->pageAllocInfo->pageDlSch.dlPagePduLen)); MAC_FREE(dlSlot->pageAllocInfo,sizeof(DlPageAlloc)); } @@ -4021,34 +4131,32 @@ uint16_t sendTxDataReq(SlotTimingInfo currTimingInfo, MacDlSlot *dlSlot, p_fapi_ { if(dlSlot->dlInfo.rarAlloc[ueIdx] != NULLP) { - if((dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == BOTH) || (dlSlot->dlInfo.rarAlloc[ueIdx]->pduPres == PDSCH_PDU)) + if((dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg)) { fillRarTxDataReq(txDataReq->pdu_desc, pduIndex, &dlSlot->dlInfo.rarAlloc[ueIdx]->rarInfo,\ dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg); pduIndex++; txDataReq->num_pdus++; + MAC_FREE(dlSlot->dlInfo.rarAlloc[ueIdx]->rarPdschCfg, sizeof(PdschCfg)); } MAC_FREE(dlSlot->dlInfo.rarAlloc[ueIdx],sizeof(RarAlloc)); } if(dlSlot->dlInfo.dlMsgAlloc[ueIdx] != NULLP) { - for(schInfoIdx=0; schInfoIdx < dlSlot->dlInfo.dlMsgAlloc[ueIdx]->numSchedInfo; schInfoIdx++) + if(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg) { - if((dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == BOTH) || \ - (dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].pduPres == PDSCH_PDU)) - { - fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, \ - &dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo, \ - dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgPdschCfg); - pduIndex++; - txDataReq->num_pdus++; - } - MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu, \ - dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPduLen); - dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgSchedInfo[schInfoIdx].dlMsgInfo.dlMsgPdu = NULLP; + fillDlMsgTxDataReq(txDataReq->pdu_desc, pduIndex, \ + dlSlot->dlInfo.dlMsgAlloc[ueIdx], \ + dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg); + pduIndex++; + txDataReq->num_pdus++; + MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdschCfg,sizeof(PdschCfg)); } - MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgAlloc)); + MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu, \ + dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPduLen); + dlSlot->dlInfo.dlMsgAlloc[ueIdx]->dlMsgPdu = NULLP; + MAC_FREE(dlSlot->dlInfo.dlMsgAlloc[ueIdx], sizeof(DlMsgSchInfo)); } } @@ -4203,12 +4311,12 @@ void fillPuschPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, fapi_vendor_ul_tti_req_pdu ulTtiReqPdu->pdu.pusch_pdu.rnti = currUlSlot->ulInfo.crnti; /* TODO : Fill handle in raCb when scheduling pusch and access here */ ulTtiReqPdu->pdu.pusch_pdu.handle = 100; - ulTtiReqPdu->pdu.pusch_pdu.bwpSize = macCellCfg->initialUlBwp.bwp.numPrb; - ulTtiReqPdu->pdu.pusch_pdu.bwpStart = macCellCfg->initialUlBwp.bwp.firstPrb; + ulTtiReqPdu->pdu.pusch_pdu.bwpSize = macCellCfg->cellCfg.initialUlBwp.bwp.numPrb; + ulTtiReqPdu->pdu.pusch_pdu.bwpStart = macCellCfg->cellCfg.initialUlBwp.bwp.firstPrb; ulTtiReqPdu->pdu.pusch_pdu.subCarrierSpacing = \ - macCellCfg->initialUlBwp.bwp.scs; + macCellCfg->cellCfg.initialUlBwp.bwp.scs; ulTtiReqPdu->pdu.pusch_pdu.cyclicPrefix = \ - macCellCfg->initialUlBwp.bwp.cyclicPrefix; + macCellCfg->cellCfg.initialUlBwp.bwp.cyclicPrefix; ulTtiReqPdu->pdu.pusch_pdu.targetCodeRate = 308; ulTtiReqPdu->pdu.pusch_pdu.qamModOrder = currUlSlot->ulInfo.schPuschInfo.tbInfo.qamOrder; ulTtiReqPdu->pdu.pusch_pdu.mcsIndex = currUlSlot->ulInfo.schPuschInfo.tbInfo.mcs; @@ -4293,15 +4401,15 @@ void fillPucchPdu(fapi_ul_tti_req_pdu_t *ulTtiReqPdu, fapi_vendor_ul_tti_req_pdu ulTtiReqPdu->pdu.pucch_pdu.rnti = currUlSlot->ulInfo.crnti; /* TODO : Fill handle in raCb when scheduling pucch and access here */ ulTtiReqPdu->pdu.pucch_pdu.handle = 100; - ulTtiReqPdu->pdu.pucch_pdu.bwpSize = macCellCfg->initialUlBwp.bwp.numPrb; - ulTtiReqPdu->pdu.pucch_pdu.bwpStart = macCellCfg->initialUlBwp.bwp.firstPrb; - ulTtiReqPdu->pdu.pucch_pdu.subCarrierSpacing = macCellCfg->initialUlBwp.bwp.scs; - ulTtiReqPdu->pdu.pucch_pdu.cyclicPrefix = macCellCfg->initialUlBwp.bwp.cyclicPrefix; + ulTtiReqPdu->pdu.pucch_pdu.bwpSize = macCellCfg->cellCfg.initialUlBwp.bwp.numPrb; + ulTtiReqPdu->pdu.pucch_pdu.bwpStart = macCellCfg->cellCfg.initialUlBwp.bwp.firstPrb; + ulTtiReqPdu->pdu.pucch_pdu.subCarrierSpacing = macCellCfg->cellCfg.initialUlBwp.bwp.scs; + ulTtiReqPdu->pdu.pucch_pdu.cyclicPrefix = macCellCfg->cellCfg.initialUlBwp.bwp.cyclicPrefix; ulTtiReqPdu->pdu.pucch_pdu.formatType = currUlSlot->ulInfo.schPucchInfo.pucchFormat; /* Supporting PUCCH Format 0 */ ulTtiReqPdu->pdu.pucch_pdu.multiSlotTxIndicator = 0; /* No Multi Slot transmission */ - ulTtiReqPdu->pdu.pucch_pdu.prbStart = currUlSlot->ulInfo.schPucchInfo.fdAlloc.resAlloc.type1.startPrb; - ulTtiReqPdu->pdu.pucch_pdu.prbSize = currUlSlot->ulInfo.schPucchInfo.fdAlloc.resAlloc.type1.numPrb; + ulTtiReqPdu->pdu.pucch_pdu.prbStart = currUlSlot->ulInfo.schPucchInfo.fdAlloc.startPrb; + ulTtiReqPdu->pdu.pucch_pdu.prbSize = currUlSlot->ulInfo.schPucchInfo.fdAlloc.numPrb; ulTtiReqPdu->pdu.pucch_pdu.startSymbolIndex = currUlSlot->ulInfo.schPucchInfo.tdAlloc.startSymb; ulTtiReqPdu->pdu.pucch_pdu.nrOfSymbols = currUlSlot->ulInfo.schPucchInfo.tdAlloc.numSymb; ulTtiReqPdu->pdu.pucch_pdu.freqHopFlag = currUlSlot->ulInfo.schPucchInfo.intraFreqHop;