Jira id - ODUHIGH-227
[o-du/l2.git] / src / 5gnrsch / rg_sch_lmm.c
index 34e10d0..9903a9f 100755 (executable)
@@ -39,16 +39,7 @@ static int RLOG_MODULE_ID=4096;
 static int RLOG_FILE_ID=167;
 
 /* 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 Defines */
+#include "common_def.h"
 #include "rg_env.h"        /* MAC Environment Defines */
 #include "rgr.h"           /* RGR Interface defines */
 #include "tfu.h"           /* RGU Interface defines */
@@ -64,15 +55,6 @@ static int RLOG_FILE_ID=167;
 #include "rl_common.h"
 
 /* header/extern include files (.x) */
-#include "gen.x"           /* general */
-#include "ssi.x"           /* system services */
-#include "cm5.x"           /* system services */
-#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 Defines */
 #include "rgr.x"           /* RGR Interface includes */
 #include "rgm.x"           /* RGM Interface includes */
 #include "tfu.x"           /* RGU Interface includes */
@@ -83,24 +65,24 @@ static int RLOG_FILE_ID=167;
 #include "rg_sch_cmn.x"    /* typedefs for Scheduler */
 #endif 
 #ifndef LTE_L2_MEAS
-PUBLIC Void rgSCHCmnInit ARGS((Void));
+Void rgSCHCmnInit ARGS((Void));
 #endif 
 /* forward references */
-
-
+extern int schActvInit(Ent entity, Inst instId, Region region, Reason reason);
+#ifdef UNUSE_FUN
 PRIVATE U16 rgSCHLmmSapCfg ARGS((
    Inst           inst,
    RgCfg          *cfg,
    U8             sapIdx,
    Elmnt          sapType
 ));
-
+#endif
 PRIVATE Void rgSCHLmmShutdown ARGS((
    Inst inst
 ));
 
 
