remove/replaced PRIVATE and EXTERN keywords
[o-du/l2.git] / src / 5gnrmac / rg_utl.c
index f6b7b50..aa02d4c 100755 (executable)
@@ -70,13 +70,13 @@ static int RLOG_FILE_ID=179;
 /* local externs */
  
 /* forward references */
-PRIVATE S16 rgUtlHndlCrntiChng ARGS((
+static S16 rgUtlHndlCrntiChng ARGS((
          Inst            inst,
          RgCellCb        *cell,
          CmLteRnti       rnti,
          CmLteRnti       newRnti
          ));
-PRIVATE Void rgUtlHndlCrntiRls ARGS((
+static Void rgUtlHndlCrntiRls ARGS((
          RgCellCb        *cell,
          RgInfRlsRnti    *rlsRnti
          ));
@@ -87,7 +87,7 @@ S16 rgDelUeFrmAllSCell ARGS((
          ));
 
 #ifdef LTE_ADV
-PRIVATE S16 rgUtlSndCrntiChngReq2AllSMacs ARGS((
+static S16 rgUtlSndCrntiChngReq2AllSMacs ARGS((
          RgCellCb        *cell,
          CmLteRnti       rnti,
          CmLteRnti       newRnti
@@ -128,8 +128,6 @@ Size    size;               /* size */
 {
    RgUstaDgn dgn;      /* Alarm diagnostics structure */
 
-   TRC2(rgAllocShrablSBuf)
-
    /* Initialize the param to NULLP */
    *pData = NULLP;
 
@@ -160,7 +158,7 @@ Size    size;               /* size */
 #endif
 
    /* zero out the allocated memory */
-   cmMemset((U8 *)*pData, 0x00, size);
+   memset(*pData, 0x00, size);
 
    return ROK;
 
@@ -200,8 +198,6 @@ Size    size;               /* size */
 {
    RgUstaDgn dgn;      /* Alarm diagnostics structure */
 
-   TRC2(rgAllocSBuf)
-
    /* Initialize the param to NULLP */
    *pData = NULLP;
 
@@ -227,7 +223,7 @@ Size    size;               /* size */
    }
 
    /* zero out the allocated memory */
-   cmMemset((U8 *)*pData, 0x00, size);
+   memset(*pData, 0x00, size);
 
    return ROK;
 
@@ -241,7 +237,7 @@ Size    size;               /* size */
 *              previously allocated by rgAllocSBuf() and size. It 
 *              deallocates the memory. 
 *
-*       Ret:   RETVOID
+*       Ret:   void
 *
 *       Notes: ccpu00117052 - MOD- changed the Data parameter from 
 *                             pointer to address of pointer so that
@@ -266,11 +262,9 @@ Size size;          /* size */
 
    S16 ret;
 
-   TRC2(rgFreeSharableBuf)
-
    if ((data == NULLP) || (*data == NULLP) || (size == 0))
    {
-      RETVOID;
+      return;
    }
 
    /* Deallocate buffer */
@@ -278,12 +272,12 @@ Size size;          /* size */
 
    if (ret != ROK)
    {
-      RETVOID;
+      return;
    }
 
    *data = NULLP;
 
-   RETVOID;
+   return;
 
 } /* end of rgFreeSharableBuf */
 
@@ -297,7 +291,7 @@ Size size;          /* size */
 *              previously allocated by rgAllocSBuf() and size. It 
 *              deallocates the memory. 
 *
-*       Ret:   RETVOID
+*       Ret:   void
 *
 *       Notes: ccpu00117052 - MOD- changed the Data parameter from 
 *                             pointer to address of pointer so that
@@ -322,11 +316,9 @@ Size size;          /* size */
 
    S16 ret;
 
-   TRC2(rgFreeSBuf)
-
    if ((data == NULLP) || (*data == NULLP) || (size == 0))
    {
-      RETVOID;
+      return;
    }
 
 
@@ -339,12 +331,12 @@ Size size;          /* size */
    if (ret != ROK)
    {
       RGLOGERROR(inst,ERRCLS_DEBUG, ERG029, (ErrVal) 0, "rgFreeSBuf failed.\n");
-      RETVOID;
+      return;
    }
 
    *data = NULLP;
 
-   RETVOID;
+   return;
 
 } /* end of rgFreeSBuf */
 
@@ -379,8 +371,6 @@ Buffer  **mBuf;           /* Message Buffer pointer be returned */
 {
    S16         ret;
 
-   TRC2(rgGetMsg)
-
 #ifdef MS_MBUF_CORRUPTION /* Should be enabled when debugging mbuf corruption */
    MS_BUF_ADD_ALLOC_CALLER();
 #endif /* */
@@ -423,22 +413,20 @@ Void rgFillDgnParams
 (
 Inst        inst,
 RgUstaDgn   *dgn,
-U8          dgnType
+uint8_t          dgnType
 )
 #else
 Void rgFillDgnParams(inst,dgn, dgnType)
 Inst        inst;
 RgUstaDgn   *dgn;
-U8          dgnType;
+uint8_t          dgnType;
 #endif
 {
 
-   TRC2(rgFillDgnParams)
-
    switch(dgnType)
    {
       case LRG_USTA_DGNVAL_MEM:
-         dgn->type = (U8) LRG_USTA_DGNVAL_MEM;
+         dgn->type = (uint8_t) LRG_USTA_DGNVAL_MEM;
          dgn->u.mem.region  = rgCb[inst].rgInit.region;
          dgn->u.mem.pool    = rgCb[inst].rgInit.pool;
       break;
@@ -447,7 +435,7 @@ U8          dgnType;
       break;
    }
 
-   RETVOID;
+   return;
 } /* end of rgFillDgnParams */
 
 
@@ -471,24 +459,20 @@ U8          dgnType;
 Void rgUpdtRguDedSts
 (
 Inst           inst,
-RgUpSapCb     *rguDlSap,
-U8             stsType,   /* Statistics type to update */
+RgUpSapCb      *rguDlSap,
+uint8_t        stsType,   /* Statistics type to update */
 RgRguDedDatReq *datReq    /* DatReq pointer */
 )
 #else
 Void rgUpdtRguDedSts(inst,rguDlSap,stsType, datReq)
 Inst           inst;
-RgUpSapCb     *rguDlSap;
-U8             stsType;   /* Statistics type to update */
+RgUpSapCb      *rguDlSap;
+uint8_t        stsType;   /* Statistics type to update */
 RgRguDedDatReq *datReq;   /* DatReq pointer */
 #endif
 {
-   U8 idx1,idx2;
-   U32 idx;
-
-
-   TRC2(rgUpdtRguDedSts)
-
+   uint8_t idx1,idx2;
+   uint32_t idx;
 
    switch(stsType)
    {
@@ -526,7 +510,7 @@ RgRguDedDatReq *datReq;   /* DatReq pointer */
          break;
    }
    
-   RETVOID;
+   return;
 } /* rgUpdtRguDedSts */
 
 
@@ -551,18 +535,15 @@ Void rgUpdtRguCmnSts
 (
 Inst           inst,
 RgUpSapCb     *rguDlSap,
-U8             stsType   /* Statistics type to update */
+uint8_t       stsType   /* Statistics type to update */
 )
 #else
 Void rgUpdtRguCmnSts(inst,rguDlSap,stsType)
 Inst           inst;
 RgUpSapCb     *rguDlSap;
-U8             stsType;   /* Statistics type to update */
+uint8_t       stsType;   /* Statistics type to update */
 #endif
 {
-   TRC2(rgUpdtRguCmnSts)
-
-
 
    switch(stsType)
    {
@@ -575,7 +556,7 @@ U8             stsType;   /* Statistics type to update */
          break;
    }
    
-   RETVOID;
+   return;
 } /* rgUpdtRguCmnSts */
 
 
@@ -600,15 +581,14 @@ U8             stsType;   /* Statistics type to update */
 Void rgUpdtCellCnt
 (
 Inst inst,
-U8 updtType
+uint8_t updtType
 )
 #else
 Void rgUpdtCellCnt(inst,updtType)
 Inst inst;
-U8 updtType;
+uint8_t updtType;
 #endif
 {
-   TRC2(rgUpdtCellCnt);
 
    switch (updtType)
    {
@@ -622,7 +602,7 @@ U8 updtType;
          break;
    }
 
-   RETVOID;
+   return;
 } /* rgUpdtCellCnt */
 
 
@@ -647,16 +627,14 @@ U8 updtType;
 Void rgUpdtUeCnt
 (
 Inst inst,
-U8 updtType
+uint8_t updtType
 )
 #else
 Void rgUpdtUeCnt (inst,updtType)
 Inst inst;
-U8 updtType;
+uint8_t updtType;
 #endif
 {
-   TRC2(rgUpdtUeCnt);
-
    switch (updtType)
    {
       case RG_CFG_ADD:
@@ -668,7 +646,7 @@ U8 updtType;
       default:
          break;
    }
-   RETVOID;
+   return;
 } /* rgUpdtUeCnt */
 
 /*
@@ -699,10 +677,9 @@ Ptr       *memPtr;
 Size      memSize;
 #endif
 {
-   Mem              sMem;
-   VOLATILE U32     startTime=0;
+   Mem               sMem;
+   volatile uint32_t startTime=0;
 
-   TRC2(rgAllocEventMem)
 
    sMem.region = rgCb[inst].rgInit.region;
    sMem.pool = rgCb[inst].rgInit.pool;
@@ -771,7 +748,6 @@ Ptr       memCp;
 {
    S16   ret;
 
-   TRC2(rgGetEventMem)
 #ifdef TFU_ALLOC_EVENT_NO_INIT
    ret = cmGetMemNoInit(memCp, len, (Ptr *)ptr);
 #else
@@ -811,7 +787,6 @@ Inst          srcInst;
 Inst          dstInst;
 #endif
 {
-   TRC2(rgGetPstToInst);
 
    pst->srcEnt = rgCb[srcInst].rgInit.ent; 
    pst->srcInst = rgCb[srcInst].rgInit.inst;
@@ -827,7 +802,7 @@ Inst          dstInst;
    pst->intfVer   = 0;
    pst->route   = RTESPEC;
 
-   RETVOID
+   return
 } /* end of rgGetPstToInst */
 
 /***********************************************************
@@ -867,8 +842,6 @@ RgInfLcgRegReq *lcgRegReq;
    RgCellCb   *cell = NULLP;
    RgUeCb     *ue;
 
-   TRC2(RgSchMacLcgRegReq);
-
    RG_IS_INST_VALID(pst->dstInst);
    inst   = pst->dstInst - RG_INST_START;
    cell   = rgCb[inst].cell;
@@ -926,8 +899,6 @@ RgInfUlSpsReset *ulSpsResetInfo;
    RgCellCb   *cell = NULLP;
    RgUeCb     *ue;
 
-   TRC2(RgSchMacUlSpsResetReq);
-
    RG_IS_INST_VALID(pst->dstInst);
    inst   = pst->dstInst - RG_INST_START;
    cell   = rgCb[inst].cell;
@@ -995,9 +966,7 @@ RgInfSpsLcInfo *lcInfo;
    Inst       inst;
    RgCellCb   *cell= NULLP;
    RgUeCb     *ue;
-   U8         idx;
-
-   TRC2(RgSchMacSpsLcRegReq);
+   uint8_t    idx;
 
    RG_IS_INST_VALID(pst->dstInst);
    inst   = pst->dstInst - RG_INST_START;
@@ -1081,8 +1050,6 @@ CmLteRnti      crnti;
    RgCellCb   *cell = NULLP;
    RgUeCb      *ue;
 
-   TRC2(RgSchMacSpsLcDeregReq);
-
    RG_IS_INST_VALID(pst->dstInst);
    inst   = pst->dstInst - RG_INST_START;
    cell   = rgCb[inst].cell;
@@ -1132,7 +1099,7 @@ CmLteRnti      crnti;
  *      -# RFAILED
  **/
 #ifdef ANSI
-PRIVATE S16 rgUtlHndlCrntiChng 
+static S16 rgUtlHndlCrntiChng 
 (
 Inst            inst,
 RgCellCb        *cell,
@@ -1140,7 +1107,7 @@ CmLteRnti       rnti,
 CmLteRnti       newRnti
 )
 #else
-PRIVATE S16 rgUtlHndlCrntiChng(inst,cell, rnti, newRnti)
+static S16 rgUtlHndlCrntiChng(inst,cell, rnti, newRnti)
 Inst            inst;
 RgCellCb        *cell;
 CmLteRnti       rnti;
@@ -1150,8 +1117,6 @@ CmLteRnti       newRnti;
    RgUeCb         *ue = NULLP;
    RgUeCb         *newUe = NULLP;
 
-   TRC3(rgUtlHndlCrntiChng)
-
    ue = rgDBMGetUeCb(cell, rnti);
    newUe = rgDBMGetUeCbFromRachLst(cell, newRnti);
    if ((ue == NULLP) || (newUe == NULLP))
@@ -1168,7 +1133,7 @@ CmLteRnti       newRnti;
 
    ue->ueId = newRnti;
 
-   cmMemcpy((U8*)&(ue->contResId), (U8*)&(newUe->contResId), 
+   memcpy(&(ue->contResId), &(newUe->contResId), 
                   sizeof(newUe->contResId));
    /* Fix : syed MSG4 might be RETXing need to store the
     * HARQ context. */
@@ -1212,13 +1177,11 @@ RgUeCb        *ue;
 #endif
 {
    Inst        inst     = cell->macInst - RG_INST_START;
-   U8          idx      = 0;
+   uint8_t     idx      = 0;
    Inst        sCellInstIdx;
    Pst         dstInstPst;
    RgPrgUeSCellDelInfo ueSCellDelInfo;
 
-   TRC2(rgDelUeFrmAllSCell)
-
    /* To Delete the SCells if exisits for that UE */
    for(idx = 0; idx < RG_MAX_SCELL_PER_UE ; idx++)
    {
@@ -1272,9 +1235,7 @@ S16 rgUtlVltdAddSCellCfg(ueSCellCb, cell, inst)
 {
   S16 ret = ROK; 
   
-  TRC3(rgUtlVltdAddSCellCfg)
-  
-     /* To Validate the CellID presence */
+  /* To Validate the CellID presence */
   if((cell == NULLP) ||
         (cell->cellId != ueSCellCb->cellId))
   {
@@ -1316,14 +1277,14 @@ S16 rgUtlVltdAddSCellCfg(ueSCellCb, cell, inst)
  *      -# ROK 
  **/
 #ifdef ANSI
-PRIVATE S16 rgUtlSndCrntiChngReq2AllSMacs
+static S16 rgUtlSndCrntiChngReq2AllSMacs
 (
 RgCellCb        *cell,
 CmLteRnti       rnti,
 CmLteRnti       newRnti
 )
 #else
-PRIVATE S16 rgUtlSndCrntiChngReq2AllSMacs(cell, rnti, newRnti)
+static S16 rgUtlSndCrntiChngReq2AllSMacs(cell, rnti, newRnti)
 RgCellCb        *cell;
 CmLteRnti       rnti;
 CmLteRnti       newRnti;
@@ -1334,13 +1295,11 @@ CmLteRnti       newRnti;
    Pst                 dstInstPst;
    RgPrgUeSCellDelInfo ueIdChngReq;
    RgUeCb              *ue;
-   U8                  idx;
+   uint8_t                  idx;
 #ifdef L2_OPTMZ
 TfuDelDatReqInfo delDatReq;
 #endif
 
-   TRC2(rgUtlSndCrntiChngReq2AllSMacs)
-
    /* use newRnti to get UeCb in PMac because rnti is already changed in PMac*/
    ue = rgDBMGetUeCb(cell, newRnti);
    if (ue == NULLP)
@@ -1400,13 +1359,13 @@ TfuDelDatReqInfo delDatReq;
  *  @return  Void 
  **/
 #ifdef ANSI
-PRIVATE Void rgUtlHndlCrntiRls
+static Void rgUtlHndlCrntiRls
 (
 RgCellCb        *cell,
 RgInfRlsRnti    *rlsRnti
 )
 #else
-PRIVATE Void rgUtlHndlCrntiRls(cell, rlsRnti)
+static Void rgUtlHndlCrntiRls(cell, rlsRnti)
 RgCellCb        *cell;
 CmLteRnti       *rlsRnti;
 #endif
@@ -1417,8 +1376,6 @@ CmLteRnti       *rlsRnti;
    RgUeCb         *spsUeCb = NULLP;
 #endif
 
-   TRC3(rgUtlHndlCrntiRls)
-
    if ((ue = rgDBMGetUeCb(cell, rlsRnti->rnti)) == NULLP)
    {
       /* Check in RachLst */
@@ -1467,7 +1424,7 @@ CmLteRnti       *rlsRnti;
       }
    }
 
-   RETVOID;
+   return;
 } /* end of rgUtlHndlCrntiRls */
 
 /**
@@ -1509,8 +1466,6 @@ RgInfRlsRnti        *rlsRnti;
 TfuDelDatReqInfo delDatReq;
 #endif
 
-   TRC3(RgSchMacRlsRntiReq)
-
    RG_IS_INST_VALID(pst->dstInst);
    macInst   = pst->dstInst - RG_INST_START;
    cell   = rgCb[macInst].cell;