Jira id - ODUHIGH-227
[o-du/l2.git] / src / 5gnrsch / rg_sch_ram.c
index ad27fe0..15c09ee 100755 (executable)
@@ -37,18 +37,7 @@ static int RLOG_MODULE_ID=4096;
 static int RLOG_FILE_ID=171;
 
 /* header include files (.h) */
-#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 "cm_tkns.h"       /* Common Token Defines */
-#include "cm_llist.h"      /* Common Link List Defines */
-#include "cm_hash.h"       /* Common Hash List Defines */
-#include "cm_mblk.h"       /* common memory link list library */
-#include "cm_lte.h"        /* Common LTE */
+#include "common_def.h"
 
 #include "rg_env.h"        /* MAC Environment Defines */
 #include "rgr.h"           /* RGR Interface defines */
@@ -64,15 +53,6 @@ static int RLOG_FILE_ID=171;
 #include "rl_common.h"
 
 /* header/extern include files (.x) */
-#include "gen.x"           /* general */
-#include "ssi.x"           /* system services */
-#include "cm5.x"           /* Timer */
-#include "cm_tkns.x"       /* Common Token Definitions */
-#include "cm_llist.x"      /* Common Link List Definitions */
-#include "cm_lib.x"        /* Common Library Definitions */
-#include "cm_hash.x"       /* Common Hash List Definitions */
-#include "cm_mblk.x"       /* common memory link list library */
-#include "cm_lte.x"        /* Common LTE */
 
 #include "rgr.x"           /* RGR Interface includes */
 #include "rgm.x"           /* RGR Interface includes */
@@ -152,13 +132,13 @@ EXTERN Void rgSCHChkEmtcContResTmrExp ARGS((RgSchCellCb        *cell));
  *      -# RFAILED
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamVldtUeCfg 
+S16 rgSCHRamVldtUeCfg 
 (
 RgSchCellCb  *cell,
 RgrUeCfg     *ueCfg
 )
 #else
-PUBLIC S16 rgSCHRamVldtUeCfg(cell, ueCfg)
+S16 rgSCHRamVldtUeCfg(cell, ueCfg)
 RgSchCellCb  *cell;
 RgrUeCfg     *ueCfg;
 #endif
@@ -178,10 +158,10 @@ RgrUeCfg     *ueCfg;
 #endif          
           )
       {
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**
@@ -205,7 +185,7 @@ RgrUeCfg     *ueCfg;
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamProcRaReq
+S16 rgSCHRamProcRaReq
 (
 U8                raReqCnt,
 RgSchCellCb       *cell,
@@ -216,7 +196,7 @@ RgSchUeCb         *ue,
 RgSchErrInfo      *err
 )
 #else
-PUBLIC S16 rgSCHRamProcRaReq(raReqCnt, cell, raRnti, raReqInd, timingInfo, ue, err)
+S16 rgSCHRamProcRaReq(raReqCnt, cell, raRnti, raReqInd, timingInfo, ue, err)
 U8                raReqCnt;
 RgSchCellCb       *cell;
 CmLteRnti         raRnti;
@@ -264,7 +244,7 @@ RgSchErrInfo      *err;
       RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,
                "RARNTI:%d rgSCHTomRaReqInd(): RAM processing failed errType(%d) ",
                raReqInd->raRnti);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /* SR_RACH_STATS : DED PREAMB*/
@@ -295,7 +275,7 @@ RgSchErrInfo      *err;
       RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHRamProcRaReq(): Allocation"
             " of RaReq failed RARNTI:%d",raRnti);
       err->errCause = RGSCHERR_RAM_MEM_EXHAUST;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /* Insert the given raReqInfo */
@@ -322,7 +302,7 @@ RgSchErrInfo      *err;
       cmLListAdd2Tail(&cell->raInfo.raReqLst[raIndex], &raReqInfo->raReqLstEnt);
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamProcRaReq */
 
 /**
@@ -342,14 +322,14 @@ RgSchErrInfo      *err;
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamCreateRaCb
+S16 rgSCHRamCreateRaCb
 (
 RgSchCellCb       *cell,
 RgSchRaCb         **raCb,
 RgSchErrInfo      *err
 )
 #else
-PUBLIC S16 rgSCHRamCreateRaCb(cell, raCb, err)
+S16 rgSCHRamCreateRaCb(cell, raCb, err)
 RgSchCellCb       *cell;
 RgSchRaCb         **raCb;
 RgSchErrInfo      *err;
@@ -366,7 +346,7 @@ RgSchErrInfo      *err;
       RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"rgSCHRamCreateRaCb(): Allocation of "
          "RaCb failed");
       err->errCause = RGSCHERR_RAM_MEM_EXHAUST;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    rntiLnk = rgSCHDbmGetRnti(cell);
@@ -388,7 +368,7 @@ RgSchErrInfo      *err;
       for proper NULLP assignment*/
       rgSCHUtlFreeSBuf(inst, (Data **)(raCb), sizeof(RgSchRaCb));
       err->errCause = RGSCHERR_RAM_RNTI_EXHAUST;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /* Allocate and initialize the DL HARQ portion of the RACB */
