[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / 5gnrsch / rg_sch_lmm.c
index 9c4e05a..dbb5cd6 100755 (executable)
@@ -34,9 +34,6 @@
        request primitives are defined here.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_MODULE_ID=4096;
-static int RLOG_FILE_ID=167;
 
 /* header include files (.h) */
 #include "common_def.h"
@@ -51,9 +48,7 @@ static int RLOG_FILE_ID=167;
 #ifdef LTE_L2_MEAS
 #include "rg_sch_cmn.h"    /* typedefs for Scheduler */
 #endif
-#include "rl_interface.h"
-#include "rl_common.h"
-
+#include "sch_utils.h"
 /* header/extern include files (.x) */
 #include "rgr.x"           /* RGR Interface includes */
 #include "rgm.x"           /* RGM Interface includes */
@@ -93,8 +88,8 @@ void printSchCellInfo(void)
        * with this SAP */
       if (rgSchCb[inst].tfuSap[idx].cell != NULLP)
       {
-         RLOG1(L_INFO,"CELL %d\n", idx);
-         RLOG1(L_INFO,"NUM UEs :%d\n",rgSchCb[inst].tfuSap[idx].cell->ueLst.nmbEnt);
+         DU_LOG("\nINFO  -->  SCH : CELL %d\n", idx);
+         DU_LOG("\nINFO  -->  SCH : NUM UEs :%d\n",rgSchCb[inst].tfuSap[idx].cell->ueLst.nmbEnt);
       }
    }
 }
@@ -141,7 +136,7 @@ Elmnt sapType             /* SAP Type */
              (cfg->s.schInstCfg.rgrSap[sapIdx].selector != ODU_SELECTOR_LC))
          {
             ret = LCM_REASON_INVALID_PAR_VAL;
-            RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCfg(): unsupported"
+            DU_LOG("\nERROR  -->  SCH : rgSCHLmmSapCfg(): unsupported"
                " Selector value for RGR.");
             break;
          }
@@ -175,7 +170,7 @@ Elmnt sapType             /* SAP Type */
              (cfg->s.schInstCfg.tfuSap[sapIdx].selector != ODU_SELECTOR_LC))
          {
             ret = LCM_REASON_INVALID_PAR_VAL;
-            RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCfg(): unsupported"
+            DU_LOG("\nERROR  -->  SCH : rgSCHLmmSapCfg(): unsupported"
                      " Selector value for TFU.");
             break;
          }
@@ -215,7 +210,7 @@ Elmnt sapType             /* SAP Type */
              (cfg->s.schInstCfg.rgmSap[sapIdx].selector != RGM_SEL_TC))
          {
             ret = LCM_REASON_INVALID_PAR_VAL;
-            RLOG_ARG0(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCfg(): unsupported"
+            DU_LOG("\nERROR  -->  SCH : rgSCHLmmSapCfg(): unsupported"
                      " Selector value for RGM.");
             break;
          }
@@ -362,29 +357,21 @@ static Void rgSCHLmmShutdown(Inst inst)
    }
    /* Free the memory held by the scheduler instance */
    /* Deallocate RGR saps */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].rgrSap,
+   SCH_FREE(rgSchCb[inst].rgrSap,
                 (sizeof(RgSchUpSapCb) * rgSchCb[inst].numSaps));
    rgSchCb[inst].rgrSap = NULLP;
    /* Deallocate RGM saps */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].rgmSap,
+   SCH_FREE(rgSchCb[inst].rgmSap,
                 (sizeof(RgSchUpSapCb) * rgSchCb[inst].numSaps));
    rgSchCb[inst].rgmSap = NULLP;
 
    /* Deallocate TFU saps */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].tfuSap,
+   SCH_FREE(rgSchCb[inst].tfuSap,
                 (sizeof(RgSchLowSapCb) * rgSchCb[inst].numSaps));
    rgSchCb[inst].tfuSap = NULLP;
 
    /* Deallocate bndCfmResponses */
-   SPutSBuf(rgSchCb[inst].rgSchInit.region,
-                rgSchCb[inst].rgSchInit.pool,
-                (Data *)rgSchCb[inst].genCfg.bndCfmResp,
+   SCH_FREE(rgSchCb[inst].genCfg.bndCfmResp,
                 (sizeof(RgSchLmResponse) * rgSchCb[inst].numSaps));
    rgSchCb[inst].genCfg.bndCfmResp = NULLP;
    /* De-register the Timer Service */
@@ -474,7 +461,7 @@ Void rgSCHLmmGenCntrl(RgMngmt *cntrl,RgMngmt *cfm,Pst  *cfmPst)
             default:
                cfm->cfm.status = LCM_PRIM_NOK;
                cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
-               RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "rgSCHLmmGenCntrl(): "
+               DU_LOG("\nERROR  -->  SCH : rgSCHLmmGenCntrl(): "
                   "invalid subaction=%d", cntrl->t.cntrl.subAction);
                break;
          }
