X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg_lmm.c;h=51742fbe216aa27c9285742fa3e6befb2ccdf576;hb=de6a435729e3cad9d4a66329080b8206a64f452c;hp=fc594475916c34b8ba2d57e907395f9b1535278e;hpb=2324a199636bc2e127af6bb3beefef668b4f45d7;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg_lmm.c b/src/5gnrmac/rg_lmm.c index fc5944759..51742fbe2 100755 --- a/src/5gnrmac/rg_lmm.c +++ b/src/5gnrmac/rg_lmm.c @@ -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 */ @@ -185,7 +186,7 @@ Reason reason /* reason */ #endif /* Initialize Scheduler as well */ - schActvInit(ENTMAC, (DEFAULT_CELLS + SCH_INST_START), DFLT_REGION, PWR_UP); + schActvInit(ENTMAC, SCH_INST_START, DFLT_REGION, PWR_UP); /* Initialize lower mac */ lwrMacLayerInit(region, 0); @@ -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;