Replaced old SSI function with new macros jira id - ODUHIGH-212
[o-du/l2.git] / src / 5gnrmac / rg_rom.c
index c517ce7..48e31f2 100755 (executable)
@@ -37,19 +37,7 @@ static int RLOG_FILE_ID=184;
 static int RLOG_MODULE_ID=4096;
 
 /* 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 "crg.h"           /* CRG Interface defines */
 #include "rgu.h"           /* RGU Interface defines */
@@ -61,15 +49,6 @@ static int RLOG_MODULE_ID=4096;
 #include "rg_err.h"        /* MAC error defines */
 
 /* 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 "crg.x"           /* CRG Interface includes */
 #include "rgu.x"           /* RGU Interface includes */
@@ -176,7 +155,7 @@ RgRguDedDatReq *datReq;
          /* Update stats */
          rgUpdtRguDedSts(inst,cell->rguDlSap,RG_RGU_SDU_DROP, datReq);
       }
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 /* Add loop here to scan for all UEs in the consolidated DDatReq*/
@@ -211,7 +190,7 @@ RgRguDedDatReq *datReq;
          RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[idx]);
 #endif
          continue;
-        // RETVALUE(RFAILED);
+        // return RFAILED;
       }
 
       if ((ue = rgDBMGetUeCb(cell, datReq->datReq[idx].rnti)) == NULLP)
@@ -237,7 +216,7 @@ RgRguDedDatReq *datReq;
                RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[idx]);
 #endif
                /* Return from here as above functions found more datReq than expected*/
-              /* RETVALUE(ret); */
+              /* return (ret); */
             }
 #endif
             /* Conitnue for next UE */
@@ -270,7 +249,7 @@ RgRguDedDatReq *datReq;
             RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[idx]);
 #endif
             /* Return from here as above functions found more datReq than expected*/
-            //RETVALUE(ret);
+            //return (ret);
          }
 #endif
          continue;
@@ -323,14 +302,14 @@ RgRguDedDatReq *datReq;
          RG_DROP_RGUDDATREQ_MBUF(datReq->datReq[idx]);
 #endif
          /* Return from here as above functions found more datReq than expected*/
-        // RETVALUE(ret);
+        // return (ret);
       }
 #endif
    } /* for loop for num of Ue per TTI*/
 
 #endif
    /* Data send successfully to PHY. lets retuns ROK*/
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgROMDedDatReq */
 
 
@@ -390,7 +369,7 @@ RgRguCmnDatReq *datReq;
       {
          rgUpdtRguCmnSts(inst,cell->rguDlSap,RG_RGU_SDU_DROP);
       }
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (datReq->lcId == cell->dlCcchId)
@@ -436,7 +415,7 @@ RgRguCmnDatReq *datReq;
    /*Added check for RFAILED as above function can return RFAILED*/
 #endif
 
-   RETVALUE(ret);
+   return (ret);
 }  /* rgROMCmnDatReq */
 
 /**
@@ -496,7 +475,7 @@ RgErrInfo      *err;
                               "rgROMHndlCcchDatReq(): Invalid ue Id");
    #endif
          err->errCause = RGERR_ROM_INV_UE_ID;
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
    }
 
@@ -515,7 +494,7 @@ RgErrInfo      *err;
                               LRG_CAUSE_DELAYED_DATREQ, &dgn);
 #endif
       err->errCause = RGERR_ROM_DELAYED_DATREQ;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    hqPId = (U8)(datReq->transId);
@@ -534,10 +513,10 @@ RgErrInfo      *err;
       /* Release First TB */
       rgDHMRlsHqProcTB(cell, hqProc, 1);
       /* err shall be filled in appropriately by DHM */
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
  
-   RETVALUE(ROK)
+   return ROK
 } /* rgROMHndlCcchDatReq */
 
 
@@ -603,7 +582,7 @@ RgErrInfo      *err;
                               LRG_CAUSE_DELAYED_DATREQ, &dgn);
 #endif
       err->errCause = RGERR_ROM_DELAYED_DATREQ;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 #ifndef RGR_SI_SCH
@@ -616,7 +595,7 @@ RgErrInfo      *err;
       SCpyMsgMsg(datReq->pdu, RG_GET_MEM_REGION(rgCb[inst]),
                RG_GET_MEM_POOL(rgCb[inst]), &bcch->tb);
 
