X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Fkw_tenb_stats.c;h=68d552714e891e4634d6102c435d173f0bf1ac87;hb=d48ca6903f310645ef58f09ad965f589660be068;hp=006326713f68b392c0bf51df34419ba4d2616c86;hpb=5625a52ad68f6ad93684e68bbbdbaef0d462cf9a;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/kw_tenb_stats.c b/src/5gnrrlc/kw_tenb_stats.c index 006326713..68d552714 100755 --- a/src/5gnrrlc/kw_tenb_stats.c +++ b/src/5gnrrlc/kw_tenb_stats.c @@ -29,18 +29,7 @@ **********************************************************************/ /* header (.h) include files */ -#include "envopt.h" /* environment options */ -#include "envdep.h" /* environment dependent */ -#include "envind.h" /* environment independent */ - -#include "gen.h" /* general */ -#include "ssi.h" /* system services */ -#include "cm5.h" /* common timer defines */ -#include "cm_tkns.h" /* common tokens defines */ -#include "cm_mblk.h" /* common memory allocation library defines */ -#include "cm_llist.h" /* common link list defines */ -#include "cm_hash.h" /* common hash list defines */ -#include "cm_lte.h" /* common LTE defines */ +#include "common_def.h" #include "lkw.h" /* LKW defines */ #include "ckw.h" /* CKW defines */ #include "kwu.h" /* KWU defines */ @@ -51,16 +40,6 @@ #include "kw_ul.h" /* extern (.x) include files */ -#include "gen.x" /* general */ -#include "ssi.x" /* system services */ - -#include "cm5.x" /* common timer library */ -#include "cm_tkns.x" /* common tokens */ -#include "cm_mblk.x" /* common memory allocation */ -#include "cm_llist.x" /* common link list */ -#include "cm_hash.x" /* common hash list */ -#include "cm_lte.x" /* common LTE includes */ -#include "cm_lib.x" /* common memory allocation library */ #include "lkw.x" /* LKW */ #include "ckw.x" /* CKW */ #include "kwu.x" /* KWU */ @@ -73,10 +52,10 @@ #endif #ifdef TENB_STATS -PUBLIC TSL2CellStatsCb* l2CellStats[L2_STATS_MAX_CELLS]; -PUBLIC TSL2UeStatsCb* l2UeStats[L2_STATS_MAX_UES]; -PUBLIC CmLListCp freeL2UeStatsLst; /*!< Free Pool of UE stats Blocks */ -PUBLIC CmLListCp inUseL2UeStatsLst;/*!< In Use Pool of UE stats Blocks */ +TSL2CellStatsCb* l2CellStats[L2_STATS_MAX_CELLS]; +TSL2UeStatsCb* l2UeStats[L2_STATS_MAX_UES]; +CmLListCp freeL2UeStatsLst; /*!< Free Pool of UE stats Blocks */ +CmLListCp inUseL2UeStatsLst;/*!< In Use Pool of UE stats Blocks */ /* * @@ -90,246 +69,181 @@ PUBLIC CmLListCp inUseL2UeStatsLst;/*!< In Use Pool of UE stats Blocks */ * * */ -#ifdef ANSI -PUBLIC Void TSL2AllocStatsMem -( - Region region, - Pool pool -) -#else -PUBLIC Void TSL2AllocStatsMem(region, pool) - Region region; - Pool pool; -#endif +Void TSL2AllocStatsMem(Region region,Pool pool) { - U32 cnt=0; - - TRC2(TSL2AllocStatsMem) + uint32_t cnt=0; 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) - { - printf("\n STATS Unexpected MEM Alloc Failure\n"); - } - } - cmMemset((U8 *)l2CellStats[cnt], 0x00, (Size)sizeof(TSL2CellStatsCb)); + 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"); + } + } + memset(l2CellStats[cnt], 0x00, sizeof(TSL2CellStatsCb)); } for (cnt=0; cnt < L2_STATS_MAX_UES; cnt++) { - TSL2UeStatsCb *statsCb = l2UeStats[cnt]; - if(NULL == statsCb) - { - if (SGetSBuf(region, pool, (Data **)&statsCb, - (Size)sizeof (TSL2UeStatsCb)) != ROK) - { - printf("\n STATS Unexpected MEM Alloc Failure at %d\n", (int)cnt); - } - } - cmMemset((U8 *)statsCb, 0x00, (Size)sizeof(TSL2UeStatsCb)); - statsCb->lnk.node = (PTR)statsCb; - cmLListAdd2Tail(&freeL2UeStatsLst, &statsCb->lnk); - l2UeStats[cnt] = statsCb; + 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); + } + } + memset(statsCb, 0x00, sizeof(TSL2UeStatsCb)); + statsCb->lnk.node = (PTR)statsCb; + cmLListAdd2Tail(&freeL2UeStatsLst, &statsCb->lnk); + l2UeStats[cnt] = statsCb; } - RETVOID; + return; } /* -* -* Fun: TSL2AllocUeStatsBlk -* -* Desc: Assign Stats Block for this UE[RNTI] -* -* Ret: -* -* Notes: None -* -* -*/ -#ifdef ANSI -PUBLIC TSL2UeStatsCb* TSL2AllocUeStatsBlk -( - U16 rnti -) -#else -PUBLIC TSL2UeStatsCb* TSL2AllocUeStatsBlk(rnti) - U16 rnti; -#endif + * + * Fun: TSL2AllocUeStatsBlk + * + * Desc: Assign Stats Block for this UE[RNTI] + * + * Ret: + * + * Notes: None + * + * + */ +TSL2UeStatsCb* TSL2AllocUeStatsBlk (uint16_t rnti) { CmLList *tmp = NULLP; TSL2UeStatsCb *statsCb = NULLP; - TRC2(TSL2AllocUeStatsBlk) - tmp = freeL2UeStatsLst.first; if (tmp == NULLP) { - printf("\n STATS Unexpected Mem BLK unavailable for UE %d\n", rnti); + DU_LOG("\nERROR --> RLC : STATS Unexpected Mem BLK unavailable for UE %d\n", rnti); } cmLListDelFrm(&freeL2UeStatsLst, tmp); statsCb = (TSL2UeStatsCb *)(tmp->node); cmLListAdd2Tail(&inUseL2UeStatsLst, tmp); - statsCb->stats.rnti = (U32)rnti; + statsCb->stats.rnti = (uint32_t)rnti; statsCb->inUse = TRUE; - RETVALUE(statsCb); + return (statsCb); } /* -* -* Fun: TSL2DeallocUeStatsBlk -* -* Desc: Deassign Stats Block for this UE[RNTI] -* -* Ret: -* -* Notes: None -* -* -*/ -#ifdef ANSI -PUBLIC Void TSL2DeallocUeStatsBlk -( - U16 rnti, - TSL2UeStatsCb *statsCb -) -#else -PUBLIC Void TSL2DeallocUeStatsBlk(rnti, statsCb) - U16 rnti; - TSL2UeStatsCb *statsCb; -#endif + * + * Fun: TSL2DeallocUeStatsBlk + * + * Desc: Deassign Stats Block for this UE[RNTI] + * + * Ret: + * + * Notes: None + * + * + */ +Void TSL2DeallocUeStatsBlk(uint16_t rnti,TSL2UeStatsCb *statsCb) { - TRC2(TSL2DeallocUeStatsBlk) - statsCb->inUse = FALSE; cmLListDelFrm(&inUseL2UeStatsLst, &statsCb->lnk); freeL2UeStatsLst.crnt = freeL2UeStatsLst.first; cmLListInsAfterCrnt(&freeL2UeStatsLst, &statsCb->lnk); - RETVOID; + return; } /* -* -* Fun: TSL2AllocCellStatsBlk -* -* Desc: Assign Stats Block for this CELL[CELLID] -* -* Ret: -* -* Notes: None -* -* -*/ -#ifdef ANSI -PUBLIC TSL2CellStatsCb* TSL2AllocCellStatsBlk -( - U32 cellId -) -#else -PUBLIC TSL2CellStatsCb* TSL2AllocCellStatsBlk(cellId) - U32 cellId; -#endif + * + * Fun: TSL2AllocCellStatsBlk + * + * Desc: Assign Stats Block for this CELL[CELLID] + * + * Ret: + * + * Notes: None + * + * + */ +TSL2CellStatsCb* TSL2AllocCellStatsBlk(uint32_t cellId) { - TRC2(TSL2AllocCellStatsBlk) - if (cellId != 1) { - printf("\n STATS Unexpected CellID = %d\n", (int)cellId); + DU_LOG("\nERROR --> RLC : STATS Unexpected CellID = %d\n", (int)cellId); } - RETVALUE(l2CellStats[cellId-1]); + return (l2CellStats[cellId-1]); } /* -* -* Fun: TSL2DeallocCellStatsBlk -* -* Desc: Deassign Stats Block for this CELL[CELLID] -* -* Ret: -* -* Notes: None -* -* -*/ -#ifdef ANSI -PUBLIC Void TSL2DeallocCellStatsBlk -( - U32 cellId -) -#else -PUBLIC Void TSL2DeallocCellStatsBlk(cellId) - U32 cellId; -#endif + * + * Fun: TSL2DeallocCellStatsBlk + * + * Desc: Deassign Stats Block for this CELL[CELLID] + * + * Ret: + * + * Notes: None + * + * + */ +Void TSL2DeallocCellStatsBlk(uint32_t cellId) { - TRC2(TSL2DeallocCellStatsBlk) - RETVOID; + return; } /* -* -* Fun: TSL2SendStatsToApp -* -* Desc: Collates and Sends STATS to Application -* Send UE STATS first. 10 UEs are grouped in one message. -* Followed by CELL Stats. All CELLS are grouped in one msg. -* At Reception of CELL stats APP assumes STATS reception cycle is complete. -* -* Ret: -* -* Notes: None -* -* -*/ -#ifdef ANSI -PUBLIC Void TSL2SendStatsToApp -( - Pst *pst, - SuId suId - ) -#else -PUBLIC Void TSL2SendStatsToApp(pst, suId) - Pst *pst; - SuId suId; -#endif + * + * Fun: TSL2SendStatsToApp + * + * Desc: Collates and Sends STATS to Application + * Send UE STATS first. 10 UEs are grouped in one message. + * Followed by CELL Stats. All CELLS are grouped in one msg. + * At Reception of CELL stats APP assumes STATS reception cycle is complete. + * + * Ret: + * + * Notes: None + * + * + */ +Void TSL2SendStatsToApp(Pst *pst, SuId suId) { - U32 idx; - - TRC2(TSL2SendStatsToApp) + uint32_t idx; for (idx = 0; idx < L2_STATS_MAX_UES; idx++) { TSL2UeStatsCb *statsCb = l2UeStats[idx]; - U32 rnti; + uint32_t rnti; if (statsCb->inUse != TRUE) { - continue; + continue; } if (pst->selector == 0) { - /* Loose Coupling */ - TSInfPkSndL2UeStats(pst, suId, &statsCb->stats); + /* Loose Coupling */ + TSInfPkSndL2UeStats(pst, suId, &statsCb->stats); } else { #ifdef PX - /* Tight Coupling */ - TSInfHdlL2UeStatsInd(pst, suId, &statsCb->stats); + /* Tight Coupling */ + TSInfHdlL2UeStatsInd(pst, suId, &statsCb->stats); #endif } rnti = statsCb->stats.rnti; - cmMemset((U8 *)&statsCb->stats.nonPersistent, 0x00, (Size)sizeof(statsCb->stats.nonPersistent)); - /* cmMemset((U8 *)&statsCb->stats, 0x00, (Size)sizeof(TSInfL2UeStats)); */ + memset(&statsCb->stats.nonPersistent, 0x00, sizeof(statsCb->stats.nonPersistent)); + /* memset(&statsCb->stats, 0x00, sizeof(TSInfL2UeStats)); */ statsCb->stats.rnti = rnti; } @@ -337,26 +251,26 @@ PUBLIC Void TSL2SendStatsToApp(pst, suId) for (idx = 0; idx < L2_STATS_MAX_CELLS; idx++) { TSL2CellStatsCb *statsCellCb = l2CellStats[idx]; - U32 cellId; + uint32_t cellId; if (pst->selector == 0) { - /* Loose Coupling */ - TSInfPkSndL2CellStats(pst, suId, l2CellStats[idx]); + /* Loose Coupling */ + TSInfPkSndL2CellStats(pst, suId, l2CellStats[idx]); } else { #ifdef PX - /* Tight Coupling */ - TSInfHdlL2CellStatsInd(pst, suId, l2CellStats[idx]); + /* Tight Coupling */ + TSInfHdlL2CellStatsInd(pst, suId, l2CellStats[idx]); #endif } cellId = statsCellCb->cellId; - cmMemset((U8 *)l2CellStats[idx], 0x00, (Size)sizeof(TSInfL2CellStats)); + memset(l2CellStats[idx], 0x00, sizeof(TSInfL2CellStats)); statsCellCb->cellId = cellId; } - RETVOID; + return; } #endif /* TENB_STATS */ /********************************************************************** - End of file -**********************************************************************/ + End of file + **********************************************************************/