U8, U16, U32 data type changes
[o-du/l2.git] / src / 5gnrmac / rg_rom.c
index 30c0efa..f8e1f4c 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 */
@@ -78,6 +57,7 @@ static int RLOG_MODULE_ID=4096;
 #include "rg_prg.x"        /* PRG Interface includes */
 #include "lrg.x"           /* LRG Interface includes */
 
+#include "du_app_mac_inf.h"
 #include "rg.x"            /* MAC includes */
 
 /* local defines */
@@ -99,7 +79,7 @@ PRIVATE S16 rgROMHndlBcchPcchStaRsp ARGS((RgCellCb *cell,
 #ifdef LTEMAC_DLUE_TMGOPTMZ
 PRIVATE S16 rgROMUpdDlSfRemDataCnt ARGS((RgCellCb  *cellCb,
                                     RgDlSf    *dlSf));
-PUBLIC S16 rgTOMUtlProcDlSf ARGS(( RgDlSf     *dlSf,
+S16 rgTOMUtlProcDlSf ARGS(( RgDlSf     *dlSf,
                                    RgCellCb   *cellCb,
                                    RgErrInfo  *err));
 #endif
@@ -125,22 +105,23 @@ PUBLIC S16 rgTOMUtlProcDlSf ARGS(( RgDlSf     *dlSf,
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgROMDedDatReq
+S16 rgROMDedDatReq
 (
 Inst      inst,
 RgRguDedDatReq *datReq
 )
 #else
-PUBLIC S16 rgROMDedDatReq(inst,datReq)
+S16 rgROMDedDatReq(inst,datReq)
 Inst      inst;
 RgRguDedDatReq *datReq;
 #endif
 {
+#if 0
    RgCellCb     *cell;
    RgUeCb       *ue;
-   U8           idx1,idx2;
+   uint8_t           idx1,idx2;
    RgDlHqProcCb *hqProc;
-   U8           hqPId;
+   uint8_t           hqPId;
    RgErrInfo    err;
    Pst          schPst;
    RgInfDedBoRpt boRpt;
@@ -153,10 +134,8 @@ RgRguDedDatReq *datReq;
 #ifdef LTEMAC_DLUE_TMGOPTMZ
    S16 ret;
 #endif
-   U32 idx;
-   //U8  datReqFailCnt = 0;
-
-   TRC2(rgROMDedDatReq)
+   uint32_t idx;
+   //uint8_t  datReqFailCnt = 0;
 
 
    if (((cell = rgCb[inst].cell) == NULLP) 
@@ -174,22 +153,22 @@ 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*/
    for(idx = 0; idx < datReq->nmbOfUeGrantPerTti; idx++)
    {
 
-      timingInfo.subframe = (U8)((datReq->datReq[idx].transId >> 8) & 0XFF);
-      timingInfo.sfn = (U16)((datReq->datReq[idx].transId >> 16) & 0xFFFF);
-      sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+      timingInfo.slot = (uint8_t)((datReq->datReq[idx].transId >> 8) & 0XFF);
+      timingInfo.sfn = (uint16_t)((datReq->datReq[idx].transId >> 16) & 0xFFFF);
+      sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
 
       if( (sf->txDone == TRUE) ||
             (!RG_TIMEINFO_SAME(sf->schdTime,timingInfo)))
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-         /* Transmission is already done for this subframe. This is a delayed
+         /* Transmission is already done for this slot. This is a delayed
           * datReq. So discard */
          rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM);
          rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
@@ -201,7 +180,7 @@ RgRguDedDatReq *datReq;
          rgUpdtRguDedSts(inst,cell->rguDlSap,RG_RGU_SDU_DROP, datReq);
 #ifdef CA_DBG
          {
-            EXTERN U32 dbgDelayedDatReqInMac;
+            EXTERN uint32_t dbgDelayedDatReqInMac;
             dbgDelayedDatReqInMac++;
          }
 #endif /* CA_DBG */         
@@ -209,7 +188,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)
@@ -235,14 +214,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
             /* Conitnue for next UE */
             continue;
       }
 
-      hqPId = (U8)(datReq->datReq[idx].transId);
+      hqPId = (uint8_t)(datReq->datReq[idx].transId);
       hqPId = hqPId >> 2;
       /* get harq process and invoke DHM */
       rgDHMGetHqProcFrmId(ue, hqPId, &hqProc);
@@ -268,7 +247,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;
@@ -321,13 +300,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 */
 
 
@@ -349,13 +329,13 @@ RgRguDedDatReq *datReq;
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgROMCmnDatReq
+S16 rgROMCmnDatReq
 (
 Inst            inst,
 RgRguCmnDatReq *datReq
 )
 #else
-PUBLIC S16 rgROMCmnDatReq(inst,datReq)
+S16 rgROMCmnDatReq(inst,datReq)
 Inst            inst;
 RgRguCmnDatReq *datReq;
 #endif
@@ -369,8 +349,6 @@ RgRguCmnDatReq *datReq;
    RgDlSf   *sf;
 #endif
 
-   TRC2(rgROMCmnDatReq)
-
    ret = ROK;
    err.errType = RGERR_ROM_CMNDATREQ;
    if(((cell = rgCb[inst].cell) == NULLP)
@@ -387,7 +365,7 @@ RgRguCmnDatReq *datReq;
       {
          rgUpdtRguCmnSts(inst,cell->rguDlSap,RG_RGU_SDU_DROP);
       }
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (datReq->lcId == cell->dlCcchId)
@@ -397,8 +375,8 @@ RgRguCmnDatReq *datReq;
       /*Get the timing Info*/
       /* ADD Changes for Downlink UE Timing Optimization */
 #ifdef LTEMAC_DLUE_TMGOPTMZ
-      timingInfo.subframe = (U8)((datReq->transId >> 8) & 0XFF);
-      timingInfo.sfn = (U16)((datReq->transId >> 16) & 0xFFFF);
+      timingInfo.slot = (uint8_t)((datReq->transId >> 8) & 0XFF);
+      timingInfo.sfn = (uint16_t)((datReq->transId >> 16) & 0xFFFF);
 #endif
    } 
    else
@@ -408,8 +386,8 @@ RgRguCmnDatReq *datReq;
       /*Get the timing Info*/
       /* ADD Changes for Downlink UE Timing Optimization */
 #ifdef LTEMAC_DLUE_TMGOPTMZ
-      timingInfo.subframe = (U8)(datReq->transId & 0XFF);
-      timingInfo.sfn = (U16)((datReq->transId >> 8) & 0xFFFF);
+      timingInfo.slot = (uint8_t)(datReq->transId & 0XFF);
+      timingInfo.sfn = (uint16_t)((datReq->transId >> 8) & 0xFFFF);
 #endif
    }
 
@@ -426,14 +404,14 @@ RgRguCmnDatReq *datReq;
 
    /* ADD Changes for Downlink UE Timing Optimization */
 #ifdef LTEMAC_DLUE_TMGOPTMZ
-   RG_ARRAY_BOUND_CHECK(0, cell->subFrms, (timingInfo.subframe % RG_NUM_SUB_FRAMES));
-   sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+   RG_ARRAY_BOUND_CHECK(0, cell->subFrms, (timingInfo.slot % RG_NUM_SUB_FRAMES));
+   sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
 
    ret = rgROMUpdDlSfRemDataCnt(cell, sf);
    /*Added check for RFAILED as above function can return RFAILED*/
 #endif
 
-   RETVALUE(ret);
+   return (ret);
 }  /* rgROMCmnDatReq */
 
 /**
@@ -470,7 +448,7 @@ RgErrInfo      *err;
 {
    Inst     inst = cell->macInst - RG_INST_START;
    RgUeCb   *ue;
-   U8       hqPId;
+   uint8_t   hqPId;
    RgDlHqProcCb *hqProc;
    CmLteTimingInfo timingInfo;
    RgDlSf   *sf;
@@ -478,9 +456,6 @@ RgErrInfo      *err;
    RgUstaDgn   dgn;      /* Alarm diagnostics structure */
 #endif
 
-   TRC2(rgROMHndlCcchDatReq);
-
-
    err->errType = RGERR_ROM_CMNDATREQ;
 
    if ((ue = rgDBMGetUeCb(cell, datReq->u.rnti)) == NULLP)
@@ -493,29 +468,29 @@ RgErrInfo      *err;
                               "rgROMHndlCcchDatReq(): Invalid ue Id");
    #endif
          err->errCause = RGERR_ROM_INV_UE_ID;
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
    }
 
-   timingInfo.subframe = (U8)((datReq->transId >> 8) & 0XFF);
-   timingInfo.sfn = (U16)((datReq->transId >> 16) & 0xFFFF);
-   sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+   timingInfo.slot = (uint8_t)((datReq->transId >> 8) & 0XFF);
+   timingInfo.sfn = (uint16_t)((datReq->transId >> 16) & 0xFFFF);
+   sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
 
    if( (sf->txDone == TRUE) ||
        (!RG_TIMEINFO_SAME(sf->schdTime,timingInfo)))
    {
 #if (ERRCLASS & ERRCLS_DEBUG)
-      /* Transmission is already done for this subframe. This is a delayed
+      /* Transmission is already done for this slot. This is a delayed
        * datReq. So discard */
       rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM);
       rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
                               LRG_CAUSE_DELAYED_DATREQ, &dgn);
 #endif
       err->errCause = RGERR_ROM_DELAYED_DATREQ;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   hqPId = (U8)(datReq->transId);
+   hqPId = (uint8_t)(datReq->transId);
    hqPId = hqPId >> 2;
 
    /* get harq process and invoke DHM */
@@ -531,10 +506,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 */
 
 
@@ -582,55 +557,53 @@ RgErrInfo      *err;
    RgUstaDgn   dgn;      /* Alarm diagnostics structure */
 #endif
 
-   TRC2(rgROMHndlBcchPcchDatReq);
-
 
-   timingInfo.subframe = (U8)(datReq->transId & 0XFF);
-   timingInfo.sfn = (U16)((datReq->transId >> 8) & 0xFFFF);
-   sf = &cell->subFrms[(timingInfo.subframe % RG_NUM_SUB_FRAMES)];
+   timingInfo.slot = (uint8_t)(datReq->transId & 0XFF);
+   timingInfo.sfn = (uint16_t)((datReq->transId >> 8) & 0xFFFF);
+   sf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
 
    if( (sf->txDone == TRUE) ||
        (!RG_TIMEINFO_SAME(sf->schdTime,timingInfo)))
    {
 #if (ERRCLASS & ERRCLS_DEBUG)
-      /* Transmission is already done for this subframe. This is a delayed
+      /* Transmission is already done for this slot. This is a delayed
        * datReq. So discard */
       rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_MEM);
       rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
                               LRG_CAUSE_DELAYED_DATREQ, &dgn);
 #endif
       err->errCause = RGERR_ROM_DELAYED_DATREQ;
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 #ifndef RGR_SI_SCH
    bcch = rgDBMGetBcchOnDlsch(cell,datReq->lcId);
    if (bcch )
    {
-      /* Store BCCH-DLSCH data received in Scheduled subframe */
+      /* Store BCCH-DLSCH data received in Scheduled slot */
       sf->bcch.tb = datReq->pdu;
 
       SCpyMsgMsg(datReq->pdu, RG_GET_MEM_REGION(rgCb[inst]),
                RG_GET_MEM_POOL(rgCb[inst]), &bcch->tb);
 
-      RETVALUE(ROK);
+      return ROK;
    }
 
    bch = rgDBMGetBcchOnBch(cell);
    if ((bch) && (bch->lcId == datReq->lcId))
    {
-      /* Store BCH data received in Scheduled subframe */
+      /* Store BCH data received in Scheduled slot */
       sf->bch.tb = datReq->pdu;
-      RETVALUE(ROK);
+      return ROK;
    }
 #endif/*RGR_SI_SCH*/
 
    pcch = rgDBMGetPcch(cell);
    if ((pcch) && (pcch->lcId == datReq->lcId))
    {
-      /* Store PCCH-DLSCH data received in Scheduled subframe */
+      /* Store PCCH-DLSCH data received in Scheduled slot */
       sf->pcch.tb = datReq->pdu;
-      RETVALUE(ROK);
+      return ROK;
    }
 
    /* Handle lcCb fetch failure */