-      RETVALUE(ROK);
+      return ROK;
    }
 
    bch = rgDBMGetBcchOnBch(cell);
@@ -624,7 +603,7 @@ RgErrInfo      *err;
    {
       /* Store BCH data received in Scheduled slot */
       sf->bch.tb = datReq->pdu;
-      RETVALUE(ROK);
+      return ROK;
    }
 #endif/*RGR_SI_SCH*/
 
@@ -633,7 +612,7 @@ RgErrInfo      *err;
    {
       /* Store PCCH-DLSCH data received in Scheduled slot */
       sf->pcch.tb = datReq->pdu;
-      RETVALUE(ROK);
+      return ROK;
    }
 
    /* Handle lcCb fetch failure */
@@ -641,7 +620,7 @@ RgErrInfo      *err;
                   "rgROMHndlBcchPcchDatReq(): Invalid Lc Id");
    err->errCause = RGERR_ROM_INV_LC_ID;
 
-   RETVALUE(RFAILED);
+   return RFAILED;
 } /* rgROMHndlBcchPcchDatReq */
 
 /**
@@ -686,25 +665,27 @@ RgRguDedStaRsp *staRsp;
    if(((cell = rgCb[inst].cell) != NULLP)
       && (cell->cellId == staRsp->cellId))
    {
-            //RgInfDedBoRpt boRpt;
             Pst        schPst;
-            /*boRpt.cellSapId  = cell->schInstMap.cellSapId;
-            boRpt.cellId  = staRsp->cellId;
-            boRpt.rnti    = staRsp->rnti; 
-            boRpt.lcId    = staRsp->lcId; 
-            boRpt.bo      = staRsp->boReport.bo;
-            boRpt.oldestSduArrTime = staRsp->boReport.oldestSduArrTime;
-            boRpt.staPduBo = staRsp->boReport.staPduBo;
-            boRpt.oldestSduArrTime = staRsp->boReport.oldestSduArrTime;*/
-            rgGetPstToInst(&schPst,inst, cell->schInstMap.schInst);
+#ifdef UNUSED_VAR
+    RgInfDedBoRpt boRpt
+        boRpt.cellSapId  = cell->schInstMap.cellSapId;
+    boRpt.cellId  = staRsp->cellId;
+        boRpt.rnti    = staRsp->rnti; 
+    boRpt.lcId    = staRsp->lcId; 
+        boRpt.bo      = staRsp->boReport.bo;
+    boRpt.oldestSduArrTime = staRsp->boReport.oldestSduArrTime;
+    boRpt.staPduBo = staRsp->boReport.staPduBo;
+    boRpt.oldestSduArrTime = staRsp->boReport.oldestSduArrTime;
+#endif
+                               rgGetPstToInst(&schPst,inst, cell->schInstMap.schInst);
             schPst.event = 0;
             //TODO: commented for compilation without SCH RgMacSchDedBoUpdt(&schPst, &boRpt);
-            RETVALUE(ROK);
+            return ROK;
    }
    RLOG_ARG2(L_ERROR,DBG_CELLID,staRsp->cellId,"Invalid cell for CRNTI:%d LCID:%d ",
              staRsp->rnti,staRsp->lcId);
 
-   RETVALUE(RFAILED);
+   return RFAILED;
 }  /* rgROMDedStaRsp */
 
 S16 RgMacSchBrdcmDedBoUpdtReq(
@@ -715,23 +696,26 @@ CmLteLcId lcId,
 S32 bo 
 )
 {
-  //RgInfDedBoRpt  boRpt;
+
   RgCellCb   *cell;
   //if ((cell = rgDBMGetCellCb(cellId)) != NULLP)
   if (((cell = rgCb[inst].cell) != NULLP) &&
         (cell->cellId == cellId))
 {
+ {
      Pst        schPst;
-    /* boRpt.cellSapId  = cell->schInstMap.cellSapId;
-     boRpt.cellId     = cellId;
-     boRpt.rnti       = rnti; 
-     boRpt.lcId       = lcId; 
-     boRpt.bo         = bo;*/
+#ifdef UNUSED_VAR
+    RgInfDedBoRpt  boRpt;
+    boRpt.cellSapId  = cell->schInstMap.cellSapId;
+    boRpt.cellId     = cellId;
+    boRpt.rnti       = rnti; 
+    boRpt.lcId       = lcId; 
+    boRpt.bo         = bo;
+#endif
      rgGetPstToInst(&schPst,inst, cell->schInstMap.schInst);
      schPst.event = 0;
      //TODO: commented for compilation without SCH RgMacSchDedBoUpdtReq (&schPst,&boRpt);
   }
-  RETVALUE(ROK);
+  return ROK;
 }
 /**
  * @brief Handler for StaRsp received on RGU for a common logical channel.
@@ -777,7 +761,7 @@ RgRguCmnStaRsp *staRsp;
                 "Invalid cell for CRNTI:%d LCID:%d",staRsp->u.rnti,staRsp->lcId);
       err.errType = RGERR_ROM_CMNSTARSP;
       err.errCause = RGERR_ROM_INV_CELL_ID;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /* handle status response on CCCH */
@@ -790,7 +774,7 @@ RgRguCmnStaRsp *staRsp;
       rgROMHndlBcchPcchStaRsp(cell, staRsp, &err); 
    }
    
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgROMCmnStaRsp */
 
 #ifdef LTE_L2_MEAS
