Replaced old SSI function with new macros jira id - ODUHIGH-212
[o-du/l2.git] / src / 5gnrsch / rg_sch_ram.c
index ad27fe0..a92fdc3 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 */
@@ -178,10 +158,10 @@ RgrUeCfg     *ueCfg;
 #endif          
           )
       {
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**
@@ -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 */
 
 /**
@@ -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 */
 
 /**
@@ -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 */
 
 
@@ -699,7 +679,7 @@ RgSchErrInfo    *err;
       }
    } 
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamProcMsg3 */
 
 
@@ -744,7 +724,7 @@ RgInfCmnBoRpt     *staRsp;
    rgSCHRamAddToRaInfoSchdLst(cell, raCb);
    /* MSG4 Fix  End */      
    
-   RETVALUE(ROK);
+   return ROK;
 } /* rgSCHRamUpdtBo */
 
 /**
@@ -779,7 +759,7 @@ RgSchRaCb      *raCb;
    /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
    rgSCHUhmProcMsg3DatInd(&(raCb->msg3HqProc));
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg3DatInd */
 
 /**
@@ -812,7 +792,7 @@ RgSchRaCb      *raCb;
    /*ccpu00128820 - MOD - Msg3 alloc double delete issue*/
    rgSCHUhmProcMsg3Failure(&(raCb->msg3HqProc));
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg3FailureInd */
 
 /**
@@ -842,7 +822,7 @@ RgSchRaCb      *raCb;
 {
    TRC2(rgSCHRamMsg4FdbkInd)
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg4FdbkInd */
 
 
@@ -936,7 +916,7 @@ RgSchRaCb      *raCb;
       rgSCHDhmRlsHqpTb(raCb->dlHqE->msg4Proc, 0, TRUE);
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamMsg4Done */
 
 
@@ -1062,7 +1042,7 @@ Bool        rlsRnti;
 #endif
    rgSCHUtlFreeSBuf(inst, (Data **)&raCb, sizeof(RgSchRaCb));
 
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgSCHRamDelRaCb */
 
 
@@ -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 */
 
 
@@ -1302,7 +1282,7 @@ RgSchCellCb    *cell;
       rgSCHRamDelRaCb(cell, raCb, TRUE);
    }
 
-   RETVALUE(ROK)
+   return ROK
 } /* rgSCHRamFreeCell */
 #ifdef RGR_V1
 #ifdef ANSI
@@ -1554,7 +1534,7 @@ U8                   raIdx;
       }
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif
 
@@ -1584,7 +1564,7 @@ RgSchRaCb         *raCb;
    cmLListAdd2Tail(&(cell->raInfo.toBeSchdLst), &(raCb->schdLnk));
    raCb->contResTmrLnk.node = (PTR)(raCb);
    cmLListAdd2Tail(&(cell->contResTmrLst), &(raCb->contResTmrLnk));
-   RETVALUE(ROK);
+   return ROK;
 } /* rgSCHRamAddToRaInfoSchdLst */
 
 
@@ -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*/