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=dcfb9b950b4060324dbf87401e158b52cbec13a5;hb=fed126358e8ddf1cb94f28740eb668b665685ea9;hp=417df5b20860450059a1bb0a646e84b742d62d79;hpb=40d79285fedc8551f3f0e43ba01123d367c09248;p=o-du%2Fl2.git diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index 417df5b20..dcfb9b950 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -19,6 +19,88 @@ #include "common_def.h" #include "du_app_rlc_inf.h" +/******************************************************************* +* +* @brief Packs and Sends Max Retransmission Reached Info from RLC to DUAPP +* +* @details +* +* Function : packRlcDuMaxRetransInd +* +* Functionality: +* Packs and Sends Max Retransmission Reached Info from RLC to DUAPP +* +* +* @params[in] Post structure pointer +* RlcMaxRetransInfo *maxRetransInfo +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packRlcDuMaxRetransInd(Pst *pst, RlcMaxRetransInfo *maxRetransInfo) +{ + 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 packRlcDuMaxRetransInd"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)maxRetransInfo, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuMaxRetransInd"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* +* @brief Unpacks Max Retransmission Reached Info received from DU APP +* +* @details +* +* Function : unpackRlcMaxRetransInd +* +* Functionality: +* Unpacks Max Retransmission Reached Info received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcMaxRetransInd(RlcDuMaxRetransInd func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcMaxRetransInfo *maxRetransInfo = NULLP; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&maxRetransInfo, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, maxRetransInfo); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for Max Retransmission Reached Info "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + /******************************************************************* * * @brief Packs and Sends UE create Request from DUAPP to RLC