@@ -851,12 +835,12 @@ RgRguL2MUlThrpMeasReq *measReq;
                }
             }
          }
-         RETVALUE(ROK);
+         return ROK;
       }
    }
    RLOG_ARG1(L_ERROR,DBG_CELLID,measReq->cellId,"Invalid cell CRNTI:%d",
              measReq->rnti);
-   RETVALUE(RFAILED);
+   return RFAILED;
 }  /* rgROML2MUlThrpMeasReq */
 
 #endif
@@ -898,19 +882,19 @@ RgErrInfo      *err;
    //RgInfCmnBoRpt boRpt;
 
    TRC2(rgROMHndlCcchStaRsp);
-
-/*
+#ifdef UNUSED_VAR
+   RgInfCmnBoRpt boRpt;
    boRpt.cellSapId  = cell->schInstMap.cellSapId;
    boRpt.cellId  = staRsp->cellId;
    boRpt.u.rnti    = staRsp->u.rnti; 
    boRpt.lcId    = staRsp->lcId; 
    boRpt.lcType  = staRsp->lcType; 
    boRpt.bo      = staRsp->bo;
-  */
+#endif
    rgGetPstToInst(&schPst,macInst, cell->schInstMap.schInst);
    //TODO: commented for compilation without SCH RgMacSchCmnBoUpdt(&schPst, &boRpt);
 
-   RETVALUE(ROK);
+   return ROK;
 } /* rgROMHndlCcchStaRsp */
 
 
@@ -957,7 +941,7 @@ RgErrInfo      *err;
       /* Handle lcCb fetch failure */
       RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"Invalid LCID:%d",staRsp->lcId);
       err->errCause = RGERR_ROM_INV_LC_ID;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    /* MS_WORKAROUND : This is to ensure that the queue for BCH is not filled with old BO requests :
          This assumes that BO is not received more than 4 frames in advance from the enodeb application */
@@ -969,7 +953,7 @@ RgErrInfo      *err;
       if ((staRsp->u.timeToTx.sfn != nextBchSfn) ||
          ((staRsp->u.timeToTx.sfn == cell->crntTime.sfn) && (cell->crntTime.slot >= 7)))
       {
-        RETVALUE(ROK);
+        return ROK;
       }
    }
 /*
@@ -992,7 +976,7 @@ RgErrInfo      *err;
    rgGetPstToInst(&schPst,macInst, cell->schInstMap.schInst);
    //TODO: commented for compilation without SCH RgMacSchCmnBoUpdt(&schPst, &boRpt);
 
-   RETVALUE(ROK);
+   return ROK;
 } /* rgROMHndlBcchPcchStaRsp */
 
 /* ADD Changes for Downlink UE Timing Optimization */
@@ -1036,7 +1020,7 @@ RgDlSf         *dlSf;
         * request than the allocation. Do nothing for this. */
       RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,
             "RX new data while remDatReqCnt is 0 for cell");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /*Decrement the remaining data request to be received countter
@@ -1062,7 +1046,7 @@ RgDlSf         *dlSf;
       dlSf->txDone = TRUE;
    }
 
-   RETVALUE(ROK);
+   return ROK;
 } /* rgROMUpdDlSfRemDataCnt*/
 #endif