X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_mac_inf.c;h=2af744dc19a366b279942f48fdeaeffd6bcff63c;hb=197f4abee4ee0909e4509d6a2fbba78c500be7fe;hp=05b5662b4692c142b424a6c9413941f4e53709e6;hpb=1bed59663a087c96c3ebb984ee19be92e7f4ecc5;p=o-du%2Fl2.git diff --git a/src/cm/du_app_mac_inf.c b/src/cm/du_app_mac_inf.c index 05b5662b4..2af744dc1 100644 --- a/src/cm/du_app_mac_inf.c +++ b/src/cm/du_app_mac_inf.c @@ -457,6 +457,98 @@ uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf) return ROK; } +/******************************************************************* + * + * @brief Packs and Sends stop ind from MAC to DUAPP + * + * @details + * + * Function : packMacStopInd + * + * Functionality: + * Packs and Sends stop ind from MAC to DUAPP + * + * @params[in] Post structure pointer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint16_t packMacStopInd(Pst *pst, MacCellStopInfo *cellStopId) +{ + Buffer *mBuf = NULLP; + + if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) + { + DU_LOG("\nDU APP : Memory allocation failed for stop Ind pack"); + return RFAILED; + } + + if(pst->selector == DU_SELECTOR_LC) + { + /*pack the payload here*/ + DU_LOG("\nDU APP : Packed CellId"); + CMCHKPK(SPkU16, cellStopId->cellId, mBuf); + CM_FREE_SHRABL_BUF(pst->region, pst->pool, cellStopId, sizeof(MacCellStopInfo)); + cellStopId = NULL; + } + else if(pst->selector == DU_SELECTOR_LWLC) + { + /* pack the address of the structure */ + CMCHKPK(cmPkPtr,(PTR)cellStopId, mBuf); + } + else + { + SPutMsg(mBuf); + } + + return SPstTsk(pst,mBuf); +} + +/******************************************************************* + * + * @brief Unpacks stop indication from MAC + * + * @details + * + * Function : unpackMacStopInd + * + * Functionality: + * Unpacks stop indication from MAC + * + * @params[in] Pointer to Handler + * Post structure pointer + * Message Buffer + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint16_t unpackMacStopInd(DuMacStopInd func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == DU_SELECTOR_LWLC) + { + MacCellStopInfo *cellStopId; + /* unpack the address of the structure */ + CMCHKUNPK(cmUnpkPtr, (PTR *)&cellStopId, mBuf); + SPutMsg(mBuf); + return (*func)(pst, cellStopId); + } + else if(pst->selector == DU_SELECTOR_LC) + { + MacCellStopInfo cellStopId; + CMCHKUNPK(SUnpkU16, &(cellStopId.cellId), mBuf); + + SPutMsg(mBuf); + return (*func)(pst, &cellStopId); + + } + else + { + /* Nothing to do for loose coupling */ + SPutMsg(mBuf); + return ROK; + } + return ROK; +} /********************************************************************** End of file **********************************************************************/