Replaced old SSI function with new macros jira id - ODUHIGH-212
[o-du/l2.git] / src / 5gnrsch / rg_sch_mga.c
index 33dcf2d..abcffc2 100755 (executable)
@@ -36,15 +36,7 @@ static int RLOG_MODULE_ID=4096;
 static int RLOG_FILE_ID=169;
 
 /* 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 "tfu.h"
@@ -57,15 +49,6 @@ static int RLOG_FILE_ID=169;
 #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"           /* RGU types */
 #include "lrg.x"           /* layer management typedefs for MAC */
 #include "rgr.x"           /* layer management typedefs for MAC */
@@ -182,7 +165,7 @@ RgrUeCfg    *ueCfg;
       cmInitTimers (&ue->ackNakRepCb.ackNakRepDlInactvTmr, 1);
       cmInitTimers (&ue->ackNakRepCb.ackNakRepTmr, 1);
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**
@@ -306,7 +289,7 @@ RgrUeRecfg     *ueRecfg;
       ackNakRepCb->isAckNackEnabled = FALSE;
    } /* repetition disabled in re configuration */
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
  /** @brief This function is a utility to add the UE to the correct Measurement
@@ -358,9 +341,9 @@ RgrUeMeasGapCfg      *cfg;
          RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, 
                   "rgSCHMeasGapANRepUeRecfg() Incorrect GAP Period"
                   "CRNTI:%d",ue->ueId);
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
-   RETVALUE(ROK);
+   return ROK;
 } /* end of rgSCHMeasGapANRepUtlAddUe */ 
 
 
@@ -408,7 +391,7 @@ RgSchUeCb          *ue;
          ue->measGapCb.measQLnk.node = NULLP;
          break;
    }
-   RETVALUE(ROK);
+   return ROK;
 } /* end of rgSCHMeasGapANRepUtlRmvUe */ 
 
 /**
@@ -564,7 +547,7 @@ PRIVATE S16 rgSchAckNackRepUtlRmvUe (cell, ue)
       }
    }
  
-   RETVALUE(ROK);
+   return ROK;
 } /* end of */ 
 
 
@@ -657,10 +640,10 @@ RgSchCellCb *cell;
    /* 40ms offset */
    /* Introduced timing delta for DL control in FDD */
 #ifdef LTE_TDD
-   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DELTA) % 
+   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DELTA) % 
       RG_MEAS_GAPPRD_40;
 #else
-   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DLCNTRL_DLDELTA) % 
+   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DLCNTRL_DLDELTA) % 
       RG_MEAS_GAPPRD_40;
 #endif
    queue = &(cell->measGapCb.gapPrd40Q[offset]);
@@ -668,10 +651,10 @@ RgSchCellCb *cell;
    /* 80ms offset */
    /* Introduced timing delta for DL control in FDD */
 #ifdef LTE_TDD
-   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DELTA) % 
+   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DELTA) % 
       RG_MEAS_GAPPRD_80;
 #else
-   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + TFU_DLCNTRL_DLDELTA) % 
+   offset = (cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + TFU_DLCNTRL_DLDELTA) % 
       RG_MEAS_GAPPRD_80;
 #endif
    queue = &(cell->measGapCb.gapPrd80Q[offset]);
@@ -679,7 +662,7 @@ RgSchCellCb *cell;
 
    /* for ACK NACK repetition starts at offset - however at MAC we are 
     * concerned with subframe - TFU_DELTA */