@@ -638,7 +611,7 @@ RgErrInfo      *err;
                   "rgROMHndlBcchPcchDatReq(): Invalid Lc Id");
    err->errCause = RGERR_ROM_INV_LC_ID;
 
-   RETVALUE(RFAILED);
+   return RFAILED;
 } /* rgROMHndlBcchPcchDatReq */
 
 /**
@@ -659,13 +632,13 @@ RgErrInfo      *err;
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgROMDedStaRsp
+S16 rgROMDedStaRsp
 (
 Inst           inst,
 RgRguDedStaRsp *staRsp
 )
 #else
-PUBLIC S16 rgROMDedStaRsp(inst,staRsp)
+S16 rgROMDedStaRsp(inst,staRsp)
 Inst           inst;
 RgRguDedStaRsp *staRsp;
 #endif
@@ -674,8 +647,6 @@ RgRguDedStaRsp *staRsp;
 
    /* Moving the error variables and assignments to available scope */
 
-   TRC2(rgROMDedStaRsp)
-
    /* Avoiding memset, as the variables of this are getting 
       initialized */
 
@@ -683,25 +654,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;
-            RgMacSchDedBoUpdt(&schPst, &boRpt);
-            RETVALUE(ROK);
+            //TODO: commented for compilation without SCH RgMacSchDedBoUpdt(&schPst, &boRpt);
+            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(
@@ -712,23 +685,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;
-     RgMacSchDedBoUpdtReq (&schPst,&boRpt);
+     //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.
@@ -749,13 +725,13 @@ S32 bo
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgROMCmnStaRsp
+S16 rgROMCmnStaRsp
 (
 Inst            inst, 
 RgRguCmnStaRsp *staRsp
 )
 #else
-PUBLIC S16 rgROMCmnStaRsp(inst,staRsp)
+S16 rgROMCmnStaRsp(inst,staRsp)
 Inst            inst;
 RgRguCmnStaRsp *staRsp;
 #endif
@@ -763,9 +739,6 @@ RgRguCmnStaRsp *staRsp;
    RgCellCb   *cell;
    RgErrInfo  err;
 
-   TRC2(rgROMCmnStaRsp)
-
-
    if(((cell = rgCb[inst].cell) == NULLP)
       || (cell->cellId != staRsp->cellId))
    {
@@ -774,7 +747,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 */
@@ -787,7 +760,7 @@ RgRguCmnStaRsp *staRsp;
       rgROMHndlBcchPcchStaRsp(cell, staRsp, &err); 
    }
    
-   RETVALUE(ROK);
+   return ROK;
 }  /* rgROMCmnStaRsp */
 
 #ifdef LTE_L2_MEAS
