Jira id - ODUHIGH-227
[o-du/l2.git] / src / 5gnrsch / rg_sch_drx.c
index 5b44497..27efeb8 100755 (executable)
@@ -37,15 +37,7 @@ static int RLOG_MODULE_ID=4096;
 static int RLOG_FILE_ID=163;
 
 /* 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 "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"
@@ -62,15 +54,6 @@ static int RLOG_FILE_ID=163;
 #include "rl_common.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"           /* TFU types */
 #include "lrg.x"           /* layer management typedefs for MAC */
 #include "rgr.x"           /* layer management typedefs for MAC */
@@ -320,12 +303,12 @@ RgUeUlHqCb   *hqE
  * @return 
  */
 #ifdef ANSI
-PUBLIC Void rgSCHDrxTtiInd 
+Void rgSCHDrxTtiInd 
 (
 RgSchCellCb  *cell
 )
 #else
-PUBLIC Void rgSCHDrxTtiInd (cell)
+Void rgSCHDrxTtiInd (cell)
 RgSchCellCb  *cell;
 #endif
 {
@@ -422,7 +405,7 @@ U16           ulIndex;
 #if ( ERRCLASS & ERRCLS_INT_PAR )
    if ( cell == (RgSchCellCb* )NULLP )
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -430,7 +413,7 @@ U16           ulIndex;
   
    rgSCHDrxTtiHdlOnDurUl(cell, ulIndex);
 
-   RETVALUE(ROK);
+   return ROK;
 
 }/*rgSCHDrxTtiHdlOnDur*/
 
@@ -462,14 +445,14 @@ U16           ulIndex;
  */
 
 #ifdef ANSI
-PUBLIC S16 rgSCHDrxTtiHdlInActv
+S16 rgSCHDrxTtiHdlInActv
 (
 RgSchCellCb  *cell,
 U16 dlIndex,
 U16 ulIndex
 )
 #else
-PUBLIC S16 rgSCHDrxTtiHdlInActv(cell, dlIndex, ulIndex)
+S16 rgSCHDrxTtiHdlInActv(cell, dlIndex, ulIndex)
 RgSchCellCb  *cell;
 U16 dlIndex;
 U16 ulIndex;
@@ -490,7 +473,7 @@ U16 ulIndex;
 #if ( ERRCLASS & ERRCLS_INT_PAR )   
    if ( cell == (RgSchCellCb* )NULLP) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -678,7 +661,7 @@ U16 ulIndex;
    cellSch = RG_SCH_CMN_GET_CELL(cell);
    cellSch->apisDl->rgSCHDlInactvtUes(cell,&dlInactvLst);
 
-      RETVALUE(ROK);
+      return ROK;
 }/*rgSCHDrxTtiHdlInActv*/
 
  /** @brief This function handles the per TTI processing for DRX short cycle
@@ -703,14 +686,14 @@ U16 ulIndex;
  */
 
 #ifdef ANSI
-PUBLIC S16 rgSCHDrxTtiHdlShortCycle 
+S16 rgSCHDrxTtiHdlShortCycle 
 (
 RgSchCellCb  *cell,
 U16           dlIndex,
 U16           ulIndex
 )
 #else
-PUBLIC S16 rgSCHDrxTtiHdlShortCycle (cell, dlIndex, ulIndex)
+S16 rgSCHDrxTtiHdlShortCycle (cell, dlIndex, ulIndex)
 RgSchCellCb  *cell;
 U16           dlIndex;
 U16           ulIndex;
@@ -726,7 +709,7 @@ U16           ulIndex;
 #if ( ERRCLASS & ERRCLS_INT_PAR )
    if ( cell == (RgSchCellCb* )NULLP )
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -762,7 +745,7 @@ U16           ulIndex;
       rgSCHDrxMvToNxtOnDurOcc(cell,ue,RG_SCH_DRX_DL_DELTA,TRUE);
    }/*while(node)...*/
 
-   RETVALUE(ROK);
+   return ROK;
 }/*rgSCHDrxTtiHdlShortCycle*/
 
 
