Memory handling fixes 69/6569/1
authorlal.harshita <Harshita.Lal@radisys.com>
Tue, 6 Jul 2021 09:24:44 +0000 (14:54 +0530)
committerAnkit Barve <anbarve@radisys.com>
Mon, 6 Sep 2021 03:59:21 +0000 (03:59 +0000)
Change-Id: I55ffd21fbc79cdd2b142402ba9925fafdaf875b0
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
Signed-off-by: barveankit <anbarve@radisys.com>
Signed-off-by: lal.harshita <Harshita.Lal@radisys.com>
(cherry picked from commit 284fc2e85cb5008061a7f8c6d07947a1c6209432)

65 files changed:
build/odu/makefile
src/5gnrmac/lwr_mac_ex_ms.c
src/5gnrmac/mac_cfg_hdl.c
src/5gnrmac/mac_ue_mgr.c
src/5gnrmac/mac_utils.h
src/5gnrmac/rg.h
src/5gnrmac/rg_cfg.c
src/5gnrmac/rg_dhm.c
src/5gnrmac/rg_lmm.c
src/5gnrmac/rg_prg.c
src/5gnrmac/rg_prg.h
src/5gnrmac/rg_ptui.c
src/5gnrmac/rg_uim.c
src/5gnrmac/rg_utl.c
src/5gnrrlc/rlc_amm_dl.c
src/5gnrrlc/rlc_dl_msg_router.c
src/5gnrrlc/rlc_dl_ul_inf.c
src/5gnrrlc/rlc_dl_ul_inf_ul.c
src/5gnrrlc/rlc_layer_mgr.c
src/5gnrrlc/rlc_mgr.c
src/5gnrrlc/rlc_msg_hdl.c
src/5gnrrlc/rlc_portable_functions.c
src/5gnrrlc/rlc_stats.c
src/5gnrrlc/rlc_tmm_ul.c
src/5gnrrlc/rlc_ul_msg_router.c
src/5gnrrlc/rlc_utils.h
src/5gnrrlc/rlc_utl_dl.c
src/5gnrsch/rg_sch.c
src/5gnrsch/rg_sch.h
src/5gnrsch/rg_sch_cmn.c
src/5gnrsch/rg_sch_gom.c
src/5gnrsch/rg_sch_inf.c
src/5gnrsch/rg_sch_inf.h
src/5gnrsch/rg_sch_lmm.c
src/5gnrsch/rg_sch_utl.c
src/5gnrsch/sch.c
src/5gnrsch/sch.h
src/5gnrsch/sch_ue_mgr.c
src/5gnrsch/sch_utils.h
src/cm/ckw.c
src/cm/cm.h
src/cm/cm_hash.c
src/cm/cm_inet.c
src/cm/cm_inet.h
src/cm/cm_mblk.c
src/cm/cm_mem.c
src/cm/cm_mem_wl.c
src/cm/cm_tpt.c
src/cm/cm_tpt.h
src/cm/common_def.c
src/cm/common_def.h
src/cm/crg.c
src/cm/ctf.c
src/cm/kwu.c
src/cm/l2_tenb_stats.x
src/cm/lkw.c
src/cm/lrg.c
src/cm/mac_sch_interface.h
src/cm/rgm.c
src/cm/rgr.c
src/cm/rgu.c
src/du_app/du_cell_mgr.c
src/du_app/du_f1ap_msg_hdl.c
src/du_app/du_ue_mgr.c
src/du_app/du_utils.h

index a364182..f478388 100644 (file)
@@ -74,7 +74,7 @@ endif
 # macro for output file name and makefile name
 #
 
-PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DODU_SLOT_IND_DEBUG_LOG -DEGTP_TEST
+PLTFRM_FLAGS= -UMSPD -DODU -DINTEL_FAPI #-DODU_MEMORY_DEBUG_LOG #-DODU_SLOT_IND_DEBUG_LOG -DEGTP_TEST
 
 ifeq ($(MODE),TDD)
    PLTFRM_FLAGS += -DNR_TDD
index fd7dedf..91fb52c 100644 (file)
@@ -101,7 +101,7 @@ uint8_t lwrMacActvTsk(Pst *pst, Buffer *mBuf)
 #endif\r
                default:\r
                   {\r
-                     SPutMsg(mBuf);\r
+                     ODU_PUT_MSG_BUF(mBuf);\r
                      DU_LOG("\nERROR  -->  LWR MAC: Invalid event %d received", pst->event);\r
                      ret = RFAILED;\r
                   }\r
@@ -147,7 +147,7 @@ uint8_t lwrMacActvTsk(Pst *pst, Buffer *mBuf)
 \r
       default:\r
          {\r
-            SPutMsg(mBuf);\r
+            ODU_PUT_MSG_BUF(mBuf);\r
             DU_LOG("\nERROR  -->  LWR MAC: Message from invalid source entity %d", pst->srcEnt);\r
             ret = RFAILED;\r
          }\r
index b2244cb..240b4fa 100644 (file)
@@ -470,8 +470,9 @@ uint8_t MacProcSchCellDeleteRsp(Pst *pst, SchCellDeleteRsp *schCellDelRsp)
          {
             if(macCb.macCell[cellIdx]->cellId == schCellDelRsp->cellId)
             {
-               memset(macCb.macCell[cellIdx], 0, sizeof(MacCellCb));
                status  = SUCCESSFUL_RSP;
+               MAC_FREE(macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1Pdu, \
+                  macCb.macCell[cellIdx]->macCellCfg.sib1Cfg.sib1PduLen);
                MAC_FREE(macCb.macCell[cellIdx], sizeof(MacCellCb));
             }
             else
index dcd84c7..8c3bb2c 100644 (file)
@@ -1502,21 +1502,21 @@ uint8_t fillLogicalChannelCfg(SchLcCfg *schLcCfg, LcCfg *macLcCfg)
 
    if(macLcCfg->drbQos)
    {
-     if(!schLcCfg->drbQos)
-     {
-        MAC_ALLOC(schLcCfg->drbQos, sizeof(SchDrbQosInfo));
-       if(!schLcCfg->drbQos)
-        {
-           DU_LOG("\nERROR  -->  MAC : Memory alloc failed at drbQos at fillLogicalChannelCfg()");
-          ret = RFAILED;
-       }
-     }
-     if(ret == ROK)
-     {
-        fillSchDrbQosInfo(macLcCfg->drbQos, schLcCfg->drbQos);
-     }
-     else
-        return ret;
+      if(!schLcCfg->drbQos)
+      {
+         MAC_ALLOC(schLcCfg->drbQos, sizeof(SchDrbQosInfo));
+         if(!schLcCfg->drbQos)
+         {
+            DU_LOG("\nERROR  -->  MAC : Memory alloc failed at drbQos at fillLogicalChannelCfg()");
+            ret = RFAILED;
+         }
+      }
+      if(ret == ROK)
+      {
+         fillSchDrbQosInfo(macLcCfg->drbQos, schLcCfg->drbQos);
+      }
+      else
+         return ret;
    }
    else
    {
@@ -1541,20 +1541,9 @@ uint8_t fillLogicalChannelCfg(SchLcCfg *schLcCfg, LcCfg *macLcCfg)
             schLcCfg->snssai->sst = macLcCfg->snssai->sst;
             for(sdIdx = 0; sdIdx < SD_SIZE; sdIdx++)
             {
-              schLcCfg->snssai->sd[sdIdx] = macLcCfg->snssai->sd[sdIdx];
+               schLcCfg->snssai->sd[sdIdx] = macLcCfg->snssai->sd[sdIdx];
             }
          }
-        else
-        {
-            schLcCfg->snssai = NULLP;
-            /*Freeing the previously allocated buffer in case of failure */
-            if(schLcCfg->drbQos)
-            {
-               MAC_FREE(schLcCfg->drbQos, sizeof(SchDrbQosInfo));
-              schLcCfg->drbQos = NULLP;
-            }
-           return ret;
-        }
       }
       else
       {
@@ -1664,8 +1653,9 @@ uint8_t fillSchUeCfg(Pst *pst, SchUeCfg *schUeCfg, MacUeCfg *ueCfg)
       schUeCfg->ambrCfg->ulBr = ueCfg->ambrCfg->ulBr;
    }
    else
+   {
       schUeCfg->ambrCfg = NULLP;
-
+   }
    /* Fill DL modulation infor */
    schUeCfg->dlModInfo.modOrder = ueCfg->dlModInfo.modOrder;
    schUeCfg->dlModInfo.mcsIndex = ueCfg->dlModInfo.mcsIndex;
index 185cce7..447774e 100644 (file)
 #define MAC_MEM_REGION   4
 #define MAC_POOL         1
 
+#ifdef ODU_MEMORY_DEBUG_LOG
+#define MAC_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\
+{\
+   printf("\n%s=== %s +%d, %s, %d, %p\n",           \
+      _macro, _file, _line, _func, _size, _datPtr); \
+}
+#else
+#define MAC_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {}
+#endif
+
 /* allocate and zero out a MAC static buffer */
 #define MAC_ALLOC(_datPtr, _size)                            \
 {                                                            \
    uint8_t _ret;                                             \
    _ret = SGetSBuf(MAC_MEM_REGION, MAC_POOL,                 \
-        (Data **)&_datPtr, _size);                          \
+        (Data **)&_datPtr, _size);                               \
    if(_ret == ROK)                                           \
    {                                                         \
-      memset(_datPtr, 0, _size);                \
+      memset(_datPtr, 0, _size);                             \
+      MAC_MEM_LOG("MAC_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
    }                                                         \
    else                                                      \
    {                                                         \
 {                                                            \
    if(_datPtr)                                               \
    {                                                         \
+      MAC_MEM_LOG("MAC_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
       SPutSBuf(MAC_MEM_REGION, MAC_POOL,                     \
-           (Data *)_datPtr, _size);                         \
-      _datPtr = NULLP;                                      \
+           (Data *)_datPtr, _size);                              \
+      _datPtr = NULLP;                                       \
    }                                                         \
 }
 
 #define MAC_ALLOC_SHRABL_BUF(_buf, _size)                    \
 {                                                            \
    if(SGetStaticBuffer(MAC_MEM_REGION, MAC_POOL,             \
-           (Data **)&_buf, (Size) _size, 0) == ROK)         \
+           (Data **)&_buf, (Size) _size, 0) == ROK)              \
    {                                                         \
-      memset((_buf), 0, _size);                 \
+      MAC_MEM_LOG("MAC_ALLOC_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
+      memset((_buf), 0, _size);                              \
    }                                                         \
    else                                                      \
    {                                                         \
@@ -69,6 +82,7 @@
 {                                                            \
    if (_buf != NULLP)                                        \
    {                                                         \
+      MAC_MEM_LOG("MAC_FREE_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       (Void) SPutStaticBuffer(_region, _pool,                \
            (Data *) _buf, (Size) _size, 0);                 \
       _buf = NULLP;                                          \
index 16355d3..2253741 100755 (executable)
@@ -244,9 +244,7 @@ uint32_t macHeader[2];
 
 /* Free shared memory, received through LWLC */
 #define MAC_FREE_MEM(_region, _pool, _datPtr, _size)         \
-   if(_datPtr)                                               \
-       SPutSBuf(_region, _pool,(Data *)_datPtr, _size);      \
-   _datPtr = NULL;
+       MAC_FREE(_datPtr, _size);      \
 
 #define RG_LCG_ISCFGD(lcg) ((lcg)->lcgId != RG_INVALID_LCG_ID)
 /* Corrected the check for dlCcchId */
index 31c2ad4..64a66d3 100755 (executable)
@@ -44,7 +44,7 @@
 #include "rg_env.h"       /* MAC environmental includes*/
 #include "rg.h"           /* MAC includes*/
 #include "rg_err.h"       /* MAC error includes*/
-
+#include "mac_utils.h" 
 /* header/extern include files (.x) */
 #include "rgu.x"           /* RGU types */
 #include "tfu.x"           /* RGU types */
@@ -688,8 +688,12 @@ RgErrInfo   *errInfo
   
    pst = &rgCb[inst].rguSap[rguDlSapId].sapCfg.sapPst;
    /* Allocate a buffer for flowCntrlInd.*/
-   SGetSBuf(pst->region, pst->pool, (Data **)&cell->flowCntrlInd, 
-              sizeof(RguFlowCntrlInd));
+   MAC_ALLOC(cell->flowCntrlInd, sizeof(RguFlowCntrlInd));
+   if(cell->flowCntrlInd == NULLP)
+   {
+      DU_LOG("ERROR  --> MAC : rgCFGCrgCellCfg(): Memory allocation failed");
+      return RFAILED;
+   }
    return ROK;
 }  /* rgCFGCrgCellCfg */
 
index acca511..80129b0 100755 (executable)
@@ -270,7 +270,7 @@ Void rgDHMFreeTbBufs(Inst inst)
    while (start != end)
    {
       start--;
-      SPutMsg(rgCbP->bufToFree[start]);
+      ODU_PUT_MSG_BUF(rgCbP->bufToFree[start]);
    }
    rgCbP->bufCnt = end;
    return;
@@ -285,7 +285,7 @@ Void rgDHMFreeAllTbBufs(Inst inst)
    while (start != end)
    {
       start--;
-      SPutMsg(rgCbP->bufToFree[start]);
+      ODU_PUT_MSG_BUF(rgCbP->bufToFree[start]);
    }
    rgCbP->bufCnt = end;
    return;
index fc59447..a8fc28a 100755 (executable)
@@ -45,6 +45,7 @@
 #include "rgr.h"           /* LRG Interface defines */
 #include "rg.h"            /* MAC defines */
 #include "rg_err.h"        /* MAC error defines */
+#include "mac_utils.h"
 
 /* header/extern include files (.x) */
 #include "crg.x"           /* CRG Interface includes */
@@ -483,7 +484,7 @@ RgMngmt  *sta     /* status structure  */
 
    if (sta->t.ssta.s.sysId.ptNmb != NULLP)
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)sta->t.ssta.s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
+      MAC_FREE(sta->t.ssta.s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
    }
    
    memset(&cfm, 0, sizeof(RgMngmt));
@@ -496,9 +497,8 @@ RgMngmt  *sta     /* status structure  */
    if(rgCb[inst].rgInit.cfgDone != TRUE) 
    {
       SGetDateTime(&cfm.t.ssta.dt);
-      if (SGetSBuf(cfmPst.region, cfmPst.pool, 
-              (Data **)&(cfm.t.ssta.s.sysId.ptNmb), LRG_MAX_PT_NUM_SIZE)
-           != ROK)
+      MAC_ALLOC(cfm.t.ssta.s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
+          if(cfm.t.ssta.s.sysId.ptNmb == NULLP)
       {
         DU_LOG("\nERROR  -->  MAC : Memory Unavailable for Confirmation");
         return ROK;
@@ -517,9 +517,8 @@ RgMngmt  *sta     /* status structure  */
    {
       case STGEN:
          SGetDateTime(&cfm.t.ssta.dt);
-         if (SGetSBuf(cfmPst.region, cfmPst.pool, 
-             (Data **)&(cfm.t.ssta.s.sysId.ptNmb), LRG_MAX_PT_NUM_SIZE)
-            != ROK)
+         MAC_ALLOC(cfm.t.ssta.s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
+         if(cfm.t.ssta.s.sysId.ptNmb  == NULLP)
          {
             DU_LOG("\nERROR  -->  MAC : Memory Unavailable for Confirmation");
             return ROK;
@@ -850,10 +849,8 @@ RgCfg *cfg            /* Configuaration information */
    }
 
    /* allocate RGR saps */
-   if (SGetSBuf(rgCb[inst].rgInit.region,
-           rgCb[inst].rgInit.pool,
-           (Data **)&rgCb[inst].rguSap,
-           (sizeof(RgUpSapCb) * cfg->s.genCfg.numRguSaps)) != ROK)
+   MAC_ALLOC(rgCb[inst].rguSap, sizeof(RgUpSapCb) * cfg->s.genCfg.numRguSaps);
+   if(rgCb[inst].rguSap == NULLP)
    {
       DU_LOG("\nERROR  -->  MAC : rgGenCfg(): Failed to allocate mem for RGU SAP's.\n");
       return RFAILED;
@@ -880,9 +877,7 @@ RgCfg *cfg            /* Configuaration information */
 
       DU_LOG("\nERROR  -->  MAC : Failed to register timer");
 
-      SPutSBuf(rgCb[inst].rgInit.region,
-           rgCb[inst].rgInit.pool,
-           (Data *)rgCb[inst].rguSap,
+      MAC_FREE(rgCb[inst].rguSap,
            (sizeof(RgUpSapCb) * cfg->s.genCfg.numRguSaps));
 
       return (LCM_REASON_MEM_NOAVAIL);
@@ -945,11 +940,8 @@ static Void rgLMMShutdown(Inst inst)
    }
 
    /* Deleting the RGU SAPs */
-   SPutSBuf(rgCb[inst].rgInit.region,
-        rgCb[inst].rgInit.pool,
-        (Data *)rgCb[inst].rguSap,
+    MAC_FREE(rgCb[inst].rguSap,
         (sizeof(RgUpSapCb) * rgCb[inst].numRguSaps));
-   rgCb[inst].rguSap = NULLP;
 
    rgCb[inst].inactiveCell = NULLP;
    rgCb[inst].cell         = NULLP;
@@ -1617,7 +1609,7 @@ uint8_t event            /* event */
            return;
         }
 
-        if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
+        if (ODU_GET_MSG_BUF(pst.region, pst.pool, &dstMbuf) != ROK)
         {
            DU_LOG("\nERROR  -->  MAC : dstMbuf Allocation Failed");
            return;
index bbdfa09..ea572fc 100755 (executable)
@@ -69,7 +69,7 @@ S16 cmPkPrgPMacSMacUeSCellCfgReq(Pst  *pst,RgPrgUeSCellCfgInfo   *ueSCellCfgInfo
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
       return RFAILED;
    }
@@ -129,7 +129,7 @@ S16 cmPkPrgSMacPMacCfgCfm(Pst *pst,RgPrgCfgCfmInfo   *cfgCfm)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
       return RFAILED;
    }
@@ -215,7 +215,7 @@ S16 cmPkPrgPMacSMacUeSCellDelReq(Pst *pst,RgPrgUeSCellDelInfo   *ueSCellDelInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
       return RFAILED;
    }
@@ -282,7 +282,7 @@ S16 cmPkPrgPMacSMacUeSCellLchAddReq(Pst *pst,RgPrgUeSCellLchAddInfo   *lchCfgInf
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
       return RFAILED;
    }
@@ -348,7 +348,7 @@ S16 cmPkPrgPMacSMacUeSCellLchDelReq(Pst *pst,RgPrgUeSCellLchDelInfo *delLcCb)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
       return RFAILED;
    }
@@ -382,7 +382,7 @@ S16 cmPkPrgPMacSMacUeSCellLchModReq(Pst  *pst,RgPrgUeSCellLchModInfo  *lchCfgInf
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
       return RFAILED;
    }
index 067f8b2..23f41de 100755 (executable)
@@ -71,7 +71,7 @@
 {\
    if (NULLP != (_buf)) \
    { \
-      SPutMsg((_buf)); \
+      ODU_PUT_MSG_BUF((_buf)); \
       _buf = NULLP; \
    } \
 }
index 071901b..5423a03 100755 (executable)
@@ -1490,7 +1490,7 @@ static S16 RgUiRguDDatIndRbuf(RguDDatIndInfo  *datInd)
             {
                if(datInd->lchData[i].pdu.mBuf[j])
                {
-                  SPutMsg(datInd->lchData[i].pdu.mBuf[j]);
+                  ODU_PUT_MSG_BUF(datInd->lchData[i].pdu.mBuf[j]);
                }
             }
          }
index e13168a..f021429 100755 (executable)
@@ -47,6 +47,7 @@ manages Pst and Sap related information for upper interface APIs.
 #include "rg_env.h"        /* customizable defines and macros for MAC */
 #include "rg.h"            /* defines and macros for MAC */
 #include "rg_err.h"        /* RG error defines */
+#include "mac_utils.h"
 
 /* header/extern include files (.x) */
 
@@ -360,8 +361,7 @@ S16 RgUiRguDDatReq(Pst *pst,SpId spId,RguDDatReqInfo  *datReq)
 
    /* Call Ownership module for further processing */
    ret = rgROMDedDatReq(inst,datReq);
-    SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,sizeof(RguDDatReqInfo), SS_SHARABLE_MEMORY);
-   datReq = NULLP;
+   MAC_FREE_SHRABL_BUF(pst->region, pst->pool, datReq,sizeof(RguDDatReqInfo));
    return (ret);
 }  /* RgUiRguDDatReq */
 
@@ -441,8 +441,7 @@ RguCDatReqInfo  *datReq
    {
       RG_DROP_RGUCDATREQ_MBUF(datReq);
    }
-   ret = SPutStaticBuffer(pst->region, pst->pool,(Data *)datReq,sizeof(RguCDatReqInfo) , SS_SHARABLE_MEMORY);
-   datReq = NULLP;
+   MAC_FREE_SHRABL_BUF(pst->region, pst->pool,datReq,sizeof(RguCDatReqInfo));
    return (ret);
 }  /* RgUiRguCDatReq */
 
@@ -561,8 +560,7 @@ RguCStaRspInfo  *staRsp
       return (ret);
    }
 
-   ret = SPutStaticBuffer(pst->region, pst->pool, (Data *)staRsp,sizeof(RguCStaRspInfo) , SS_SHARABLE_MEMORY);
-   staRsp = NULLP;
+   MAC_FREE_SHRABL_BUF(pst->region, pst->pool, staRsp,sizeof(RguCStaRspInfo));
    return (ret);
 }  /* RgUiRguCStaRsp */
 
@@ -634,8 +632,7 @@ RguL2MUlThrpMeasReqInfo  *measReq
       DU_LOG("\nERROR  -->  MAC : Processing Of Meas Request Failed");
    }
 
-  SPutStaticBuffer(pst->region, pst->pool, (Data *)measReq,sizeof(RguL2MUlThrpMeasReqInfo) , SS_SHARABLE_MEMORY);
-   measReq= NULLP;
+   MAC_FREE_SHRABL_BUF(pst->region, pst->pool, (Data *)measReq,sizeof(RguL2MUlThrpMeasReqInfo));
    return (ret);
 }  /* RgUiRguL2MUlThrpMeasReq */
 #endif
@@ -1038,12 +1035,10 @@ CrgCfgReqInfo *cfgReqInfo
            DU_LOG("\nERROR  -->  MAC : Invalid SAP State:%d RgUiCrgCfgReq failed",
                   rgCb[inst].crgSap.sapSta.sapState);
 #endif
-         SPutSBuf (pst->region, pst->pool, (Data *)cfgReqInfo,
-               sizeof(CrgCfgReqInfo));
-         cfgReqInfo = NULLP;
+           MAC_FREE(cfgReqInfo, sizeof(CrgCfgReqInfo));
 
-            rgUIMCrgCfgCfm(inst,transId, cfmStatus);
-            return RFAILED;
+           rgUIMCrgCfgCfm(inst,transId, cfmStatus);
+           return RFAILED;
       }
    }
    else
@@ -1052,16 +1047,12 @@ CrgCfgReqInfo *cfgReqInfo
       DU_LOG("\nERROR  -->  MAC : Invalid SAP Id:%d RgUiCrgCfgReq failed",
             rgCb[inst].crgSap.sapCfg.spId);
 #endif
-      SPutSBuf (pst->region, pst->pool, (Data *)cfgReqInfo,
-            sizeof(CrgCfgReqInfo));
-      cfgReqInfo = NULLP;
+      MAC_FREE(cfgReqInfo, sizeof(CrgCfgReqInfo));
       rgUIMCrgCfgCfm(inst,transId, cfmStatus); 
       return RFAILED;
    }
    ret = rgCOMCfgReq(inst,transId, cfgReqInfo);
-   SPutSBuf (pst->region, pst->pool, (Data *)cfgReqInfo,
-         sizeof(CrgCfgReqInfo));
-   cfgReqInfo = NULLP;
+   MAC_FREE(cfgReqInfo, sizeof(CrgCfgReqInfo));
    if (ret != ROK)
    {
       DU_LOG("\nERROR  -->  MAC : Configuration Request Handling Failed ");
index c5e4025..6ec985d 100755 (executable)
@@ -41,6 +41,7 @@
 #include "tfu.h"           /* TFU Interface defines */
 #include "rg_sch_inf.h"    /* RGR Interface defines */
 #include "lrg.h"           /* LRG Interface defines */
+#include  "mac_utils.h"
 
 #include "rg_prg.h"        /* PRG(MAC-MAC) Interface includes */
 #include "rg.h"            /* MAC defines */
@@ -127,7 +128,8 @@ Size    size                /* size */
    }
 
    /* allocate buffer */
-   if (SGetStaticBuffer(rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, pData, size, 0) != ROK)
+   MAC_ALLOC_SHRABL_BUF(pData, size);
+   if(pData == NULLP)
    {
      dgn.type = LRG_USTA_DGNVAL_MEM;
      dgn.u.mem.region = rgCb[inst].rgInit.region;
@@ -140,10 +142,10 @@ Size    size                /* size */
    }
 
 #ifndef ALIGN_64BIT
-   DU_LOG("\nDEBUG  -->  MAC : SGetSBuf(Region (%d), Pool (%d), Size (%ld)), Data (0x%p))\n",
+   DU_LOG("\nDEBUG  -->  MAC : MAC_ALLOC(Region (%d), Pool (%d), Size (%ld)), Data (0x%p))\n",
              rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, size, *pData);
 #else
-   DU_LOG("\nDEBUG  -->  MAC : SGetSBuf(Region (%d), Pool (%d), Size (%d)), Data (0x%p))\n",
+   DU_LOG("\nDEBUG  -->  MAC : MAC_ALLOC(Region (%d), Pool (%d), Size (%d)), Data (0x%p))\n",
              rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, size, *pData);
 #endif
 
@@ -193,7 +195,8 @@ Size    size                /* size */
 #ifdef MS_MBUF_CORRUPTION /* Should be enabled when debugging mbuf corruption */
    MS_BUF_ADD_ALLOC_CALLER();
 #endif /* */
-   if (SGetSBuf(rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, pData, size) != ROK)
+   MAC_ALLOC(pData, size);
+   if(pData == NULLP)
    {
      dgn.type = LRG_USTA_DGNVAL_MEM;
      dgn.u.mem.region = rgCb[inst].rgInit.region;
@@ -244,9 +247,9 @@ Size size            /* size */
    }
 
    /* Deallocate buffer */
-   ret = SPutStaticBuffer(rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, *data, size, SS_SHARABLE_MEMORY);
-
-   if (ret != ROK)
+   MAC_FREE_SHRABL_BUF(rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, *data, size);
+   
+   if (data != NULLP)
    {
       return;
    }
@@ -295,9 +298,9 @@ Size size            /* size */
    MS_BUF_ADD_CALLER();
 #endif /* */
    /* Deallocate buffer */
-   ret = SPutSBuf(rgCb[inst].rgInit.region, rgCb[inst].rgInit.pool, *data, size);
+   MAC_FREE(data, size);
 
-   if (ret != ROK)
+   if (data != NULLP)
    {
       DU_LOG("\nERROR  -->  MAC : rgFreeSBuf failed.\n");
       return;
@@ -337,7 +340,7 @@ Buffer  **mBuf            /* Message Buffer pointer be returned */
 #ifdef MS_MBUF_CORRUPTION /* Should be enabled when debugging mbuf corruption */
    MS_BUF_ADD_ALLOC_CALLER();
 #endif /* */
-   ret = SGetMsg(RG_GET_MEM_REGION(rgCb[inst]), RG_GET_MEM_POOL(rgCb[inst]), mBuf);
+   ret = ODU_GET_MSG_BUF(RG_GET_MEM_REGION(rgCb[inst]), RG_GET_MEM_POOL(rgCb[inst]), mBuf);
 
    if (ROK != ret) 
    {
index a9a1da3..8854714 100755 (executable)
@@ -2950,15 +2950,6 @@ RlcSn          sn
    while(txBuf->pduLst.first)
    {
       RlcDlPduInfo *pduInfo = (RlcDlPduInfo *)(txBuf->pduLst.first->node);
-      RLC_ALLOC_WC(gCb,*retx, sizeof(RlcRetx));
-
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      if (*retx == NULLP)
-      {
-             DU_LOG("\nERROR  -->  RLC_DL : Memory allocation failed");
-             return;
-      }
-#endif /* ERRCLASS & ERRCLS_RES */
 
       /* Move Sdu byte segment from TX buf to retx buf*/
       rlcAmmDlMoveSduByteSegFrmTxtoRetxBuffer(gCb, 
@@ -3295,7 +3286,7 @@ static void rlcAmmCreateStatusPdu(RlcCb *gCb, RlcDlRbCb *rbCb, RlcDatReq *rlcDat
 
 
 #ifndef L2_OPTMZ
-    SGetMsg(RLC_GET_MEM_REGION(gCb), RLC_GET_MEM_POOL(gCb),&mBuf);
+    ODU_GET_MSG_BUF(RLC_MEM_REGION_DL, RLC_POOL, &mBuf);
 #else
     mBuf = (Buffer *)rlcAmmStaPduList[rlcAmmStaPduListCnt++];
     SResetMBuf(mBuf);
index 63c958b..258e2e6 100755 (executable)
@@ -172,7 +172,7 @@ Reason reason               /* reason */
    {
       Buffer *mBuf = NULL;
       Buffer *bufPtr = NULL;
-      SGetMsg(1, 0 , &mBuf);
+      ODU_GET_MSG_BUF(1, 0 , &mBuf);
       ssGetDBufOfSize(1 , 1800, &bufPtr);
       SUpdMsg(mBuf, bufPtr, 0);
       rlcAmmStaPduList[i] = (uint32_t)mBuf; 
index 0538fee..851a0a1 100755 (executable)
@@ -103,14 +103,14 @@ S16 cmPkUdxBndReq(Pst *pst,SuId suId,SpId spId)
     Buffer *mBuf;
     mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
        return (ret1);
@@ -141,14 +141,14 @@ S16 cmPkUdxUbndReq(Pst *pst,SpId spId,Reason reason)
     Buffer *mBuf;
     mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
        return (ret1);
@@ -179,14 +179,14 @@ S16 cmPkUdxBndCfm(Pst *pst,SuId suId,uint8_t status)
     Buffer *mBuf;
     mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
@@ -219,14 +219,14 @@ S16 cmPkUdxCfgReq(Pst *pst,SpId  spId,RlcCfgInfo *cfgInfo)
     Buffer *mBuf;
     mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
        return (ret1);
@@ -276,14 +276,14 @@ S16 cmPkUdxCfgCfm(Pst *pst,SuId suId,RlcCfgCfmInfo  *cfgCfmInfo)
     Buffer *mBuf;
     mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
        return (ret1);
@@ -297,8 +297,7 @@ S16 cmPkUdxCfgCfm(Pst *pst,SuId suId,RlcCfgCfmInfo  *cfgCfmInfo)
              cmPkUdxStruct((uint8_t *)cfgCfmInfo, sizeof(RlcCfgCfmInfo),mBuf);
              /* Need to free the cfgCfmInfo here as it is allocated 
                                         buffer call SPutStaticBuffer */
-             SPutStaticBuffer(pst->region,pst->pool,(Data *) cfgCfmInfo,
-                          sizeof(RlcCfgCfmInfo),0);
+             RLC_FREE_SHRABL_BUF(pst->region, pst->pool, cfgCfmInfo, sizeof(RlcCfgCfmInfo));
              break;
           }
         case UDX_SEL_LWLC:
@@ -342,14 +341,14 @@ CkwUeInfo  *newUeInfo
     Buffer *mBuf = NULLP;
 
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -405,14 +404,14 @@ S16 cmPkUdxUeIdChgCfm(Pst *pst,SuId suId,uint32_t transId,CmStatus status)
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -446,14 +445,14 @@ S16 cmPkUdxStaUpdCfm(Pst *pst,SuId suId,CmLteRlcId *rlcId,RlcUdxBufLst *pStaPdu)
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -500,14 +499,14 @@ S16 cmPkUdxStaProhTmrStart(Pst *pst,SpId spId,CmLteRlcId *rlcId)
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -552,14 +551,14 @@ S16 cmPkUdxStaUpdReq(Pst *pst,SpId spId,CmLteRlcId *rlcId,RlcUdxStaPdu *pStaPdu)
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -572,8 +571,7 @@ S16 cmPkUdxStaUpdReq(Pst *pst,SpId spId,CmLteRlcId *rlcId,RlcUdxStaPdu *pStaPdu)
        {
          cmPkUdxStruct((uint8_t *)pStaPdu, sizeof(RlcUdxStaPdu),mBuf);
          cmPkUdxStruct((uint8_t *)rlcId, sizeof(CmLteRlcId),mBuf);
-         SPutStaticBuffer(pst->region,pst->pool,(Data *) pStaPdu,
-                          sizeof(RlcUdxStaPdu),0);
+         RLC_FREE_SHRABL_BUF(pst->region,pst->pool, pStaPdu, sizeof(RlcUdxStaPdu));
 
          break;
        }
@@ -609,14 +607,14 @@ S16 cmPkUdxStaPduReq(Pst *pst,SpId spId,CmLteRlcId *rlcId,RlcUdxDlStaPdu *pStaPd
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -630,8 +628,7 @@ S16 cmPkUdxStaPduReq(Pst *pst,SpId spId,CmLteRlcId *rlcId,RlcUdxDlStaPdu *pStaPd
          cmPkUdxStruct((uint8_t *)pStaPdu, sizeof(RlcUdxDlStaPdu),mBuf);
          cmPkUdxStruct((uint8_t *)rlcId, sizeof(CmLteRlcId),mBuf);
          /* Free status Pdu here for LC */
-         SPutStaticBuffer(pst->region,pst->pool,(Data *) pStaPdu,
-                          sizeof(RlcUdxDlStaPdu),0);
+         RLC_FREE_SHRABL_BUF(pst->region,pst->pool, pStaPdu, sizeof(RlcUdxDlStaPdu));
          break;
        }
        case UDX_SEL_LWLC:
@@ -664,14 +661,14 @@ S16 cmPkUdxL2MeasReq(Pst  *pst,RlcL2MeasReqEvt *measReqEvt)
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -712,14 +709,14 @@ S16 cmPkUdxL2MeasSendReq(Pst  *pst,uint8_t measType)
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -756,14 +753,14 @@ S16 cmPkUdxL2MeasStopReq(Pst *pst,uint8_t measType)
     S16    ret1;
     Buffer *mBuf = NULLP;
 
-    if((ret1 = SGetMsg(pst->region, pst->pool, &mBuf)) != ROK)
+    if((ret1 = ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
        if(ret1 != ROK)
        {
           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+               (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
        }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
 
@@ -809,7 +806,7 @@ S16 cmUnpkUdxBndReq(UdxBndReq func,Pst  *pst,Buffer *mBuf)
     
     CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EUDXXXX, pst);
     CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EUDXXXX, pst);
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, suId, spId));
 } /*end of function cmUnpkUdxBndReq*/
@@ -834,7 +831,7 @@ S16 cmUnpkUdxUbndReq(UdxUbndReq func,Pst *pst,Buffer *mBuf)
     
     CMCHKUNPKLOG(SUnpkS16, &spId, mBuf, EUDXXXX, pst);
     CMCHKUNPKLOG(SUnpkS16, &reason, mBuf, EUDXXXX, pst);
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
     return ((*func)(pst, spId, reason));
 } /*end of function cmUnpkUdxUbndReq*/
 \f
@@ -858,7 +855,7 @@ S16 cmUnpkUdxBndCfm(UdxBndCfm func,Pst *pst,Buffer *mBuf)
     
     CMCHKUNPKLOG(SUnpkS16, &suId, mBuf, EUDXXXX, pst);
     CMCHKUNPKLOG(oduPackUInt8, &status, mBuf, EUDXXXX, pst);
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, suId, status));
 } /*end of function cmUnpkUdxBndCfm*/
@@ -896,7 +893,7 @@ S16 cmUnpkUdxCfgReq(UdxCfgReq func,Pst  *pst,Buffer *mBuf)
           ret1 = cmUnpkUdxStruct(mBuf,0,(uint8_t *)&tmpCfgInfo,sizeof(RlcCfgInfo));
           if(ret1 != ROK)
           {
-             SPutMsg(mBuf);
+             ODU_PUT_MSG_BUF(mBuf);
              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
                   (ErrVal)EUDXXXX, (ErrVal)ret1, "Unpacking failure");
@@ -915,7 +912,7 @@ S16 cmUnpkUdxCfgReq(UdxCfgReq func,Pst  *pst,Buffer *mBuf)
        }
 #endif /* LCUDX */
     }
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, spId, cfgInfo));
 } /* cmUnpkUdxCfgReq */
