+DuRlcDlUserDataToRlcFunc duSendRlcDlUserDataToRlcOpts[] =
+{
+ packRlcDlUserDataToRlc, /* Loose coupling */
+ RlcProcDlUserDataTransfer, /* Tight coupling */
+ packRlcDlUserDataToRlc /* Light weight-loose coupling */
+};
+
+/*******************************************************************
+ *
+ * @brief Function to fillDlUserDataInfo
+ *
+ * @details
+ *
+ * Function : fillDlUserDataInfo
+ *
+ * Functionality:
+ * Function to fillDlUserDataInfo
+ *
+ * @params[in] teId,
+ * dlDataMsgInfo
+ *
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t fillDlUserDataInfo(uint32_t teId, RlcDlUserDataInfo *dlDataMsgInfo)
+{
+ uint8_t drbIdx;
+
+ for(drbIdx = 0; drbIdx < duCb.numDrb; drbIdx++)
+ {
+ if(duCb.upTnlCfg[drbIdx] && (duCb.upTnlCfg[drbIdx]->tnlCfg1 != NULLP))
+ {
+ if(duCb.upTnlCfg[drbIdx]->tnlCfg1->teId == teId)
+ {
+ dlDataMsgInfo->cellId = duCb.upTnlCfg[drbIdx]->cellId;
+ dlDataMsgInfo->ueIdx = duCb.upTnlCfg[drbIdx]->ueIdx;
+ dlDataMsgInfo->rbId = duCb.upTnlCfg[drbIdx]->drbId;
+ return ROK;
+ }
+ }
+ }
+ return RFAILED;
+}
+
+ /*******************************************************************
+ *
+ * @brief Build and Send DL Data Message transfer to RLC
+ *
+ * @details
+ *
+ * Function : duBuildAndSendDlUserDataToRlc
+ *
+ * Functionality:
+ * Build and Send DL Data Message transfer to RLC
+ *
+ * @params[in] Cell ID
+ * UE Index
+ * Logical Channgel ID
+ * RRC Message
+ * RRC Message Length
+ * @return ROK - success
+ * RFAILED - failure
+ *
+ * ****************************************************************/
+
+uint8_t duBuildAndSendDlUserDataToRlc(uint16_t msgLen, EgtpMsg *egtpMsg)
+{
+ uint8_t ret = RFAILED;
+ Pst pst;
+ RlcDlUserDataInfo *dlDataMsgInfo = NULLP;
+
+ DU_ALLOC_SHRABL_BUF(dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
+ if(!dlDataMsgInfo)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed for dlDataMsgInfo in duHdlEgtpDlData()");
+ return RFAILED;
+ }
+ memset(dlDataMsgInfo, 0, sizeof(RlcDlUserDataInfo));
+ if(ODU_GET_MSG_BUF(DU_APP_MEM_REGION, DU_POOL, &dlDataMsgInfo->dlMsg) != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP : Memory allocation failed for dlMsg in duHdlEgtpDlData()");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
+ return RFAILED;
+ }
+ dlDataMsgInfo->dlMsg = egtpMsg->msg;
+ dlDataMsgInfo->msgLen = msgLen;
+
+ /* Filling DL DATA Msg Info */
+ if(fillDlUserDataInfo(egtpMsg->msgHdr.teId, dlDataMsgInfo) == ROK)
+ {
+ /* Filling post structure and sending msg */
+ FILL_PST_DUAPP_TO_RLC(pst, RLC_DL_INST, EVENT_DL_USER_DATA_TRANS_TO_RLC);
+ DU_LOG("\nDEBUG --> DU_APP : Sending User Data Msg to RLC \n");
+ ret = (*duSendRlcDlUserDataToRlcOpts[pst.selector])(&pst, dlDataMsgInfo);
+ }
+ if(ret != ROK)
+ {
+ DU_LOG("\nERROR --> DU_APP : Failed to send User Data to RLC in duHdlEgtpDlData()");
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo->dlMsg, msgLen);
+ DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlDataMsgInfo, sizeof(RlcDlUserDataInfo));
+ }
+ return ret;
+}