-PUBLIC void printSchCellInfo(void)
+void printSchCellInfo(void)
 {
    U8 idx=0;
    U8 inst=0;
@@ -124,7 +106,7 @@ PUBLIC void printSchCellInfo(void)
  *
  *     Function : rgSCHLmmSapCfg
  *     
- *     This function in called by HandleSchGenCfgReq(). It handles the
+ *     This function in called by SchProcGenCfgReq(). It handles the
  *     interface SAP configuration of the scheduler instance. It 
  *     initializes the sapState to LRG_UNBND. Returns
  *     reason for success/failure of this function.
@@ -135,6 +117,7 @@ PUBLIC void printSchCellInfo(void)
  *      -# LCM_REASON_INVALID_SAP
  *      -# LCM_REASON_NOT_APPL
  **/
+#ifdef UNUSE_FUN
 #ifdef ANSI
 PRIVATE U16 rgSCHLmmSapCfg
 (
@@ -164,8 +147,8 @@ Elmnt sapType;            /* SAP Type */
    {   
       case STRGRSAP:
 #ifndef CL_MAC_LWLC
-         if ((cfg->s.schInstCfg.rgrSap[sapIdx].selector != RGR_SEL_TC) &&
-             (cfg->s.schInstCfg.rgrSap[sapIdx].selector != RGR_SEL_LC))
+         if ((cfg->s.schInstCfg.rgrSap[sapIdx].selector != ODU_SELECTOR_TC) &&
+             (cfg->s.schInstCfg.rgrSap[sapIdx].selector != ODU_SELECTOR_LC))
          {
             ret = LCM_REASON_INVALID_PAR_VAL;
             RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCfg(): unsupported"
@@ -198,8 +181,8 @@ Elmnt sapType;            /* SAP Type */
          break;
       case STTFUSAP:
 #ifndef CL_MAC_LWLC
-         if ((cfg->s.schInstCfg.tfuSap[sapIdx].selector != TFU_SEL_TC) &&
-             (cfg->s.schInstCfg.tfuSap[sapIdx].selector != TFU_SEL_LC))
+         if ((cfg->s.schInstCfg.tfuSap[sapIdx].selector != ODU_SELECTOR_TC) &&
+             (cfg->s.schInstCfg.tfuSap[sapIdx].selector != ODU_SELECTOR_LC))
          {
             ret = LCM_REASON_INVALID_PAR_VAL;
             RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCfg(): unsupported"
@@ -274,8 +257,9 @@ Elmnt sapType;            /* SAP Type */
          /* would never reach here */
          break;
    }
-   RETVALUE(ret);
+   return (ret);
 }
+#endif
 \f
 /***********************************************************
  *
@@ -455,14 +439,14 @@ Inst inst;
  *
  **********************************************************/
 #ifdef ANSI
-PUBLIC Void rgSCHLmmGenCntrl 
+Void rgSCHLmmGenCntrl 
 (
 RgMngmt       *cntrl,
 RgMngmt       *cfm,
 Pst           *cfmPst
 )
 #else
-PUBLIC Void rgSCHLmmGenCntrl(cntrl, cfm, cfmPst)
+Void rgSCHLmmGenCntrl(cntrl, cfm, cfmPst)
 RgMngmt       *cntrl;
 RgMngmt       *cfm;
 Pst           *cfmPst;
@@ -584,14 +568,14 @@ Pst           *cfmPst;
  *
  **********************************************************/
 #ifdef ANSI
-PUBLIC Void rgSCHLmmSapCntrl 
+Void rgSCHLmmSapCntrl 
 (
 RgMngmt       *cntrl,
 RgMngmt       *cfm,
 Pst           *cfmPst
 )
 #else
-PUBLIC Void rgSCHLmmSapCntrl(cntrl, cfm, cfmPst)
+Void rgSCHLmmSapCntrl(cntrl, cfm, cfmPst)
 RgMngmt       *cntrl;
 RgMngmt       *cfm;
 Pst           *cfmPst;
@@ -777,14 +761,14 @@ Pst           *cfmPst;
  *
  **********************************************************/
 #ifdef ANSI
-PUBLIC Void SchFillCfmPst
+Void SchFillCfmPst
 (
 Pst           *reqPst,
 Pst           *cfmPst,
 RgMngmt       *cfm
 )
 #else
-PUBLIC Void SchFillCfmPst(reqPst, cfmPst, cfm)
+Void SchFillCfmPst(reqPst, cfmPst, cfm)
 Pst           *reqPst;
 Pst           *cfmPst;
 RgMngmt       *cfm;
@@ -796,10 +780,10 @@ RgMngmt       *cfm;
 
    inst = (reqPst->dstInst - SCH_INST_START);
 
-   cfmPst->srcEnt    = ENTRG;
+   cfmPst->srcEnt    = ENTMAC;
    cfmPst->srcInst   = (Inst) 1;
    cfmPst->srcProcId = rgSchCb[inst].rgSchInit.procId;
-   cfmPst->dstEnt    = ENTRG;
+   cfmPst->dstEnt    = ENTMAC;
    cfmPst->dstInst   = (Inst) 0;
    cfmPst->dstProcId = reqPst->srcProcId;
 
@@ -830,7 +814,7 @@ RgMngmt       *cfm;
  *      -# ROK
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHLmmStartTmr
+S16 rgSCHLmmStartTmr
 (
 Inst               inst,
 S16                tmrEvnt,            /* Timer Event */
@@ -838,7 +822,7 @@ U32                tmrVal,             /* Wait Time */
 PTR                cb                  /* Entry for which Timer Expired */
 )
 #else
-PUBLIC S16 rgSCHLmmStartTmr(inst, tmrEvnt, tmrVal, cb)
+S16 rgSCHLmmStartTmr(inst, tmrEvnt, tmrVal, cb)
 Inst               inst;             /* scheduler instance ID */
 S16                tmrEvnt;            /* Timer Event */
 U32                tmrVal;             /* Wait Time */
@@ -865,7 +849,7 @@ PTR                cb;                 /* Entry for which Timer Expired */
    arg.wait = tmrVal;      
    cmPlcCbTq(&arg);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
@@ -889,14 +873,14 @@ PTR                cb;                 /* Entry for which Timer Expired */
  *      -# RFAILED
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHLmmStopTmr
+S16 rgSCHLmmStopTmr
 (
 Inst               inst,             /* Scheduler instance */
 S16                tmrEvnt,            /* Timer Event */
 PTR                cb                  /* Entry for which Timer Expired */
 )
 #else
-PUBLIC S16 rgSCHLmmStopTmr(inst, tmrEvnt, cb)
+S16 rgSCHLmmStopTmr(inst, tmrEvnt, cb)
 Inst               inst;             /* Scheduler instance */
 S16                tmrEvnt;            /* Timer Event */
 PTR                cb;                 /* Entry for which Timer Expired */
@@ -934,7 +918,7 @@ PTR                cb;                 /* Entry for which Timer Expired */
    }
 
 
-   RETVALUE(ret);
+   return (ret);
 }
 
 \f
@@ -955,13 +939,13 @@ PTR                cb;                 /* Entry for which Timer Expired */
  *      -# ROK
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHLmmTmrExpiry
+S16 rgSCHLmmTmrExpiry
 (
 PTR cb,               /* Pointer to timer control block */
 S16 tmrEvnt           /* Timer Event */
 )
 #else
-PUBLIC S16 rgSCHLmmTmrExpiry(cb,tmrEvnt)
+S16 rgSCHLmmTmrExpiry(cb,tmrEvnt)
 PTR cb;               /* Pointer to timer control block */
 S16 tmrEvnt;          /* Timer Event */
 #endif
@@ -1005,7 +989,7 @@ S16 tmrEvnt;          /* Timer Event */
          ret = RFAILED;
          break;
    }