@@ -947,25 +944,25 @@ S16 cmUnpkUdxCfgCfm(UdxCfgCfm func,Pst  *pst,Buffer *mBuf)
 #ifdef LCUDX
        case UDX_SEL_LC:
        {
-           if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&cfgCfmInfo,\
-                       sizeof(RlcCfgCfmInfo),0)) != ROK)
+           RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, cfgCfmInfo, sizeof(RlcCfgCfmInfo))
+           if(cfgCfmInfo == NULL)
            {
 #if (ERRCLASS & ERRCLS_ADD_RES)
-              if(ret1 != ROK)
+              if(cfgCfmInfo == NULL)
               {
                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-                      (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+                      (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
               }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-              return (ret1);
+              return (RFAILED);
            }
 
           ret1 = cmUnpkUdxStruct(mBuf,0,(uint8_t *)cfgCfmInfo, sizeof(RlcCfgCfmInfo));
 #if(ERRCLASS & ERRCLS_DEBUG)
           if(ret1 != ROK)
           {
-             SPutMsg(mBuf);
+             ODU_PUT_MSG_BUF(mBuf);
              SLogError(pst->dstEnt, pst->dstInst, pst->dstProcId,
                    __FILE__, __LINE__, (ErrCls)ERRCLS_DEBUG,
                   (ErrVal)EUDXXXX, (ErrVal)ret1, "Unpacking failure");
@@ -981,7 +978,7 @@ S16 cmUnpkUdxCfgCfm(UdxCfgCfm func,Pst  *pst,Buffer *mBuf)
        }
 #endif /* LCUDX */
     }
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, suId, cfgCfmInfo));
 } /* cmUnpkUdxCfgCfm */
@@ -1037,7 +1034,7 @@ S16 cmUnpkUdxUeIdChgReq(UdxUeIdChgReq func,Pst *pst,Buffer *mBuf)
 
 #endif /* LCUDX */
     }
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, spId, transId, ueInfo, newUeInfo));
 
@@ -1069,7 +1066,7 @@ S16 cmUnpkUdxUeIdChgCfm(UdxUeIdChgCfm func,Pst  *pst,Buffer *mBuf)
 
     CMCHKUNPK(cmUnpkCmStatus, &status, mBuf);
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, suId, transId, status));
 
@@ -1109,7 +1106,7 @@ S16 cmUnpkUdxStaUpdCfm(UdxStaUpdCfm func,Pst *pst,Buffer *mBuf)
        }
     } 
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, suId, rlcId, pBufLst));
 
@@ -1133,7 +1130,6 @@ S16 cmUnpkUdxStaUpdReq(UdxStaUpdReq func,Pst *pst,Buffer *mBuf)
     SpId      spId = 0;
     CmLteRlcId *rlcId = NULLP; /* KW_FIX */ 
     RlcUdxStaPdu *pStaPdu = NULLP; /* KW_FIX */
-    S16 ret1;
     CmLteRlcId tmpRlcId;
     
     CMCHKUNPK(SUnpkS16, &spId, mBuf);
@@ -1141,21 +1137,21 @@ S16 cmUnpkUdxStaUpdReq(UdxStaUpdReq func,Pst *pst,Buffer *mBuf)
     {
        case UDX_SEL_LC:
        {
-           if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&pStaPdu,
-                       sizeof(RlcUdxStaPdu),0)) != ROK)
+           RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, pStaPdu, sizeof(RlcUdxStaPdu))
+           if(pStaPdu == NULLP)
            {
 #if (ERRCLASS & ERRCLS_ADD_RES)
-              if(ret1 != ROK)
+              if(pStaPdu == NULLP)
               {
                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-                      (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+                      (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
               }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-              return (ret1);
+              return (RFAILED);
            }
-          ret1 = cmUnpkUdxStruct(mBuf,0,(uint8_t *)pStaPdu, sizeof(RlcUdxStaPdu));
-          ret1 = cmUnpkUdxStruct(mBuf,sizeof(RlcUdxStaPdu),(uint8_t *)&tmpRlcId,sizeof(CmLteRlcId));
+           cmUnpkUdxStruct(mBuf,0,(uint8_t *)pStaPdu, sizeof(RlcUdxStaPdu));
+           cmUnpkUdxStruct(mBuf,sizeof(RlcUdxStaPdu),(uint8_t *)&tmpRlcId,sizeof(CmLteRlcId));
           rlcId = &tmpRlcId; 
           break;
        }
@@ -1167,7 +1163,7 @@ S16 cmUnpkUdxStaUpdReq(UdxStaUpdReq func,Pst *pst,Buffer *mBuf)
        }
     } 
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, spId, rlcId, pStaPdu));
 
@@ -1188,7 +1184,6 @@ S16 cmUnpkUdxStaUpdReq(UdxStaUpdReq func,Pst *pst,Buffer *mBuf)
 */
 S16 cmUnpkUdxStaPduReq(UdxStaPduReq func,Pst *pst,Buffer *mBuf)
 {
-    S16       ret1;
     SpId      spId = 0;
     CmLteRlcId tmpRlcId;
     CmLteRlcId *rlcId = NULLP;  /* KW_FIX */
@@ -1199,22 +1194,22 @@ S16 cmUnpkUdxStaPduReq(UdxStaPduReq func,Pst *pst,Buffer *mBuf)
     {
        case UDX_SEL_LC:
        {
-           if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&pStaPdu,
-                       sizeof(RlcUdxDlStaPdu),0)) != ROK)
+           RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, pStaPdu, sizeof(RlcUdxDlStaPdu))
+           if(pStaPdu == NULLP)
            {
 #if (ERRCLASS & ERRCLS_ADD_RES)
-              if(ret1 != ROK)
+              if(pStaPdu == NULLP)
               {
                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-                      (ErrVal)EUDXXXX, (ErrVal)0, "SGetMsg() failed");
+                      (ErrVal)EUDXXXX, (ErrVal)0, "ODU_GET_MSG_BUF() failed");
               }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-              return (ret1);
+              return (RFAILED);
            }
-          ret1 = cmUnpkUdxStruct(mBuf,0, (uint8_t *)pStaPdu, sizeof(RlcUdxDlStaPdu));
-          ret1 = cmUnpkUdxStruct(mBuf,sizeof(RlcUdxDlStaPdu),(uint8_t *)&tmpRlcId,sizeof(CmLteRlcId));
-          rlcId = &tmpRlcId; 
+           cmUnpkUdxStruct(mBuf,0, (uint8_t *)pStaPdu, sizeof(RlcUdxDlStaPdu));
+           cmUnpkUdxStruct(mBuf,sizeof(RlcUdxDlStaPdu),(uint8_t *)&tmpRlcId,sizeof(CmLteRlcId));
+           rlcId = &tmpRlcId; 
            break;
        }
        case UDX_SEL_LWLC:
@@ -1225,7 +1220,7 @@ S16 cmUnpkUdxStaPduReq(UdxStaPduReq func,Pst *pst,Buffer *mBuf)
        }
     } 
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
     return ((*func)(pst, spId, rlcId, pStaPdu));
 
 } /* cmUnpkUdxUeIdChgCfm */
@@ -1265,7 +1260,7 @@ S16 cmUnpkUdxStaProhTmrStart(UdxStaProhTmrStart func,Pst *pst,Buffer *mBuf)
        }
     } 
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, spId, rlcId));
 
@@ -1303,7 +1298,7 @@ S16 cmUnpkUdxL2MeasReq(UdxL2MeasReq func,Pst *pst,Buffer *mBuf)
        }
     }
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, measReqEvt));
 } /* cmUnpkUdxL2MeasReq */
@@ -1332,7 +1327,7 @@ S16 cmUnpkUdxL2MeasSendReq(UdxL2MeasSendReq func,Pst *pst,Buffer *mBuf)
        }
     }
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, measType));
 } /* cmUnpkUdxL2MeasReq */
@@ -1361,7 +1356,7 @@ S16 cmUnpkUdxL2MeasStopReq(UdxL2MeasStopReq func,Pst *pst,Buffer *mBuf)
        }
     }
 
-    SPutMsg(mBuf);
+    ODU_PUT_MSG_BUF(mBuf);
 
     return ((*func)(pst, measType));
 } /* cmUnpkUdxL2MeasStopReq */
index b97cf15..2379c7e 100755 (executable)
@@ -274,15 +274,14 @@ RlcCfgCfmInfo   *cfmInfo
       if(sendRlcUeDeleteRspToDu(cfgCfm->cellId, cfgCfm->ueId, SUCCESSFUL) != ROK)
       {
          DU_LOG("ERROR  --> RLC_UL: rlcUlUdxCfgCfm(): Failed to send UE delete response ");
+         RLC_FREE(tRlcCb, cfgCfm, sizeof(RlcCfgCfmInfo));
          return RFAILED;
       }
+      RLC_FREE(tRlcCb, cfgCfm, sizeof(RlcCfgCfmInfo));
    }
 
    /* free the memory from DL */
-   RLC_FREE_SHRABL_BUF(pst->region,
-                      pst->pool,
-                     cfmInfo,
-                     sizeof(RlcCfgCfmInfo));
+   RLC_FREE_SHRABL_BUF(pst->region, pst->pool, cfmInfo, sizeof(RlcCfgCfmInfo));
 
    /* free the cfgInfo that came from LM */
    RLC_PST_FREE(pst->region, pst->pool, cfgTmpData->cfgInfo, sizeof(RlcCfgInfo));
index 8fc762a..9143f52 100755 (executable)
@@ -262,9 +262,7 @@ static S16 rlcLmmGenCfg(RlcCb  *gCb,RlcGenCfg *cfg)
       rlcUtlInitToBeFreed(gCb, &(gCb->u.dlCb->toBeFreed));
       rlcUtlInitializeSelfPst(gCb);
 
-      if(SGetMsg(gCb->init.region, 
-                 gCb->init.pool,
-                 &(gCb->u.dlCb->selfPstMBuf)) != ROK)
+      if(ODU_GET_MSG_BUF(gCb->init.region, gCb->init.pool, &(gCb->u.dlCb->selfPstMBuf)) != ROK)
       {
          RLC_FREE(gCb,gCb->u.dlCb->udxDlSap, rlcSapSize);
          RLC_FREE(gCb,gCb->u.dlCb->rlcKwuDlSap, rlcSapSize);
@@ -1524,7 +1522,7 @@ static Void rlcLmmCleanGblRsrcs(RlcCb *gCb)
             {
                if (gCb->u.dlCb->selfPstMBuf != NULL)
                {
-                  SPutMsg(gCb->u.dlCb->selfPstMBuf);
+                  ODU_PUT_MSG_BUF(gCb->u.dlCb->selfPstMBuf);
                }
                RLC_FREE(gCb,gCb->u.dlCb, sizeof (RlcDlCb));
             }
@@ -2226,7 +2224,7 @@ S16 rlcLmmSendTrc(RlcCb *gCb,Event event,Buffer *mBuf)
               return RFAILED;
            }
 
-           if (SGetMsg(pst.region, pst.pool, &dstMbuf) != ROK)
+           if (ODU_GET_MSG_BUF(pst.region, pst.pool, &dstMbuf) != ROK)
            {
               DU_LOG("\nERROR  --> RLC : Memory Allocation failed");   
               return RFAILED;
index 3cfb3b7..60391ef 100644 (file)
@@ -65,8 +65,10 @@ uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
 {
    /* jump to specific primitive depending on configured selector */
    uint8_t ret = ROK;
+   RlcCb   *gCb;
    RlcUeCfgRsp *ueRsp = NULLP;
 
+   gCb = RLC_GET_RLCCB(pst->srcInst);
    RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp));
    if(!ueRsp)
    {  
@@ -92,6 +94,7 @@ uint8_t SendRlcUeCfgRspToDu(Pst *pst, RlcCfgCfmInfo *cfgRsp)
          RLC_FREE_SHRABL_BUF(pst->region, pst->pool, ueRsp, sizeof(RlcUeCfgRsp));
       }
    }
+   RLC_FREE(gCb, cfgRsp, sizeof(RlcCfgCfmInfo));
    return ret;
 } /* end of SendRlcUeCfgRspToDu */
 