@@ -812,7 +795,7 @@ U16                   ulIndex;
 #if ( ERRCLASS & ERRCLS_INT_PAR)
    if ( cell == (RgSchCellCb *)NULLP )
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /*ERRCLASS & ERRCLS_INT_PAR*/
 
@@ -823,7 +806,7 @@ U16                   ulIndex;
 
    rgSCHDrxTtiHdlUlHarqRTT(cell, ulIndex);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
  /** @brief This function is called by the common scheduler as part of
@@ -846,14 +829,14 @@ U16                   ulIndex;
   */
 
 #ifdef ANSI
-PUBLIC Void rgSCHDrxStrtInActvTmr
+Void rgSCHDrxStrtInActvTmr
 (
 RgSchCellCb  *cell,
 CmLListCp    *ueLst,
 U8            direction
 )
 #else
-PUBLIC Void rgSCHDrxStrtInActvTmr(cell, ueLst, direction)
+Void rgSCHDrxStrtInActvTmr(cell, ueLst, direction)
 RgSchCellCb  *cell;
 CmLListCp    *ueLst;
 U8            direction;
@@ -1045,14 +1028,14 @@ U8            direction;
   * @return Void 
   */
 #ifdef ANSI
-PUBLIC Void rgSCHDrxStartHarqRTTTmr
+Void rgSCHDrxStartHarqRTTTmr
 (
 RgSchCellCb            *cell,
 RgSchDlHqProcCb        *hqP,
 U8                     tbCnt
 )
 #else
-PUBLIC Void rgSCHDrxStartHarqRTTTmr(cell, hqP, tbCnt)
+Void rgSCHDrxStartHarqRTTTmr(cell, hqP, tbCnt)
 RgSchCellCb             *cell;
 RgSchDlHqProcCb         *hqP;
 U8                      tbCnt;
@@ -1174,14 +1157,14 @@ U8                      tbCnt;
  * -# RFAILED
  */
 #ifdef ANSI
-PUBLIC S16 rgSCHDrxUeCfg 
+S16 rgSCHDrxUeCfg 
 (
  RgSchCellCb *cell,
  RgSchUeCb   *ue,
  RgrUeCfg    *ueCfg
  )
 #else
-PUBLIC S16 rgSCHDrxUeCfg (cell, ue, ueCfg)
+S16 rgSCHDrxUeCfg (cell, ue, ueCfg)
  RgSchCellCb *cell;
  RgSchUeCb   *ue;
  RgrUeCfg    *ueCfg;
@@ -1202,7 +1185,7 @@ PUBLIC S16 rgSCHDrxUeCfg (cell, ue, ueCfg)
 #if ( ERRCLASS & ERRCLS_INT_PAR )   
    if ( cell == (RgSchCellCb* )NULLP) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if ((ue == (RgSchUeCb* )NULLP)
@@ -1211,7 +1194,7 @@ PUBLIC S16 rgSCHDrxUeCfg (cell, ue, ueCfg)
    {
       RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId, "rgSCHDrxUeCfg():"
                "Invalid params.cell or ue or ueCfg is NULL ");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -1224,7 +1207,7 @@ PUBLIC S16 rgSCHDrxUeCfg (cell, ue, ueCfg)
    {
       RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
                "Memory allocation FAILED for DRX UECB CRBTI:%d",ue->ueId);
-      RETVALUE(ret);
+      return (ret);
    }
 
    ueDrxCb = ue->drxCb;
@@ -1307,7 +1290,7 @@ PUBLIC S16 rgSCHDrxUeCfg (cell, ue, ueCfg)
       ueDrxCb->shortCycleEnt.node = (PTR)ue;
    }
 