-   RETVALUE(ret);
+   return (ret);
 }
 
 \f
@@ -1030,14 +1014,14 @@ S16 tmrEvnt;          /* Timer Event */
  *      -# ROK
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHLmmBndCfm
+S16 rgSCHLmmBndCfm
 (
 Pst *pst,               /* Post Structure */
 SuId suId,              /* Service user ID */
 U8 status               /* Status */
 )
 #else
-PUBLIC S16 rgSCHLmmBndCfm(pst,suId,status)
+S16 rgSCHLmmBndCfm(pst,suId,status)
 Pst *pst;               /* Post Structure */
 SuId suId;              /* Service user Id */
 U8 status;              /* Status */
@@ -1058,9 +1042,9 @@ U8 status;              /* Status */
          break;
       case LRG_BND:
          /* SAP is already bound */
-         RETVALUE(ROK);
+         return ROK;
       default:
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
 
    cfmPst = rgSchCb[inst].rgSchInit.lmPst;
@@ -1108,7 +1092,7 @@ U8 status;              /* Status */
 
    ret = RgMiLrgSchCntrlCfm(&cfmPst, &cntrlCfm);
 
-   RETVALUE(ret);
+   return (ret);
 }
 
 /**
@@ -1129,7 +1113,7 @@ U8 status;              /* Status */
  *      -# ROK
  **/
 #ifdef ANSI
-PUBLIC S16 rgSCHLmmStaInd
+S16 rgSCHLmmStaInd
 (
 Inst inst,
 U16  category,
@@ -1138,7 +1122,7 @@ U16  cause,
 RgUstaDgn *dgn
 )
 #else
-PUBLIC S16 rgSCHLmmStaInd(inst, category, event, cause, dgn) 
+S16 rgSCHLmmStaInd(inst, category, event, cause, dgn) 
 Inst inst;
 U16 category;
 U16 event;
@@ -1152,7 +1136,7 @@ RgUstaDgn *dgn;
 
    if(rgSchCb[inst].rgSchInit.usta == FALSE)
    {
-      RETVALUE(ROK);
+      return ROK;
    }
 
    cmMemset((U8 *)&usta, 0, sizeof(RgMngmt));
@@ -1178,7 +1162,7 @@ RgUstaDgn *dgn;
                        rgSchCb[inst].genCfg.ustaResp.response.mem.pool;
    usta.hdr.transId = rgSchCb[inst].genCfg.ustaResp.transId;
 
-   RETVALUE(RgMiLrgSchStaInd(&rgSchCb[inst].rgSchInit.lmPst, &usta));
+   return (RgMiLrgSchStaInd(&rgSchCb[inst].rgSchInit.lmPst, &usta));
 }
 
 \f
@@ -1199,13 +1183,13 @@ RgUstaDgn *dgn;
  *      -# ROK
  **/
 #ifdef ANSI
-PUBLIC S16 schActvTmr
+S16 schActvTmr
 (
 Ent ent,
 Inst inst
 )
 #else
-PUBLIC S16 schActvTmr(ent, inst)
+S16 schActvTmr(ent, inst)
 Ent ent;
 Inst inst;
 #endif
@@ -1217,7 +1201,7 @@ Inst inst;
    cmPrcTmr(&rgSchCb[schInst].tmrTqCp,
             rgSchCb[schInst].tmrTq, (PFV) rgSCHLmmTmrExpiry);
  
-   RETVALUE(ROK);
+   return ROK;
  
 } /* end of schActvTmr */