+/*******************************************************************
+*
+* @brief Fills UL DCI information for MSG3 retransmission
+*
+* @details
+*
+* Function : schFillUlDciForMsg3Retx
+*
+* Functionality: fills UL DCI information for MSG3 retransmission
+*
+* @params[in]
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t schFillUlDciForMsg3Retx(SchRaCb *raCb, SchPuschInfo *puschInfo, DciInfo *dciInfo)
+{
+ SchCellCb *cellCb = raCb->cell;
+
+ dciInfo->crnti = raCb->tcrnti;
+ SchUlHqProcCb *msg3HqProc = &raCb->msg3HqProc;
+ if (msg3HqProc == NULLP)
+ {
+ return RFAILED;
+ }
+
+ /* fill bwp cfg */
+ dciInfo->bwpCfg.subcarrierSpacing = cellCb->sib1SchCfg.bwp.subcarrierSpacing;
+ dciInfo->bwpCfg.cyclicPrefix = cellCb->sib1SchCfg.bwp.cyclicPrefix;
+ dciInfo->bwpCfg.freqAlloc.startPrb = cellCb->cellCfg.dlCfgCommon.schInitialDlBwp.bwp.freqAlloc.startPrb;
+ dciInfo->bwpCfg.freqAlloc.numPrb = cellCb->cellCfg.dlCfgCommon.schInitialDlBwp.bwp.freqAlloc.numPrb;
+
+ /*fill coreset cfg */
+ //Considering number of RBs in coreset1 is same as coreset0
+ dciInfo->coresetCfg.coreSetSize = coresetIdxTable[0][1];
+ //Considering coreset1 also starts from same symbol as coreset0
+ dciInfo->coresetCfg.startSymbolIndex = searchSpaceIdxTable[0][3];
+ dciInfo->coresetCfg.durationSymbols = coresetIdxTable[0][2];
+ memcpy(dciInfo->coresetCfg.freqDomainResource, cellCb->cellCfg.dlCfgCommon.schInitialDlBwp.pdcchCommon.commonSearchSpace.freqDomainRsrc, FREQ_DOM_RSRC_SIZE);
+
+ dciInfo->coresetCfg.cceRegMappingType = 1; /* coreset0 is always interleaved */
+ dciInfo->coresetCfg.regBundleSize = 6; /* spec-38.211 sec 7.3.2.2 */
+ dciInfo->coresetCfg.interleaverSize = 2; /* spec-38.211 sec 7.3.2.2 */
+ dciInfo->coresetCfg.coreSetType = 0;
+ dciInfo->coresetCfg.coreSetSize = coresetIdxTable[0][1];
+ dciInfo->coresetCfg.shiftIndex = cellCb->cellCfg.phyCellId;
+ dciInfo->coresetCfg.precoderGranularity = 0;
+ dciInfo->coresetCfg.cceIndex = 0; /* 0-3 for UL and 4-7 for DL */
+ dciInfo->coresetCfg.aggregationLevel = 4; /* same as for sib1 */
+
+ dciInfo->dciFormatInfo.formatType = FORMAT0_0;
+ msg3HqProc->tbInfo.rvIdx++;
+ msg3HqProc->tbInfo.rv = schCmnDlRvTbl[msg3HqProc->tbInfo.rvIdx & 0x03];
+ /* fill UL grant */
+ dciInfo->dciFormatInfo.format.format0_0.resourceAllocType = msg3HqProc->puschResType;
+ dciInfo->dciFormatInfo.format.format0_0.freqAlloc.resAllocType = msg3HqProc->puschResType;
+ dciInfo->dciFormatInfo.format.format0_0.freqAlloc.resAlloc.type1.startPrb = msg3HqProc->puschStartPrb;
+ dciInfo->dciFormatInfo.format.format0_0.freqAlloc.resAlloc.type1.numPrb = msg3HqProc->puschNumPrb;
+ dciInfo->dciFormatInfo.format.format0_0.timeAlloc.startSymb = msg3HqProc->strtSymbl;
+ dciInfo->dciFormatInfo.format.format0_0.timeAlloc.numSymb = msg3HqProc->numSymbl;
+ dciInfo->dciFormatInfo.format.format0_0.rowIndex = 0; /* row Index */
+ dciInfo->dciFormatInfo.format.format0_0.mcs = msg3HqProc->tbInfo.iMcs;
+ dciInfo->dciFormatInfo.format.format0_0.harqProcId = msg3HqProc->procId;
+ dciInfo->dciFormatInfo.format.format0_0.freqHopFlag = FALSE; /* disabled */
+ dciInfo->dciFormatInfo.format.format0_0.ndi = msg3HqProc->tbInfo.ndi; /* new transmission */
+ dciInfo->dciFormatInfo.format.format0_0.rvIndex = msg3HqProc->tbInfo.rv;
+ dciInfo->dciFormatInfo.format.format0_0.tpcCmd = 0; //Sphoorthi TODO: check
+ dciInfo->dciFormatInfo.format.format0_0.sulIndicator = FALSE; /* SUL not configured */
+
+ /* Fill DCI Structure */
+ dciInfo->dciInfo.rnti = raCb->tcrnti;
+ dciInfo->dciInfo.scramblingId = cellCb->cellCfg.phyCellId;
+ dciInfo->dciInfo.scramblingRnti = 0;
+ dciInfo->dciInfo.cceIndex = 0; /* 0-3 for UL and 4-7 for DL */
+ dciInfo->dciInfo.aggregLevel = 4;
+ dciInfo->dciInfo.beamPdcchInfo.numPrgs = 1;
+ dciInfo->dciInfo.beamPdcchInfo.prgSize = 1;
+ dciInfo->dciInfo.beamPdcchInfo.digBfInterfaces = 0;
+ dciInfo->dciInfo.beamPdcchInfo.prg[0].pmIdx = 0;
+ dciInfo->dciInfo.beamPdcchInfo.prg[0].beamIdx[0] = 0;
+ dciInfo->dciInfo.txPdcchPower.beta_pdcch_1_0 = 0;
+ dciInfo->dciInfo.txPdcchPower.powerControlOffsetSS = 0;
+ memset(&dciInfo->dciInfo.pdschCfg, 0, sizeof(PdschCfg));
+ msg3HqProc->tbInfo.txCntr++;
+
+ puschInfo->harqProcId = msg3HqProc->procId;
+ puschInfo->fdAlloc.resAllocType = msg3HqProc->puschResType;
+ puschInfo->fdAlloc.resAlloc.type1.startPrb = msg3HqProc->puschStartPrb;
+ puschInfo->fdAlloc.resAlloc.type1.numPrb = msg3HqProc->puschNumPrb;
+ puschInfo->tdAlloc.startSymb = msg3HqProc->strtSymbl;
+ puschInfo->tdAlloc.numSymb = msg3HqProc->numSymbl;
+ puschInfo->tbInfo.qamOrder = msg3HqProc->tbInfo.qamOrder;
+ puschInfo->tbInfo.mcs = msg3HqProc->tbInfo.iMcs;
+ puschInfo->tbInfo.mcsTable = msg3HqProc->tbInfo.mcsTable;
+ puschInfo->tbInfo.ndi = msg3HqProc->tbInfo.ndi; /* retransmission */
+ puschInfo->tbInfo.rv = msg3HqProc->tbInfo.rvIdx;
+ puschInfo->tbInfo.tbSize = msg3HqProc->tbInfo.tbSzReq;
+#ifdef INTEL_FAPI
+ puschInfo->dmrsMappingType = msg3HqProc->dmrsMappingType; /* Setting Type-A */
+ puschInfo->nrOfDmrsSymbols = msg3HqProc->nrOfDmrsSymbols;
+ puschInfo->dmrsAddPos = msg3HqProc->dmrsAddPos;
+#endif
+ return ROK;
+}
+