index d3fdff6..5c787dc 100644 (file)
@@ -245,10 +245,10 @@ uint8_t RlcProcUeCreateReq(Pst *pst, RlcUeCfg *ueCfg)
 {
    uint8_t ret = ROK;
    RlcCfgInfo *rlcUeCfg = NULLP;
+   RlcCb *gCb;
 
-   RlcCb *rlcUeCb = NULLP;
-   rlcUeCb = RLC_GET_RLCCB(pst->dstInst);
-   RLC_ALLOC(rlcUeCb, rlcUeCfg, sizeof(RlcCfgInfo));
+   gCb = RLC_GET_RLCCB(pst->dstInst);
+   RLC_ALLOC(gCb, rlcUeCfg, sizeof(RlcCfgInfo));
    if(rlcUeCfg == NULLP)
    {
       DU_LOG("\nERROR  -->  RLC: Failed to allocate memory at RlcProcUeCreateReq()");
index c57cb07..0f35140 100644 (file)
@@ -1481,7 +1481,7 @@ S16 rlcUtlDlFreeRlcRBuf(Void)
       kwuDatReqDetl = (KwuDatReqDetl *)elmIndx;
       SRngIncrRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC);
       SsRngInfoTbl[SS_RNG_BUF_DLPDCP_TO_DLRLC].nPktProc++;
-      SPutMsg(kwuDatReqDetl->mBuf);
+      ODU_PUT_MSG_BUF(kwuDatReqDetl->mBuf);
       elmIndx = NULLP;
       kwuDatReqDetl = NULLP;
       if((elmIndx = SRngGetRIndx(SS_RNG_BUF_DLPDCP_TO_DLRLC)) == NULLP)
index c01228d..782bc1a 100755 (executable)
@@ -68,21 +68,23 @@ CmLListCp        inUseL2UeStatsLst;/*!< In Use Pool of UE stats Blocks */
 *
 *
 */
-Void TSL2AllocStatsMem(Region region,Pool pool)
+Void TSL2AllocStatsMem(Inst inst)
 {
    uint32_t cnt=0;
+   RlcCb *gCb;
 
+   gCb = RLC_GET_RLCCB(inst);
    cmLListInit(&inUseL2UeStatsLst);     
    cmLListInit(&freeL2UeStatsLst);      
    for (cnt=0; cnt < L2_STATS_MAX_CELLS; cnt++)
    {
       if(NULL == l2CellStats[cnt])
       {
-        if (SGetSBuf(region, pool, (Data **)&l2CellStats[cnt],
-                 (Size)sizeof (TSL2CellStatsCb)) != ROK)
-        {
-           DU_LOG("\nERROR  -->  RLC : STATS Unexpected MEM Alloc Failure\n");
-        }
+         RLC_ALLOC(gCb, l2CellStats[cnt], (Size)sizeof (TSL2CellStatsCb));
+         if(l2CellStats[cnt] == NULL)
+         {
+            DU_LOG("\nERROR  -->  RLC : STATS Unexpected MEM Alloc Failure\n");
+         }
       }
       memset(l2CellStats[cnt], 0x00, sizeof(TSL2CellStatsCb));
    }
@@ -92,11 +94,11 @@ Void TSL2AllocStatsMem(Region region,Pool pool)
       TSL2UeStatsCb *statsCb = l2UeStats[cnt];
       if(NULL == statsCb)
       {
-        if (SGetSBuf(region, pool, (Data **)&statsCb,
-                 (Size)sizeof (TSL2UeStatsCb)) != ROK)
-        {
-           DU_LOG("\nERROR  -->   RLC : STATS Unexpected MEM Alloc Failure at %d\n", (int)cnt);
-        }
+         RLC_ALLOC(gCb, statsCb, (Size)sizeof (TSL2UeStatsCb));
+         if(NULL == statsCb)        
+         {
+            DU_LOG("\nERROR  -->   RLC : STATS Unexpected MEM Alloc Failure at %d\n", (int)cnt);
+         }
       }
       memset(statsCb, 0x00, sizeof(TSL2UeStatsCb));
       statsCb->lnk.node = (PTR)statsCb;
index 6486538..8094f74 100755 (executable)
@@ -110,7 +110,7 @@ uint8_t rrcUeCapabilityInfo[] =
    datIndInfo->tCrnti = crnti;
    datIndInfo->isOutOfSeq = 16;
 
-   SGetMsg(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
+   ODU_GET_MSG_BUF(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
   
    SAddPstMsgMult(rrcConReq,6,pdu);
 
@@ -126,7 +126,7 @@ uint8_t rrcUeCapabilityInfo[] =
     pdcpId.rbId = 1;
     pdcpId.rbType = 0;
 #endif   
-    SGetMsg(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
+    ODU_GET_MSG_BUF(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
   
     SAddPstMsgMult(rrcConSetupComplete,34,pdu);
 
@@ -145,7 +145,7 @@ uint8_t rrcUeCapabilityInfo[] =
     pdcpId.rbId = 1;
     pdcpId.rbType = 0;
 #endif   
-    SGetMsg(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
+    ODU_GET_MSG_BUF(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
   
 #ifndef CA_PAL_5GTF 
     SAddPstMsgMult(rrcUeCapabilityInfo,12,pdu);
@@ -168,7 +168,7 @@ uint8_t rrcUeCapabilityInfo[] =
     pdcpId.rbType = 0;
 #endif
    
-    SGetMsg(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
+    ODU_GET_MSG_BUF(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
   
     SAddPstMsgMult(rrcSecurityModeComplete,2,pdu);
 
@@ -187,7 +187,7 @@ uint8_t rrcUeCapabilityInfo[] =
     pdcpId.rbType = 0;
 #endif
    
-    SGetMsg(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
+    ODU_GET_MSG_BUF(DFLT_REGION, DFLT_POOL, (Buffer **) &pdu);
   
     SAddPstMsgMult(rrcReconfigComplete,2,pdu);
 
index f136927..e7da942 100755 (executable)
@@ -161,7 +161,7 @@ Reason reason               /* reason */
    kwInitExt();
    */
 #ifdef TENB_STATS 
-   TSL2AllocStatsMem(tRlcCb->init.region, tRlcCb->init.pool); 
+   TSL2AllocStatsMem(tRlcCb->init.inst); 
 #endif
 
    return ROK;
index 51504f8..3645a85 100755 (executable)
@@ -103,12 +103,22 @@ extern "C" {
  *                              Memory related Defines 
  ******************************************************************************/
 /* Allocate function */
+#ifdef ODU_MEMORY_DEBUG_LOG
+#define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\
+{\
+   printf("\n%s=== %s +%d, %s, %d, %p\n",           \
+         _macro, _file, _line, _func, _size, _datPtr); \
+}
+#else
+#define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {}
+#endif
 
 #define RLC_ALLOC(_cb,_buf, _size)                                    \
 {                                                                    \
  if (SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf,      \
                 (Size) _size) == ROK)                                \
    {                                                                 \
+      RLC_MEM_LOG("RLC_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       memset((_buf), 0, _size);                              \
    }                                                                 \
    else                                                              \
@@ -121,6 +131,7 @@ extern "C" {
 {                                                         \
    if (_buf != NULLP)                                     \
    {                                                      \
+      RLC_MEM_LOG("RLC_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       (Void) SPutSBuf(_cb->init.region, _cb->init.pool,   \
             (Data *) _buf, (Size) _size);                 \
       _buf = NULLP;                                       \
@@ -130,7 +141,8 @@ extern "C" {
 #define RLC_FREE_SHRABL_BUF(_region, _pool,_buf, _size)    \
 {                                                         \
    if (_buf != NULLP)                                     \
-   {                                                      \
+   { \
+      RLC_MEM_LOG("RLC_FREE_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       (Void) SPutStaticBuffer(_region, _pool,             \
             (Data *) _buf, (Size) _size, 0);                 \
       _buf = NULLP;                                       \
@@ -139,15 +151,25 @@ extern "C" {
 
 #define RLC_FREE_SHRABL_BUF_WC(_region, _pool,_buf, _size) \
 {                                                         \
+ if (_buf != NULLP){\
+      RLC_MEM_LOG("RLC_FREE_SHRABL_BUF_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
   (Void) SPutStaticBuffer(_region, _pool,                 \
         (Data *) _buf, (Size) _size, 0);                 \
-  _buf = NULLP;                                       \
+  _buf = NULLP;      \
+  }\
 }
 
 #define RLC_ALLOC_SHRABL_BUF_WC(_region, _pool,_buf, _size)           \
 {                                                                    \
- SGetStaticBuffer(_region, _pool, (Data **)&_buf,                    \
-                (Size) _size, 0);                                    \
+   if(SGetStaticBuffer(_region, _pool, (Data **)&_buf,                    \
+            (Size) _size, 0)==ROK)                                    \
+   {\
+      RLC_MEM_LOG("RLC_ALLOC_SHRABL_BUF_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
+   }\
+   else\
+   {\
+      (_buf) = NULLP;\
+   }\
 }
 
 #define RLC_ALLOC_SHRABL_BUF(_region, _pool,_buf, _size)              \
@@ -155,6 +177,7 @@ extern "C" {
  if (SGetStaticBuffer(_region, _pool, (Data **)&_buf,                \
                 (Size) _size, 0) == ROK)                                \
    {                                                                 \
+      RLC_MEM_LOG("RLC_ALLOC_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       memset((_buf), 0, _size);                              \
    }                                                                 \
    else                                                              \
@@ -164,13 +187,19 @@ extern "C" {
 }
 
 #define RLC_ALLOC_WC(_cb,_buf, _size)  \
-           SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, (Size) _size)     
+{\
+   if(SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, (Size) _size) == ROK)\
+   {\
+      RLC_MEM_LOG("RLC_ALLOC_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
+   }\
+}
 
 #define RLC_REMOVE_SDU(_cb,_sduQ,_sdu)              \
 {                                               \
    if(_sdu->mBuf)                               \
    {                                            \
-      SPutMsg(_sdu->mBuf);    \
+      RLC_MEM_LOG("RLC_REMOVE_SDU", __FILE__, __LINE__, __FUNCTION__, _sdu->sduSz, _sdu->mBuf);\
+      ODU_PUT_MSG_BUF(_sdu->mBuf);    \
    }                                            \
    cmLListDelFrm(_sduQ,&_sdu->lstEnt);          \
    RLC_FREE(_cb,_sdu, sizeof(RlcSdu));            \
@@ -181,6 +210,7 @@ extern "C" {
 {                                                         \
    if (_buf != NULLP)                                     \
    {                                                      \
+      RLC_MEM_LOG("RLC_PST_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       (Void) SPutSBuf(_region, _pool,                     \
                       (Data *) _buf, (Size) _size);       \
       _buf = NULLP;                                       \
@@ -230,16 +260,18 @@ extern "C" {
 {                                                                  \
    if (_buf != NULLP)                                              \
    {                                                               \
+      RLC_MEM_LOG("RLC_SHRABL_STATIC_BUF_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       (Void) SPutStaticBuffer(_region, _pool,                      \
-                      (Data *) _buf, (Size) _size, 0);             \
+            (Data *) _buf, (Size) _size, 0);             \
       _buf = NULLP;                                                \
    }                                                               \
 }
 
 #define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size)     \
 {                                                                        \
- SGetStaticBuffer(_region, _pool, (Data **)&_buf,      \
-                (Size) _size, 0);                                        \
+   SGetStaticBuffer(_region, _pool, (Data **)&_buf,      \
+         (Size) _size, 0);                                        \
+   RLC_MEM_LOG("RLC_SHRABL_STATIC_BUF_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
 }
 #endif
 
index ff7c636..b62d44d 100755 (executable)
@@ -400,7 +400,7 @@ uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo)
    uint8_t        snIdx1;
    uint8_t        snIdx2;
 #endif /* LTE_L2_MEAS */
-   uint32_t  idx;
+   uint32_t  idx, ueDataIdx = 0;
 
 //Debug
    uint32_t staIndSz=0,datIndSz = 0;
@@ -436,7 +436,7 @@ uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo)
       for (numTb = 0; numTb < staInd->nmbOfTbs; numTb++)
       {
          staIndTb = &(staInd->staIndTb[numTb]);
-         datReqTb = &(datReqInfo->datReq[idx].datReqTb[numTb]);
+         datReqTb = &(datReqInfo->datReq[ueDataIdx].datReqTb[numTb]);
 #ifdef LTE_L2_MEAS
          ueCb->tbIdx = (ueCb->tbIdx+1) % RLC_MAX_TB_PER_UE;
 #endif   
@@ -588,15 +588,24 @@ uint8_t rlcUtlSendToMac(RlcCb *gCb, SuId suId, KwDStaIndInfo *staIndInfo)
          }
 #endif /* LTE_L2_MEAS */
       }
-      datReqInfo->datReq[idx].nmbOfTbs = staInd->nmbOfTbs;
-      datReqInfo->datReq[idx].transId = staInd->transId;
-      datReqInfo->datReq[idx].rnti    = staInd->rnti;
+      datReqInfo->datReq[ueDataIdx].nmbOfTbs = staInd->nmbOfTbs;
+      datReqInfo->datReq[ueDataIdx].transId = staInd->transId;
+      datReqInfo->datReq[ueDataIdx].rnti    = staInd->rnti;
+      ueDataIdx++;
    }
-   datReqInfo->cellId  = staIndInfo->cellId;
-   datReqInfo->nmbOfUeGrantPerTti = staIndInfo->nmbOfUeGrantPerTti;
 
-   rguSap = &(gCb->u.dlCb->rguDlSap[suId]);
-   rlcSendDedLcDlData(&rguSap->pst,rguSap->spId,datReqInfo); 
+   if(ueDataIdx > 0)
+   {
+      datReqInfo->cellId  = staIndInfo->cellId;
+      datReqInfo->nmbOfUeGrantPerTti = staIndInfo->nmbOfUeGrantPerTti;
+
+      rguSap = &(gCb->u.dlCb->rguDlSap[suId]);
+      rlcSendDedLcDlData(&rguSap->pst,rguSap->spId,datReqInfo); 
+   }
+   else
+   {
+      RLC_FREE_SHRABL_BUF(RLC_MEM_REGION_DL, RLC_POOL, datReqInfo,sizeof(RguDDatReqInfo));
+   }
    return ROK;
 }
 
@@ -1127,11 +1136,7 @@ Void rlcUtlFreeDlMemory(RlcCb *gCb)
 
    /* Free from the ReTx list */
    lst  = &pToBeFreed->reTxLst;
-#ifndef L2_OPTMZ
-   while((lst->first) && toBeFreed && (pToBeFreed->reTxLst.count > 100))
-#else
    while((lst->first) && toBeFreed)
-#endif
    {
       RlcRetx* seg = (RlcRetx *)(lst->first->node);
       cmLListDelFrm(lst, lst->first);
@@ -1142,11 +1147,7 @@ Void rlcUtlFreeDlMemory(RlcCb *gCb)
 
    /* Free from the Tx list */
    lst  = &pToBeFreed->txLst;
-#ifndef L2_OPTMZ
-   while((lst->first) && toBeFreed && (pToBeFreed->txLst.count > 100))
-#else
    while((lst->first) && toBeFreed)
-#endif
    {
       RlcTx* pdu = (RlcTx *)(lst->first->node);
       cmLListDelFrm(lst, lst->first);
@@ -1164,11 +1165,7 @@ Void rlcUtlFreeDlMemory(RlcCb *gCb)
 
    /* Free from the SDU queue */
    lst  = &pToBeFreed->sduLst;
-#ifndef L2_OPTMZ
-   while((lst->first) && toBeFreed && (pToBeFreed->sduLst.count > 100))
-#else
    while((lst->first) && toBeFreed)
-#endif
    {
       RlcSdu* sdu = (RlcSdu *)(lst->first->node);
       RLC_REMOVE_SDU(gCb, lst, sdu);
@@ -1177,11 +1174,7 @@ Void rlcUtlFreeDlMemory(RlcCb *gCb)
 
    /* Free from the RBs */
    lst  = &pToBeFreed->rbLst;
-#ifndef L2_OPTMZ
-   while((lst->first) && toBeFreed && (pToBeFreed->rbLst.count > 100))
-#else
    while((lst->first) && toBeFreed)
-#endif
    {
       RlcDlRbCb* rbCb = (RlcDlRbCb *)(lst->first->node);
       Bool moreToBeFreed = rlcUtlFreeDlAmRbMemory(gCb, rbCb,&toBeFreed);
@@ -1390,11 +1383,10 @@ RlcL2MeasTb * rlcUtlGetCurMeasTb(RlcCb *gCb,RlcDlRbCb *rbCb)
    if((curL2MeasTb = rbCb->ueCb->l2MeasTbCb[rbCb->ueCb->tbIdx]) == NULLP)
       {
          /* Intentionally avoiding the RLC_ALLOC macro to avoid  memset */
-         if (SGetSBuf(gCb->init.region,
-                  gCb->init.pool,
-                  (Data **)&curL2MeasTb,
-                  (Size)sizeof(RlcL2MeasTb)) != ROK)
+         RLC_ALLOC(gCb, curL2MeasTb, (Size)sizeof(RlcL2MeasTb));
+         if(curL2MeasTb == NULLP)
          {
+            DU_LOG("ERROR  --> RLC_DL :  rlcUtlGetCurMeasTb(): Memory allocation failed");
             return (NULLP);
          }
          rbCb->ueCb->l2MeasTbCb[rbCb->ueCb->tbIdx] = curL2MeasTb;
index f042025..dbf3a1c 100755 (executable)
@@ -44,6 +44,7 @@
 #include "rg_sch.h"
 #include "rg_sch_err.h"
 #include "rg_sch_cmn.h"
+#include "sch_utils.h"
 
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
@@ -53,6 +54,7 @@
 #include "rg_sch_inf.x"         /* typedefs for Scheduler */
 #include "rg_sch.x"        /* typedefs for Scheduler */
 #include "rg_sch_cmn.x"
+#include "mac_sch_interface.h"
 
 #ifdef EMTC_ENABLE
 S16 rgEmtcMacSchUeDelInd ARGS((RgSchCellCb *cell,RgInfUeDelInd *ueDelInd));
@@ -111,11 +113,11 @@ RgMngmt  *cntrl   /* control structure  */
    SchFillCfmPst(pst, &cfmPst, cntrl);
 
    /* Initialize the cfg cfm structure 
-   if (SGetSBuf(cfmPst.region, cfmPst.pool, (Data **)&cfm, sizeof(RgMngmt))
-      != ROK)
+   SCH_ALLOC(cfm, sizeof(RgMngmt));
+   if(cfm   == NULLP)
    {
       DU_LOG("\nERROR  -->  SCH : Memory Unavailable for Confirmation");
-      SPutSBuf(pst->region, pst->pool, (Data *)cntrl, sizeof(RgMngmt));
+      SCH_FREE(pst->region, pst->pool, cntrl, sizeof(RgMngmt));
       return ROK;
    } */
    memset(&cfm, 0, sizeof(RgMngmt));
@@ -137,7 +139,7 @@ RgMngmt  *cntrl   /* control structure  */
       cfm.hdr.elmId.elmnt = cntrl->hdr.elmId.elmnt;
       RgMiLrgSchCntrlCfm(&cfmPst, &cfm);
       DU_LOG("\nERROR  -->  SCH : Gen Cfg not done.");
-      /*      SPutSBuf(pst->region, pst->pool, (Data *)cntrl, sizeof(RgMngmt)); */
+      /*      SCH_FREE(pst->region, pst->pool, cntrl, sizeof(RgMngmt)); */
       return ROK;
    }
 
@@ -159,7 +161,7 @@ RgMngmt  *cntrl   /* control structure  */
                   cntrl->hdr.elmId.elmnt);
          break;
    }
-   /*   SPutSBuf(pst->region, pst->pool, (Data *)cntrl, sizeof(RgMngmt)); */
+   /*   SCH_FREE(pst->region, pst->pool, cntrl, sizeof(RgMngmt)); */
    return (ret);
 }/*-- RgMiLrgSchCntrlReq --*/
 
@@ -587,8 +589,7 @@ S16 RgUiRgrSiCfgReq(Pst *pst, SpId  spId,RgrCfgTransId transId,RgrSiCfgReqInfo *
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          DU_LOG("\nERROR  -->  SCH : Invalid SAP State: RgUiRgrSiCfgReq failed\n");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
-                                          (Size)sizeof(*cfgReqInfo));
+         SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo));
          rgSCHUtlRgrSiCfgCfm(instId, spId, transId, cfmStatus); 
          return RFAILED;
       }
@@ -598,8 +599,7 @@ S16 RgUiRgrSiCfgReq(Pst *pst, SpId  spId,RgrCfgTransId transId,RgrSiCfgReqInfo *
 #if (ERRCLASS & ERRCLS_ADD_RES)      
       DU_LOG("\nERROR  -->  SCH : Invalid SAP Id:RgUiRgrSiCfgReq failed\n");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo,
-                                   (Size)sizeof(*cfgReqInfo));
+      SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo));
       rgSCHUtlRgrSiCfgCfm(instId, spId, transId, cfmStatus); 
       return RFAILED;
    }
@@ -682,8 +682,7 @@ S16 RgUiRgrWarningSiCfgReq(Pst *pst, SpId spId,RgrCfgTransId transId,RgrWarningS
 #endif
          rgSCHUtlFreeWarningSiSeg(pst->region, pst->pool, 
                &warningSiCfgReqInfo->siPduLst);
-         SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo,
-               sizeof(RgrWarningSiCfgReqInfo));
+         SCH_FREE(warningSiCfgReqInfo, sizeof(RgrWarningSiCfgReqInfo));
          rgSCHUtlRgrWarningSiCfgCfm(instId, spId, warningSiCfgReqInfo->siId, 
                transId, cfmStatus);
          return RFAILED;
@@ -696,8 +695,7 @@ S16 RgUiRgrWarningSiCfgReq(Pst *pst, SpId spId,RgrCfgTransId transId,RgrWarningS
 #endif
       rgSCHUtlFreeWarningSiSeg(pst->region, pst->pool, 
             &warningSiCfgReqInfo->siPduLst);
-      SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo,
-            sizeof(RgrWarningSiCfgReqInfo));
+      SCH_FREE(warningSiCfgReqInfo,sizeof(RgrWarningSiCfgReqInfo));
       rgSCHUtlRgrWarningSiCfgCfm(instId, spId, warningSiCfgReqInfo->siId, 
             transId, cfmStatus);
       return RFAILED;
@@ -825,8 +823,7 @@ S16 RgUiRgrLoadInfReq(Pst *pst, SpId spId, RgrCfgTransId  transId,RgrLoadInfReqI
 #if (ERRCLASS & ERRCLS_ADD_RES)
          DU_LOG("\nERROR  -->  SCH : Invalid SAP State: RgUiRgrLoadInfReq failed\n");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq,
-               (Size)sizeof(*loadInfReq));
+         SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq));
          return RFAILED;
       }
    }
@@ -835,8 +832,7 @@ S16 RgUiRgrLoadInfReq(Pst *pst, SpId spId, RgrCfgTransId  transId,RgrLoadInfReqI
 #if (ERRCLASS & ERRCLS_ADD_RES)
       DU_LOG("\nERROR  -->  SCH : Invalid SAP Id:RgUiRgrLoadInfReq failed\n");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq,
-            (Size)sizeof(*loadInfReq));
+      SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq));
       return RFAILED;
    }
 
@@ -1648,7 +1644,7 @@ S16 RgLiTfuRaReqInd(Pst *pst,SuId suId, TfuRaReqIndInfo *raReqInd)
    ret = rgSCHTomRaReqInd(rgSchCb[inst].tfuSap[suId].cell, raReqInd);
    /* Free up the memory for the request structure */
    RGSCH_FREE_MEM(raReqInd);
-   /*SPutSBuf (pst->region, pst->pool, (Data *)raReqInd,
+   /*SCH_FREE(pst->region, pst->pool, (Data *)raReqInd,
          sizeof(TfuRaReqIndInfo)); */
    return (ret);
 }  /* RgLiTfuRaReqInd */
@@ -2270,7 +2266,7 @@ S16 RgUiRgmCfgPrbRprt(Pst   *pst, SpId  spId,RgmPrbRprtCfg *prbRprtCfg)
             prbUsage->prbRprtEnabld,prbUsage->rprtPeriod);
 
    /* ccpu00134393 : mem leak fix */
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
+      SCH_FREE(prbRprtCfg, sizeof(RgmPrbRprtCfg));
   
    return ROK;
 }
index cd6202d..5385fd2 100755 (executable)
@@ -631,7 +631,7 @@ do \
 {\
    if (NULLP != (_buf)) \
    { \
-      SPutMsg((_buf)); \
+      ODU_PUT_MSG_BUF((_buf)); \
       _buf = NULLP; \
    } \
 }
index a4f1406..924c488 100755 (executable)
@@ -44,7 +44,6 @@
 #include "rg_sch_inf.h"
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
-
 /* header/extern include files (.x) */
 #include "tfu.x"           /* TFU types */
 #include "lrg.x"           /* layer management typedefs for MAC */
@@ -53,6 +52,7 @@
 #include "rg_sch_inf.x"    /* typedefs for Scheduler */
 #include "rg_sch.x"        /* typedefs for Scheduler */
 #include "rg_sch_cmn.x"    /* typedefs for Scheduler */
+#include "sch_utils.h"
 #ifdef MAC_SCH_STATS
 #include "lrg.x"            /* Stats Structures */
 #endif /* MAC_SCH_STATS */
@@ -28098,10 +28098,10 @@ uint8_t        newTxMode
    if(!(ueDl->mimoInfo.forceTD & RG_SCH_CMN_TD_TXMODE_RECFG))
    {
       /* Mem Alloc */
-      if(SGetSBuf(cell->rgmSap->sapCfg.sapPst.region,
-               cell->rgmSap->sapCfg.sapPst.pool, (Data**)&txModeChgInd,
-               sizeof(RgmTransModeInd)) != ROK)
+      SCH_ALLOC(txModeChgInd, sizeof(RgmTransModeInd));
+      if(txModeChgInd == NULLP)
       {
+         DU_LOG("ERROR  --> SCH : rgSCHCmnSendTxModeInd(): Memory allocation failed");
          return;
       }
       RG_SCH_FILL_RGM_TRANSMODE_IND(ue->ueId, cell->cellId, newTxMode, txModeChgInd);
index 5dee41a..7582f60 100755 (executable)
@@ -43,6 +43,7 @@ invoked by RRM towards MAC.
 #include "rg_sch_inf.h"
 #include "rg_sch.h"
 #include "rg_sch_err.h"
+#include "sch_utils.h"
 
 /* header/extern include files (.x) */
 #include "lrg.x"
@@ -50,6 +51,7 @@ invoked by RRM towards MAC.
 #include "tfu.x"
 #include "rg_sch_inf.x"
 #include "rg_sch.x"
+#include "mac_sch_interface.h"
 
 /* local defines */
 static S16 rgSCHGomHndlCfgReq ARGS((RgSchCb *instCb, SpId spId,
@@ -151,7 +153,7 @@ S16 rgSCHGomHndlCfg(Pst *pst,RgSchCb  *instCb,RgrCfgTransId transId,RgrCfgReqInf
    {
       DU_LOG("\nERROR  -->  SCH : Action.Config Type Error");
 
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+      SCH_FREE(cfgReqInfo, 
             (Size)sizeof(*cfgReqInfo));
       cfgReqInfo = NULLP;
       schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); 
@@ -165,7 +167,7 @@ S16 rgSCHGomHndlCfg(Pst *pst,RgSchCb  *instCb,RgrCfgTransId transId,RgrCfgReqInf
          DU_LOG("\nERROR  -->  SCH : Cell with Id %d already exists "
            "on sap %d", instCb->rgrSap[spId].cell->cellId, spId);  
 
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+         SCH_FREE(cfgReqInfo, 
                (Size)sizeof(*cfgReqInfo));
          cfgReqInfo = NULLP;
          schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); 
@@ -180,7 +182,7 @@ S16 rgSCHGomHndlCfg(Pst *pst,RgSchCb  *instCb,RgrCfgTransId transId,RgrCfgReqInf
          DU_LOG("\nERROR  -->  SCH : rgSCHGomHndlCfg: Enqueuing CfgReq "
               "Failed ");
 
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+         SCH_FREE(cfgReqInfo, 
                (Size)sizeof(*cfgReqInfo));
          cfgReqInfo = NULLP;
          schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); 
@@ -189,7 +191,7 @@ S16 rgSCHGomHndlCfg(Pst *pst,RgSchCb  *instCb,RgrCfgTransId transId,RgrCfgReqInf
 
       return ROK;
    }
-   SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+   SCH_FREE(cfgReqInfo, 
          (Size)sizeof(*cfgReqInfo));
    cfgReqInfo = NULLP;
    schSendCfgCfm(pst->region, pst->pool, transId, cfmStatus); 
@@ -282,7 +284,7 @@ printf("\nDEBUG  -->  SCH: AT MAC rgSCHGomCfgReq \n");
       cfmStatus = RGR_CFG_CFM_NOK;
    }
 
-   SPutSBuf(reg, pool, (Data *)cfgReqInfo, 
+   SCH_FREE(cfgReqInfo, 
          (Size)sizeof(*cfgReqInfo));
    cfgReqInfo = NULLP;
 #ifdef EMTC_ENABLE
@@ -980,7 +982,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
    {
       DU_LOG("\nERROR  -->  SCH : Cell Control block does not exist");
       RGSCH_FREE_MSG(cfgReqInfo->pdu);
-      SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+      SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
       cfgReqInfo = NULLP;
       rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); 
       return RFAILED;
@@ -993,7 +995,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
       DU_LOG("\nERROR  -->  SCH : Rgr SI configuration "
                "validation FAILED");
       RGSCH_FREE_MSG(cfgReqInfo->pdu);
-      SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+      SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
       cfgReqInfo = NULLP;
       rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); 
       return RFAILED;
@@ -1012,7 +1014,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
             RGSCH_FREE_MSG(cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si);
             cell->siCb.newSiInfo.siInfo[cfgReqInfo->siId-1].si = NULLP;
          }
-         SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
+         SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo));
          cfgReqInfo = NULLP;   
          cfmStatus = RGR_CFG_CFM_OK;
          rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
@@ -1020,7 +1022,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
        }
        else
        {
-          SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo));
+          SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo));
           cfgReqInfo = NULLP;
           rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus);
           return RFAILED; 
@@ -1048,11 +1050,12 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
          /* need to add padding bytes */
          nmPadBytes = (tbSz - (msgLen*8))/8;
 
-         if ( SGetSBuf(reg,pool,&padding,nmPadBytes) != ROK)
+         SCH_ALLOC(padding,nmPadBytes);
+         if(padding == NULLP)
          {
             DU_LOG("\nERROR  -->  SCH : Rgr SI configuration "
-                     "SGetSBuf failed for padding failed");
-            SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+                     " failed to allocate memory for padding");
+            SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
             cfgReqInfo = NULLP;
             rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, 
                                                            cfmStatus); 
@@ -1068,15 +1071,15 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
          {
             DU_LOG("\nERROR  -->  SCH : Rgr SI configuration "
                      "Failed to add padding bytes");
-            SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+            SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
             cfgReqInfo = NULLP;
-            SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
+            SCH_FREE(padding,(Size)nmPadBytes);
             padding = NULLP;
             rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, 
                                                             cfmStatus); 
             return RFAILED;
          }
-         SPutSBuf(reg, pool, (Data* )padding,(Size)nmPadBytes);
+         SCH_FREE(padding,(Size)nmPadBytes);
          padding = NULLP;
       }/* if (tbSz != ...*/
    }/* if (RGR_SI_CFG_TYPE_SI...*/
@@ -1100,7 +1103,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
                DU_LOG("\nERROR  -->  SCH : Failed to get MCS and NPRB" 
                      "value");
                RGSCH_FREE_MSG(cfgReqInfo->pdu);
-               SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+               SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
                cfgReqInfo = NULLP;
                rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, 
                      cfmStatus); 
@@ -1122,7 +1125,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
             DU_LOG("\nERROR  -->  SCH : Failed to get MCS and NPRB" 
                      "value");
             RGSCH_FREE_MSG(cfgReqInfo->pdu);
-            SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+            SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
             cfgReqInfo = NULLP;
             rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, 
                                                                  cfmStatus); 
@@ -1143,7 +1146,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
             DU_LOG("\nERROR  -->  SCH : Failed to get MCS and NPRB" 
                      "value");
             RGSCH_FREE_MSG(cfgReqInfo->pdu);
-            SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+            SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
             cfgReqInfo = NULLP;
             rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, 
                                                                  cfmStatus); 
@@ -1191,7 +1194,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
             DU_LOG("\nERROR  -->  SCH : Failed to get MCS and NPRB" 
                      "value");
             RGSCH_FREE_MSG(cfgReqInfo->pdu);
-            SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+            SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
             cfgReqInfo = NULLP;
             rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, 
                                                                  cfmStatus); 
@@ -1207,7 +1210,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
          DU_LOG("\nERROR  -->  SCH : Invalid cfgType "
                   "parameter value");
          RGSCH_FREE_MSG(cfgReqInfo->pdu);
-         SPutSBuf(reg, pool, (Data *)cfgReqInfo, 
+         SCH_FREE(cfgReqInfo, 
                (Size)sizeof(*cfgReqInfo)); 
          cfgReqInfo = NULLP;
          rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, 
@@ -1215,7 +1218,7 @@ S16 rgSCHGomHndlSiCfg(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTrans
          return RFAILED;
    }
 
-   SPutSBuf(reg, pool, (Data *)cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
+   SCH_FREE(cfgReqInfo, (Size)sizeof(*cfgReqInfo)); 
    cfgReqInfo = NULLP;
    cfmStatus = RGR_CFG_CFM_OK;
    rgSCHUtlRgrSiCfgCfm(instCb->rgSchInit.inst, spId, transId, cfmStatus); 
@@ -1291,7 +1294,7 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
       DU_LOG("\nERROR  -->  SCH : Warning SI Cfg Failed for siId = %d"
                 "warning cellID:%d",warningSiCfgReqInfo->siId,warningSiCfgReqInfo->cellId);
       rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
-      SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, 
+      SCH_FREE(warningSiCfgReqInfo, 
             sizeof(RgrWarningSiCfgReqInfo)); 
       warningSiCfgReqInfo = NULLP;
       rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId, 
@@ -1343,7 +1346,7 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
                            "for siId = %d", warningSiCfgReqInfo->siId);
                      rgSCHUtlFreeWarningSiSeg(reg, pool, 
                            &warningSiCfgReqInfo->siPduLst);
-                     SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, 
+                     SCH_FREE(warningSiCfgReqInfo, 
                            sizeof(RgrWarningSiCfgReqInfo)); 
                      warningSiCfgReqInfo = NULLP;
                      rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId,
@@ -1368,7 +1371,7 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
             {
                node = warningSiCfgReqInfo->siPduLst.first;
                cmLListDelFrm(&(warningSiCfgReqInfo->siPduLst), node);
-               SPutSBuf(reg, pool, (Data *)node,sizeof(CmLList));
+               SCH_FREE(node,sizeof(CmLList));
                node = NULLP;
             } 
 
@@ -1397,7 +1400,7 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
    {
       DU_LOG("\nDEBUG  -->  SCH : No SI Index is free");
       rgSCHUtlFreeWarningSiSeg(reg, pool, &warningSiCfgReqInfo->siPduLst);
-      SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, 
+      SCH_FREE(warningSiCfgReqInfo, 
             sizeof(RgrWarningSiCfgReqInfo)); 
       warningSiCfgReqInfo = NULLP;
       rgSCHUtlRgrWarningSiCfgCfm(instCb->rgSchInit.inst, spId, siId, transId, 
@@ -1405,7 +1408,7 @@ RgrWarningSiCfgReqInfo *warningSiCfgReqInfo
       return RFAILED;
    }
 
-   SPutSBuf(reg, pool, (Data *)warningSiCfgReqInfo, 
+   SCH_FREE(warningSiCfgReqInfo, 
          sizeof(RgrWarningSiCfgReqInfo)); 
    warningSiCfgReqInfo = NULLP;
    return ROK;
@@ -1546,14 +1549,14 @@ S16 rgSCHGomHndlLoadInf(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTra
    {
       DU_LOG("\nERROR  -->  SCH : Cell Control block does not exist"
              "for load cellId:%d",loadInfReq->cellId);
-      SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
+      SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq));
       return RFAILED;
    }
 
    if (cell->lteAdvCb.dsfrCfg.status == RGR_DISABLE)
    {
       DU_LOG("\nERROR  -->  SCH : rgSCHGomHndlLoadInf(): DSFR Feature not enabled");
-      SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
+      SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq));
       return RFAILED;
    }
    /* Validate the received LOAD INF Configuration */
@@ -1562,7 +1565,7 @@ S16 rgSCHGomHndlLoadInf(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTra
    {
       DU_LOG("\nERROR  -->  SCH : Rgr LOAD INF Configuration "
                "validation FAILED");
-      SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
+      SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq));
       return RFAILED;
    }
    /* Update the RNTP info rcvd in the respective cell centre pool so that Phigh can be
@@ -1575,7 +1578,7 @@ S16 rgSCHGomHndlLoadInf(Region reg,Pool pool,RgSchCb *instCb,SpId spId,RgrCfgTra
       }
    }
 
-   SPutSBuf(reg, pool, (Data *)loadInfReq, (Size)sizeof(*loadInfReq));
+   SCH_FREE(loadInfReq, (Size)sizeof(*loadInfReq));
 
 
    return ROK;
index e6eaa02..ff63354 100755 (executable)
@@ -62,7 +62,7 @@
 S16 cmPkMacSchUeDelInd(Pst* pst,RgInfUeDelInd*  ueDelInd)
 {
    Buffer *mBuf = NULLP;
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
       return RFAILED;
    }
@@ -129,7 +129,7 @@ S16 cmPkMacSchDedBoUpdtReq(Pst* pst,RgInfDedBoRpt* boRpt)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -192,7 +192,7 @@ S16 cmPkMacSchCmnBoUpdtReq(Pst* pst,RgInfCmnBoRpt* boRpt)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -255,7 +255,7 @@ S16 cmPkMacSchSfRecpInd(Pst* pst,RgInfSfDatInd*  datInd)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -316,7 +316,7 @@ S16 cmPkMacSchSpsRelInd(Pst* pst,RgInfSpsRelInfo* relInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -378,7 +378,7 @@ S16 cmPkSchMacSfAllocReq(Pst* pst,RgInfSfAlloc* resAllocReq)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -436,7 +436,7 @@ S16 cmPkSchMacRstHqEntReq(Pst*  pst,RgInfResetHqEnt* hqEntInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -494,7 +494,7 @@ S16 cmPkSchMacRlsHqReq(Pst* pst,RgInfRlsHqInfo* sfHqInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -553,7 +553,7 @@ S16 cmPkSchMacRlsRntiReq(Pst* pst,RgInfRlsRnti* rlsRnti)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -616,7 +616,7 @@ S16 cmPkSchMacCellRegReq(Pst* pst,RgInfCellReg* regReq)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -677,7 +677,7 @@ S16 cmPkSchMacLcgRegReq(Pst* pst,RgInfLcgRegReq *lcgRegReq)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -736,7 +736,7 @@ S16 cmPkSchMacSpsLcRegReq(Pst*  pst,RgInfSpsLcInfo *lcInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -766,7 +766,7 @@ S16 cmPkSchMacUlSpsResetReq(Pst*  pst,RgInfUlSpsReset  *ulSpsResetInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -855,7 +855,7 @@ S16 cmPkSchMacSpsLcDeregReq(Pst* pst,CmLteCellId cellId,CmLteRnti  crnti)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -910,7 +910,7 @@ S16 cmPkSchMacL2MeasReq(Pst* pst,RgInfL2MeasReq  *measInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
    if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasReq), mBuf) != ROK)
@@ -939,12 +939,12 @@ S16 cmPkSchMacL2MeasStopReq(Pst*  pst,RgInfL2MeasStopReq *measInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
        return RFAILED;
   }
    if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
    {
-      SPutMsg(mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
       return RFAILED;
    }
 
@@ -967,13 +967,13 @@ S16 cmPkSchMacL2MeasSendReq(Pst* pst,RgInfL2MeasSndReq *measInfo)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
        return RFAILED;
   }
 
    if(SAddPstMsgMult((Data *)measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)
    {
-      SPutMsg(mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
       return RFAILED;
    }
 
@@ -1027,11 +1027,11 @@ S16 cmUnpkSchMacL2MeasStopReq(L2MeasStopReq func,Pst *pst,Buffer *mBuf)
 
    if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasStopReq), mBuf) != ROK)
    {
-      SPutMsg(mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
       return RFAILED;
    }
 
-   SPutMsg(mBuf);
+   ODU_PUT_MSG_BUF(mBuf);
    return ((*func)(pst, &measInfo));
 } /* end of cmUnpkSchMacL2MeasReq */
 /**
@@ -1053,11 +1053,11 @@ S16 cmUnpkSchMacL2MeasSendReq(L2MeasSendReq  func,Pst *pst,Buffer *mBuf)
 
  if(SRemPreMsgMult((Data *)&measInfo, sizeof(RgInfL2MeasSndReq), mBuf) != ROK)  
    {
-      SPutMsg(mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
       return RFAILED;
    }
 
-   SPutMsg(mBuf);
+   ODU_PUT_MSG_BUF(mBuf);
    return ((*func)(pst, &measInfo));
 } /* end of cmUnpkSchMacL2MeasSendReq*/
 
@@ -1077,7 +1077,7 @@ S16 cmPkMacSchL2MeasCfm(Pst*  pst,RgInfL2MeasCfm *measCfm)
 {
    Buffer *mBuf = NULLP;
 
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
@@ -1108,13 +1108,13 @@ S16 cmPkMacSchL2MeasStopCfm(Pst*  pst,RgInfL2MeasCfm  *measCfm)
 {
    Buffer *mBuf = NULLP;
 
- if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
+ if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) {
       return RFAILED;
    }
 
    if(SAddPstMsgMult((Data *)measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
    {
-      SPutMsg(mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
       return RFAILED;
    }
 
@@ -1167,11 +1167,11 @@ S16 cmUnpkMacSchL2MeasStopCfm(L2MeasCfm func,Pst *pst,Buffer  *mBuf)
 
    if(SRemPreMsgMult((Data *)&measCfm, sizeof(RgInfL2MeasCfm), mBuf) != ROK)
    {
-      SPutMsg(mBuf);
+      ODU_PUT_MSG_BUF(mBuf);
       return RFAILED;
    }
 
-   SPutMsg(mBuf);
+   ODU_PUT_MSG_BUF(mBuf);
    return ((*func)(pst, &measCfm));
 } /* end of cmUnpkMacSchL2MeasStopCfm */
 
index 8c3d7d2..ab8e9cc 100755 (executable)
@@ -90,7 +90,7 @@
 {\
    if (NULLP != (_buf)) \
    { \
-      SPutMsg((_buf)); \
+      ODU_PUT_MSG_BUF((_buf)); \
       _buf = NULLP; \
    } \
 }
index 6e1a089..dbb5cd6 100755 (executable)
@@ -48,7 +48,7 @@
 #ifdef LTE_L2_MEAS
 #include "rg_sch_cmn.h"    /* typedefs for Scheduler */
 #endif
-
+#include "sch_utils.h"
 /* header/extern include files (.x) */
 #include "rgr.x"           /* RGR Interface includes */
 #include "rgm.x"           /* RGM Interface includes */
@@ -357,29 +357,21 @@ static Void rgSCHLmmShutdown(Inst inst)
    }
    /* Free the memory held by the scheduler instance */
    /* Deallocate RGR saps */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].rgrSap,
+   SCH_FREE(rgSchCb[inst].rgrSap,
                 (sizeof(RgSchUpSapCb) * rgSchCb[inst].numSaps));
    rgSchCb[inst].rgrSap = NULLP;
    /* Deallocate RGM saps */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].rgmSap,
+   SCH_FREE(rgSchCb[inst].rgmSap,
                 (sizeof(RgSchUpSapCb) * rgSchCb[inst].numSaps));
    rgSchCb[inst].rgmSap = NULLP;
 
    /* Deallocate TFU saps */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].tfuSap,
+   SCH_FREE(rgSchCb[inst].tfuSap,
                 (sizeof(RgSchLowSapCb) * rgSchCb[inst].numSaps));
    rgSchCb[inst].tfuSap = NULLP;
 
    /* Deallocate bndCfmResponses */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].genCfg.bndCfmResp,
+   SCH_FREE(rgSchCb[inst].genCfg.bndCfmResp,
                 (sizeof(RgSchLmResponse) * rgSchCb[inst].numSaps));
    rgSchCb[inst].genCfg.bndCfmResp = NULLP;
    /* De-register the Timer Service */
index e9a8923..f7b8ce7 100755 (executable)
@@ -38,6 +38,7 @@
 #include "lrg.h"
 #include "rgr.h"
 #include "tfu.h"
+#include "sch_utils.h"
 #include "rg_env.h"
 #include "rg_sch_err.h"
 #include "rg_sch_inf.h"
