X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fcm%2Fdu_app_mac_inf.c;h=51c46c819e48dab7e9faa8c45ff3701a9e3202f2;hb=069ae37558afd5aee2d1072bbf5b517cf665bdd8;hp=57068bbd46784f703796a93fee550b78bb5b8991;hpb=8b3c1a54b33c87e09512690649ed24775f7a5508;p=o-du%2Fl2.git diff --git a/src/cm/du_app_mac_inf.c b/src/cm/du_app_mac_inf.c index 57068bbd4..51c46c819 100644 --- a/src/cm/du_app_mac_inf.c +++ b/src/cm/du_app_mac_inf.c @@ -376,28 +376,34 @@ uint16_t unpackMacCellStopReq(DuMacCellStopReq func, Pst *pst, Buffer *mBuf) * ****************************************************************/ uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo ) { - if(pst->selector == DU_SELECTOR_LC || pst->selector == DU_SELECTOR_TC) + Buffer *mBuf = NULLP; + + if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) { - /* Loose coupling not supported */ - DU_LOG("\nDU APP : Only LWLC supported"); + DU_LOG("\nDU APP : Memory allocation failed for cell start req pack"); return RFAILED; } - else if(pst->selector == DU_SELECTOR_LWLC) + + if(pst->selector == DU_SELECTOR_LC) { - Buffer *mBuf = NULLP; + CMCHKPK(SPkU16, slotInfo->cellId, mBuf); + CMCHKPK(SPkU16, slotInfo->sfn, mBuf); + CMCHKPK(SPkU16, slotInfo->slot, mBuf); - if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) - { - DU_LOG("\nDU APP : Memory allocation failed for cell start req pack"); - return RFAILED; - } - + SPutStaticBuffer(pst->region, pst->pool, slotInfo, sizeof(SlotInfo), 0); + slotInfo = NULL; + } + else if(pst->selector == DU_SELECTOR_LWLC) + { /* pack the address of the structure */ CMCHKPK(cmPkPtr,(PTR)slotInfo, mBuf); - - return SPstTsk(pst,mBuf); } - return ROK; + else + { + SPutMsg(mBuf); + } + + return SPstTsk(pst,mBuf); } /******************************************************************* @@ -420,15 +426,27 @@ uint16_t packMacSlotInd(Pst *pst, SlotInfo *slotInfo ) * ****************************************************************/ uint16_t unpackMacSlotInd(DuMacSlotInd func, Pst *pst, Buffer *mBuf) { - SlotInfo *slotInfo; - if(pst->selector == DU_SELECTOR_LWLC) { + SlotInfo *slotInfo; + /* unpack the address of the structure */ CMCHKUNPK(cmUnpkPtr, (PTR *)&slotInfo, mBuf); SPutMsg(mBuf); return (*func)(pst, slotInfo); } + else if(pst->selector == DU_SELECTOR_LC) + { + SlotInfo slotInfo; + + CMCHKUNPK(SUnpkU16, &(slotInfo.slot), mBuf); + CMCHKUNPK(SUnpkU16, &(slotInfo.sfn), mBuf); + CMCHKUNPK(SUnpkU16, &(slotInfo.cellId), mBuf); + + SPutMsg(mBuf); + return (*func)(pst, &slotInfo); + + } else { /* Nothing to do for loose coupling */