-   RETVALUE(ret);
+   return (ret);
 } /* end of rgSCHDrxUeCfg */
 
 /** @brief This function gets the next occurance of onDurationTimer from the
@@ -1363,7 +1346,7 @@ PRIVATE S16 rgSCHDrxGetNxtOnDur (cell, drxCb, nxtOnDur, delta)
 #if ( ERRCLASS & ERRCLS_INT_PAR ) 
    if ( cell == (RgSchCellCb* )NULLP ) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if( (drxCb == (RgSchDrxUeCb* )NULLP)
@@ -1374,7 +1357,7 @@ PRIVATE S16 rgSCHDrxGetNxtOnDur (cell, drxCb, nxtOnDur, delta)
       RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
                         "rgSCHDrxGetNxOnDur():Invalid params."
                         "cell/drxCb/nxtOnDur is NULL");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -1432,7 +1415,7 @@ PRIVATE S16 rgSCHDrxGetNxtOnDur (cell, drxCb, nxtOnDur, delta)
       nxtOnDur->sfn      = (U16)nxtDist / RGSCH_NUM_SUB_FRAMES_5G;
       nxtOnDur->slot = (U16)nxtDist % RGSCH_NUM_SUB_FRAMES_5G;
    }
-   RETVALUE(ROK);
+   return ROK;
 } /* end of rgSCHDrxGetNxtOnDur */ 
 
 /** @brief This function is a utility function to copy the UE configuration from
@@ -1470,7 +1453,7 @@ PRIVATE S16 rgSCHDrxCpyUeCfg (ueCb, drxCfg)
         (drxCfg == (RgrUeDrxCfg* )NULLP)
       )
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -1488,7 +1471,7 @@ PRIVATE S16 rgSCHDrxCpyUeCfg (ueCb, drxCfg)
    ueCb->shortDrxCycle        = drxCfg->drxShortDrx.shortDrxCycle;
    ueCb->shortCycleTmrLen     = drxCfg->drxShortDrx.drxShortCycleTmr;
    
-   RETVALUE(ROK);
+   return ROK;
 } /* end of rgSCHDrxCpyUeCfg */ 
 
 #ifdef RGR_V2
@@ -1516,14 +1499,14 @@ PRIVATE S16 rgSCHDrxCpyUeCfg (ueCb, drxCfg)
  * @return  ROK/RFAILED
  */
 #ifdef ANSI
-PUBLIC S16 rgSCHDrxUeReCfg 
+S16 rgSCHDrxUeReCfg 
 (
  RgSchCellCb *cell, 
  RgSchUeCb   *ue, 
  RgrUeRecfg  *ueReCfg
  )
 #else
-PUBLIC S16 rgSCHDrxUeReCfg (cell, ue, ueReCfg)
+S16 rgSCHDrxUeReCfg (cell, ue, ueReCfg)
  RgSchCellCb *cell; 
  RgSchUeCb   *ue; 
  RgrUeRecfg  *ueReCfg;
@@ -1564,7 +1547,7 @@ PUBLIC S16 rgSCHDrxUeReCfg (cell, ue, ueReCfg)
         RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
            "rgSCHdrxUeReCfg():""Memory allocation FAILED for DRX UE Cb CRNTI:%d",
                   ue->ueId);
-        RETVALUE(ret);
+        return (ret);
      }
 
      ue->isDrxEnabled = TRUE;    /* sachin */
@@ -1595,7 +1578,7 @@ PUBLIC S16 rgSCHDrxUeReCfg (cell, ue, ueReCfg)
   }
   if( ue->drxCb == NULLP ) 
   { 
-     RETVALUE(RFAILED)
+     return RFAILED
   }
    ueDrxCb = ue->drxCb;
    
@@ -1747,7 +1730,7 @@ PUBLIC S16 rgSCHDrxUeReCfg (cell, ue, ueReCfg)
       }   
    }
 
-   RETVALUE(ROK);
+   return ROK;
 
 } /* end of rgSCHDrxUeReCfg */
 #endif
@@ -1766,7 +1749,7 @@ PUBLIC S16 rgSCHDrxUeReCfg (cell, ue, ueReCfg)
  * @return ROK/RFAILED
  */
 #ifdef ANSI
-PUBLIC Void rgSCHDrxUeHqReset
+Void rgSCHDrxUeHqReset
 (
  RgSchCellCb   *cell,
  RgSchUeCb     *ue,
@@ -1774,7 +1757,7 @@ PUBLIC Void rgSCHDrxUeHqReset
  U8            cellIdx
  )
 #else
