+ if ((hqP->ulLcPrbEst.defLcList.count == 0) && (hqP->ulLcPrbEst.dedLcList.count == 0))
+ {
+ if( (ueCb->srRcvd) || (isRetx) )
+ {
+ *startPrb = MAX_NUM_RB;
+ *totTBS = schCalcTbSize(UL_GRANT_SIZE);
+ }
+ /*Returning true when NO Grant is there for UE as this is not scheduling
+ * error*/
+ return ROK;
+ }
+
+ maxFreePRB = searchLargestFreeBlock(ueCb->cellCb, puschTime, startPrb, DIR_UL);
+
+ /*[Step4]: Estimation of PRB and BO which can be allocated to each LC in
+ * the list based on RRM policy*/
+
+ /*Either this UE contains no reservedPRB pool fir dedicated S-NSSAI or
+ * Num of Free PRB available is not enough to reserve Dedicated PRBs*/
+ if(maxFreePRB != 0)
+ {
+ mcsIdx = ueCb->ueCfg.ulModInfo.mcsIndex;
+ if((hqP->ulLcPrbEst.dedLcList.count == 0) || ((maxFreePRB < rsvdDedicatedPRB)))
+ {
+ hqP->ulLcPrbEst.sharedNumPrb = maxFreePRB;
+ DU_LOG("\nDEBUG --> SCH : UL Only Default Slice is scheduled, sharedPRB Count:%d",\
+ hqP->ulLcPrbEst.sharedNumPrb);
+
+ /*PRB Alloc for Default LCs*/
+ prbAllocUsingRRMPolicy(&(hqP->ulLcPrbEst.defLcList), FALSE, mcsIdx, symbLen,\
+ &(hqP->ulLcPrbEst.sharedNumPrb), NULLP, NULLP,&(ueCb->srRcvd));
+ }
+ else
+ {
+ hqP->ulLcPrbEst.sharedNumPrb = maxFreePRB - rsvdDedicatedPRB;
+
+ /*PRB Alloc for Dedicated LCs*/
+ prbAllocUsingRRMPolicy(&(hqP->ulLcPrbEst.dedLcList), TRUE, mcsIdx, symbLen,\
+ &(hqP->ulLcPrbEst.sharedNumPrb), &(rsvdDedicatedPRB),\
+ NULLP,&(ueCb->srRcvd));
+
+ /*PRB Alloc for Default LCs*/
+ prbAllocUsingRRMPolicy(&(hqP->ulLcPrbEst.defLcList), FALSE, mcsIdx, symbLen, \
+ &(hqP->ulLcPrbEst.sharedNumPrb), &(rsvdDedicatedPRB),\
+ NULLP,&(ueCb->srRcvd));
+ }
+ }
+ /*[Step5]:Traverse each LCID in LcList to calculate the exact Scheduled Bytes
+ * using allocated BO per LC and Update dlMsgAlloc(BO report for MAC*/
+ if(hqP->ulLcPrbEst.dedLcList.count != 0)
+ updateGrantSizeForBoRpt(&(hqP->ulLcPrbEst.dedLcList), NULLP, ueCb->bsrInfo, totTBS);
+
+ updateGrantSizeForBoRpt(&(hqP->ulLcPrbEst.defLcList), NULLP, ueCb->bsrInfo, totTBS);
+
+ /*Below case will hit if NO LC(s) are allocated due to resource crunch*/
+ if (*totTBS == 0)
+ {
+ if(maxFreePRB == 0)
+ {
+ DU_LOG("\nERROR --> SCH : NO FREE PRB!!");
+ }
+ else
+ {
+ /*Schedule the LC for next slot*/
+ DU_LOG("\nDEBUG --> SCH : No LC has been scheduled");
+ }
+ return RFAILED;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief sch Process pending Sr or Bsr Req
+ *
+ * @details
+ *
+ * Function : schProcessSrOrBsrReq
+ *
+ * Functionality:
+ * sch Process pending Sr or Bsr Req
+ *
+ * @params[in] SchCellCb *cell, SlotTimingInfo currTime
+ * @params[in] uint8_t ueId, Bool isRetx, SchUlHqProcCb **hqP
+ * @return true - success
+ * false - failure
+ *
+ *******************************************************************/
+bool schProcessSrOrBsrReq(SchCellCb *cell, SlotTimingInfo currTime, uint8_t ueId, bool isRetx, SchUlHqProcCb **hqP)
+{
+ bool k2Found = FALSE;
+ uint8_t ret = RFAILED;
+ uint8_t startSymb = 0, symbLen = 0;
+ uint8_t k2TblIdx = 0, k2Index = 0, k2Val = 0;
+ uint16_t startPrb = 0;
+ uint32_t totDataReq = 0; /* in bytes */
+ SchUeCb *ueCb;
+ SchPuschInfo *puschInfo;
+ DciInfo *dciInfo = NULLP;
+ SchK2TimingInfoTbl *k2InfoTbl=NULLP;
+ SlotTimingInfo dciTime, puschTime;
+
+ if(cell == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH: schProcessSrOrBsrReq() : Cell is NULL");
+ return false;
+ }
+
+ ueCb = &cell->ueCb[ueId-1];
+
+ if(ueCb == NULLP)
+ {
+ DU_LOG("\nERROR --> SCH: schProcessSrOrBsrReq() : UE is NULL");
+ return false;
+ }
+
+ if (isRetx == FALSE)
+ {
+ if (schUlGetAvlHqProcess(cell, ueCb, hqP) != ROK)