[Epic-ID: ODUHIGH-464][Task-ID: ODUHIGH-483] Memeory related fix in FDD and TDD mode
[o-du/l2.git] / src / 5gnrsch / rg_sch_dhm.c
index 2e51df9..bf93a4f 100755 (executable)
@@ -32,9 +32,6 @@
 @brief APIs related to Downlink HARQ for the scheduler.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_FILE_ID=242;
-static int RLOG_MODULE_ID=4096;
 
 /* header include files -- defines (.h) */
 #include "common_def.h"
@@ -47,8 +44,6 @@ static int RLOG_MODULE_ID=4096;
 #include "rg_sch_inf.h"         /* typedefs for Scheduler */
 #include "rg_sch.h"
 #include "rg_sch_cmn.h"
-#include "rl_interface.h"
-#include "rl_common.h"
 
 /* header/extern include files (.x) */
 #include "lrg.x"
@@ -321,8 +316,7 @@ RgSchDlHqEnt *rgSCHDhmHqEntInit(RgSchCellCb *cell)
    /* Init the HARQ data structure */
    if (rgSCHUtlAllocSBuf(inst, (Data **)&hqE, sizeof(RgSchDlHqEnt)) != ROK)
    {
-      RLOG_ARG0(L_DEBUG,DBG_CELLID,cell->cellId,
-                                         "rgSCHDhmHqEntInit hqE alloc fail"); 
+      DU_LOG("\nERROR  -->  SCH: rgSCHDhmHqEntInit hqE alloc fail"); 
       return (NULLP);
    }
 #ifdef LTE_TDD
@@ -331,8 +325,7 @@ RgSchDlHqEnt *rgSCHDhmHqEntInit(RgSchCellCb *cell)
    if (rgSCHUtlAllocSBuf(inst, (Data **)&hqE->procs, 
                            hqE->numHqPrcs * sizeof(RgSchDlHqProcCb)) != ROK)
    {
-      RLOG_ARG0(L_DEBUG,DBG_CELLID,cell->cellId,
-                                         "rgSCHDhmHqEntInit hqP alloc fail in hqE"); 
+      DU_LOG("\nERROR  -->  SCH: rgSCHDhmHqEntInit hqP alloc fail in hqE"); 
       return (NULLP);
    }
 #else
