X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_rlc_inf.c;h=42a51dd92bdeda26d39ef7439df1fb1b666a2900;hb=088bb8763eaf91c139ede025faf2fac7e57d25ed;hp=b2ebef662f4da55e97e3d4e630cb77894c291ddd;hpb=4d45b914f9e94203603d3b9fdbcb1aad361301dd;p=o-du%2Fl2.git diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index b2ebef662..42a51dd92 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -43,7 +43,7 @@ uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) if(pst->selector == ODU_SELECTOR_LWLC) { - if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nRLC : Memory allocation failed at packDuRlcUeCreateReq"); return RFAILED; @@ -85,14 +85,14 @@ uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf) RlcUeCfg *ueCfg; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, mBuf); - ODU_PUT_MSG(mBuf); + ODU_PUT_MSG_BUF(mBuf); return (*func)(pst, ueCfg); } else { /* Nothing to do for other selectors */ DU_LOG("\nRLC: Only LWLC supported for UE Create Request "); - ODU_PUT_MSG(mBuf); + ODU_PUT_MSG_BUF(mBuf); } return RFAILED; @@ -122,7 +122,7 @@ uint8_t packRlcUlDuUeCreateRsp(Pst *pst, RlcUeCfgRsp *ueCfg) if(pst->selector == ODU_SELECTOR_LWLC) { - if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nRLC : Memory allocation failed at packRlcUlDuUeCreateRsp"); return RFAILED; @@ -164,14 +164,14 @@ uint8_t unpackRlcUlUeCreateRsp(RlcUlDuUeCreateRsp func, Pst *pst, Buffer *mBuf) RlcUeCfgRsp *cfgRsp; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, mBuf); - ODU_PUT_MSG(mBuf); + ODU_PUT_MSG_BUF(mBuf); return (*func)(pst, cfgRsp); } else { /* Nothing to do for other selectors */ DU_LOG("\nRLC: Only LWLC supported for UE Create Response "); - ODU_PUT_MSG(mBuf); + ODU_PUT_MSG_BUF(mBuf); } return RFAILED; @@ -200,7 +200,7 @@ uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) if(pst->selector == ODU_SELECTOR_LWLC) { - if (ODU_GET_MSG(pst->region, pst->pool, &mBuf) != ROK) + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { DU_LOG("\nRLC : Memory allocation failed at packRlcUlRrcMsgToDu"); return RFAILED; @@ -239,19 +239,93 @@ uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf) RlcUlRrcMsgInfo *ulRrcMsgInfo; /* unpack the address of the structure */ CMCHKUNPK(oduUnpackPointer, (PTR *)&ulRrcMsgInfo, mBuf); - ODU_PUT_MSG(mBuf); + ODU_PUT_MSG_BUF(mBuf); return (*func)(pst, ulRrcMsgInfo); } else { /* Nothing to do for other selectors */ DU_LOG("\nRLC: Only LWLC supported for UL RRC Message transfer "); - ODU_PUT_MSG(mBuf); + ODU_PUT_MSG_BUF(mBuf); } return RFAILED; } +/******************************************************************* + * + * @brief Pack and post DL RRC Message from DU APP to RLC + * + * @details + * + * Function : packDlRrcMsgToRlc + * + * Functionality: Pack and post DL RRC Message from DU APP to RLC + * + * @params[in] Post structure + * DL RRC Message info + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) +{ + 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 packRlcUlRrcMsgToDu"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)dlRrcMsgInfo, mBuf); + return ODU_POST_TASK(pst,mBuf); + } + else + { + DU_LOG("\nRLC: Only LWLC supported for packDlRrcMsgToRlc"); + } + return RFAILED; +} + +/******************************************************************* + * + * @brief Unpacks DL RRC Message info received at RLC from DU APP + * + * @details + * + * Function : unpackDlRrcMsgToRlc + * + * Functionality: + * Unpacks the DL RRC Message info received at RLC from DU APP + * + * @params[in] Pointer to handler function + * Post structure + * Messae buffer to be unpacked + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcDlRrcMsgInfo *dlRrcMsgInfo; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&dlRrcMsgInfo, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, dlRrcMsgInfo); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nRLC: Only LWLC supported for UL RRC Message transfer "); + ODU_PUT_MSG_BUF(mBuf); + } + return RFAILED; +} /********************************************************************** End of file