@@ -3989,8 +3990,8 @@ Size    size                /* size */
 #ifdef MS_MBUF_CORRUPTION /* Should be enabled when debugging mbuf corruption */
    MS_BUF_ADD_ALLOC_CALLER();
 #endif /* */
-   if (SGetSBuf(rgSchCb[inst].rgSchInit.region, rgSchCb[inst].rgSchInit.pool,
-                      pData, size) != ROK)
+   SCH_ALLOC(pData, size);
+   if(pData == NULLP)
    {
      RgUstaDgn dgn;      /* Alarm diagnostics structure */
      dgn.type = LRG_USTA_DGNVAL_MEM;
@@ -4045,10 +4046,9 @@ Size size           /* size */
    MS_BUF_ADD_CALLER();
 #endif /* */
    /* Deallocate buffer */
-   ret = SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                  rgSchCb[inst].rgSchInit.pool, (*data), size);
+   SCH_FREE((*data), size);
 
-   if (ret != ROK)
+   if (data ==NULLP)
    {
       DU_LOG("\nERROR  -->  SCH : rgSCHUtlFreeSBuf failed");
       return;
@@ -4085,7 +4085,7 @@ Void rgSCHUtlFreeWarningSiSeg(Region reg,Pool pool,CmLListCp *siPduLst)
       pdu = (Buffer *)node->node;
       cmLListDelFrm(siPduLst, node);
       RGSCH_FREE_MSG(pdu);
-      SPutSBuf(reg, pool, (Data *)node,sizeof(CmLList));
+      SCH_FREE(node,sizeof(CmLList));
       node = NULLP;
    }
 
@@ -8331,10 +8331,10 @@ S16 rgSCHUtlUpdAvgPrbUsage(RgSchCellCb  *cell)
      numUlSf = cell->prbUsage.rprtPeriod;
 #endif
 
-   if(SGetSBuf(cell->rgmSap->sapCfg.sapPst.region, 
-               cell->rgmSap->sapCfg.sapPst.pool, (Data**)&prbRprtInd, 
-               sizeof(RgmPrbRprtInd)) != ROK)
+    SCH_ALLOC(prbRprtInd, sizeof(RgmPrbRprtInd));
+    if(prbRprtInd == NULLP)
    {
+      DU_LOG("\nERROR  --> SCH : Failed to allocate memory for prbRprtInd");
       return RFAILED;
    }
 
index 3be7fba..257c585 100644 (file)
@@ -239,7 +239,7 @@ uint8_t SchProcGenCfgReq(Pst *pst, RgMngmt *cfg)
    cfm.cfm.reason = reason;
 
    SchSendCfgCfm(&cfmPst, &cfm);
-   /*   SPutSBuf(pst->region, pst->pool, (Data *)cfg, sizeof(RgMngmt)); */
+   /*   SCH_FREE(pst->region, pst->pool, (Data *)cfg, sizeof(RgMngmt)); */
 
    return ROK;
 }/*-- SchProcGenCfgReq --*/
index 21a5ecb..d05d77b 100644 (file)
@@ -255,6 +255,10 @@ typedef struct schCb
 SchCb schCb[SCH_MAX_INST];
 
 /* function declarations */
+SchUeCb* schGetUeCb(SchCellCb *cellCb, uint16_t crnti);
+void schInitUlSlot(SchUlSlotInfo *schUlSlotInfo);
+void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo);
+uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
 short int schActvTmr(Ent ent,Inst inst);
 uint8_t schBroadcastAlloc(SchCellCb *cell, DlBrdcstAlloc *dlBrdcstAlloc,uint16_t slot);
 uint8_t schProcessSlotInd(SlotIndInfo *slotInd, Inst inst);
index a27c3e4..84b413c 100644 (file)
@@ -233,9 +233,13 @@ uint8_t fillSchUeCb(SchUeCb *ueCb, SchUeCfg *ueCfg)
       memcpy(&ueCb->ueCfg.spCellCfg , &ueCfg->spCellCfg, sizeof(SchSpCellCfg));
       ueCb->ueCfg.spCellCfgPres = true;
    }
+
    ueCb->state = SCH_UE_STATE_ACTIVE;
-   
-   ueCb->ueCfg.ambrCfg =  ueCfg->ambrCfg;
+   if(ueCfg->ambrCfg)
+   {
+      SCH_FREE(ueCb->ueCfg.ambrCfg, sizeof(SchAmbrCfg));
+      ueCb->ueCfg.ambrCfg =  ueCfg->ambrCfg;
+   }
    memcpy(&ueCb->ueCfg.dlModInfo,  &ueCfg->dlModInfo , sizeof(SchModulationInfo));
    memcpy(&ueCb->ueCfg.ulModInfo,  &ueCfg->ulModInfo , sizeof(SchModulationInfo));
 
@@ -274,6 +278,10 @@ uint8_t fillSchUeCb(SchUeCb *ueCb, SchUeCfg *ueCfg)
             }
          }/*End of inner for loop */
       }
+
+      SCH_FREE(ueCfg->schLcCfg[lcIdx].drbQos, sizeof(SchDrbQosInfo));
+      SCH_FREE(ueCfg->schLcCfg[lcIdx].snssai, sizeof(SchSnssai));
+
    }/* End of outer for loop */
    return ROK;
 }
index 5d1807a..a287413 100644 (file)
 }
 
 /* allocate and zero out a static buffer */
+#ifdef ODU_MEMORY_DEBUG_LOG
+#define SCH_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\
+{\
+   printf("\n%s=== %s +%d, %s, %d, %p\n",           \
+         _macro, _file, _line, _func, _size, _datPtr); \
+}
+#else
+#define SCH_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {}
+#endif
+
 #define SCH_ALLOC(_datPtr, _size)                               \
 {                                                               \
    uint8_t _ret;                                                    \
    _ret = SGetSBuf(SCH_MEM_REGION, SCH_POOL,                    \
           (Data **)&_datPtr, _size);                             \
    if(_ret == ROK)                                              \
-   {                                                            \
+   {  \
+      SCH_MEM_LOG("SCH_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
       memset(_datPtr, 0, _size);                         \
    }                                                            \
    else                                                         \
@@ -64,7 +75,8 @@
 #define SCH_FREE(_datPtr, _size)                                \
 {                                                               \
    if(_datPtr)                                                  \
-   {                                                            \
+   {\
+      SCH_MEM_LOG("SCH_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
       SPutSBuf(SCH_MEM_REGION, SCH_POOL,                        \
             (Data *)_datPtr,(Size) _size);                            \
       _datPtr = NULLP;                                          \
@@ -91,9 +103,6 @@ void freqDomRscAllocType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDoma
 uint16_t schCalcTbSize(uint32_t payLoadSize);
 uint16_t schCalcNumPrb(uint16_t tbSize, uint16_t mcs, uint8_t numSymbols);
 uint16_t schCalcTbSizeFromNPrb(uint16_t numPrb, uint16_t mcs, uint8_t numSymbols);
-SchUeCb* schGetUeCb(SchCellCb *cellCb, uint16_t crnti);
-void schInitUlSlot(SchUlSlotInfo *schUlSlotInfo);
-void schInitDlSlot(SchDlSlotInfo *schDlSlotInfo);
 #ifdef NR_TDD
 SlotConfig schGetSlotSymbFrmt(uint16_t slot, uint32_t bitMap);
 #endif
index 8c2a930..d4afe91 100755 (executable)
@@ -533,7 +533,7 @@ RlcCfgCfmInfo     *cfgCfmInfo
                 return ( ret1 );
              }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-             if (SPutSBuf(pst->region, pst->pool, (Data *)cfgCfmInfo,
+             if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgCfmInfo,
                       sizeof(RlcCfgCfmInfo)) != ROK)
              {
                 SPutMsg(mBuf);
@@ -618,14 +618,14 @@ CkwUeInfo *newUeInfo
     }
 
     CMCHKPK(cmPkCkwUeInfo, newUeInfo, mBuf);
-    if (SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo,
+    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo,
              sizeof(CkwUeInfo)) != ROK)
     {
        SPutMsg(mBuf);
        return RFAILED;
     }
     CMCHKPK(cmPkCkwUeInfo, ueInfo, mBuf);
-    if (SPutSBuf(pst->region, pst->pool, (Data *)ueInfo,
+    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo,
              sizeof(CkwUeInfo)) != ROK)
     {
        SPutMsg(mBuf);
@@ -681,7 +681,7 @@ CmStatus    status
     
     CMCHKPK(cmPkCmStatus, &status, mBuf); 
     CMCHKPK(cmPkCkwUeInfo, ueInfo, mBuf);
-    if (SPutSBuf(pst->region, pst->pool, (Data *)ueInfo,
+    if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo,
              sizeof(CkwUeInfo)) != ROK)
     {
        SPutMsg(mBuf);
@@ -1127,7 +1127,7 @@ Buffer            *mBuf
     RlcCfgCfmInfo  *cfgCfmInfo = NULLP;
     
 
-    if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&cfgCfmInfo,\
+    if((ret1 = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgCfmInfo,\
                 sizeof(RlcCfgCfmInfo))) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1227,7 +1227,7 @@ Buffer            *mBuf
     CMCHKUNPK(SUnpkS16, &(spId), mBuf);
     CMCHKUNPKLOG(oduPackUInt32, &transId, mBuf, ECKW037, pst);
 
-    if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&ueInfo,\
+    if((ret1 = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueInfo,\
                 sizeof(CkwUeInfo))) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1254,7 +1254,7 @@ Buffer            *mBuf
     }
 #endif /* ERRCLASS & ERRCLS_DEBUG */
 
-    if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&newUeInfo,\
+    if((ret1 = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&newUeInfo,\
                 sizeof(CkwUeInfo))) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1319,7 +1319,7 @@ Buffer            *mBuf
     CMCHKUNPK(SUnpkS16, &suId, mBuf);
     CMCHKUNPKLOG(oduPackUInt32, &transId, mBuf, ECKW042, pst);
 
-    if((ret1 = SGetSBuf(pst->region, pst->pool, (Data **)&ueInfo,\
+    if((ret1 = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueInfo,\
                 sizeof(CkwUeInfo))) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
index eb46d32..d35977d 100644 (file)
@@ -26,7 +26,7 @@
 {                                                            \
    if (_buf != NULLP)                                        \
    {                                                         \
-      (Void) SPutStaticBuffer(_region, _pool,                \
+      (Void) SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool,                \
              (Data *) _buf, (Size) _size, 0);                \
        _buf = NULLP;                                         \
    }                                                         \
index 61074e5..f6c2a2f 100644 (file)
@@ -826,11 +826,11 @@ Pool         pool          /* memory pool to allocate bins */
    if (nmbBins)
    {
 #ifndef CM_MT_HASH_BIN
-      if (SGetSBuf(region, pool, (Data **) &hashListCp->hl, 
+      if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data **) &hashListCp->hl, 
                    (Size) (nmbBins * sizeof(CmListEnt))) != ROK)
          return RFAILED;
 #else
-      if (SGetSBuf(region, pool, (Data **) &hashListCp->hl, 
+      if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data **) &hashListCp->hl, 
                    (Size) (nmbBins * sizeof(CmListBinEnt))) != ROK)
          return RFAILED;
 #endif
@@ -903,11 +903,11 @@ CmHashListCp *hashListCp   /* hash list to deinitialize */
    /* deallocate memory for bins */
    if (hashListCp->nmbBins)
 #ifndef CM_MT_HASH_BIN
-      (Void) SPutSBuf(hashListCp->region, hashListCp->pool, 
+      (Void) SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,hashListCp->region, hashListCp->pool, 
                       (Data *) hashListCp->hl, 
                       (Size) (hashListCp->nmbBins * sizeof(CmListEnt)));
 #else
-      (Void) SPutSBuf(hashListCp->region, hashListCp->pool, 
+      (Void) SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,hashListCp->region, hashListCp->pool, 
                       (Data *) hashListCp->hl, 
                       (Size) (hashListCp->nmbBins * sizeof(CmListBinEnt)));
 #endif
index 2f9d4ee..0278b08 100644 (file)
@@ -2348,7 +2348,7 @@ uint32_t        context       /* value to be passed back, if error occurs */
    {
       return RFAILED;
    }
-   ret = SGetSBuf(info->region, info->pool, &sendBuf, bufLen);                  
+   ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &sendBuf, bufLen);                  
    if (ret != ROK)
    {
       return (ROUTRES);
@@ -2356,7 +2356,7 @@ uint32_t        context       /* value to be passed back, if error occurs */
    ret = SCpyMsgFix(mBuf, 0, bufLen, sendBuf, &msgLen);
    if ((ret != ROK) || (msgLen != bufLen)) 
    {
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);       
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);       
       return RFAILED;
    }
 
@@ -2367,7 +2367,7 @@ uint32_t        context       /* value to be passed back, if error occurs */
       {
          if (sockFd->protType == AF_INET)
          {
-            SPutSBuf(info->region, info->pool, sendBuf, bufLen);       
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);       
 #ifdef CMINETDBG
 #ifndef ALIGN_64BIT
             /* cm_inet_c_001.main_54: CMINETLOGERROR added insted of SDisp */
@@ -2476,7 +2476,7 @@ uint32_t        context       /* value to be passed back, if error occurs */
          ppId, flags, strmId, ttl, context);
    if (ret == INET_ERR)
    {
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);       
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);       
 #ifdef CMINETDBG
 #ifndef ALIGN_64BIT
       /* cm_inet_c_001.main_54: CMINETLOGERROR added insted of SDisp */
@@ -2507,7 +2507,7 @@ uint32_t        context       /* value to be passed back, if error occurs */
    *len = (MsgLen)ret; 
 
    /* cleanup */
-   SPutSBuf(info->region, info->pool, sendBuf, bufLen);       
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);       
 
    return ROK;
 }
@@ -2574,7 +2574,7 @@ CmInetSctpNotification *ntfy        /* notification parameters */
    buflen = CM_INET_MAX_MSG_LEN;
 
    /* allocate flat receive buffer */
-   ret = SGetSBuf(meminfo->region, meminfo->pool, &recvbuf, buflen);
+   ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, &recvbuf, buflen);
    if (ret != ROK)
    {
 #ifdef CMINETDBG
@@ -2597,7 +2597,7 @@ CmInetSctpNotification *ntfy        /* notification parameters */
    if (ret == INET_ERR)
    {
       /* cleanup */
-      SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);       
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);       
 #ifdef CMINETDBG
 #ifndef ALIGN_64BIT
       /* cm_inet_c_001.main_54: CMINETLOGERROR added insted of SDisp */
@@ -2771,7 +2771,7 @@ CmInetSctpNotification *ntfy        /* notification parameters */
             /* cm_inet_c_001.main_46: Allocate memory for data before copying */
             datlen = cmStrlen(sctpNtfy->sn_remote_error.sre_data) + 1;
 
-            ret = SGetSBuf( meminfo->region, meminfo->pool, \
+            ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__, meminfo->region, meminfo->pool, \
                   &ntfy->u.remoteErr.data, datlen );
             if( ret != ROK )
             {
@@ -2791,7 +2791,7 @@ CmInetSctpNotification *ntfy        /* notification parameters */
             /* cm_inet_c_001.main_46: Allocate memory for data before copying */
             datlen = cmStrlen(sctpNtfy->sn_send_failed.ssf_data) + 1;
 
-            ret = SGetSBuf( meminfo->region, meminfo->pool, \
+            ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__, meminfo->region, meminfo->pool, \
                   &ntfy->u.sndFailed.data, datlen );
             if( ret != ROK )
             {
@@ -2849,7 +2849,7 @@ CmInetSctpNotification *ntfy        /* notification parameters */
       ret = SGetMsg(meminfo->region, meminfo->pool, mBuf);
       if (ret != ROK)
       {
-         SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);
          return RFAILED;
       }
 
@@ -2857,13 +2857,13 @@ CmInetSctpNotification *ntfy        /* notification parameters */
       if (ret != ROK)
       {
          SPutMsg(*mBuf);
-         SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);
          return RFAILED;
       }
    }
 
    /* cleanup */
-   SPutSBuf(meminfo->region, meminfo->pool, recvbuf, buflen);       
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,meminfo->region, meminfo->pool, recvbuf, buflen);       
 
    return ROK;
 }
@@ -4124,7 +4124,7 @@ S16             flags           /* additional control flags, unused */
    {
       return RFAILED;
    }
-   ret = SGetSBuf(info->region, info->pool, &sendBuf, bufLen);                  
+   ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &sendBuf, bufLen);                  
    if (ret != ROK)
    {
       return (ROUTRES);
@@ -4133,7 +4133,7 @@ S16             flags           /* additional control flags, unused */
    if ((ret != ROK) || (msgLen != bufLen)) 
    {
       /* cleanup */
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);       
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);       
       return RFAILED;
    }
 
@@ -4166,7 +4166,7 @@ S16             flags           /* additional control flags, unused */
    if (ret == INET_ERR)
    {
       /* cleanup */
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);      
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);      
 
       if(INET_ERR_CODE == ERR_AGAIN)
       {
@@ -4223,12 +4223,12 @@ S16             flags           /* additional control flags, unused */
    if (ret < bufLen) 
    {   
       /* cleanup */
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);      
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);      
       return (RWOULDBLOCK);
    }
 
    /* cleanup */
-   SPutSBuf(info->region, info->pool, sendBuf, bufLen);      
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);      
 
 #else /* end of Win NT/flat buffer specific part */
    ret = SFndLenMsg(mBuf, &msgLen);
@@ -4615,7 +4615,7 @@ S16             flags           /* additional control flags, unused */
    {
       return RFAILED;
    }
-   ret = SGetSBuf(info->region, info->pool, &sendBuf, bufLen);                  
+   ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &sendBuf, bufLen);                  
    if (ret != ROK)
    {
       return (ROUTRES);
@@ -4624,7 +4624,7 @@ S16             flags           /* additional control flags, unused */
    if ((ret != ROK) || (msgLen != bufLen)) 
    {
       /* cleanup */
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);       
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);       
       return RFAILED;
    }
 
@@ -4657,7 +4657,7 @@ S16             flags           /* additional control flags, unused */
    if (ret == INET_ERR)
    {
       /* cleanup */
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);      
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);      
 
       if(INET_ERR_CODE == ERR_AGAIN)
       {
@@ -4714,12 +4714,12 @@ S16             flags           /* additional control flags, unused */
    if (ret < bufLen) 
    {   
       /* cleanup */
-      SPutSBuf(info->region, info->pool, sendBuf, bufLen);      
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);      
       return (RWOULDBLOCK);
    }
 
    /* cleanup */
-   SPutSBuf(info->region, info->pool, sendBuf, bufLen);      
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, sendBuf, bufLen);      
 
 #else /* end of Win NT/flat buffer specific part */
    ret = SFndLenMsg(mBuf, &msgLen);
@@ -5391,7 +5391,7 @@ CmInetMemInfo   *info            /* Memory information */
    }
 
    /* allocate mem needed to hold all HBH/Dest options */
-   ret = SGetSBuf(info->region, info->pool, 
+   ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, 
          (Data **)&hbhOptsArr->hbhOpts, 
          (Size)((sizeof(CmInetIpv6HBHHdr)) * numOpts)); 
    if (ret != ROK)
@@ -5460,7 +5460,7 @@ CmInetMemInfo   *info            /* Memory information */
       {   
          /* take care of all other options having valid value field
           * such as Router Alert, PADN >= 3 bytes and Jumbo */
-         ret = SGetSBuf(info->region, info->pool, 
+         ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, 
                (Data **)&hbhOptsArr->hbhOpts[optsIdx].value, 
                (Size)hbhOptsArr->hbhOpts[optsIdx].length);
          if (ret != ROK)
@@ -5483,7 +5483,7 @@ CmInetMemInfo   *info            /* Memory information */
                   snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "SPutSBuf call 1 in BuildRecvHopOptsArr\n");
                   CMINETLOGERROR(ERRCLS_INT_PAR, ECMINET030, 0, prntBuf);
 #endif /* CMINETDBG */                  
-                  SPutSBuf(info->region, info->pool, 
+                  SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, 
                         (Data *)hbhOptsArr->hbhOpts[optsIdx - 1].value,
                         (Size)hbhOptsArr->hbhOpts[optsIdx - 1].length);
                }
@@ -5497,7 +5497,7 @@ CmInetMemInfo   *info            /* Memory information */
             snprintf(prntBuf, CMINET_PRNT_BUF_SIZE, "SPutSBuf call 2 in BuildRecvHopOptsArr\n");
             CMINETLOGERROR(ERRCLS_DEBUG, ECMINET031, 0, prntBuf);
 #endif /* CMINETDBG */            
-            SPutSBuf(info->region, info->pool, 
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, 
                   (Data *)hbhOptsArr->hbhOpts, numOpts * sizeof(CmInetIpv6HBHHdr));
             hbhOptsArr->numHBHOpts = 0;
             hbhOptsArr->hbhOpts = NULLP;
@@ -5580,7 +5580,7 @@ CmInetMemInfo   *info      /* Memory information */
    /* subtract 8 bytes for Next Hdr, Hdr Ext Len, .... + SL bit map */
    rtOptsArr->numAddrs = (rtDataLen - 8)/16;
 
-   ret = SGetSBuf(info->region, info->pool, 
+   ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, 
          (Data **)&rtOptsArr->ipv6Addrs, 
          (Size)rtOptsArr->numAddrs * 16);
    if (ret != ROK)
@@ -5935,7 +5935,7 @@ S32              flags          /* additional control flags */
       }
 
       /* allocate flat receive buffer */
-      ret = SGetSBuf(info->region, info->pool, &recvBuf, bufLen);
+      ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &recvBuf, bufLen);
       if (ret != ROK)
       {
          return (ROUTRES);
@@ -5983,7 +5983,7 @@ S32              flags          /* additional control flags */
          {
             /* cleanup */
             /* moved cleanup here */
-            SPutSBuf(info->region, info->pool, recvBuf, bufLen); 
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen); 
 
             /*  added check ERR_WOULDBLOCK */
             if ((INET_ERR_CODE == ERR_AGAIN) ||
@@ -6054,7 +6054,7 @@ S32              flags          /* additional control flags */
          if ((sockFd->type == CM_INET_DGRAM) && (*len == 0))
 #endif
          {
-            SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
             return (ROKDNA);
          }
 
@@ -6086,7 +6086,7 @@ S32              flags          /* additional control flags */
             CMINETLOGERROR(ERRCLS_INT_PAR, ECMINET068, 0, prntBuf);
 #endif /*ALIGN_64BIT*/
 #endif
-            SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
             return (ROKDNA);
          }
 
@@ -6095,7 +6095,7 @@ S32              flags          /* additional control flags */
       if (ret != ROK)
       {
          /* cleanup */
-         SPutSBuf(info->region, info->pool, recvBuf, bufLen);       
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);       
          return (ret);
       }
 
@@ -6123,7 +6123,7 @@ S32              flags          /* additional control flags */
 
       if (ret != ROK)
       {
-         SPutSBuf(info->region, info->pool, recvBuf, bufLen);    
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);    
          SPutMsg(mBuf); 
          return (ret);
       }
@@ -6157,7 +6157,7 @@ S32              flags          /* additional control flags */
       }   
 
       /* cleanup */
-      SPutSBuf(info->region, info->pool, recvBuf, bufLen);      
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);      
 
 #else  /* end of Win NT/flat buffer specific part */
 
@@ -6173,7 +6173,7 @@ S32              flags          /* additional control flags */
          /* allocate gather vector, it's a dynamic array */    
          numDBufs =  CM_INET_MAX_DBUF;
 
-         ret = SGetSBuf(info->region, info->pool, (Data**)&dBufs, 
+         ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data**)&dBufs, 
                numDBufs*sizeof(Buffer*));
          if (ret != ROK)
          {
@@ -6209,11 +6209,11 @@ S32              flags          /* additional control flags */
                   for (i = 0; i < msg.msg_iovlen; i++)
                      SPutDBuf(info->region, info->pool, dBufs[i]);   
 
-                  SPutSBuf(info->region, info->pool, (Data*)dBufs, 
+                  SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs, 
                         numDBufs * sizeof(Buffer*)); 
 
                   /* allocate flat receive buffer */
-                  ret = SGetSBuf(info->region, info->pool, &recvBuf, bufLen);
+                  ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &recvBuf, bufLen);
                   if (ret != ROK)
                      return (ROUTRES);
 
@@ -6233,7 +6233,7 @@ S32              flags          /* additional control flags */
             }
             else
             {
-               SPutSBuf(info->region, info->pool, (Data*)dBufs, 
+               SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs, 
                      numDBufs*sizeof(Buffer*)); 
                return (ret);
             }
@@ -6277,7 +6277,7 @@ S32              flags          /* additional control flags */
             /* Moved up the cleanup precedures here before returning */
             /* Cleanup flat buffer if allocated */
             if (allocFlatBuf)
-               SPutSBuf(info->region, info->pool, recvBuf, bufLen);
+               SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);
             else
             {
                /* cleanup */
@@ -6290,7 +6290,7 @@ S32              flags          /* additional control flags */
 
                   SPutDBuf(info->region, info->pool, dBufs[i]);   
                }
-               SPutSBuf(info->region, info->pool, (Data*)dBufs, 
+               SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs, 
                      numDBufs*sizeof(Buffer*)); 
             }
 
@@ -6518,7 +6518,7 @@ S32              flags          /* additional control flags */
             if (ret != ROK)
             {
                /* cleanup */
-               SPutSBuf(info->region, info->pool, recvBuf, bufLen);       
+               SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);       
                return (ret);
             }
 
@@ -6528,7 +6528,7 @@ S32              flags          /* additional control flags */
                ret = SAddPstMsgMult(recvBuf, recvLen, tempMsg);        
                if (ret != ROK)
                {
-                  SPutSBuf(info->region, info->pool, recvBuf, bufLen);    
+                  SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);    
                   SPutMsg(tempMsg); 
                   return (ret);
                }
@@ -6536,7 +6536,7 @@ S32              flags          /* additional control flags */
 
             *mPtr = tempMsg;
 
-            SPutSBuf(info->region, info->pool, recvBuf, bufLen);    
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);    
             /* cm_inet_c_001.main_48 :flat buffers are allocated 
              * for non -TCP sockets. On these sockets we can receive 
              * only one message at a time 
@@ -6555,7 +6555,7 @@ S32              flags          /* additional control flags */
                 * mBuf */
                if (*mPtr != NULLP)
                   SPutMsg(*mPtr);
-               SPutSBuf(info->region, info->pool, (Data*)dBufs, 
+               SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs, 
                      numDBufs*sizeof(Buffer*)); 
                return (ret);
             }
@@ -6575,14 +6575,14 @@ S32              flags          /* additional control flags */
                /* cleanup */
                SPutMsg(*mPtr);
                SPutMsg(tempMsg);
-               SPutSBuf(info->region, info->pool, (Data*)dBufs, 
+               SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs, 
                      numDBufs*sizeof(Buffer*)); 
                return RFAILED;
             }
             SPutMsg(tempMsg);
          }
 
-         SPutSBuf(info->region, info->pool, (Data*)dBufs, 
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, (Data*)dBufs, 
                numDBufs*sizeof(Buffer*)); 
 
          /* 
@@ -7012,7 +7012,7 @@ Data            *data           /* read data */
       if ((MsgLen)pendLen >= bufLen)
       {        
          /* allocate receive buffer (flat structure) */
-         ret = SGetSBuf(info->region, info->pool, &recvBuf, bufLen);                  
+         ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, &recvBuf, bufLen);                  
          if (ret != ROK)
          {
             return (ROUTRES);
@@ -7053,7 +7053,7 @@ Data            *data           /* read data */
          {
             /* cleanup */
             /* moved cleanup here */
-            SPutSBuf(info->region, info->pool, recvBuf, bufLen); 
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen); 
 
             /* added check ERR_WOULDBLOCK */
             if ((INET_ERR_CODE == ERR_AGAIN) ||
@@ -7092,7 +7092,7 @@ Data            *data           /* read data */
          if (recvLen < (S32)bufLen)  /* maybe happen */
          {
             /* cleanup */
-            SPutSBuf(info->region, info->pool, recvBuf, bufLen);                            
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);                            
             return (ROKDNA);
          } 
 
@@ -7131,7 +7131,7 @@ Data            *data           /* read data */
          }   
 
          /* cleanup */
-         SPutSBuf(info->region, info->pool, recvBuf, bufLen);                            
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,info->region, info->pool, recvBuf, bufLen);                            
       }
       else
       {
index c253aee..b57e570 100644 (file)
           numOpts > 0; numOpts--) \
       { \
          if (_hdrParmIpv6->ipv6ExtHdr.hbhOptsArr.hbhOpts[numOpts - 1].length) \
-            SPutSBuf(_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
                  hbhOptsArr.hbhOpts[numOpts - 1].value, (Size)(_hdrParmIpv6-> \
                  ipv6ExtHdr.hbhOptsArr.hbhOpts[numOpts - 1].length)); \
-            SPutSBuf(_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
                  hbhOptsArr.hbhOpts[numOpts - 1], \
                  (Size)sizeof(CmInetIpv6HBHHdr)); \
       } \
       for(numOpts = _hdrParmIpv6->ipv6ExtHdr.destOptsArr.numDestOpts; \
           numOpts > 0; numOpts--) \
       { \
-         SPutSBuf(_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
                 destOptsArr.destOpts[numOpts - 1].value, (Size)(_hdrParmIpv6-> \
                 ipv6ExtHdr.destOptsArr.destOpts[numOpts - 1].length)); \
-         SPutSBuf(_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
                 destOptsArr.destOpts[numOpts - 1], \
                 (Size)sizeof(CmInetIpv6DestOptsHdr)); \
       } \
    } \
    if( _hdrParmIpv6->ipv6ExtHdr.rtOptsPrsnt) \
    { \
-      SPutSBuf(_region, _pool, \
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, \
                (Data *)_hdrParmIpv6->ipv6ExtHdr.rtOptsArr.ipv6Addrs, \
                (Size)(_hdrParmIpv6->ipv6ExtHdr.rtOptsArr.numAddrs * 16)); \
    } \
index 02dbe20..e2fee9b 100644 (file)
@@ -117,10 +117,10 @@ Ptr             *ptr         /* Location to place allocated event ptr */
   /* Allocate memory for the first Memory Chunk */
   /* Allocated memory should be maxBlkSize + sizeof(CmMemList) */
 #ifdef SS_LOCKLESS_MEMORY
