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=6fd9b940266c70a71325522e5bcd759f0ccd95d7;hpb=6b44407d464a5a4e060999255233a7cfe78bb0fa;p=o-du%2Fl2.git diff --git a/src/cm/du_app_rlc_inf.c b/src/cm/du_app_rlc_inf.c index 6fd9b9402..b2ec5813e 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -25,7 +25,7 @@ * * @details * - * Function : packDuRlcUlUeCreateReq + * Function : packDuRlcUeCreateReq * * Functionality: * Packs and Sends UE Create Request from DUAPP to RLC @@ -37,19 +37,19 @@ * RFAILED - failure * * ****************************************************************/ -uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) +uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) { Buffer *mBuf = NULLP; if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(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; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)ueCfg, mBuf); + CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf); } else { @@ -57,7 +57,7 @@ uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) return RFAILED; } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* @@ -66,7 +66,7 @@ uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) * * @details * - * Function : unpackRlcUlUeCreateReq + * Function : unpackRlcUeCreateReq * * Functionality: * Unpacks UE Create Request received from DU APP @@ -78,21 +78,21 @@ uint8_t packDuRlcUlUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) * RFAILED - failure * * ****************************************************************/ -uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf) +uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf) { if(pst->selector == ODU_SELECTOR_LWLC) { RlcUeCfg *ueCfg; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&ueCfg, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, 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 "); - SPutMsg(mBuf); + ODU_PUT_MSG_BUF(mBuf); } return RFAILED; @@ -100,14 +100,14 @@ uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf) /******************************************************************* * - * @brief Packs and Sends UE create Response from RLC to DUAPP + * @brief Packs and Sends UE Cfg Response from RLC to DUAPP * * @details * - * Function : packRlcUlDuUeCreateRsp + * Function : packRlcDuUeCfgRsp * * Functionality: - * Packs and Sends UE Create Rrsponse from RLC to DUAPP + * Packs and Sends UE Cfg Rrsponse from RLC to DUAPP * * * @params[in] Post structure pointer @@ -116,39 +116,39 @@ uint8_t unpackRlcUlUeCreateReq(DuRlcUlUeCreateReq func, Pst *pst, Buffer *mBuf) * RFAILED - failure * * ****************************************************************/ -uint8_t packRlcUlDuUeCreateRsp(Pst *pst, RlcUeCfgRsp *ueCfg) +uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) { Buffer *mBuf = NULLP; if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(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"); + DU_LOG("\nRLC : Memory allocation failed at packRlcDuUeCfgRsp"); return RFAILED; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)ueCfg, mBuf); + CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf); } else { - DU_LOG("\nRLC: Only LWLC supported for packRlcUlDuUeCreateRsp"); + DU_LOG("\nRLC: Only LWLC supported for packRlcDuUeCfgRsp"); return RFAILED; } - return SPstTsk(pst,mBuf); + return ODU_POST_TASK(pst,mBuf); } /******************************************************************* * - * @brief Unpacks UE Create Response received from DU APP + * @brief Unpacks UE Cfg Response received from DU APP * * @details * - * Function : unpackRlcUlUeCreateRsp + * Function : unpackRlcUeCfgRsp * * Functionality: - * Unpacks UE Create Response received from DU APP + * Unpacks UE Cfg Response received from DU APP * * @params[in] Pointer to Handler * Post structure pointer @@ -157,21 +157,21 @@ uint8_t packRlcUlDuUeCreateRsp(Pst *pst, RlcUeCfgRsp *ueCfg) * RFAILED - failure * * ****************************************************************/ -uint8_t unpackRlcUlUeCreateRsp(RlcUlDuUeCreateRsp func, Pst *pst, Buffer *mBuf) +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(cmUnpkPtr, (PTR *)&cfgRsp, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&cfgRsp, 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 "); - SPutMsg(mBuf); + DU_LOG("\nRLC: Only LWLC supported for UE Cfg Response "); + ODU_PUT_MSG_BUF(mBuf); } return RFAILED; @@ -200,14 +200,14 @@ uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) if(pst->selector == ODU_SELECTOR_LWLC) { - if (SGetMsg(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; } /* pack the address of the structure */ - CMCHKPK(cmPkPtr,(PTR)ulRrcMsgInfo, mBuf); - return SPstTsk(pst,mBuf); + CMCHKPK(oduPackPointer,(PTR)ulRrcMsgInfo, mBuf); + return ODU_POST_TASK(pst,mBuf); } else { @@ -238,20 +238,398 @@ uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf) { RlcUlRrcMsgInfo *ulRrcMsgInfo; /* unpack the address of the structure */ - CMCHKUNPK(cmUnpkPtr, (PTR *)&ulRrcMsgInfo, mBuf); - SPutMsg(mBuf); + CMCHKUNPK(oduUnpackPointer, (PTR *)&ulRrcMsgInfo, 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 "); - SPutMsg(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 packRlcDlRrcMsgToRlc"); + 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; +} + +/******************************************************************* +* +* @brief packs RRC delivery report sending from RLC to DU APP +* +* @details +* +* Function : packRrcDeliveryReportToDu +* +* 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 packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport) +{ + 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 packRrcDeliveryReportToDu"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)rrcDeliveryReport, mBuf); + return ODU_POST_TASK(pst,mBuf); + } + else + { + DU_LOG("\nRLC: Only LWLC supported for packRrcDeliveryReportToDu"); + } + return RFAILED; + } + +/******************************************************************* +* +* @brief Unpacks RRC Delivery Report info received at DU APP from RIC +* +* @details +* +* Function : unpackRrcDeliveryReportToDu +* +* Functionality: +* Unpacks RRC Delivery Report info received at DU APP from RIC +* +* @params[in] Pointer to handler function +* Post structure +* Messae buffer to be unpacked +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ +uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RrcDeliveryReport *rrcDeliveryReport; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&rrcDeliveryReport, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, rrcDeliveryReport); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nRLC: Only LWLC supported for RRC delivery Message transfer "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + +/******************************************************************* + * + * @brief Packs and Sends UE Reconfig Request from DUAPP to RLC + * + * @details + * + * Function : packDuRlcUeReconfigReq + * + * Functionality: + * Packs and Sends UE Reconfig Request from DUAPP to RLC + * + * + * @params[in] Post structure pointer + * RlcUeCfg pointer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg) +{ + 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 packDuRlcUeReconfigReq"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueCfg, mBuf); + } + else + { + DU_LOG("\nRLC: Only LWLC supported for packDuRlcUeReconfigReq"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* + * @brief Unpacks UE Reconfig Request received from DU APP + * + * @details + * + * Function : unpackRlcUeReconfigReq + * + * Functionality: + * Unpacks UE Create Request received from DU APP + * + * @params[in] Pointer to Handler + * Post structure pointer + * Message Buffer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeCfg *ueCfg; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueCfg, 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_BUF(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