Part -5 Separation of log [JIRA-ID ODUHIGH-275] 90/5490/4
authorsphoorthi <sphoorthi.dayanand@radisys.com>
Fri, 22 Jan 2021 07:19:51 +0000 (12:49 +0530)
committersphoorthi <sphoorthi.dayanand@radisys.com>
Wed, 3 Feb 2021 11:08:30 +0000 (16:38 +0530)
Change-Id: I71c5bb7b3154deaf130f44474831b3de230dd08f
Signed-off-by: sphoorthi <sphoorthi.dayanand@radisys.com>
src/5gnrmac/rg_cfg.c
src/5gnrmac/rg_com.c
src/5gnrmac/rg_dhm.c
src/5gnrmac/rg_dux.c
src/5gnrmac/rg_l2m.c

index c389d65..31c2ad4 100755 (executable)
@@ -32,9 +32,6 @@
 @brief This module handles the configuration of MAC by RRC and RRM.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_FILE_ID=180;
-static int RLOG_MODULE_ID=4096;
 
 /* header include files -- defines (.h) */
 #include "common_def.h"
@@ -123,7 +120,7 @@ RgErrInfo   *errInfo
    if ((rgCb[inst].cell != NULLP)
          || rgCb[inst].inactiveCell != NULLP)
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Cell already exists");
+      DU_LOG("\nERROR  -->  MAC : Cell already exists");
       return RFAILED;
    }
    if ((cellCfg->bwCfg.dlTotalBw < RG_MIN_DL_BW
@@ -131,25 +128,23 @@ RgErrInfo   *errInfo
          || (cellCfg->bwCfg.ulTotalBw < RG_MIN_UL_BW
             || cellCfg->bwCfg.ulTotalBw > RG_MAX_UL_BW))
    {
-      RLOG_ARG2(L_ERROR,DBG_CELLID,cellCfg->cellId, 
-            "Invalid Bandwidth configuration: ul %d dl %d",
+      DU_LOG("\nERROR  -->  MAC : Invalid Bandwidth configuration: ul %d dl %d",
             cellCfg->bwCfg.ulTotalBw, cellCfg->bwCfg.dlTotalBw);
       return RFAILED;
    }
    if (cellCfg->rachCfg.maxMsg3Tx < RG_MIN_HQ_TX)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,cellCfg->cellId,
-                "Invalid RACH configuration: maxMsg3Tx %d",cellCfg->rachCfg.maxMsg3Tx);
+      DU_LOG("\nERROR  -->  MAC : Invalid RACH configuration: maxMsg3Tx %d",cellCfg->rachCfg.maxMsg3Tx);
       return RFAILED;
    }
 #ifdef TENB_MULT_CELL_SUPPRT
    if((cellCfg->rguDlSapId > rgCb[inst].numRguSaps) ||
       (cellCfg->rguUlSapId > rgCb[inst].numRguSaps))
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), "Invald Sap Id: DL %d UL %d for CellId %d failed\n",
+      DU_LOG("\nERROR  -->  MAC : Invald Sap Id: DL %d UL %d for CellId %d failed\n",
                cellCfg->rguDlSapId,
                cellCfg->rguUlSapId,
-               cellCfg->cellId));
+               cellCfg->cellId);
       return RFAILED;
    }
 #endif
@@ -193,7 +188,7 @@ RgErrInfo *errInfo
    if ((ueCfg->txMode.pres == PRSNT_NODEF) && 
        (ueCfg->txMode.tm == CRG_UE_TM_5))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"Transmission Mode=%d not supported",
+      DU_LOG("\nERROR  -->  MAC : Transmission Mode=%d not supported",
             ueCfg->txMode.tm);
       return RFAILED;
    }
@@ -202,20 +197,20 @@ RgErrInfo *errInfo
    if(((*cell = rgCb[inst].cell) == NULLP) ||
        ((*cell)->cellId != ueCfg->cellId))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti,"Active Cell does not exist for cellId%d",
+      DU_LOG("\nERROR  -->  MAC : Active Cell does not exist for cellId%d",
             ueCfg->cellId);
       return RFAILED;
    }
-   /* Check if Ue already configured */
+   /* Check if UE already configured */
    if (rgDBMGetUeCb(*cell, ueCfg->crnti) != NULLP)
    {
-      RLOG_ARG0(L_ERROR,DBG_CRNTI,ueCfg->crnti,"Ue already exists");
+      DU_LOG("\nERROR  -->  MAC : UE already exists");
       return RFAILED;
    }
 
    if (ueCfg->ueUlHqCfg.maxUlHqTx < RG_MIN_HQ_TX)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueCfg->crnti, "Invalid Uplink HARQ config %d ",
+      DU_LOG("\nERROR  -->  MAC : Invalid Uplink HARQ config %d ",
             ueCfg->ueUlHqCfg.maxUlHqTx);
       return RFAILED;
    }
@@ -223,10 +218,10 @@ RgErrInfo *errInfo
    if((ueCfg->rguDlSapId > rgCb[inst].numRguSaps) ||
       (ueCfg->rguUlSapId > rgCb[inst].numRguSaps))
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), "Invald Sap Id: DL %d UL %d for ueId %d failed\n",
+      DU_LOG("\nERROR  -->  MAC : Invald Sap Id: DL %d UL %d for ueId %d failed\n",
                ueCfg->rguDlSapId,
                ueCfg->rguUlSapId,
-               ueCfg->crnti));
+               ueCfg->crnti);
       return RFAILED;
    }
 #endif
@@ -276,7 +271,7 @@ RgErrInfo  *errInfo
       /* Dedicated logical channels */
       if ((rgCFGVldtCrgDedLcCfg(inst,lcCfg, cell, ue, errInfo)) != ROK)
       {
-         RLOG_ARG0(L_ERROR,DBG_CRNTI,lcCfg->crnti,"Validation for dedicated LC failed");
+         DU_LOG("\nERROR  -->  MAC : Validation for dedicated LC failed");
          return RFAILED;
       }
    }
@@ -286,13 +281,13 @@ RgErrInfo  *errInfo
    {
       if ((rgCFGVldtCrgCmnLcCfg(inst,lcCfg, cell, errInfo)) != ROK)
       {
-         RLOG_ARG0(L_ERROR,DBG_CRNTI,lcCfg->crnti,"Validation for common logical channels failed");
+         DU_LOG("\nERROR  -->  MAC : Validation for common logical channels failed");
          return RFAILED;
       }
    }
    else
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"Invalid logical channel type %d",
+      DU_LOG("\nERROR  -->  MAC : Invalid logical channel type %d",
                 lcCfg->lcType);
       return RFAILED;
    }
@@ -301,7 +296,7 @@ RgErrInfo  *errInfo
         lcCfg->qci >  RG_QCI_MAX
       )
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"Invalid qci %x",lcCfg->qci);
+      DU_LOG("\nERROR  -->  MAC : Invalid qci %x",lcCfg->qci);
       return RFAILED;
    }
    /*validate qci */
@@ -351,19 +346,18 @@ RgErrInfo     *errInfo
    if (((*cell = rgCb[inst].cell) == NULLP)
          && ((*cell = rgCb[inst].inactiveCell) == NULLP))
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cellRecfg->cellId,"Cell does not exist");
+      DU_LOG("\nERROR  -->  MAC : Cell does not exist");
       return RFAILED;
    }
 
    if((*cell)->cellId != cellRecfg->cellId)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId, "Cell does not exist %d\n",cellRecfg->cellId);
+      DU_LOG("\nERROR  -->  MAC : Cell does not exist %d\n",cellRecfg->cellId);
       return RFAILED;
    }
    if (cellRecfg->rachRecfg.maxMsg3Tx < RG_MIN_HQ_TX)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,cellRecfg->cellId,
-                "Invalid RACH configuration: maxMsg3Tx %d",cellRecfg->rachRecfg.maxMsg3Tx);
+      DU_LOG("\nERROR  -->  MAC : Invalid RACH configuration: maxMsg3Tx %d",cellRecfg->rachRecfg.maxMsg3Tx);
       return RFAILED;
    }
    errInfo->errCause = RGERR_NONE;
@@ -412,7 +406,7 @@ RgErrInfo   *errInfo
    if ((ueRecfg->txMode.pres == PRSNT_NODEF) && 
        (ueRecfg->txMode.tm == CRG_UE_TM_5))
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Transmission Mode=%d not supported",
+      DU_LOG("\nERROR  -->  MAC : Transmission Mode=%d not supported",
                 ueRecfg->txMode.tm);
       return RFAILED;
    }
@@ -421,7 +415,7 @@ RgErrInfo   *errInfo
    if (((*cell = rgCb[inst].cell) == NULLP) 
         || ((*cell)->cellId != ueRecfg->cellId))
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,ueRecfg->cellId, "Active Cell does not exist\n");
+      DU_LOG("\nERROR  -->  MAC : Active Cell does not exist\n");
       return RFAILED;
    }
  
@@ -429,12 +423,12 @@ RgErrInfo   *errInfo
     * by SCH. */
    if ((*ue = rgDBMGetUeCb(*cell, ueRecfg->oldCrnti)) == NULLP)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"[%d]Old Ue does not exist", ueRecfg->oldCrnti);
+      DU_LOG("\nERROR  -->  MAC : [%d]Old UE does not exist", ueRecfg->oldCrnti);
       return RFAILED;
    }
    if (ueRecfg->ueUlHqRecfg.maxUlHqTx < RG_MIN_HQ_TX)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,ueRecfg->cellId,"Invalid Uplink HARQ config for UE %d",
+      DU_LOG("\nERROR  -->  MAC : Invalid Uplink HARQ config for UE %d",
             ueRecfg->ueUlHqRecfg.maxUlHqTx);
       return RFAILED;
    }
@@ -489,25 +483,25 @@ RgErrInfo   *errInfo
    if ((((*cell = rgCb[inst].cell)) == NULLP)
       || ((*cell)->cellId != lcRecfg->cellId))
    {
-      RLOG_ARG2(L_ERROR,DBG_CRNTI,lcRecfg->crnti,"Active Cell %u does not exist for UE %u", lcRecfg->cellId, lcRecfg->crnti);
+      DU_LOG("\nERROR  -->  MAC : Active Cell %u does not exist for UE %u", lcRecfg->cellId, lcRecfg->crnti);
       return RFAILED;
    }
    /* Fetch the Ue for dedicated channels */
    if ((*ue = rgDBMGetUeCb(*cell, lcRecfg->crnti)) == NULLP)
    {
-      RLOG_ARG0(L_ERROR,DBG_CRNTI,lcRecfg->crnti,"Ue does not exist for dedicated logical channel");
+      DU_LOG("\nERROR  -->  MAC : UE does not exist for dedicated logical channel");
       return RFAILED;
    }
 
    if ((*ulLc = rgDBMGetUlDedLcCb((*ue), lcRecfg->lcId)) == NULLP)
    {
-      RLOG_ARG1(L_ERROR, DBG_CRNTI,lcRecfg->crnti,"Dedicated UL LC does not exist %d",lcRecfg->lcId);
+      DU_LOG("\nERROR  -->  MAC : Dedicated UL LC does not exist %d",lcRecfg->lcId);
       return RFAILED;
    }
 
    if (lcRecfg->ulRecfg.lcgId > (RG_MAX_LCG_PER_UE - 1))
    {
-      RLOG_ARG2(L_ERROR,DBG_CRNTI,lcRecfg->crnti,"Invalid lcgId for uplink logical channel lcg %d lc %d",
+      DU_LOG("\nERROR  -->  MAC : Invalid lcgId for uplink logical channel lcg %d lc %d",
                 lcRecfg->ulRecfg.lcgId, lcRecfg->lcId);
       return RFAILED;
    }
@@ -556,15 +550,14 @@ RgErrInfo   *errInfo
    if (((*cell = rgCb[inst].cell) == NULLP)
       || ((*cell)->cellId != reset->cellId))
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Active Cell does not exist %d\n",reset->crnti, reset->cellId));
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,reset->crnti,"Active Cell does not exist %d",reset->cellId);
+      DU_LOG("\nERROR  -->  MAC : Active Cell does not exist %d",reset->cellId);
       return RFAILED;
    }
 
    /* Fetch the Ue */
    if ((*ue = rgDBMGetUeCb(*cell, reset->crnti)) == NULLP)
    {
-      RLOG_ARG0(L_ERROR,DBG_CRNTI,reset->crnti,"UE does not exist");
+      DU_LOG("\nERROR  -->  MAC : UE does not exist");
       return RFAILED;
    }
 
@@ -617,12 +610,12 @@ RgErrInfo   *errInfo
    /* Allocate the cell control block */
    if((ret = rgAllocSBuf(inst,(Data**)&cell, sizeof(RgCellCb))) != ROK)
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"Memory allocation FAILED for cell");
+      DU_LOG("\nERROR  -->  MAC : Memory allocation FAILED for cell");
       return RFAILED;
    }
    if (cell == NULLP)
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId, "Memory allocation FAILED for cell");
+      DU_LOG("\nERROR  -->  MAC : Memory allocation FAILED for cell");
       return RFAILED;
    }
 
@@ -645,7 +638,7 @@ RgErrInfo   *errInfo
    ret = rgDBMInitCell(cell);
    if (ret != ROK)
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cellCfg->cellId,"DBM initialization for cell failed");
+      DU_LOG("\nERROR  -->  MAC : DBM initialization for cell failed");
       rgCFGFreeInactvCellCb(cell);
       return RFAILED;
    }
@@ -749,10 +742,9 @@ RgCellCb    *cell
 
    if ((ueCb = rgDBMGetUeCb(cell, ueSCellCb->ueId)) != NULLP)
    {
-      RGDBGERRNEW(dstMacInst,(rgPBuf(dstMacInst), 
-               "[%d]Ue already exist in scell %d during scell addition\n", 
+      DU_LOG("\nERROR  -->  MAC : [%d]UE already exist in scell %d during scell addition\n", 
                ueSCellCb->ueId,
-               cell->cellId));
+               cell->cellId);
       return RFAILED;
    }
 
@@ -760,16 +752,14 @@ RgCellCb    *cell
    if((ueCb = rgRAMCreateUeCb(cell, ueSCellCb->ueId,
                FALSE, &errInfo)) == NULLP)
    {
-      RGDBGERRNEW(dstMacInst, (rgPBuf(dstMacInst),
-               "[%d]UeCb creation failed\n", ueSCellCb->ueId));
+      DU_LOG("\nERROR  -->  MAC : [%d]UeCb creation failed\n", ueSCellCb->ueId);
       return RFAILED;
    }
 
    if(rgDHMHqEntInit(dstMacInst, &ueCb->dl.hqEnt, 
             (rgCb[dstMacInst].cell)->maxDlHqProcPerUe) != ROK)
    {
-      RGDBGERRNEW(dstMacInst,(rgPBuf(dstMacInst), 
-               "[%d]UeCb Harq Entity Initialization failed\n", ueSCellCb->ueId));
+      DU_LOG("\nERROR  -->  MAC : [%d]UeCb Harq Entity Initialization failed\n", ueSCellCb->ueId);
       return RFAILED;
    }
    rgDBMInsUeCb(cell, ueCb);
@@ -847,20 +837,17 @@ Bool            *isCfmRqrd
    if(((cell = rgCb[inst].cell) == NULLP) ||
        (cell->cellId != ueRecfg->cellId))
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), 
-                       "[%d]Active Cell does not exist %d\n",
-                                  ueRecfg->oldCrnti, ueRecfg->cellId));
+      DU_LOG("\nERROR  -->  MAC : [%d]Active Cell does not exist %d\n",
+                                  ueRecfg->oldCrnti, ueRecfg->cellId);
       return RFAILED;
    }
 
-   RGDBGPRM(inst,(rgPBuf(inst), 
-            "Filling SCell Config : cellId %d ueId %d\n",
-            cell->cellId, cell->ueId));
+   DU_LOG("\nINFO  -->  MAC : Filling SCell Config : cellId %d ueId %d\n",
+            cell->cellId, cell->ueId);
 
    if ((ue = rgDBMGetUeCb(cell, ueRecfg->oldCrnti)) == NULLP)
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), 
-               "[%d]Ue does not exist\n", ueRecfg->oldCrnti));
+      DU_LOG("\nERROR  -->  MAC : [%d]UE does not exist\n", ueRecfg->oldCrnti);
       return RFAILED;
    }
 
