X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_rlc_inf.c;h=b2ec5813e6a486c4fde5112df0daff7720827176;hb=6d01b1cb797bb2b47115eee21ad7d1a6ff3fcfe7;hp=41e1c0b99d1d82209dd614762f8b2dcea094b737;hpb=7c6820e987fadb1102e5891408ad33a8ce36ba95;p=o-du%2Fl2.git diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index 41e1c0b99..b2ec5813e 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -161,7 +161,7 @@ uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { - RlcUeCfgRsp *cfgRsp; + RlcUeCfgRsp *cfgRsp = NULLP; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf); ODU_PUT_MSG_BUF(mBuf); @@ -482,6 +482,155 @@ uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf) return RFAILED; } +/******************************************************************* + * + * @brief Pack and send DL RRC message Response from RLC to DU APP + * + * @details + * + * Function : packRlcDlRrcMsgRspToDu + * + * Functionality: + * Pack and send DL RRC message Response from RLC to DU APP + * + * @params[in] Post structure + * DL RRC Msg Response + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packRlcDlRrcMsgRspToDu(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsgRsp) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nRLC : Memory allocation failed at packRlcDlRrcMsgRspToDu"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)dlRrcMsgRsp, mBuf); + return ODU_POST_TASK(pst,mBuf); + } + else + { + DU_LOG("\nRLC: Only LWLC supported for packRlcDlRrcMsgRspToDu"); + } + return RFAILED; +} + +/******************************************************************* + * + * @brief Unpack DL RRC Msg Response received at DU APP from RLC + * + * @details + * + * Function : unpackRlcDlRrcMsgRspToDu + * + * Functionality: + * Unpack DL RRC Msg Response received at DU APP from RLC + * + * @params[in] + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackRlcDlRrcMsgRspToDu(RlcDlRrcMsgRspToDuFunc func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcDlRrcMsgRsp *dlRrcMsgRsp; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&dlRrcMsgRsp, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, dlRrcMsgRsp); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nRLC: Only LWLC supported for DL RRC Message transfer "); + ODU_PUT_MSG_BUF(mBuf); + } + return RFAILED; +} + +/******************************************************************* + * + * @brief Pack and send UL user data from RLC to DU APP + * + * @details + * + * Function : packRlcUlUserDataToDu + * + * Functionality: + * Pack and send UL User Data from RLC to DU APP + * + * @params[in] Post structure + * UL user data + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packRlcUlUserDataToDu(Pst *pst, RlcUlUserDatInfo *ulUserData) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> RLC UL: Memory allocation failed at packRlcUlUserDataToDu"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ulUserData, mBuf); + return ODU_POST_TASK(pst,mBuf); + } + else + { + DU_LOG("\nERROR --> RLC UL: Only LWLC supported for packRlcUlUserDataToDu"); + } + return RFAILED; +} + +/******************************************************************* + * + * @brief Unpack UL user data received at DU APP from RLC + * + * @details + * + * Function : unpackRlcUlUserDataToDu + * + * Functionality: + * Unpack UL user data received at DU APP from RLC + * + * @params[in] + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackRlcUlUserDataToDu(RlcUlUserDataToDuFunc func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUlUserDatInfo *ulUserData; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&ulUserData, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, ulUserData); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> DU APP: Only LWLC supported for UL User data transfer "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + /********************************************************************** End of file ***********************************************************************/