@@ -402,7 +382,7 @@ RgSchErrInfo      *err;
       for proper NULLP assignment*/
       rgSCHUtlFreeSBuf(inst, (Data **)(raCb), sizeof(RgSchRaCb));
       err->errCause = RGSCHERR_RAM_MEM_EXHAUST;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #ifdef EMTC_ENABLE
    (*raCb)->isEmtcRaCb = FALSE;
@@ -419,7 +399,7 @@ RgSchErrInfo      *err;
    (*raCb)->raCbLnk.node = (PTR)(*raCb);
    cmLListAdd2Tail(&cell->raInfo.raCbLst, &(*raCb)->raCbLnk);
    
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamCreateRaCb */
 
 /**
@@ -445,7 +425,7 @@ RgSchErrInfo      *err;
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamRgrUeCfg
+S16 rgSCHRamRgrUeCfg
 (
 RgSchCellCb    *cell,
 RgSchUeCb      *ue,
@@ -453,7 +433,7 @@ RgSchRaCb      *raCb,
 RgSchErrInfo   *err
 )
 #else
-PUBLIC S16 rgSCHRamRgrUeCfg(cell, ue, raCb, err)
+S16 rgSCHRamRgrUeCfg(cell, ue, raCb, err)
 RgSchCellCb    *cell;
 RgSchUeCb      *ue;
 RgSchRaCb      *raCb;
@@ -494,10 +474,10 @@ RgSchErrInfo   *err;
       err->errCause = RGSCHERR_RAM_NO_MSG3_RCVD;
       *hqEnt = NULLP;
       raCb->dlHqE->ue = NULLP;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamRgrUeCfg */
 
 
@@ -566,7 +546,7 @@ RgSchErrInfo *err;
    /* No need of raCb any more */
    rgSCHRamDelRaCb(cell, raCb, TRUE);
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamContResCrnti */
 
 
@@ -609,7 +589,7 @@ RgSchRaCb *raCb;
                "RNTI:%d RaCb in wrong State %d Drop Msg 3",
                raCb->rntiLnk->rnti, 
                raCb->raState);
-      RETVALUE(ROK);
+      return ROK;
    }
 
    raCb->raState = RGSCH_RA_MSG4_PENDING;
@@ -631,7 +611,7 @@ RgSchRaCb *raCb;
       raCb->contResTmrLnk.node = (PTR)(raCb);
       cmLListAdd2Tail(&(cell->contResGrdTmrLst), &(raCb->contResTmrLnk));
 #endif
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamContResCcchsdu */
 
 
@@ -653,7 +633,7 @@ RgSchRaCb *raCb;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamProcMsg3
+S16 rgSCHRamProcMsg3
 (
 RgSchCellCb     *cell,
 RgSchUeCb       *ue,
@@ -662,7 +642,7 @@ RgInfUeDatInd   *pdu,
 RgSchErrInfo    *err
 )
 #else
-PUBLIC S16 rgSCHRamProcMsg3(cell, ue, raCb, pdu, err)
+S16 rgSCHRamProcMsg3(cell, ue, raCb, pdu, err)
 RgSchCellCb     *cell;
 RgSchUeCb       *ue;
 RgSchRaCb       *raCb;
@@ -699,7 +679,7 @@ RgSchErrInfo    *err;
       }
    } 
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamProcMsg3 */
 
 
@@ -719,14 +699,14 @@ RgSchErrInfo    *err;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamUpdtBo
+S16 rgSCHRamUpdtBo
 (
 RgSchCellCb       *cell,
 RgSchRaCb         *raCb,
 RgInfCmnBoRpt     *staRsp
 )
 #else
-PUBLIC S16 rgSCHRamUpdtBo(cell, raCb, staRsp)
+S16 rgSCHRamUpdtBo(cell, raCb, staRsp)
 RgSchCellCb       *cell;
 RgSchRaCb         *raCb;
 RgInfCmnBoRpt     *staRsp;
@@ -744,7 +724,7 @@ RgInfCmnBoRpt     *staRsp;
    rgSCHRamAddToRaInfoSchdLst(cell, raCb);
    /* MSG4 Fix  End */      
    