@@ -951,12 +938,12 @@ RgErrInfo *errInfo
       /* Create UeCb and Insert in Rach List */
       if((ue=rgRAMCreateUeCb(cell, ueCfg->crnti, FALSE, errInfo)) == NULLP)
       {
-         RLOG_ARG0(L_ERROR,DBG_CRNTI,ueCfg->crnti,"UeCb creation failed");
+         DU_LOG("\nERROR  -->  MAC : UeCb creation failed");
          return RFAILED;
       }
       if(rgDHMHqEntInit(inst,&ue->dl.hqEnt, cell->maxDlHqProcPerUe) != ROK)
       {
-         RLOG_ARG0(L_ERROR,DBG_CRNTI,ueCfg->crnti,"UeCb Harq Entity Initialization failed");
+         DU_LOG("\nERROR  -->  MAC : UeCb Harq Entity Initialization failed");
          return RFAILED;
       }
       handover = TRUE;
@@ -1043,8 +1030,7 @@ CrgCfgTransId   transId
 
       if ((rgCFGCrgDedLcCfg(cell, ue, lcCfg, errInfo)) != ROK)
       {
-         RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,
-               "Dedicated logical channel configuration failed %d",lcCfg->lcId);
+         DU_LOG("\nERROR  -->  MAC : Dedicated logical channel configuration failed %d",lcCfg->lcId);
          return RFAILED;
       }
 #ifdef LTE_ADV
@@ -1058,14 +1044,14 @@ CrgCfgTransId   transId
    {
       if ((rgCFGCrgCmnLcCfg(inst,cell, lcCfg, errInfo)) != ROK)
       {
-         RLOG_ARG1(L_ERROR, DBG_CRNTI, lcCfg->crnti, "Common logical channel configuration"
+         DU_LOG("\nERROR  -->  MAC : Common logical channel configuration"
                   "failed %d\n", lcCfg->lcId);
          return RFAILED;
       }
    }
 
    errInfo->errCause = RGERR_NONE;
-   RLOG_ARG1(L_INFO, DBG_CRNTI,lcCfg->crnti, "CRG LC config done for UE: lcId %d\n", lcCfg->lcId);
+   DU_LOG("\nINFO   -->  MAC : CRG LC config done for UE lcId %d\n", lcCfg->lcId);
    return ROK;
 }  /* rgCFGCrgLcCfg */
 
@@ -1233,7 +1219,7 @@ RgErrInfo   *errInfo
 )
 {
 
-   RLOG_ARG1(L_DEBUG, DBG_CRNTI, ue->ueId, "UE: of cell %d Reset\n", cell->cellId);
+   DU_LOG("\nDEBUG  -->  MAC : UE of cell %d Reset\n", cell->cellId);
    rgDHMUeReset(cell, &ue->dl.hqEnt);
 
    errInfo->errCause = RGERR_NONE;
@@ -1282,7 +1268,7 @@ RgErrInfo   *errInfo
       {
 
          
-         RLOG_ARG0(L_ERROR,DBG_CELLID,cellDelInfo->u.cellDel.cellId,"Cell does not exist");
+         DU_LOG("\nERROR  -->  MAC : Cell does not exist");
          return RFAILED;
       }
 
@@ -1309,7 +1295,7 @@ RgErrInfo   *errInfo
    rgCb[inst].cell = NULLP;
 
    errInfo->errCause    = RGERR_NONE;
-   RGDBGINFO(inst,(rgPBuf(inst), "Cell %d deleted\n", cellDelInfo->u.cellDel.cellId));
+   DU_LOG("\nINFO  -->  MAC : Cell %d deleted\n", cellDelInfo->u.cellDel.cellId);
    return ROK;
 }  /* rgCFGCrgCellDel */
 
@@ -1344,12 +1330,12 @@ RgErrInfo   *errInfo
 
    errInfo->errCause = RGERR_CFG_CRG_UE_DEL;
 
-   RLOG_ARG1(L_DEBUG, DBG_CRNTI, ueDelInfo->u.ueDel.crnti, "UE %d Deletion Req at MAC\n", \
+   DU_LOG("\nDEBUG  -->  MAC : UE %d Deletion Req at MAC\n", \
             ueDelInfo->u.ueDel.crnti);
    if ((rgCb[inst].cell == NULLP)
        || (rgCb[inst].cell->cellId != ueDelInfo->u.ueDel.cellId))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,ueDelInfo->u.ueDel.crnti,"Cell does not exist %d",
+      DU_LOG("\nERROR  -->  MAC : Cell does not exist %d",
                 ueDelInfo->u.ueDel.cellId);
       return RFAILED;
    }
@@ -1401,7 +1387,7 @@ CrgCfgTransId transId
    if (((cell = rgCb[inst].cell) == NULLP) ||
        (rgCb[inst].cell->cellId != lcDelInfo->u.lchDel.cellId))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcDelInfo->u.lchDel.crnti,"Cell does not exist %d",
+      DU_LOG("\nERROR  -->  MAC : Cell does not exist %d",
                 lcDelInfo->u.lchDel.cellId);
       return RFAILED;
    }
@@ -1409,8 +1395,7 @@ CrgCfgTransId transId
    /* Fetch the Ue */
    if ((ue = rgDBMGetUeCb(cell, lcDelInfo->u.lchDel.crnti)) == NULLP)
    {
-      RLOG_ARG0(L_ERROR,DBG_CRNTI,lcDelInfo->u.lchDel.crnti,
-                "UE does not exist for dedicated logical channel");
+      DU_LOG("\nERROR  -->  MAC : UE does not exist for dedicated logical channel");
       return RFAILED;
    }
 
@@ -1420,7 +1405,7 @@ CrgCfgTransId transId
       if ((dlLc = rgDBMGetDlDedLcCb(ue, lcDelInfo->u.lchDel.lcId))
             == NULLP)
       {
-         RLOG_ARG1(L_ERROR,DBG_CRNTI,lcDelInfo->u.lchDel.crnti,"DL LC %d does not exist",
+         DU_LOG("\nERROR  -->  MAC : DL LC %d does not exist",
                    lcDelInfo->u.lchDel.lcId);
          return RFAILED;
       }
@@ -1434,7 +1419,7 @@ CrgCfgTransId transId
       if ((ulLc = rgDBMGetUlDedLcCb(ue, lcDelInfo->u.lchDel.lcId))
             == NULLP)
       {
-         RLOG_ARG1(L_ERROR,DBG_CRNTI,lcDelInfo->u.lchDel.crnti,"UL LC %d does not exist",
+         DU_LOG("\nERROR  -->  MAC : UL LC %d does not exist",
                    lcDelInfo->u.lchDel.lcId);
          return RFAILED;
       }
@@ -1444,7 +1429,7 @@ CrgCfgTransId transId
 
    if (!dirVld)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcDelInfo->u.lchDel.crnti,"Invalid direction %d for LC Delete",
+      DU_LOG("\nERROR  -->  MAC : Invalid direction %d for LC Delete",
             lcDelInfo->u.lchDel.dir);
       return RFAILED;
    }
@@ -1491,7 +1476,7 @@ RgErrInfo     *errInfo
    if (((*cell = rgCb[inst].cell) == NULLP)
       || ((*cell)->cellId != lcCfg->cellId))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"Active Cell does not exist: Cell %d",
+      DU_LOG("\nERROR  -->  MAC : Active Cell does not exist: Cell %d",
                 lcCfg->cellId);
       return RFAILED;
    }
@@ -1499,7 +1484,7 @@ RgErrInfo     *errInfo
    /* Fetch the Ue */
    if ((*ue = rgDBMGetUeCb(*cell, lcCfg->crnti)) == NULLP)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"UE  does not exist for dedicated logical channel %d",
+      DU_LOG("\nERROR  -->  MAC : UE  does not exist for dedicated logical channel %d",
                 lcCfg->lcId);
       return RFAILED;
    }
@@ -1508,7 +1493,7 @@ RgErrInfo     *errInfo
    if ((lcCfg->lcId < RG_DEDLC_MIN_LCID)
             ||(lcCfg->lcId > RG_DEDLC_MAX_LCID))
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"Invalid logical channel Id %d",
+      DU_LOG("\nERROR  -->  MAC : Invalid logical channel Id %d",
                 lcCfg->lcId);
       return RFAILED;
    }
@@ -1518,7 +1503,7 @@ RgErrInfo     *errInfo
    {
       if (rgDBMGetDlDedLcCb((*ue), lcCfg->lcId) != NULLP)
       {
-         RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"UE: Dedicated DL LC %d already configured",
+         DU_LOG("\nERROR  -->  MAC : UE Dedicated DL LC %d already configured",
                     lcCfg->lcId);
          return RFAILED;
       }
@@ -1530,13 +1515,13 @@ RgErrInfo     *errInfo
    {
       if (lcCfg->ulInfo.lcgId > (RG_MAX_LCG_PER_UE - 1))
       {
-         RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"UE: Invalid lcgId for uplink logical channel %d",
+         DU_LOG("\nERROR  -->  MAC : UE Invalid lcgId for uplink logical channel %d",
                    lcCfg->ulInfo.lcgId);
          return RFAILED;
       }
       if (rgDBMGetUlDedLcCb((*ue), lcCfg->lcId) != NULLP)
       {
-         RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"UE: Dedicated UL LC %d already configured",
+         DU_LOG("\nERROR  -->  MAC : UE Dedicated UL LC %d already configured",
                    lcCfg->lcId);
          return RFAILED;
       }
@@ -1545,7 +1530,7 @@ RgErrInfo     *errInfo
 
    if (!dirVld)
    {
-      RLOG_ARG1(L_ERROR,DBG_CRNTI,lcCfg->crnti,"Invalid Direction %d",
+      DU_LOG("\nERROR  -->  MAC : Invalid Direction %d",
                lcCfg->dir);
       return RFAILED;
    }
@@ -1586,7 +1571,7 @@ RgErrInfo     *errInfo
    if (((*cell = rgCb[inst].cell) != NULLP)
       && ((*cell)->cellId != lcCfg->cellId))
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,lcCfg->cellId,"Active Cell exists for common channels");
+      DU_LOG("\nERROR  -->  MAC : Active Cell exists for common channels");
       return RFAILED;
    }
 
@@ -1595,7 +1580,7 @@ RgErrInfo     *errInfo
         || ((*cell)->cellId != lcCfg->cellId))
    {
       
-      RLOG_ARG0(L_ERROR,DBG_CELLID,lcCfg->cellId,"Inactive Cell does not exist for common channels");
+      DU_LOG("\nERROR  -->  MAC : Inactive Cell does not exist for common channels");
       return RFAILED;
    }
    /* Validate downlink info */
@@ -1607,7 +1592,7 @@ RgErrInfo     *errInfo
          {
             if (rgDBMGetBcchOnDlsch(*cell,lcCfg->lcId) != NULLP)
             {
-               RLOG_ARG0(L_ERROR,DBG_CELLID,lcCfg->cellId,"BCCH on DLSCH already configured for cell");
+               DU_LOG("\nERROR  -->  MAC : BCCH on DLSCH already configured for cell");
                return RFAILED;
             }
          }
@@ -1615,13 +1600,13 @@ RgErrInfo     *errInfo
          {
             if (rgDBMGetBcchOnBch(*cell) != NULLP)
             {
-               RLOG_ARG0(L_ERROR,DBG_CELLID,lcCfg->cellId,"BCCH on BCH already configured for cell %d");
+               DU_LOG("\nERROR  -->  MAC : BCCH on BCH already configured for cell ");
                return RFAILED;
             }
          }
          else
          {
-            RLOG_ARG1(L_ERROR,DBG_CELLID,lcCfg->cellId,"Invalid transport channel %d for cell",
+            DU_LOG("\nERROR  -->  MAC : Invalid transport channel %d for cell",
                   lcCfg->dlInfo.dlTrchType);
             return RFAILED;
          }
@@ -1630,13 +1615,13 @@ RgErrInfo     *errInfo
       {
          if (rgDBMGetPcch(*cell) != NULLP)
          {
-            RLOG_ARG0(L_ERROR,DBG_CELLID,lcCfg->cellId,"PCCH already configured for cell");
+            DU_LOG("\nERROR  -->  MAC : PCCH already configured for cell");
             return RFAILED;
          }
       }
       else if (RG_DLCCCH_ISCFGD(*cell))
       {
-         RLOG_ARG0(L_ERROR,DBG_CELLID,lcCfg->cellId,"DL CCCH already configured for cell %d");
+         DU_LOG("\nERROR  -->  MAC : DL CCCH already configured for cell ");
          return RFAILED;
       }
       dirVld = TRUE;
@@ -1648,13 +1633,13 @@ RgErrInfo     *errInfo
       /* Uplink CCCH */
       if (lcCfg->lcType != CM_LTE_LCH_CCCH)
       {
-         RLOG_ARG1(L_ERROR,DBG_CELLID,lcCfg->cellId,"Invalid UL common lcType %d for cell ",
+         DU_LOG("\nERROR  -->  MAC : Invalid UL common lcType %d for cell ",
                   lcCfg->lcType);
          return RFAILED;
       }
       if (RG_ULCCCH_ISCFGD(*cell))
       {
-         RLOG_ARG0(L_ERROR,DBG_CELLID,lcCfg->cellId,"UL CCCH already configured for cell ");
+         DU_LOG("\nERROR  -->  MAC : UL CCCH already configured for cell ");
          return RFAILED;
       }
       dirVld = TRUE;
@@ -1663,7 +1648,7 @@ RgErrInfo     *errInfo
    /* Invalid direction */
    if (!dirVld)
    {
-      RLOG_ARG1(L_ERROR,DBG_CELLID,lcCfg->cellId,"Invalid Direction %d", lcCfg->dir);
+      DU_LOG("\nERROR  -->  MAC : Invalid Direction %d", lcCfg->dir);
       return RFAILED;
    }
 
@@ -1801,7 +1786,7 @@ RgErrInfo     *errInfo
    {
       rgCb[inst].cell = cell;
       rgCb[inst].inactiveCell = NULLP;
-      RLOG_ARG1(L_DEBUG, DBG_CELLID, cell->cellId, "Cell %d added to active list after common LC %d\
+      DU_LOG("\nDEBUG  -->  MAC : Cell  added to active list after common LC %d\
                config\n", lcCfg->lcId);
    }
 
@@ -1886,7 +1871,7 @@ Void rgCFGFreeCellCb(RgCellCb  *cell)
    rgFreeSBuf(inst,(Data **)&cell, sizeof(*cell));
  
 
-   RGDBGINFO(inst,(rgPBuf(inst), "Cell freed\n"));
+   DU_LOG("\nINFO  -->  MAC : Cell freed\n");
 
   /* Stack Crash Problem for TRACE5 Changes. Added return below */
   return; 
index 039d359..ed4e14d 100755 (executable)
@@ -33,9 +33,6 @@
 invoked by RRC towards MAC.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_FILE_ID=181;
-static int RLOG_MODULE_ID=4096;
 
 /* header include files -- defines (.h) */
 #include "common_def.h"
@@ -136,8 +133,8 @@ CrgCfgReqInfo *crgCfgReq
          }
       default:
          {
-            RLOG1(L_ERROR, "Invalid configuration action %d",
-                     crgCfgReq->action);
+            DU_LOG("\nERROR  -->  MAC : Invalid configuration action %d",
+            crgCfgReq->action);
 
             ret = RFAILED;
          }
@@ -160,7 +157,7 @@ if(TRUE == isCfmRqrd)
 #ifdef LTE_ADV
    }
 #endif
-   RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n"));
+   DU_LOG("\nINFO  -->  MAC : CRG Configuration request processed\n");
    return (ret);
 }  /* rgCOMCfgReq */
 /**
@@ -211,7 +208,7 @@ CrgCfgTransId    transId
          ret = rgCFGVldtCrgCellCfg(inst,&cfg->u.cellCfg,errInfo);
          if (ret != ROK)
          {
-              RLOG_ARG0(L_ERROR,DBG_CELLID,cfg->u.cellCfg.cellId, "Cell configuration validation FAILED\n");
+              DU_LOG("\nERROR  -->  MAC : Cell configuration validation FAILED\n");
               return RFAILED;
          }
          ret = rgCFGCrgCellCfg(inst,&cfg->u.cellCfg, errInfo);
@@ -223,7 +220,7 @@ CrgCfgTransId    transId
             ret = rgCFGVldtCrgUeCfg(inst,&cfg->u.ueCfg, &cell, errInfo);
             if (ret != ROK)
             {
-               RLOG_ARG0(L_ERROR,DBG_CRNTI,cfg->u.ueCfg.crnti, "Ue configuration validation FAILED\n");
+               DU_LOG("\nERROR  -->  MAC : UE configuration validation FAILED\n");
                return RFAILED;
             }
             ret = rgCFGCrgUeCfg(inst,cell, &cfg->u.ueCfg, errInfo);
@@ -237,8 +234,7 @@ CrgCfgTransId    transId
          if (ret != ROK)
          {
             
-            RLOG_ARG1(L_ERROR,DBG_CELLID,cfg->u.cellCfg.cellId,
-                         "LC configuration validation FAILED: LC %d\n", cfg->u.lchCfg.lcId);
+            DU_LOG("\nERROR  -->  MAC : LC configuration validation FAILED: LC %d\n", cfg->u.lchCfg.lcId);
             return RFAILED;
          }
          ret = rgCFGCrgLcCfg(inst,cell, ue, &cfg->u.lchCfg, errInfo,isCfmRqrd,transId);
@@ -246,7 +242,7 @@ CrgCfgTransId    transId
       }
       default:
       {
-         RLOG1(L_ERROR, "Should never come here: cfgType %d",cfg->cfgType);
+         DU_LOG("\nERROR  -->  MAC : Should never come here: cfgType %d",cfg->cfgType);
          return RFAILED;
       }
    }
@@ -304,8 +300,7 @@ Bool             *isCfmRqrd
          ret = rgCFGVldtCrgCellRecfg(inst,&recfg->u.cellRecfg, &cell, errInfo);
             if (ret != ROK) 
             {
-               RLOG_ARG0(L_ERROR,DBG_CELLID,recfg->u.cellRecfg.cellId,
-                         "Cell Recfg Validation FAILED");
+               DU_LOG("\nERROR  -->  MAC : Cell Recfg Validation FAILED");
                return RFAILED;
             }
          ret = rgCFGCrgCellRecfg(inst,cell, &recfg->u.cellRecfg, errInfo);
@@ -329,8 +324,8 @@ Bool             *isCfmRqrd
             ret = rgFillAndAddSCellCfg(inst, cell, &recfg->u.ueRecfg, transId, isCfmRqrd);
             if (ret != ROK)
             {
-               RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Ue SCell configuration FAILED for inst [%d]\n",
-                        recfg->u.ueRecfg.oldCrnti, inst));
+               DU_LOG("\nERROR  -->  MAC : [%d]UE SCell configuration FAILED for inst [%d]\n",
+                        recfg->u.ueRecfg.oldCrnti, inst);
                return RFAILED;
             }
 
@@ -341,8 +336,7 @@ Bool             *isCfmRqrd
             ret = rgCFGVldtCrgUeRecfg(inst,&recfg->u.ueRecfg, &cell, &ue, errInfo);
             if ( ret != ROK)
             {
-               RLOG_ARG1(L_ERROR,DBG_CELLID,recfg->u.ueRecfg.cellId,
-                      "Ue Re-configuration validation FAILED OLD CRNTI:%d",
+                DU_LOG("\nERROR  -->  MAC : UE Re-configuration validation FAILED OLD CRNTI:%d",
                       recfg->u.ueRecfg.oldCrnti);
                return RFAILED;
             }
@@ -359,8 +353,7 @@ Bool             *isCfmRqrd
                &ulLc, errInfo);
          if (ret != ROK)
          {
-            RLOG_ARG2(L_ERROR,DBG_CELLID,recfg->u.lchRecfg.cellId,
-                      "LC Re-configuration validation FAILED LCID:%d CRNTI:%d",
+            DU_LOG("\nERROR  -->  MAC : LC Re-configuration validation FAILED LCID:%d CRNTI:%d",
                       recfg->u.lchRecfg.lcId,recfg->u.lchRecfg.crnti);
             return RFAILED;
          }
@@ -377,7 +370,7 @@ Bool             *isCfmRqrd
       }
       default:
       {
-         RLOG1(L_ERROR, "Should never come here: recfgType %d",
+         DU_LOG("\nERROR  -->  MAC : Should never come here: recfgType %d",
                   recfg->recfgType);
          return RFAILED;
       }
@@ -418,7 +411,7 @@ RgErrInfo  *errInfo
    /* Fix : ccpu00126865: ignore CRG reset. Let SCH trigger it. */
    
    errInfo->errCause = RGERR_NONE;