-PUBLIC Void rgSCHDrxUeHqReset(cell, ue, hqE, cellIdx)
+Void rgSCHDrxUeHqReset(cell, ue, hqE, cellIdx)
  RgSchCellCb   *cell; 
  RgSchUeCb     *ue;
  RgSchDlHqEnt  *hqE;
@@ -1838,13 +1821,13 @@ PUBLIC Void rgSCHDrxUeHqReset(cell, ue, hqE, cellIdx)
  * @return ROK/RFAILED
  */
 #ifdef ANSI
-PUBLIC S16 rgSCHDrxUeDel
+S16 rgSCHDrxUeDel
 (
  RgSchCellCb   *cell,
  RgSchUeCb      *ue
  )
 #else
-PUBLIC S16 rgSCHDrxUeDel (cell, ue)
+S16 rgSCHDrxUeDel (cell, ue)
  RgSchCellCb   *cell; 
  RgSchUeCb     *ue;
 #endif
@@ -1917,7 +1900,7 @@ PUBLIC S16 rgSCHDrxUeDel (cell, ue)
    ueDrxCb->drxDlInactvMask = DRX_UE_INACTIVE;
    ueDrxCb->drxUlInactvMask = DRX_UE_INACTIVE;
 
-   RETVALUE(ROK);
+   return ROK;
 }/*rgSCHDrxUeDel*/
 
 /** @brief This function is called at the time of RGR cell configuration.
@@ -1936,13 +1919,13 @@ PUBLIC S16 rgSCHDrxUeDel (cell, ue)
  * @return ROK/RFAILED
  */
 #ifdef ANSI
-PUBLIC S16 rgSCHDrxCellCfg 
+S16 rgSCHDrxCellCfg 
 (
  RgSchCellCb   *cell,
  RgrCellCfg    *cellCfg
  )
 #else
-PUBLIC S16 rgSCHDrxCellCfg (cell, cellCfg)
+S16 rgSCHDrxCellCfg (cell, cellCfg)
  RgSchCellCb   *cell; 
  RgrCellCfg    *cellCfg;
 #endif
@@ -1960,7 +1943,7 @@ PUBLIC S16 rgSCHDrxCellCfg (cell, cellCfg)
    {
       RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
                 "rgSCHDrxCellCfg():Invalid Params. cell/cellCfg is NULL");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -1972,7 +1955,7 @@ PUBLIC S16 rgSCHDrxCellCfg (cell, cellCfg)
    {
       RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHDrxCellCfg():"
                "Memory allocation FAILED for DRX cell Cb");
-      RETVALUE(ret);
+      return (ret);
    }
 
    /* delInUlScan determines which index scans the queue last.
@@ -1992,7 +1975,7 @@ PUBLIC S16 rgSCHDrxCellCfg (cell, cellCfg)
       cell->drxCb->delInUlScan = TRUE;
    }
 
-   RETVALUE(ret);
+   return (ret);
 } /* end of rgSchDrxCellCfg */
 
 
@@ -2013,12 +1996,12 @@ PUBLIC S16 rgSCHDrxCellCfg (cell, cellCfg)
  * @return Void
  */
 #ifdef ANSI
-PUBLIC Void rgSCHDrxCellDel 
+Void rgSCHDrxCellDel 
 (
  RgSchCellCb *cell
  )
 #else
