+/*******************************************************************
+ *
+ * @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)
+{
+ Pst pst;
+ RlcData *ulData;
+
+ /* Filling RLC Ul Data*/
+ MAC_ALLOC_SHRABL_BUF(ulData, sizeof(RlcData));
+ if(!ulData)
+ {
+ DU_LOG("\nERROR --> MAC : Memory allocation failed while sending UL data to RLC");
+ return RFAILED;
+ }
+ memset(ulData, 0, sizeof(RlcData));
+ ulData->cellId = cellId;
+ ulData->rnti = rnti;
+ memcpy(&ulData->slotInfo, &slotInfo, sizeof(SlotIndInfo));
+ ulData->slotInfo.cellId = cellId;
+
+ /* Filling pdu info */
+ if(lcId == SRB1_LCID || lcId == SRB2_LCID)
+ {
+ ulData->pduInfo[ulData->numPdu].commCh = true;
+ }
+ ulData->pduInfo[ulData->numPdu].lcId = lcId;
+ ulData->pduInfo[ulData->numPdu].pduBuf = pdu;
+ ulData->pduInfo[ulData->numPdu].pduLen = pduLen;
+ ulData->numPdu++;
+
+ /* Filling Post and send to RLC */
+ memset(&pst, 0, sizeof(Pst));
+ FILL_PST_MAC_TO_RLC(pst, 0, EVENT_UL_DATA_TO_RLC);
+ MacSendUlDataToRlc(&pst, ulData);
+
+ return ROK;
+}
+
+