+/*******************************************************************
+ *
+ * @brief Processes DL RLC BO info from MAC
+ *
+ * @details
+ *
+ * Function : MacSchDlRlcBoInfo
+ *
+ * Functionality:
+ * Processes DL RLC BO info from MAC
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacSchDlRlcBoInfo(Pst *pst, DlRlcBoInfo *dlBoInfo)
+{
+ uint8_t lcId = 0;
+ uint16_t ueIdx = 0;
+ uint16_t slot;
+ SchUeCb *ueCb = NULLP;
+ SchCellCb *cell = NULLP;
+ SchDlSlotInfo *schDlSlotInfo = NULLP;
+
+ Inst inst = pst->dstInst-SCH_INST_START;
+ DU_LOG("\nDEBUG --> SCH : Received RLC BO Status indication");
+ cell = schCb[inst].cells[inst];
+
+ GET_UE_IDX(dlBoInfo->crnti, ueIdx);
+ ueCb = &cell->ueCb[ueIdx-1];
+ lcId = dlBoInfo->lcId;
+
+ if(lcId == SRB1_LCID || lcId == SRB2_LCID || lcId == SRB3_LCID || \
+ (lcId >= MIN_DRB_LCID && lcId <= MAX_DRB_LCID))
+ {
+ SET_ONE_BIT(ueIdx, cell->boIndBitMap);
+ ueCb->dlInfo.dlLcCtxt[lcId].bo = dlBoInfo->dataVolume;
+ }
+ else if(lcId != SRB0_LCID)
+ {
+ DU_LOG("\nERROR --> SCH : Invalid LC Id %d in MacSchDlRlcBoInfo", lcId);
+ return RFAILED;
+ }
+
+ slot = (cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA + BO_DELTA) % cell->numSlots;
+ schDlSlotInfo = cell->schDlSlotInfo[slot];
+
+ SCH_ALLOC(schDlSlotInfo->dlMsgInfo, sizeof(DlMsgInfo));
+ if(!schDlSlotInfo->dlMsgInfo)
+ {
+ DU_LOG("\nERROR --> SCH : Memory allocation failed for dlMsgInfo");
+ schDlSlotInfo = NULL;
+ return RFAILED;
+ }
+ schDlSlotInfo->dlMsgInfo->crnti = dlBoInfo->crnti;
+ schDlSlotInfo->dlMsgInfo->ndi = 1;
+ schDlSlotInfo->dlMsgInfo->harqProcNum = 0;
+ schDlSlotInfo->dlMsgInfo->dlAssignIdx = 0;
+ schDlSlotInfo->dlMsgInfo->pucchTpc = 0;
+ schDlSlotInfo->dlMsgInfo->pucchResInd = 0;
+ schDlSlotInfo->dlMsgInfo->harqFeedbackInd = 0;
+ schDlSlotInfo->dlMsgInfo->dciFormatId = 1;
+ if(lcId == SRB0_LCID)
+ schDlSlotInfo->dlMsgInfo->isMsg4Pdu = true;
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes BSR indiation from MAC
+ *
+ * @details
+ *
+ * Function : MacSchBsr
+ *
+ * Functionality:
+ * Processes DL BSR from MAC
+ *
+ * @params[in] Pst pst
+ * UlBufferStatusRptInd bsrInd
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacSchBsr(Pst *pst, UlBufferStatusRptInd *bsrInd)
+{
+ Inst schInst = pst->dstInst-SCH_INST_START;
+ SchCellCb *cellCb = NULLP;
+ SchUeCb *ueCb = NULLP;
+ uint8_t lcgIdx;
+
+ DU_LOG("\nDEBUG --> SCH : Received BSR");
+ cellCb = schCb[schInst].cells[schInst];
+ ueCb = schGetUeCb(cellCb, bsrInd->crnti);
+
+ /* store dataVolume per lcg in uecb */
+ for(lcgIdx = 0; lcgIdx < bsrInd->numLcg; lcgIdx++)
+ {
+ ueCb->bsrInfo[lcgIdx].priority = 1; //TODO: determining LCG priority?
+ ueCb->bsrInfo[lcgIdx].dataVol = bsrInd->dataVolInfo[lcgIdx].dataVol;
+ }
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Processes SR UCI indication from MAC
+ *
+ * @details
+ *
+ * Function : MacSchSrUciInd
+ *
+ * Functionality:
+ * Processes SR UCI indication from MAC
+ *
+ * @params[in] Post structure
+ * UCI Indication
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t MacSchSrUciInd(Pst *pst, SrUciIndInfo *uciInd)
+{
+ Inst inst = pst->dstInst-SCH_INST_START;
+
+ SchUeCb *ueCb;
+ SchCellCb *cellCb = schCb[inst].cells[inst];
+
+ DU_LOG("\nDEBUG --> SCH : Received SR");
+
+ ueCb = schGetUeCb(cellCb, uciInd->crnti);
+
+ if(uciInd->numSrBits)
+ {
+ ueCb->srRcvd = true;
+ }
+ return ROK;
+}