-   if(SGetStaticBuffer(sMem->region, sMem->pool, (Data **)&allocPtr,
+   if(SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,sMem->region, sMem->pool, (Data **)&allocPtr,
                        (Size)(maxBlkSize + sizeof(CmMemList)), 0) != ROK)
 #else
-  if (SGetSBuf(sMem->region, sMem->pool, 
+  if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,sMem->region, sMem->pool, 
                (Data **)&allocPtr, 
                (Size)(maxBlkSize + sizeof(CmMemList))) != ROK)
 #endif /* SS_LOCKLESS_MEMORY */
@@ -271,11 +271,11 @@ Ptr           *allocPtr  /* location to place pointer */
   /* Allocate buffer */
   /* cm_mblk_c_001.101: use blkSize instead of cb->maxSize */
 #ifdef SS_LOCKLESS_MEMORY
-   if(SGetStaticBuffer(cb->sMem.region, cb->sMem.pool, 
+   if(SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,cb->sMem.region, cb->sMem.pool, 
                        (Data **)&(cb->initPtr),
                        (Size)(blkSize + sizeof(CmMemList)), 0) != ROK)
 #else
-  if (SGetSBuf(cb->sMem.region, cb->sMem.pool, 
+  if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,cb->sMem.region, cb->sMem.pool, 
               (Data **)&(cb->initPtr),
               (Size)(blkSize + sizeof(CmMemList)) )  != ROK)
 #endif /* SS_LOCKLESS_MEMORY */
@@ -355,10 +355,10 @@ Ptr             *ptr         /* Location to place allocated event ptr */
   /* Allocate memory for the first Memory Chunk */
   /* Allocated memory should be maxBlkSize + sizeof(CmMemList) */
 #ifdef SS_LOCKLESS_MEMORY
-   if(SGetStaticBuffer(sMem->region, sMem->pool, (Data **)&allocPtr,
+   if(SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,sMem->region, sMem->pool, (Data **)&allocPtr,
                        (Size)(maxBlkSize + sizeof(CmMemList)), 0) != ROK)
 #else
-  if (SGetSBuf(sMem->region, sMem->pool, 
+  if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,sMem->region, sMem->pool, 
                (Data **)&allocPtr, 
                (Size)(maxBlkSize + sizeof(CmMemList))) != ROK)
 #endif /* SS_LOCKLESS_MEMORY */
@@ -479,11 +479,11 @@ Ptr           *allocPtr  /* location to place pointer */
   /* Allocate buffer */
   /* cm_mblk_c_001.101: use blkSize instead of cb->maxSize */
 #ifdef SS_LOCKLESS_MEMORY
-   if(SGetStaticBuffer(cb->sMem.region, cb->sMem.pool, 
+   if(SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,cb->sMem.region, cb->sMem.pool, 
                        (Data **)&(cb->initPtr),
                        (Size)(blkSize + sizeof(CmMemList)), 0) != ROK)
 #else
-  if (SGetSBuf(cb->sMem.region, cb->sMem.pool, 
+  if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,cb->sMem.region, cb->sMem.pool, 
               (Data **)&(cb->initPtr),
               (Size)(blkSize + sizeof(CmMemList)) )  != ROK)
 #endif /* SS_LOCKLESS_MEMORY */
@@ -578,10 +578,10 @@ Ptr    memPtr      /* Link List CP */
     if( node )
     {
 #ifdef SS_LOCKLESS_MEMORY
-       SPutStaticBuffer(sMem.region, sMem.pool,
+       SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,sMem.region, sMem.pool,
                         (Data *)node, (node->size + sizeof(CmMemList)), 0);
 #else
-       SPutSBuf(sMem.region,sMem.pool, 
+       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,sMem.region,sMem.pool, 
                 (Data *)node, (node->size + sizeof(CmMemList)));
 #endif /* SS_LOCKLESS_MEMORY */
     }
index 46c32de..a507098 100755 (executable)
@@ -4882,7 +4882,7 @@ uint16_t    bktIdx
 #else
    funcNm = (S8 **)calloc(1, (sizeof(uint32_t) * CM_MAX_STACK_TRACE));
 #endif
-       /* SGetSBuf(DFLT_REGION, DFLT_POOL, &funcNm, sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
+       /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &funcNm, sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
    traceSize = backtrace((Void **)funcNm, CM_MAX_STACK_TRACE);
 #else /* SS_MEM_LEAK_SOL */
 #ifndef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
@@ -4905,7 +4905,7 @@ uint16_t    bktIdx
    allocInfo = (MemAllocInfo *)calloc(1, sizeof(MemAllocInfo));  
 #endif
 #endif
-       /* SGetSBuf(DFLT_REGION, DFLT_POOL, &allocInfo,  sizeof(MemAllocInfo)); */
+       /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &allocInfo,  sizeof(MemAllocInfo)); */
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
    /* check if hashListCp is initialised yet */
    if ( regCb->brdcmSsiLstCp.nmbBins == 0)
@@ -5238,7 +5238,7 @@ Void SFlushLkInfo (Void)
 #else
                 free(funcNm[i]); 
 #endif
-                                   /* SPutSBuf(DFLT_REGION, DFLT_POOL, funcNm[i], sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
+                                   /* SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, funcNm[i], sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
              }
 #endif /* SS_MEM_LEAK_SOl */
 /*cm_mem_c_001.main_27 SSI-4GMX specfic changes*/   
@@ -5459,7 +5459,7 @@ S32 cmLeakCallBack(uintptr_t pc,S32  sigNo, Void *arg)
 #else
     buffer = (S8 *)calloc(1, 510); 
 #endif
-        /* SGetSBuf(DFLT_REGION, DFLT_POOL, &buffer, 510); */
+        /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &buffer, 510); */
     (void) cmAddrToSymStr((void *)pc, buffer, 505);
     bt->bt_buffer[bt->bt_actcount++] = (S8 *)buffer;
 
@@ -5670,7 +5670,7 @@ Pool         pool          /* memory pool to allocate bins */
    /* allocate memory for bins */
    if (nmbBins)
    {
-      if (SGetSBuf(region, pool, (Data **) &hashListCp->hashList,
+      if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data **) &hashListCp->hashList,
                (Size)(nmbBins * sizeof(CmMmHashListEnt))) != ROK)
       return RFAILED;
 
@@ -5717,7 +5717,7 @@ Pool   pool          /* memory pool to allocate bins */
 
    /* deallocate memory for bins */
    if (hashListCp->numOfbins)
-      (Void) SPutSBuf(region, pool,
+      (Void) SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool,
                       (Data *) hashListCp->hashList,
                       (Size) (hashListCp->numOfbins * sizeof(CmMmHashListEnt)));
 
index 31c073b..cd042a4 100755 (executable)
@@ -119,7 +119,7 @@ S32 clusterMode;
 #endif
 
 #include "cm_lte.x"
-
+#include "du_log.h"
 \f
 /* local defines */
 /*ccpu00142274 - UL mem based flow control changes */
@@ -1743,7 +1743,7 @@ PTR              ptr
       return RFAILED;
    }
    SUnlock(&memDoubleFreeLock);
-   SPutSBuf(regionCb->region, 0, (Data *)memNode, sizeof(CmMemDoubleFree));
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,regionCb->region, 0, (Data *)memNode, sizeof(CmMemDoubleFree));
 
    return ROK;
 }
@@ -1774,7 +1774,7 @@ PTR              ptr
 
    CmMemDoubleFree   *memNode;
 
-   SGetSBuf(regionCb->region, 0, (Data **)&memNode, sizeof(CmMemDoubleFree));
+   SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,regionCb->region, 0, (Data **)&memNode, sizeof(CmMemDoubleFree));
    if(memNode == NULLP)
    {
        return RFAILED;
@@ -1823,7 +1823,6 @@ Data  **ptr          /* Reference to pointer for which need to be allocate */
 {
    S16 ret;
 
-
    if((SLock(&dynAllocFreeLock)) != ROK)
    {
       printf("cmDynAllocWithLock: Failed to get the dyn lock\n");
@@ -1881,8 +1880,27 @@ Data  **ptr          /* Reference to pointer for which need to be allocate */
 #if (ERRCLASS & ERRCLS_INT_PAR)
 
    /* error check on parameters */
-   if ((regCb == NULLP) || (size == NULLP) || !(*size) || (ptr == NULLP))
+   if(regCb == NULLP)
+   {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory region pointer is null");
+      return RFAILED;
+   }
+   
+   if(ptr == NULLP)
+   {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory block pointer is null");
+      return RFAILED;
+   }
+   
+   if(size == NULLP)
    {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory size pointer null");
+      return RFAILED;  
+   }
+   
+   if(!(*size))
+   {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory block size is 0");
       return RFAILED;
    }
 #endif
@@ -1914,14 +1932,15 @@ Data  **ptr          /* Reference to pointer for which need to be allocate */
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       if (regCb->mapTbl[idx].bktIdx == 0xFF)
-      { 
-         printf("Failed to get the buffer of size %d\n", *size);
+      {
+         DU_LOG("\nERROR  --> CM: cmDynAlloc(): Failed to get the buffer of size %d\n", *size);
          /* Some fatal error in the map table initialization. */
          return RFAILED;
       }
 #endif
      if (idx > 512)
      {
+         DU_LOG("\nERROR  --> CM: cmDynAlloc(): idx value is greater than 512");
          return RFAILED;
      }
       /* Dequeue the memory block and return it to the user */
@@ -1943,9 +1962,9 @@ Data  **ptr          /* Reference to pointer for which need to be allocate */
       if(dynMemElem == NULLP)
       {
 #ifndef ALIGN_64BIT
-         printf("Failed to get the buffer of size %ld\n", *size);
+         DU_LOG("\nERROR  --> CM: cmDynAlloc(): Failed to get the buffer of size %ld\n", *size);
 #else
-         printf("Failed to get the buffer of size %d\n", *size);
+         printf("\nERROR  --> CM: cmDynAlloc(): Failed to get the buffer of size %d\n", *size);
 #endif
          return RFAILED;
       }
@@ -1961,6 +1980,7 @@ Data  **ptr          /* Reference to pointer for which need to be allocate */
       *ptr = dynMemElem->nextBktPtr;
       if (*ptr == NULLP)
       {
+        DU_LOG("\nERROR  --> CM: cmDynAlloc(): nextBktPtr is null");
         return RFAILED;
       }
       dynMemElem->nextBktPtr = *((CmMmEntry **)(*ptr));
@@ -2002,9 +2022,9 @@ Data  **ptr          /* Reference to pointer for which need to be allocate */
 
    /* If the size is not matching, return failure to caller */
 #ifndef ALIGN_64BIT
-   printf("Failed to get the buffer of size %ld\n", *size);
+   DU_LOG("\nERROR  --> CM : cmDynAlloc(): Failed to get the buffer of size %ld\n", *size);
 #else
-   printf("Failed to get the buffer of size %d\n", *size);
+   DU_LOG("\nERROR  --> CM: cmDynAlloc(): Failed to get the buffer of size %d\n", *size);
 #endif
    return RFAILED;
    
@@ -2019,7 +2039,10 @@ Data  **ptr          /* Reference to pointer for which need to be allocate */
    *ptr = (Data *)malloc(*size);
 
    if ( (*ptr) == NULLP)
-       return RFAILED;
+   {
+       DU_LOG("\nERROR  --> CM : cmDynAlloc(): Data ptr is null");
+       return RFAILED; 
+   }
    /* avail_size -= *size; */
    return ROK;
 #endif /* USE_PURE */
@@ -2169,8 +2192,27 @@ Data  **ptr
 #if (ERRCLASS & ERRCLS_INT_PAR)
 
    /* error check on parameters */
-   if ((regCb == NULLP) || (size == NULLP) || !(*size) || (ptr == NULLP))
+   if(regCb == NULL)
    {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory region pointer is null");
+      return RFAILED;
+   }
+
+   if(ptr == NULLP)
+   {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory block pointer is null");
+      return RFAILED;
+   }
+
+   if(size == NULLP)
+   {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory size pointer null");
+      return RFAILED;
+   }
+
+   if(!(*size))
+   {
+      DU_LOG("\nERROR  --> CM: cmDynAlloc(): Received memory block size is 0");
       return RFAILED;
    }
 #endif
@@ -2180,6 +2222,7 @@ Data  **ptr
 #if (ERRCLASS & ERRCLS_INT_PAR)
       if ((memType != CMM_STATIC_MEM_FLAG) && (memType != CMM_DYNAMIC_MEM_FLAG))
       {
+         DU_LOG("\nERROR  --> CM : cmAlloc(): memType[%d] is invalid",memType);
          return RFAILED;
       }
 #endif /* (ERRCLASS & ERRCLS_INT_PAR) */
@@ -2224,6 +2267,7 @@ Data  **ptr
       if (regCb->mapTbl[idx].bktIdx == 0xFF)
       { 
          /* Some fatal error in the map table initialization. */
+         DU_LOG("\nERROR  --> CM : cmAlloc(): bktIdx is invalid");
          return RFAILED;
       }
 #endif
@@ -2312,6 +2356,7 @@ Data  **ptr
 #else
                   (Void) SUnlock(&(bkt->bktLock));
 #endif
+                  DU_LOG("\nERROR  --> CM : cmAlloc(): Sanity check returns failure");
                   /* return RFAILED */
                   return RFAILED;
                }
@@ -2509,6 +2554,7 @@ Data  **ptr
    }
 
    /* No memory available */
+   DU_LOG("\nERROR  --> CM : cmAlloc(): No memory available in heap");
    return RFAILED;
 #else /* use pure is on */
 /*cm_mem_c_001.main_27 SSI-4GMX specfic changes*/   
@@ -2519,7 +2565,10 @@ Data  **ptr
    *ptr = (Data*) malloc(*size);
 #endif
    if ( (*ptr) == NULLP)
+   {
+       DU_LOG("\nERROR  --> CM : cmAlloc(): ptr is null");
        return RFAILED;
+   }
    avail_size -= *size;
    return ROK;
 #endif /* USE_PURE */
@@ -2681,7 +2730,7 @@ Size    size        /* Size of the block */
 )
 {
    S16 ret;
-
+   
    if((SLock(&dynAllocFreeLock)) != ROK)
    {
       printf("dynAllocWithLock: Failed to get the DYN lock\n");
@@ -2749,6 +2798,7 @@ Size    size        /* Size of the block */
    /* error check on parameters */
    if ((regCb == NULLP) || (!size) || (ptr == NULLP))
    {
+      DU_LOG("\nERROR --> CM : cmDynFree(): Received memory region[%p] or size[%p] or block[%p] is invalid",regCb,size,ptr);
       return RFAILED;
    }
 
@@ -2756,12 +2806,14 @@ Size    size        /* Size of the block */
    if (ptr >= ((CmMmRegCb *)regCb)->regInfo.start +
                ((CmMmRegCb *)regCb)->regInfo.size) 
    {
+      DU_LOG("\nERROR --> CM : cmDynFree(): Memory block[%p] not from region[%d]", ptr, ((CmMmRegCb *)regCb)->region);
       return RFAILED;
    }
        /* cm_mem_c_001.main_20 Addition */
        if (ptr < regCb->regInfo.start)
        {
-         return RFAILED;
+          DU_LOG("\nERROR --> CM : cmDynFree(): Memory block[%p] not from region[%d]", ptr, ((CmMmRegCb *)regCb)->region);
+      return RFAILED;
        }
 
 #endif
@@ -2778,6 +2830,7 @@ Size    size        /* Size of the block */
 #if (ERRCLASS & ERRCLS_DEBUG)
    if (regCb->mapTbl[idx].bktIdx == 0xFF)
    { 
+      DU_LOG("\nERROR --> CM : cmDynFree(): bktIdx is not valid");
       /* Some fatal error in the map table initialization. */
       return RFAILED;
    }
@@ -2796,13 +2849,13 @@ Size    size        /* Size of the block */
 #ifdef SS_MEM_WL_DEBUG
    if (size > bkt->size)
    {
-      printf("Size = %d bucket size = %d\n", size, bkt->size);
+      DU_LOG("Size = %d bucket size = %d\n", size, bkt->size);
       exit(-1);
       bkt = &(regCb->bktTbl[bktIdx = regCb->mapTbl[++idx].bktIdx]);
    }
    if(size > bkt->size)
    {
-      printf("2nd time Size = %d bucket size = %d\n", size, bkt->size);
+      DU_LOG("2nd time Size = %d bucket size = %d\n", size, bkt->size);
       exit(-1);
       uint8_t *tmpptr = NULLP;
       printf("Bucket Size wrong \n");
@@ -2815,6 +2868,7 @@ Size    size        /* Size of the block */
    /* Check if the bucket index, if its not valid, return failure */
    if(dynMemElem == NULLP)
    {
+      DU_LOG("\nERROR --> CM : cmDynFree(): dynMemElem is null");
       return RFAILED;
    }
 
@@ -2857,7 +2911,6 @@ Size    size        /* Size of the block */
 
    memset(ptr, (regCb->region+1), bkt->size); 
 #endif
-
    /* Get the bucket node from the index returned and allocate the memory */
    *((CmMmEntry **)ptr) =  dynMemElem->nextBktPtr;
    dynMemElem->nextBktPtr = ptr;
@@ -2965,6 +3018,7 @@ Size    size
    /* error check on parameters */
    if ((regCb == NULLP) || (!size) || (ptr == NULLP))
    {
+      DU_LOG("\nERROR --> CM : cmFree(): Received memory region[%p] or size[%p] or block[%p] is invalid",regCb,size,ptr);
       return RFAILED;
    }
 
@@ -2972,11 +3026,13 @@ Size    size
    if (ptr >= ((CmMmRegCb *)regCb)->regInfo.start +
                ((CmMmRegCb *)regCb)->regInfo.size) 
    {
+      DU_LOG("\nERROR --> CM : cmFree(): Memory block[%p] not from region[%d]",ptr,regCb.region);
       return RFAILED;
    }
        /* cm_mem_c_001.main_20 Addition */
        if (ptr < regCb->regInfo.start)
        {
+     DU_LOG("\nERROR --> CM : cmFree(): Memory block[%p] not from region[%d]",ptr,regCb.region);
          return RFAILED;
        }
 
@@ -3002,6 +3058,7 @@ Size    size
       if (regCb->mapTbl[idx].bktIdx == 0xFF)
       { 
          /* Some fatal error in the map table initialization. */
+         DU_LOG("\nERROR --> CM : cmFree(): Invalid bktIdx");
          return RFAILED;
       }
 #endif
@@ -3085,6 +3142,7 @@ Size    size
 #endif
 
                 /* handle RTRAMPLINGNOK in SFree/SPutSBuf */
+                DU_LOG("\nERROR  --> CM : cmFree(): Sanity check returns failure");    
                 return (RTRAMPLINGNOK);
            }
       }
@@ -3117,6 +3175,7 @@ Size    size
 #endif
 
           /* handle RDBLFREE in SFree/SPutSBuf */
+          DU_LOG("\nERROR  --> CM : cmFree(): Memory block is already freed");    
           return (RDBLFREE);
       }
       if (CMM_IS_STATIC(ptrHdr->memFlags))
@@ -3173,6 +3232,7 @@ Size    size
 #endif
 
             /* handle RTRAMPLINGNOK in SFree/SPutSBuf */
+            DU_LOG("\nERROR  --> CM : cmFree(): Sanity check returns failure");    
             return (RTRAMPLINGNOK);
          }
       }
@@ -4727,7 +4787,7 @@ Void SFlushLkInfo (Void)
 #else
                 free(funcNm[i]); 
 #endif
-                                   /* SPutSBuf(DFLT_REGION, DFLT_POOL, funcNm[i], sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
+                                   /* SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, funcNm[i], sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
              }
 #endif /* SS_MEM_LEAK_SOl */
 /*cm_mem_c_001.main_27 SSI-4GMX specfic changes*/   
@@ -4792,7 +4852,7 @@ uint16_t    bktIdx
 #else
    funcNm = (S8 **)calloc(1, (sizeof(uint32_t) * CM_MAX_STACK_TRACE));
 #endif
-       /* SGetSBuf(DFLT_REGION, DFLT_POOL, &funcNm, sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
+       /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &funcNm, sizeof(uint32_t) * CM_MAX_STACK_TRACE); */
    traceSize = backtrace((Void **)funcNm, CM_MAX_STACK_TRACE);
 #else /* SS_MEM_LEAK_SOL */
    traceSize = backtrace(trace, CM_MAX_STACK_TRACE);
@@ -4809,7 +4869,7 @@ uint16_t    bktIdx
 #else
    allocInfo = (MemAllocInfo *)calloc(1, sizeof(MemAllocInfo)); 
 #endif
-       /* SGetSBuf(DFLT_REGION, DFLT_POOL, &allocInfo,  sizeof(MemAllocInfo)); */
+       /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &allocInfo,  sizeof(MemAllocInfo)); */
    allocInfo->memAddr    = addr;
    allocInfo->reqSz      = reqSz;
    allocInfo->allocSz    = allocSz;
@@ -5179,7 +5239,7 @@ Void      *arg
 #else
     buffer = (S8 *)calloc(1, 510); 
 #endif
-        /* SGetSBuf(DFLT_REGION, DFLT_POOL, &buffer, 510); */
+        /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &buffer, 510); */
     (void) cmAddrToSymStr((void *)pc, buffer, 505);
     bt->bt_buffer[bt->bt_actcount++] = (S8 *)buffer;
 
@@ -5418,7 +5478,7 @@ Pool         pool          /* memory pool to allocate bins */
    /* allocate memory for bins */
    if (nmbBins)
    {
-      if (SGetSBuf(region, pool, (Data **) &hashListCp->hashList,
+      if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data **) &hashListCp->hashList,
                (Size)(nmbBins * sizeof(CmMmHashListEnt))) != ROK)
       return RFAILED;
 
@@ -5465,7 +5525,7 @@ Pool         pool          /* memory pool to allocate bins */
 
    /* deallocate memory for bins */
    if (hashListCp->numOfbins)
-      (Void) SPutSBuf(region, pool,
+      (Void) SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool,
                       (Data *) hashListCp->hashList,
                       (Size) (hashListCp->numOfbins * sizeof(CmMmHashListEnt)));
 
index 2fb4170..2058493 100755 (executable)
@@ -1215,7 +1215,7 @@ Mem         *memInfo     /* meminfo to allocate for Route hdr */
    /* unpack reserve byte & strict/loose bit map */
    CMCHKUNPK(oduPackUInt32, &unpkParam->slMap, mBuf);
    
-   retVal = SGetSBuf(memInfo->region,    
+   retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region,    
                   memInfo->pool,                     
                  (Data **)&unpkParam->ipv6Addrs, 
                  (unpkParam->numAddrs * 16));
@@ -1369,7 +1369,7 @@ Mem               *memInfo   /* meminfo to allocate mem for dest opt */
    CMCHKUNPK(oduPackUInt8, &unpkParam->length, mBuf);
 
    /* allocate static memory to hold the unpacked values */
-   retVal = SGetSBuf(memInfo->region,                   
+   retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region,                   
                   memInfo->pool,                     
                   (Data **)&unpkParam->value, (Size)unpkParam->length);
    if (retVal != ROK)
@@ -1415,7 +1415,7 @@ Mem               *memInfo    /* meminfo to allocate mem for dest opts */
    if (unpkParam->numDestOpts)
    {
       /* allocate mem to hold all dest options */
-      retVal = SGetSBuf(memInfo->region,    
+      retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region,    
                      memInfo->pool,                     
                      (Data **)&unpkParam->destOpts, 
                      (unpkParam->numDestOpts * sizeof(CmIpv6DestOptsHdr)));
@@ -1532,7 +1532,7 @@ Mem          *memInfo   /* meminfo to allocate mem for HBH opt */
    /* allocate static memory to hold the unpacked values */
    if (unpkParam->length)
    {
-      retVal = SGetSBuf(memInfo->region,                   
+      retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region,                   
                      memInfo->pool,                     
                      (Data **)&unpkParam->value, (Size)unpkParam->length); 
       if (retVal != ROK)
@@ -1576,7 +1576,7 @@ Mem             *memInfo     /* meminfo to allocate space for HBH opt */
    if (unpkParam->numHBHOpts)
    {
       /*  allocate space for all HBH options */
-      retVal = SGetSBuf(memInfo->region,    
+      retVal = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,memInfo->region,    
                      memInfo->pool,                     
                      (Data **)&unpkParam->hbhOpts, 
                      (unpkParam->numHBHOpts * sizeof(CmIpv6HBHHdr)));
index 9323c88..3142963 100755 (executable)
          for(numOpts = _hdrParmIpv6->ipv6ExtHdr.hbhOptsArr.numHBHOpts;  \
             numOpts > 0; numOpts--) \
          { \
-            SPutSBuf(_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
                  hbhOptsArr.hbhOpts[numOpts - 1].value, (Size)(_hdrParmIpv6-> \
                  ipv6ExtHdr.hbhOptsArr.hbhOpts[numOpts - 1].length)); \
-            SPutSBuf(_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
                  hbhOptsArr.hbhOpts[numOpts - 1], \
                  (Size)sizeof(CmInetIpv6HBHHdr)); \
          }  \
          for(numOpts = _hdrParmIpv6->ipv6ExtHdr.destOptsArr.numDestOpts; \
             numOpts > 0; numOpts--) \
          { \
-            SPutSBuf(_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)_hdrParmIpv6->ipv6ExtHdr. \
                destOptsArr.destOpts[numOpts - 1].value, (Size)(_hdrParmIpv6-> \
                ipv6ExtHdr.destOptsArr.destOpts[numOpts - 1].length)); \
-            SPutSBuf(_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
+            SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, (Data *)&_hdrParmIpv6->ipv6ExtHdr. \
                destOptsArr.destOpts[numOpts - 1], \
                (Size)sizeof(CmInetIpv6DestOptsHdr)); \
          } \
       } \
       if( _hdrParmIpv6->ipv6ExtHdr.rtOptsPrsnt) \
       { \
-         SPutSBuf(_region, _pool, \
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,_region, _pool, \
                (Data *)_hdrParmIpv6->ipv6ExtHdr.rtOpts.ipv6Addrs, \
                (Size)(_hdrParmIpv6->ipv6ExtHdr.rtOpts.numAddrs * 16)); \
       } \
index 9d99246..00b61dc 100644 (file)
@@ -140,7 +140,128 @@ uint8_t buildPlmnId(Plmn plmn, uint8_t *buf)
    return ROK;
 }
 
+/*******************************************************************
+*
+* @brief  SGetSBuf with debug logs
+*
+* @details
+*
+*    Function : SGetSBufNewForDebug
+*
+*    Functionality: SGetSBuf with debug logs
+*
+* @params[in] file name, fun name, region, pool, data ptr, size
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t SGetSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data **ptr, Size size)
+{
+   if(SGetSBuf(region, pool, ptr, size) == ROK)
+   {
+#ifdef ODU_MEMORY_DEBUG_LOG
+      printf("\nCM_ALLOC=== SGetSBufNewForDebug %s +%d, %s, %d, %p\n",\
+         file, line, func, size, *ptr);
+#endif
+      return ROK;
+   }
+   else
+      return RFAILED;
+}
+
+/*******************************************************************
+*
+* @brief  SPutSBuf with debug logs
+*
+* @details
+*
+*    Function : SPutSBufNewForDebug
+*
+*    Functionality: SPutSBuf with debug logs
+*
+* @params[in] file name, fun name, region, pool, data ptr, size
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t SPutSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data *ptr, Size size)
+{
+   if(SPutSBuf(region, pool, ptr, size) == ROK)
+   {
+#ifdef ODU_MEMORY_DEBUG_LOG
+      printf("\nCM_FREE=== SPutSBufNewForDebug %s +%d, %s, %d, %p\n",\
+         file, line, func, size, ptr);
+#endif
+      return ROK;
+   }
+   else
+      return RFAILED;
+}
+
 
+/*******************************************************************
+*
+* @brief  SGetStaticBuf with debug logs
+*
+* @details
+*
+*    Function : SGetStaticBufNewForDebug
+*
+*    Functionality: SGetStaticBuf with debug logs
+*
+* @params[in] file name, fun name, region, pool, data ptr, size, memType
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t SGetStaticBufNewForDebug(char *file, char *func, char *line, \
+Region region, Pool pool, Data **ptr, Size size, uint8_t memType)
+{
+   if(SGetStaticBuffer(region, pool, ptr, size, memType) == ROK)
+   {
+#ifdef ODU_MEMORY_DEBUG_LOG
+      printf("\nCM_ALLOC=== SGetStaticBufNewForDebug %s +%d, %s, %d, %p\n",\
+         file, line, func, size, *ptr);
+#endif
+      return ROK;
+   }
+   else
+      return RFAILED;
+}
+
+/*******************************************************************
+*
+* @brief  SPutStaticBuf with debug logs
+*
+* @details
+*
+*    Function : SPutStaticBufNewForDebug 
+*
+*    Functionality: SPutStaticBuf with debug logs
+*
+* @params[in] file name, fun name, region, pool, data ptr, size, memType
+*
+* @return ROK     - success
+*         RFAILED - failure
+*
+* ****************************************************************/
+uint8_t SPutStaticBufNewForDebug(char *file, char *func, char *line, \
+Region region, Pool pool, Data *ptr, Size size, uint8_t memType)
+{
+   if(SPutStaticBuffer(region, pool, ptr, size, memType) == ROK)
+   {
+#ifdef ODU_MEMORY_DEBUG_LOG
+      printf("\nCM_FREE=== SPutStaticBufNewForDebug %s +%d, %s, %d, %p\n",\
+         file, line, func, size, ptr);
+#endif
+      return ROK;
+   }
+   else
+      return RFAILED;
+}
 /**********************************************************************
          End of file
 **********************************************************************/
index c60670a..58fda11 100644 (file)
@@ -265,6 +265,13 @@ void freqDomRscAllocType0(uint16_t startPrb, uint16_t prbSize, uint8_t *freqDoma
 void oduCpyFixBufToMsg(uint8_t *fixBuf, Buffer *mBuf, uint16_t len);
 uint8_t buildPlmnId(Plmn plmn, uint8_t *buf);
 
+uint8_t SGetSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data **ptr, Size size);
+uint8_t SPutSBufNewForDebug(char *file, char *func, char *line, Region region, Pool pool, Data *ptr, Size size);
+uint8_t SGetStaticBufNewForDebug(char *file, char *func, char *line, \
+Region region, Pool pool, Data **ptr, Size size, uint8_t memType);
+uint8_t SPutStaticBufNewForDebug(char *file, char *func, char *line, \
+Region region, Pool pool, Data *ptr, Size size, uint8_t memType);
+
 #endif
 
 /**********************************************************************
index 1e221cd..d6c0c79 100755 (executable)
@@ -375,7 +375,7 @@ CrgCfgReqInfo  * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECRG016, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
       return RFAILED;
    }
    if (cmPkCrgCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
@@ -384,7 +384,7 @@ CrgCfgReqInfo  * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECRG017, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -395,7 +395,7 @@ CrgCfgReqInfo  * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECRG018, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -405,11 +405,11 @@ CrgCfgReqInfo  * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECRG019, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
-   if (SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo)) != ROK) {
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -468,7 +468,7 @@ Buffer *mBuf
 #endif
       return RFAILED;
    }
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&cfgReqInfo, sizeof(CrgCfgReqInfo))) != ROK) {
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo, sizeof(CrgCfgReqInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -479,7 +479,7 @@ Buffer *mBuf
    }
     
    if (cmUnpkCrgCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CrgCfgReqInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
index 03bca92..e310a8b 100755 (executable)
@@ -390,12 +390,12 @@ CtfCfgReqInfo *cfgReqInfo
    /* ctf_c_001.main_4: Added support for vendor specific parameters */
 #ifdef CTF_VER3
    if(cfgReqInfo->vendorParams.paramBuffer != NULLP) {
-      SPutSBuf(pst->region, pst->pool, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, 
                    (Data *)cfgReqInfo->vendorParams.paramBuffer,
                    cfgReqInfo->vendorParams.buffLen);
    }
 #endif
-   SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCfgReqInfo)); 
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCfgReqInfo)); 
    return ROK;
 }
 
