+uint8_t MacProcRlcDlData(Pst* pstInfo, RlcData *dlData)
+{
+ uint8_t pduIdx;
+ uint8_t *txPdu;
+ uint16_t tbSize;
+ MacDlData macDlData;
+ MacDlSlot *currDlSlot = NULLP;
+
+ DU_LOG("\nMAC: Received DL data for sfn=%d slot=%d", \
+ dlData->slotInfo.sfn, dlData->slotInfo.slot);
+
+ /* 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("\nMAC : Memory allocation failed in MacProcRlcDlData");
+ return RFAILED;
+ }
+ macMuxPdu(&macDlData, NULLP, txPdu, tbSize);
+
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPduLen = tbSize;
+ currDlSlot->dlInfo.dlMsgAlloc->dlMsgInfo.dlMsgPdu = txPdu;
+ }
+ }
+
+ /* 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));
+ }
+
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Builds and Sends UL Data to RLC
+ *
+ * @details
+ *
+ * Function : macProcUlData
+ *
+ * Functionality: Builds and Sends UL Data to RLC
+ *
+ * @params[in] CellId
+ * CRNTI
+ * Slot information
+ * LC Id on which payload was received
+ * Pointer to the payload
+ * Length of payload
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t macProcUlData(uint16_t cellId, uint16_t rnti, SlotIndInfo slotInfo, \
+uint8_t lcId, uint16_t pduLen, uint8_t *pdu)