@@ -811,24 +784,21 @@ RgRguCmnStaRsp *staRsp;
  *      -# RFAILED 
  **/
 #ifdef ANSI
-PUBLIC S16 rgROML2MUlThrpMeasReq 
+S16 rgROML2MUlThrpMeasReq 
 (
 Inst                  inst,
 RgRguL2MUlThrpMeasReq *measReq
 )
 #else
-PUBLIC S16 rgROML2MUlThrpMeasReq(inst,measReq)
+S16 rgROML2MUlThrpMeasReq(inst,measReq)
 Inst                  inst;
 RgRguL2MUlThrpMeasReq *measReq;
 #endif
 {
    RgCellCb   *cell;
    RgUeCb     *ue;
-   U8         lcgId;
-   U8         loop;
-   TRC2(rgROML2MUlThrpMeasReq)
-
-
+   uint8_t    lcgId;
+   uint8_t    loop;
 
    if(((cell = rgCb[inst].cell) != NULLP)
       &&(cell->cellId == measReq->cellId))
@@ -848,12 +818,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
@@ -892,21 +862,21 @@ RgErrInfo      *err;
 {
    Pst      schPst;
    Inst     macInst = cell->macInst - RG_INST_START;
-   RgInfCmnBoRpt boRpt;
-
-   TRC2(rgROMHndlCcchStaRsp);
-
+   //RgInfCmnBoRpt boRpt;
 
+#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);
-   RgMacSchCmnBoUpdt(&schPst, &boRpt);
+   //TODO: commented for compilation without SCH RgMacSchCmnBoUpdt(&schPst, &boRpt);
 
-   RETVALUE(ROK);
+   return ROK;
 } /* rgROMHndlCcchStaRsp */
 
 
@@ -942,39 +912,38 @@ RgErrInfo      *err;
 #endif
 {
    Pst      schPst;
-   RgInfCmnBoRpt boRpt;
+   //RgInfCmnBoRpt boRpt;
    Inst     macInst = cell->macInst - RG_INST_START;
 
-   TRC2(rgROMHndlBcchPcchStaRsp);
-   cmMemset((U8*)&schPst, (U8)0, sizeof(Pst));
+   memset(&schPst, 0, sizeof(Pst));
 
    if (rgDBMChkCmnLcCb(cell, staRsp->lcId) != ROK)
    {
       /* 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 */
    if (cell->bcchBchInfo.lcId == staRsp->lcId)
    {
-      U16 nextBchSfn;
+      uint16_t nextBchSfn;
 
       nextBchSfn = (cell->crntTime.sfn + 4 - (cell->crntTime.sfn%4)) % RG_MAX_SFN;
       if ((staRsp->u.timeToTx.sfn != nextBchSfn) ||
-         ((staRsp->u.timeToTx.sfn == cell->crntTime.sfn) && (cell->crntTime.subframe >= 7)))
+         ((staRsp->u.timeToTx.sfn == cell->crntTime.sfn) && (cell->crntTime.slot >= 7)))
       {
-        RETVALUE(ROK);
+        return ROK;
       }
    }
-
+/*
    boRpt.cellSapId     = cell->schInstMap.cellSapId;
    boRpt.cellId     = staRsp->cellId;
    boRpt.u.timeToTx = staRsp->u.timeToTx; 
    boRpt.lcId       = staRsp->lcId; 
    boRpt.lcType     = staRsp->lcType; 
-   boRpt.bo         = staRsp->bo;
+   boRpt.bo         = staRsp->bo;*/    
 #ifdef EMTC_ENABLE
   if(cell->emtcEnable)
   {
@@ -986,9 +955,9 @@ RgErrInfo      *err;
   }
 #endif
    rgGetPstToInst(&schPst,macInst, cell->schInstMap.schInst);
-   RgMacSchCmnBoUpdt(&schPst, &boRpt);
+   //TODO: commented for compilation without SCH RgMacSchCmnBoUpdt(&schPst, &boRpt);
 
-   RETVALUE(ROK);
+   return ROK;
 } /* rgROMHndlBcchPcchStaRsp */
 
 /* ADD Changes for Downlink UE Timing Optimization */
@@ -1023,16 +992,13 @@ RgDlSf         *dlSf;
    RgErrInfo            err;
    //Inst                 inst = cellCb->macInst - RG_INST_START;
 
-   TRC2(rgROMUpdDlSfRemDataCnt);
-
-
    if(!dlSf->remDatReqCnt)
    {
        /*This is an error scenario of RLC generating more data          
         * 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
@@ -1050,7 +1016,7 @@ RgDlSf         *dlSf;
       if (ROK != rgTOMUtlProcDlSf (dlSf, cellCb, &err))
       {
          RLOG_ARG0(L_ERROR,DBG_CELLID,cellCb->cellId,
-               "Unable to process downlink subframe for cell");
+               "Unable to process downlink slot for cell");
          err.errType = RGERR_ROM_DEDDATREQ;
       }
 
@@ -1058,7 +1024,7 @@ RgDlSf         *dlSf;
       dlSf->txDone = TRUE;
    }
 
-   RETVALUE(ROK);
+   return ROK;
 } /* rgROMUpdDlSfRemDataCnt*/
 #endif