-   RGDBGINFO(inst,(rgPBuf(inst), "CRG UE Reset processed \n"));
+   DU_LOG("\nINFO  -->  MAC : CRG UE Reset processed \n");
    return ROK;
 }  /* rgCOMHndlResetReq */
 /*End: LTEMAC_2.1_DEV_CFG */
@@ -473,9 +466,8 @@ CrgCfgTransId transId
          /*starting Task*/ 
          SStartTask(&startTime,PID_MAC_UE_DEL);
 
-
          ret = rgCFGCrgUeDel(inst,del, errInfo);
-         RGDBGINFONEW(inst,(rgPBuf(inst),"[%d] Delete UE Done \n", del->u.ueDel.crnti));
+         DU_LOG("\nINFO  -->  MAC : [%d] Delete UE Done \n", del->u.ueDel.crnti);
 
          /*stoping Task*/ 
          SStopTask(startTime,PID_MAC_UE_DEL);
@@ -489,7 +481,7 @@ CrgCfgTransId transId
       }
       default:
       {
-         RLOG1(L_ERROR, "Should never come here: delType %d",
+         DU_LOG("\nERROR  -->  MAC : Should never come here: delType %d",
                   del->delType);
          return RFAILED;
       }
@@ -532,9 +524,8 @@ RgPrgUeSCellCfgInfo *ueSCellCb
    Pst              cfmPst;    
 
    
-   RGDBGPRM(inst,(rgPBuf(inst),
-            "APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d\n",
-            ueSCellCb->cellId, ueSCellCb->ueId));
+   DU_LOG("\nDEBUG  -->  MAC : APPLYING CRG UE SCELL CONFIG: cellId %d ueId %d\n",
+            ueSCellCb->cellId, ueSCellCb->ueId);
 
    cfgCfm.ueId = ueSCellCb->ueId;
    cfgCfm.sCellId = ueSCellCb->cellId;
@@ -545,8 +536,8 @@ RgPrgUeSCellCfgInfo *ueSCellCb
   ret = rgUtlVltdAddSCellCfg(ueSCellCb, cell, inst);
   if(ret != ROK)
   {
-     RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Crg Ue SCell failed:\
-              cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId));
+     DU_LOG("\nERROR  -->  MAC : [%d]Crg UE SCell failed:\
+              cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId);
      /* Set status as Not OK*/
      cfgCfm.status = PRG_CFG_CFM_NOK;
   }
@@ -555,15 +546,15 @@ RgPrgUeSCellCfgInfo *ueSCellCb
      ret = rgCfgAddUeSCellCfg(inst, ueSCellCb, cell);
      if(ret != ROK)
      {
-        RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]Crg Ue SCell failed:\
-                 cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId));
+        DU_LOG("\nERROR  -->  MAC : [%d]Crg UE SCell failed:\
+                 cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId);
         /* Set status as Not OK*/
         cfgCfm.status = PRG_CFG_CFM_NOK;
      }
   }
   
-  RGDBGINFONEW(inst,(rgPBuf(inst), "[%d]Crg Ue SCell Config done:\
-           cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId));
+  DU_LOG("\nINFO  -->  MAC : [%d]Crg UE SCell Config done:\
+           cellId %d\n", ueSCellCb->ueId, ueSCellCb->cellId);
 
   /* Send positive confirmation to primary cell*/
   RgPrgSMacPMacCfg(&cfmPst, &cfgCfm);
@@ -606,16 +597,14 @@ RgPrgCfgCfmInfo *cfgCfm
 
    RG_IS_INST_VALID(inst);
 
-   RGDBGPRM(pst->dstInst,(rgPBuf(pst->dstInst),
-            "Config Confirm Rcvd from Inst %d ueId %d cellId %d\n",
-            pst->srcInst, cfgCfm->ueId, cfgCfm->cellId));
+   DU_LOG("\nINFO  -->  MAC : Config Confirm Rcvd from Inst %d ueId %d cellId %d\n",
+            pst->srcInst, cfgCfm->ueId, cfgCfm->cellId);
 
    cell = rgCb[inst].cell;
 
    if ((ue = rgDBMGetUeCb(cell, cfgCfm->ueId)) == NULLP)
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), 
-               "[%d]Ue does not exist\n", cfgCfm->ueId));
+      DU_LOG("\nERROR  -->  MAC : [%d]UE does not exist\n", cfgCfm->ueId);
       return RFAILED;
    }
    switch(cfgCfm->event)
@@ -633,7 +622,7 @@ RgPrgCfgCfmInfo *cfgCfm
                /* Send back confirmation status to RRC */
                rgUIMCrgCfgCfm(inst, ue->cfgCfmInfo.transId, ue->cfgCfmInfo.mask);
                ue->cfgCfmInfo.mask = 0;
-               RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n"));
+               DU_LOG("\nINFO  -->  MAC : CRG Configuration request processed\n");
             }
          }
          break;
@@ -655,14 +644,14 @@ RgPrgCfgCfmInfo *cfgCfm
                /* Send back confirmation status to RRC */
                rgUIMCrgCfgCfm(inst, ue->cfgCfmInfo.transId, ue->cfgCfmInfo.mask);
                ue->cfgCfmInfo.mask = 0;
-               RGDBGINFO(inst,(rgPBuf(inst), "CRG Configuration request processed\n"));
+               DU_LOG("\nINFO  -->  MAC : CRG Configuration request processed\n");
             }
          }
          break;
       default:
          {
-            RGDBGERRNEW(inst,(rgPBuf(inst), "Invalid configuration confirm event %d\n",
-                     cfgCfm->event));
+            DU_LOG("\nERROR  -->  MAC : Invalid configuration confirm event %d\n",
+                     cfgCfm->event);
 
             return RFAILED;
          }
@@ -705,8 +694,8 @@ RgPrgUeSCellDelInfo *ueSCellDelInfo
    /* Retrive the UeCb from sec cell*/
    if ((sCellUe = rgDBMGetUeCb(sCell, ueSCellDelInfo->ueId)) == NULLP)
    {
-      RGDBGERRNEW(inst, (rgPBuf(inst), "[%d]UE:does not exist in sCell(%d)\n",
-               ueSCellDelInfo->ueId, sCell->cellId));
+      DU_LOG("\nERROR  -->  MAC : [%d]UE:does not exist in sCell(%d)\n",
+               ueSCellDelInfo->ueId, sCell->cellId);
       return RFAILED;
    }
    
@@ -718,8 +707,8 @@ RgPrgUeSCellDelInfo *ueSCellDelInfo
      /* Retrive the UeCb from sec cell*/
      if ((rgDBMGetUeCb(sCell, ueSCellDelInfo->newRnti)) != NULLP)
      {
-        RGDBGERRNEW(inst, (rgPBuf(inst), "[%d]UE:UE context already exist in\
-                 sCell(%d)",ueSCellDelInfo->newRnti, sCell->cellId));
+        DU_LOG("\nERROR  -->  MAC : [%d]UE:UE context already exist in\
+                 sCell(%d)",ueSCellDelInfo->newRnti, sCell->cellId);
         return RFAILED;
      }
 
index 3c648e4..acca511 100755 (executable)
@@ -32,9 +32,6 @@
 @brief APIs related to Downlink HARQ.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_FILE_ID=279;
-static int RLOG_MODULE_ID=4096;
 /* header include files -- defines (.h) */
 #include "common_def.h"
 #ifdef L2_OPTMZ
@@ -125,40 +122,40 @@ S16 rgDHMHqEntInit(Inst  inst, RgDlHqEnt *hqE, uint8_t maxHqProcs)
    {
       if (rgAllocSBuf(inst,(Data **)&(hqE->procs[idx1]),sizeof(RgDlHqProcCb)) != ROK) 
       {
-         while(idx1--)
-         {
-            rgFreeSBuf(inst,(Data **)&(hqE->procs[idx1]), sizeof(RgDlHqProcCb));
-         }
-         RLOG0(L_ERROR, "Memory Alloc Failure for RgDlHqProcCb");        
-         return RFAILED;
+        while(idx1--)
+        {
+           rgFreeSBuf(inst,(Data **)&(hqE->procs[idx1]), sizeof(RgDlHqProcCb));
+        }
+        DU_LOG("\nERROR  -->  MAC : Memory Alloc Failure for RgDlHqProcCb");        
+        return RFAILED;
       }
 
       hqE->procs[idx1]->procId      = idx1;
       for(idx2 = 0; idx2 < RG_MAX_TB_PER_UE; idx2++)
       {
 #ifndef L2_OPTMZ
-         hqE->procs[idx1]->tbInfo[idx2].tb = NULLP;
+        hqE->procs[idx1]->tbInfo[idx2].tb = NULLP;
 #else
-         Buffer *tmpMBuf;
-         /* L2 optimization for mUe/Tti: Allocating buffers for macHdr, macCes
-          * and macPadding. These buffers shall not be released by MAC/CL.
-          * However, Only rPtr and wPtr will be reset while release of hq proc
-          */
-         tmpMBuf = hqE->procs[idx1]->tbInfo[idx2].tb.macHdr;
-         rgGetMsg(inst, &tmpMBuf);
-         RG_ADD_DBuf(hdrDBuf, RG_MAC_HDR_SIZE, tmpMBuf);
-         hqE->procs[idx1]->tbInfo[idx2].tb.macHdr = tmpMBuf;
-         macHeader[idx2] = MacPtrAddress;
-
-         tmpMBuf = hqE->procs[idx1]->tbInfo[idx2].tb.macCes;
-         rgGetMsg(inst, &tmpMBuf);
-         RG_ADD_DBuf(ceDBuf, RG_MAC_CE_SIZE, tmpMBuf);
-         hqE->procs[idx1]->tbInfo[idx2].tb.macCes = tmpMBuf;
-
-         hqE->procs[idx1]->tbInfo[idx2].tb.padSize = 0;
+        Buffer *tmpMBuf;
+        /* L2 optimization for mUe/Tti: Allocating buffers for macHdr, macCes
+         * and macPadding. These buffers shall not be released by MAC/CL.
+         * However, Only rPtr and wPtr will be reset while release of hq proc
+         */
+        tmpMBuf = hqE->procs[idx1]->tbInfo[idx2].tb.macHdr;
+        rgGetMsg(inst, &tmpMBuf);
+        RG_ADD_DBuf(hdrDBuf, RG_MAC_HDR_SIZE, tmpMBuf);
+        hqE->procs[idx1]->tbInfo[idx2].tb.macHdr = tmpMBuf;
+        macHeader[idx2] = MacPtrAddress;
+
+        tmpMBuf = hqE->procs[idx1]->tbInfo[idx2].tb.macCes;
+        rgGetMsg(inst, &tmpMBuf);
+        RG_ADD_DBuf(ceDBuf, RG_MAC_CE_SIZE, tmpMBuf);
+        hqE->procs[idx1]->tbInfo[idx2].tb.macCes = tmpMBuf;
+
+        hqE->procs[idx1]->tbInfo[idx2].tb.padSize = 0;
 #endif
 #ifdef LTE_L2_MEAS
-         hqE->procs[idx1]->tbId[idx2] = RGU_INVALID_TBID;
+        hqE->procs[idx1]->tbId[idx2] = RGU_INVALID_TBID;
 #endif
       }
 
@@ -192,11 +189,11 @@ Void rgDHMUeReset(RgCellCb *cell, RgDlHqEnt  *hqE)
       /* Free all the TB memory associated with HARQ */
       for (i=0; i < hqE->numHqProcs; i++)
       {
-         rgDHMRlsHqProcTB(cell, hqE->procs[i], 1);
-         rgDHMRlsHqProcTB(cell, hqE->procs[i], 2);
+        rgDHMRlsHqProcTB(cell, hqE->procs[i], 1);
+        rgDHMRlsHqProcTB(cell, hqE->procs[i], 2);
 
 #ifdef LTE_ADV
-         rgDHMFreeSavedHqP((cell->macInst - RG_INST_START), hqE, i);
+        rgDHMFreeSavedHqP((cell->macInst - RG_INST_START), hqE, i);
 #endif
       }
    }
@@ -227,9 +224,9 @@ Void rgDHMHdlBufFree(Inst inst, Buffer **mBuf)
    {
       if (*mBuf)
       {
-         rgCbP->bufToFree[rgCbP->bufCnt] = *mBuf;
-         rgCbP->bufCnt++;
-         *mBuf = NULLP;
+        rgCbP->bufToFree[rgCbP->bufCnt] = *mBuf;
+        rgCbP->bufCnt++;
+        *mBuf = NULLP;
       }
    }
    else
@@ -313,14 +310,14 @@ Void rgDHMFreeAllTbBufs(Inst inst)
  **/
 S16 rgDHMRlsHqProcTB(RgCellCb  *cell, RgDlHqProcCb *hqP, uint8_t tbIndex)
 {
-    uint8_t          idx;
+   uint8_t          idx;
 #ifdef L2_OPTMZ
-    RgTfuDatReqTbInfo     *tb;   /* TB to be sent to CL/PHY*/
+   RgTfuDatReqTbInfo     *tb;   /* TB to be sent to CL/PHY*/
    // uint32_t lchIdx, pduIdx;
 #endif
 
    if((tbIndex > RG_MAX_TB_PER_UE) ||
-      (tbIndex == 0))
+        (tbIndex == 0))
    {
       return RFAILED;
    }