@@ -498,7 +485,7 @@ Void rgSCHLmmGenCntrl(RgMngmt *cntrl,RgMngmt *cfm,Pst  *cfmPst)
             default:
                cfm->cfm.status = LCM_PRIM_NOK;
                cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
-               RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "rgSCHLmmGenCntrl():"
+               DU_LOG("\nERROR  -->  SCH : rgSCHLmmGenCntrl():"
                  " invalid subaction=%d", cntrl->t.cntrl.subAction);
                break;
          }
@@ -510,7 +497,7 @@ Void rgSCHLmmGenCntrl(RgMngmt *cntrl,RgMngmt *cfm,Pst  *cfmPst)
       default:
          cfm->cfm.status = LCM_PRIM_NOK;
          cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
-         RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "rgSCHLmmGenCntrl(): invalid"
+         DU_LOG("\nERROR  -->  SCH : rgSCHLmmGenCntrl(): invalid"
           " action=%d", cntrl->t.cntrl.action);
          break;
    }
@@ -642,7 +629,7 @@ Pst           *cfmPst
             default:
                cfm->cfm.status = LCM_PRIM_NOK;
                cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
-               RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCntrl(): "
+               DU_LOG("\nERROR  -->  SCH : rgSCHLmmSapCntrl(): "
                   "invalid action=%d", cntrl->t.cntrl.action);
                break;
          }
@@ -665,7 +652,7 @@ Pst           *cfmPst
             default:
                cfm->cfm.status = LCM_PRIM_NOK;
                cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
-               RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCntrl(): "
+               DU_LOG("\nERROR  -->  SCH : rgSCHLmmSapCntrl(): "
                      "invalid action=%d", cntrl->t.cntrl.action);
                break;
          }
@@ -688,7 +675,7 @@ Pst           *cfmPst
             default:
                cfm->cfm.status = LCM_PRIM_NOK;
                cfm->cfm.reason = LCM_REASON_INVALID_PAR_VAL;
-               RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "rgSCHLmmSapCntrl(): "
+               DU_LOG("\nERROR  -->  SCH : rgSCHLmmSapCntrl(): "
                      "invalid action=%d", cntrl->t.cntrl.action);
                break;
          }
@@ -877,9 +864,6 @@ S16 tmrEvnt           /* Timer Event */
 {
    S16           ret = ROK;
    RgSchLowSapCb *tfuSap = (RgSchLowSapCb *)cb;
-#ifdef DEBUGP
-   Inst          inst = tfuSap->cell->instIdx;
-#endif
 
    
    switch(tmrEvnt)
@@ -908,7 +892,7 @@ S16 tmrEvnt           /* Timer Event */
          }
          break;
       default:
-         RLOG_ARG1(L_ERROR,DBG_INSTID,inst, "rgSCHLmmTmrExpiry(): Invalid"
+         DU_LOG("\nERROR  -->  SCH : rgSCHLmmTmrExpiry(): Invalid"
                  " tmrEvnt=%d", tmrEvnt);
          ret = RFAILED;
          break;
@@ -1069,35 +1053,6 @@ RgUstaDgn *dgn
 }
 
 \f
-/**
- * @brief Scheduler instance timer call back function registered with SSI. 
- *
- * @details
- *
- *     Function :  schActvTmr
- *     
- *     This function is invoked by SSI for every timer activation
- *     period expiry. Note that SS_MT_TMR flag needs to be enabled for this
- *     as isntId is needed.As part of SRegTmr call for scheduler instance 
- *     SS_MT_TMR flag needs to be enabled and schActvTmr needs to be given as 
- *     callback function
- *     
- *  @return  S16
- *      -# ROK
- **/
-S16 schActvTmr(Ent ent,Inst inst)
-{
-   Inst schInst = (inst  - SCH_INST_START);
-
-   /* Check if any timer in the scheduler instance has expired */ 
-   cmPrcTmr(&rgSchCb[schInst].tmrTqCp,
-            rgSchCb[schInst].tmrTq, (PFV) rgSCHLmmTmrExpiry);
-   return ROK;
-} /* end of schActvTmr */
-
-\f
 /**********************************************************************
  
          End of file