X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_mac_inf.c;h=775508d820364a3d1c8e7959365f542c8c66bacb;hb=964fd8f1dc9c969e70caf8885332cc086ff22d74;hp=7b56931d0e1612060892b643e622fb1c85236afa;hpb=f76690adc96d589ab208fbcdef906be32a5abb7d;p=o-du%2Fl2.git diff --git a/src/cm/du_app_mac_inf.c b/src/cm/du_app_mac_inf.c index 7b56931d0..775508d82 100644 --- a/src/cm/du_app_mac_inf.c +++ b/src/cm/du_app_mac_inf.c @@ -983,6 +983,86 @@ uint8_t unpackMacRachRsrcReq(DuMacRachRsrcReq func, Pst *pst, Buffer *mBuf) return RFAILED; } +/******************************************************************* + * + * @brief Packs and Sends RACH Resource release from DUAPP to MAC + * + * @details + * + * Function : packDuMacRachRsrcRel + * + * Functionality: + * Packs and Sends RACH Resource release from DU APP to MAC + * + * + * @params[in] Post structure pointer + * MacRachRsrcRel pointer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packDuMacRachRsrcRel(Pst *pst, MacRachRsrcRel *rachRsrcRel) +{ + Buffer *mBuf = NULLP; + + if(pst->selector == ODU_SELECTOR_LWLC) + { + if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nERROR --> MAC : Memory allocation failed at packDuMacRachRsrcRel"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer, (PTR)rachRsrcRel, mBuf); + } + else + { + DU_LOG("\nERROR --> MAC: Only LWLC supported for packDuMacRachRsrcRel"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* + * + * @brief Unpacks RACH Resource Release received from DU APP + * + * @details + * + * Function : unpackMacRachRsrcRel + * + * Functionality: + * Unpacks RACH Resource Release received from DU APP + * + * @params[in] Pointer to Handler + * Post structure pointer + * Message Buffer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackMacRachRsrcRel(DuMacRachRsrcRel func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + MacRachRsrcRel *rachRsrcRel; + + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&rachRsrcRel, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, rachRsrcRel); + } + else + { + /* Nothing to do for other selectors */ + DU_LOG("\nERROR --> DU APP : Only LWLC supported for RACH Resource Release "); + ODU_PUT_MSG_BUF(mBuf); + } + + return RFAILED; +} + /******************************************************************* * * @brief Packs and Sends RACH Resource response from MAC to DU APP