@@ -354,12 +351,12 @@ S16 rgDHMRlsHqProcTB(RgCellCb  *cell, RgDlHqProcCb *hqP, uint8_t tbIndex)
    for(idx = 0; idx < 2; idx++)
    {
       if (hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk.node != NULLP)
-   {
-         cmLListDelFrm(&hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sf->tbs,
-               &(hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk));
-         hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk.node  = (PTR)NULLP;
-      printf("\nrgDHMRlsHqProcTB:: hqP %p \n", (Void *)hqP);
-   }
+      {
+        cmLListDelFrm(&hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sf->tbs,
+              &(hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk));
+        hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk.node  = (PTR)NULLP;
+        DU_LOG("\nINFO  -->  MAC : rgDHMRlsHqProcTB:: hqP %p \n", (Void *)hqP);
+      }
       hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sf = NULLP;
    }
    /* Fix : syed It is better to reset these feilds
@@ -416,14 +413,14 @@ S16 rgDHMGetHqProcFrmId(RgUeCb *ue, uint8_t  idx, RgDlHqProcCb **hqP)
  *      -#ROK 
  *      -#RFAILED 
  **/
-S16 rgDHMSndDatReq
+   S16 rgDHMSndDatReq
 (
-RgCellCb        *cellCb,
-RgDlSf          *dlSf,
-RgTfuDatReqInfo *datInfo,
-RgDlHqProcCb   *hqP,
-RgErrInfo      *err 
-)
+ RgCellCb        *cellCb,
+ RgDlSf          *dlSf,
+ RgTfuDatReqInfo *datInfo,
+ RgDlHqProcCb   *hqP,
+ RgErrInfo      *err 
+ )
 {
    uint8_t i;
    Inst    inst = cellCb->macInst - RG_INST_START;
@@ -436,92 +433,92 @@ RgErrInfo      *err
    dataAvlblUe = TRUE;
    for(i=0;i< RG_MAX_TB_PER_UE;i++)
    {
-         /* printf("\nDHMSndDatReq1: Rnti %d dlSfSchdTime(sfn sf) : (%d %d)\n"
-                "macCell(sfn sf): (%d %d) tbTimingInfo(sfn sf): (%d %d)\n"
-                "dlSf %p dlSf->tbs.count %d hqp %p tb %p\n",
-                             hqP->tbInfo[i].pdcch.rnti,
-                             dlSf->schdTime.sfn, dlSf->schdTime.slot,
-                             cellCb->crntTime.sfn, cellCb->crntTime.slot,
-                             hqP->tbInfo[i].timingInfo.sfn, 
-                             hqP->tbInfo[i].timingInfo.slot,
-                             (Void *)dlSf, dlSf->tbs.count,
-                             (Void *)hqP,
-                             (Void *)hqP->tbInfo[i].tb);*/
+      /* DU_LOG("\nDHMSndDatReq1: Rnti %d dlSfSchdTime(sfn sf) : (%d %d)\n"
+        "macCell(sfn sf): (%d %d) tbTimingInfo(sfn sf): (%d %d)\n"
+        "dlSf %p dlSf->tbs.count %d hqp %p tb %p\n",
+        hqP->tbInfo[i].pdcch.rnti,
+        dlSf->schdTime.sfn, dlSf->schdTime.slot,
+        cellCb->crntTime.sfn, cellCb->crntTime.slot,
+        hqP->tbInfo[i].timingInfo.sfn, 
+        hqP->tbInfo[i].timingInfo.slot,
+        (Void *)dlSf, dlSf->tbs.count,
+        (Void *)hqP,
+        (Void *)hqP->tbInfo[i].tb);*/
       /* Mukesh :: in case of rpepetiton this is not rerd*/
       if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf)
       {
-         /* Check if data from RLC had been received and got muxed. */
+        /* Check if data from RLC had been received and got muxed. */
 #ifndef L2_OPTMZ
-         if (hqP->tbInfo[i].tb == NULLP) 
+        if (hqP->tbInfo[i].tb == NULLP) 
 #else
-         if (!(hqP->tbInfo[i].tb.tbPres)) 
+           if (!(hqP->tbInfo[i].tb.tbPres)) 
 #endif
-         {
+           {
 #ifndef LTE_ADV
-            if (hqP->tbInfo[i].schdTa.pres == TRUE ||
-                  hqP->tbInfo[i].contResCe == PRSNT_NODEF)
+              if (hqP->tbInfo[i].schdTa.pres == TRUE ||
+                    hqP->tbInfo[i].contResCe == PRSNT_NODEF)
 #else
-            if ((hqP->tbInfo[i].schdTa.pres == TRUE) ||
-                 (hqP->tbInfo[i].contResCe == PRSNT_NODEF) ||
-                 (hqP->tbInfo[i].sCellActCe.pres == TRUE))
+                 if ((hqP->tbInfo[i].schdTa.pres == TRUE) ||
+                       (hqP->tbInfo[i].contResCe == PRSNT_NODEF) ||
+                       (hqP->tbInfo[i].sCellActCe.pres == TRUE))
 #endif
-            {
-               /* Data not received but ta needs to be sent. */
-               /* MUX TA and send it */
-               bldPdu.datReq    =  NULLP;
-               //bldPdu.reqType   =  EVENT_SLOT_IND_TO_MAC;
-               bldPdu.schdTbSz  =  hqP->tbInfo[i].tbSz;
-               bldPdu.ta        =  hqP->tbInfo[i].schdTa;
+                 {
+                    /* Data not received but ta needs to be sent. */
+                    /* MUX TA and send it */
+                    bldPdu.datReq    =  NULLP;
+                    //bldPdu.reqType   =  EVENT_SLOT_IND_TO_MAC;
+                    bldPdu.schdTbSz  =  hqP->tbInfo[i].tbSz;
+                    bldPdu.ta        =  hqP->tbInfo[i].schdTa;
 #ifdef LTE_ADV
-               bldPdu.sCellActCe= hqP->tbInfo[i].sCellActCe;
+                    bldPdu.sCellActCe= hqP->tbInfo[i].sCellActCe;
 #endif
-               /* changes for CR timer implementation*/
-               bldPdu.contResId =  hqP->tbInfo[i].contResId;
-               if (ROK != rgMUXBldPdu(inst,&bldPdu, &(hqP->tbInfo[i].tb), err))  
-               {
-                  RLOG1(L_ERROR, "MUXing failed for:  MacInst %d", inst);
-                  RLOG4(L_ERROR, "MUXing failed for:  time: %d/%d\
-                  procId %d ueId %d", hqP->tbInfo[i].timingInfo.sfn,
-                  hqP->tbInfo[i].timingInfo.slot, hqP->procId, 
-                  hqP->tbInfo[i].pdcch.rnti);
-
-                  return RFAILED;
-               }
-            }
-            else   
-            {
+                    /* changes for CR timer implementation*/
+                    bldPdu.contResId =  hqP->tbInfo[i].contResId;
+                    if (ROK != rgMUXBldPdu(inst,&bldPdu, &(hqP->tbInfo[i].tb), err))  
+                    {
+                       DU_LOG("\nERROR  -->  MAC : MUXing failed for:  MacInst %d", inst);
+                       DU_LOG("\nERROR  -->  MAC : MUXing failed for:  time: %d/%d\
+                             procId %d ueId %d", hqP->tbInfo[i].timingInfo.sfn,
+                             hqP->tbInfo[i].timingInfo.slot, hqP->procId, 
+                             hqP->tbInfo[i].pdcch.rnti);
+
+                       return RFAILED;
+                    }
+                 }
+                 else   
+                 {
 #ifdef LTEMAC_RGU_PAD
-               /* Data not received from RLC. Padding at MAC */
-               bldPdu.datReq    =  NULLP;
-               //bldPdu.reqType   =  EVENT_SLOT_IND_TO_MAC;
-               bldPdu.schdTbSz  =  hqP->tbInfo[i].tbSz;
-               bldPdu.ta        =  hqP->tbInfo[i].schdTa;
+                    /* Data not received from RLC. Padding at MAC */
+                    bldPdu.datReq    =  NULLP;
+                    //bldPdu.reqType   =  EVENT_SLOT_IND_TO_MAC;
+                    bldPdu.schdTbSz  =  hqP->tbInfo[i].tbSz;
+                    bldPdu.ta        =  hqP->tbInfo[i].schdTa;
 #ifdef LTE_ADV
-               bldPdu.sCellActCe= hqP->tbInfo[i].sCellActCe;
+                    bldPdu.sCellActCe= hqP->tbInfo[i].sCellActCe;
 #endif
-               bldPdu.ta.val    =  0;
-               bldPdu.contResId =  NULLP;
-
-               if (ROK != rgMUXBldPdu(inst,&bldPdu, &(hqP->tbInfo[i].tb), err))  
-               {
-                  RLOG1(L_ERROR, "MUXing failed for:  MacInst %d", inst);
-                  RLOG4(L_ERROR, "MUXing failed for:  time: %d/%d\
-                  procId %d ueId %d", hqP->tbInfo[i].timingInfo.sfn,
-                  hqP->tbInfo[i].timingInfo.slot, hqP->procId, 
-                  hqP->tbInfo[i].pdcch.rnti);
-                  
-                  return RFAILED;
-               }
+                    bldPdu.ta.val    =  0;
+                    bldPdu.contResId =  NULLP;
+
+                    if (ROK != rgMUXBldPdu(inst,&bldPdu, &(hqP->tbInfo[i].tb), err))  
+                    {
+                       DU_LOG("\nERROR  -->  MAC : MUXing failed for:  MacInst %d", inst);
+                       DU_LOG("\nERROR  -->  MAC : MUXing failed for:  time: %d/%d\
+                             procId %d ueId %d", hqP->tbInfo[i].timingInfo.sfn,
+                             hqP->tbInfo[i].timingInfo.slot, hqP->procId, 
+                             hqP->tbInfo[i].pdcch.rnti);
+
+                       return RFAILED;
+                    }
 #else
-               /*Padding is not done so data for this UE will not be
-                 included.*/
-               dataAvlblUe = FALSE;
+                    /*Padding is not done so data for this UE will not be
+                      included.*/
+                    dataAvlblUe = FALSE;
 #endif
-            }
-         }
-         else
-         {
-         }
+                 }
+           }
+           else
+           {
+           }
       }
       //else
       {
@@ -537,19 +534,19 @@ RgErrInfo      *err
       rgDHMRlsHqProcTB(cellCb, hqP, 1);
       if(2 == hqP->numOfTBs)
       {
-         rgDHMRlsHqProcTB(cellCb, hqP, 2);
+        rgDHMRlsHqProcTB(cellCb, hqP, 2);
       }
-      
+
       return ROK;
    }
 
    if (rgGetEventMem(inst,(Ptr *)&datReq, sizeof(TfuDatReqPduInfo),
-            &(datInfo->memCp)) != ROK)
+           &(datInfo->memCp)) != ROK)
    {
       return RFAILED;
    }
    /* Fill the TFU Dat Req with information from Harq Proc */
-  
+
    rgDHMBldTfuDatReq(cellCb, dlSf, hqP, datReq);
 
    /* MS_WORKAROUND for ccpu00122894 */
@@ -557,11 +554,11 @@ RgErrInfo      *err
    {
       if (hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf)
       {
-         cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk));
-         hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = NULLP;
-         
-        
-        hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf = NULLP;
+        cmLListDelFrm(&dlSf->tbs, &(hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk));
+        hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = NULLP;
+
+
+        hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf = NULLP;
       }
    }
    cmLListAdd2Tail(&datInfo->pdus, &(datReq->lnk));
@@ -590,16 +587,16 @@ RgErrInfo      *err
  *      -# ROK 
  *      -# RFAILED 
  **/
-S16 rgDHMHndlDedDatReq
+   S16 rgDHMHndlDedDatReq
 (
-Inst           inst,
-RgDlHqProcCb   *hqProc,
-RgRguDDatReqPerUe *datReq,
-RgDlSf            *dlSf,
-RgErrInfo      *err
-)
+ Inst           inst,
+ RgDlHqProcCb   *hqProc,
+ RgRguDDatReqPerUe *datReq,
+ RgDlSf            *dlSf,
+ RgErrInfo      *err
+ )
 {
-//   uint32_t            len;
+   //   uint32_t            len;
    uint8_t        i;
    uint8_t        j;
    RgBldPduInfo   bldPdu;
@@ -614,16 +611,16 @@ RgErrInfo      *err
     * has been sent earlier on the harq proc.
     */
    if((datReq->nmbOfTbs > RG_MAX_TB_PER_UE) ||
-         (tbIndex == 0))
+        (tbIndex == 0))
    {
       /* release corresponding TBs from SF tbs List */
       for(j=0;j<datReq->nmbOfTbs;j++)
       {
-         if (!(tbIndex & (j+1)))
-         {
-            j++;
-         
-         rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (uint8_t)(j+1));
+        if (!(tbIndex & (j+1)))
+        {
+           j++;
+        } 
+        rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (uint8_t)(j+1));
       }
       return RFAILED;
    }
@@ -635,21 +632,21 @@ RgErrInfo      *err
        * 11 corresponds two TBs of UE */
       if (!(tbIndex & (i+1)))
       {
-          continue;
+        continue;
       }
       if (hqProc->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node == NULLP)
       {
-         /* release corresponding TBs from SF tbs List */
-         for(j=0;j<datReq->nmbOfTbs;j++)
-         {
-            if (!(tbIndex & (j+1)))
-            {
-               j++;
-            }
-            rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (uint8_t)(j+1));
-            printf("\nrgDHMHndlDedDatReq:: hqP %p \n", (Void *)hqProc);
-         }
-         return RFAILED;
+        /* release corresponding TBs from SF tbs List */
+        for(j=0;j<datReq->nmbOfTbs;j++)
+        {
+           if (!(tbIndex & (j+1)))
+           {
+              j++;
+           }
+           rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (uint8_t)(j+1));
+           DU_LOG("\nINFO  -->  MAC : rgDHMHndlDedDatReq:: hqP %p \n", (Void *)hqProc);
+        }
+        return RFAILED;
 
       }
 #ifndef L2_OPTMZ
@@ -661,7 +658,7 @@ RgErrInfo      *err
       tb = &hqProc->tbInfo[i].tb;
       if (tb->tbPres == TRUE)
       {
-         RG_FREE_TB(tb);
+        RG_FREE_TB(tb);
       }
 #endif
       bldPdu.datReq    =  datReq;
@@ -682,26 +679,26 @@ RgErrInfo      *err
 #endif 
       if(rgMUXBldPdu(inst,&bldPdu, &(hqProc->tbInfo[i].tb), err) != ROK)
       {
-         RLOG1(L_ERROR, "MUXing failed for:  MacInst %d", inst);
-         RLOG4(L_ERROR, "MUXing failed for:  time: %d/%d\
-               procId %d ueId %d", hqProc->tbInfo[i].timingInfo.sfn,
-               hqProc->tbInfo[i].timingInfo.slot, hqProc->procId, 
-               hqProc->tbInfo[i].pdcch.rnti);
-
-         /* release corresponding TBs from SF tbs List */
-         for(j=0;j<datReq->nmbOfTbs;j++)
-         {
-            if (!(tbIndex & (j+1)))
-            {
-               j++;
-            }
-            rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (uint8_t)(j+1));
-         }
-         return RFAILED;
+        DU_LOG("\nERROR  -->  MAC : MUXing failed for:  MacInst %d", inst);
+        DU_LOG("\nERROR  -->  MAC : MUXing failed for:  time: %d/%d\
+              procId %d ueId %d", hqProc->tbInfo[i].timingInfo.sfn,
+              hqProc->tbInfo[i].timingInfo.slot, hqProc->procId, 
+              hqProc->tbInfo[i].pdcch.rnti);
+
+        /* release corresponding TBs from SF tbs List */
+        for(j=0;j<datReq->nmbOfTbs;j++)
+        {
+           if (!(tbIndex & (j+1)))
+           {
+              j++;
+           }
+           rgDHMRlsHqProcTB(rgCb[inst].cell, hqProc, (uint8_t)(j+1));
+        }
+        return RFAILED;
       }
       /*
-      SFndLenMsg(hqProc->tbInfo[i].tb, &len);
-      */
+        SFndLenMsg(hqProc->tbInfo[i].tb, &len);
+       */
    }
    return ROK;
 }  /* rgDHMHndlDedDatReq */
@@ -726,29 +723,29 @@ RgErrInfo      *err
  *      -# ROK 
  *      -# RFAILED 
  **/