@@ -391,7 +384,7 @@ S16 rgSCHDhmGetAvlHqProc(RgSchCellCb *cell,RgSchUeCb *ue,CmLteTimingInfo  timing
  
    if (hqE == NULLP)
    {   
-      RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, "rgSCHDhmGetAvlHqProc hqE NULL ue %d"
+      DU_LOG("\nERROR  -->  SCH : rgSCHDhmGetAvlHqProc hqE NULL ue %d"
                            , ue->ueId);     
       return RFAILED;
    }
@@ -401,8 +394,7 @@ S16 rgSCHDhmGetAvlHqProc(RgSchCellCb *cell,RgSchUeCb *ue,CmLteTimingInfo  timing
 
    if (NULLP == tmp)
    {
-    RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId,
-                        "rgSCHDhmGetAvlHqProc free %ld inUse %ld ue %d"
+       DU_LOG("\nERROR  -->  SCH : rgSCHDhmGetAvlHqProc free %d inUse %d ue %d"
                                            , hqE->free.count, hqE->inUse.count, ue->ueId);
       /* No Harq Process available in the free queue. */
       return RFAILED;
@@ -866,8 +858,8 @@ rgEmtcsetNullSubFrm(hqP);
          if (hqE->free.count > 8)
          {
             int *p = NULL;
-            printf("Crashing invalid hq count after free \n");
-            printf("Crashing %d \n", *p);
+            printf("\nDEBUG  -->  SCH: Crashing invalid hq count after free \n");
+            printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
             *p = 10;
          }
 #endif
@@ -1109,7 +1101,7 @@ static Void rgSCHDhmFdbkIndHndlTa(RgSchDlHqProcCb *hqP,uint8_t tbIdx,uint8_t fdb
          else
          { 
 #ifdef DEBUGP            
-            RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId, "Trying to add CRNTI:%d into TA"
+            DU_LOG("\nERROR  -->  SCH : Trying to add CRNTI:%d into TA"
                      "ACK List twice", ueCb->ueId);
 #endif            
          } 
@@ -1125,8 +1117,7 @@ static Void rgSCHDhmFdbkIndHndlTa(RgSchDlHqProcCb *hqP,uint8_t tbIdx,uint8_t fdb
             hqP->hqE->ue->dl.taCb.state =  RGSCH_TA_IDLE;
 
             rgSCHUtlReTxTa(cell, ueCb);
-            RLOG_ARG0(L_DEBUG,DBG_CELLID,cell->cellId, 
-                  "Nack Rcvd for TA. Max Tries Attempted");
+            DU_LOG("\nERROR  -->  SCH : Nack Rcvd for TA. Max Tries Attempted");
          }
          break;
       case TFU_HQFDB_DTX:
@@ -1371,8 +1362,7 @@ Void rgSCHDhmHqTbTrnsFail(RgSchCellCb *cell,RgSchDlHqProcCb *hqP,uint8_t tbCnt,B
 #ifdef RGR_V1
       if(hqP->hqE->raCb->expiryTime.sfn == RGSCH_CONTRES_EXP)
       {
-         RLOG_ARG1(L_DEBUG,DBG_CELLID,cell->cellId,
-               "rgSCHDhmHqTbTrnsFail contRes exp(): tmpCRNTI = %u",
+         DU_LOG("\nDEBUG  -->  SCH : rgSCHDhmHqTbTrnsFail contRes exp(): tmpCRNTI = %u",
                hqP->hqE->raCb->tmpCrnti);
          rgSCHRamMsg4Done(cell, (RgSchRaCb *)hqP->hqE->raCb);
          return;
@@ -1505,8 +1495,7 @@ Void rgSCHDhmHqTbTrnsFail(RgSchCellCb *cell,RgSchDlHqProcCb *hqP,uint8_t tbCnt,B
 #endif
 
          /* Perform RAM MSG4 done processing */
-         RLOG_ARG1(L_DEBUG,DBG_CELLID,cell->cellId,
-               "rgSCHDhmHqTbTrnsFail(): hq max retx fail: tmpCRNTI = %u",
+         DU_LOG("\nDEBUG  -->  SCH : rgSCHDhmHqTbTrnsFail(): hq max retx fail: tmpCRNTI = %u",
                hqP->hqE->raCb->tmpCrnti);
          rgSCHRamMsg4Done(cell, (RgSchRaCb *)hqP->hqE->raCb);
       }
@@ -2439,8 +2428,7 @@ RgSchErrInfo         *err
          if ( found == FALSE ) 
          {
          RGSCH_NULL_CHECK(cellCb->instIdx, ue);
-         RLOG_ARG3(L_ERROR,DBG_CELLID,cellCb->cellId,"CRNTI:%d"
-         " NO HARQ proc available for feedback:timeInfo:snf %d,slot %d",
+         DU_LOG("\nERROR  -->  SCH : NO HARQ proc available for feedback:timeInfo:snf %d,slot %d",
          ue->ueId,timeInfo.sfn, timeInfo.slot);
          err->errType   = RGSCHERR_DHM_FDBK_IND;
          err->errCause  = RGSCHERR_DHM_FDBK_IND_INVALID_CB;
@@ -2653,20 +2641,19 @@ RgSchErrInfo    *err
          {
             raCb = rgSCHDbmGetRaCb(cell, rnti);
          }
-         RGSCHDBGINFO(cell->instIdx,
-               (rgSchPBuf(cell->instIdx), "Ack Rcvd. FdbkInd for Msg4Done\n"));
+         DU_LOG("\nDEBUG  -->  SCH: Ack Rcvd. FdbkInd for Msg4Done\n");
          /* Inform Random Access Module regarding the ack received */
          if (raCb != NULLP)
          {
             /*RRC Connection Setup failure issue where RRC connection 
              * setup was not reaching UE due to message 4 HARQ failure */
-            printf("\nMSG4 Ack ,calling rgSCHRamMsg4Done\n");
+            printf("\nDEBUG  -->  SCH: MSG4 Ack ,calling rgSCHRamMsg4Done\n");
             ret = rgSCHRamMsg4Done(cell, raCb);
             hqFreed = TRUE;
          }
          else
          {
-            printf("\nraCb is NULLP\n");
+            printf("\nDEBUG  -->  SCH: raCb is NULLP\n");
          }
       }
       else /*ccpu00114124- HARQ Release for Msg4 */
@@ -3191,8 +3178,7 @@ RgSchErrInfo         *err
          {
             if (!sf->relPdcch)
             {
-               RLOG_ARG3(L_ERROR,DBG_CELLID,cell->cellId, 
-                  "CRNTI:%d NO HARQ proc available for feedback: TimingInfo: "
+               DU_LOG("\nERROR  -->  SCH : CRNTI:%d NO HARQ proc available for feedback: TimingInfo: "
                   "sfn %d slot %d", ue->ueId, timingInfo.sfn,
                   timingInfo.slot);
                return RFAILED;
@@ -3871,8 +3857,7 @@ S16 rgSCHDhmRlsDlsfHqProc(RgSchCellCb *cellCb,CmLteTimingInfo uciTimingInfo)
 
                            rgSCHUtlReTxTa(cellCb, ue);
 
-                           RLOG_ARG0(L_DEBUG,DBG_CELLID,cellCb->cellId,
-                                   "Nack/DTX Rcvd for TA. Max Tries Attempted");
+                           DU_LOG("\nDEBUG  -->  SCH : Nack/DTX Rcvd for TA. Max Tries Attempted");
                         }
                      }
                   }
@@ -3956,8 +3941,7 @@ S16 rgSCHDhmRlsDlsfHqProc(RgSchCellCb *cellCb,CmLteTimingInfo uciTimingInfo)
                ue->dl.taCb.state = RGSCH_TA_IDLE;
                
                rgSCHUtlReTxTa(cellCb, ue); 
-               RLOG_ARG0(L_DEBUG,DBG_CELLID,cellCb->cellId,
-                     "Nack/DTX Rcvd for TA. Max Tries Attempted");
+               DU_LOG("\nDEBUG  -->  SCH : Nack/DTX Rcvd for TA. Max Tries Attempted");
                
              }
          }
@@ -4350,7 +4334,7 @@ static S16 rgSCHDhmUpdateAckNackHistory(RgSchCellCb *cell,RgSchUeCb *ueCb,uint8_
       ueDl->laCb[tbCnt].deltaiTbs = ueDl->laCb[tbCnt].deltaiTbs - DL_LA_STEPDOWN; 
    }
    /*
-   printf("deltaiTbs[%d] cqibasediTbs[%d] iTbs[%d] tbCnt[%d]\n", 
+   printf("\nDEBUG  -->  SCH: deltaiTbs[%d] cqibasediTbs[%d] iTbs[%d] tbCnt[%d]\n", 
            ueDl->laCb[tbCnt].deltaiTbs, ueDl->laCb[tbCnt].cqiBasediTbs, 
            (ueDl->laCb[tbCnt].deltaiTbs + ueDl->laCb[tbCnt].cqiBasediTbs)/100,
            tbCnt);
@@ -4486,8 +4470,8 @@ Void rgSCHDhmHqPAdd2FreeLst(RgSchDlHqProcCb  *hqP)
    if (hqP->hqPLst)
    {
       int *p = NULL;
-      printf("Crashing already part of free lst\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing already part of free lst\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4499,8 +4483,8 @@ Void rgSCHDhmHqPAdd2FreeLst(RgSchDlHqProcCb  *hqP)
    if (hqP->hqE->free.count > 8)
    {
       int *p = NULL;
-      printf("Crashing invalid hq count\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing invalid hq count\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4534,8 +4518,8 @@ Void rgSCHDhmHqPAdd2InUseLst(RgSchDlHqProcCb  *hqP)
    if (hqP->hqPLst)
    {
       int *p = NULL;
-      printf("Crashing already part of inuse lst\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing already part of inuse lst\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4547,8 +4531,8 @@ Void rgSCHDhmHqPAdd2InUseLst(RgSchDlHqProcCb  *hqP)
    if (hqP->hqE->inUse.count > 8)
    {
       int *p = NULL;
-      printf("Crashing invalid hq count \n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing invalid hq count \n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4577,8 +4561,8 @@ Void rgSCHDhmHqPDelFrmFreeLst(RgSchDlHqProcCb *hqP)
    if (!hqP->hqPLst)
    {
       int *p = NULL;
-      printf("Crashing not part of any lst\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing not part of any lst\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4586,8 +4570,8 @@ Void rgSCHDhmHqPDelFrmFreeLst(RgSchDlHqProcCb *hqP)
    if (hqP->hqPLst != &hqP->hqE->free)
    {
       int *p = NULL;
-      printf("Crashing del from wrong lst\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing del from wrong lst\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4599,8 +4583,8 @@ Void rgSCHDhmHqPDelFrmFreeLst(RgSchDlHqProcCb *hqP)
    if (hqP->hqE->free.count > 8)
    {
       int *p = NULL;
-      printf("Crashing invalid hq count\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing invalid hq count\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4631,8 +4615,8 @@ Void rgSCHDhmHqPDelFrmInUseLst(RgSchDlHqProcCb *hqP)
    if (!hqP->hqPLst)
    {
       int *p = NULL;
-      printf("Crashing not part of any lst\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing not part of any lst\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
 
    }
@@ -4641,8 +4625,8 @@ Void rgSCHDhmHqPDelFrmInUseLst(RgSchDlHqProcCb *hqP)
    if (hqP->hqPLst != &hqP->hqE->inUse)
    {
       int *p = NULL;
-      printf("Crashing del from wrong lst\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing del from wrong lst\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif
@@ -4654,8 +4638,8 @@ Void rgSCHDhmHqPDelFrmInUseLst(RgSchDlHqProcCb *hqP)
    if (hqP->hqE->inUse.count > 8)
    {
       int *p = NULL;
-      printf("Crashing invalid hq count\n");
-      printf("Crashing %d \n", *p);
+      printf("\nDEBUG  -->  SCH: Crashing invalid hq count\n");
+      printf("\nDEBUG  -->  SCH: Crashing %d \n", *p);
       *p = 10;
    }
 #endif