@@ -598,7 +598,7 @@ CtfKdfReqInfo* kdfReqInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LC) {
@@ -609,7 +609,7 @@ CtfKdfReqInfo* kdfReqInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -623,7 +623,7 @@ CtfKdfReqInfo* kdfReqInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF019, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -634,12 +634,12 @@ CtfKdfReqInfo* kdfReqInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF020, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if (SPutSBuf(pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo)) != ROK) {
+      if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -804,7 +804,7 @@ CtfCnmCellSyncReq * cfgReqInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LC) {
@@ -815,7 +815,7 @@ CtfCnmCellSyncReq * cfgReqInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -829,7 +829,7 @@ CtfCnmCellSyncReq * cfgReqInfo
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -842,7 +842,7 @@ CtfCnmCellSyncReq * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -853,12 +853,12 @@ CtfCnmCellSyncReq * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmCellSyncReq));
    }
    pst->event = (Event)EVTCTFCNMSYNCREQ;
    return (SPstTsk(pst,mBuf));
@@ -911,7 +911,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&SyncReqMsg, sizeof(CtfCnmCellSyncReq))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&SyncReqMsg, sizeof(CtfCnmCellSyncReq))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -930,7 +930,7 @@ Buffer *mBuf
    }
   else if (pst->selector == ODU_SELECTOR_LC)
       if (cmUnpkCtfCtfCnmCellSyncReq(SyncReqMsg, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)SyncReqMsg, sizeof(CtfCnmCellSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)SyncReqMsg, sizeof(CtfCnmCellSyncReq));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -980,7 +980,7 @@ CtfCnmInitSyncReq * cfgReqInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LC) {
@@ -991,7 +991,7 @@ CtfCnmInitSyncReq * cfgReqInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1005,7 +1005,7 @@ CtfCnmInitSyncReq * cfgReqInfo
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1018,7 +1018,7 @@ CtfCnmInitSyncReq * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -1029,12 +1029,12 @@ CtfCnmInitSyncReq * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(CtfCnmInitSyncReq));
    }
    pst->event = (Event)EVTCTFCNMINITSYNCREQ;
    return (SPstTsk(pst,mBuf));
@@ -1089,7 +1089,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&syncReqInfo, sizeof(CtfCnmInitSyncReq))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncReqInfo, sizeof(CtfCnmInitSyncReq))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -1108,7 +1108,7 @@ Buffer *mBuf
    }
   else if (pst->selector == ODU_SELECTOR_LC)
       if (cmUnpkCtfsyncReqInfo(syncReqInfo, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)syncReqInfo, sizeof(CtfCnmInitSyncReq));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncReqInfo, sizeof(CtfCnmInitSyncReq));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -1210,7 +1210,7 @@ CtfCnmInitSyncRsp * cfgRspInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LC) {
@@ -1221,7 +1221,7 @@ CtfCnmInitSyncRsp * cfgRspInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1235,7 +1235,7 @@ CtfCnmInitSyncRsp * cfgRspInfo
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1248,7 +1248,7 @@ CtfCnmInitSyncRsp * cfgRspInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -1259,12 +1259,12 @@ CtfCnmInitSyncRsp * cfgRspInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmInitSyncRsp));
    }
    pst->event = (Event)EVTCTFCNMINITSYNCRSP;
    return (SPstTsk(pst,mBuf));
@@ -1370,7 +1370,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if((SGetSBuf(pst->region, pst->pool, (Data **)&syncRspInfo, sizeof(CtfCnmInitSyncRsp))) != ROK) {
+      if((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncRspInfo, sizeof(CtfCnmInitSyncRsp))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -1389,7 +1389,7 @@ Buffer *mBuf
    }
   else if (pst->selector == ODU_SELECTOR_LC)
       if(cmUnpkCtfCnmInitSyncRspMsg(syncRspInfo, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)syncRspInfo, sizeof(CtfCnmInitSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncRspInfo, sizeof(CtfCnmInitSyncRsp));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -1449,7 +1449,7 @@ CtfCnmCellSyncRsp * cfgRspInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LC) {
@@ -1460,7 +1460,7 @@ CtfCnmCellSyncRsp * cfgRspInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1474,7 +1474,7 @@ CtfCnmCellSyncRsp * cfgRspInfo
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1487,7 +1487,7 @@ CtfCnmCellSyncRsp * cfgRspInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -1498,12 +1498,12 @@ CtfCnmCellSyncRsp * cfgRspInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgRspInfo, sizeof(CtfCnmCellSyncRsp));
    }
    pst->event = (Event)EVTCTFCNMSYNCRSP;
    return (SPstTsk(pst,mBuf));
@@ -1570,7 +1570,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&syncRspMsg, sizeof(CtfCnmCellSyncRsp))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncRspMsg, sizeof(CtfCnmCellSyncRsp))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -1589,7 +1589,7 @@ Buffer *mBuf
    }
   else if (pst->selector == ODU_SELECTOR_LC)
       if (cmUnpkCtfCnmSyncRspMsg(syncRspMsg, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)syncRspMsg, sizeof(CtfCnmCellSyncRsp));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncRspMsg, sizeof(CtfCnmCellSyncRsp));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -1650,7 +1650,7 @@ CtfCnmCellSyncInd * cfgIndInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LC) {
@@ -1661,7 +1661,7 @@ CtfCnmCellSyncInd * cfgIndInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1675,7 +1675,7 @@ CtfCnmCellSyncInd * cfgIndInfo
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -1688,7 +1688,7 @@ CtfCnmCellSyncInd * cfgIndInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -1699,12 +1699,12 @@ CtfCnmCellSyncInd * cfgIndInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgIndInfo, sizeof(CtfCnmCellSyncInd));
    }
    pst->event = (Event)EVTCTFCNMSYNCIND;
    return (SPstTsk(pst,mBuf));
@@ -1772,7 +1772,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&syncIndMsg, sizeof(CtfCnmCellSyncInd))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&syncIndMsg, sizeof(CtfCnmCellSyncInd))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -1791,7 +1791,7 @@ Buffer *mBuf
    }
   else if (pst->selector == ODU_SELECTOR_LC)
       if (cmUnpkCtfCnmSyncIndMsg(syncIndMsg, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)syncIndMsg, sizeof(CtfCnmCellSyncInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)syncIndMsg, sizeof(CtfCnmCellSyncInd));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -2105,7 +2105,7 @@ Buffer *mBuf
    }
    
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&kdfReqInfo, sizeof(CtfKdfReqInfo))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&kdfReqInfo, sizeof(CtfKdfReqInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -2126,7 +2126,7 @@ Buffer *mBuf
    }
    else if (pst->selector == ODU_SELECTOR_LC) 
       if (cmUnpkCtfKdfReqInfo(kdfReqInfo, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfReqInfo, sizeof(CtfKdfReqInfo));
       SPutMsg(mBuf);
          #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -2191,7 +2191,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&cfgReqInfo, sizeof(CtfCfgReqInfo))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo, sizeof(CtfCfgReqInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -2412,7 +2412,7 @@ uint8_t status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF026, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
       return RFAILED;
    }
 
@@ -2423,7 +2423,7 @@ uint8_t status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF027, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -2435,7 +2435,7 @@ uint8_t status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF028, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -2447,7 +2447,7 @@ uint8_t status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF028, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -2459,12 +2459,12 @@ uint8_t status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF029, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
-   if (SPutSBuf(pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo)) != ROK) 
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)kdfCfmInfo, sizeof(CtfKdfCfmInfo)) != ROK) 
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
    /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -2975,8 +2975,8 @@ CtfUeInfo * newUeInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF033, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-      SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LC) {
@@ -2987,8 +2987,8 @@ CtfUeInfo * newUeInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF034, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-         SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -3001,8 +3001,8 @@ CtfUeInfo * newUeInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF035, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-         SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -3015,8 +3015,8 @@ CtfUeInfo * newUeInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF036, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-         SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -3029,8 +3029,8 @@ CtfUeInfo * newUeInfo
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF037, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-         SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -3042,8 +3042,8 @@ CtfUeInfo * newUeInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF038, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-      SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -3054,13 +3054,13 @@ CtfUeInfo * newUeInfo
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF039, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-      SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if (SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo)) != ROK) {
+      if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -3070,7 +3070,7 @@ CtfUeInfo * newUeInfo
          SPutMsg(mBuf);
          return RFAILED;
       }
-      if (SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo)) != ROK) {
+      if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -3135,7 +3135,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&ueInfo, sizeof(CtfUeInfo))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueInfo, sizeof(CtfUeInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -3154,7 +3154,7 @@ Buffer *mBuf
    }
    else if (pst->selector == ODU_SELECTOR_LC) 
       if (cmUnpkCtfUeInfo(ueInfo, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -3165,7 +3165,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&newUeInfo, sizeof(CtfUeInfo))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&newUeInfo, sizeof(CtfUeInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -3173,7 +3173,7 @@ Buffer *mBuf
             (ErrVal)ECTF046, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
          return RFAILED;
       }
    }
@@ -3185,8 +3185,8 @@ Buffer *mBuf
    }
    else if (pst->selector == ODU_SELECTOR_LC) 
       if (cmUnpkCtfUeInfo(newUeInfo, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
-      SPutSBuf(pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)newUeInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -3234,7 +3234,7 @@ CmStatus status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF048, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
       return RFAILED;
    }
    if (cmPkCmStatus(&status, mBuf) != ROK) {
@@ -3244,7 +3244,7 @@ CmStatus status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF049, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -3256,7 +3256,7 @@ CmStatus status
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF050, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -3269,7 +3269,7 @@ CmStatus status
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF051, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
@@ -3281,7 +3281,7 @@ CmStatus status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF052, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -3292,12 +3292,12 @@ CmStatus status
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF053, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if (SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo)) != ROK) {
+      if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -3362,7 +3362,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&ueInfo, sizeof(CtfUeInfo))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueInfo, sizeof(CtfUeInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -3381,7 +3381,7 @@ Buffer *mBuf
    }
    else if (pst->selector == ODU_SELECTOR_LC) 
       if (cmUnpkCtfUeInfo(ueInfo, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -3392,7 +3392,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (cmUnpkCmStatus(&status, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueInfo, sizeof(CtfUeInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -4427,7 +4427,7 @@ Buffer *mBuf
    CMCHKUNPK(oduPackUInt16, &param->buffLen, mBuf);
 
    if(param->buffLen != 0) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&param->paramBuffer, param->buffLen)) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&param->paramBuffer, param->buffLen)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -6982,7 +6982,7 @@ CtfPeriodicRemCellSearchRsp *CellCfgRsp
          (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF016, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)CellCfgRsp,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
             sizeof(CtfPeriodicRemCellSearchRsp));
       return RFAILED;
    }
@@ -6994,7 +6994,7 @@ CtfPeriodicRemCellSearchRsp *CellCfgRsp
             (Txt*)&__FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF017, (ErrVal)0, (Txt*)&"Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)CellCfgRsp,
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
                sizeof(CtfPeriodicRemCellSearchRsp));
          SPutMsg(mBuf);
          return RFAILED;
@@ -7009,7 +7009,7 @@ CtfPeriodicRemCellSearchRsp *CellCfgRsp
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ECTF018, (ErrVal)0, "Packing failed");
 #endif
-         SPutSBuf(pst->region, pst->pool, (Data *)CellCfgRsp,
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
                sizeof(CtfPeriodicRemCellSearchRsp));
          SPutMsg(mBuf);
          return RFAILED;
@@ -7023,7 +7023,7 @@ CtfPeriodicRemCellSearchRsp *CellCfgRsp
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF019, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)CellCfgRsp,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
             sizeof(CtfPeriodicRemCellSearchRsp));
       SPutMsg(mBuf);
       return RFAILED;
@@ -7035,13 +7035,13 @@ CtfPeriodicRemCellSearchRsp *CellCfgRsp
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ECTF020, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)CellCfgRsp,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
             sizeof(CtfPeriodicRemCellSearchRsp));
       SPutMsg(mBuf);
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      SPutSBuf(pst->region, pst->pool, (Data *)CellCfgRsp,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellCfgRsp,
             sizeof(CtfPeriodicRemCellSearchRsp));
    }
    pst->event = (Event)EVTCTFPREMCELLSRCHRSP;
@@ -7124,7 +7124,7 @@ Buffer *mBuf
       return RFAILED;
    }
    if (pst->selector != ODU_SELECTOR_LWLC) {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&CellSrchRsp,
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&CellSrchRsp,
                   sizeof(CtfPeriodicRemCellSearchRsp))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       /* ctf_c_001.main_3 Compilation warning fix with g++ */
@@ -7144,7 +7144,7 @@ Buffer *mBuf
    }
   else if (pst->selector == ODU_SELECTOR_LC)
       if (cmUnpkCtfPerRemCellSrch(CellSrchRsp, mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)CellSrchRsp,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)CellSrchRsp,
             sizeof(CtfPeriodicRemCellSearchRsp));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
index 1784166..94e294a 100755 (executable)
@@ -187,7 +187,7 @@ uint8_t cmPkRlcDatReq(Pst * pst,RlcDatReqInfo* datReq,Buffer * mBuf)
               * the contents and pass the pointer of the allocated memory. The
               * subsequent free would be done during the Unpack function of the
               * primitive. */
-            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datReqInfo,
+            if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&datReqInfo,
                         sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY)) != ROK)
             {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -226,7 +226,7 @@ uint8_t cmPkRlcDatReq(Pst * pst,RlcDatReqInfo* datReq,Buffer * mBuf)
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
            if(pst->srcEnt == ENTNH)
            {
-              if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
+              if (SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)datReq,
                        sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY) != ROK)
               {
                  SPutMsg(mBuf);
@@ -316,7 +316,7 @@ uint8_t cmPkRlcDatReq(Pst * pst,RlcDatReqInfo* datReq,Buffer * mBuf)
       ret1 = SPstTsk(pst,mBuf);
       if(pst->selector == ODU_SELECTOR_LC)
       {
-         if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
+         if (SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)datReq,
                   sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY) != ROK)
          {
             SPutMsg(mBuf);
@@ -370,7 +370,7 @@ uint8_t cmPkKwuDatInd(Pst * pst,KwuDatIndInfo* datInd,Buffer * mBuf)
               * the contents and pass the pointer of the allocated memory. The
               * subsequent free would be done during the Unpack function of the
               * primitive. */
-            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datIndInfo,
+            if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&datIndInfo,
                         sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY)) != ROK)
             {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -471,7 +471,7 @@ S16 cmPkKwuDatCfm(Pst * pst,SuId suId,KwuDatCfmInfo* datCfm)
 #else
             cmPkKwuDatCfmInfo( (datCfm), mBuf);
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-            if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datCfm,
+            if (SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)datCfm,
                      sizeof(KwuDatCfmInfo),SS_SHARABLE_MEMORY) != ROK)
             {
                SPutMsg(mBuf);
@@ -518,7 +518,7 @@ S16 cmPkKwuDiscSduReq(Pst * pst,SpId spId,KwuDiscSduInfo* discSdu)
              * the contents and pass the pointer of the allocated memory. The
              * subsequent free would be done during the Unpack function of the
              * primitive. */
-           if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSduInfo,
+           if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&discSduInfo,
                        sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
            {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -633,7 +633,7 @@ S16 cmPkKwuStaInd(Pst * pst,SuId suId,KwuStaIndInfo* staInd)
 #else
              cmPkKwuStaIndInfo( (staInd), mBuf);
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-             if (SPutStaticBuffer(pst->region, pst->pool, (Data *)staInd,
+             if (SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd,
                       sizeof(KwuStaIndInfo),SS_SHARABLE_MEMORY) != ROK)
              {
                 SPutMsg(mBuf);
@@ -740,7 +740,7 @@ S16 cmPkKwuDiscSduCfm(Pst *pst,SpId spId,KwuDiscSduInfo *discCfmSdu)
 #else
             cmPkKwuDiscSduInfo((discCfmSdu), mBuf);
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-            if (SPutStaticBuffer(pst->region, pst->pool, (Data *)discCfmSdu,
+            if (SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)discCfmSdu,
                      sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY) != ROK)
             {
                SPutMsg(mBuf);
@@ -773,7 +773,7 @@ S16 cmPkKwuFlowCntrlInd(Pst *pst,SuId suId,KwuFlowCntrlIndInfo *flowCntrlIndInfo
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      SPutStaticBuffer(pst->region, 
+      SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, 
                pst->pool, 
                (Data *)flowCntrlIndInfo,
                sizeof(KwuFlowCntrlIndInfo),0);
@@ -786,7 +786,7 @@ S16 cmPkKwuFlowCntrlInd(Pst *pst,SuId suId,KwuFlowCntrlIndInfo *flowCntrlIndInfo
       {
          cmPkKwuFlowCntrlIndInfo((flowCntrlIndInfo), mBuf);
 
-         if (SPutStaticBuffer(pst->region, 
+         if (SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, 
                       pst->pool, 
                       (Data *)flowCntrlIndInfo,
                       sizeof(KwuFlowCntrlIndInfo),0) != ROK)
@@ -844,7 +844,7 @@ S16 cmPkKwuDatAckInd(Pst * pst,SuId suId,KwuDatAckInfo* datInd)
       return ( ret1 );
    }
 #endif /*  ERRCLASS & ERRCLS_ADD_RES  */
-   if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
+   if (SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)datInd,
             sizeof(KwuDatAckInfo),SS_SHARABLE_MEMORY) != ROK)
    {
       SPutMsg(mBuf);
@@ -986,7 +986,7 @@ S16 cmUnpkKwuDatReq(KwuDatReq func,Pst *pst,Buffer *mBuf)
     * free the memory here. */
    if(pst->selector == ODU_SELECTOR_LWLC)
    {
-      retVal = SPutStaticBuffer(pst->region, pst->pool, (Data *)datReq,
+      retVal = SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)datReq,
             sizeof(RlcDatReqInfo),SS_SHARABLE_MEMORY);
    }
    return (retVal);
@@ -1026,7 +1026,7 @@ uint8_t cmUnpkKwuDatInd(KwuDatInd func,Pst *pst,Buffer *mBuf)
              * doesn't free any memory */
             if(pst->dstEnt != ENTPJ)
             {
-               if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datInd,
+               if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&datInd,
                            sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY)) != ROK)
                {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1070,7 +1070,7 @@ uint8_t cmUnpkKwuDatInd(KwuDatInd func,Pst *pst,Buffer *mBuf)
      * free the memory here. */
     if((pst->selector == ODU_SELECTOR_LWLC) && (pst->dstEnt == ENTPJ))
     {
-       retVal = SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
+       retVal = SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)datInd,
                 sizeof(KwuDatIndInfo),SS_SHARABLE_MEMORY);
     }
     return (retVal);
@@ -1113,7 +1113,7 @@ S16 cmUnpkKwuDatCfm(KwuDatCfm func,Pst *pst,Buffer *mBuf)
          break;
       case ODU_SELECTOR_LC:
          {
-            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datCfm,\
+            if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&datCfm,\
                         sizeof(KwuDatCfmInfo),SS_SHARABLE_MEMORY)) != ROK)
             {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1174,7 +1174,7 @@ S16 cmUnpkKwuDiscSduReq(KwuDiscSduReq func,Pst *pst,Buffer *mBuf)
          break;
       case ODU_SELECTOR_LC:
          {
-            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSdu,\
+            if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&discSdu,\
                         sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
             {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1249,7 +1249,7 @@ S16 cmUnpkKwuStaInd(KwuStaInd func,Pst *pst,Buffer *mBuf)
          break;
       case ODU_SELECTOR_LC:
          {
-            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&staInd,\
+            if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&staInd,\
                         sizeof(KwuStaIndInfo),SS_SHARABLE_MEMORY)) != ROK)
             {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1349,7 +1349,7 @@ S16 cmUnpkKwuDiscSduCfm(KwuDiscSduCfm  func,Pst *pst,Buffer *mBuf)
          break;
       case ODU_SELECTOR_LC:
          {
-            if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&discSdu,\
+            if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&discSdu,\
                         sizeof(KwuDiscSduInfo),SS_SHARABLE_MEMORY)) != ROK)
             {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -1400,7 +1400,7 @@ S16 cmUnpkKwuFlowCntrlInd(KwuFlowCntrlInd func,Pst *pst,Buffer *mBuf)
 #ifdef LCKWU
       case ODU_SELECTOR_LC:
       {
-         if(SGetStaticBuffer(pst->region, 
+         if(SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, 
                      pst->pool, 
                      (Data **)&flowCntrlInfo,
                      sizeof(KwuFlowCntrlIndInfo),0) != ROK)
@@ -1444,7 +1444,7 @@ S16 cmUnpkKwuDatAckInd(KwuDatAckInd func,Pst *pst,Buffer *mBuf)
     KwuDatAckInfo *datInd = NULLP;
     
 
-    if((ret1 = SGetStaticBuffer(pst->region, pst->pool, (Data **)&datInd,\
+    if((ret1 = SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&datInd,\
                 sizeof(KwuDatAckInfo),SS_SHARABLE_MEMORY)) != ROK)
     {
 #if (ERRCLASS & ERRCLS_ADD_RES)
index 5b27df7..501936d 100755 (executable)
@@ -53,8 +53,7 @@ typedef struct tSL2UeStatsCb
 }TSL2UeStatsCb;
 
 Void TSL2AllocStatsMem ARGS((
- Region region,
- Pool   pool
+  Inst inst
 ));
 TSL2UeStatsCb* TSL2AllocUeStatsBlk ARGS((
  uint16_t   rnti
index 25ebfd0..9cf66a3 100755 (executable)
@@ -2219,7 +2219,7 @@ RlcL2MeasReqEvt *measReqEvt
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
       return RFAILED;
    }       
    if (cmPkRlcL2MeasReqInfo(&measReqEvt->measReq, mBuf) != ROK) {
@@ -2228,7 +2228,7 @@ RlcL2MeasReqEvt *measReqEvt
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -2238,7 +2238,7 @@ RlcL2MeasReqEvt *measReqEvt
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -2248,7 +2248,7 @@ RlcL2MeasReqEvt *measReqEvt
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -2370,7 +2370,7 @@ Buffer *mBuf
    }
    if (cmUnpkRlcL2MeasReqInfo(&measReqEvt.measReq, mBuf) != ROK) 
    {
-      /*SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));*/
+      /*SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));*/
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -2395,7 +2395,7 @@ Buffer *mBuf
 
 
 
-   if((ret = SGetSBuf(pst->region, pst->pool, (Data **)&measReqEvt,\
+   if((ret = SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&measReqEvt,\
                sizeof(RlcL2MeasReqEvt))) != ROK)
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -2426,7 +2426,7 @@ Buffer *mBuf
    }
    if (cmUnpkRlcL2MeasReqInfo(&measReqEvt->measReq, mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReqEvt, sizeof(RlcL2MeasReqEvt));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -2529,7 +2529,7 @@ RlcL2MeasCfmEvt *measCfmEvt
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERRLKW, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)measCfmEvt, sizeof(RlcL2MeasCfmEvt));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measCfmEvt, sizeof(RlcL2MeasCfmEvt));
       return RFAILED;
    }
 
index 38642db..1b6dcfc 100755 (executable)
@@ -2327,7 +2327,7 @@ Buffer *mBuf
                CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
                if (param->s.sysId.ptNmb != NULLP)
                {
-                  SPutSBuf(pst->region, pst->pool, 
+                  SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, 
                         (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
                }
             }
@@ -2335,7 +2335,7 @@ Buffer *mBuf
             if (param->s.sysId.ptNmb != NULLP)
             {
                  CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
-                 SPutSBuf(pst->region, pst->pool, (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
+                 SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
             }
 
 #endif /*end of LRG_V1 */
@@ -2383,7 +2383,7 @@ Buffer *mBuf
             if (pst->event == EVTLRGSSTACFM)
             {
                /* After Merging */
-               if((SGetSBuf(pst->region, pst->pool, (Data **)&param->s.sysId.ptNmb,
+               if((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&param->s.sysId.ptNmb,
                            LRG_MAX_PT_NUM_SIZE)) != ROK){
 #if (ERRCLASS & ERRCLS_ADD_RES)
                   SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
index ec4c91d..495fc64 100644 (file)
@@ -1610,7 +1610,6 @@ uint8_t MacProcSchCellCfg(Pst *pst, SchCellCfg  *schCellCfg);
 uint8_t MacProcSchCellCfgCfm(Pst *pst, SchCellCfgCfm  *schCellCfgCfm);
 uint8_t SchHdlCellCfgReq(Pst *pst, SchCellCfg *schCellCfg);
 uint8_t schActvInit(Ent entity, Inst instId, Region region, Reason reason);
-uint8_t SchSendCfgCfm(Pst *pst, RgMngmt *cfm);
 uint8_t MacProcUlSchInfo(Pst *pst, UlSchedInfo *ulSchedInfo);
 uint8_t packMacSchRachInd(Pst *pst, RachIndInfo *rachInd);
 uint8_t MacSchRachInd(Pst *pst, RachIndInfo *rachInd);
index 0471a67..9857653 100755 (executable)
@@ -284,20 +284,20 @@ RgmPrbRprtCfg  * prbRprtCfg
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
       return RFAILED;
    }
 
     if(oduPackPointer((PTR)prbRprtCfg, mBuf) != ROK)
     {
        SPutMsg(mBuf); 
-       SPutSBuf(pst->region, pst->pool, (Data*)prbRprtCfg, len);
+       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data*)prbRprtCfg, len);
        return RFAILED;
     }
 
    if (SPkS16(spId, mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -341,7 +341,7 @@ Buffer *mBuf
    if (oduUnpackPointer((PTR *)&prbRprtCfg, mBuf) != ROK)
    {
       SPutMsg(mBuf);
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
       return RFAILED;
    }
 
@@ -376,20 +376,20 @@ RgmPrbRprtInd  * prbRprtInd
 
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       return RFAILED;
    }
 
    if(oduPackPointer((PTR)prbRprtInd, mBuf) != ROK)
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -433,7 +433,7 @@ Buffer *mBuf
    if (oduUnpackPointer((PTR *)&prbRprtInd, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       return RFAILED;
    }
 
@@ -780,25 +780,25 @@ RgmPrbRprtCfg  * prbRprtCfg
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
       return RFAILED;
    }
 
     if(cmPkCfgPrbRprt(prbRprtCfg, mBuf) != ROK)
     {
        SPutMsg(mBuf); 
-       SPutSBuf(pst->region, pst->pool, (Data*)prbRprtCfg, len);
+       SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data*)prbRprtCfg, len);
        return RFAILED;
     }
 
    if (SPkS16(spId, mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
-   SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
 
    pst->event = (Event) EVTRGMCFGPRBRPRT;
    return (SPstTsk(pst,mBuf));
@@ -829,7 +829,7 @@ Buffer *mBuf
    SpId spId;
    RgmPrbRprtCfg *prbRprtCfg;
 
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&prbRprtCfg, sizeof(RgmPrbRprtCfg))) != ROK)
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&prbRprtCfg, sizeof(RgmPrbRprtCfg))) != ROK)
       {
          SPutMsg(mBuf);
          return RFAILED;
@@ -995,25 +995,25 @@ RgmPrbRprtInd  * prbRprtInd
 
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       return RFAILED;
    }
 
    if(cmPkPrbRprtInd(prbRprtInd, mBuf) != ROK)
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
-   SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
 
    pst->event = (Event) EVTRGMPRBRPRTIND;
    return (SPstTsk(pst,mBuf));
@@ -1132,25 +1132,25 @@ RgmTransModeInd *transModeInd
 
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-      SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
       return RFAILED;
    }
 
    if(cmPkTransModeInd(transModeInd, mBuf) != ROK)
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
-   SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
 
    pst->event = (Event) EVTRGMTRANSMODEIND;
    return (SPstTsk(pst,mBuf));
index c3c6cd1..b176d64 100755 (executable)
@@ -403,7 +403,7 @@ Buffer *mBuf
 #endif
       return RFAILED;
    }
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&cfgReqInfo,sizeof(RgrCfgReqInfo))) != ROK) {
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo,sizeof(RgrCfgReqInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -415,7 +415,7 @@ Buffer *mBuf
    memset(cfgReqInfo, 0, sizeof(RgrCfgReqInfo));
    if (pst->selector == ODU_SELECTOR_LC) 
       if (cmUnpkRgrCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, sizeof(RgrCfgReqInfo));
          SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -521,7 +521,7 @@ RgrTtiIndInfo *ttiInd
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR026, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -531,11 +531,11 @@ RgrTtiIndInfo *ttiInd
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR027, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
-   SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, sizeof(RgrTtiIndInfo));
    pst->event = (Event) EVTRGRTTIIND;
    return (SPstTsk(pst,mBuf));
 }
@@ -576,7 +576,7 @@ Buffer *mBuf
 #endif
       return RFAILED;
    }
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&ttiInd, sizeof(RgrTtiIndInfo))) != ROK) 
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ttiInd, sizeof(RgrTtiIndInfo))) != ROK) 
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -589,7 +589,7 @@ Buffer *mBuf
  
    if (cmUnpkRgrTtiIndInfo(ttiInd, mBuf) != ROK) {
       /*ccpu00114888- Memory Leak issue- Start*/
-      SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ttiInd, 
             sizeof(RgrTtiIndInfo));
       /*ccpu00114888- Memory Leak issue- End*/
       SPutMsg(mBuf);
@@ -7765,7 +7765,7 @@ RgrSiCfgReqInfo * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR045, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
                  sizeof(RgrSiCfgReqInfo));
       return RFAILED;
    }
@@ -7775,7 +7775,7 @@ RgrSiCfgReqInfo * cfgReqInfo
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR046, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
                 sizeof(RgrSiCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -7786,7 +7786,7 @@ RgrSiCfgReqInfo * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR047, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
                sizeof(RgrSiCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -7797,12 +7797,12 @@ RgrSiCfgReqInfo * cfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR048, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
                sizeof(RgrSiCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
-   if (SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
                sizeof(RgrSiCfgReqInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -7863,7 +7863,7 @@ Buffer *mBuf
 #endif
       return RFAILED;
    }
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&cfgReqInfo,
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&cfgReqInfo,
             sizeof(RgrSiCfgReqInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -7876,7 +7876,7 @@ Buffer *mBuf
    memset(cfgReqInfo, 0, sizeof(RgrSiCfgReqInfo));
    if (pst->selector == ODU_SELECTOR_LC) 
       if (cmUnpkRgrSiCfgReqInfo(cfgReqInfo, mBuf) != ROK) {
-         SPutSBuf(pst->region, pst->pool, (Data *)cfgReqInfo, 
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)cfgReqInfo, 
                           sizeof(RgrSiCfgReqInfo));
          SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -8028,7 +8028,7 @@ RgrWarningSiCfgReqInfo * warningSiCfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR061, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
                  sizeof(RgrWarningSiCfgReqInfo));
       return RFAILED;
    }
@@ -8040,7 +8040,7 @@ RgrWarningSiCfgReqInfo * warningSiCfgReqInfo
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR062, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
                 sizeof(RgrWarningSiCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -8053,7 +8053,7 @@ RgrWarningSiCfgReqInfo * warningSiCfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR063, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
                sizeof(RgrWarningSiCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -8066,7 +8066,7 @@ RgrWarningSiCfgReqInfo * warningSiCfgReqInfo
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR064, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
                sizeof(RgrWarningSiCfgReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -8074,7 +8074,7 @@ RgrWarningSiCfgReqInfo * warningSiCfgReqInfo
 
    /* if the application wants to retain this structure, the below 
     * code should be removed */
-   if (SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
                sizeof(RgrWarningSiCfgReqInfo)) != ROK) 
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -8141,7 +8141,7 @@ Buffer *mBuf
       return RFAILED;
    }
 
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&warningSiCfgReqInfo,
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&warningSiCfgReqInfo,
             sizeof(RgrWarningSiCfgReqInfo))) != ROK) 
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -8158,7 +8158,7 @@ Buffer *mBuf
    {
       if (cmUnpkRgrWarningSiCfgReqInfo(pst, warningSiCfgReqInfo, mBuf) != ROK) 
       {
-         SPutSBuf(pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)warningSiCfgReqInfo, 
                           sizeof(RgrWarningSiCfgReqInfo));
          SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -8227,7 +8227,7 @@ Buffer *mBuf
          SPutMsg(pdu->pdu);
       }
       cmLListDelFrm(&param->siPduLst, node);
-      SPutSBuf(pst->region, pst->pool, (Data *)node, sizeof(RgrSegmentInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)node, sizeof(RgrSegmentInfo));
       node= prevNode;
    }
    CMCHKPK(oduUnpackUInt32, count, mBuf);