-S16 rgDHMHndlCmnDatReq
+   S16 rgDHMHndlCmnDatReq
 (
-Inst           inst,
-RgDlHqProcCb   *hqProc,
-RgRguCmnDatReq *datReq,
-RgErrInfo      *err
-)
+ Inst           inst,
+ RgDlHqProcCb   *hqProc,
+ RgRguCmnDatReq *datReq,
+ RgErrInfo      *err
+ )
 {
    RgUstaDgn      dgn;
    RgBldPduInfo   bldPdu;
 
 #ifndef L2_OPTMZ
-      if (hqProc->tbInfo[0].tb != NULLP)
+   if (hqProc->tbInfo[0].tb != NULLP)
 #else
       /* If numLch is non zero means HQ Proc is busy*/
       if (hqProc->tbInfo[0].tb.tbPres)
 #endif
       {
-         /* datReq discarded. Generate an alarm */
-         rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_HARQ); 
-         rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
-               LRG_CAUSE_HQ_PROC_BUSY, &dgn);
-         return RFAILED;
+        /* datReq discarded. Generate an alarm */
+        rgFillDgnParams(inst,&dgn, LRG_USTA_DGNVAL_HARQ); 
+        rgLMMStaInd(inst,LCM_CATEGORY_PROTOCOL, LCM_EVENT_UI_INV_EVT,
+              LRG_CAUSE_HQ_PROC_BUSY, &dgn);
+        return RFAILED;
       }
 
    bldPdu.datReq    =  datReq;
@@ -763,11 +760,11 @@ RgErrInfo      *err
 
    if(rgMUXBldPdu(inst,&bldPdu, &(hqProc->tbInfo[0].tb), err) != ROK)
    {
-      RLOG1(L_ERROR, "MUXing failed for:  MacInst %d", inst); 
-      RLOG4(L_ERROR, "MUXing failed for: time: %d/%d\
-               procId %d ueId %d", hqProc->tbInfo[0].timingInfo.sfn,
-            hqProc->tbInfo[0].timingInfo.slot, hqProc->procId, 
-            hqProc->tbInfo[0].pdcch.rnti);
+      DU_LOG("\nERROR  -->  MAC : MUXing failed for:  MacInst %d", inst); 
+      DU_LOG("\nERROR  -->  MAC : MUXing failed for: time: %d/%d\
+           procId %d ueId %d", hqProc->tbInfo[0].timingInfo.sfn,
+           hqProc->tbInfo[0].timingInfo.slot, hqProc->procId, 
+           hqProc->tbInfo[0].pdcch.rnti);
 
       RG_FREE_MSG(datReq->pdu);
       return RFAILED;
@@ -798,14 +795,14 @@ RgErrInfo      *err
  *      -# ROK 
  *      -# RFAILED 
  **/
- RgUeCb  *gUe =NULLP;
-S16 rgDHMSndConsolidatedStaInd
+RgUeCb  *gUe =NULLP;
+   S16 rgDHMSndConsolidatedStaInd
 (
-RgCellCb        *cell,
-RgInfUeInfo     *ueInfo,
-CmLteTimingInfo timingInfo,
-RgErrInfo       *err
-)
+ RgCellCb        *cell,
+ RgInfUeInfo     *ueInfo,
+ CmLteTimingInfo timingInfo,
+ RgErrInfo       *err
+ )
 {
    SuId            rguDlSpId;/*need to use spID instead of suID*/
    uint8_t         idx;
@@ -814,7 +811,7 @@ RgErrInfo       *err
    uint8_t         tbIndex=0,idx1;
    RgDlSf          *dlSf = &cell->subFrms[(timingInfo.slot % RG_NUM_SUB_FRAMES)];
    Inst            inst = cell->macInst - RG_INST_START;
-//   Bool            isDStaReqrd = FALSE;
+   //   Bool            isDStaReqrd = FALSE;
    RgRguDedStaInd  *dStaInd[rgCb[inst].numRguSaps] ;
    RgUpSapCb      *rguDlSap[rgCb[inst].numRguSaps];
 
@@ -842,15 +839,15 @@ RgErrInfo       *err
 #endif
       if((ue=rgDBMGetUeCb (cell, ueInfo->allocInfo[ueIdx].rnti)) == NULLP)
       {
-         /* Check in RachLst */
-         if((ue=rgDBMGetUeCbFromRachLst (cell, 
-                     ueInfo->allocInfo[ueIdx].rnti)) == NULLP)
-         {
-            RLOG_ARG1(L_ERROR,DBG_CELLID,cell->cellId,"CRNTI:%d No ueCb found", 
-                      ueInfo->allocInfo[ueIdx].rnti);
-            /*Fix: If one UE is not present dont return, look for the next.*/
-            continue;
-         }
+        /* Check in RachLst */
+        if((ue=rgDBMGetUeCbFromRachLst (cell, 
+                    ueInfo->allocInfo[ueIdx].rnti)) == NULLP)
+        {
+           DU_LOG("\nERROR  -->  MAC : CRNTI:%d No ueCb found", 
+                 ueInfo->allocInfo[ueIdx].rnti);
+           /*Fix: If one UE is not present dont return, look for the next.*/
+           continue;
+        }
       }
 
 
@@ -861,260 +858,255 @@ RgErrInfo       *err
       /* Fix : syed Avoid sending data for a RETX
        * if initial TX data processing was unsuccessful */
       if((allocInfo->tbInfo[0].isReTx == TRUE) &&
-            (hqP->tbInfo[0].tbSz == 0)) 
+           (hqP->tbInfo[0].tbSz == 0)) 
       {
-         RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,
-               "CRNTI:%d RETX hqP(%d) tb(0) for a failed New Tx", 
-                  allocInfo->rnti, hqP->procId);        
-         continue;
+        DU_LOG("\nERROR  -->  MAC : CRNTI:%d RETX hqP(%d) tb(0) for a failed New Tx", 
+              allocInfo->rnti, hqP->procId);        
+        continue;
       }
       if((allocInfo->tbInfo[1].isReTx == TRUE) &&
-            (hqP->tbInfo[1].tbSz == 0)) 
+           (hqP->tbInfo[1].tbSz == 0)) 
       {
-         RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId,
-                   "CRNTI:%d RETX hqP(%d) tb(1) for a failed New Tx", 
-                  allocInfo->rnti, hqP->procId);        
-         continue;
+        DU_LOG("\nERROR  -->  MAC : CRNTI:%d RETX hqP(%d) tb(1) for a failed New Tx", 
+              allocInfo->rnti, hqP->procId);        
+        continue;
       }
 
       if(ue->rguDlSap != NULLP)
       {
-          rguDlSpId = ue->rguDlSap->sapCfg.spId;
+        rguDlSpId = ue->rguDlSap->sapCfg.spId;
       }else
       {/* UeCb is from rachList */
-          rguDlSpId = cell->rguDlSap->sapCfg.spId;
+        rguDlSpId = cell->rguDlSap->sapCfg.spId;
       }
 
 
       for(idx=allocInfo->tbStrtIdx;((idx-allocInfo->tbStrtIdx) <\
-               allocInfo->nmbOfTBs); idx++)
+              allocInfo->nmbOfTBs); idx++)
       {
-         RguCStaIndInfo  *cStaInd;
+        RguCStaIndInfo  *cStaInd;
 #ifdef TFU_UPGRADE
-         /* LTE_ADV_FLAG_REMOVED_START */
-         hqP->tbInfo[idx].isEnbSFR = allocInfo->isEnbSFR;
-         /* update pA value */
-         hqP->tbInfo[idx].pa = allocInfo->pa;
-         /* LTE_ADV_FLAG_REMOVED_END */
+        /* LTE_ADV_FLAG_REMOVED_START */
+        hqP->tbInfo[idx].isEnbSFR = allocInfo->isEnbSFR;
+        /* update pA value */
+        hqP->tbInfo[idx].pa = allocInfo->pa;
+        /* LTE_ADV_FLAG_REMOVED_END */
 #endif
 
-         hqP->numOfTBs =  allocInfo->nmbOfTBs;
-         hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = (PTR)hqP;
-         hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sf = dlSf;
-         cmLListAdd2Tail(&dlSf->tbs,&(hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk));
-         /* Changes as part of performance testing*/
-         /*   hqP->numOfTBs++;*/
-         hqP->tbInfo[idx].doa = allocInfo->doa;
-         hqP->tbInfo[idx].txMode = allocInfo->txMode;
-         hqP->tbInfo[idx].puschRptUsd = allocInfo->puschRptUsd;
-         hqP->tbInfo[idx].puschPmiInfo = allocInfo->puschPmiInfo;
+        hqP->numOfTBs =  allocInfo->nmbOfTBs;
+        hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk.node = (PTR)hqP;
+        hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sf = dlSf;
+        cmLListAdd2Tail(&dlSf->tbs,&(hqP->tbInfo[idx].sfLnkInfo[dlSf->schdTime.slot % 2].sfLnk));
+        /* Changes as part of performance testing*/
+        /*   hqP->numOfTBs++;*/
+        hqP->tbInfo[idx].doa = allocInfo->doa;
+        hqP->tbInfo[idx].txMode = allocInfo->txMode;
+        hqP->tbInfo[idx].puschRptUsd = allocInfo->puschRptUsd;
+        hqP->tbInfo[idx].puschPmiInfo = allocInfo->puschPmiInfo;
 #ifdef LTEMAC_SPS
-         hqP->tbInfo[idx].pdcch.rnti = allocInfo->pdcchRnti;
+        hqP->tbInfo[idx].pdcch.rnti = allocInfo->pdcchRnti;
 #else
-         hqP->tbInfo[idx].pdcch.rnti = allocInfo->rnti;
+        hqP->tbInfo[idx].pdcch.rnti = allocInfo->rnti;
 #endif
-         if(allocInfo->tbInfo[idx].isReTx == TRUE)
-         {
-            hqP->tbInfo[idx].pdcch.dci = allocInfo->dciInfo;
-            continue;
-         }
-
-         hqP->tbInfo[idx].timingInfo = timingInfo;
-         hqP->tbInfo[idx].pdcch.dci = allocInfo->dciInfo;
+        if(allocInfo->tbInfo[idx].isReTx == TRUE)
+        {
+           hqP->tbInfo[idx].pdcch.dci = allocInfo->dciInfo;
+           continue;
+        }
+
+        hqP->tbInfo[idx].timingInfo = timingInfo;
+        hqP->tbInfo[idx].pdcch.dci = allocInfo->dciInfo;
 #ifndef L2_OPTMZ
-         RG_FREE_MSG(hqP->tbInfo[idx].tb);
+        RG_FREE_MSG(hqP->tbInfo[idx].tb);
 #else
-         /* L2 optimization for mUe/Tti: Pre-allocated mBuf pointers(macHdr, 
-          * macCes and MacPad) of harq TB need to be reset to db_base
-          */
-         tb = &(hqP->tbInfo[idx].tb);
-         if (tb->tbPres == TRUE)
-         {
-            RG_FREE_TB(tb);
-         }
+        /* L2 optimization for mUe/Tti: Pre-allocated mBuf pointers(macHdr, 
+         * macCes and MacPad) of harq TB need to be reset to db_base
+         */
+        tb = &(hqP->tbInfo[idx].tb);
+        if (tb->tbPres == TRUE)
+        {
+           RG_FREE_TB(tb);
+        }
 #endif
-         hqP->tbInfo[idx].tbSz = allocInfo->tbInfo[idx].schdTbSz; 
+        hqP->tbInfo[idx].tbSz = allocInfo->tbInfo[idx].schdTbSz; 
 
-         hqP->tbInfo[idx].schdTa.pres = allocInfo->tbInfo[idx].ta.pres;
-         hqP->tbInfo[idx].schdTa.val  = allocInfo->tbInfo[idx].ta.val;
+        hqP->tbInfo[idx].schdTa.pres = allocInfo->tbInfo[idx].ta.pres;
+        hqP->tbInfo[idx].schdTa.val  = allocInfo->tbInfo[idx].ta.val;
 
 #ifdef LTE_ADV
-         hqP->tbInfo[idx].sCellActCe.pres = allocInfo->tbInfo[idx].sCellActCe.pres;
-         hqP->tbInfo[idx].sCellActCe.val  = allocInfo->tbInfo[idx].sCellActCe.val;
+        hqP->tbInfo[idx].sCellActCe.pres = allocInfo->tbInfo[idx].sCellActCe.pres;
+        hqP->tbInfo[idx].sCellActCe.val  = allocInfo->tbInfo[idx].sCellActCe.val;
 #endif
 
 #ifdef LTE_ADV 
-         if(( hqPAdded == TRUE) || (ROK == rgLaaPushHqPToScellLst(allocInfo,cell,timingInfo)))
-         {
-            hqPAdded = TRUE;
-            continue;
-         }
+        if(( hqPAdded == TRUE) || (ROK == rgLaaPushHqPToScellLst(allocInfo,cell,timingInfo)))
+        {
+           hqPAdded = TRUE;
+           continue;
+        }
 #endif
-         if (allocInfo->tbInfo[idx].schdDat[0].lcId == RG_CCCH_LCID)        
-         {
+        if (allocInfo->tbInfo[idx].schdDat[0].lcId == RG_CCCH_LCID)        
+        {
 #ifndef L2_OPTMZ
-            RG_FREE_MSG(hqP->tbInfo[idx].tb);
+           RG_FREE_MSG(hqP->tbInfo[idx].tb);
 #else
-           /* L2 optimization for mUe/Tti: Pre-allocated mBuf pointers(macHdr, 
-            * macCes and MacPad) of harq TB need to be reset to db_base
-            */
-           tb = &(hqP->tbInfo[idx].tb);
-
-           if (tb->tbPres == TRUE)
-           {
-              RG_FREE_TB(tb);
-           }
+           /* L2 optimization for mUe/Tti: Pre-allocated mBuf pointers(macHdr, 
+            * macCes and MacPad) of harq TB need to be reset to db_base
+            */
+           tb = &(hqP->tbInfo[idx].tb);
+
+           if (tb->tbPres == TRUE)
+           {
+              RG_FREE_TB(tb);
+           }
 #endif
-            hqP->tbInfo[0].contResCe  = allocInfo->tbInfo[0].contResCe;
-            if(allocInfo->tbInfo[0].contResCe)
-            {
-               hqP->tbInfo[0].contResId = &ue->contResId;
-            }
-
-
-            if(allocInfo->tbInfo[idx].numSchLch == 0)
-            {
-               RLOG_ARG2(L_DEBUG,DBG_CELLID,cell->cellId,
-                        "UEID:%d MSG4 with only contResId hqP(%d)",
-                                       allocInfo->rnti,
-                       hqP->procId);
-               hqP->tbInfo[idx].numSchLch = 0;
-               continue;
-            }
-
-            /* Increamenting the tbIndex instead of
-               assigning it to constant */
-            tbIndex++;
-
-
-            hqP->tbInfo[idx].numSchLch = 1;
-            hqP->tbInfo[idx].schdData[0].lcId = 
-               allocInfo->tbInfo[idx].schdDat[0].lcId;
-            hqP->tbInfo[idx].schdData[0].schdSz = 
-               allocInfo->tbInfo[idx].schdDat[0].numBytes;
-
-           // if(cStaInd == NULLP)
-            {
-               if ((rgAllocShrablSBuf(inst,(Data**)&cStaInd, sizeof(RguCStaIndInfo))) != ROK)
-               {
-                  err->errType  = RGERR_DHM_SND_STA_IND;
-                  err->errCause = RG_DHM_MEM_ALLOC_FAIL;
-                  return RFAILED; 
-               }
-            }
-
-            idx1 = (hqP->procId << 2) | tbIndex;
-            
-            cStaInd->cellId    = cell->cellId;
-            cStaInd->rnti      = allocInfo->rnti;
-            cStaInd->lcId      = cell->dlCcchId;
-            cStaInd->transId   = (timingInfo.sfn << 16) | 
-                                 (timingInfo.slot << 8) | idx1;
-               /* ADD Changes for Downlink UE Timing Optimization */
+           hqP->tbInfo[0].contResCe  = allocInfo->tbInfo[0].contResCe;
+           if(allocInfo->tbInfo[0].contResCe)
+           {
+              hqP->tbInfo[0].contResId = &ue->contResId;
+           }
+
+
+           if(allocInfo->tbInfo[idx].numSchLch == 0)
+           {
+              DU_LOG("\nDEBUG  -->  MAC : UEID:%d MSG4 with only contResId hqP(%d)",
+                    allocInfo->rnti,
+                    hqP->procId);
+              hqP->tbInfo[idx].numSchLch = 0;
+              continue;
+           }
+
+           /* Increamenting the tbIndex instead of
+              assigning it to constant */
+           tbIndex++;
+
+
+           hqP->tbInfo[idx].numSchLch = 1;
+           hqP->tbInfo[idx].schdData[0].lcId = 
+              allocInfo->tbInfo[idx].schdDat[0].lcId;
+           hqP->tbInfo[idx].schdData[0].schdSz = 
+              allocInfo->tbInfo[idx].schdDat[0].numBytes;
+
+           // if(cStaInd == NULLP)
+           {
+              if ((rgAllocShrablSBuf(inst,(Data**)&cStaInd, sizeof(RguCStaIndInfo))) != ROK)
+              {
+                 err->errType  = RGERR_DHM_SND_STA_IND;
+                 err->errCause = RG_DHM_MEM_ALLOC_FAIL;
+                 return RFAILED; 
+              }
+           }
+
+           idx1 = (hqP->procId << 2) | tbIndex;
+
+           cStaInd->cellId    = cell->cellId;
+           cStaInd->rnti      = allocInfo->rnti;
+           cStaInd->lcId      = cell->dlCcchId;
+           cStaInd->transId   = (timingInfo.sfn << 16) | 
+              (timingInfo.slot << 8) | idx1;
+           /* ADD Changes for Downlink UE Timing Optimization */
 #ifdef LTEMAC_DLUE_TMGOPTMZ
-            dlSf->remDatReqCnt++;
+           dlSf->remDatReqCnt++;
 #endif
-            RLOG_ARG3(L_DEBUG,DBG_CELLID,cell->cellId,
-                              "RNTI:%d UE:MSG4 grant for CCCH hqP(%d) LCID:%d",
-                     allocInfo->rnti, 
-                     hqP->procId,
-                              cStaInd->lcId);       
-            /* Fix : syed Avoid return param for interface prim and
-             * proceed for other UEs. For the failed UE, MAC shall
-             * do padding. */
-            rgUIMSndCmnStaInd(cell->macInst,cell->rguDlSap,cStaInd);
-            break;
-         }
-         else
-         {
-            tbIndex+=idx+1;
+           DU_LOG("\nDEUBG  -->  MAC : RNTI:%d UE:MSG4 grant for CCCH hqP(%d) LCID:%d",
+                 allocInfo->rnti, 
+                 hqP->procId,
+                 cStaInd->lcId);       
+           /* Fix : syed Avoid return param for interface prim and
+            * proceed for other UEs. For the failed UE, MAC shall
+            * do padding. */
+           rgUIMSndCmnStaInd(cell->macInst,cell->rguDlSap,cStaInd);
+           break;
+        }
+        else
+        {
+           tbIndex+=idx+1;
 #ifndef L2_OPTMZ
-            RG_FREE_MSG(hqP->tbInfo[idx].tb);
+           RG_FREE_MSG(hqP->tbInfo[idx].tb);
 #else
-            /* L2 optimization for mUe/Tti: Pre-allocated mBuf pointers(macHdr, 
-             * macCes and MacPad) of harq TB need to be reset to db_base
-             */
-            tb = &(hqP->tbInfo[idx].tb);
-            if (tb->tbPres == TRUE)
-            {  
-               RG_FREE_TB(tb);
-            }
+           /* L2 optimization for mUe/Tti: Pre-allocated mBuf pointers(macHdr, 
+            * macCes and MacPad) of harq TB need to be reset to db_base
+            */
+           tb = &(hqP->tbInfo[idx].tb);
+           if (tb->tbPres == TRUE)
+           {  
+              RG_FREE_TB(tb);
+           }
 #endif
 
-            if((NULLP == dStaInd[rguDlSpId]) && (allocInfo->tbInfo[idx].numSchLch))
-            {
-               if ((rgAllocShrablSBuf (inst,(Data**)&dStaInd[rguDlSpId], sizeof(RguDStaIndInfo))) != ROK)
-               {
-                  err->errType  = RGERR_DHM_SND_STA_IND;
-                  err->errCause = RG_DHM_MEM_ALLOC_FAIL;
-                  /* Need to return as memory allocation will fail for other UEs also*/
-                  return RFAILED;
-               }
-               dStaInd[rguDlSpId]->nmbOfUeGrantPerTti = 0;
-               rguDlSap[rguDlSpId] = ue->rguDlSap;
-               activeSapCnt++;
-            }
-
-            for (lcIdx = 0; 
-                  lcIdx < allocInfo->tbInfo[idx].numSchLch; lcIdx++)
-            {
-               hqP->tbInfo[idx].schdData[lcIdx].lcId = 
-                  allocInfo->tbInfo[idx].schdDat[lcIdx].lcId;
-               if (hqP->tbInfo[idx].schdData[lcIdx].lcId == 0)
-               {
-                  RLOG_ARG2(L_ERROR,DBG_CELLID,cell->cellId, 
-                        "CCCH grant in DStaInd for LCID:%d CRNTI:%d",
-                        hqP->tbInfo[idx].schdData[lcIdx].lcId,allocInfo->rnti);
-               }
-               hqP->tbInfo[idx].schdData[lcIdx].schdSz = 
-                  allocInfo->tbInfo[idx].schdDat[lcIdx].numBytes;
-               if(dStaInd[rguDlSpId])
-               {
-                  dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].\
-                  lchStaInd[lcIdx].lcId = allocInfo->tbInfo[idx].\
-                  schdDat[lcIdx].lcId;
-                  dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].\
-                  lchStaInd[lcIdx].totBufSize = allocInfo->tbInfo[idx].\
-                  schdDat[lcIdx].numBytes;
-               }
-
-               lchBufSize+=allocInfo->tbInfo[idx].schdDat[lcIdx].numBytes;
-            }
-            hqP->tbInfo[idx].numSchLch = 
-               allocInfo->tbInfo[idx].numSchLch;
-            if(dStaInd[rguDlSpId])
-            {
-               dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].nmbLch =
-                  allocInfo->tbInfo[idx].numSchLch;
+           if((NULLP == dStaInd[rguDlSpId]) && (allocInfo->tbInfo[idx].numSchLch))
+           {
+              if ((rgAllocShrablSBuf (inst,(Data**)&dStaInd[rguDlSpId], sizeof(RguDStaIndInfo))) != ROK)
+              {
+                 err->errType  = RGERR_DHM_SND_STA_IND;
+                 err->errCause = RG_DHM_MEM_ALLOC_FAIL;
+                 /* Need to return as memory allocation will fail for other UEs also*/
+                 return RFAILED;
+              }
+              dStaInd[rguDlSpId]->nmbOfUeGrantPerTti = 0;
+              rguDlSap[rguDlSpId] = ue->rguDlSap;
+              activeSapCnt++;
+           }
+
+           for (lcIdx = 0; 
+                 lcIdx < allocInfo->tbInfo[idx].numSchLch; lcIdx++)
+           {
+              hqP->tbInfo[idx].schdData[lcIdx].lcId = 
+                 allocInfo->tbInfo[idx].schdDat[lcIdx].lcId;
+              if (hqP->tbInfo[idx].schdData[lcIdx].lcId == 0)
+              {
+                 DU_LOG("\nERROR  -->  MAC : CCCH grant in DStaInd for LCID:%d CRNTI:%d",
+                       hqP->tbInfo[idx].schdData[lcIdx].lcId,allocInfo->rnti);
+              }
+              hqP->tbInfo[idx].schdData[lcIdx].schdSz = 
+                 allocInfo->tbInfo[idx].schdDat[lcIdx].numBytes;
+              if(dStaInd[rguDlSpId])
+              {
+                 dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].\
+                    lchStaInd[lcIdx].lcId = allocInfo->tbInfo[idx].\
+                    schdDat[lcIdx].lcId;
+                 dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].\
+                    lchStaInd[lcIdx].totBufSize = allocInfo->tbInfo[idx].\
+                    schdDat[lcIdx].numBytes;
+              }
+
+              lchBufSize+=allocInfo->tbInfo[idx].schdDat[lcIdx].numBytes;
+           }
+           hqP->tbInfo[idx].numSchLch = 
+              allocInfo->tbInfo[idx].numSchLch;
+           if(dStaInd[rguDlSpId])
+           {
+              dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].nmbLch =
+                 allocInfo->tbInfo[idx].numSchLch;
 #ifdef LTE_L2_MEAS
