X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_rlc_inf.c;fp=src%2Fcm%2Fdu_app_rlc_inf.c;h=417df5b20860450059a1bb0a646e84b742d62d79;hb=40d79285fedc8551f3f0e43ba01123d367c09248;hp=2bdcf248a39b538a326800a77534f446e8ae2874;hpb=8144a551b3efaa006e48c00e6a2838ff662e2650;p=o-du%2Fl2.git diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index 2bdcf248a..417df5b20 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -940,6 +940,167 @@ uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf) return RFAILED; } + +/******************************************************************* +* +* @brief Packs and Sends UE Reestablishment Req from DUAPP to RLC +* +* @details +* +* Function : packDuRlcUeReestablishReq +* +* Functionality: +* Packs and Sends UE Reestablishment Req from DUAPP to RLC +* +* +* @params[in] Post structure pointer +* RlcUeReestablishReq pointer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packDuRlcUeReestablishReq(Pst *pst, RlcUeReestablishReq *ueDelete) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> RLC : Memory allocation failed at packDuRlcUeReestablishReq"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueDelete, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packDuRlcUeReestablishReq"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* @brief Unpacks UE Reestablishment Req received from DU APP +* +* @details +* +* Function : unpackRlcUeReestablishReq +* +* Functionality: +* Unpacks UE Reestablishment Req received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcUeReestablishReq(DuRlcUeReestablishReq func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeReestablishReq *ueDelete; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDelete, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, ueDelete); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Reestablishment Req "); + ODU_PUT_MSG_BUF(mBuf); + } + return RFAILED; +} + +/******************************************************************* +* +* @brief Packs and Sends UE Reestablishment Response from RLC to DUAPP +* +* @details +* +* Function : packRlcDuUeReestablishRsp +* +* Functionality: +* Packs and Sends UE Reestablishment Response from RLC to DUAPP +* +* +* @params[in] Post structure pointer +* RlcUeReestablishRsp *ueReestablish +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packRlcDuUeReestablishRsp(Pst *pst, RlcUeReestablishRsp *ueReestablish) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuUeReestablishRsp"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueReestablish, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeReestablishRsp"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* +* @brief Unpacks UE Reestablishment Response received from DU APP +* +* @details +* +* Function : unpackRlcUeReestablishRsp +* +* Functionality: +* Unpacks UE Reestablishment Response received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcUeReestablishRsp(RlcDuUeReestablishRsp func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeReestablishRsp *ueReestablishRsp = NULLP; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueReestablishRsp, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, ueReestablishRsp); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Reestablishment Response "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} /********************************************************************** End of file ***********************************************************************/