- SchCellCb *cell = schCb[inst].cells[inst];
- SchDlSlotInfo *schDlSlotInfo = \
- cell->schDlSlotInfo[(cell->slotInfo.slot + SCHED_DELTA + PHY_DELTA + MSG4_DELAY) % SCH_NUM_SLOTS];
-
- for(lcIdx = 0; lcIdx < dlBoInfo->numLc; lcIdx++)
- {
- if(dlBoInfo->boInfo[lcIdx].lcId == CCCH_LCID)
- {
- SCH_ALLOC(schDlSlotInfo->msg4Info, sizeof(Msg4Info));
- if(!schDlSlotInfo->msg4Info)
- {
- DU_LOG("\nSCH : Memory allocation failed for msg4Info");
- schDlSlotInfo = NULL;
- return RFAILED;
- }
- schDlSlotInfo->msg4Info->crnti = dlBoInfo->crnti;
- schDlSlotInfo->msg4Info->ndi = 1;
- schDlSlotInfo->msg4Info->harqProcNum = 0;
- schDlSlotInfo->msg4Info->dlAssignIdx = 0;
- schDlSlotInfo->msg4Info->pucchTpc = 0;
- schDlSlotInfo->msg4Info->pucchResInd = 0;
- schDlSlotInfo->msg4Info->harqFeedbackInd = 0;
- schDlSlotInfo->msg4Info->dciFormatId = 1;
- }
- }
+ 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);