-               dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].tbId =
-                  hqP->tbId[idx]; 
+              dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].staIndTb[idx].tbId =
+                 hqP->tbId[idx]; 
 #endif
-            }
-            lchBufSize=0;
-         }
+           }
+           lchBufSize=0;
+        }
       }
       //if((dStaInd) && (tbIndex) && (isDStaReqrd == TRUE))
       if((dStaInd[rguDlSpId]) && (tbIndex))
       {
-         idx1 = (hqP->procId << 2) | tbIndex;
-         /* Create RguDStaInd struct and send to UIM */
-         dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].rnti    = allocInfo->rnti;
-         /*
-            dStaInd->transId = (hqP->timingInfo.sfn << 16) | 
-            (hqP->timingInfo.slot << 8) | hqP->procId;
-          */
-         dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].transId = (timingInfo.sfn << 16) | 
-            (timingInfo.slot << 8) | idx1;
-         dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].nmbOfTbs = hqP->numOfTBs;
+        idx1 = (hqP->procId << 2) | tbIndex;
+        /* Create RguDStaInd struct and send to UIM */
+        dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].rnti    = allocInfo->rnti;
+        /*
+           dStaInd->transId = (hqP->timingInfo.sfn << 16) | 
+           (hqP->timingInfo.slot << 8) | hqP->procId;
+         */
+        dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].transId = (timingInfo.sfn << 16) | 
+           (timingInfo.slot << 8) | idx1;
+        dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].nmbOfTbs = hqP->numOfTBs;
 #ifdef LTE_ADV
-         dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].fillCtrlPdu = allocInfo->fillCtrlPdu;
+        dStaInd[rguDlSpId]->staInd[dStaInd[rguDlSpId]->nmbOfUeGrantPerTti].fillCtrlPdu = allocInfo->fillCtrlPdu;
 #endif        
-         /*increment num of UE as staInd is prepared for it */
-         dStaInd[rguDlSpId]->nmbOfUeGrantPerTti++;
-         /* ADD Changes for Downlink UE Timing Optimization */
+        /*increment num of UE as staInd is prepared for it */
+        dStaInd[rguDlSpId]->nmbOfUeGrantPerTti++;
+        /* ADD Changes for Downlink UE Timing Optimization */
 #ifdef LTEMAC_DLUE_TMGOPTMZ
-         dlSf->remDatReqCnt++;
+        dlSf->remDatReqCnt++;
 #endif
       }
       //isDStaReqrd = FALSE;
@@ -1125,15 +1117,15 @@ RgErrInfo       *err
    {
       if(dStaInd[idx] != NULLP)
       {
-         dStaInd[idx]->cellId  = cell->cellId;
-         /* Fix : syed Avoid return param for interface prim and
-          * proceed for other UEs. For the failed UE, MAC shall
-          * do padding. */
-         rgUIMSndDedStaInd(inst,rguDlSap[idx],dStaInd[idx]);
-   
-         staIndCnt++;
-         if(staIndCnt == activeSapCnt)
-            break;/* all valid staind are considered */
+        dStaInd[idx]->cellId  = cell->cellId;
+        /* Fix : syed Avoid return param for interface prim and
+         * proceed for other UEs. For the failed UE, MAC shall
+         * do padding. */
+        rgUIMSndDedStaInd(inst,rguDlSap[idx],dStaInd[idx]);
+
+        staIndCnt++;
+        if(staIndCnt == activeSapCnt)
+           break;/* all valid staind are considered */
       }
 
    }
@@ -1157,13 +1149,13 @@ RgErrInfo       *err
  *              None 
  **/
 //uint8_t crashFlag = 0;
