+ }
+ RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg));
+ return ret;
+}
+
+/*******************************************************************
+*
+* @brief filling the structure of rrc delivery msg info
+*
+* @details
+*
+* Function : BuildAndSendRrcDeliveryReportToDu
+*
+* Functionality: filling the structure of rrc delivery msg info
+*
+* @return ROK - success
+* RFAILED - failure
+*
+* ****************************************************************/
+uint8_t BuildAndSendRrcDeliveryReportToDu( RlcDlRrcMsgInfo *dlRrcMsgInfo )
+{
+ Pst pst;
+ RrcDeliveryReport *rrcDelivery;
+
+ DU_LOG("\nINFO --> RLC : Filling RRC Delivery Report");
+ RLC_ALLOC_SHRABL_BUF(RLC_MEM_REGION_UL, RLC_POOL, rrcDelivery, sizeof(RrcDeliveryReport));
+
+ if(rrcDelivery)
+ {
+ rrcDelivery->cellId = dlRrcMsgInfo->cellId;
+ rrcDelivery->ueIdx = dlRrcMsgInfo->ueIdx;
+ rrcDelivery->srbId = dlRrcMsgInfo->lcId ;
+ rrcDelivery->rrcDeliveryStatus.deliveryStatus = PDCP_SN;
+ rrcDelivery->rrcDeliveryStatus.triggeringMessage = PDCP_SN;
+
+ /* Sending UL RRC Message transfeer to DU APP */
+ memset(&pst, 0, sizeof(Pst));
+ FILL_PST_RLC_TO_DUAPP(pst, RLC_UL_INST, EVENT_RRC_DELIVERY_MSG_TRANS_TO_DU);
+ rlcSendRrcDeliveryReportToDu(&pst, rrcDelivery);
+ }
+ else
+ {
+ DU_LOG("\nERROR --> RLC : Memory allocation failed");
+ }
+
+ return ROK;
+}
+/* ****************************************************************
+ *
+ * @brief Process the DL RRC Message from DU APP
+ *
+ * @details
+ *
+ * Function : RlcProcDlRrcMsgTransfer
+ *
+ * Functionality: Process the DL RRC Message from DU APP
+ *
+ * @params[in] Post structure
+ * DL RRC Message info
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t RlcProcDlRrcMsgTransfer(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo)
+{
+ Buffer *mBuf;
+ KwuDatReqInfo *datReqInfo;
+
+ RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
+ if(!datReqInfo)
+ {
+ DU_LOG("\nERROR --> RLC : Memory allocation failed in RlcProcDlRrcMsgTransfer");
+ RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
+ RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
+ return RFAILED;
+ }
+
+ datReqInfo->rlcId.rbType = dlRrcMsgInfo->rbType;
+ datReqInfo->rlcId.rbId = dlRrcMsgInfo->rbId;
+ datReqInfo->rlcId.ueId = dlRrcMsgInfo->ueIdx;
+ datReqInfo->rlcId.cellId = dlRrcMsgInfo->cellId;
+ datReqInfo->lcType = dlRrcMsgInfo->lcType;
+ datReqInfo->sduId = ++(rlcCb[pst->dstInst]->dlSduId);
+
+ /* Copy fixed buffer to message */
+ if(ODU_GET_MSG_BUF(RLC_MEM_REGION_UL, RLC_POOL, &mBuf) != ROK)
+ {
+ DU_LOG("\nERROR --> RLC : Memory allocation failed at RlcMacProcUlData");
+ RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
+ RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
+ RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
+ return RFAILED;
+ }
+ oduCpyFixBufToMsg(dlRrcMsgInfo->rrcMsg, mBuf, dlRrcMsgInfo->msgLen);
+
+ if(rlcProcDlData(pst, datReqInfo, mBuf) != ROK)
+ {
+ return RFAILED;
+ }
+
+ /* RRC Delivery report is only send when RRC Delivery status report is true in DL RRC Message */
+ if(dlRrcMsgInfo->deliveryStaRpt)
+ {
+ BuildAndSendRrcDeliveryReportToDu(dlRrcMsgInfo);
+ }
+
+ /* Free memory allocated by du app */
+ RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo));
+ RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen);
+ RLC_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, dlRrcMsgInfo, sizeof(RlcDlRrcMsgInfo));
+ return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Process UL data from UE
+ *
+ * @details
+ *
+ * Function : RlcProcUlData
+ *
+ * Functionality:
+ * This function receives the PDU from MAC.
+ * seggregates common and dedicated logical channel
+ * PDU and call respective handler.
+ *
+ * @params[in]
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+uint8_t RlcProcUlData(Pst *pst, RlcData *ulData)
+{
+ uint8_t ret = ROK;
+ uint8_t idx, pduIdx;
+ uint8_t lcId; /* Logical Channel */
+ uint8_t numDLch = 0; /* Number of dedicated logical channel */
+ bool dLchPduPres; /* PDU received on dedicated logical channel */
+ RguLchDatInd dLchData[MAX_NUM_LC]; /* PDU info on dedicated logical channel */
+ RguDDatIndInfo *dLchUlDat; /* UL data on dedicated logical channel */
+ RguCDatIndInfo *cLchUlDat; /* UL data on common logical channel */
+
+ /* Initializing dedicated logical channel Database */
+ DU_LOG("\nDEBUG --> RLC: Received UL Data request from MAC");
+ for(idx = 0; idx < MAX_NUM_LC; idx++)
+ {
+ dLchData[idx].lcId = idx;
+ dLchData[idx].pdu.numPdu = 0;
+ }
+ dLchPduPres = FALSE;
+
+ /* Seggregate PDUs received on common and dedicated channels
+ * and call common channel's handler */
+ for(idx = 0; idx< ulData->numPdu; idx++)
+ {
+ if(ulData->pduInfo[idx].commCh)