X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_utl.c;h=fbc659e22f08ad6b111316ef940a1c64448f891f;hb=aae1fb8fd1e149a7b3a6a6ca799c56aceadc6184;hp=c5e4025c63c7a96d7b7f86957f5b9439f2e16d1d;hpb=3275b4a8aec68cc23c20062f157c9f3a494d6271;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_utl.c b/src/5gnrmac/rg_utl.c index c5e4025c6..fbc659e22 100755 --- a/src/5gnrmac/rg_utl.c +++ b/src/5gnrmac/rg_utl.c @@ -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; @@ -236,17 +239,15 @@ Size size /* size */ ) { - S16 ret; - if ((data == NULLP) || (*data == NULLP) || (size == 0)) { return; } /* 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; } @@ -283,8 +284,6 @@ Size size /* size */ ) { - S16 ret; - if ((data == NULLP) || (*data == NULLP) || (size == 0)) { return; @@ -295,9 +294,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 +336,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) {