-static Void rgDHMBldTfuDatReq
+   static Void rgDHMBldTfuDatReq
 (
-RgCellCb           *cellCb,
-RgDlSf             *dlSf,
-RgDlHqProcCb       *hqP,
-RgTfuDatReqPduInfo *datReq
-)
+ RgCellCb           *cellCb,
+ RgDlSf             *dlSf,
+ RgDlHqProcCb       *hqP,
+ RgTfuDatReqPduInfo *datReq
+ )
 {
 
 #ifndef L2_OPTMZ
@@ -1179,7 +1171,7 @@ RgTfuDatReqPduInfo *datReq
 #ifdef L2_OPTMZ
    uint32_t lchIdx, pduIdx;
 #endif
+
    datReq->nmbOfTBs = 0;
 #ifndef L2_OPTMZ
 #if !(!(defined TENB_ACC) && !(defined LTE_PAL_ENB))
@@ -1196,106 +1188,104 @@ RgTfuDatReqPduInfo *datReq
    datReq->mBuf[1] = 0;
 #endif    
 #endif
+
    for(i=0;i<RG_MAX_TB_PER_UE;i++)
    {
 #ifndef L2_OPTMZ
       if ((hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf) &&
-          (hqP->tbInfo[i].tb != NULLP))
+           (hqP->tbInfo[i].tb != NULLP))
 #else
-      if ((hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf) &&
-           RgUtlIsTbMuxed(&(hqP->tbInfo[i].tb)))
+        if ((hqP->tbInfo[i].sfLnkInfo[dlSf->schdTime.slot % 2].sf == dlSf) &&
+              RgUtlIsTbMuxed(&(hqP->tbInfo[i].tb)))
 #endif
-      {
-
-         datReq->rnti           =  hqP->tbInfo[i].pdcch.rnti;
-         datReq->dciInfo        =  hqP->tbInfo[i].pdcch.dci;
-         datReq->doa            =  hqP->tbInfo[i].doa;
-         datReq->transMode      =  hqP->tbInfo[i].txMode;
-         datReq->puschRptUsd    =  hqP->tbInfo[i].puschRptUsd;
-         datReq->puschPmiInfo   =  hqP->tbInfo[i].puschPmiInfo;
-         /*MS_WORKAROUND  for ccpu00123904*/
-         if (hqP->tbInfo[i].schdTa.pres)
-         {
-            datReq->isTApres       =  TRUE; 
-         }
+        {
+
+           datReq->rnti           =  hqP->tbInfo[i].pdcch.rnti;
+           datReq->dciInfo        =  hqP->tbInfo[i].pdcch.dci;
+           datReq->doa            =  hqP->tbInfo[i].doa;
+           datReq->transMode      =  hqP->tbInfo[i].txMode;
+           datReq->puschRptUsd    =  hqP->tbInfo[i].puschRptUsd;
+           datReq->puschPmiInfo   =  hqP->tbInfo[i].puschPmiInfo;
+           /*MS_WORKAROUND  for ccpu00123904*/
+           if (hqP->tbInfo[i].schdTa.pres)
+           {
+              datReq->isTApres       =  TRUE; 
+           }
 #ifdef   TFU_UPGRADE
-         /* update pA value */
-         datReq->pa             =  hqP->tbInfo[i].pa;
+           /* update pA value */
+           datReq->pa             =  hqP->tbInfo[i].pa;
 #endif
-         /* LTE_ADV_FLAG_REMOVED_START */
-         datReq->isEnbSFR       =  hqP->tbInfo[i].isEnbSFR;
-         /* LTE_ADV_FLAG_REMOVED_END */
+           /* LTE_ADV_FLAG_REMOVED_START */
+           datReq->isEnbSFR       =  hqP->tbInfo[i].isEnbSFR;
+           /* LTE_ADV_FLAG_REMOVED_END */
 #ifndef L2_OPTMZ
 #if (!(defined TENB_ACC) && !(defined LTE_PAL_ENB))  /* ABHI */ /* This is only temp fix. It needs to be removed
-                                after rebasing to MAC CCB */
+                                                                  after rebasing to MAC CCB */
 #ifdef BRDCM
-         datReq->mBuf[i] = hqP->tbInfo[i].tb;
+           datReq->mBuf[i] = hqP->tbInfo[i].tb;
 #else
-         /* Intel Tdd- Commenting out the Optimization for direct Access of 
-          * mBuf Index */
-         /*Proper clean-up needed as this needs long stability tests
-          * in all SoCs*/
+           /* Intel Tdd- Commenting out the Optimization for direct Access of 
+            * mBuf Index */
+           /*Proper clean-up needed as this needs long stability tests
+            * in all SoCs*/
 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
-         SIncMsgRef(hqP->tbInfo[i].tb, RG_GET_MEM_REGION(rgCb[inst]),
-               RG_GET_MEM_POOL(rgCb[inst]), &datReq->mBuf[i]); 
+           SIncMsgRef(hqP->tbInfo[i].tb, RG_GET_MEM_REGION(rgCb[inst]),
+                 RG_GET_MEM_POOL(rgCb[inst]), &datReq->mBuf[i]); 
 #else
-         datReq->mBuf[i] = hqP->tbInfo[i].tb;
+           datReq->mBuf[i] = hqP->tbInfo[i].tb;
 #endif
 #endif/*BRDCM*/
 #else
-         SIncMsgRef(hqP->tbInfo[i].tb, RG_GET_MEM_REGION(rgCb[inst]),
-               RG_GET_MEM_POOL(rgCb[inst]), &datReq->mBuf[i]);
+           SIncMsgRef(hqP->tbInfo[i].tb, RG_GET_MEM_REGION(rgCb[inst]),
+                 RG_GET_MEM_POOL(rgCb[inst]), &datReq->mBuf[i]);
 #endif
-         {
-            MsgLen   dbgBufLen;
-            if(SFndLenMsg(datReq->mBuf[i], &dbgBufLen))
-            {
-               if(dbgBufLen == 0)
-               {              
-                  RLOG_ARG4(L_ERROR,DBG_CELLID,cellCb->cellId,
-                                         "RNTI:%d SFN:%d slot:%d tbIdx:%d Sdu Length 0 ",
-                             datReq->rnti,
-                                     hqP->tbInfo[i].timingInfo.sfn,
-                                         hqP->tbInfo[i].timingInfo.slot,i);
-                  RLOG_ARG3(L_ERROR,DBG_CELLID,cellCb->cellId,
-                             "taPres [%d] numOfTbs [%d] format[%d]",
-                             datReq->isTApres, 
-                           hqP->numOfTBs, 
-                           datReq->dciInfo.format);  
-               }              
-            }  
-         }
+           {
+              MsgLen   dbgBufLen;
+              if(SFndLenMsg(datReq->mBuf[i], &dbgBufLen))
+              {
+                 if(dbgBufLen == 0)
+                 {              
+                    DU_LOG("\nERROR  -->  MAC : RNTI:%d SFN:%d slot:%d tbIdx:%d Sdu Length 0 ",
+                          datReq->rnti,
+                          hqP->tbInfo[i].timingInfo.sfn,
+                          hqP->tbInfo[i].timingInfo.slot,i);
+                    DU_LOG("\nERROR  -->  MAC : taPres [%d] numOfTbs [%d] format[%d]",
+                          datReq->isTApres, 
+                          hqP->numOfTBs, 
+                          datReq->dciInfo.format);  
+                 }              
+              }  
+           }
 #else
-         /* L2 optimization for mUe/Tti: Removing SIncMsgRef to avoid additional
-          * mBuf allocation. MAC header, MAC Ces, MAC PDU per LCH per TB Per UE
-          * and MAC padding Mbufs are being sent to CL. Populating these Ptrs
-          * From TB Info to TfuDatReq
-          */
-         datReq->tbInfo[i].tbPres =  TRUE;
-         datReq->tbInfo[i].tbSize =  hqP->tbInfo[i].tbSz;
-         datReq->tbInfo[i].macHdr =  hqP->tbInfo[i].tb.macHdr;
-         datReq->tbInfo[i].macCes =  hqP->tbInfo[i].tb.macCes;
-         datReq->tbInfo[i].numLch =  hqP->tbInfo[i].tb.numLch;
-         for(lchIdx = 0; lchIdx < hqP->tbInfo[i].tb.numLch; lchIdx++)
-         {
-            datReq->tbInfo[i].lchInfo[lchIdx].numPdu = hqP->tbInfo[i].tb.\
-                                                       lchInfo[lchIdx].numPdu;
-            for(pduIdx = 0; pduIdx < hqP->tbInfo[i].tb.lchInfo[lchIdx].numPdu;\
-                  pduIdx++)
-            {
-               datReq->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] =
-                  hqP->tbInfo[i].tb.lchInfo[lchIdx].mBuf[pduIdx];
-            }
-         }
-        // datReq->tbInfo[i].macPad  =  hqP->tbInfo[i].tb.macPad;
-         datReq->tbInfo[i].padSize =  hqP->tbInfo[i].tb.padSize;
-        // prc_trace_format_string(0x40,3,"TfuDatReq:RNTI=%d TbIdx=%d TbSize=%d PdSz=(%d) macHdraddr: (%p) macCEAddr: (%p) noLch=(%d)",datReq->rnti, i,
-          //     hqP->tbInfo[i].tbSz, datReq->tbInfo[i].padSize, datReq->tbInfo[i].macHdr, datReq->tbInfo[i].macCes, datReq->tbInfo[i].numLch);
+           /* L2 optimization for mUe/Tti: Removing SIncMsgRef to avoid additional
+            * mBuf allocation. MAC header, MAC Ces, MAC PDU per LCH per TB Per UE
+            * and MAC padding Mbufs are being sent to CL. Populating these Ptrs
+            * From TB Info to TfuDatReq
+            */
+           datReq->tbInfo[i].tbPres =  TRUE;
+           datReq->tbInfo[i].tbSize =  hqP->tbInfo[i].tbSz;
+           datReq->tbInfo[i].macHdr =  hqP->tbInfo[i].tb.macHdr;
+           datReq->tbInfo[i].macCes =  hqP->tbInfo[i].tb.macCes;
+           datReq->tbInfo[i].numLch =  hqP->tbInfo[i].tb.numLch;
+           for(lchIdx = 0; lchIdx < hqP->tbInfo[i].tb.numLch; lchIdx++)
+           {
+              datReq->tbInfo[i].lchInfo[lchIdx].numPdu = hqP->tbInfo[i].tb.\
+                                                         lchInfo[lchIdx].numPdu;
+              for(pduIdx = 0; pduIdx < hqP->tbInfo[i].tb.lchInfo[lchIdx].numPdu;\
+                    pduIdx++)
+              {
+                 datReq->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] =
+                    hqP->tbInfo[i].tb.lchInfo[lchIdx].mBuf[pduIdx];
+              }
+           }
+           // datReq->tbInfo[i].macPad  =  hqP->tbInfo[i].tb.macPad;
+           datReq->tbInfo[i].padSize =  hqP->tbInfo[i].tb.padSize;
+           // prc_trace_format_string(0x40,3,"TfuDatReq:RNTI=%d TbIdx=%d TbSize=%d PdSz=(%d) macHdraddr: (%p) macCEAddr: (%p) noLch=(%d)",datReq->rnti, i,
+           //     hqP->tbInfo[i].tbSz, datReq->tbInfo[i].padSize, datReq->tbInfo[i].macHdr, datReq->tbInfo[i].macCes, datReq->tbInfo[i].numLch);
 
 #endif
-         datReq->nmbOfTBs++;
-      }
+           datReq->nmbOfTBs++;
+        }
    }
    return;
 }  /* rgDHMBldTfuDatReq */
@@ -1324,7 +1314,7 @@ S16 rgDHMFreeHqProcTB(RgDlHqProcCb *hqP, uint8_t tbIndex)
    uint8_t               idx;
 
    if((tbIndex > RG_MAX_TB_PER_UE) ||
-      (tbIndex == 0))
+        (tbIndex == 0))
    {
       return RFAILED;
    }
@@ -1336,12 +1326,12 @@ S16 rgDHMFreeHqProcTB(RgDlHqProcCb *hqP, uint8_t tbIndex)
    for(idx = 0; idx < 2; idx++)
    {
       if (hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk.node != NULLP)
-   {
-         cmLListDelFrm(&hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sf->tbs,
-               &(hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk));
-         hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk.node  = (PTR)NULLP;
-      printf("\nrgDHMFreeHqProcTB:: hqP %p \n", (Void *)hqP);
-   }
+      {
+        cmLListDelFrm(&hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sf->tbs,
+              &(hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk));
+        hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sfLnk.node  = (PTR)NULLP;
+        DU_LOG("\nINFO  -->  MAC : rgDHMFreeHqProcTB:: hqP %p \n", (Void *)hqP);
+      }
       hqP->tbInfo[tbIndex-1].sfLnkInfo[idx].sf = NULLP;
    }
    return ROK;
@@ -1375,21 +1365,21 @@ Void rgDHMFreeUe(Inst  inst, RgDlHqEnt *hqE)
       for (i=0; i < hqE->numHqProcs; i++)
       {
 #ifndef L2_OPTMZ
-         rgDHMRlsHqProcTB(rgCb[inst].cell, hqE->procs[i], 1);
-         rgDHMRlsHqProcTB(rgCb[inst].cell, hqE->procs[i], 2);
+        rgDHMRlsHqProcTB(rgCb[inst].cell, hqE->procs[i], 1);
+        rgDHMRlsHqProcTB(rgCb[inst].cell, hqE->procs[i], 2);
 #else
-         rgDHMFreeHqProcTB(hqE->procs[i], 1);
-         rgDHMFreeHqProcTB(hqE->procs[i], 2);
+        rgDHMFreeHqProcTB(hqE->procs[i], 1);
+        rgDHMFreeHqProcTB(hqE->procs[i], 2);
 #endif
-         
-         rgFreeSBuf(inst,(Data **)&(hqE->procs[i]), sizeof(RgDlHqProcCb));
+
+        rgFreeSBuf(inst,(Data **)&(hqE->procs[i]), sizeof(RgDlHqProcCb));
 #ifdef LTE_ADV
-         rgDHMFreeSavedHqP(inst,hqE,i);
+        rgDHMFreeSavedHqP(inst,hqE,i);
 #endif
       }
 
       /*ccpu00117052 - MOD - Passing double pointer for proper NULLP
-                            assignment */
+       assignment */
    }
 
    return;
@@ -1421,17 +1411,17 @@ S16 RgSchMacRstHqEntReq(Pst* pst, RgInfResetHqEnt* hqEntInfo)
    inst = pst->dstInst - RG_INST_START;
 
    if (((cell = rgCb[inst].cell) == NULLP) ||
-       (rgCb[inst].cell->cellId != hqEntInfo->cellId))
+        (rgCb[inst].cell->cellId != hqEntInfo->cellId))
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), "For user [%d]Cell does not exist %d\n",
-                hqEntInfo->crnti,hqEntInfo->cellId));
+      DU_LOG("\nERROR  -->  MAC : For user [%d]Cell does not exist %d\n",
+           hqEntInfo->crnti,hqEntInfo->cellId);
       return RFAILED;
    }
 
    if ((ue = rgDBMGetUeCb(cell, hqEntInfo->crnti)) == NULLP)
    {
-      RGDBGERRNEW(inst,(rgPBuf(inst), "[%d]UE does not exist for this hqEntInfo\n",
-                       hqEntInfo->crnti));
+      DU_LOG("\nERROR  -->  MAC : [%d]UE does not exist for this hqEntInfo\n",
+           hqEntInfo->crnti);
       return RFAILED;
    }
 
@@ -1473,7 +1463,7 @@ S16 RgSchMacRlsHqReq(Pst *pst, RgInfRlsHqInfo *rlshqUeInfo)
    Bool              isValidTbId = FALSE;
 #endif
    uint32_t        startTime=0;
-   
+
    RG_IS_INST_VALID(pst->dstInst);
    inst = pst->dstInst - RG_INST_START;
    cell  = rgCb[inst].cell;
@@ -1486,11 +1476,10 @@ S16 RgSchMacRlsHqReq(Pst *pst, RgInfRlsHqInfo *rlshqUeInfo)
    }
 
    if((cell  == NULLP)
-      ||( cell->cellId != rlshqUeInfo->cellId))
+        ||( cell->cellId != rlshqUeInfo->cellId))
    {
-       
-      RLOG_ARG0(L_ERROR,DBG_CELLID,rlshqUeInfo->cellId,
-                "No cellCb found with cellId");
+
+      DU_LOG("\nERROR  -->  MAC : No cellCb found with cellId");
       return RFAILED;
    }
 
@@ -1503,35 +1492,36 @@ S16 RgSchMacRlsHqReq(Pst *pst, RgInfRlsHqInfo *rlshqUeInfo)
    {
       if((ue=rgDBMGetUeCb (cell, rlshqUeInfo->ueHqInfo[idx1].rnti)) == NULLP)
       {
-         /* Check in RachLst */
-         if((ue=rgDBMGetUeCbFromRachLst (cell, 
-                     rlshqUeInfo->ueHqInfo[idx1].rnti)) == NULLP)
-         {
-            RLOG_ARG1(L_ERROR,DBG_CELLID,rlshqUeInfo->cellId, "CRNTI:%d No ueCb found",
-                     rlshqUeInfo->ueHqInfo[idx1].rnti);
-            continue;
-         }
+        /* Check in RachLst */
+        if((ue=rgDBMGetUeCbFromRachLst (cell, 
+                    rlshqUeInfo->ueHqInfo[idx1].rnti)) == NULLP)
+        {
+           DU_LOG("\nERROR  -->  MAC : CRNTI:%d No ueCb found",
+                 rlshqUeInfo->ueHqInfo[idx1].rnti);
+           continue;
+        }
       }
 #ifdef LTE_ADV
 #ifdef LAA_DBG
-     if ((rlshqUeInfo->ueHqInfo[idx1].rlsOperationType && !gSaveVal) || (rlshqUeInfo->ueHqInfo[idx1].hqProcId > 8))
+      if ((rlshqUeInfo->ueHqInfo[idx1].rlsOperationType && !gSaveVal) || (rlshqUeInfo->ueHqInfo[idx1].hqProcId > 8))
       {
-         int *p = NULL;
-         RLOG_ARG1(L_INFO," SPURIOUS CALLL !!!! procId %d \n", rlshqUeInfo->ueHqInfo[idx1].hqProcId);
-
-
-       printf ("RgSchMacRlsHqReq cell %d : numUes %d idx %d rnti %d hqProc %d numTbs %d tbid[0] %d tbid[1] %d rlsopr %d \n",
-      cell->cellId,
-       rlshqUeInfo->numUes,
-       idx1,
-       rlshqUeInfo->ueHqInfo[idx1].rnti,
-       rlshqUeInfo->ueHqInfo[idx1].hqProcId,
-       rlshqUeInfo->ueHqInfo[idx1].numOfTBs,
-       rlshqUeInfo->ueHqInfo[idx1].tbId[0],
-       rlshqUeInfo->ueHqInfo[idx1].tbId[1],
-       rlshqUeInfo->ueHqInfo[idx1].rlsOperationType);
-      
-         *p = 10; 
+        int *p = NULL;
+        DU_LOG("\nINFO  -->  MAC :  SPURIOUS CALLL !!!! procId %d \n", rlshqUeInfo->ueHqInfo[idx1].hqProcId);
+
+
+        DU_LOG("\nINFO  -->  MAC : RgSchMacRlsHqReq cell %d : numUes %d idx %d rnti %d hqProc %d numTbsi\
+              %d tbid[0] %d tbid[1] %d rlsopr %d \n",
+              cell->cellId,
+              rlshqUeInfo->numUes,
+              idx1,
+              rlshqUeInfo->ueHqInfo[idx1].rnti,
+              rlshqUeInfo->ueHqInfo[idx1].hqProcId,
+              rlshqUeInfo->ueHqInfo[idx1].numOfTBs,
+              rlshqUeInfo->ueHqInfo[idx1].tbId[0],
+              rlshqUeInfo->ueHqInfo[idx1].tbId[1],
+              rlshqUeInfo->ueHqInfo[idx1].rlsOperationType);
+
+        *p = 10; 
       }
 #endif
       gSaveVal = 0;
@@ -1541,17 +1531,17 @@ S16 RgSchMacRlsHqReq(Pst *pst, RgInfRlsHqInfo *rlshqUeInfo)
 
       if (RGINF_RLS_HQ_DEL_TB == rlshqUeInfo->ueHqInfo[idx1].rlsOperationType)
       {
-         /* If REQ is to DEL the saved TBs no need to free the HqP as it's already
-            freed up earlier */
-         continue;
+        /* If REQ is to DEL the saved TBs no need to free the HqP as it's already
+           freed up earlier */
+        continue;
       }
 #endif /* LTE_ADV */
       rgDHMGetHqProcFrmId(ue,rlshqUeInfo->ueHqInfo[idx1].hqProcId,&hqP);
       if(rlshqUeInfo->ueHqInfo[idx1].status[0] != TRUE)
       {
-         rgCb[inst].genSts.numHarqFail++;
+        rgCb[inst].genSts.numHarqFail++;
       }
-     
+
 #ifdef LTE_L2_MEAS
       hqStaInd.cellId = cell->cellId;
       hqStaInd.ueId = rlshqUeInfo->ueHqInfo[idx1].rnti;
@@ -1561,44 +1551,43 @@ S16 RgSchMacRlsHqReq(Pst *pst, RgInfRlsHqInfo *rlshqUeInfo)
       for(idx2=0; idx2 < rlshqUeInfo->ueHqInfo[idx1].numOfTBs; idx2++)
       {
 #ifdef LTE_L2_MEAS
-         /* Fill the hq sta Ind stucture. Need to send the Status Ind for only
-          those TBID's reported by Scheduler*/
-            tbId = rlshqUeInfo->ueHqInfo[idx1].tbId[idx2];
-            if (hqP->tbId[tbId-1] != RGU_INVALID_TBID)
-            {
-            /* Fill the correct Sn Map corresponding to the TBID */
-            hqStaInd.tbId[idx2] = hqP->tbId[tbId-1];
-            hqStaInd.status[idx2] = rlshqUeInfo->ueHqInfo[idx1].status[idx2];
-               isValidTbId = TRUE;
-            }
+        /* Fill the hq sta Ind stucture. Need to send the Status Ind for only
+           those TBID's reported by Scheduler*/
+        tbId = rlshqUeInfo->ueHqInfo[idx1].tbId[idx2];
+        if (hqP->tbId[tbId-1] != RGU_INVALID_TBID)
+        {
+           /* Fill the correct Sn Map corresponding to the TBID */
+           hqStaInd.tbId[idx2] = hqP->tbId[tbId-1];
+           hqStaInd.status[idx2] = rlshqUeInfo->ueHqInfo[idx1].status[idx2];
+           isValidTbId = TRUE;
+        }
 #endif
-         if(rgDHMRlsHqProcTB(cell, hqP, 
-               rlshqUeInfo->ueHqInfo[idx1].tbId[idx2]) != ROK)
-         {
-            RLOG_ARG1(L_ERROR,DBG_CELLID,rlshqUeInfo->cellId,
-                  "CRNTI:%d Failure in releasing hq TB",
-                  rlshqUeInfo->ueHqInfo[idx1].rnti);
-            continue;
-         }
+        if(rgDHMRlsHqProcTB(cell, hqP, 
+                 rlshqUeInfo->ueHqInfo[idx1].tbId[idx2]) != ROK)
+        {
+           DU_LOG("\nERROR  -->  MAC : CRNTI:%d Failure in releasing hq TB",
+                 rlshqUeInfo->ueHqInfo[idx1].rnti);
+           continue;
+        }
       }
 
 #ifdef LTE_L2_MEAS
 
-         if (isValidTbId)
-         {
-            if(ue->rguDlSap)
-            {
-               RgUiRguHqStaInd(&(ue->rguDlSap->sapCfg.sapPst),
-                     ue->rguDlSap->sapCfg.suId,
-                     &hqStaInd);
-            }
-            else
-            {/* Ue is from rach list*/
-               RgUiRguHqStaInd(&(cell->rguDlSap->sapCfg.sapPst),
-                     cell->rguDlSap->sapCfg.suId,
-                     &hqStaInd);
-            }
-         }
+      if (isValidTbId)
+      {
+        if(ue->rguDlSap)
+        {
+           RgUiRguHqStaInd(&(ue->rguDlSap->sapCfg.sapPst),
+                 ue->rguDlSap->sapCfg.suId,
+                 &hqStaInd);
+        }
+        else
+        {/* Ue is from rach list*/
+           RgUiRguHqStaInd(&(cell->rguDlSap->sapCfg.sapPst),
+                 cell->rguDlSap->sapCfg.suId,
+                 &hqStaInd);
+        }
+      }
 #endif
    } /* end of ues loop */
 
