X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_msg_hdl.c;h=713fc2779661e1c892c3fc37f94269f936cbea71;hb=088bb8763eaf91c139ede025faf2fac7e57d25ed;hp=36f0ec16787db2afc0e94e461764f3f208450102;hpb=0a26c487f1b6bbb5217e47b15fa8273b2e749283;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_msg_hdl.c b/src/5gnrrlc/rlc_msg_hdl.c index 36f0ec167..713fc2779 100644 --- a/src/5gnrrlc/rlc_msg_hdl.c +++ b/src/5gnrrlc/rlc_msg_hdl.c @@ -35,9 +35,7 @@ #include "kw.x" #include "du_app_rlc_inf.h" -#include "rlc.h" - -extern U16 getTransId(); +#include "rlc_utils.h" /******************************************************************* * @@ -211,6 +209,65 @@ uint8_t RlcUlProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueCfg, sizeof(RlcUeCfg)); return ret; } + +/******************************************************************* + * + * @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) +{ + uint16_t copyLen; + Buffer *mBuf; + KwuDatReqInfo *datReqInfo; + + RLC_SHRABL_STATIC_BUF_ALLOC(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo)); + if(!datReqInfo) + { + DU_LOG("\nRLC : Memory allocation failed in RlcProcDlRrcMsgTransfer"); + 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("\nRLC : Memory allocation failed at RlcMacProcUlData"); + RLC_SHRABL_STATIC_BUF_FREE(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo, sizeof(KwuDatReqInfo)); + return RFAILED; + } + /* ODU_COPY_FIX_BUF_TO_MSG copies fixed buffer in reverse order. Hence reversing the + * fixed buffer before copying in order to maintain the actual order*/ + reverseFixBuf(dlRrcMsgInfo->rrcMsg, dlRrcMsgInfo->msgLen); + ODU_COPY_FIX_BUF_TO_MSG(dlRrcMsgInfo->rrcMsg, mBuf, 0, dlRrcMsgInfo->msgLen, \ + (MsgLen *)©Len); + + RlcUiKwuDatReq(pst, datReqInfo, mBuf); + + /* 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; +} + /********************************************************************** End of file **********************************************************************/