@@ -8288,7 +8288,7 @@ Buffer *mBuf
       {
          return RFAILED;
       }
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&node,
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&node,
                   sizeof(CmLList))) != ROK)
          return RFAILED;
       node->node = (PTR)pdu;
@@ -8618,7 +8618,7 @@ RgrLoadInfReqInfo * loadInfReq
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR045, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
                  sizeof(RgrLoadInfReqInfo));
       return RFAILED;
    }
@@ -8628,7 +8628,7 @@ RgrLoadInfReqInfo * loadInfReq
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR046, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
                 sizeof(RgrLoadInfReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -8639,7 +8639,7 @@ RgrLoadInfReqInfo * loadInfReq
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR047, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
                sizeof(RgrLoadInfReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -8650,12 +8650,12 @@ RgrLoadInfReqInfo * loadInfReq
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR048, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
                sizeof(RgrLoadInfReqInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
-   if (SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq, 
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
                sizeof(RgrLoadInfReqInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -8718,7 +8718,7 @@ Buffer *mBuf
       return RFAILED;
    }
 
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&loadInfReq,
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&loadInfReq,
             sizeof(RgrLoadInfReqInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -8733,7 +8733,7 @@ Buffer *mBuf
 
    if (pst->selector == ODU_SELECTOR_LC) 
       if (cmUnpkRgrLoadInfReqInfo(loadInfReq, mBuf) != ROK) {
-         SPutSBuf(pst->region, pst->pool, (Data *)loadInfReq, 
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfReq, 
                           sizeof(RgrLoadInfReqInfo));
          SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -8900,7 +8900,7 @@ RgrStaIndInfo* staInd
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR054, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, 
                sizeof(RgrStaIndInfo));
       return RFAILED;
    }
@@ -8912,7 +8912,7 @@ RgrStaIndInfo* staInd
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR055, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RgrStaIndInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, sizeof(RgrStaIndInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
@@ -8924,13 +8924,13 @@ RgrStaIndInfo* staInd
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR056, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, 
                   sizeof(RgrStaIndInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
-   if (SPutSBuf(pst->region, pst->pool, (Data *)staInd, 
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd, 
                   sizeof(RgrStaIndInfo)) != ROK) 
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -8983,7 +8983,7 @@ Buffer *mBuf
       return RFAILED;
    }
 
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&staInd,
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&staInd,
                  sizeof(RgrStaIndInfo))) != ROK)
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -8997,7 +8997,7 @@ Buffer *mBuf
 
    if (cmUnpkRgrStaIndInfo(staInd, mBuf) != ROK)
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)staInd,
              sizeof(RgrStaIndInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -9299,7 +9299,7 @@ RgrLoadInfIndInfo* loadInfInd
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR054, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfInd,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
             sizeof(RgrLoadInfIndInfo));
       return RFAILED;
    }
@@ -9311,7 +9311,7 @@ RgrLoadInfIndInfo* loadInfInd
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR055, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfInd,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
             sizeof(RgrLoadInfIndInfo));
       SPutMsg(mBuf);
 
@@ -9325,13 +9325,13 @@ RgrLoadInfIndInfo* loadInfInd
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR056, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfInd,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
             sizeof(RgrLoadInfIndInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
-   if (SPutSBuf(pst->region, pst->pool, (Data *)loadInfInd,
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
                   sizeof(RgrLoadInfIndInfo)) != ROK)
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -9383,7 +9383,7 @@ Buffer *mBuf
       return RFAILED;
    }
 
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&loadInfInd,
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&loadInfInd,
                  sizeof(RgrLoadInfIndInfo))) != ROK)
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -9398,7 +9398,7 @@ Buffer *mBuf
    /* dsfr_pal_fixes ** 22-March-2013 ** SKS */
    if (cmUnpkRgrLoadInfIndInfo(loadInfInd, pst, mBuf) != ROK)
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)loadInfInd,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)loadInfInd,
              sizeof(RgrLoadInfIndInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -9504,7 +9504,7 @@ Buffer *mBuf
          /* Length */
          CMCHKUNPK(oduPackUInt16, &tknStr->len, mBuf);
 
-         if ((SGetSBuf(pst->region, pst->pool, (Data **)&tknStr->val,tknStr->len)) != ROK) {
+         if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&tknStr->val,tknStr->len)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)
             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -10026,7 +10026,7 @@ RgrUeStaIndInfo* ueStaInd
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR054, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueStaInd, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
                sizeof(RgrUeStaIndInfo));
       return RFAILED;
    }
@@ -10038,7 +10038,7 @@ RgrUeStaIndInfo* ueStaInd
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGR055, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueStaInd, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
                sizeof(RgrUeStaIndInfo));
       SPutMsg(mBuf);
       return RFAILED;
@@ -10051,13 +10051,13 @@ RgrUeStaIndInfo* ueStaInd
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGR056, (ErrVal)0, "Packing failed");
 #endif
-      SPutSBuf(pst->region, pst->pool, (Data *)ueStaInd, 
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
                   sizeof(RgrUeStaIndInfo));
       SPutMsg(mBuf);
       return RFAILED;
    }
 
-   if (SPutSBuf(pst->region, pst->pool, (Data *)ueStaInd, 
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd, 
                   sizeof(RgrUeStaIndInfo)) != ROK) 
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -10110,7 +10110,7 @@ Buffer *mBuf
       return RFAILED;
    }
 
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&ueStaInd,
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&ueStaInd,
                  sizeof(RgrUeStaIndInfo))) != ROK)
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)
@@ -10124,7 +10124,7 @@ Buffer *mBuf
 
    if (cmUnpkRgrUeStaIndInfo(ueStaInd, mBuf) != ROK)
    {
-      SPutSBuf(pst->region, pst->pool, (Data *)ueStaInd,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)ueStaInd,
              sizeof(RgrUeStaIndInfo));
       SPutMsg(mBuf);
 #if (ERRCLASS & ERRCLS_ADD_RES)
index 604f955..5a2653b 100755 (executable)
@@ -453,7 +453,7 @@ RguL2MUlThrpMeasReqInfo* measReq
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU049, (ErrVal)0, "Packing failed");
 #endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)measReq, sizeof(RguL2MUlThrpMeasReqInfo));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReq, sizeof(RguL2MUlThrpMeasReqInfo));
       return RFAILED;
    }
    if (pst->selector == ODU_SELECTOR_LWLC)
@@ -468,12 +468,12 @@ RguL2MUlThrpMeasReqInfo* measReq
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU050, (ErrVal)0, "Packing failed");
 #endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReq, 
                                     sizeof(RguL2MUlThrpMeasReqInfo));
          SPutMsg(mBuf);
          return RFAILED;
       }
-      if (SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
+      if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReq, 
                            sizeof(RguL2MUlThrpMeasReqInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -494,7 +494,7 @@ RguL2MUlThrpMeasReqInfo* measReq
 #endif      
       if (measReq != NULLP)
       {
-         SPutSBuf(pst->region, pst->pool, (Data *)measReq,
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReq,
                              sizeof(RguL2MUlThrpMeasReqInfo));
       }
       SPutMsg(mBuf);
@@ -547,7 +547,7 @@ Buffer *mBuf
    }
    else 
    {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&measReq,
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&measReq,
                               sizeof(RguL2MUlThrpMeasReqInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
@@ -564,7 +564,7 @@ Buffer *mBuf
              (ErrVal)ERGU055, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)measReq, 
                                 sizeof(RguL2MUlThrpMeasReqInfo));
          return RFAILED;
       }
@@ -605,9 +605,9 @@ RguHarqStatusInd  *harqStatusInd
    RguHarqStatusInd *harqStaInd = NULL;
 
 #ifdef XEON_SPECIFIC_CHANGES
-   if (SGetSBuf(pst->region, pst->pool, (Data **)&harqStaInd, sizeof(RguHarqStatusInd)) != ROK)
+   if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&harqStaInd, sizeof(RguHarqStatusInd)) != ROK)
 #else      
-   if ((SGetStaticBuffer(pst->region, pst->pool, 
+   if ((SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, 
                (Data **)&harqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
 #endif      
    {
@@ -628,9 +628,9 @@ RguHarqStatusInd  *harqStatusInd
             (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
 #endif
 #ifdef XEON_SPECIFIC_CHANGES
-      SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd));
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd));
 #else      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
+      SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
 #endif      
       return RFAILED;
    }
@@ -660,21 +660,21 @@ RguHarqStatusInd  *harqStatusInd
           (ErrVal)ERGU071, (ErrVal)0, "Packing failed");
 #endif
 #ifdef XEON_SPECIFIC_CHANGES
-      SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
+      SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)harqStaInd,
               sizeof(RguHarqStatusInd));
 #else      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
+      SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
 #endif      
       SPutMsg(mBuf);
       return RFAILED;
    }
 #ifdef XEON_SPECIFIC_CHANGES
-   if (SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
+   if (SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)harqStaInd,
             sizeof(RguHarqStatusInd)) != ROK) {
 #else   
    if (pst->selector != ODU_SELECTOR_LWLC)
    {
-      if(SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, 
+      if(SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)harqStaInd, 
                sizeof(RguHarqStatusInd), 0) != ROK)
       {
 #endif         
@@ -729,7 +729,7 @@ Buffer *mBuf
       return RFAILED;
    }
 #ifdef XEON_SPECIFIC_CHANGES
-   if ((SGetSBuf(pst->region, pst->pool, (Data **)&hqStaInd, 
+   if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&hqStaInd, 
         sizeof(RguHarqStatusInd))) != ROK) {
 #else   
    if (pst->selector == ODU_SELECTOR_LWLC)
@@ -738,7 +738,7 @@ Buffer *mBuf
    }  
    else
    {   
-      if ((SGetStaticBuffer(pst->region, pst->pool, 
+      if ((SGetStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, 
                   (Data **)&hqStaInd, sizeof(RguHarqStatusInd),0)) != ROK)
       {
 #endif         
@@ -767,9 +767,9 @@ Buffer *mBuf
    SPutMsg(mBuf);
    (*func)(pst, suId, hqStaInd);
 #ifdef XEON_SPECIFIC_CHANGES
-   SPutSBuf(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd));
+   SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd));
 #else   
-   SPutStaticBuffer(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
+   SPutStaticBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
 #endif   
    return ROK;
 }
@@ -972,7 +972,7 @@ Buffer *mBuf
    }
    else 
    {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&flowCntrlInd, sizeof(RguFlowCntrlInd))) != ROK) {
+      if ((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&flowCntrlInd, sizeof(RguFlowCntrlInd))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -988,7 +988,7 @@ Buffer *mBuf
              (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)flowCntrlInd, sizeof(RguFlowCntrlInd));
+         SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)flowCntrlInd, sizeof(RguFlowCntrlInd));
          return RFAILED;
       }
    }
index 6c28f46..0eb2022 100644 (file)
@@ -222,6 +222,7 @@ uint8_t DuProcMacCellDeleteRsp(Pst *pst, MacCellDeleteRsp *deleteRsp)
 {
    uint8_t ret = ROK;
    uint16_t cellIdx=0;
+   
    if(deleteRsp)
    {
       if(deleteRsp->result == SUCCESSFUL_RSP)
index 5fde3ad..36a9c6c 100644 (file)
@@ -1407,160 +1407,126 @@ void FreeRrcVer(RRC_Version_t *rrcVer)
 void FreeServedCellList( GNB_DU_Served_Cells_List_t *duServedCell)
 {
    uint8_t   plmnCnt=1;
-   uint8_t  servId=0;
-   uint8_t sliceId=0;
-   uint8_t  ieId=0;
-   uint8_t   extensionCnt=1;
-   uint8_t plmnidx=0;
-   GNB_DU_Served_Cells_Item_t *srvCellItem= &duServedCell->list.array[0]->value.choice.GNB_DU_Served_Cells_Item;
+   uint8_t  sliceId=0;
+   uint8_t  extensionCnt=1;
+   uint8_t  plmnIdx=0;
+   GNB_DU_Served_Cells_Item_t *srvCellItem;
+   ServedPLMNs_Item_t  *servedPlmnItem;
+   SliceSupportItem_t  *sliceSupportItem;
+
    if(duServedCell->list.array!=NULLP)
    {
       if(duServedCell->list.array[0]!=NULLP)
       {
-        if(srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.buf!=NULLP)
-        {
-           if(srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.buf !=NULLP)
-           {
-              if(srvCellItem->served_Cell_Information.fiveGS_TAC!=NULLP)
-              {
-                 if(srvCellItem->served_Cell_Information.fiveGS_TAC->buf!=NULLP)
-                 {
-                    if(srvCellItem->served_Cell_Information.servedPLMNs.list.array!=NULLP)
-                    {
-                       if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[0]!=NULLP)
-                       {
-                          if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->pLMN_Identity.buf!=NULLP)
-                          {
-                             if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions!=NULLP)
-                             {
-                                if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array!=NULLP)
-                                {
-                                   if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]!=NULLP)
-                                   {
-                                      if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                            extensionValue.choice.SliceSupportList.list.array!=NULLP)
-                                      {
-                                         if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                               extensionValue.choice.SliceSupportList.list.array[sliceId]!= NULLP)
-                                         {
-                                            if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                                  extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sST.buf!=NULLP)
-                                            {
-                                               if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                                     extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sD!=NULLP)
-                                               {
-                                                  if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->\
-                                                        list.array[0]->extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sD->buf!=NULLP)
-                                                  {
-                                                     if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD!=NULLP)
-                                                     {
-                                                        if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
-                                                              freqBandListNr.list.array!=NULLP)
-                                                        {
-                                                           if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
-                                                                 freqBandListNr.list.array[0]!=NULLP)
-                                                           {
-                                                              if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                    freqBandListNr.list.array)
-                                                              {
-                                                                 if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                       freqBandListNr.list.array[0]!=NULLP)
-                                                                 {
-                                                                    if(srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf!=NULLP)
-                                                                    {
-                                                                       if(!srvCellItem->gNB_DU_System_Information)
-                                                                       {
-                                                                          if(srvCellItem->gNB_DU_System_Information->mIB_message.buf!=NULLP)
-                                                                          {
-                                                                             if(srvCellItem->gNB_DU_System_Information->sIB1_message.buf!=NULLP)
-                                                                             { 
-                                                                                DU_FREE(srvCellItem->gNB_DU_System_Information->sIB1_message.buf,\
-                                                                                      srvCellItem->gNB_DU_System_Information->sIB1_message.size);
-                                                                                DU_FREE(duCfgParam.srvdCellLst[0].duSysInfo.sib1Msg,\
-                                                                                      srvCellItem->gNB_DU_System_Information->sIB1_message.size);
-                                                                             }
-                                                                             DU_FREE(srvCellItem->gNB_DU_System_Information->mIB_message.buf,\
-                                                                                   srvCellItem->gNB_DU_System_Information->mIB_message.size);
-                                                                             DU_FREE(duCfgParam.srvdCellLst[0].duSysInfo.mibMsg,\
-                                                                                   strlen((char*)duCfgParam.srvdCellLst[0].duSysInfo.mibMsg));
-                                                                          }
-                                                                          DU_FREE(srvCellItem->gNB_DU_System_Information,sizeof(GNB_DU_System_Information_t));
-                                                                       }
-                                                                       DU_FREE(srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf,\
-                                                                             srvCellItem->served_Cell_Information.measurementTimingConfiguration.size);
-                                                                    }
-                                                                    DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                          freqBandListNr.list.array[0],sizeof(FreqBandNrItem_t));
-                                                                 }
-                                                                 DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                       freqBandListNr.list.array,sizeof(FreqBandNrItem_t *));
-                                                              }
-                                                              DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
-                                                                    list.array[0],sizeof(FreqBandNrItem_t));
-                                                           }
-                                                           DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
-                                                                 list.array,sizeof(FreqBandNrItem_t*));
-                                                        }
-                                                        DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD,sizeof(FDD_Info_t));
-                                                     }
-                                                     DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->\
-                                                           iE_Extensions->list.array[ieId]->extensionValue.choice.SliceSupportList.list.array[sliceId]->\
-                                                           sNSSAI.sD->buf,srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->
-                                                           list.array[ieId]->extensionValue.choice.SliceSupportList.list.array[sliceId]->sNSSAI.sD->size);
-                                                  }
-                                                  DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->\
-                                                        iE_Extensions->list.array[ieId]->extensionValue.choice.SliceSupportList.\
-                                                        list.array[sliceId]->sNSSAI.sD,sizeof(OCTET_STRING_t));
-                                               }
-                                               DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->\
-                                                     iE_Extensions->list.array[ieId]->extensionValue.choice.SliceSupportList.list.array[sliceId]->\
-                                                     sNSSAI.sST.buf,sizeof(uint8_t));
-                                            }
-                                            DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                                  extensionValue.choice.SliceSupportList.list.array[sliceId],sizeof(SliceSupportItem_t));
-                                         }
-                                         DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[servId]->iE_Extensions->list.array[0]->\
-                                               extensionValue.choice.SliceSupportList.list.array,sizeof(SliceSupportItem_t*));
-                                      }
-                                      DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                            array[servId]->iE_Extensions->list.array[plmnidx],sizeof(ServedPLMNs_ItemExtIEs_t));
-                                   }
-                                   DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                         array[servId]->iE_Extensions->list.array,\
-                                         extensionCnt*sizeof(ServedPLMNs_ItemExtIEs_t*));
-                                }
-                                DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                      array[servId]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
-                             }
-                             DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.\
-                                   array[servId]->pLMN_Identity.buf,srvCellItem->served_Cell_Information.\
-                                   servedPLMNs.list.array[servId]->pLMN_Identity.size
-                                   * sizeof(uint8_t));
-                          }
-                          DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnidx],\
-                                sizeof(ServedPLMNs_Item_t *));
-                       }
-                       DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array,\
-                             sizeof(ServedPLMNs_Item_t *));
-                    }
-                    DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC->buf,\
-                          sizeof(srvCellItem->served_Cell_Information.fiveGS_TAC->size));
-                 }
-                 DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC,sizeof(FiveGS_TAC_t));
-              }
-              DU_FREE(srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
-                    srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.size *
-                    sizeof(uint8_t));
-           }
-           DU_FREE(srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
-                 srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.size *
-                 sizeof(uint8_t));
-        }
-        DU_FREE(duServedCell->list.array[plmnidx],sizeof(GNB_DU_Served_Cells_ItemIEs_t));
+         srvCellItem= &duServedCell->list.array[0]->value.choice.GNB_DU_Served_Cells_Item;
+
+         DU_FREE(srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
+               srvCellItem->served_Cell_Information.nRCGI.pLMN_Identity.size * sizeof(uint8_t));
+         DU_FREE(srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
+               srvCellItem->served_Cell_Information.nRCGI.nRCellIdentity.size * sizeof(uint8_t));
+
+         if(srvCellItem->served_Cell_Information.fiveGS_TAC!=NULLP)
+         {
+            DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC->buf,\
+                  sizeof(srvCellItem->served_Cell_Information.fiveGS_TAC->size));
+            DU_FREE(srvCellItem->served_Cell_Information.fiveGS_TAC,sizeof(FiveGS_TAC_t));
+         }
+
+         if(srvCellItem->served_Cell_Information.servedPLMNs.list.array!=NULLP)
+         {
+            if(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx] != NULLP)
+            {
+               servedPlmnItem = srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx];
+               DU_FREE(servedPlmnItem->pLMN_Identity.buf, servedPlmnItem->pLMN_Identity.size * sizeof(uint8_t));
+
+               if(servedPlmnItem->iE_Extensions != NULLP)
+               {
+                  if(servedPlmnItem->iE_Extensions->list.array != NULLP)
+                  {
+                     if(servedPlmnItem->iE_Extensions->list.array[0] != NULLP)
+                     {
+                        if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.\
+                              array != NULLP)
+                        {
+                           if(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.list.\
+                                 array[sliceId] != NULLP)
+                           {
+                              sliceSupportItem = servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.\
+                                                 SliceSupportList.list.array[sliceId];
+
+                              DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sizeof(uint8_t));
+
+                              if(sliceSupportItem->sNSSAI.sD != NULLP)
+                              {
+                                 DU_FREE(sliceSupportItem->sNSSAI.sD->buf, sliceSupportItem->sNSSAI.sD->size);
+                                 DU_FREE(sliceSupportItem->sNSSAI.sD, sizeof(OCTET_STRING_t));
+                              }
+
+                              DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+                                    list.array[sliceId], sizeof(SliceSupportItem_t));
+                           }
+                           DU_FREE(servedPlmnItem->iE_Extensions->list.array[0]->extensionValue.choice.SliceSupportList.\
+                                 list.array, sizeof(SliceSupportItem_t*));
+                        }
+                        DU_FREE(servedPlmnItem->iE_Extensions->list.array[0], sizeof(ServedPLMNs_ItemExtIEs_t));
+                     }
+                     DU_FREE(servedPlmnItem->iE_Extensions->list.array, extensionCnt*sizeof(ServedPLMNs_ItemExtIEs_t*));
+                  }
+                  DU_FREE(servedPlmnItem->iE_Extensions, sizeof(ProtocolExtensionContainer_4624P3_t));
+               }
+               DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array[plmnIdx], sizeof(ServedPLMNs_Item_t));
+            }
+            DU_FREE(srvCellItem->served_Cell_Information.servedPLMNs.list.array, sizeof(ServedPLMNs_Item_t *));
+         }
+
+         if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD != NULLP)
+         {
+            if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.\
+                  freqBandListNr.list.array != NULLP)
+            {
+               DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
+                     list.array[0],sizeof(FreqBandNrItem_t));
+               DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.\
+                     list.array,sizeof(FreqBandNrItem_t*));
+            }
+
+            if(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
+                  freqBandListNr.list.array)
+            {
+               DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
+                     freqBandListNr.list.array[0],sizeof(FreqBandNrItem_t));
+               DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
+                     freqBandListNr.list.array,sizeof(FreqBandNrItem_t *));
+            }
+            DU_FREE(srvCellItem->served_Cell_Information.nR_Mode_Info.choice.fDD, sizeof(FDD_Info_t));
+         }
+
+         DU_FREE(srvCellItem->served_Cell_Information.measurementTimingConfiguration.buf,\
+               srvCellItem->served_Cell_Information.measurementTimingConfiguration.size);
+
+         if(srvCellItem->gNB_DU_System_Information != NULLP)
+         {
+            if(srvCellItem->gNB_DU_System_Information->mIB_message.buf != NULLP)
+            {
+               DU_FREE(srvCellItem->gNB_DU_System_Information->mIB_message.buf,\
+                     srvCellItem->gNB_DU_System_Information->mIB_message.size);
+            }
+
+            if(srvCellItem->gNB_DU_System_Information->sIB1_message.buf != NULLP)
+            { 
+               DU_FREE(srvCellItem->gNB_DU_System_Information->sIB1_message.buf,\
+                     srvCellItem->gNB_DU_System_Information->sIB1_message.size);
+            }
+
+            DU_FREE(srvCellItem->gNB_DU_System_Information, sizeof(GNB_DU_System_Information_t));
+         }
+
+         DU_FREE(duServedCell->list.array[0], sizeof(GNB_DU_Served_Cells_ItemIEs_t));
       }
-      DU_FREE(duServedCell->list.array,plmnCnt*sizeof(GNB_DU_Served_Cells_ItemIEs_t*));
+      DU_FREE(duServedCell->list.array, plmnCnt * sizeof(GNB_DU_Served_Cells_ItemIEs_t*));
    }
 }