-   RETVALUE(ROK);
+   return ROK;
 } /* rgSCHRamUpdtBo */
 
 /**
@@ -763,12 +743,12 @@ RgInfCmnBoRpt     *staRsp;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamMsg3DatInd
+S16 rgSCHRamMsg3DatInd
 (
 RgSchRaCb      *raCb
 )
 #else
-PUBLIC S16 rgSCHRamMsg3DatInd(raCb)
+S16 rgSCHRamMsg3DatInd(raCb)
 RgSchRaCb      *raCb;
 #endif
 {
@@ -779,7 +759,7 @@ RgSchRaCb      *raCb;
    /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
    rgSCHUhmProcMsg3DatInd(&(raCb->msg3HqProc));
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg3DatInd */
 
 /**
@@ -798,12 +778,12 @@ RgSchRaCb      *raCb;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamMsg3FailureInd
+S16 rgSCHRamMsg3FailureInd
 (
 RgSchRaCb      *raCb
 )
 #else
-PUBLIC S16 rgSCHRamMsg3FailureInd(raCb)
+S16 rgSCHRamMsg3FailureInd(raCb)
 RgSchRaCb      *raCb;
 #endif
 {
@@ -812,7 +792,7 @@ RgSchRaCb      *raCb;
    /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
    rgSCHUhmProcMsg3Failure(&(raCb->msg3HqProc));
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg3FailureInd */
 
 /**
@@ -831,18 +811,18 @@ RgSchRaCb      *raCb;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamMsg4FdbkInd
+S16 rgSCHRamMsg4FdbkInd
 (
 RgSchRaCb      *raCb
 )
 #else
-PUBLIC S16 rgSCHRamMsg4FdbkInd(raCb)
+S16 rgSCHRamMsg4FdbkInd(raCb)
 RgSchRaCb      *raCb;
 #endif
 {
    TRC2(rgSCHRamMsg4FdbkInd)
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg4FdbkInd */
 
 
@@ -864,13 +844,13 @@ RgSchRaCb      *raCb;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamMsg4Done
+S16 rgSCHRamMsg4Done
 (
 RgSchCellCb    *cell,
 RgSchRaCb      *raCb
 )
 #else
-PUBLIC S16 rgSCHRamMsg4Done(cell, raCb)
+S16 rgSCHRamMsg4Done(cell, raCb)
 RgSchCellCb    *cell;
 RgSchRaCb      *raCb;
 #endif
@@ -936,7 +916,7 @@ RgSchRaCb      *raCb;
       rgSCHDhmRlsHqpTb(raCb->dlHqE->msg4Proc, 0, TRUE);
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg4Done */
 
 
@@ -958,14 +938,14 @@ RgSchRaCb      *raCb;
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamDelRaCb
+S16 rgSCHRamDelRaCb
 (
 RgSchCellCb *cell,
 RgSchRaCb   *raCb,
 Bool        rlsRnti
 )
 #else
-PUBLIC S16 rgSCHRamDelRaCb(cell, raCb, rlsRnti)
+S16 rgSCHRamDelRaCb(cell, raCb, rlsRnti)
 RgSchCellCb *cell;
 RgSchRaCb   *raCb;
 Bool        rlsRnti;
@@ -1062,7 +1042,7 @@ Bool        rlsRnti;
 #endif
    rgSCHUtlFreeSBuf(inst, (Data **)&raCb, sizeof(RgSchRaCb));
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamDelRaCb */
 
 
@@ -1086,12 +1066,12 @@ Bool        rlsRnti;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamTtiHndlr
+S16 rgSCHRamTtiHndlr
 (
 RgSchCellCb  *cell
 )
 #else
-PUBLIC S16 rgSCHRamTtiHndlr(cell)
+S16 rgSCHRamTtiHndlr(cell)
 RgSchCellCb  *cell;
 #endif
 {
@@ -1134,7 +1114,7 @@ RgSchCellCb  *cell;
    winGap = (rgRaPrmblToRaFrmTbl[cell->rachCfg.preambleFormat]-1)+ 
       (cell->rachCfg.raWinSize -1 ) + RGSCH_RARSP_WAIT_PERIOD;   
  
-   raIdx = (((crntSfn & 1) * RGSCH_MAX_RA_RNTI+ cell->crntTime.subframe 
+   raIdx = (((crntSfn & 1) * RGSCH_MAX_RA_RNTI+ cell->crntTime.slot 
             + RG_SCH_CMN_DL_DELTA - winGap)+ RGSCH_RAREQ_ARRAY_SIZE ) 
            % RGSCH_RAREQ_ARRAY_SIZE;
 
@@ -1154,10 +1134,10 @@ RgSchCellCb  *cell;
    /* Fixes for RACH handling: Added deletion of queued RaReq */
    frm   = cell->crntTime;
    RGSCH_INCR_SUB_FRAME(frm, RG_SCH_CMN_DL_DELTA);
-   if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][frm.subframe] !=
+   if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][frm.slot] !=
                      RG_SCH_TDD_UL_SUBFRAME)
    {
-      raIdx = rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][frm.subframe]-1;
+      raIdx = rgSchTddNumDlSubfrmTbl[cell->ulDlCfgIdx][frm.slot]-1;
       rgSCHRamDelRaReq(cell, cell->crntTime, raIdx);
    }
 #endif
