X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fdu_app_mac_inf.c;h=7e2caf123df47cf08011f359300f65c3dce05e4a;hb=5bca27d3d33c085718de6e894b875c845d7456d2;hp=0aa49644175be46f205ad15159b6f68d4a30b6e3;hpb=6ffefa70d25f1f2e9a5879d4eb8f3af6379b54a9;p=o-du%2Fl2.git diff --git a/src/cm/du_app_mac_inf.c b/src/cm/du_app_mac_inf.c index 0aa496441..7e2caf123 100644 --- a/src/cm/du_app_mac_inf.c +++ b/src/cm/du_app_mac_inf.c @@ -1498,6 +1498,76 @@ uint8_t unpackDuMacSliceReCfgRsp(MacDuSliceReCfgRspFunc func, Pst *pst, Buffer * ODU_PUT_MSG_BUF(mBuf); return RFAILED; } + +/******************************************************************* + * + * @brief Pack and send Slot ind from MAC to DU APP + * + * @details + * + * Function : packDuMacSliceReCfgRsp + * + * Functionality: + * Pack and send Slot ind from MAC to DU APP + * + * @params[in] Pst *pst, SlotTimingInfo *slotIndInfo + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t packMacSlotInd(Pst *pst, SlotTimingInfo *slotIndInfo) +{ + 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 packMacSlotInd"); + return RFAILED; + } + /* pack the address of the structure */ + CMCHKPK(oduPackPointer,(PTR)slotIndInfo, mBuf); + } + else + { + DU_LOG("\nERROR --> MAC: Only LWLC supported for packMacSlotInd"); + return RFAILED; + } + + return ODU_POST_TASK(pst,mBuf); +} + +/******************************************************************* + * + * @brief Unpack Slot indication from MAC to DU APP + * + * @details + * + * Function :unpackDuMacSlotInd + * + * Functionality: Unpack Slot Indication from MAC to DU APP + * + * @params[in] DuMacSlotInd func, Pst *pst, Buffer *mBuf + * @return ROK - success + * RFAILED - failure + * + * ****************************************************************/ +uint8_t unpackDuMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf) +{ + if(pst->selector == ODU_SELECTOR_LWLC) + { + SlotTimingInfo *slotIndInfo; + + /* unpack the address of the structure */ + CMCHKUNPK(oduUnpackPointer, (PTR *)&slotIndInfo, mBuf); + ODU_PUT_MSG_BUF(mBuf); + return (*func)(pst, slotIndInfo); + } + + ODU_PUT_MSG_BUF(mBuf); + return RFAILED; +} /********************************************************************** End of file **********************************************************************/