+
 /*******************************************************************
  *
  * @brief  deallocating the memory of function BuildAndSendF1SetupReq()
@@ -1616,7 +1582,6 @@ void FreeF1SetupReq(F1AP_PDU_t *f1apMsg)
                        break;
                  }
               }
-              break;
            }
            for(ieIdx2=0; ieIdx2< ieIdx; ieIdx2++)
            {
@@ -1832,183 +1797,92 @@ uint8_t BuildAndSendF1SetupReq()
 void freeCellsToModifyItem(Served_Cells_To_Modify_Item_t *modifyItem)
 {
    uint8_t arrIdx=0,i=0;
-   if(modifyItem->oldNRCGI.pLMN_Identity.buf != NULLP)
+   ServedPLMNs_Item_t *servedPlmnItem = NULLP;
+   SliceSupportItem_t *sliceSupportItem = NULLP;
+
+   DU_FREE(modifyItem->oldNRCGI.pLMN_Identity.buf, modifyItem->oldNRCGI.pLMN_Identity.size);
+   DU_FREE(modifyItem->oldNRCGI.nRCellIdentity.buf, modifyItem->oldNRCGI.nRCellIdentity.size);
+
+   DU_FREE(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
+           modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
+   DU_FREE(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
+         modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);
+
+   if(modifyItem->served_Cell_Information.servedPLMNs.list.array != NULLP)
    {
-      if(modifyItem->oldNRCGI.nRCellIdentity.buf != NULLP)
+      if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx] != NULLP)
       {
-         if(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf != NULLP)
+         servedPlmnItem = modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx];
+
+         DU_FREE(servedPlmnItem->pLMN_Identity.buf,servedPlmnItem->pLMN_Identity.size);
+
+         if(servedPlmnItem->iE_Extensions != NULLP)
          {
-            if(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf
-                  != NULLP)
+            if(servedPlmnItem->iE_Extensions->list.array != NULLP)
             {
-               if(modifyItem->served_Cell_Information.servedPLMNs.list.array\
-                     != NULLP)
+               if(servedPlmnItem->iE_Extensions->list.array[arrIdx] != NULLP)
                {
-                  if(!modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx])
+                  if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array != NULLP)
                   {
-                     if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                           array[arrIdx]->pLMN_Identity.buf != NULLP)
+                     if(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array[arrIdx] != NULLP)
                      {
-                        if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                              array[arrIdx]->iE_Extensions!= NULLP)
-                        {
-                           if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                 array[arrIdx]->iE_Extensions->list.array != NULLP)
-                           {
-                              if(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                    array[arrIdx]->iE_Extensions->list.array[arrIdx])
-                              {
-                                 if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                       iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
-                                       list.array !=NULLP)
-                                 {
-                                    if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                          iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
-                                          list.array[arrIdx]!=NULLP)
-                                    {
-                                       if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                             iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
-                                             list.array[arrIdx]->sNSSAI.sST.buf!=NULLP)
-                                       {
-                                          if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                                iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
-                                                SliceSupportList.\
-                                                list.array[arrIdx]->sNSSAI.sD != NULLP)
-                                          {
-                                             if(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                                   iE_Extensions->list.array[arrIdx]->extensionValue.\
-                                                   choice.SliceSupportList.\
-                                                   list.array[arrIdx]->sNSSAI.sD->buf!=NULLP)
-                                             {
-                                                if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD
-                                                      !=NULLP)
-                                                {
-                                                   if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                         fDD->uL_NRFreqInfo.freqBandListNr.list.array!=NULLP)
-                                                   {
-                                                      if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                            fDD->uL_NRFreqInfo.freqBandListNr.list.array[arrIdx]!=NULLP)
-                                                      {
-                                                         if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                               fDD->dL_NRFreqInfo.freqBandListNr.list.array !=NULLP)
-                                                         {
-                                                            if(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                  choice.fDD->dL_NRFreqInfo.freqBandListNr.list.\
-                                                                  array[arrIdx]!= NULLP)
-                                                            {
-                                                               if(modifyItem->served_Cell_Information.\
-                                                                     measurementTimingConfiguration.buf !=NULLP)
-                                                               {
-                                                                  DU_FREE(modifyItem->served_Cell_Information.\
-                                                                        measurementTimingConfiguration.\
-                                                                        buf,modifyItem->served_Cell_Information.\
-                                                                        measurementTimingConfiguration.size);
-                                                               }
-                                                               DU_FREE(modifyItem->served_Cell_Information.\
-                                                                     nR_Mode_Info.choice.fDD->dL_NRFreqInfo.\
-                                                                     freqBandListNr.\
-                                                                     list.array[arrIdx],sizeof(FreqBandNrItem_t));
-                                                            }
-                                                            DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info\
-                                                                  .choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
-                                                                  modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                                  choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
-                                                         }
-                                                         DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                               choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
-                                                               array[arrIdx],sizeof(FreqBandNrItem_t));
-                                                      }
-                                                      DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                            choice.\
-                                                            fDD->uL_NRFreqInfo.freqBandListNr.list.\
-                                                            array,modifyItem->served_Cell_Information.nR_Mode_Info.\
-                                                            choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size);
-                                                   }
-                                                   DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.\
-                                                         fDD,sizeof(FDD_Info_t));
-                                                }
-                                                DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                      array[arrIdx]->iE_Extensions->list.array[arrIdx]->extensionValue.\
-                                                      choice.SliceSupportList.\
-                                                      list.array[arrIdx]->sNSSAI.sD->buf,modifyItem->\
-                                                      served_Cell_Information.\
-                                                      servedPLMNs.list.array[arrIdx]->iE_Extensions->list.\
-                                                      array[arrIdx]->\
-                                                      extensionValue.choice.SliceSupportList.list.array[arrIdx]->\
-                                                      sNSSAI.sD->size);
+                        sliceSupportItem = modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->iE_Extensions->\
+                                           list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array[arrIdx];
 
-                                             }
-                                             DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                                   array[arrIdx]->\
-                                                   iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
-                                                   SliceSupportList.\
-                                                   list.array[arrIdx]->sNSSAI.sD,sizeof(OCTET_STRING_t));
-                                          }
-                                          DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                                iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
-                                                SliceSupportList.\
-                                                list.array[arrIdx]->sNSSAI.sST.buf,modifyItem->served_Cell_Information.\
-                                                servedPLMNs.\
-                                                list.array[arrIdx]->iE_Extensions->list.array[arrIdx]->\
-                                                extensionValue.choice.\
-                                                SliceSupportList.list.array[arrIdx]->sNSSAI.sST.size);
-                                       }
-                                       DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                             iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
-                                             list.array[arrIdx],sizeof(SliceSupportItem_t));
-                                    }
-                                    DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                          iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
-                                          list.array,\
-                                          modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->\
-                                          iE_Extensions->list.array[arrIdx]->extensionValue.choice.\
-                                          SliceSupportList.list.size);
-                                 }
-                              }
-                              for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                    array[arrIdx]->iE_Extensions->list.count;i++)
-                              {
-                                 DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                       array[arrIdx]->iE_Extensions->list.array[i],\
-                                       sizeof(ServedPLMNs_ItemExtIEs_t ));
-                              }
-                              DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                    array[arrIdx]->iE_Extensions->list.array,modifyItem->served_Cell_Information.\
-                                    servedPLMNs.list.array[arrIdx]->iE_Extensions->list.size);
-                           }
-                           DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                                 array[arrIdx]->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
+                        DU_FREE(sliceSupportItem->sNSSAI.sST.buf, sliceSupportItem->sNSSAI.sST.size);
+                        if(sliceSupportItem->sNSSAI.sD != NULLP)
+                        {
+                           DU_FREE(sliceSupportItem->sNSSAI.sD->buf, sliceSupportItem->sNSSAI.sD->size);
+                           DU_FREE(sliceSupportItem->sNSSAI.sD,sizeof(OCTET_STRING_t));
                         }
-                        DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.\
-                              array[arrIdx]->pLMN_Identity.buf,
-                              modifyItem->served_Cell_Information.servedPLMNs.list.array[arrIdx]->pLMN_Identity.size);
-                     }
-                  }
-                  for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
-                  {
-                     if(modifyItem->served_Cell_Information.servedPLMNs.list.array[i]
-                           != NULLP)
-                     {
-                        DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i],\
-                              sizeof(ServedPLMNs_Item_t));
+                        DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.\
+                              list.array[arrIdx], sizeof(SliceSupportItem_t));
                      }
+                     DU_FREE(servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.array,
+                           servedPlmnItem->iE_Extensions->list.array[arrIdx]->extensionValue.choice.SliceSupportList.list.size);
                   }
-                  DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
-                        modifyItem->served_Cell_Information.servedPLMNs.list.size);
                }
-               DU_FREE(modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.buf,\
-                     modifyItem->served_Cell_Information.nRCGI.nRCellIdentity.size);
+               for(i=0; i < servedPlmnItem->iE_Extensions->list.count ; i++)
+               {
+                  DU_FREE(servedPlmnItem->iE_Extensions->list.array[i], sizeof(ServedPLMNs_ItemExtIEs_t ));
+               }
+               DU_FREE(servedPlmnItem->iE_Extensions->list.array, servedPlmnItem->iE_Extensions->list.size);
             }
-            DU_FREE(modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.buf,\
-                  modifyItem->served_Cell_Information.nRCGI.pLMN_Identity.size);
+            DU_FREE(servedPlmnItem->iE_Extensions,sizeof(ProtocolExtensionContainer_4624P3_t));
          }
-         DU_FREE(modifyItem->oldNRCGI.nRCellIdentity.buf,\
-               modifyItem->oldNRCGI.nRCellIdentity.size);
       }
-      DU_FREE(modifyItem->oldNRCGI.pLMN_Identity.buf,\
-            modifyItem->oldNRCGI.pLMN_Identity.size);  
+      for(i=0;i<modifyItem->served_Cell_Information.servedPLMNs.list.count;i++)
+      {
+         DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array[i], sizeof(ServedPLMNs_Item_t));
+      }
+      DU_FREE(modifyItem->served_Cell_Information.servedPLMNs.list.array,\
+            modifyItem->served_Cell_Information.servedPLMNs.list.size);
    }
+
+   if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD != NULLP)
+   {
+      if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array != NULLP)
+      {
+         DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.\
+               array[arrIdx], sizeof(FreqBandNrItem_t));
+         DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.array, \
+               modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->uL_NRFreqInfo.freqBandListNr.list.size);
+      }
+
+      if(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array != NULLP)
+      {
+         DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.\
+             array[arrIdx], sizeof(FreqBandNrItem_t));
+         DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.array,\
+               modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD->dL_NRFreqInfo.freqBandListNr.list.size);
+      }
+      DU_FREE(modifyItem->served_Cell_Information.nR_Mode_Info.choice.fDD,sizeof(FDD_Info_t));
+   }
+
+   DU_FREE(modifyItem->served_Cell_Information.measurementTimingConfiguration.buf,\
+      modifyItem->served_Cell_Information.measurementTimingConfiguration.size);
 }
+
 /*******************************************************************
  *
  * @brief Deallocating memory of BuildAndSendDUConfigUpdate
@@ -2094,7 +1968,7 @@ void FreeDUConfigUpdate(F1AP_PDU_t *f1apDuCfg)
 
                            break;
                         }
-                     case GNBDUConfigurationUpdateIEs__value_PR_GNB_DU_ID:
+                     case ProtocolIE_ID_id_gNB_DU_ID:
                         {
                            DU_FREE(duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.buf,\
                                  duCfgUpdate->protocolIEs.list.array[ieIdx]->value.choice.GNB_DU_ID.size);
@@ -6247,48 +6121,44 @@ void freeRlcLcCfg(RlcBearerCfg *lcCfg)
    switch(lcCfg->rlcMode)
    {
       case RLC_AM :
-      {
-         if(lcCfg->u.amCfg)
-        {
-            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
-            lcCfg->u.amCfg = NULLP;
-        }
-         break;
-      }
+         {
+            if(lcCfg->u.amCfg)
+            {
+               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.amCfg, sizeof(AmBearerCfg));
+            }
+            break;
+         }
       case RLC_UM_BI_DIRECTIONAL :
-      {
-         if(lcCfg->u.umBiDirCfg)
-        {
-            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
-           lcCfg->u.umBiDirCfg = NULLP;
+         {
+            if(lcCfg->u.umBiDirCfg)
+            {
+               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umBiDirCfg, sizeof(UmBiDirBearerCfg));
+            }
+            break;
          }
-         break;
-      }
       case RLC_UM_UNI_DIRECTIONAL_UL :
-      {
-         if(lcCfg->u.umUniDirUlCfg)
-        {
-            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
-           lcCfg->u.umUniDirUlCfg = NULLP;
-        }
-         break;
+         {
+            if(lcCfg->u.umUniDirUlCfg)
+            {
+               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirUlCfg, sizeof(UmUniDirUlBearerCfg));
+            }
+            break;
 
-      }
+         }
       case RLC_UM_UNI_DIRECTIONAL_DL :
-      {
-         if(lcCfg->u.umUniDirDlCfg)
-        {
-            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
-           lcCfg->u.umUniDirDlCfg = NULLP;
+         {
+            if(lcCfg->u.umUniDirDlCfg)
+            {
+               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->u.umUniDirDlCfg, sizeof(UmUniDirDlBearerCfg));
+            }
+            break;
          }
-         break;
-      }
       default:
          DU_LOG("\nERROR  -->  DU_APP: Invalid Rlc Mode %d at freeRlcLcCfg()", lcCfg->rlcMode);
-        break;
+         break;
    }
-   memset(lcCfg, 0, sizeof(LcCfg));
 }
+
 /*******************************************************************
  *
  * @brief Function to free MacLcCfg
@@ -6310,15 +6180,12 @@ void  freeMacLcCfg(LcCfg *lcCfg)
    if(lcCfg->drbQos)
    {
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo));
-      lcCfg->drbQos = NULLP;
    }
    /* Deleting SNSSAI */
    if(lcCfg->snssai)
    {
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->snssai, sizeof(Snssai));
-      lcCfg->snssai = NULLP;
    }
-   memset(lcCfg, 0, sizeof(LcCfg));
 }
 /*******************************************************************
  *
@@ -7045,7 +6912,6 @@ void freeDuUeCfg(DuUeCfg *ueCfg)
    }
    if(ueCfg->ambrCfg)
    {
-      memset(ueCfg->ambrCfg, 0, sizeof(AmbrCfg));
       DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, ueCfg->ambrCfg, sizeof(AmbrCfg));
    }
    for(lcIdx = 0; lcIdx < ueCfg->numRlcLcs; lcIdx++)
@@ -7059,7 +6925,6 @@ void freeDuUeCfg(DuUeCfg *ueCfg)
    for(lcIdx = 0; lcIdx < ueCfg->numDrb; lcIdx++)
    {
       DU_FREE(ueCfg->upTnlInfo[lcIdx].tnlCfg1, sizeof(GtpTnlCfg));
-      memset(&ueCfg->upTnlInfo[lcIdx], 0, sizeof(UpTnlCfg));
    }
 }
 
@@ -10394,9 +10259,18 @@ void freeDlTnlInfo(DLUPTNLInformation_ToBeSetup_List_t *tnlInfo)
 {
    uint8_t arrIdx = 0;
 
-   for(arrIdx=0; arrIdx < tnlInfo->list.count; arrIdx++)
+   if(tnlInfo)
    {
-      DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel, sizeof(GTPTunnel_t));
+      for(arrIdx=0; arrIdx < tnlInfo->list.count; arrIdx++)
+      {
+         DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->transportLayerAddress.buf,\
+               tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->transportLayerAddress.size);
+         DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->gTP_TEID.buf,\
+               tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel->gTP_TEID.size);
+         DU_FREE(tnlInfo->list.array[arrIdx]->dLUPTNLInformation.choice.gTPTunnel, sizeof(GTPTunnel_t));
+         DU_FREE(tnlInfo->list.array[arrIdx], sizeof(DLUPTNLInformation_ToBeSetup_Item_t));
+      }
+      DU_FREE(tnlInfo->list.array, tnlInfo->list.size);
    }
 }
 
@@ -10423,7 +10297,9 @@ void freeDrbSetupList(DRBs_Setup_List_t *drbSetupList)
    {
       drbItemIe = ((DRBs_Setup_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
       freeDlTnlInfo(&drbItemIe->value.choice.DRBs_Setup_Item.dLUPTNLInformation_ToBeSetup_List);
+      DU_FREE(drbSetupList->list.array[arrIdx],  sizeof(DRBs_Setup_Item_t));
    }
+   DU_FREE(drbSetupList->list.array, drbSetupList->list.size);
 }
 
 /*******************************************************************
@@ -12169,7 +12045,9 @@ void FreeDrbSetupModList(DRBs_SetupMod_List_t *drbSetupList)
    {
       drbItemIe = ((DRBs_SetupMod_ItemIEs_t *)drbSetupList->list.array[arrIdx]);
       freeDlTnlInfo(&drbItemIe->value.choice.DRBs_SetupMod_Item.dLUPTNLInformation_ToBeSetup_List);
+      DU_FREE(drbSetupList->list.array[arrIdx], sizeof(DRBs_SetupMod_ItemIEs_t));
    }
+   DU_FREE(drbSetupList->list.array, drbSetupList->list.size);
 }
 /*******************************************************************
 * @brief Free the memory allocated for UE Context Mod Response
index 4eb2a67..edca41d 100644 (file)
@@ -14,7 +14,7 @@
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
- *******************************************************************************/
+*******************************************************************************/
 /* This file contains UE management handling functionality for DU APP */
 #include "common_def.h"
 #include "lrg.h"
@@ -946,69 +946,73 @@ void fillMacSrb1LcCfg(LcCfg *macLcCfg)
  *
  *****************************************************************/
 
-uint8_t fillMacLcCfgToAddMod(LcCfg *lcCfg, LcCfg *ueSetReqDb)
+uint8_t fillMacLcCfgToAddMod(LcCfg *macLcCfgToSend, LcCfg *ueLcCfgDb, LcCfg *oldLcCfg, Bool toUpdate)
 {
-   uint8_t ret = ROK; 
-   lcCfg->lcId = ueSetReqDb->lcId;
-   lcCfg->configType = ueSetReqDb->configType;
-   /* Filling DRBQOS */
-   if(ueSetReqDb->drbQos)
+   if(!toUpdate)
    {
-      if(!lcCfg->drbQos)
+      if(macLcCfgToSend)
       {
-         DU_ALLOC_SHRABL_BUF(lcCfg->drbQos, sizeof(DrbQosInfo));
-         if(!lcCfg->drbQos)
-         { 
-            DU_LOG("\nERROR  -->  DU APP : Memory Alloc failed at drQos at fillMacLcCfgToAddMod()");
-            return RFAILED;
-         }
-      }
-      if(ret == ROK)
-      {
-         memcpy(lcCfg->drbQos, ueSetReqDb->drbQos, sizeof(DrbQosInfo));
+         macLcCfgToSend->lcId = ueLcCfgDb->lcId;
+         macLcCfgToSend->configType = ueLcCfgDb->configType;
+
+         if(ueLcCfgDb->drbQos)
+            macLcCfgToSend->drbQos = ueLcCfgDb->drbQos;
+         else if(oldLcCfg)
+            macLcCfgToSend->drbQos = oldLcCfg->drbQos;
+         else
+            macLcCfgToSend->drbQos = NULL;
+
+         if(ueLcCfgDb->snssai)
+            macLcCfgToSend->snssai = ueLcCfgDb->snssai;
+         else if(oldLcCfg)
+            macLcCfgToSend->snssai = oldLcCfg->snssai;
+         else
+            macLcCfgToSend->snssai = NULL;
+
+         macLcCfgToSend->ulLcCfgPres = ueLcCfgDb->ulLcCfgPres;
+         memcpy(&macLcCfgToSend->ulLcCfg, &ueLcCfgDb->ulLcCfg, sizeof(UlLcCfg));
+         memcpy(&macLcCfgToSend->dlLcCfg, &ueLcCfgDb->dlLcCfg, sizeof(DlLcCfg));
       }
    }
    else
    {
-      lcCfg->drbQos = NULLP;
-   }
+      oldLcCfg->lcId = ueLcCfgDb->lcId;
+      oldLcCfg->configType = ueLcCfgDb->configType;
 
-   if(ret == ROK)
-   {
-      if(ueSetReqDb->snssai)
+      if(ueLcCfgDb->drbQos)
       {
-         if(!lcCfg->snssai)
+         if(oldLcCfg->drbQos)
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, oldLcCfg->drbQos, sizeof(DrbQosInfo));
+
+         DU_ALLOC_SHRABL_BUF(oldLcCfg->drbQos, sizeof(DrbQosInfo));
+         if(oldLcCfg->drbQos == NULL)
          {
-            DU_ALLOC_SHRABL_BUF(lcCfg->snssai, sizeof(Snssai));
-            if(!lcCfg->snssai)
-            {
-               DU_LOG("\nERROR  -->  DU APP : Memory Alloc failed at snnsai at fillMacLcCfgToAddMod()");
-               ret = RFAILED;
-            }
+            DU_LOG("\nERROR  -->  DU APP : Memory Alloc Failed at fillMacLcCfgToAddMod()");
+            return RFAILED;
          }
-         if(ret == ROK)
+         memcpy(oldLcCfg->drbQos, ueLcCfgDb->drbQos, sizeof(DrbQosInfo));
+      }
+
+      if(ueLcCfgDb->snssai)
+      {
+         if(oldLcCfg->snssai)
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, oldLcCfg->snssai, sizeof(Snssai));
+
+         DU_ALLOC_SHRABL_BUF(oldLcCfg->snssai, sizeof(Snssai));
+         if(oldLcCfg->snssai == NULL)
          {
-            /* Filling SNSSAI */
-            memcpy(lcCfg->snssai, ueSetReqDb->snssai, sizeof(Snssai));
+            DU_LOG("\nERROR  -->  DU APP : Memory Alloc Failed at fillMacLcCfgToAddMod()");
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, oldLcCfg->drbQos, sizeof(DrbQosInfo));
+            return RFAILED;
          }
-        else
-        {
-            lcCfg->snssai = NULLP;
-            if(lcCfg->drbQos)
-            {
-               DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, lcCfg->drbQos, sizeof(DrbQosInfo));
-               lcCfg->drbQos = NULLP;
-            }
-           return ret;
-        }
+         memcpy(oldLcCfg->snssai, ueLcCfgDb->snssai, sizeof(Snssai));
       }
-      else
-         lcCfg->snssai = NULLP;
+
+      oldLcCfg->ulLcCfgPres = ueLcCfgDb->ulLcCfgPres;
+      memcpy(&oldLcCfg->ulLcCfg, &ueLcCfgDb->ulLcCfg, sizeof(UlLcCfg));
+      memcpy(&oldLcCfg->dlLcCfg, &ueLcCfgDb->dlLcCfg, sizeof(DlLcCfg));
    }
-   lcCfg->ulLcCfgPres = ueSetReqDb->ulLcCfgPres;
-   memcpy(&lcCfg->ulLcCfg, &ueSetReqDb->ulLcCfg, sizeof(UlLcCfg));
-   memcpy(&lcCfg->dlLcCfg, &ueSetReqDb->dlLcCfg, sizeof(DlLcCfg));
-   return ret;
+   return ROK;
 }
 
 /******************************************************************
@@ -1026,26 +1030,36 @@ uint8_t fillMacLcCfgToAddMod(LcCfg *lcCfg, LcCfg *ueSetReqDb)
  *
  *****************************************************************/
 
-uint8_t fillAmbr(AmbrCfg **macAmbr, AmbrCfg *ueDbAmbr)
+uint8_t fillAmbr(AmbrCfg **macAmbrCfgToSend, AmbrCfg *ueDbAmbr, AmbrCfg **oldMacAmbrCfg, Bool toUpdate)
 {
-   if(ueDbAmbr)
+   if(!toUpdate)
+   {
+      if(ueDbAmbr)
+      {
+         *macAmbrCfgToSend = ueDbAmbr;
+      }
+      else
+         *macAmbrCfgToSend = *oldMacAmbrCfg;       
+   }
+   else
    {
-      if(*macAmbr == NULLP)
+      if(ueDbAmbr)
       {
-         DU_ALLOC_SHRABL_BUF(*macAmbr, sizeof(AmbrCfg));
-         if(*macAmbr == NULLP)
+         if(*oldMacAmbrCfg)
+         {
+            DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, *oldMacAmbrCfg, sizeof(AmbrCfg));
+         }
+         DU_ALLOC_SHRABL_BUF(*oldMacAmbrCfg, sizeof(AmbrCfg));
+         if(*oldMacAmbrCfg == NULLP)
          {
             DU_LOG("\nERROR  -->  DU APP : Memory Alloc Failed at fillAmbr()");
             return RFAILED;
          }
+         memset(*oldMacAmbrCfg, 0, sizeof(AmbrCfg));
+         (*oldMacAmbrCfg)->ulBr = ueDbAmbr->ulBr;
       }
-      memset(*macAmbr, 0, sizeof(AmbrCfg));
-      (*macAmbr)->ulBr = ueDbAmbr->ulBr;
-   }
-   else
-   {
-      *macAmbr = NULLP;
    }
+
    return ROK;
 }
 
@@ -1192,7 +1206,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
                      NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg);
             }
          }
-         ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg);
+         ret = fillAmbr(&macUeCfg->ambrCfg, ueCfgDb->ambrCfg , &duMacDb->ambrCfg, FALSE);
          duFillModulationDetails(macUeCfg, duMacDb, ueCfgDb->ueNrCapability);
       }
 
@@ -1214,7 +1228,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
                      (ueCfgDb->macLcCfg[dbIdx].configType == CONFIG_MOD))
                {
                   ueCfgDb->macLcCfg[dbIdx].configType = CONFIG_MOD;
-                  ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx]);
+                  ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx], &duMacDb->lcCfgList[lcIdx], FALSE);
                }
             }
             else
@@ -1223,7 +1237,7 @@ uint8_t fillMacUeCfg(uint16_t cellId, uint8_t ueIdx, uint16_t crnti, \
          if(!lcIdFound)
          {
             /* ADD/DEL CONFIG */
-            ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx]);
+            ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[dbIdx], &ueCfgDb->macLcCfg[dbIdx], NULL, FALSE);
          }
          if(ret == ROK)
          {
@@ -1714,6 +1728,9 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb)
    MacUeCfg *oldMacUeCfg;
    ret = ROK;
 
+   GET_CELL_IDX(macUeCfg->cellId, cellIdx);
+   oldMacUeCfg = &duCb.actvCellLst[cellIdx]->ueCb[macUeCfg->ueIdx-1].macUeCfg;
+
    /*Filling Cell Group Cfg*/
    ret =  procUeReCfgCellInfo(macUeCfg, f1UeDb->duUeCfg.cellGrpCfg);
    if(ret == ROK)
@@ -1728,10 +1745,7 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb)
          fillStartSymbolAndLen(macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg.numTimeDomRsrcAlloc,\
               NULL, &macUeCfg->spCellCfg.servCellCfg.initUlBwp.puschCfg);
       }
-      ret = fillAmbr(&macUeCfg->ambrCfg, f1UeDb->duUeCfg.ambrCfg);
-
-      GET_CELL_IDX(macUeCfg->cellId, cellIdx);
-      oldMacUeCfg = &duCb.actvCellLst[cellIdx]->ueCb[macUeCfg->ueIdx-1].macUeCfg;
+      ret = fillAmbr(NULL, f1UeDb->duUeCfg.ambrCfg, &oldMacUeCfg->ambrCfg, true);
       duFillModulationDetails(macUeCfg, oldMacUeCfg, f1UeDb->duUeCfg.ueNrCapability);
    }
 
@@ -1745,7 +1759,7 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb)
         {
            if(f1UeDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_MOD)
            {
-              ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[lcIdx],&f1UeDb->duUeCfg.macLcCfg[dbIdx]);
+              ret = fillMacLcCfgToAddMod(NULL, &f1UeDb->duUeCfg.macLcCfg[dbIdx], &macUeCfg->lcCfgList[lcIdx], true);
            }
            else if(f1UeDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_DEL)
            {
@@ -1755,7 +1769,7 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb)
               for(lcDelIdx = lcIdx; lcDelIdx < macUeCfg->numLcs; lcDelIdx++)
               {
                  /* moving all elements one index ahead */
-                 ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[lcDelIdx], &macUeCfg->lcCfgList[lcDelIdx+1]);
+                 ret = fillMacLcCfgToAddMod(NULL,  &macUeCfg->lcCfgList[lcDelIdx+1], &macUeCfg->lcCfgList[lcDelIdx], true);
                  freeMacLcCfg(&macUeCfg->lcCfgList[lcDelIdx+1]);
                  if(ret == RFAILED)
                  {
@@ -1768,7 +1782,7 @@ uint8_t duUpdateMacCfg(MacUeCfg *macUeCfg, F1UeContextSetupDb *f1UeDb)
       } 
       if(f1UeDb->duUeCfg.macLcCfg[dbIdx].configType == CONFIG_ADD)
       {
-        ret = fillMacLcCfgToAddMod(&macUeCfg->lcCfgList[numLcs], &f1UeDb->duUeCfg.macLcCfg[dbIdx]);
+        ret = fillMacLcCfgToAddMod(NULL, &f1UeDb->duUeCfg.macLcCfg[dbIdx], &macUeCfg->lcCfgList[numLcs], true);
         if(ret == RFAILED)
         {
            DU_LOG("\nERROR  -->  DU APP : Failed to add LC at Idx %d in duUpdateMacCfg()", numLcs);
@@ -1951,6 +1965,12 @@ uint8_t duUpdateRlcLcCfg(RlcUeCfg *rlcUeCfg, F1UeContextSetupDb *f1UeDb)
  * ****************************************************************/
 uint8_t fillTnlCfgToAddMod(UpTnlCfg **ueCbTnlCfg, UpTnlCfg *f1TnlCfg)
 {
+   if(*ueCbTnlCfg)
+   {
+      DU_FREE((*ueCbTnlCfg)->tnlCfg1, sizeof(GtpTnlCfg));
+      DU_FREE(*ueCbTnlCfg, sizeof(UpTnlCfg));
+   }
+
    if(*ueCbTnlCfg == NULLP)
    {
       /* copying to DuCb Tnl Cfg */
@@ -2015,21 +2035,21 @@ uint8_t duProcEgtpTunnelCfg(uint8_t ueCbIdx, UpTnlCfg *duTnlCfg, UpTnlCfg *f1Tnl
    {
       if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_ADD, NULLP, f1TnlCfg->tnlCfg1) == ROK)
       {
-        if(fillTnlCfgToAddMod(&duCb.upTnlCfg[duCb.numDrb], f1TnlCfg) == ROK)
-        {
-           duCb.numDrb++;
-           ret = ROK;
-        }
+         if(fillTnlCfgToAddMod(&duCb.upTnlCfg[duCb.numDrb], f1TnlCfg) == ROK)
+         {
+            duCb.numDrb++;
+            ret = ROK;
+         }
       }      
    }
    else if(f1TnlCfg->configType == CONFIG_MOD)
    {
       if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_MOD, duTnlCfg->tnlCfg1->teId, f1TnlCfg->tnlCfg1) == ROK)
       {
-        if(fillTnlCfgToAddMod(&duTnlCfg, f1TnlCfg) == ROK)
-        {
-           ret = ROK;
-        }
+         if(fillTnlCfgToAddMod(&duTnlCfg, f1TnlCfg) == ROK)
+         {
+            ret = ROK;
+         }
       }   
    }
    else if(f1TnlCfg->configType == CONFIG_DEL)
@@ -2037,7 +2057,6 @@ uint8_t duProcEgtpTunnelCfg(uint8_t ueCbIdx, UpTnlCfg *duTnlCfg, UpTnlCfg *f1Tnl
       if(duSendEgtpTnlMgmtReq(EGTP_TNL_MGMT_DEL, duTnlCfg->tnlCfg1->teId, f1TnlCfg->tnlCfg1) == ROK)
       {           
          /* Free memory at drbIdx */
-         DU_FREE(duTnlCfg->tnlCfg1, sizeof(GtpTnlCfg));
          duCb.numDrb--;
          for(delIdx = ueCbIdx; delIdx < duCb.numDrb; delIdx++)
          {
@@ -2048,6 +2067,11 @@ uint8_t duProcEgtpTunnelCfg(uint8_t ueCbIdx, UpTnlCfg *duTnlCfg, UpTnlCfg *f1Tnl
                return ret;
             }
          }
+         if(duCb.upTnlCfg[delIdx])
+         {
+            DU_FREE(duCb.upTnlCfg[delIdx]->tnlCfg1, sizeof(GtpTnlCfg));
+            DU_FREE(duCb.upTnlCfg[delIdx], sizeof(UpTnlCfg));
+         }
       }   
    }
    return ret;
@@ -2501,31 +2525,39 @@ uint8_t duBuildAndSendUeContextSetupReq(uint16_t cellId, uint16_t crnti, DuUeCfg
 uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg)
 {
    uint8_t ret = ROK, ueIdx = 0;
+   uint16_t cellId, crnti;
    DuUeCb *ueCb = NULLP;
+   DlMsgState state;
 
-   if(dlRrcMsg->state == TRANSMISSION_COMPLETE)
+   state = dlRrcMsg->state;
+   cellId = dlRrcMsg->cellId;
+   crnti = dlRrcMsg->crnti;
+   DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlRrcMsg, sizeof(RlcDlRrcMsgRsp));
+
+   if(state == TRANSMISSION_COMPLETE)
    {
-      GET_UE_IDX(dlRrcMsg->crnti, ueIdx);
-      ueCb = &duCb.actvCellLst[dlRrcMsg->cellId -1]->ueCb[ueIdx -1];
+      GET_UE_IDX(crnti, ueIdx);
+      ueCb = &duCb.actvCellLst[cellId -1]->ueCb[ueIdx -1];
+
       if(ueCb->f1UeDb && ueCb->f1UeDb->dlRrcMsgPres)
       {
          if(ueCb->f1UeDb->actionType == UE_CTXT_SETUP)
          {
-            ret = duBuildAndSendUeContextSetupReq(dlRrcMsg->cellId, dlRrcMsg->crnti, &ueCb->f1UeDb->duUeCfg);
+            ret = duBuildAndSendUeContextSetupReq(cellId, crnti, &ueCb->f1UeDb->duUeCfg);
             if(ret == RFAILED)
                DU_LOG("\nERROR  -->  DU APP : Failed to process UE Context Setup Request in DuProcRlcDlRrcMsgRsp()");
          }
          
          if(ueCb->f1UeDb->actionType == UE_CTXT_MOD)
          {
-            ret = duBuildAndSendUeContextModReq(dlRrcMsg->cellId, dlRrcMsg->crnti, &ueCb->f1UeDb->duUeCfg);
+            ret = duBuildAndSendUeContextModReq(cellId, crnti, &ueCb->f1UeDb->duUeCfg);
             if(ret == RFAILED)
                DU_LOG("\nERROR  -->  DU APP : Failed to process UE Context Mod Request in DuProcRlcDlRrcMsgRsp()");
          }
 
          if(ueCb->f1UeDb->actionType == UE_CTXT_RELEASE && ueCb->ueState == UE_ACTIVE)
          {
-            ret = duBuildAndSendUeDeleteReq(dlRrcMsg->cellId,dlRrcMsg->crnti);
+            ret = duBuildAndSendUeDeleteReq(cellId, crnti);
             if(ret == RFAILED)
             {
                DU_LOG("\nERROR  -->  DU APP : Failed to process UE Context Release Request in DuProcRlcDlRrcMsgRsp()");
@@ -2536,7 +2568,6 @@ uint8_t DuProcRlcDlRrcMsgRsp(Pst *pst, RlcDlRrcMsgRsp *dlRrcMsg)
    else
       DU_LOG("\nERROR  -->  DU APP : Failed to transmit DL RRC Msg");
 
-   DU_FREE_SHRABL_BUF(DU_APP_MEM_REGION, DU_POOL, dlRrcMsg, sizeof(RlcDlRrcMsgRsp));
    return ret;
 }
 /*******************************************************************
index c3cf3e7..1a87ed7 100644 (file)
 #define EVENT_RIC_DATA  10
 
 /* allocate and zero out a static buffer */
+
+#ifdef ODU_MEMORY_DEBUG_LOG
+#define DU_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\
+{\
+   printf("\n%s=== %s +%d, %s, %d, %p\n",           \
+         _macro, _file, _line, _func, _size, _datPtr); \
+}
+#else
+#define DU_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {}
+#endif
+
 #define DU_ALLOC(_datPtr, _size)                                \
 {                                                               \
    int _ret;                                                    \
    _ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL,                  \
                     (Data **)&_datPtr, _size);                  \
-   if(_ret == ROK)                                              \
+   if(_ret == ROK)     \
+   {\
+      DU_MEM_LOG("DU_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
       memset(_datPtr, 0, _size);                         \
+   }\
    else                                                         \
       _datPtr = NULLP;                                          \
 }
@@ -59,6 +73,7 @@
 {                                                               \
    if(_datPtr != NULLP)                                                  \
    {                                                            \
+      DU_MEM_LOG("DU_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
       SPutSBuf(DU_APP_MEM_REGION, DU_POOL,                      \
          (Data *)_datPtr, _size);                               \
       _datPtr = NULLP;                                          \
@@ -71,6 +86,7 @@
    if(SGetStaticBuffer(DU_APP_MEM_REGION, DU_POOL,           \
       (Data **)&_buf, (Size) _size, 0) == ROK)               \
    {                                                         \
+      DU_MEM_LOG("DU_ALLOC_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       memset((_buf), 0, _size);                      \
    }                                                         \
    else                                                      \
 {                                                               \
    if (_buf != NULLP)                                           \
    {                                                            \
+      DU_MEM_LOG("DU_FREE_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
       (Void) SPutStaticBuffer(_region, _pool,                   \
            (Data *) _buf, (Size) _size, 0);                     \
        _buf = NULLP;                                            \