@@ -1166,7 +1146,7 @@ RgSchCellCb  *cell;
    /* ccpu00132536:MOD- racb timeout will be verified in each SFN such that 
     * the RACB whose processing is not completed in RG_MAX_RA_PRC_FRM
     * will be deleted*/
-   if (cell->crntTime.subframe == 0)
+   if (cell->crntTime.slot == 0)
    {
       maxCnt = cell->raInfo.raCbLst.count;
       for (idx = 0; idx < maxCnt; idx++)
@@ -1196,7 +1176,7 @@ RgSchCellCb  *cell;
       }
    }
    
-   RETVALUE(ROK)
+   return ROK
 }  /* rgSCHRamTtiHndlr */
 
 
@@ -1216,12 +1196,12 @@ RgSchCellCb  *cell;
  *      -# ROK 
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamFreeCell
+S16 rgSCHRamFreeCell
 (
 RgSchCellCb    *cell
 )
 #else
-PUBLIC S16 rgSCHRamFreeCell(cell)
+S16 rgSCHRamFreeCell(cell)
 RgSchCellCb    *cell;
 #endif
 {
@@ -1302,7 +1282,7 @@ RgSchCellCb    *cell;
       rgSCHRamDelRaCb(cell, raCb, TRUE);
    }
 
-   RETVALUE(ROK)
+   return ROK
 } /* rgSCHRamFreeCell */
 #ifdef RGR_V1
 #ifdef ANSI
@@ -1485,14 +1465,14 @@ RgSchCellCb        *cell;
  *      -# ROK
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHRamDelRaReq
+S16 rgSCHRamDelRaReq
 (
 RgSchCellCb          *cell,
 CmLteTimingInfo      timingInfo,
 U8                   raIdx
 )
 #else
-PUBLIC S16 rgSCHRamDelRaReq(cell, timingInfo, raIdx)
+S16 rgSCHRamDelRaReq(cell, timingInfo, raIdx)
 RgSchCellCb          *cell;
 CmLteTimingInfo      timingInfo;
 U8                   raIdx;
@@ -1554,19 +1534,19 @@ U8                   raIdx;
       }
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif
 
 /*MSG4 Fix Start */
 #ifdef ANSI
-PUBLIC S16 rgSCHRamAddToRaInfoSchdLst
+S16 rgSCHRamAddToRaInfoSchdLst
 (
 RgSchCellCb       *cell,
 RgSchRaCb         *raCb
 )
 #else
-PUBLIC S16 rgSCHRamAddToRaInfoSchdLst(cell, raCb)
+S16 rgSCHRamAddToRaInfoSchdLst(cell, raCb)
 RgSchCellCb       *cell;
 RgSchRaCb         *raCb;
 #endif
@@ -1584,19 +1564,19 @@ RgSchRaCb         *raCb;
    cmLListAdd2Tail(&(cell->raInfo.toBeSchdLst), &(raCb->schdLnk));
    raCb->contResTmrLnk.node = (PTR)(raCb);
    cmLListAdd2Tail(&(cell->contResTmrLst), &(raCb->contResTmrLnk));
-   RETVALUE(ROK);
+   return ROK;
 } /* rgSCHRamAddToRaInfoSchdLst */
 
 
 
 #ifdef ANSI
-PUBLIC S16 rgSCHRamRmvFrmRaInfoSchdLst
+S16 rgSCHRamRmvFrmRaInfoSchdLst
 (
 RgSchCellCb       *cell,
 RgSchRaCb         *raCb
 )
 #else
-PUBLIC S16 rgSCHRamRmvFrmRaInfoSchdLst(cell, raCb)
+S16 rgSCHRamRmvFrmRaInfoSchdLst(cell, raCb)
 RgSchCellCb       *cell;
 RgSchRaCb         *raCb;
 #endif
@@ -1607,7 +1587,7 @@ RgSchRaCb         *raCb;
    raCb->schdLnk.node = NULLP;   
    cmLListDelFrm(&(cell->contResTmrLst), &(raCb->contResTmrLnk));
    raCb->contResTmrLnk.node = NULLP;
-   RETVALUE(ROK);
+   return ROK;
 } /* rgSCHRamRmvFrmRaInfoSchdLst */
 
 /*MSG4 Fix End*/