+ return(MacMessageRouter(&pst, (void *)dlSchedInfo));
+}
+
+/*******************************************************************
+ *
+ * @brief
+ *
+ * @details
+ *
+ * Function : schFillBoGrantDlSchedInfo
+ *
+ * Functionality:
+
+ *
+ * @params[in] SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId
+ * @params[in] bool isRetx, SchDlHqProcCb **hqP
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+bool schFillBoGrantDlSchedInfo(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchDlHqProcCb **hqP)
+{
+ uint8_t pdschNumSymbols = 0, pdschStartSymbol = 0;
+ uint8_t lcIdx = 0;
+ uint16_t startPrb = 0;
+ uint16_t crnti = 0;
+ uint32_t accumalatedSize = 0;
+ SchUeCb *ueCb = NULLP;
+ DlMsgSchInfo *dciSlotAlloc, *dlMsgAlloc;
+ SlotTimingInfo pdcchTime, pdschTime, pucchTime;
+ SchPdcchAllocInfo pdcchAllocInfo;
+
+ GET_CRNTI(crnti,ueId);
+ ueCb = &cell->ueCb[ueId-1];
+
+ if (isRetx == FALSE)
+ {
+ if(schDlGetAvlHqProcess(cell, ueCb, hqP) != ROK)
+ {
+ return false;
+ }
+ }
+
+ memset(&pdcchAllocInfo,0,sizeof(SchPdcchAllocInfo));
+ if(findValidK0K1Value(cell, currTime, ueId, ueCb->k0K1TblPrsnt,\
+ &pdschStartSymbol, &pdschNumSymbols, &pdcchTime, &pdschTime, \
+ &pucchTime, isRetx, *hqP, &pdcchAllocInfo) != true )
+ {
+ /* If a valid combination of slots to scheduled PDCCH, PDSCH and PUCCH is
+ * not found, do not perform resource allocation. Return from here. */
+ return false;
+ }
+
+ /* allocate PDCCH and PDSCH resources for the ue */
+ if(cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId-1] == NULL)
+ {
+
+ SCH_ALLOC(dciSlotAlloc, sizeof(DlMsgSchInfo));
+ if(!dciSlotAlloc)
+ {
+ DU_LOG("\nERROR --> SCH : Memory Allocation failed for ded DL msg alloc");
+ return false;
+ }
+ cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1] = dciSlotAlloc;
+ memset(dciSlotAlloc, 0, sizeof(DlMsgSchInfo));
+ }
+ else
+ {
+ dciSlotAlloc = cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1];
+ }
+ /* Dl ded Msg info is copied, this was earlier filled in macSchDlRlcBoInfo */
+ fillDlMsgInfo(dciSlotAlloc, crnti, isRetx, *hqP);
+ dciSlotAlloc->transportBlock[0].ndi = isRetx;
+
+ accumalatedSize = cell->api->SchScheduleDlLc(pdcchTime, pdschTime, pdschNumSymbols, &startPrb, isRetx, hqP);
+
+ /*Below case will hit if NO LC(s) are allocated due to resource crunch*/
+ if (!accumalatedSize)
+ return false;
+
+ /*[Step6]: pdcch and pdsch data is filled */
+ if((schDlRsrcAllocDlMsg(cell, pdschTime, crnti, accumalatedSize, dciSlotAlloc, startPrb,\
+ pdschStartSymbol, pdschNumSymbols, isRetx, *hqP, pdcchAllocInfo)) != ROK)
+ {
+ DU_LOG("\nERROR --> SCH : Scheduling of DL dedicated message failed");
+
+ /* Free the dl ded msg info allocated in macSchDlRlcBoInfo */
+ if(!dciSlotAlloc->dlMsgPdschCfg)
+ {
+ SCH_FREE(dciSlotAlloc, sizeof(DlMsgSchInfo));
+ cell->schDlSlotInfo[pdcchTime.slot]->dlMsgAlloc[ueId -1] = NULL;
+ }
+ return false;
+ }
+
+ /* TODO : Update the scheduling byte report for multiple LC based on QCI
+ * and Priority */
+ /* As of now, the total number of bytes scheduled for a slot is divided
+ * equally amongst all LC with pending data. This is avoid starving of any
+ * LC
+ * */
+#if 0
+ accumalatedSize = accumalatedSize/dlMsgAlloc->numLc;
+ for(lcIdx = 0; lcIdx < dlMsgAlloc->numLc; lcIdx ++)
+ dlMsgAlloc->lcSchInfo[lcIdx].schBytes = accumalatedSize;
+#endif
+
+ /* Check if both DCI and DL_MSG are sent in the same slot.
+ * If not, allocate memory for DL_MSG PDSCH slot to store PDSCH info */