[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / 5gnrsch / rg_sch_ram.c
index 9f9d5a0..ed7e002 100755 (executable)
@@ -32,9 +32,6 @@
 @brief This file has APIs to handle the random access procedure functionality for the scheduler.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_MODULE_ID=4096;
-static int RLOG_FILE_ID=171;
 
 /* header include files (.h) */
 #include "common_def.h"
@@ -49,8 +46,6 @@ static int RLOG_FILE_ID=171;
 #include "rg_sch_err.h"    /* Scheduler error defines */
 #include "rg_sch.h"        /* Scheduler defines */
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 
@@ -63,20 +58,20 @@ static int RLOG_FILE_ID=171;
 #include "rg_sch.x"        /* Scheduler includes */
 #include "rg_sch_cmn.x"
 #ifdef EMTC_ENABLE
-EXTERN Bool rgSCHRamVldtRgrEmtcUeCfg  ARGS((
+Bool rgSCHRamVldtRgrEmtcUeCfg  ARGS((
 RgSchCellCb  *cell,
 RgrUeCfg     *ueCfg
 ));
 
-EXTERN S16 rgSCHRamRmvAllFrmEmtcRaInfoSchdLst
+S16 rgSCHRamRmvAllFrmEmtcRaInfoSchdLst
 (
 RgSchCellCb       *cell
 );
-EXTERN Void rgSCHEmtcUtlUpdCmnNb 
+Void rgSCHEmtcUtlUpdCmnNb 
 (
 RgSchRaCb      *raCb
 );
-EXTERN Void rgSCHEmtcHqPAlloc 
+Void rgSCHEmtcHqPAlloc 
 (
 RgSchCellCb       *cell,
 RgSchDlHqEnt      *hqEnt
@@ -84,30 +79,30 @@ RgSchDlHqEnt      *hqEnt
 #endif
 /* local defines */
 /* local typedefs */
-PRIVATE Void rgSCHRamUlFreeAllocation ARGS((RgSchUlSf *sf,RgSchUlAlloc *alloc, 
+static Void rgSCHRamUlFreeAllocation ARGS((RgSchUlSf *sf,RgSchUlAlloc *alloc, 
          RgSchCellCb     *cell,Bool isEmtc));
 
-PRIVATE S16 rgSCHRamContResCrnti   ARGS((RgSchCellCb *cell, RgSchUeCb *ue, 
+static S16 rgSCHRamContResCrnti   ARGS((RgSchCellCb *cell, RgSchUeCb *ue, 
                                       RgSchRaCb *raCb, RgSchErrInfo *err));
-PRIVATE S16 rgSCHRamContResCcchsdu ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
+static S16 rgSCHRamContResCcchsdu ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
 #ifdef EMTC_ENABLE
 
-EXTERN S16 rgSCHEmtcRamContResCcchsdu ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
-EXTERN S16 rgSCHRamEmtcContResCcchsdu ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
-EXTERN Void rgSCHChkEmtcContResGrdTmrExp ARGS((RgSchCellCb        *cell));
-EXTERN Void rgSCHChkEmtcContResTmrExp ARGS((RgSchCellCb        *cell));
-EXTERN Void rgSCHEmtcRaInfoFree ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
+S16 rgSCHEmtcRamContResCcchsdu ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
+S16 rgSCHRamEmtcContResCcchsdu ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
+Void rgSCHChkEmtcContResGrdTmrExp ARGS((RgSchCellCb        *cell));
+Void rgSCHChkEmtcContResTmrExp ARGS((RgSchCellCb        *cell));
+Void rgSCHEmtcRaInfoFree ARGS((RgSchCellCb *cell, RgSchRaCb *raCb));
 #endif
 #ifdef RGR_V1
-PRIVATE Void rgSCHChkContResGrdTmrExp ARGS((RgSchCellCb        *cell));
-PRIVATE Void rgSCHChkContResTmrExp ARGS((RgSchCellCb        *cell));
-PRIVATE Void rgSCHRamProcContResExp ARGS((RgSchCellCb *cell, 
+static Void rgSCHChkContResGrdTmrExp ARGS((RgSchCellCb        *cell));
+static Void rgSCHChkContResTmrExp ARGS((RgSchCellCb        *cell));
+static Void rgSCHRamProcContResExp ARGS((RgSchCellCb *cell, 
                                  RgSchRaCb  *raCb));
-PRIVATE Void rgSCHRamProcContResGrdExp ARGS((RgSchCellCb *cell,
+static Void rgSCHRamProcContResGrdExp ARGS((RgSchCellCb *cell,
                                       RgSchRaCb  *raCb));
 #ifdef EMTC_ENABLE
-EXTERN Void rgSCHChkEmtcContResGrdTmrExp ARGS((RgSchCellCb        *cell));
-EXTERN Void rgSCHChkEmtcContResTmrExp ARGS((RgSchCellCb        *cell));
+Void rgSCHChkEmtcContResGrdTmrExp ARGS((RgSchCellCb        *cell));
+Void rgSCHChkEmtcContResTmrExp ARGS((RgSchCellCb        *cell));
 #endif
 #endif
 /* forward references */
@@ -131,17 +126,7 @@ EXTERN Void rgSCHChkEmtcContResTmrExp ARGS((RgSchCellCb        *cell));
  *      -# ROK
  *      -# RFAILED
  **/
-#ifdef ANSI
-S16 rgSCHRamVldtUeCfg 
-(
-RgSchCellCb  *cell,
-RgrUeCfg     *ueCfg
-)
-#else
-S16 rgSCHRamVldtUeCfg(cell, ueCfg)
-RgSchCellCb  *cell;
-RgrUeCfg     *ueCfg;
-#endif
+S16 rgSCHRamVldtUeCfg(RgSchCellCb  *cell,RgrUeCfg     *ueCfg)
 {
    if (ueCfg->dedPreambleId.pres == PRSNT_NODEF)
    {
@@ -183,10 +168,9 @@ RgrUeCfg     *ueCfg;
  *      -# ROK 
  *      -# RFAILED 
  **/
-#ifdef ANSI
 S16 rgSCHRamProcRaReq
 (
-U8                raReqCnt,
+uint8_t           raReqCnt,
 RgSchCellCb       *cell,
 CmLteRnti         raRnti,
 TfuRachInfo       *raReqInd,
@@ -194,22 +178,12 @@ CmLteTimingInfo   timingInfo,
 RgSchUeCb         *ue,
 RgSchErrInfo      *err
 )
-#else
-S16 rgSCHRamProcRaReq(raReqCnt, cell, raRnti, raReqInd, timingInfo, ue, err)
-U8                raReqCnt;
-RgSchCellCb       *cell;
-CmLteRnti         raRnti;
-TfuRachInfo       *raReqInd;
-CmLteTimingInfo   timingInfo;
-RgSchUeCb         *ue;
-RgSchErrInfo      *err;
-#endif
 {
    RgSchRaReqInfo *raReqInfo;
-   U16            raIndex;
+   uint16_t       raIndex;
 #ifdef LTE_TDD
-   U8             fid;
-   U8             tid;
+   uint8_t        fid;
+   uint8_t        tid;
 #endif
 
 
@@ -239,9 +213,7 @@ RgSchErrInfo      *err;
    /* allocate new raReqInfos and enqueue them */
    if (raReqInd->raReqInfoArr[raReqCnt].rapId >= RGSCH_MAX_NUM_RA_PREAMBLE)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
-               "RARNTI:%d rgSCHTomRaReqInd(): RAM processing failed errType(%d) ",
-               raReqInd->raRnti);
+      DU_LOG("\nERROR  -->  SCH : RARNTI:%d rgSCHTomRaReqInd(): RAM processing failed", raReqInd->raRnti);
       return RFAILED;
    }
 
@@ -270,7 +242,7 @@ RgSchErrInfo      *err;
    if((rgSCHUtlAllocSBuf(cell->instIdx, (Data **)(&raReqInfo), 
                sizeof(RgSchRaReqInfo))) == RFAILED)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHRamProcRaReq(): Allocation"
+      DU_LOG("\nERROR  -->  SCH : rgSCHRamProcRaReq(): Allocation"
             " of RaReq failed RARNTI:%d",raRnti);
       err->errCause = RGSCHERR_RAM_MEM_EXHAUST;
       return RFAILED;
@@ -319,19 +291,12 @@ RgSchErrInfo      *err;
  *      -# ROK 
  *      -# RFAILED 
  **/
-#ifdef ANSI
 S16 rgSCHRamCreateRaCb
 (
 RgSchCellCb       *cell,
 RgSchRaCb         **raCb,
 RgSchErrInfo      *err
 )
-#else
-S16 rgSCHRamCreateRaCb(cell, raCb, err)
-RgSchCellCb       *cell;
-RgSchRaCb         **raCb;
-RgSchErrInfo      *err;
-#endif
 {
    RgSchRntiLnk *rntiLnk;
    Inst         inst = cell->instIdx;
@@ -340,7 +305,7 @@ RgSchErrInfo      *err;
    if((rgSCHUtlAllocSBuf(inst, (Data **)(raCb),
                       sizeof(RgSchRaCb))) == RFAILED)
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHRamCreateRaCb(): Allocation of "
+      DU_LOG("\nERROR  -->  SCH : rgSCHRamCreateRaCb(): Allocation of "
          "RaCb failed");
       err->errCause = RGSCHERR_RAM_MEM_EXHAUST;
       return RFAILED;
@@ -359,7 +324,7 @@ RgSchErrInfo      *err;
       rgNumRarFailDuetoRntiExhaustion++;
 
       /* No rnti available! */
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHRamCreateRaCb(): Allocation of "
+      DU_LOG("\nERROR  -->  SCH : rgSCHRamCreateRaCb(): Allocation of "
          "temporary RNTI failed at MAC(CRNTI exhausted)");
       /* ccpu00117052 - MOD - Passing double pointer
       for proper NULLP assignment*/
@@ -373,7 +338,7 @@ RgSchErrInfo      *err;
    if ((*raCb)->dlHqE == NULLP)
    {
       /* No memory available! */
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHRamCreateRaCb(): Creation of"
+      DU_LOG("\nERROR  -->  SCH : rgSCHRamCreateRaCb(): Creation of"
          " DL HARQ failed");
          /* ccpu00117052 - MOD - Passing double pointer
       for proper NULLP assignment*/
@@ -421,7 +386,6 @@ RgSchErrInfo      *err;
  *      -# ROK 
  *      -# RFAILED 
  **/
-#ifdef ANSI
 S16 rgSCHRamRgrUeCfg
 (
 RgSchCellCb    *cell,
@@ -429,17 +393,10 @@ RgSchUeCb      *ue,
 RgSchRaCb      *raCb,
 RgSchErrInfo   *err
 )
-#else
-S16 rgSCHRamRgrUeCfg(cell, ue, raCb, err)
-RgSchCellCb    *cell;
-RgSchUeCb      *ue;
-RgSchRaCb      *raCb;
-RgSchErrInfo   *err;
-#endif
 {
    /* Releasing HARQ processes of old UE when ue
     *           reconfig with new crnti */
-  /* U32 cnt; */
+  /* uint32_t cnt; */
    RgSchDlHqEnt          **hqEnt = &(RG_SCH_CMN_GET_UE_HQE(ue, cell));
    RgSchCmnUlUe *ueUl = RG_SCH_CMN_GET_UL_UE(ue, cell);
 
@@ -495,21 +452,13 @@ RgSchErrInfo   *err;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-PRIVATE S16 rgSCHRamContResCrnti
+static S16 rgSCHRamContResCrnti
 (
 RgSchCellCb  *cell,
 RgSchUeCb    *ue,
 RgSchRaCb    *raCb,
 RgSchErrInfo *err
 )
-#else
-PRIVATE S16 rgSCHRamContResCrnti(cell, ue, raCb, err)
-RgSchCellCb  *cell;
-RgSchUeCb    *ue;
-RgSchRaCb    *raCb;
-RgSchErrInfo *err;
-#endif
 {
    TfuUlCqiRpt   ulCqiRpt;
    RgSchCmnCell  *cellSch= (RgSchCmnCell *)(cell->sc.sch);
@@ -561,17 +510,11 @@ RgSchErrInfo *err;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-PRIVATE S16 rgSCHRamContResCcchsdu
+static S16 rgSCHRamContResCcchsdu
 (
 RgSchCellCb *cell,
 RgSchRaCb *raCb
 )
-#else
-PRIVATE S16 rgSCHRamContResCcchsdu(cell, raCb)
-RgSchCellCb *cell;
-RgSchRaCb *raCb;
-#endif
 {
 #ifdef RGR_V1 
    CmLteTimingInfo expTime = {0}; 
@@ -579,8 +522,7 @@ RgSchRaCb *raCb;
 #endif
    if(raCb->raState != RGSCH_RA_MSG3_PENDING)
    {
-      RLOG_ARG2(L_DEBUG,DBG_CELLID,cell->cellId,
-               "RNTI:%d RaCb in wrong State %d Drop Msg 3",
+      DU_LOG("\nERROR  -->  SCH : RNTI:%d RaCb in wrong State %d Drop Msg 3",
                raCb->rntiLnk->rnti, 
                raCb->raState);
       return ROK;
@@ -626,7 +568,6 @@ RgSchRaCb *raCb;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
 S16 rgSCHRamProcMsg3
 (
 RgSchCellCb     *cell,
@@ -635,14 +576,6 @@ RgSchRaCb       *raCb,
 RgInfUeDatInd   *pdu,
 RgSchErrInfo    *err
 )
-#else
-S16 rgSCHRamProcMsg3(cell, ue, raCb, pdu, err)
-RgSchCellCb     *cell;
-RgSchUeCb       *ue;
-RgSchRaCb       *raCb;
-RgInfUeDatInd   *pdu;
-RgSchErrInfo    *err;
-#endif
 {
 
 
@@ -691,23 +624,16 @@ RgSchErrInfo    *err;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
 S16 rgSCHRamUpdtBo
 (
 RgSchCellCb       *cell,
 RgSchRaCb         *raCb,
 RgInfCmnBoRpt     *staRsp
 )
-#else
-S16 rgSCHRamUpdtBo(cell, raCb, staRsp)
-RgSchCellCb       *cell;
-RgSchRaCb         *raCb;
-RgInfCmnBoRpt     *staRsp;
-#endif
 {
 
    /* Update Bo in RaCb */
-   raCb->dlCcchInfo.bo = (U32)(staRsp->bo);
+   raCb->dlCcchInfo.bo = (uint32_t)(staRsp->bo);
    /* SR_RACH_STATS : MSG4 WITH CCCH SDU */
    rgNumMsg4WithCCCHSdu++;
 
@@ -734,15 +660,7 @@ RgInfCmnBoRpt     *staRsp;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-S16 rgSCHRamMsg3DatInd
-(
-RgSchRaCb      *raCb
-)
-#else
-S16 rgSCHRamMsg3DatInd(raCb)
-RgSchRaCb      *raCb;
-#endif
+S16 rgSCHRamMsg3DatInd(RgSchRaCb *raCb)
 {
 
    /* SR_RACH_STATS : MSG3 ACK*/
@@ -768,15 +686,7 @@ RgSchRaCb      *raCb;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-S16 rgSCHRamMsg3FailureInd
-(
-RgSchRaCb      *raCb
-)
-#else
-S16 rgSCHRamMsg3FailureInd(raCb)
-RgSchRaCb      *raCb;
-#endif
+S16 rgSCHRamMsg3FailureInd(RgSchRaCb *raCb)
 {
 
    /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
@@ -800,15 +710,7 @@ RgSchRaCb      *raCb;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-S16 rgSCHRamMsg4FdbkInd
-(
-RgSchRaCb      *raCb
-)
-#else
-S16 rgSCHRamMsg4FdbkInd(raCb)
-RgSchRaCb      *raCb;
-#endif
+S16 rgSCHRamMsg4FdbkInd(RgSchRaCb  *raCb)
 {
 
    return ROK;
@@ -832,21 +734,10 @@ RgSchRaCb      *raCb;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-S16 rgSCHRamMsg4Done
-(
-RgSchCellCb    *cell,
-RgSchRaCb      *raCb
-)
-#else
-S16 rgSCHRamMsg4Done(cell, raCb)
-RgSchCellCb    *cell;
-RgSchRaCb      *raCb;
-#endif
+S16 rgSCHRamMsg4Done(RgSchCellCb *cell,RgSchRaCb *raCb)
 {
 
-   RLOG_ARG1(L_DEBUG,DBG_CELLID,cell->cellId,
-            "rgSCHRamMsg4Done(): tmpCRNTI = %u",
+    DU_LOG("\nDEBUG  -->  SCH : rgSCHRamMsg4Done(): tmpCRNTI = %u",
             raCb->tmpCrnti);
 
    if(raCb->ue != NULLP) 
@@ -885,7 +776,7 @@ RgSchRaCb      *raCb;
    else if(raCb->toDel == TRUE)
    {
 #ifdef XEON_SPECIFIC_CHANGES
-      CM_LOG_DEBUG(CM_LOG_ID_SCH, "Deleting RacB:%d\n", raCb->tmpCrnti);
+      DU_LOG("\nDEBUG  -->  SCH : Deleting RacB:%d\n", raCb->tmpCrnti);
 #endif
       /* Delete RACB and release RNTI */
       rgSCHRamDelRaCb(cell, raCb, TRUE);
@@ -893,14 +784,12 @@ RgSchRaCb      *raCb;
    else
    {
 #ifdef XEON_SPECIFIC_CHANGES
-      CM_LOG_DEBUG(CM_LOG_ID_SCH, "Releasing Harq of RacB:%d\n", raCb->tmpCrnti);
+      DU_LOG("\nDEBUG  -->  SCH : Releasing Harq of RacB:%d\n", raCb->tmpCrnti);
 #endif
       raCb->raState = RGSCH_RA_MSG4_DONE;
       /* Release harq process as final feedback is received for Msg4. In other
        * cases, delRaCb will take care of releasing the harq process */
-      printf("=======Harq process released \n"); 
-      RLOG_ARG0(L_DEBUG,DBG_CELLID,cell->cellId,
-                                         "Harq process released "); 
+      DU_LOG("\nDEBUG  -->  SCH : Harq process released "); 
       rgSCHDhmRlsHqpTb(raCb->dlHqE->msg4Proc, 0, TRUE);
    }
 
@@ -925,22 +814,10 @@ RgSchRaCb      *raCb;
  *      -# ROK 
  *      -# RFAILED 
  **/
-#ifdef ANSI
-S16 rgSCHRamDelRaCb
-(
-RgSchCellCb *cell,
-RgSchRaCb   *raCb,
-Bool        rlsRnti
-)
-#else
-S16 rgSCHRamDelRaCb(cell, raCb, rlsRnti)
-RgSchCellCb *cell;
-RgSchRaCb   *raCb;
-Bool        rlsRnti;
-#endif
+S16 rgSCHRamDelRaCb(RgSchCellCb *cell,RgSchRaCb   *raCb,Bool rlsRnti)
 {
-   Inst         inst = cell->instIdx;
-   Bool         isEmtc = FALSE;
+   Inst  inst = cell->instIdx;
+   Bool  isEmtc = FALSE;
  
     /* Delete from all the lists it is enqueued */
     cmLListDelFrm(&(cell->raInfo.raCbLst),&(raCb->raCbLnk));
@@ -982,7 +859,7 @@ Bool        rlsRnti;
          if ((raCb->dlHqE->msg4Proc->subFrm != NULLP) &&
              (raCb->dlHqE->msg4Proc->hqPSfLnk.node != NULLP))
          {
-            RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"TMP CRNTI:%d RACH FAILURE!! "
+            DU_LOG("\nERROR  -->  SCH : TMP CRNTI:%d RACH FAILURE!! "
                "msg4proc  removed from SF", raCb->tmpCrnti);
             rgSCHUtlDlHqPTbRmvFrmTx(raCb->dlHqE->msg4Proc->subFrm, 
                                    raCb->dlHqE->msg4Proc, 0, FALSE);
@@ -1052,30 +929,21 @@ Bool        rlsRnti;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-S16 rgSCHRamTtiHndlr
-(
-RgSchCellCb  *cell
-)
-#else
-S16 rgSCHRamTtiHndlr(cell)
-RgSchCellCb  *cell;
-#endif
+S16 rgSCHRamTtiHndlr(RgSchCellCb  *cell)
 {
    RgSchRaCb   *raCb;
-   U16         raSfn;
-   U16         crntSfn;
-   U16         dist;       /* Number of frames between raCb's creation and crnt
-                              frame */
-   U8          idx;
-   U32         maxCnt;
+   uint16_t    raSfn;
+   uint16_t    crntSfn;
+   uint16_t    dist;       /* Number of frames between raCb's creation and crnt frame */
+   uint8_t     idx;
+   uint32_t    maxCnt;
 #ifndef LTE_TDD
-   U8          winGap;        
-   U8          raIdx;
+   uint8_t     winGap;        
+   uint8_t     raIdx;
    RgSchRaReqInfo *raReqInfo;
 #else
    CmLteTimingInfo      frm;
-   U8                   raIdx;
+   uint8_t     raIdx;
 #endif
 
 
@@ -1181,25 +1049,17 @@ RgSchCellCb  *cell;
  *  @return  S16
  *      -# ROK 
  **/
-#ifdef ANSI
-S16 rgSCHRamFreeCell
-(
-RgSchCellCb    *cell
-)
-#else
-S16 rgSCHRamFreeCell(cell)
-RgSchCellCb    *cell;
-#endif
+S16 rgSCHRamFreeCell(RgSchCellCb  *cell)
 {
    RgSchRaReqInfo  *raReqInfo;
    RgSchRaCb       *raCb;
-   U8              idx;
-   U8              raCbCnt;
+   uint8_t         idx;
+   uint8_t         raCbCnt;
    Inst            inst = cell->instIdx;
-   U8              lstSz;
+   uint8_t         lstSz;
 #ifdef LTE_TDD
-   U8              maxUlSubframes;
-   U8              maxDlSubframes;
+   uint8_t         maxUlSubframes;
+   uint8_t         maxDlSubframes;
 #endif
 
 
@@ -1270,17 +1130,7 @@ RgSchCellCb    *cell;
    return ROK; 
 } /* rgSCHRamFreeCell */
 #ifdef RGR_V1
-#ifdef ANSI
-PRIVATE Void rgSCHRamProcContResExp
-(
-RgSchCellCb *cell,
-RgSchRaCb  *raCb
-)
-#else
-PRIVATE Void rgSCHRamProcContResExp (cell, raCb)
-RgSchCellCb *cell;
-RgSchRaCb  *raCb;
-#endif
+static Void rgSCHRamProcContResExp(RgSchCellCb *cell,RgSchRaCb  *raCb)
 {
    raCb->expiryTime.sfn = RGSCH_CONTRES_EXP;
    /*MSG4 Fix*/
@@ -1296,20 +1146,10 @@ RgSchRaCb  *raCb;
       /* Delete RACB and release RNTI */
       rgSCHRamDelRaCb(cell, raCb, TRUE);
    }
-   RETVOID;
+   return;
 }
 
-#ifdef ANSI
-PRIVATE Void rgSCHRamProcContResGrdExp
-(
-RgSchCellCb *cell,
-RgSchRaCb  *raCb
-)
-#else
-PRIVATE Void rgSCHRamProcContResGrdExp (cell, raCb)
-RgSchCellCb  *cell;
-RgSchRaCb  *raCb;
-#endif
+static Void rgSCHRamProcContResGrdExp(RgSchCellCb *cell,RgSchRaCb  *raCb)
 {
 
 
@@ -1326,12 +1166,11 @@ RgSchRaCb  *raCb;
    raCb->contResTmrLnk.node = NULLP;
 
    /* MSG4 Fix Start */
-   RLOG_ARG1(L_DEBUG,DBG_CELLID,cell->cellId,
-            "Con Res Grd Tmr exp RNTI:%d", 
+   DU_LOG("\nDEBUG  -->  SCH : Con Res Grd Tmr exp RNTI:%d", 
             raCb->rntiLnk->rnti);   
    rgSCHRamAddToRaInfoSchdLst(cell, raCb);
    /* MSG4 Fix End */    
-   RETVOID;
+   return;
    
 }
 /**
@@ -1348,18 +1187,10 @@ RgSchRaCb  *raCb;
  *      -# ROK 
  *      -# RFAILED 
  **/
-#ifdef ANSI
-PRIVATE Void rgSCHChkContResTmrExp
-(
-RgSchCellCb        *cell
-)
-#else
-PRIVATE Void rgSCHChkContResTmrExp(cell)
-RgSchCellCb        *cell;
-#endif
+static Void rgSCHChkContResTmrExp(RgSchCellCb *cell)
 {
-   CmLList         *chkLnk    = NULLP;
-   RgSchRaCb       *raCb = NULLP;
+   CmLList    *chkLnk    = NULLP;
+   RgSchRaCb  *raCb = NULLP;
    
       
    chkLnk = cmLListFirst(&(cell->contResTmrLst));
@@ -1394,18 +1225,10 @@ RgSchCellCb        *cell;
  *      -# ROK 
  *      -# RFAILED 
  **/
-#ifdef ANSI
-PRIVATE Void rgSCHChkContResGrdTmrExp
-(
-RgSchCellCb        *cell
-)
-#else
-PRIVATE Void rgSCHChkContResGrdTmrExp(cell)
-RgSchCellCb        *cell;
-#endif
+static Void rgSCHChkContResGrdTmrExp(RgSchCellCb  *cell)
 {
-   CmLList         *chkLnk    = NULLP;
-   RgSchRaCb       *raCb = NULLP;
+   CmLList    *chkLnk    = NULLP;
+   RgSchRaCb  *raCb = NULLP;
    
       
    chkLnk = cmLListFirst(&(cell->contResGrdTmrLst));
@@ -1441,33 +1264,26 @@ RgSchCellCb        *cell;
  *
  *  @param[in,out] RgSchCellCb      *cell
  *  @param[in]     CmLteTimingInfo  timingInfo
- *  @param[in]     U8               raIdx
+ *  @param[in]     uint8_t               raIdx
  *  @return  S16
  *      -# ROK
  **/
-#ifdef ANSI
 S16 rgSCHRamDelRaReq
 (
-RgSchCellCb          *cell,
-CmLteTimingInfo      timingInfo,
-U8                   raIdx
+RgSchCellCb      *cell,
+CmLteTimingInfo  timingInfo,
+uint8_t          raIdx
 )
-#else
-S16 rgSCHRamDelRaReq(cell, timingInfo, raIdx)
-RgSchCellCb          *cell;
-CmLteTimingInfo      timingInfo;
-U8                   raIdx;
-#endif
 {
-   U8                   subfrmIdx;
+   uint8_t              subfrmIdx;
    RgSchTddRachRspLst   *rachRsp;
-   U16                   sfnIdx;
+   uint16_t             sfnIdx;
    S16                  calcSfn;
-   U8                   subfrm;
+   uint8_t              subfrm;
    RgSchRaReqInfo       *raReqInfo;
-   U8                   idx;
-   U8                   i;
-   U8                   raRntiIdx;
+   uint8_t              idx;
+   uint8_t              i;
+   uint8_t              raRntiIdx;
    CmLteRnti            raRnti;
 
 
@@ -1519,17 +1335,7 @@ U8                   raIdx;
 #endif
 
 /*MSG4 Fix Start */
-#ifdef ANSI
-S16 rgSCHRamAddToRaInfoSchdLst
-(
-RgSchCellCb       *cell,
-RgSchRaCb         *raCb
-)
-#else
-S16 rgSCHRamAddToRaInfoSchdLst(cell, raCb)
-RgSchCellCb       *cell;
-RgSchRaCb         *raCb;
-#endif
+S16 rgSCHRamAddToRaInfoSchdLst(RgSchCellCb *cell,RgSchRaCb *raCb)
 {
    CmLteTimingInfo expTime ={0};
    RgSchCmnCell    *cellSch =  RG_SCH_CMN_GET_CELL(cell);
@@ -1548,17 +1354,7 @@ RgSchRaCb         *raCb;
 
 
 
-#ifdef ANSI
-S16 rgSCHRamRmvFrmRaInfoSchdLst
-(
-RgSchCellCb       *cell,
-RgSchRaCb         *raCb
-)
-#else
-S16 rgSCHRamRmvFrmRaInfoSchdLst(cell, raCb)
-RgSchCellCb       *cell;
-RgSchRaCb         *raCb;
-#endif
+S16 rgSCHRamRmvFrmRaInfoSchdLst(RgSchCellCb *cell,RgSchRaCb  *raCb)
 {
 
    cmLListDelFrm(&(cell->raInfo.toBeSchdLst), &(raCb->schdLnk));
@@ -1584,22 +1380,13 @@ RgSchRaCb         *raCb;
  *     File :
  *
  **********************************************************/
-#ifdef ANSI
-PRIVATE Void rgSCHRamUlFreeAllocation
+static Void rgSCHRamUlFreeAllocation
 (
 RgSchUlSf       *sf,
 RgSchUlAlloc    *alloc,
 RgSchCellCb     *cell,
 Bool            isEmtc
-
 )
-#else
-PRIVATE Void rgSCHRamUlFreeAllocation(sf, alloc, cell,isEmtc)
-RgSchUlSf       *sf;
-RgSchUlAlloc    *alloc;
-RgSchCellCb     *cell;
-Bool            isEmtc;
-#endif
 {
 
    rgSCHUhmFreeProc(alloc->hqProc, cell);
@@ -1607,7 +1394,7 @@ Bool            isEmtc;
    {
       rgSCHUtlUlAllocRls(sf, alloc);
    }
-   RETVOID;
+   return;
 }
 
 /**********************************************************************