@@ -1610,6 +1599,6 @@ S16 RgSchMacRlsHqReq(Pst *pst, RgInfRlsHqInfo *rlshqUeInfo)
 
 
 /**********************************************************************
-         End of file
-**********************************************************************/
+
+  End of file
+ **********************************************************************/
index f474bae..55d7080 100755 (executable)
@@ -32,9 +32,6 @@
 @brief This module handles de-multiplexing of the data recieved at MAC.
 */
 
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_FILE_ID=176;
-static int RLOG_MODULE_ID=4096;
 /* header include files -- defines (.h) */
 #include "common_def.h"
   
@@ -157,7 +154,7 @@ static S16 rgDUXInsSdu(Inst inst, RgMacPdu *pdu, RgMacSdu **sdu, uint8_t lcId, u
    RG_DUX_ALLOC(pdu, sizeof(RgMacSdu), sduAloc, ret);
    if(ret != ROK)
    {
-      RLOG1(L_ERROR, "Allocation of RgSubHdr failed for LCID:%d",lcId);
+      DU_LOG("\nERROR  -->  MAC : Allocation of RgSubHdr failed for LCID:%d",lcId);
       err->errCause = RGERR_DUX_MEM_EXHAUST;
       return RFAILED;
    }
@@ -198,7 +195,7 @@ static S16 rgDUXExtSubHdr(Inst inst, RgMacPdu *pdu, Buffer *mBuf, uint8_t *lcId,
    *len = 0;   
    if(oduPackUInt8(&byte,mBuf) != ROK)
    {
-      RLOG0(L_ERROR, "oduPackUInt8 failed");
+      DU_LOG("\nERROR  -->  MAC : oduPackUInt8 failed");
       err->errCause = RGERR_DUX_UNPACK_FAILURE;
       return RFAILED;
    }
@@ -211,7 +208,7 @@ static S16 rgDUXExtSubHdr(Inst inst, RgMacPdu *pdu, Buffer *mBuf, uint8_t *lcId,
       RG_EXT_FORMT_BIT(fmt,byte);
       if(oduPackUInt8(&byte, mBuf) != ROK)
       {
-         RLOG0(L_ERROR, "oduPackUInt8 failed");
+         DU_LOG("\nERROR  -->  MAC : oduPackUInt8 failed");
          err->errCause = RGERR_DUX_UNPACK_FAILURE;
          return RFAILED;
       }
@@ -220,7 +217,7 @@ static S16 rgDUXExtSubHdr(Inst inst, RgMacPdu *pdu, Buffer *mBuf, uint8_t *lcId,
       {
          if(oduPackUInt8(&byte,mBuf) != ROK)
          {
-            RLOG0(L_ERROR, "oduPackUInt8 failed");
+            DU_LOG("\nERROR  -->  MAC : oduPackUInt8 failed");
             err->errCause = RGERR_DUX_UNPACK_FAILURE;
             return RFAILED;
          }
@@ -272,7 +269,7 @@ RgErrInfo *err)
             RG_UNPACK_EXT_PHR_CI(&Ci,mBuf,ret);
             if(ret != ROK)
             {
-               RLOG1(L_ERROR,"Unpacking of EXT PHR failed LCID:%d",lcId);
+               DU_LOG("\nERROR  -->  MAC : Unpacking of EXT PHR failed LCID:%d",lcId);
                err->errCause = RGERR_DUX_UNPACK_FAILURE;
                return RFAILED;
             }
@@ -293,7 +290,7 @@ RgErrInfo *err)
                   RG_UNPACK_EXT_PHR(&extPhrOctet,mBuf,ret);
                   if(ret != ROK)
                   {
-                     RLOG1(L_ERROR,"Unpacking of EXT PHR failed LCID:%d",lcId);
+                     DU_LOG("\nERROR  -->  MAC : Unpacking of EXT PHR failed LCID:%d",lcId);
                      err->errCause = RGERR_DUX_UNPACK_FAILURE;
                      return RFAILED;
                   }
@@ -317,7 +314,7 @@ RgErrInfo *err)
                      RG_UNPACK_EXT_PHR(&extPhrPCmax,mBuf,ret);
                      if(ret != ROK)
                      {
-                        RLOG1(L_ERROR,"Unpacking of EXT PHR failed LCID:%d",lcId);
+                        DU_LOG("\nERROR  -->  MAC : Unpacking of EXT PHR failed LCID:%d",lcId);
                         err->errCause = RGERR_DUX_UNPACK_FAILURE;
                         return RFAILED;
                      }
@@ -337,7 +334,7 @@ RgErrInfo *err)
             RG_UNPACK_PHR(&ceInfo->ces.phr,mBuf,ret);
             if(ret != ROK)
             {
-               RLOG1(L_ERROR,"Unpacking of PHR failed LCID:%d",lcId);
+               DU_LOG("\nERROR  -->  MAC : Unpacking of PHR failed LCID:%d",lcId);
                err->errCause = RGERR_DUX_UNPACK_FAILURE;
                return RFAILED;
             }
@@ -349,7 +346,7 @@ RgErrInfo *err)
             RG_UNPACK_TRUNC_BSR(&ceInfo->ces.bsr.truncBsr,mBuf,ret);
             if(ret != ROK)
             {
-               RLOG1(L_ERROR,"Unpacking of Trunc BSR failed LCID:%d",lcId);
+               DU_LOG("\nERROR  -->  MAC : Unpacking of Trunc BSR failed LCID:%d",lcId);
                err->errCause = RGERR_DUX_UNPACK_FAILURE;
                return RFAILED;
             }
@@ -361,7 +358,7 @@ RgErrInfo *err)
             RG_UNPACK_SHORT_BSR(&ceInfo->ces.bsr.shortBsr,mBuf,ret);
             if(ret != ROK)
             {
-               RLOG1(L_ERROR,"Unpacking of Short BSR failed LCID:%d",lcId);
+               DU_LOG("\nERROR  -->  MAC : Unpacking of Short BSR failed LCID:%d",lcId);
                err->errCause = RGERR_DUX_UNPACK_FAILURE;
                return RFAILED;
             }
@@ -374,7 +371,7 @@ RgErrInfo *err)
             RG_UNPACK_LONG_BSR(longBsr,mBuf,ret);
             if(ret != ROK)
             {
-               RLOG1(L_ERROR,"Unpacking of Long BSR failed LCID:%d",lcId);
+               DU_LOG("\nERROR  -->  MAC : Unpacking of Long BSR failed LCID:%d",lcId);
                err->errCause = RGERR_DUX_UNPACK_FAILURE;
                return RFAILED;
             }
@@ -391,7 +388,7 @@ RgErrInfo *err)
             RG_UNPACK_CRNTI(&ceInfo->ces.cRnti,mBuf,ret);
             if(ret != ROK)
             {
-               RLOG1(L_ERROR,"Unpacking of C-RNTI failed LCID:%d",lcId);
+               DU_LOG("\nERROR  -->  MAC : Unpacking of C-RNTI failed LCID:%d",lcId);
                err->errCause = RGERR_DUX_UNPACK_FAILURE;
                return RFAILED;
             }
@@ -399,7 +396,7 @@ RgErrInfo *err)
          }
          break;
       default:
-         RLOG1(L_ERROR, "Invalid LCID:%u received",lcId); 
+         DU_LOG("\nERROR  -->  MAC : Invalid LCID:%u received",lcId); 
          err->errCause = RGERR_DUX_INV_LCID_RX;
          return RFAILED;
    }
@@ -456,7 +453,7 @@ RgErrInfo *err)
       if((ret != ROK) && (!((ret == ROKDNA) )))
       {
          RG_FREE_MSG(tmpBuf1);
-         RLOG0(L_ERROR,"SSegMsg failed");
+         DU_LOG("\nERROR  -->  MAC : SSegMsg failed");
          err->errCause = RGERR_DUX_RLC_PDU_CREAT_FAIL;
          return RFAILED;
       }
@@ -501,7 +498,7 @@ S16 rgDUXDemuxData(Inst inst, RgMacPdu  *pdu, RgInfCeInfo *ceInfo, Buffer **mBuf
 
    if(*mBuf == NULLP) 
    {
-      RLOG0(L_ERROR, "Null Buffer Recevived");
+      DU_LOG("\nERROR  -->  MAC : Null Buffer Recevived");
       return RFAILED;
    }
    do
@@ -513,7 +510,7 @@ S16 rgDUXDemuxData(Inst inst, RgMacPdu  *pdu, RgInfCeInfo *ceInfo, Buffer **mBuf
                &subPduLen, err) != ROK)
       {
          RG_FREE_MSG(*mBuf);         
-         RLOG0(L_ERROR, "Failed to extract pad sub headers");
+         DU_LOG("\nERROR  -->  MAC : Failed to extract pad sub headers");
          return RFAILED;
       }
       if(lcId == RG_PAD_LCID)
@@ -529,7 +526,7 @@ S16 rgDUXDemuxData(Inst inst, RgMacPdu  *pdu, RgInfCeInfo *ceInfo, Buffer **mBuf
             /* Fix : syed rgDUXExtSdu would have segmented mBuf and hence
              * will be responsible for freeing mBuf */
             *mBuf = NULLP;
-            RLOG0(L_ERROR, "failed to Extract the sdus");
+            DU_LOG("\nERROR  -->  MAC : failed to Extract the sdus");
             return RFAILED;
          }
          if(*mBuf == NULLP) /* if message read completes then return */
@@ -543,14 +540,14 @@ S16 rgDUXDemuxData(Inst inst, RgMacPdu  *pdu, RgInfCeInfo *ceInfo, Buffer **mBuf
          if(rgDUXExtCe(inst,pdu,ceInfo,*mBuf, lcId,subPduLen, err) != ROK)
          {
             RG_FREE_MSG(*mBuf);              
-            RLOG0(L_ERROR, " failed to Extract the ces");
+            DU_LOG("\nERROR  -->  MAC : failed to Extract the ces");
             return RFAILED;
          }
       }
       if(SFndLenMsg(*mBuf,&len) != ROK)
       {
          RG_FREE_MSG(*mBuf);
-         RLOG0(L_ERROR,"mBuf length check failed");
+         DU_LOG("\nERROR  -->  MAC : mBuf length check failed");
          err->errCause = RGERR_DUX_UNPACK_FAILURE;
          return RFAILED;
       }
index 0ba47b0..644a5eb 100755 (executable)
 #include "du_app_mac_inf.h"
 #include "rg.x"            /* MAC types */
 
-#ifdef LTE_L2_MEAS
-static const char* RLOG_MODULE_NAME="MAC";
-static int RLOG_FILE_ID=183;
-static int RLOG_MODULE_ID=4096;
-#endif 
 
 /* local defines */
 #ifdef LTE_L2_MEAS
@@ -111,7 +106,7 @@ RgErrInfo      *err
 
    if ((measCb = rgL2mAllocMeasCb(cell, measInfo, err)) == NULLP)
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,"Allocation of RgL2MeasCb failed");
+      DU_LOG("\nERROR  -->  MAC : Allocation of RgL2MeasCb failed");
       return RFAILED;
    }
    //Memcpy is already done in rgL2mAllocMeasCb
@@ -251,7 +246,7 @@ RgInfL2MeasReq    *measInfo      /* Meas Req Info */
    if ((cellCb == NULLP) ||
        (cellCb->cellId != measInfo->cellId))
    {
-      RLOG_ARG0(L_ERROR,DBG_CELLID,measInfo->cellId,"unable to get the cellCb");
+      DU_LOG("\nERROR  -->  MAC : unable to get the cellCb");
       return RFAILED;
    }
    /* Call L2M Function to store Meas req */
@@ -265,8 +260,7 @@ RgInfL2MeasReq    *measInfo      /* Meas Req Info */
       measCfm.cfm.reason   = LCM_REASON_INVALID_PAR_VAL;
       measCfm.cfm.status  = LCM_PRIM_NOK;
       rgSndL2MeasCfm(cellCb, &measCfm);
-      RLOG_ARG2(L_ERROR,DBG_CELLID,measInfo->cellId,
-               "Meas req Failed  errType(%d) errCause(%d)",
+      DU_LOG("\nERROR  -->  MAC : Meas req Failed  errType(%d) errCause(%d)",
                err.errType, err.errCause);
       return RFAILED;
    }
@@ -310,8 +304,7 @@ RgInfL2MeasStopReq *measInfo      /* Meas Req Info */
        (cellCb->cellId != measInfo->cellId))
    {
       
-      RLOG_ARG0(L_ERROR,DBG_CELLID,measInfo->cellId,
-            "Unable to get the cellCb");
+      DU_LOG("\nERROR  -->  MAC : Unable to get the cellCb");
       return RFAILED;
    }
    node = cellCb->l2mList.first; 
@@ -369,8 +362,7 @@ RgInfL2MeasSndReq *measInfo      /* Meas Req Info */
        (cellCb->cellId != measInfo->cellId))
    {
       
-      RLOG_ARG0(L_ERROR,DBG_CELLID,measInfo->cellId,
-            "Unable to get the cellCb");
+      DU_LOG("\nERROR  -->  MAC : Unable to get the cellCb");
       return RFAILED;
    }
    /*set sndL2Meas as applicatoin sent l2 meas info request*/
@@ -464,8 +456,7 @@ RgErrInfo      *err
       if((rgAllocSBuf(inst,(Data **)&(measCb),
                   sizeof(RgL2MeasCb))) == RFAILED)
       {
-         RLOG_ARG0(L_ERROR,DBG_CELLID,cell->cellId,
-                   "Allocation of RgL2MeasCb failed");
+         DU_LOG("\nERROR  -->  MAC : Allocation of RgL2MeasCb failed");
          err->errType  = RGERR_L2M_MEASREQ;
          err->errCause = RGERR_RAM_MEM_EXHAUST;
          return (NULLP);