-   /* offset = ((cell->crntTime.sfn * 10) + cell->crntTime.subframe) % 
+   /* offset = ((cell->crntTime.sfn * 10) + cell->crntTime.slot) % 
     * RG_MAX_NUM_DLSF; */
    /* We wish to get the subframe whose HARQ Reception request would go out in
     * this subframe. HARQ_RTT - TFU_DELTA
@@ -696,7 +679,7 @@ RgSchCellCb *cell;
    queue = &(dlSf->ueLst);
    rgSchAckNackRepUtlHdlTti (cell, queue);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
  /** @brief This function Marks the UE as ackNakRep so that Reception request
@@ -868,14 +851,14 @@ CmLListCp   *dlInactvUeLst;
 
    TRC2(rgSCHMeasGapANRepGetDlInactvUe);
 
-   schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + RG_DL_DELTA; 
+   schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + RG_DL_DELTA; 
 
 #ifdef LTE_TDD
    RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, ackNakTime, RG_DL_DELTA);
    if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][ackNakTime.subframe] !=
          RG_SCH_TDD_DL_SUBFRAME)
    {
-      RETVALUE(ROK);
+      return ROK;
    }
 
    dlSf = rgSCHUtlSubFrmGet (cell, ackNakTime);
@@ -931,14 +914,14 @@ CmLListCp   *dlInactvUeLst;
 
    /* Calc offset for ACK NACK repetition */
    /*offset = (cell->crntTime.sfn * 10 + 
-     cell->crntTime.subframe + RG_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL - 1) 
+     cell->crntTime.slot + RG_DL_DELTA + RG_SCH_CMN_HARQ_INTERVAL - 1) 
      % RG_MAX_NUM_DLSF;*/
    /* The ackNakRepQ resides in each dlSf corresponding to the repStart */
    /* Must pick up the subframe that was scheduled in the last TTI */
 #ifdef LTE_TDD
    if(cell->ulDlCfgIdx == 5)
    {
-      RETVALUE(ROK);
+      return ROK;
    }
    rgSCHUtlGetPrevDlSfInfo(cell, ackNakTime, &ackNakTime, &repCntr);
    dlSf = rgSCHUtlSubFrmGet (cell, ackNakTime);
@@ -997,7 +980,7 @@ CmLListCp   *dlInactvUeLst;
          }
       }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**
@@ -1078,7 +1061,7 @@ CmLListCp   *ulInactvUeLst;
    TRC2(rgSCHMeasGapANRepGetUlInactvUe);
 
    /*ccpu00139481- Meas Gap should be monitored in UL with TFU_ULCNTRL_DLDELTA*/
-   schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.subframe + \
+   schedTime = cell->crntTime.sfn * RGSCH_NUM_SUB_FRAMES_5G + cell->crntTime.slot + \
                TFU_ULCNTRL_DLDELTA;
 #ifndef LTE_TDD
    pdcchToPuschGap = RGSCH_PDCCH_PUSCH_DELTA;
@@ -1136,20 +1119,20 @@ CmLListCp   *ulInactvUeLst;
    }
    /* Calc offset for ACK NACK repetition */
    /*offset = (cell->crntTime.sfn * 10 + 
-     cell->crntTime.subframe + RG_UL_SCHED_DELTA + 
+     cell->crntTime.slot + RG_UL_SCHED_DELTA + 
      RG_SCH_CMN_HARQ_INTERVAL ) % RG_MAX_NUM_DLSF;*/
 
    /* Must get the DLSF that is scheduled at TFU_DELTA Away */
 #ifdef LTE_TDD
    if(cell->ulDlCfgIdx == 5)
    {
-      RETVALUE(ROK);
+      return ROK;
    }
    RG_SCH_ADD_TO_CRNT_TIME(cell->crntTime, ackNakTime, TFU_DELTA);
    if(rgSchTddUlDlSubfrmTbl[cell->ulDlCfgIdx][ackNakTime.subframe] !=
          RG_SCH_TDD_DL_SUBFRAME)
    {
-      RETVALUE(ROK);
+      return ROK;
    }
 #else
    /* Introduced timing delta for DL control in FDD */
@@ -1194,7 +1177,7 @@ CmLListCp   *ulInactvUeLst;
          }
       }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**
@@ -1539,7 +1522,7 @@ U8                repCnt;
       }
    noSubfrms += rem;
 
-   RETVALUE(noSubfrms);
+   return (noSubfrms);
    }
 
 /**