+ uint8_t pduIdx =0;
+ uint8_t lcIdx = 0;
+ uint8_t *txPdu =NULLP;
+ uint16_t tbSize =0;
+ MacDlData macDlData;
+ MacDlSlot *currDlSlot = NULLP;
+ DlRlcBoInfo dlBoInfo;
+
+ memset(&macDlData , 0, sizeof(MacDlData));
+ DU_LOG("\nDEBUG --> MAC: Received DL data for sfn=%d slot=%d numPdu= %d", \
+ dlData->slotInfo.sfn, dlData->slotInfo.slot, dlData->numPdu);
+ /* Copy the pdus to be muxed into mac Dl data */
+ macDlData.numPdu = dlData->numPdu;
+ for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
+ {
+ macDlData.pduInfo[pduIdx].lcId = dlData->pduInfo[pduIdx].lcId;
+ macDlData.pduInfo[pduIdx].pduLen = dlData->pduInfo[pduIdx].pduLen;
+ macDlData.pduInfo[pduIdx].dlPdu = dlData->pduInfo[pduIdx].pduBuf;
+ }
+
+ /* Store DL data in the scheduled slot */
+ currDlSlot = &macCb.macCell[dlData->cellId -1]->dlSlot[dlData->slotInfo.slot];
+ if(currDlSlot)
+ {
+ if(currDlSlot->dlInfo.dlMsgAlloc)
+ {
+ tbSize = currDlSlot->dlInfo.dlMsgAlloc->dlMsgPdschCfg.codeword[0].tbSize;
+ MAC_ALLOC(txPdu, tbSize);
+ if(!txPdu)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed in MacProcRlcDlData");
+ return RFAILED;
+ }
+ macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
+
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
+ }
+ }
+
+ for(lcIdx = 0; lcIdx < dlData->numLc; lcIdx++)
+ {
+ if(dlData->boStatus[lcIdx].bo)
+ {
+ memset(&dlBoInfo, 0, sizeof(DlRlcBoInfo));
+ dlBoInfo.cellId = dlData->boStatus[lcIdx].cellId;
+ GET_CRNTI(dlBoInfo.crnti, dlData->boStatus[lcIdx].ueIdx);
+ dlBoInfo.lcId = dlData->boStatus[lcIdx].lcId;
+ dlBoInfo.dataVolume = dlData->boStatus[lcIdx].bo;
+ sendDlRlcBoInfoToSch(&dlBoInfo);
+ }
+ }
+
+ /* Free memory */
+ for(pduIdx = 0; pduIdx < dlData->numPdu; pduIdx++)
+ {
+ MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData->pduInfo[pduIdx].pduBuf,\
+ dlData->pduInfo[pduIdx].pduLen);
+ }
+ if(pstInfo->selector == ODU_SELECTOR_LWLC)
+ {
+ MAC_FREE_SHRABL_BUF(pstInfo->region, pstInfo->pool, dlData, sizeof(RlcData));
+ }