[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / 5gnrsch / rg_sch_scell.c
index db18f1a..2990c0f 100755 (executable)
 */
 
 /* header include files -- defines (.h) */
-#include "envopt.h"        /* environment options */
-#include "envdep.h"        /* environment dependent */
-#include "envind.h"        /* environment independent */
-#include "gen.h"           /* general layer */
-#include "ssi.h"           /* system service interface */
-#include "cm5.h"           /* common timers */
-#include "cm_hash.h"       /* common hash list */
-#include "cm_llist.h"      /* common linked list library */
-#include "cm_err.h"        /* common error */
-#include "cm_lte.h"        /* common LTE */
+#include "common_def.h"
 #include "lrg.h"
 #include "rgr.h"
 #include "rgm.h"
 #include "rg_sch_cmn.h"
 
 /* header/extern include files (.x) */
-#include "gen.x"           /* general layer typedefs */
-#include "ssi.x"           /* system services typedefs */
-#include "cm5.x"           /* common timers */
-#include "cm_hash.x"       /* common hash list */
-#include "cm_lib.x"        /* common library */
-#include "cm_llist.x"      /* common linked list */
-#include "cm_mblk.x"       /* memory management */
-#include "cm_tkns.x"       /* common tokens */
-#include "cm_lte.x"        /* common tokens */
 #include "tfu.x"           /* RGU types */
 #include "lrg.x"           /* layer management typedefs for MAC */
 #include "rgr.x"           /* layer management typedefs for MAC */
 
 #ifdef LTE_ADV
 
-PUBLIC Void rgSCHSCellActivation ARGS((
+Void rgSCHSCellActivation ARGS((
 RgSchUeCellInfo  *sCell
 ));
 
-PUBLIC Void rgSCHSCellSchdActDeactCe ARGS((
+Void rgSCHSCellSchdActDeactCe ARGS((
 RgSchUeCb         *ueCb,
 RgSchDlHqTbCb     *tbInfo
 ));
-PUBLIC Void rgSCHSCellAddToActDeactLst ARGS((
+Void rgSCHSCellAddToActDeactLst ARGS((
 RgSchCellCb                *cell,
 RgSchUeCb                  *ue
 ));
 
-PUBLIC Void rgSCHSCellRmvFrmActLst ARGS((
+Void rgSCHSCellRmvFrmActLst ARGS((
 RgSchCellCb                *cell,
 RgSchUeCb                  *ue
 ));
-PUBLIC S16 rgSCHSCellIsActive ARGS((
+S16 rgSCHSCellIsActive ARGS((
 RgSchCellCb                *cell,
 RgSchUeCb                  *ue
 ));
 
-PUBLIC Void rgSCHSCellHndlFdbkInd ARGS((
+Void rgSCHSCellHndlFdbkInd ARGS((
 RgSchDlHqProcCb   *hqP,
-U8                tbIdx,
-U8                fdbk,
+uint8_t                tbIdx,
+uint8_t                fdbk,
 Bool              maxHqRetxReached
 ));
 
 #ifdef LTE_ADV
-PUBLIC Void rgSCHSCellDeactTmrExpry ARGS((
+Void rgSCHSCellDeactTmrExpry ARGS((
 RgSchUeCellInfo *sCell
 ));
 #endif
 
-PUBLIC Void rgSCHSCellDelUeSCell ARGS((
+Void rgSCHSCellDelUeSCell ARGS((
 RgSchCellCb  *cellCb,
 RgSchUeCb    *ueCb,
-U8            sCellIdx
+uint8_t            sCellIdx
 ));
 
-PUBLIC S16 rgSCHSCellDelUe ARGS((
+S16 rgSCHSCellDelUe ARGS((
 RgSchCellCb  *cellCb,
 RgSchUeCb    *ueCb
 ));
 #ifdef TFU_UPGRADE
-PUBLIC S16 rgSCHSCellPCqiCfg ARGS((
+S16 rgSCHSCellPCqiCfg ARGS((
 RgSchCellCb  *priCellCb,
 RgSchCellCb  *secCellCb,
 RgSchUeCb    *ueCb,
 RgrUePrdDlCqiCfg  *cqiCfg,
 CmLteUeCategory   ueCat,
-U8            sCellIdx
+uint8_t            sCellIdx
 ));
 #endif
-PRIVATE S16 rgSCHSCellTrgMacHqEReset ARGS((
+static S16 rgSCHSCellTrgMacHqEReset ARGS((
 Inst          inst,
-U16           secCellId,
-U16           rnti
+uint16_t           secCellId,
+uint16_t           rnti
 ));
 
 
@@ -150,22 +132,11 @@ U16           rnti
  *  @return     Void
  *      -# None.
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellSchdActDeactCe
-(
-RgSchUeCb         *ueCb,
-RgSchDlHqTbCb     *tbInfo
-)
-#else
-PUBLIC Void rgSCHSCellSchdActDeactCe(ueCb, tbInfo)
-RgSchUeCb         *ueCb;
-RgSchDlHqTbCb     *tbInfo;
-#endif
+Void rgSCHSCellSchdActDeactCe(RgSchUeCb  *ueCb,RgSchDlHqTbCb *tbInfo)
 {
 
-   U8   bitVal = 0;
-   U8   sCellActDeactBitMask = 0;
-   TRC3(rgSCHSCellSchdActDeactCe);
+   uint8_t   bitVal = 0;
+   uint8_t   sCellActDeactBitMask = 0;
 
    /* Change the state of all Scells waiting for
     * activation */
@@ -177,7 +148,7 @@ RgSchDlHqTbCb     *tbInfo;
      * 0 for deactivation
      * */
 
-   for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+   for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
    {
       if(ueCb->cellInfo[idx] != NULLP)
       {
@@ -219,7 +190,7 @@ RgSchDlHqTbCb     *tbInfo;
    tbInfo->schdSCellActCe.pres    = PRSNT_NODEF;
    tbInfo->schdSCellActCe.val     = sCellActDeactBitMask;
 
-   RETVOID;
+   return;
 } /* rgSCHSCellSchdActDeactCe */
 
 \f
@@ -238,20 +209,9 @@ RgSchDlHqTbCb     *tbInfo;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellAddToActDeactLst
-(
-RgSchCellCb                *cell,
-RgSchUeCb                  *ue
-)
-#else
-PUBLIC Void rgSCHSCellAddToActDeactLst(cell, ue)
-RgSchCellCb                *cell;
-RgSchUeCb                  *ue;
-#endif
+Void rgSCHSCellAddToActDeactLst(RgSchCellCb *cell,RgSchUeCb *ue)
 {
    RgSchCmnDlCell *cellCmnDl = RG_SCH_CMN_GET_DL_CELL(cell);
-   TRC3(rgSCHSCellAddToActDeactLst);
 
    if(NULLP == ue->sCellActLnk.node)
    {/* Ue is not present in the list */
@@ -260,11 +220,10 @@ RgSchUeCb                  *ue;
    }
    else
    {
-      RGSCHDBGINFONEW(cell->instIdx,(rgSchPBuf(cell->instIdx),
-            "SCell is already added in the Act List: ueId(%u)\n", ue->ueId));
+      DU_LOG("\nINFO  -->  SCH : SCell is already added in the Act List: ueId(%u)\n", ue->ueId);
    }
    
-   RETVOID;
+   return;
 }
 
 \f
@@ -283,27 +242,16 @@ RgSchUeCb                  *ue;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellRmvFrmActLst
-(
-RgSchCellCb                *cell,
-RgSchUeCb                  *ue
-)
-#else
-PUBLIC Void rgSCHSCellRmvFrmActLst(cell, ue)
-RgSchCellCb                *cell;
-RgSchUeCb                  *ue;
-#endif
+Void rgSCHSCellRmvFrmActLst(RgSchCellCb *cell,RgSchUeCb *ue)
 {
    RgSchCmnDlCell *cellCmnDl = RG_SCH_CMN_GET_DL_CELL(cell);
-   TRC3(rgSCHSCellRmvFrmActLst);
    if (NULLP != ue->sCellActLnk.node)
    {
       cmLListDelFrm(&cellCmnDl->secCellActCeLst, &ue->sCellActLnk);
    }
    ue->sCellActLnk.node = (PTR)NULLP;
 
-   RETVOID;
+   return;
 }
 \f
 /**
@@ -323,15 +271,7 @@ RgSchUeCb                  *ue;
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellActivation
-(
-RgSchUeCellInfo  *sCellInfo
-)
-#else
-PUBLIC Void rgSCHSCellActivation(sCellInfo)
-RgSchUeCellInfo  *sCellInfo
-#endif
+Void rgSCHSCellActivation(RgSchUeCellInfo  *sCellInfo)
 {
    RgSchCellCb  *sCell = sCellInfo->cell;
    RgSchUeCb    *ueCb = sCellInfo->ue;
@@ -340,18 +280,17 @@ RgSchUeCellInfo  *sCellInfo
 #ifdef DEBUGP
    Inst   inst = ueCb->cell->instIdx;
 #endif
-   U16    tempIdx; 
+   uint16_t    tempIdx; 
    RgrUePrdDlCqiCfg  *cqiCfg;
-   U8     j;  /*Bandwidth Parts*/
-   U16    riTrInsTime; 
-   U16    periodicity; 
-   U16    cqiTrInstTime; 
+   uint8_t     j;  /*Bandwidth Parts*/
+   uint16_t    riTrInsTime; 
+   uint16_t    periodicity; 
+   uint16_t    cqiTrInstTime; 
    RgSchUePCqiCb *cqiCb = NULLP;
    CmLteTimingInfo timingInfo;
-   U16    crntTime;           
+   uint16_t    crntTime;           
 #endif
 
-   TRC3(rgSCHSCellActivation);
 
    sCellInfo->sCellState = RG_SCH_SCELL_ACTIVE;
 #ifdef TENB_STATS
@@ -359,7 +298,8 @@ RgSchUeCellInfo  *sCellInfo
 #endif
 
 #ifdef CA_DBG 
-   printf("ueId is SCELL_ACTIVE\n ueCb->ueId = %d sCell->sCellIdx =%d, sCell->sCellId=%d, sCell->sCellState=%d \n", ueCb->ueId, sCellInfo->sCellIdx, sCellInfo->sCellId, sCellInfo->sCellState);
+    DU_LOG("\nDEBUG  -->  SCH : ueId is SCELL_ACTIVE\n ueCb->ueId = %d sCell->sCellIdx =%d,\
+    sCell->sCellId=%d, sCell->sCellState=%d \n", ueCb->ueId, sCellInfo->sCellIdx, sCellInfo->sCellId, sCellInfo->sCellState);
 #endif
    /* Start the sCellDeactivation timer if cfgd */
    if(PRSNT_NODEF == ueCb->sCellDeactTmrVal.pres)
@@ -397,19 +337,18 @@ RgSchUeCellInfo  *sCellInfo
 
       cqiCb->nCqiTrIdx = cqiCb->nCqiTrIdx
          %RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
-      RGSCHDBGINFONEW(inst, (rgSchPBuf(inst), "CQI Config: idx(%u) Periodicity %u"
+      DU_LOG("\nINFO  -->  SCH : CQI Config: idx(%u) Periodicity %u"
                "Offset %u uePosInQ (%u)\n", cqiCfg->cqiSetup.cqiPCfgIdx,
-               cqiCb->cqiPeri, cqiCb->cqiOffset,cqiCb->nCqiTrIdx));
+               cqiCb->cqiPeri, cqiCb->cqiOffset,cqiCb->nCqiTrIdx);
 
       cmLListAdd2Tail(&ueCb->cell->pCqiSrsSrLst[cqiCb->nCqiTrIdx].cqiLst,
             &cqiCb->cqiLstEnt);  
 
       rgSCHUtlSCellHndlCqiCollsn(cqiCb);
 
-      RGSCHDBGINFO(inst,(rgSchPBuf(inst), 
-               "\n rgSCHCfgPCqiUeCfg():"
+      DU_LOG("\nINFO  -->  SCH :  rgSCHCfgPCqiUeCfg():"
                "  CrntTime=%d  Next CqiTrInstTime=%d  Index Stored at=%d  ",
-               crntTime, cqiTrInstTime, cqiCb->nCqiTrIdx));
+               crntTime, cqiTrInstTime, cqiCb->nCqiTrIdx);
 
       if(cqiCfg->cqiSetup.riEna)
       {
@@ -468,8 +407,8 @@ RgSchUeCellInfo  *sCellInfo
             % RG_SCH_PCQI_SRS_SR_TRINS_SIZE;
          if(periodicity >= RG_SCH_PCQI_SRS_SR_TRINS_SIZE)
          {  
-            cqiCb->riDist = rgSCHUtlFindDist((U16)(crntTime + TFU_RECPREQ_DLDELTA),
-                  (U16) tempIdx);
+            cqiCb->riDist = rgSCHUtlFindDist((uint16_t)(crntTime + TFU_RECPREQ_DLDELTA),
+                  (uint16_t) tempIdx);
          }
          else
          {
@@ -486,25 +425,24 @@ RgSchUeCellInfo  *sCellInfo
          rgSCHUtlSCellHndlRiCollsn(cqiCb);
          /*werror*/
 #ifndef BIT_64
-         RGSCHDBGINFONEW(inst,(rgSchPBuf(inst), "SCel RI cfg:"
+         DU_LOG("\nINFO  -->  SCH : SCel RI cfg:"
                   "idx %u period %u Offset %u posInQ(%u) riDist(%u)lst count"
                   "%lu\n", cqiCfg->cqiSetup.riCfgIdx, cqiCb->riPeri,
                   cqiCb->riOffset, cqiCb->nRiTrIdx, cqiCb->riDist, 
-                  ueCb->cell->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst.count));
+                  ueCb->cell->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst.count);
 #else
-         RGSCHDBGINFONEW(inst,(rgSchPBuf(inst), "SCel RI cfg:"
+         DU_LOG("\nINFO  -->  SCH : SCel RI cfg:"
                   "idx %u period %u Offset %u posInQ(%u) riDist(%u)lst count"
                   "%u\n", cqiCfg->cqiSetup.riCfgIdx, cqiCb->riPeri,
                   cqiCb->riOffset, cqiCb->nRiTrIdx, cqiCb->riDist, 
-                  ueCb->cell->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst.count));
+                  ueCb->cell->pCqiSrsSrLst[cqiCb->nRiTrIdx].riLst.count);
 
 
 #endif
 
-         RGSCHDBGINFO(inst,(rgSchPBuf(inst),
-                  "\n rgSCHSCellActivation(): CrntTime=%d Next RiTrInstTime=%d"
+         DU_LOG("\nINFO  -->  SCH : \n rgSCHSCellActivation(): CrntTime=%d Next RiTrInstTime=%d"
                   "Index Stored at=%d riDis=%d ",
-                  crntTime, riTrInsTime, cqiCb->nRiTrIdx, cqiCb->riDist));
+                  crntTime, riTrInsTime, cqiCb->nRiTrIdx, cqiCb->riDist);
       }
    }
 #endif
@@ -512,7 +450,7 @@ RgSchUeCellInfo  *sCellInfo
    cellSch = RG_SCH_CMN_GET_CELL(sCellInfo->cell);
    cellSch->apisDl->rgSCHDlSCellActv(sCellInfo->cell, sCellInfo->ue);
 
-   RETVOID;
+   return;
 }
 
 #ifdef TFU_UPGRADE
@@ -532,18 +470,9 @@ RgSchUeCellInfo  *sCellInfo
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PRIVATE Void rgSCHCellClearScellLstOfCQI
-(
-RgSchUeCellInfo *sCellInfo
-)
-#else
-PRIVATE Void rgSCHCellClearScellLstOfCQI(sCellInfo)
-RgSchUeCellInfo *sCellInfo;
-#endif
+static Void rgSCHCellClearScellLstOfCQI(RgSchUeCellInfo *sCellInfo)
 {
 
-   TRC3(rgSCHCellClearScellLstOfCQI);
    RgSchUePCqiCb *cqiRiCb = NULLP;
    RgSchUeCb    *ueCb;
    ueCb = sCellInfo->ue;
@@ -576,7 +505,7 @@ RgSchUeCellInfo *sCellInfo;
       }
    }
 
-   RETVOID;
+   return;
 }
 #endif/*TFU_UPGRADE*/
 \f
@@ -600,21 +529,12 @@ RgSchUeCellInfo *sCellInfo;
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PRIVATE S16 rgSCHSCellDeActivation
-(
-RgSchUeCellInfo *sCellInfo
-)
-#else
-PRIVATE S16 rgSCHSCellDeActivation(sCellInfo)
-RgSchUeCellInfo *sCellInfo
-#endif
+static S16 rgSCHSCellDeActivation(RgSchUeCellInfo *sCellInfo)
 {
-   RETVALUE(ROK);
+   return ROK;
    RgSchCmnCell *cellSch;
    Inst inst = sCellInfo->cell->instIdx;
 
-   TRC3(rgSCHSCellDeActivation);
    /* Stop the timer if running */
 
    if(sCellInfo->deactTmr.tmrEvnt != TMR_NONE)
@@ -658,10 +578,11 @@ RgSchUeCellInfo *sCellInfo
    cellSch->apisDl->rgSCHDlSCellDeactv(sCellInfo->cell, sCellInfo->ue);
 
 #ifdef CA_DBG 
-   printf("SCELL DEATIVATED  sCellInfo->ue->ueId =%d, sCellInfo->sCellId =%d\n", sCellInfo->ue->ueId, sCellInfo->sCellId);
+   DU_LOG("\nDEBUG  -->  SCH : SCELL DEATIVATED  sCellInfo->ue->ueId =%d, sCellInfo->sCellId =%d\n",\
+   sCellInfo->ue->ueId, sCellInfo->sCellId);
    //MSPD_DBG("SCELL DEATIVATED  sCellInfo->ue->ueId =%d, sCellInfo->sCellId =%d\n", sCellInfo->ue->ueId, sCellInfo->sCellId);
 #endif
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
@@ -679,24 +600,12 @@ RgSchUeCellInfo *sCellInfo
  *
  *     Invoked by: CommonScheduler
  *
- *  @param[in]  U16        sCellId
- *  @param[in]  U16        rnti
+ *  @param[in]  uint16_t        sCellId
+ *  @param[in]  uint16_t        rnti
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PRIVATE S16 rgSCHSCellTrgMacHqEReset
-(
-Inst          inst,
-U16           secCellId,
-U16           rnti
-)
-#else
-PRIVATE S16 rgSCHSCellTrgMacHqEReset(inst,secCellId,rnti)
-Inst          inst;
-U16           secCellId;
-U16           rnti;
-#endif
+static S16 rgSCHSCellTrgMacHqEReset(Inst inst,uint16_t secCellId,uint16_  rnti)
 {
    Pst               pst;
    RgSchCellCb      *secCellCb = NULLP;
@@ -704,8 +613,8 @@ U16           rnti;
 
    if((secCellCb = (RgSchCellCb *)rgSchUtlGetCellCb(inst, secCellId)) == NULLP)
    {
-      RGSCHDBGERRNEW(inst, (rgSchPBuf(inst), "SCell doesnt exists"));
-      RETVALUE(RFAILED);
+      DU_LOG("\nERROR  -->  SCH : SCell doesnt exists");
+      return RFAILED;
    }
 
    hqEntRstInfo.cellId = secCellId;
@@ -715,7 +624,7 @@ U16           rnti;
 
    RgSchMacRstHqEnt(&pst, &hqEntRstInfo);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 /*removed endif*/
 
@@ -741,28 +650,13 @@ U16           rnti;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellHndlFdbkInd
-(
-RgSchDlHqProcCb   *hqP,
-U8                tbIdx,
-U8                fdbk,
-Bool              maxHqRetxReached
-)
-#else
-PUBLIC Void rgSCHSCellHndlFdbkInd(hqP, tbIdx, fdbk,maxHqRetxReached)
-RgSchDlHqProcCb   *hqP;
-U8                tbIdx;
-U8                fdbk;
-Bool              maxHqRetxReached;
-#endif
+Void rgSCHSCellHndlFdbkInd(RgSchDlHqProcCb *hqP,uint8_t tbIdx,uint8_t  fdbk,Bool maxHqRetxReached)
 {
 
    RgSchUeCb      *ueCb;
    RgSchCellCb    *cell;
    RgSchUeCellInfo *sCellInfo;
 
-   TRC3(rgSCHSCellHndlFdbkInd);
 
    ueCb  = hqP->hqE->ue;
    cell  = ueCb->cell;
@@ -772,14 +666,14 @@ Bool              maxHqRetxReached;
          {
             hqP->tbInfo[tbIdx].schdSCellActCe.pres =  FALSE;
 
-            for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+            for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
             {
                if(ueCb->cellInfo[idx] != NULLP) 
                {
                   if(ueCb->cellInfo[idx]->sCellState == RG_SCH_SCELL_ACTVTN_IN_PROG)
                   {
 #ifdef CA_DBG
-                     printf("\n starting delay timer...\n");
+                     DU_LOG("\nINFO  -->  SCH : starting delay timer...\n");
 #endif                     
                      rgSCHTmrStartTmr (cell,ueCb->cellInfo[idx] ,RG_SCH_TMR_SCELL_ACT_DELAY,
                            RG_SCH_CMN_SCELL_ACT_DELAY_TMR);
@@ -802,7 +696,7 @@ Bool              maxHqRetxReached;
             if(TRUE == maxHqRetxReached)
             {
                hqP->tbInfo[tbIdx].schdSCellActCe.pres =  FALSE;
-               for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+               for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
                {
                   if(ueCb->cellInfo[idx] != NULLP) 
                   {
@@ -827,7 +721,7 @@ Bool              maxHqRetxReached;
       default:
          break;
    }
-   RETVOID;
+   return;
 }
 
 #ifdef LTE_ADV
@@ -850,18 +744,9 @@ Bool              maxHqRetxReached;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellDeactTmrExpry
-(
-RgSchUeCellInfo *sCellInfo
-)
-#else
-PUBLIC Void rgSCHSCellDeactTmrExpry(sCellInfo)
-RgSchUeCellInfo *sCellInfo;
-#endif
+Void rgSCHSCellDeactTmrExpry(RgSchUeCellInfo *sCellInfo)
 {
 
-   TRC3(rgSCHSCellDeactTmrExpry);
    if (sCellInfo->ue->isScellExplicitDeAct == TRUE)
    {
       /* Deactivation Timer is not configured (infinity), thus send deactivation CE explicitly */ 
@@ -872,7 +757,7 @@ RgSchUeCellInfo *sCellInfo;
       }
       else
       {
-         printf (" !!!!!! Avoiding DEACT for UE %d because of LAA Cell !!!!!!!!!!!!! \n",
+         DU_LOG("\nERROR  -->  SCH : !!!!!! Avoiding DEACT for UE %d because of LAA Cell !!!!!!!!!!!!! \n",
          sCellInfo->ue->ueId);
       }
 
@@ -882,7 +767,7 @@ RgSchUeCellInfo *sCellInfo;
       /* Deactivation Timer is configured, thus assume that UE has deactivated */ 
       rgSCHSCellDeActivation(sCellInfo);
    }
-   RETVOID;
+   return;
 }
 #endif
 \f
@@ -901,46 +786,29 @@ RgSchUeCellInfo *sCellInfo;
  *
  *  @param[in]  RgSchCellCb *cellCb
  *  @param[in]  RgSchUeCb   *ueCb
- *  @param[in]  U8           sCellIdx
- *  @param[in]  U8           action
+ *  @param[in]  uint8_t           sCellIdx
+ *  @param[in]  uint8_t           action
  *
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PUBLIC S16 rgSCHSCellTrigActDeact
-(
-RgSchCellCb  *cell,
-RgSchUeCb    *ueCb,
-U8            sCellIdx,
-U8            action
-)
-#else
-PUBLIC S16 rgSCHSCellTrigActDeact(cell,ueCb,sCellIdx,action)
-RgSchCellCb  *cell,
-RgSchUeCb    *ueCb;
-U8            sCellIdx;
-U8            action;
-#endif
+S16 rgSCHSCellTrigActDeact(RgSchCellCb *cell,RgSchUeCb *ueCb,uint8_t sCellIdx,uint8_t action)
 {
    Inst inst = cell->instIdx;
    S16 ret   = ROK;
 
-   TRC3(rgSCHSCellTrigActDeact);
-
    if((sCellIdx < 1) ||
       (sCellIdx > RGR_MAX_SCELL_PER_UE))
    {
-      RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid Serv Cell Idx %d\n", \
-               sCellIdx));
-      RETVALUE(RFAILED);
+      DU_LOG("\nERROR  -->  SCH : Invalid Serv Cell Idx %d\n", sCellIdx);
+      return RFAILED;
    }
 
    if(ueCb->cellInfo[sCellIdx] == NULLP)
    {
-      RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Serv Cell not added to this Ue Scell Idx %d ueId %d\n", \
-              sCellIdx,ueCb->ueId));
-      RETVALUE(RFAILED);
+      DU_LOG("\nERROR  -->  SCH : Serv Cell not added to this Ue Scell Idx %d ueId %d\n", \
+              sCellIdx,ueCb->ueId);
+      return RFAILED;
    }
 
    switch (action)
@@ -949,8 +817,8 @@ U8            action;
       {
          if(ueCb->cellInfo[sCellIdx]->sCellState != RG_SCH_SCELL_INACTIVE)
          {
-            RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid state %u for preparing SCell Idx %u for UE %u\n", \
-                     ueCb->cellInfo[sCellIdx]->sCellState, sCellIdx, ueCb->ueId));
+            DU_LOG("\nERROR  -->  SCH : Invalid state %u for preparing SCell Idx %u for UE %u\n", \
+                     ueCb->cellInfo[sCellIdx]->sCellState, sCellIdx, ueCb->ueId);
             ret = RFAILED;
          }
          else
@@ -961,8 +829,10 @@ U8            action;
             /* Setting allocCmnUlPdcch flag to FALSE, So that PDCCH allocation will be done 
                from UE Searchspace */
             ueCb->allocCmnUlPdcch = FALSE;
-            printf("\n***** SCellIdx=%d state Changed to %d State \n",sCellIdx, ueCb->cellInfo[sCellIdx]->sCellState);
-            printf("\n***** SCellInfo Addr=%p state Changed to RG_SCH_SCELL_READY\n",(void*)ueCb->cellInfo[sCellIdx]);
+            DU_LOG("\nINFO  -->  SCH : ***** SCellIdx=%d state Changed to %d State \n",sCellIdx,\
+           ueCb->cellInfo[sCellIdx]->sCellState);
+            DU_LOG("\nINFO  -->  SCH : ***** SCellInfo Addr=%p state Changed to RG_SCH_SCELL_READY\n",\
+           (void*)ueCb->cellInfo[sCellIdx]);
          }
          break;
       }
@@ -970,8 +840,8 @@ U8            action;
       {
          if(ueCb->cellInfo[sCellIdx]->sCellState != RG_SCH_SCELL_READY)
          {
-            RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid state %u for activating SCell Idx %u for UE %u\n", \
-                     ueCb->cellInfo[sCellIdx]->sCellState, sCellIdx, ueCb->ueId));
+            DU_LOG("\nERROR  -->  SCH : Invalid state %u for activating SCell Idx %u for UE %u\n", \
+                     ueCb->cellInfo[sCellIdx]->sCellState, sCellIdx, ueCb->ueId);
             ret = RFAILED;
          }
          else
@@ -989,8 +859,8 @@ U8            action;
       {
          if(ueCb->cellInfo[sCellIdx]->sCellState != RG_SCH_SCELL_ACTIVE)
          {
-            RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid state %u for deactivating SCell Idx %u for UE %u\n", \
-                     ueCb->cellInfo[sCellIdx]->sCellState, sCellIdx, ueCb->ueId));
+            DU_LOG("\nERROR  -->  SCH : Invalid state %u for deactivating SCell Idx %u for UE %u\n", \
+                     ueCb->cellInfo[sCellIdx]->sCellState, sCellIdx, ueCb->ueId);
             ret = RFAILED;
          }
          else
@@ -1006,13 +876,13 @@ U8            action;
       }
       default:
       {
-         RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid action received for SCell Idx %u for UE %u\n", \
-                  sCellIdx, ueCb->ueId));
+         DU_LOG("\nERROR  -->  SCH : Invalid action received for SCell Idx %u for UE %u\n", \
+                  sCellIdx, ueCb->ueId);
          ret = RFAILED;
          break;
       }
    }
-   RETVALUE(ret);
+   return (ret);
 }
 
  \f
@@ -1032,31 +902,18 @@ U8            action;
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PRIVATE S16 rgSCHSCellSelectForAct
-(
-RgSchCellCb  *cell,
-RgSchUeCb    *ueCb,
-U8           *sCellIdx
-)
-#else
-PRIVATE S16 rgSCHSCellSelectForAct(cell, ueCb)
-RgSchCellCb  *cell;
-RgSchUeCb    *ueCb;
-U8           *sCellIdx;
-#endif
+static S16 rgSCHSCellSelectForAct(RgSchCellCb *cell,RgSchUeCb  *ueCb,uint8_t *sCellIdx)
 {
-   TRC3(rgSCHSCellSelectAndAct);
 
    for((*sCellIdx) = 1; (*sCellIdx) <= RG_SCH_MAX_SCELL; (*sCellIdx)++)
    {
       if((ueCb->cellInfo[(*sCellIdx)] != NULLP) &&
             (ueCb->cellInfo[(*sCellIdx)]->sCellState == RG_SCH_SCELL_READY))
       {
-         RETVALUE(ROK);
+         return ROK;
       }
    }
-   RETVALUE(RFAILED);
+   return RFAILED;
 }
 
 /**
@@ -1071,26 +928,14 @@ U8           *sCellIdx;
  *
  *  @param[in]  RgSchCellCb *cellCb
  *  @param[in]  RgSchUeCb   *ueCb
- *  @param[in]  U8          action
+ *  @param[in]  uint8_t          action
  *
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellSelectAndActDeAct
-(
-RgSchCellCb  *pCell,
-RgSchUeCb    *ueCb,
-U8           action
-)
-#else
-PUBLIC Void rgSCHSCellSelectAndActDeAct(pCell, ueCb, action)
-RgSchCellCb  *pCell;
-RgSchUeCb    *ueCb;
-U8           action;
-#endif
+Void rgSCHSCellSelectAndActDeAct(RgSchCellCb  *pCell,RgSchUeCb *ueCb,uint8_t action)
 {
-   U8  sCellIdx = 0;
+   uint8_t  sCellIdx = 0;
    S16 ret = ROK;
 
    switch (action)
@@ -1100,19 +945,19 @@ U8           action;
 
             if(((ret = rgSCHSCellSelectForAct(pCell, ueCb, &sCellIdx)) == ROK)
                   && (sCellIdx == 0))
-               RETVOID;
+               return;
             break;
          }
          default:
-         RETVOID;
+         return;
    }
    if ((ret != ROK) || 
          (ROK != (rgSCHSCellTrigActDeact(pCell, ueCb, sCellIdx, action))))
    {
-      RGSCHDBGERR(pCell->instIdx,(rgSchPBuf(pCell->instIdx), "SCell Actication failed"
-               "for UE [%d] with SCellIdx [%d]\n", ueCb->ueId, sCellIdx));
+      DU_LOG("\nERROR  -->  SCH : SCell Actication failed"
+               "for UE [%d] with SCellIdx [%d]\n", ueCb->ueId, sCellIdx);
    }
-   RETVOID;
+   return;
 }
 
  \f
@@ -1131,39 +976,26 @@ U8           action;
  *
  *  @param[in]  RgSchCellCb  *cellCb
  *  @param[in]  RgSchUeCb    *ueCb
- *  @param[in]  U8            idx
+ *  @param[in]  uint8_t            idx
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellDelUeSCell
-(
-RgSchCellCb  *cellCb,
-RgSchUeCb    *ueCb,
-U8            sCellIdx
-)
-#else
-PUBLIC Void rgSCHSCellDelUeSCell(cellCb,ueCb,sCellIdx)
-RgSchCellCb  *cellCb;
-RgSchUeCb    *ueCb;
-U8            sCellIdx;
-#endif
+Void rgSCHSCellDelUeSCell(RgSchCellCb  *cellCb,RgSchUeCb *ueCb,uint8_t sCellIdx)
 {
    RgUeUlHqCb       *ulHqEnt;
    Inst inst = cellCb->instIdx;
    RgSchUeCellInfo *sCellInfo;
    RgSchCmnUlUe *ueUl;
 
-   TRC3(rgSCHSCellDelUeSCell);
    sCellInfo = ueCb->cellInfo[sCellIdx];
 
 
    if(sCellInfo == NULLP)
    {
-      RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Serv Cell not added to this Ue Scell Idx %d\
+      DU_LOG("\nERROR  -->  SCH : Serv Cell not added to this Ue Scell Idx %d\
                ueId %d\n",
-               sCellIdx,ueCb->ueId));
-      RETVOID;
+               sCellIdx,ueCb->ueId);
+      return;
    }
 
    rgSCHDbmDelUeCb(sCellInfo->cell, ueCb);
@@ -1200,7 +1032,7 @@ U8            sCellIdx;
 
    ueCb->cellInfo[sCellIdx] = NULLP;
    
-   RETVOID;
+   return;
 }
 \f
 /**
@@ -1222,27 +1054,16 @@ U8            sCellIdx;
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PUBLIC S16 rgSCHSCellDelUe
-(
-RgSchCellCb  *cellCb,
-RgSchUeCb    *ueCb
-)
-#else
-PUBLIC S16 rgSCHSCellDelUe(cellCb,ueCb)
-RgSchCellCb  *cellCb;
-RgSchUeCb    *ueCb;
-#endif
+S16 rgSCHSCellDelUe(RgSchCellCb *cellCb,RgSchUeCb *ueCb)
 {
 
-   TRC3(rgSCHSCellDelUe);
 
-   for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+   for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
    {
       rgSCHSCellDelUeSCell(cellCb,ueCb,idx);
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #ifdef TFU_UPGRADE
@@ -1277,46 +1098,33 @@ RgSchUeCb    *ueCb;
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PUBLIC S16 rgSCHSCellPCqiCfg
+S16 rgSCHSCellPCqiCfg
 (
 RgSchCellCb  *priCellCb,
 RgSchCellCb  *secCellCb,
 RgSchUeCb    *ueCb,
 RgrUePrdDlCqiCfg  *cqiCfg,
 CmLteUeCategory   ueCat,
-U8            sCellIdx
+uint8_t sCellIdx
 )
-#else
-PUBLIC S16 rgSCHSCellPCqiCfg(priCellCb,secCellCb,ueCb,cqiCfg,ueCat,sCellIdx)
-RgSchCellCb       *priCellCb;
-RgSchCellCb       *secCellCb;
-RgSchUeCb         *ueCb;
-RgrUePrdDlCqiCfg  *cqiCfg;
-CmLteUeCategory    ueCat;
-U8                sCellIdx;
-#endif
 {
-   U8     j;  /*Bandwidth Parts*/
-   U8     temp; 
+   uint8_t     j;  /*Bandwidth Parts*/
+   uint8_t     temp; 
 #ifdef DEBUGP
    Inst   inst = priCellCb->instIdx;
 #endif
    RgSchUeCellInfo *sCellInfo;
    RgSchUePCqiCb *cqiCb = NULLP;
 
-   TRC3(rgSCHSCellPCqiCfg);
-
-   RGSCHDBGINFO(priCellCb->instIdx, (rgSchPBuf(priCellCb->instIdx), 
-            "rgSCHSCellPCqiCfg cellId =%d, ueId = %d, CfgType =%d\n",
-            secCellCb->cellId,  ueCb->ueId, cqiCfg->type));
+   DU_LOG("\nINFO  -->  SCH : rgSCHSCellPCqiCfg cellId =%d, ueId = %d, CfgType =%d\n",
+            secCellCb->cellId,  ueCb->ueId, cqiCfg->type);
    
    if((sCellIdx < 1) ||
       (sCellIdx > RGR_MAX_SCELL_PER_UE))
    {
-      RGSCHDBGERRNEW(inst, (rgSchPBuf(inst),"Invalid Serv Cell Idx %d\n",
-               sCellIdx));
-      RETVALUE(RFAILED);
+      DU_LOG("\nERROR  -->  SCH : Invalid Serv Cell Idx %d\n",
+               sCellIdx);
+      return RFAILED;
    }
 
    sCellInfo = ueCb->cellInfo[sCellIdx];
@@ -1328,7 +1136,7 @@ U8                sCellIdx;
    if (cqiCfg->type == RGR_SCH_PCQI_SETUP)
    {   
       /*  1. Copy the Received CQI Cfg parameters to ueCb  */
-      cmMemcpy((U8 *)&cqiCb->cqiCfg, (U8 *)cqiCfg, 
+      memcpy(&cqiCb->cqiCfg, cqiCfg, 
             sizeof(RgrUePrdDlCqiCfg));
 
       /*  2. Compute Periodic CQI Periodicity and subframe offset   */
@@ -1342,13 +1150,12 @@ U8                sCellIdx;
 #endif
 
 
-      RGSCHDBGINFO(priCellCb->instIdx,(rgSchPBuf(priCellCb->instIdx), 
-               "\n rgSCHSCellPCqiCfg(): CQI Peri=%d, CQI Offset=%d", 
-               cqiCb->cqiPeri,cqiCb->cqiOffset));
+      DU_LOG("\nDEBUG  -->  SCH :  rgSCHSCellPCqiCfg(): CQI Peri=%d, CQI Offset=%d", 
+               cqiCb->cqiPeri,cqiCb->cqiOffset);
 
       if(RGR_UE_PCQI_SB_REP == cqiCfg->cqiSetup.cqiRepType)
       {
-         U8     k;  /*SubBand Size (RB) */
+         uint8_t     k;  /*SubBand Size (RB) */
          RG_SCH_GET_CQI_J_VAL(secCellCb->bwCfg.dlTotalBw, j);
          RG_SCH_GET_CQI_K_VAL(secCellCb->bwCfg.dlTotalBw, k);
          cqiCb->J = j; /*Number of Bandwidth Parts*/
@@ -1377,9 +1184,8 @@ U8                sCellIdx;
                cqiCfg->cqiSetup.riCfgIdx,
                &cqiCb->riPeri, &cqiCb->riOffset);
 
-         RGSCHDBGINFO(priCellCb->instIdx,(rgSchPBuf(priCellCb->instIdx),
-                  "\n rgSCHSCellPCqiCfg(): RI Peri=%d, RI Offset=%d", 
-                  cqiCb->riPeri,cqiCb->riOffset));
+         DU_LOG("\nDEBUG  -->  SCH :  rgSCHSCellPCqiCfg(): RI Peri=%d, RI Offset=%d", 
+                  cqiCb->riPeri,cqiCb->riOffset);
 
          if(ueCb->cellInfo[sCellIdx]->txMode.txModeEnum == RGR_UE_TM_3 
                || ueCb->cellInfo[sCellIdx]->txMode.txModeEnum == RGR_UE_TM_4)
@@ -1421,7 +1227,7 @@ U8                sCellIdx;
    cqiCb->riDist    = RG_SCH_INVALID_IDX; 
    cqiCb->nCqiTrIdx = RG_SCH_INVALID_IDX;
  
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif
 
@@ -1441,22 +1247,11 @@ U8                sCellIdx;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellDlUeReset
-(
-RgSchCellCb                *cell,
-RgSchUeCb                  *ue
-)
-#else
-PUBLIC Void rgSCHSCellDlUeReset(cell, ue)
-RgSchCellCb                *cell;
-RgSchUeCb                  *ue;
-#endif
+Void rgSCHSCellDlUeReset(RgSchCellCb *cell,RgSchUeCb *ue)
 {
    RgSchCmnCell *cellSch;
-   TRC3(rgSCHSCellDlUeReset);
 
-   for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+   for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
    {
       if(ue->cellInfo[idx] != NULLP) 
       {
@@ -1466,7 +1261,7 @@ RgSchUeCb                  *ue;
          ue->cellInfo[idx]->sCellState = RG_SCH_SCELL_INACTIVE;
       }
    }
-   RETVOID;
+   return;
 }
 
 
@@ -1486,30 +1281,17 @@ RgSchUeCb                  *ue;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellDlLcCfg
-(
-RgSchCellCb                *cell,
-RgSchUeCb                  *ue,
-RgSchDlLcCb                *svc
-)
-#else
-PUBLIC Void rgSCHSCellDlLcCfg(cell, ue, svc)
-RgSchCellCb                *cell;
-RgSchUeCb                  *ue;
-RgSchDlLcCb                *svc;
-#endif
+Void rgSCHSCellDlLcCfg(RgSchCellCb *cell,RgSchUeCb *ue,RgSchDlLcCb *svc)
 {
    RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
-   TRC3(rgSCHSCellDlLcCfg);
-   for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+   for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
    {
       if(ue->cellInfo[idx] != NULLP) 
       {
          cellSch->apisDl->rgSCHRgrDlLcCfg(ue->cellInfo[idx]->cell, ue, svc,NULLP,NULLP);
       }
    }
-   RETVOID;
+   return;
 }
 
 /**
@@ -1528,30 +1310,17 @@ RgSchDlLcCb                *svc;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellDlLcDel
-(
-RgSchCellCb                *cell,
-RgSchUeCb                  *ue,
-RgSchDlLcCb                *svc
-)
-#else
-PUBLIC Void rgSCHSCellDlLcDel(cell, ue, svc)
-RgSchCellCb                *cell;
-RgSchUeCb                  *ue;
-RgSchDlLcCb                *svc;
-#endif
+Void rgSCHSCellDlLcDel(RgSchCellCb *cell,RgSchUeCb  *ue,RgSchDlLcCb  *svc)
 {
    RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
-   TRC3(rgSCHSCellDlLcDel);
-   for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+   for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
    {
       if(ue->cellInfo[idx] != NULLP) 
       {
          cellSch->apisDl->rgSCHFreeDlLc(ue->cellInfo[idx]->cell, ue, svc);
       }
    }
-   RETVOID;
+   return;
 }
 
 /**
@@ -1570,22 +1339,9 @@ RgSchDlLcCb                *svc;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC Void rgSCHSCellDlDedBoUpd
-(
-RgSchCellCb                *cell,
-RgSchUeCb                  *ue,
-RgSchDlLcCb                *svc
-)
-#else
-PUBLIC Void rgSCHSCellDlDedBoUpd(cell, ue, svc)
-RgSchCellCb                *cell;
-RgSchUeCb                  *ue;
-RgSchDlLcCb                *svc;
-#endif
+Void rgSCHSCellDlDedBoUpd(RgSchCellCb *cell,RgSchUeCb *ue,RgSchDlLcCb *svc)
 {
    RgSchCmnCell *cellSch = RG_SCH_CMN_GET_CELL(cell);
-   TRC3(rgSCHSCellDlDedBoUpd);
 
    /* If this is not invoked by PCell, then
       invoke the call to PCell handler 
@@ -1594,7 +1350,7 @@ RgSchDlLcCb                *svc;
    {
       cellSch->apisDl->rgSCHDlDedBoUpd(ue->cell, ue, svc);
    }
-   for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+   for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
    {
       if((ue->cellInfo[idx] != NULLP) &&
             (ue->cellInfo[idx]->sCellState == RG_SCH_SCELL_ACTIVE) &&
@@ -1603,7 +1359,7 @@ RgSchDlLcCb                *svc;
          cellSch->apisDl->rgSCHDlDedBoUpd(ue->cellInfo[idx]->cell, ue, svc);
       }
    }
-   RETVOID;
+   return;
 }
 #ifdef TFU_UPGRADE
 /**
@@ -1619,23 +1375,12 @@ RgSchDlLcCb                *svc;
  *
  *  @param[in] RgSchUePCqiCb *cqiCb1
  *  @param[in] RgSchUePCqiCb *cqiCb2
- *  @return U8 cqiCb cell idx which has the higher priority
+ *  @return uint8_t cqiCb cell idx which has the higher priority
  *
  **/
-#ifdef ANSI
-PRIVATE U8  rgSCHUtlSCellCmpCqiCfg
-(
-RgSchUePCqiCb *cqiCb1,
-RgSchUePCqiCb *cqiCb2
-)
-#else
-PRIVATE U8  rgSCHUtlSCellCmpCqiCfg(cqiCb1, cqiCb2)
-RgSchUePCqiCb     *cqiCb1;
-RgSchUePCqiCb     *cqiCb2;
-#endif
+static uint8_t  rgSCHUtlSCellCmpCqiCfg(RgSchUePCqiCb *cqiCb1,RgSchUePCqiCb *cqiCb2)
 {
    RgSchUePCqiCb     *retCqiCb;
-   TRC3(rgSCHUtlSCellCmpCqiCfg);
    /* Collision rules are defined in TS 36.213,7.2.2 */
    /* RI, WB first PMI > WB CQI >  SB CQI */
    /* As of now only taking care of RI > WB CQI > SB CQI */
@@ -1668,7 +1413,7 @@ RgSchUePCqiCb     *cqiCb2;
       }
    }
 
-   RETVALUE(retCqiCb->servCellInfo->sCellIdx);
+   return (retCqiCb->servCellInfo->sCellIdx);
 }
 
 /**
@@ -1686,28 +1431,19 @@ RgSchUePCqiCb     *cqiCb2;
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PUBLIC S16 rgSCHUtlSCellHndlCqiCollsn
-(
-RgSchUePCqiCb *cqiCb
-)
-#else
-PUBLIC S16 rgSCHUtlSCellHndlCqiCollsn(cqiCb)
-RgSchUePCqiCb     *cqiCb;
-#endif
+S16 rgSCHUtlSCellHndlCqiCollsn(RgSchUePCqiCb *cqiCb)
 {
-   U32 nPCqiServCellIdx;
-   U32 minPCqiTrIdx;
-   U32 scellPCqiTrIdx;
-   U32 pCqiTrIdx;
+   uint32_t nPCqiServCellIdx;
+   uint32_t minPCqiTrIdx;
+   uint32_t scellPCqiTrIdx;
+   uint32_t pCqiTrIdx;
    RgSchCellCb       *priCellCb = cqiCb->servCellInfo->ue->cell;
    RgSchUeCb         *ueCb = cqiCb->servCellInfo->ue;
-   U16 crntSfIdx;
-   U32 cellIdx;
-   U32 sCellCnt = 0;
+   uint16_t crntSfIdx;
+   uint32_t cellIdx;
+   uint32_t sCellCnt = 0;
    CmLteTimingInfo timingInfo;
-   U8 idx = 0;
-   TRC3(rgSCHUtlSCellHndlCqiCollsn);
+   uint8_t idx = 0;
 
 #ifdef xLTE_TDD
    RG_SCH_ADD_TO_CRNT_TIME(priCellCb->crntTime, timingInfo, TFU_DELTA);
@@ -1778,7 +1514,7 @@ RgSchUePCqiCb     *cqiCb;
    idx = ((nPCqiServCellIdx)& (CM_LTE_MAX_CELLS -1));
    ueCb->nPCqiCb = &ueCb->cellInfo[idx]->cqiCb;
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -1797,27 +1533,18 @@ RgSchUePCqiCb     *cqiCb;
  *  @return  ROK/RFAILED
  *
  **/
-#ifdef ANSI
-PUBLIC S16 rgSCHUtlSCellHndlRiCollsn
-(
-RgSchUePCqiCb *cqiCb
-)
-#else
-PUBLIC S16 rgSCHUtlSCellHndlRiCollsn(cqiCb)
-RgSchUePCqiCb     *cqiCb;
-#endif
+S16 rgSCHUtlSCellHndlRiCollsn(RgSchUePCqiCb *cqiCb)
 {
-   U32 nPRiServCellIdx;
-   U32 minPRiTrIdx;
-   U32 scellPRiTrIdx;
-   U32 pRiTrIdx;
+   uint32_t nPRiServCellIdx;
+   uint32_t minPRiTrIdx;
+   uint32_t scellPRiTrIdx;
+   uint32_t pRiTrIdx;
    RgSchCellCb       *priCellCb = cqiCb->servCellInfo->ue->cell;
    RgSchUeCb         *ueCb = cqiCb->servCellInfo->ue;
-   U16 crntSfIdx;
-   U32 cellIdx;
-   U32 sCellCnt = 0;
+   uint16_t crntSfIdx;
+   uint32_t cellIdx;
+   uint32_t sCellCnt = 0;
    CmLteTimingInfo timingInfo;
-   TRC3(rgSCHUtlSCellHndlRiCollsn);
 
 #ifdef xLTE_TDD
    RG_SCH_ADD_TO_CRNT_TIME(priCellCb->crntTime, timingInfo, TFU_DELTA);
@@ -1896,7 +1623,7 @@ RgSchUePCqiCb     *cqiCb;
    /* Set the next expected Cqi into nPCqiCb */
    ueCb->nPRiCb = &ueCb->cellInfo[nPRiServCellIdx]->cqiCb;
 
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif/*TFU_UPGRADE*/
 
@@ -1916,22 +1643,11 @@ RgSchUePCqiCb     *cqiCb;
  *  @return  Void
  *
  **/
-#ifdef ANSI
-PUBLIC S16 rgSCHSCellIsActive
-(
-RgSchCellCb                *cell,
-RgSchUeCb                  *ue
-)
-#else
-PUBLIC S16 rgSCHSCellIsActive(cell, ue)
-RgSchCellCb                *cell;
-RgSchUeCb                  *ue;
-#endif
+S16 rgSCHSCellIsActive(RgSchCellCb *cell,RgSchUeCb *ue)
 {
    S16 retVal = RFAILED;
-   TRC3(rgSCHSCellIsActive);
 
-   for(U8 idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
+   for(uint8_t idx = 1; idx <= RG_SCH_MAX_SCELL ; idx++)
    {
       if((ue->cellInfo[idx] != NULLP) &&
          (ue->cellInfo[idx]->cell->cellId == cell->cellId)&&
@@ -1941,7 +1657,7 @@ RgSchUeCb                  *ue;
          break;
       }
    }
-   RETVALUE(retVal);   
+   return (retVal);    
 }
 
 /**
@@ -1958,27 +1674,16 @@ RgSchUeCb                  *ue;
  *  @return  BOOL
  *      -#  TRUE
  **/
-#ifdef ANSI
-PUBLIC Bool rgSCHIsActvReqd 
-(
-RgSchCellCb    *cell,
-RgSchUeCb      *ue
-)
-#else
-PUBLIC Bool rgSCHIsActvReqd(cell, ue)
-RgSchCellCb    *cell;
-RgSchUeCb      *ue
-#endif
+Bool rgSCHIsActvReqd(RgSchCellCb *cell,RgSchUeCb *ue)
 {
-   TRC2(rgSCHIsActvReqd)
    /* Check if remBoCnt in this UE is greater than ZERO for sufficient number of
     * Scheduling TTIs. If yes then We should activate a secondary cell to handle
     * outstanding BO */
    if(ue->remBoCnt == RG_SCH_ACTIVATION_COUNT)
    {
-      RETVALUE(TRUE);
+      return (TRUE);
    }
-   RETVALUE(FALSE);
+   return (FALSE);
 }
 #endif/*LTE_ADV*/