-PUBLIC Void rgSCHDrxCellDel (cell)
+Void rgSCHDrxCellDel (cell)
  RgSchCellCb *cell;
 #endif
 {
@@ -2064,13 +2047,13 @@ PUBLIC Void rgSCHDrxCellDel (cell)
  * @return  ROK/RFAILED
  */
 #ifdef ANSI
-PUBLIC S16 rgSCHDrxSrInd 
+S16 rgSCHDrxSrInd 
 (
  RgSchCellCb   *cell, 
  RgSchUeCb     *ue
  )
 #else
-PUBLIC S16 rgSCHDrxSrInd (cell, ue)
+S16 rgSCHDrxSrInd (cell, ue)
  RgSchCellCb   *cell; 
  RgSchUeCb     *ue;
 #endif
@@ -2083,14 +2066,14 @@ PUBLIC S16 rgSCHDrxSrInd (cell, ue)
 #if ( ERRCLASS & ERRCLS_INT_PAR )
    if ( cell == (RgSchCellCb* )NULLP)
    {
-      RETVALUE(ROK);
+      return ROK;
    }
 
    if( (ue == (RgSchUeCb* )NULLP))
    {
       RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
                  "rgSCHDrxSrInd():Invalid Params. cell/ue is NULL");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
  #endif
    /* KWork fix - shifted this down */
@@ -2104,7 +2087,7 @@ PUBLIC S16 rgSCHDrxSrInd (cell, ue)
    /* Update UE's inactive mask and if required move UE to ACTIVE state */
    RG_SCH_CMN_UL_UPDT_INACTV_MASK( cell, ue, RG_DRX_INACTIVE);
 
-   RETVALUE(ROK);
+   return ROK;
 } /* rgSCHDrxSrInd */
 
 
@@ -2133,13 +2116,13 @@ PUBLIC S16 rgSCHDrxSrInd (cell, ue)
  * @return Void 
  */
 #ifdef ANSI
-PUBLIC Void rgSCHDrxDedRa 
+Void rgSCHDrxDedRa 
 (
 RgSchCellCb   *cellCb, 
 RgSchUeCb     *ueCb
  )
 #else
-PUBLIC Void rgSCHDrxDedRa (cellCb, ueCb)
+Void rgSCHDrxDedRa (cellCb, ueCb)
 RgSchCellCb   *cellCb; 
 RgSchUeCb     *ueCb;
 #endif
@@ -2330,7 +2313,7 @@ PRIVATE S16 rgSCHDrxGetNxtTmrExpry (cell,curTime,duration,tmrExpryIdx)
          (tmrExpryIdx == (CmLteTimingInfo* )NULLP)
       )
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -2428,7 +2411,7 @@ PRIVATE S16 rgSCHDrxGetNxtTmrExpry (cell,curTime,duration,tmrExpryIdx)
       tmrExpryIdx->sfn = tmrExpryIdx->sfn - (RG_SCH_CMN_MAX_SFN_NUM + 1);
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }/*rgSCHDrxGetNxtTmrExpry*/
 
 /** @brief This function calculates the next onDuration Occurence
@@ -2537,7 +2520,7 @@ PRIVATE Void rgSCHDrxCalcNxtTmrExpry (cell,ue,delta,tmrLen,distance,idx)
  *
  **********************************************************/
 #ifdef ANSI
-PUBLIC S16 rgSCHCfgVldtTddDrxCycCfg
+S16 rgSCHCfgVldtTddDrxCycCfg
 (
 RgSchCellCb  *cell,
 U16           drxCycle,
@@ -2545,7 +2528,7 @@ U8            onDurTmr,
 U16           offSet
 )
 #else
-PUBLIC S16 rgSCHCfgVldtTddDrxCycCfg(cell, drxCycle, onDurTmr, offSet)
+S16 rgSCHCfgVldtTddDrxCycCfg(cell, drxCycle, onDurTmr, offSet)
 RgSchCellCb  *cell;
 U16           drxCycle;
 U8            onDurTmr;
@@ -2567,7 +2550,7 @@ U16           offSet;
       if(((RGSCH_MAX_SUBFRM_5G + endTimeInSf- startTime) % RGSCH_MAX_SUBFRM_5G) >= 
           drxCycle)
       {
-          RETVALUE(RFAILED);
+          return RFAILED;
       }
       
       startTime = (startTime + drxCycle);
@@ -2579,7 +2562,7 @@ U16           offSet;
    }while((drxCycle % RGSCH_NUM_SUB_FRAMES) && 
        (startTime < (drxCycle * RGSCH_NUM_SUB_FRAMES/2)));
    
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #endif /*LTE_TDD */