X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_rlc_inf.c;h=dd2aae755c79d6eaf97701abc45ed33103c9bc24;hb=cb811f8127971006aa5c345c71cb737e8be8dc10;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..dd2aae755 100644 --- a/src/cm/du_app_rlc_inf.c +++ b/src/cm/du_app_rlc_inf.c @@ -45,7 +45,7 @@ uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at packDuRlcUeCreateReq"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at packDuRlcUeCreateReq"); return RFAILED; } /* pack the address of the structure */ @@ -53,7 +53,7 @@ uint8_t packDuRlcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg) } else { - DU_LOG("\nRLC: Only LWLC supported for packDuRlcUeCreateReq"); + DU_LOG("\nERROR --> RLC: Only LWLC supported for packDuRlcUeCreateReq"); return RFAILED; } @@ -91,7 +91,7 @@ uint8_t unpackRlcUeCreateReq(DuRlcUeCreateReq func, Pst *pst, Buffer *mBuf) else { /* Nothing to do for other selectors */ - DU_LOG("\nRLC: Only LWLC supported for UE Create Request "); + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Create Request "); ODU_PUT_MSG_BUF(mBuf); } @@ -124,7 +124,7 @@ uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at packRlcDuUeCfgRsp"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDuUeCfgRsp"); return RFAILED; } /* pack the address of the structure */ @@ -132,7 +132,7 @@ uint8_t packRlcDuUeCfgRsp(Pst *pst, RlcUeCfgRsp *ueCfg) } else { - DU_LOG("\nRLC: Only LWLC supported for packRlcDuUeCfgRsp"); + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeCfgRsp"); return RFAILED; } @@ -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); @@ -170,7 +170,7 @@ uint8_t unpackRlcUeCfgRsp(RlcDuUeCfgRsp func, Pst *pst, Buffer *mBuf) else { /* Nothing to do for other selectors */ - DU_LOG("\nRLC: Only LWLC supported for UE Cfg Response "); + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Cfg Response "); ODU_PUT_MSG_BUF(mBuf); } @@ -202,7 +202,7 @@ uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at packRlcUlRrcMsgToDu"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcUlRrcMsgToDu"); return RFAILED; } /* pack the address of the structure */ @@ -211,7 +211,7 @@ uint8_t packRlcUlRrcMsgToDu(Pst *pst, RlcUlRrcMsgInfo *ulRrcMsgInfo) } else { - DU_LOG("\nRLC: Only LWLC supported for packRlcUlRrcMsgToDu"); + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcUlRrcMsgToDu"); } return RFAILED; } @@ -245,7 +245,7 @@ uint8_t unpackRlcUlRrcMsgToDu(RlcUlRrcMsgToDuFunc func, Pst *pst, Buffer *mBuf) else { /* Nothing to do for other selectors */ - DU_LOG("\nRLC: Only LWLC supported for UL RRC Message transfer "); + DU_LOG("\nERROR --> RLC: Only LWLC supported for UL RRC Message transfer "); ODU_PUT_MSG_BUF(mBuf); } @@ -276,7 +276,7 @@ uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at packRlcDlRrcMsgToRlc"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at packRlcDlRrcMsgToRlc"); return RFAILED; } /* pack the address of the structure */ @@ -285,7 +285,7 @@ uint8_t packDlRrcMsgToRlc(Pst *pst, RlcDlRrcMsgInfo *dlRrcMsgInfo) } else { - DU_LOG("\nRLC: Only LWLC supported for packDlRrcMsgToRlc"); + DU_LOG("\nERROR --> RLC: Only LWLC supported for packDlRrcMsgToRlc"); } return RFAILED; } @@ -321,7 +321,7 @@ uint8_t unpackDlRrcMsgToRlc(DuDlRrcMsgToRlcFunc func, Pst *pst, Buffer *mBuf) else { /* Nothing to do for other selectors */ - DU_LOG("\nRLC: Only LWLC supported for UL RRC Message transfer "); + DU_LOG("\nERROR --> RLC: Only LWLC supported for UL RRC Message transfer "); ODU_PUT_MSG_BUF(mBuf); } return RFAILED; @@ -353,7 +353,7 @@ uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at packRrcDeliveryReportToDu"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at packRrcDeliveryReportToDu"); return RFAILED; } /* pack the address of the structure */ @@ -362,7 +362,7 @@ uint8_t packRrcDeliveryReportToDu(Pst *pst, RrcDeliveryReport *rrcDeliveryReport } else { - DU_LOG("\nRLC: Only LWLC supported for packRrcDeliveryReportToDu"); + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRrcDeliveryReportToDu"); } return RFAILED; } @@ -398,7 +398,7 @@ uint8_t unpackRrcDeliveryReportToDu(RlcRrcDeliveryReportToDuFunc func, Pst *pst, else { /* Nothing to do for other selectors */ - DU_LOG("\nRLC: Only LWLC supported for RRC delivery Message transfer "); + DU_LOG("\nERROR --> RLC: Only LWLC supported for RRC delivery Message transfer "); ODU_PUT_MSG_BUF(mBuf); } @@ -431,7 +431,7 @@ uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg) { if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) { - DU_LOG("\nRLC : Memory allocation failed at packDuRlcUeReconfigReq"); + DU_LOG("\nERROR --> RLC : Memory allocation failed at packDuRlcUeReconfigReq"); return RFAILED; } /* pack the address of the structure */ @@ -439,7 +439,7 @@ uint8_t packDuRlcUeReconfigReq(Pst *pst, RlcUeCfg *ueCfg) } else { - DU_LOG("\nRLC: Only LWLC supported for packDuRlcUeReconfigReq"); + DU_LOG("\nERROR --> RLC: Only LWLC supported for packDuRlcUeReconfigReq"); return RFAILED; } @@ -476,12 +476,470 @@ uint8_t unpackRlcUeReconfigReq(DuRlcUeReconfigReq func, Pst *pst, Buffer *mBuf) else { /* Nothing to do for other selectors */ - DU_LOG("\nRLC: Only LWLC supported for UE Create Request "); + DU_LOG("\nERROR --> RLC: 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("\nERROR --> RLC : 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("\nERROR --> RLC: 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("\nERROR --> RLC: 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 --> RLC UL: Only LWLC supported for UL User data transfer "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + +/******************************************************************* + * + * @brief Pack and send DL user data from DUAPP to RLC + * + * @details + * + * Function : packRlcDlUserDataToRlc + * + * Functionality: + * Pack and send DL User Data from DUAPP to RLC + * + * @params[in] Post structure + * DL user data + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packRlcDlUserDataToRlc(Pst *pst, RlcDlUserDataInfo *dlUserData) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)dlUserData, dlUserData->dlMsg); + return ODU_POST_TASK(pst,dlUserData->dlMsg); + } + else + { + DU_LOG("\nERROR --> RLC DL: Only LWLC supported for packRlcUlUserDataToDu"); + } + return RFAILED; +} + +/******************************************************************* + * + * @brief Unpack DL user data received at RLC from DUAPP + * + * @details + * + * Function : unpackRlcDlUserDataToRlc + * + * Functionality: + * Unpack DL user data received at RLC from DUAPP + * + * @params[in] + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackRlcDlUserDataToRlc(DuRlcDlUserDataToRlcFunc func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcDlUserDataInfo *dlUserData; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&dlUserData, mBuf); + return (*func)(pst, dlUserData); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC DL: Only LWLC supported for UL User data transfer "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + +/******************************************************************* +* +* @brief Packs and Sends UE Delete Request from DUAPP to RLC +* +* @details +* +* Function : packDuRlcUeDeleteReq +* +* Functionality: +* Packs and Sends UE Delete Request from DUAPP to RLC +* +* +* @params[in] Post structure pointer +* RlcUeDelete pointer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packDuRlcUeDeleteReq(Pst *pst, RlcUeDelete *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 packDuRlcUeDeleteReq"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueDelete, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packDuRlcUeDeleteReq"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* @brief Unpacks UE Delete Request received from DU APP +* +* @details +* +* Function : unpackRlcUeDeleteReq +* +* Functionality: +* Unpacks UE Delete Request received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcUeDeleteReq(DuRlcUeDeleteReq func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeDelete *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 Delete Request "); + ODU_PUT_MSG_BUF(mBuf); + } + return RFAILED; +} + +/******************************************************************* +* +* @brief Packs and Sends UE Del Response from RLC to DUAPP +* +* @details +* +* Function : packRlcDuUeDeleteRsp +* +* Functionality: +* Packs and Sends UE Del Response from RLC to DUAPP +* +* +* @params[in] Post structure pointer +* RlcUeDeleteRsp *ueDelRsp +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packRlcDuUeDeleteRsp(Pst *pst, RlcUeDeleteRsp *ueDelRsp) +{ + 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 packRlcDuUeDeleteRsp"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)ueDelRsp, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuUeDeleteRsp"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* +* @brief Unpacks UE Del Response received from DU APP +* +* @details +* +* Function : unpackRlcUeDeleteRsp +* +* Functionality: +* Unpacks UE Del Response received from DU APP +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcUeDeleteRsp(RlcDuUeDeleteRsp func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + RlcUeDeleteRsp *ueDeleteRsp = NULLP; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&ueDeleteRsp, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, ueDeleteRsp); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for UE Del Response "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + +/******************************************************************* +* +* @brief Packs and Sends Slice PM from RLC to DUAPP +* +* @details +* +* Function : packRlcDuSlicePm +* +* Functionality: +* Packs and Sends Slice Performance Metrics from RLC to DUAPP +* +* +* @params[in] Post structure pointer +* SlicePmList *sliceStats +* +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t packRlcDuSlicePm(Pst *pst, SlicePmList *sliceStats) +{ + 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 packRlcDuSlicePm"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)sliceStats, mBuf); + } + else + { + DU_LOG("\nERROR --> RLC: Only LWLC supported for packRlcDuSlicePm"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* +* +* @brief Unpacks Slice PM received from RLC +* +* @details +* +* Function : unpackRlcSlicePm +* +* Functionality: +* Unpacks Slice Performance Metrics received from RLC +* +* @params[in] Pointer to Handler +* Post structure pointer +* Message Buffer +* @return ROK - success +* RFAILED - failure +* +* ****************************************************************/ + +uint8_t unpackRlcSlicePm(RlcSlicePmToDuFunc func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + SlicePmList *sliceStats = NULLP; + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&sliceStats, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, sliceStats); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> RLC: Only LWLC supported for Slice Metrics "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} /********************************************************************** End of file ***********************************************************************/