+
+/**
+ * @brief Function to fill Pucch Format 0
+ *
+ * @details
+ *
+ * Function : fillPucchFormat0
+ *
+ * Function to fill Pucch format 0
+ *
+ * @param[in] SchPucchInfo pointer, SchPucchResrcInfo pointer
+ * @return void
+ **/
+
+void fillPucchFormat0(SchPucchInfo *ulSchedPucch, SchPucchResrcInfo *resrcInfo)
+{
+ if(resrcInfo->SchPucchFormat.format0)
+ {
+ ulSchedPucch->fdAlloc.numPrb = PUCCH_NUM_PRB_FORMAT_0_1_4;
+ ulSchedPucch->pucchFormat = PUCCH_FORMAT_0;
+ ulSchedPucch->initialCyclicShift = resrcInfo->SchPucchFormat.format0->initialCyclicShift;
+ ulSchedPucch->tdAlloc.numSymb = resrcInfo->SchPucchFormat.format0->numSymbols;
+ ulSchedPucch->tdAlloc.startSymb = resrcInfo->SchPucchFormat.format0->startSymbolIdx;
+ }
+}
+
+/**
+ * @brief Function to fill Pucch Format 1
+ *
+ * @details
+ *
+ * Function : fillPucchFormat1
+ *
+ * Function to fill Pucch format 1
+ *
+ * @param[in] SchPucchInfo pointer, SchPucchResrcInfo pointer
+ * @return void
+ **/
+
+void fillPucchFormat1(SchPucchInfo *ulSchedPucch, SchPucchResrcInfo *resrcInfo)
+{
+ if(resrcInfo->SchPucchFormat.format1)
+ {
+ ulSchedPucch->fdAlloc.numPrb = PUCCH_NUM_PRB_FORMAT_0_1_4;
+ ulSchedPucch->pucchFormat = PUCCH_FORMAT_1;
+ ulSchedPucch->initialCyclicShift = resrcInfo->SchPucchFormat.format1->initialCyclicShift;
+ ulSchedPucch->tdAlloc.numSymb = resrcInfo->SchPucchFormat.format1->numSymbols;
+ ulSchedPucch->tdAlloc.startSymb = resrcInfo->SchPucchFormat.format1->startSymbolIdx;
+ ulSchedPucch->timeDomOCC = resrcInfo->SchPucchFormat.format1->timeDomOCC;
+ }
+}
+
+/**
+ * @brief Function to fill Pucch format for UL Sched Info
+ *
+ * @details
+ *
+ * Function : fillUlSchedPucchFormat
+ *
+ * Function to fill Pucch format for UL Sched Info
+ *
+ * @param[in] pucchFormat , SchPucchInfo pointer,
+ * @param[in] SchPucchFormatCfg pointer, SchPucchResrcInfo pointer
+ * @return void
+ **/
+
+uint8_t fillUlSchedPucchFormat(uint8_t pucchFormat, SchPucchInfo *ulSchedPucch,\
+ SchPucchResrcInfo *resrcInfo, SchPucchFormatCfg *formatCfg)
+{
+ uint8_t ret = ROK;
+
+ switch(pucchFormat)
+ {
+ case PUCCH_FORMAT_0:
+ {
+ if(resrcInfo)
+ fillPucchFormat0(ulSchedPucch, resrcInfo);
+ return ret;
+ }
+ case PUCCH_FORMAT_1:
+ {
+ if(resrcInfo)
+ {
+ fillPucchFormat1(ulSchedPucch, resrcInfo);
+ }
+ if(formatCfg)
+ {
+ memcpy(&ulSchedPucch->cmnFormatCfg, formatCfg, sizeof(SchPucchFormatCfg));
+ }
+ return ret;
+ }/* To Add support for more Pucch Format */
+
+ default:
+ DU_LOG("\nERROR --> SCH : Invalid PUCCH format[%d] in fillUlSchedPucchFormatCfg()", pucchFormat);
+ ret = RFAILED;
+ return ret;
+ }
+ return ret;
+}
+
+/**
+ * @brief Function to fill Pucch Dedicated Cfg for UL Sched Info
+ *
+ * @details
+ *
+ * Function : fillUlSchedPucchDedicatedCfg
+ *
+ * Function to fill Pucch Dedicated Cfg for UL Sched Info
+ *
+ * @param[in] pucchFormat to be filled
+ * @param[in] SchPucchFormatCfg pointer, SchPucchCfg pointer
+ * @return void
+ **/
+
+uint8_t fillUlSchedPucchDedicatedCfg(uint16_t numSlots, SchPucchCfg *pucchDedCfg,\
+ SlotIndInfo *slotInfo, SchPucchInfo *ulSchedPucch)
+{
+ uint8_t ret, resrcSetIdx, resrcIdx, schedReqIdx, srPeriodicity = 0;
+ uint16_t srOffset = 0;
+
+ ret = ROK;
+ if(pucchDedCfg->resrcSet && pucchDedCfg->resrc)
+ {
+ //Assuming one entry in the list
+ for(resrcSetIdx = 0; resrcSetIdx < pucchDedCfg->resrcSet->resrcSetToAddModListCount; resrcSetIdx++)
+ {
+ for(resrcIdx = 0; resrcIdx < pucchDedCfg->resrc->resrcToAddModListCount; resrcIdx++)
+ {
+ if(pucchDedCfg->resrcSet->resrcSetToAddModList[resrcSetIdx].resrcList[resrcSetIdx] ==\
+ pucchDedCfg->resrc->resrcToAddModList[resrcIdx].resrcId)
+ {
+ ulSchedPucch->intraFreqHop = pucchDedCfg->resrc->resrcToAddModList[resrcIdx].intraFreqHop;
+ ulSchedPucch->secondPrbHop = pucchDedCfg->resrc->resrcToAddModList[resrcIdx].secondPrbHop;
+ ulSchedPucch->fdAlloc.startPrb = pucchDedCfg->resrc->resrcToAddModList[resrcIdx].startPrb;
+ ulSchedPucch->pucchFormat = pucchDedCfg->resrc->resrcToAddModList[resrcIdx].pucchFormat;
+ ret = fillUlSchedPucchFormat(ulSchedPucch->pucchFormat, ulSchedPucch,\
+ &pucchDedCfg->resrc->resrcToAddModList[resrcIdx], NULLP);
+ if(ret == RFAILED)
+ return ret;
+ }
+ }
+ }
+ }
+ if(pucchDedCfg->format1)
+ {
+ memset(&ulSchedPucch->cmnFormatCfg, 0, sizeof(SchPucchFormatCfg));
+ ret = fillUlSchedPucchFormat(ulSchedPucch->pucchFormat, ulSchedPucch, NULLP, pucchDedCfg->format1);
+ if(ret == RFAILED)
+ return ret;
+ }
+
+ /* setting SR and UCI flag */
+ if(pucchDedCfg->schedReq)
+ {
+ for(schedReqIdx = 0; schedReqIdx < pucchDedCfg->schedReq->schedAddModListCount; schedReqIdx++)
+ {
+ srPeriodicity = pucchDedCfg->schedReq->schedAddModList[schedReqIdx].periodicity;
+ srOffset = pucchDedCfg->schedReq->schedAddModList[schedReqIdx].offset;
+ break;
+ }
+ if(((numSlots * slotInfo->sfn + slotInfo->slot - srOffset) % srPeriodicity) == 0)
+ {
+ ulSchedPucch->srFlag = true;
+ ulSchedPucch->uciFlag = true;
+ }
+ }
+ return ret;
+}
+
+/**
+ * @brief Function to fill Pucch Resource Info
+ *
+ * @details
+ *
+ * Function : fillPucchResourceInfo
+ *
+ * Function to fill Pucch Resource Info
+ *
+ * @param[in] SchPucchInfo *schPucchInfo, Inst inst
+ * @return ROK/RFAILED
+ **/
+