Replaced old SSI function with new macros jira id - ODUHIGH-212
[o-du/l2.git] / src / cm / rgu.c
index 7a42dbf..87c188a 100755 (executable)
 */
 
 /* header include files (.h) */
-#include "envopt.h"        /* environment options */
-#include "envdep.h"        /* environment dependent */
-#include "envind.h"        /* environment independent */
-#include "gen.h"           /* general */
-#include "ssi.h"           /* system services */
-#include "cm_tkns.h"       /* Common Token Defines */
-#include "cm_llist.h"      /* Common Link List Defines */
-#include "cm_hash.h"       /* Common Hash List Defines */
-#include "cm_lte.h"        /* Common LTE Defines */
+#include "common_def.h"
 #include "rgu.h"           /* RGU Interface defines */
 
 /* header/extern include files (.x) */
-#include "gen.x"           /* general */
-#include "ssi.x"           /* system services */
-#include "cm_tkns.x"       /* Common Token Definitions */
-#include "cm_llist.x"      /* Common Link List Definitions */
-#include "cm_lib.x"        /* Common Library Definitions */
-#include "cm_hash.x"       /* Common Hash List Definitions */
-#include "cm_lte.x"        /* Common LTE Defines */
 #include "rgu.x"           /* RGU Interface includes */
 
 #ifdef SS_RBUF
@@ -100,7 +85,7 @@ SpId spId;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU001, (ErrVal)0, "Packing failed");
 #endif      
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(spId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -109,7 +94,7 @@ SpId spId;
           (ErrVal)ERGU002, (ErrVal)0, "Packing failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(suId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -118,10 +103,10 @@ SpId spId;
           (ErrVal)ERGU003, (ErrVal)0, "Packing failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    pst->event = (Event) EVTRGUBNDREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -164,7 +149,7 @@ Buffer *mBuf;
           (ErrVal)ERGU004, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SUnpkS16(&spId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -173,10 +158,10 @@ Buffer *mBuf;
           (ErrVal)ERGU005, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, spId));
+   return ((*func)(pst, suId, spId));
 }
 
 \f
@@ -216,7 +201,7 @@ Reason reason;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU006, (ErrVal)0, "Packing failed");
 #endif      
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(reason, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -225,7 +210,7 @@ Reason reason;
           (ErrVal)ERGU007, (ErrVal)0, "Packing failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(spId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -234,10 +219,10 @@ Reason reason;
           (ErrVal)ERGU008, (ErrVal)0, "Packing failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    pst->event = (Event) EVTRGUUBNDREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -280,7 +265,7 @@ Buffer *mBuf;
           (ErrVal)ERGU009, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SUnpkS16(&reason, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -289,10 +274,10 @@ Buffer *mBuf;
           (ErrVal)ERGU010, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, reason));
+   return ((*func)(pst, spId, reason));
 }
 
 \f
@@ -333,16 +318,16 @@ U8 status;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU011, (ErrVal)0, "Packing failed");
 #endif      
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (SPkU8(status, mBuf) != ROK) {
+   if (oduUnpackUInt8(status, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU012, (ErrVal)0, "Packing failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(suId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -351,10 +336,10 @@ U8 status;
           (ErrVal)ERGU013, (ErrVal)0, "Packing failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    pst->event = (Event) EVTRGUBNDCFM;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -398,182 +383,19 @@ Buffer *mBuf;
           (ErrVal)ERGU014, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (SUnpkU8(&status, mBuf) != ROK) {
+   if (oduPackUInt8(&status, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU015, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, status));
-}
-
-\f
-/**
-* @brief Request from RLC to MAC for forwarding SDUs on common
- * channel for transmission
-*
-* @details
-*
-*     Function : cmPkRguCDatReq
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguCDatReqInfo  *  datReq
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmPkRguCDatReq
-(
-Pst* pst,
-SpId spId,
-RguCDatReqInfo  * datReq
-)
-#else
-PUBLIC S16 cmPkRguCDatReq(pst, spId, datReq)
-Pst* pst;
-SpId spId;
-RguCDatReqInfo  * datReq;
-#endif
-{
-   Buffer *mBuf = NULLP;
-   TRC3(cmPkRguCDatReq)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU016, (ErrVal)0, "Packing failed");
-#endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)datReq, sizeof(RguCDatReqInfo));
-      RETVALUE(RFAILED);
-   }
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKPK(cmPkPtr,(PTR) datReq, mBuf);
-   }
-   else
-   {
-      if (cmPkRguCDatReqInfo(datReq, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU017, (ErrVal)0, "Packing failed");
-#endif      
-         SPutSBuf(pst->region, pst->pool, 
-                  (Data *)datReq, sizeof(RguCDatReqInfo));
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      if (SPutSBuf(pst->region, pst->pool, 
-                   (Data *)datReq, sizeof(RguCDatReqInfo)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU019, (ErrVal)0, "Packing failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      datReq = NULLP;
-   }
-
-   if (SPkS16(spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU018, (ErrVal)0, "Packing failed");
-#endif      
-
-      if (datReq != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, 
-                   (Data *)datReq, sizeof(RguCDatReqInfo));
-      }
-
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   pst->event = (Event) EVTRGUCDATREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Request from RLC to MAC for forwarding SDUs on common
- * channel for transmission
-*
-* @details
-*
-*     Function : cmUnpkRguCDatReq
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguCDatReqInfo  *  datReq
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguCDatReq
-(
-RguCDatReq func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkRguCDatReq(func, pst, mBuf)
-RguCDatReq func;
-Pst *pst;
-Buffer *mBuf;
-#endif
-{
-   SpId spId;
-   RguCDatReqInfo *datReq;
-   
-   TRC3(cmUnpkRguCDatReq)
-
-   if (SUnpkS16(&spId, mBuf) != ROK) {
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &datReq, mBuf);
-   }
-   else 
-   {
-      if ((SGetSBuf(pst->region, pst->pool, 
-                   (Data **)&datReq, sizeof(RguCDatReqInfo))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU020, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-     }
-     cmMemset((U8*)datReq, (U8)0, sizeof(RguCDatReqInfo));
-     if (cmUnpkRguCDatReqInfo(datReq, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU021, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, 
-                  (Data *)datReq, sizeof(RguCDatReqInfo));
-         RETVALUE(RFAILED);
-      }
-   }
-   SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, datReq));
+   return ((*func)(pst, suId, status));
 }
 
 \f
@@ -583,7 +405,7 @@ Buffer *mBuf;
 *
 * @details
 *
-*     Function : cmPkRguDDatReq
+*     Function : packDlData
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SpId  spId
@@ -591,22 +413,15 @@ Buffer *mBuf;
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-PUBLIC S16 cmPkRguDDatReq
+PUBLIC uint16_t packDlData
 (
 Pst* pst,
 SpId spId,
-RguDDatReqInfo  * datReq
+RlcMacData  *dlData
 )
-#else
-PUBLIC S16 cmPkRguDDatReq(pst, spId, datReq)
-Pst* pst;
-SpId spId;
-RguDDatReqInfo  * datReq;
-#endif
 {
    Buffer *mBuf = NULLP;
-   TRC3(cmPkRguDDatReq)
+   TRC3(packDlData)
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -614,21 +429,21 @@ RguDDatReqInfo  * datReq;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU022, (ErrVal)0, "Packing failed");
 #endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)datReq, sizeof(RguDDatReqInfo));
-      RETVALUE(RFAILED);
+      SPutSBuf(pst->region, pst->pool, (Data *)dlData, sizeof(RlcMacData));
+      return RFAILED;
    }
 
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) datReq, mBuf);
+      CMCHKPK(oduPackPointer,(PTR) dlData, mBuf);
    }
    else
    {
       /*rgu_c_001.main_5 - ADD - L2M Support */
 #ifdef LTE_L2_MEAS
-      if (cmPkRguDDatReqInfo(pst, datReq, mBuf) != ROK)
+      if (packRlcMacDataInfo(pst, dlData, mBuf) != ROK)
 #else
-      if (cmPkRguDDatReqInfo(datReq, mBuf) != ROK) 
+      if (packRlcMacDataInfo(dlData, mBuf) != ROK) 
 #endif
       {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -636,23 +451,23 @@ RguDDatReqInfo  * datReq;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU023, (ErrVal)0, "Packing failed");
 #endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)datReq,
-                                       sizeof(RguDDatReqInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)dlData,
+                                       sizeof(RlcMacData));
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
 
       if (SPutSBuf(pst->region, pst->pool, 
-                   (Data *)datReq, sizeof(RguDDatReqInfo)) != ROK) {
+                   (Data *)dlData, sizeof(RlcMacData)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
               __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU025, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
-      datReq = NULLP;
+      dlData = NULLP;
    }
    if (SPkS16(spId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -660,16 +475,16 @@ RguDDatReqInfo  * datReq;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU024, (ErrVal)0, "Packing failed");
 #endif      
-      if (datReq != NULLP);
+      if (dlData != NULLP)
       {
          SPutSBuf(pst->region, pst->pool, 
-                  (Data *)datReq, sizeof(RguDDatReqInfo));
+                  (Data *)dlData, sizeof(RlcMacData));
       }
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   pst->event = (Event) EVTRGUDDATREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   pst->event = (Event) EVTRLCDLDAT;
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -679,7 +494,7 @@ RguDDatReqInfo  * datReq;
 *
 * @details
 *
-*     Function : cmUnpkRguDDatReq
+*     Function : unpackDlData
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SpId  spId
@@ -687,52 +502,45 @@ RguDDatReqInfo  * datReq;
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguDDatReq
+PUBLIC S16 unpackDlData
 (
-RguDDatReq func,
+RlcMacDlData func,
 Pst *pst,
 Buffer *mBuf
 )
-#else
-PUBLIC S16 cmUnpkRguDDatReq(func, pst, mBuf)
-RguDDatReq func;
-Pst *pst;
-Buffer *mBuf;
-#endif
 {
    SpId spId;
-   RguDDatReqInfo *datReq;
+   RlcMacData *dlData;
    
-   TRC3(cmUnpkRguDDatReq)
+   TRC3(unpackDlData)
 
    if (SUnpkS16(&spId, mBuf) != ROK) {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &datReq, mBuf);
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &dlData, mBuf);
    }
    else 
    {
       if ((SGetSBuf(pst->region, pst->pool, 
-                     (Data **)&datReq, sizeof(RguDDatReqInfo))) != ROK) {
+                     (Data **)&dlData, sizeof(RlcMacData))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU026, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
-      cmMemset((U8*)datReq, (U8)0, sizeof(RguDDatReqInfo));
+      cmMemset((U8*)dlData, (U8)0, sizeof(RlcMacData));
   /*rgu_c_001.main_5 - ADD - L2M Support */
 #ifdef LTE_L2_MEAS
-      if (cmUnpkRguDDatReqInfo(pst,datReq, mBuf) != ROK)
+      if (unpackRlcMacDataInfo(pst,dlData, mBuf) != ROK)
 #else
-      if (cmUnpkRguDDatReqInfo(datReq, mBuf) != ROK) 
+      if (unpackRlcMacDataInfo(dlData, mBuf) != ROK) 
 #endif
       {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -741,174 +549,17 @@ Buffer *mBuf;
              (ErrVal)ERGU027, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)datReq,
-                                     sizeof(RguDDatReqInfo));
-         RETVALUE(RFAILED);
+         SPutSBuf(pst->region, pst->pool, (Data *)dlData,
+                                     sizeof(RlcMacData));
+         return RFAILED;
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, datReq));
-}
 
-\f
-/**
-* @brief Data Indication from MAC to RLC to 
- * forward the data received for common channels
-*
-* @details
-*
-*     Function : cmPkRguCDatInd
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguCDatIndInfo  *  datInd
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmPkRguCDatInd
-(
-Pst* pst,
-SuId suId,
-RguCDatIndInfo  * datInd
-)
-#else
-PUBLIC S16 cmPkRguCDatInd(pst, suId, datInd)
-Pst* pst;
-SuId suId;
-RguCDatIndInfo  * datInd;
-#endif
-{
-   Buffer *mBuf = NULLP;
-   TRC3(cmPkRguCDatInd)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU028, (ErrVal)0, "Packing failed");
-#endif      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguCDatIndInfo),0);
-      RETVALUE(RFAILED);
-   }
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKPK(cmPkPtr,(PTR) datInd, mBuf);
-   }
-   else
-   {
-      if (cmPkRguCDatIndInfo(datInd, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-        SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ERGU029, (ErrVal)0, "Packing failed");
-#endif      
-        SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd,
-                                    sizeof(RguCDatIndInfo),0);
-        SPutMsg(mBuf);
-        RETVALUE(RFAILED);
-     }
-     if (SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, 
-                               sizeof(RguCDatIndInfo),0) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-        SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ERGU031, (ErrVal)0, "Packing failed");
-#endif      
-        SPutMsg(mBuf);
-        RETVALUE(RFAILED);
-     }
-     datInd = NULLP;
-  }
-   if (SPkS16(suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU030, (ErrVal)0, "Packing failed");
-#endif      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguCDatIndInfo),0);
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   pst->event = (Event) EVTRGUCDATIND;
-   RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Data Indication from MAC to RLC to 
- * forward the data received for common channels
-*
-* @details
-*
-*     Function : cmUnpkRguCDatInd
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguCDatIndInfo  *  datInd
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguCDatInd
-(
-RguCDatInd func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkRguCDatInd(func, pst, mBuf)
-RguCDatInd func;
-Pst *pst;
-Buffer *mBuf;
-#endif
-{
-   SuId suId;
-   RguCDatIndInfo *datInd;
+   /* TODO : change function call to send RlcMacData as below: */
+   return ((*func)(pst, spId, dlData));
    
-   TRC3(cmUnpkRguCDatInd)
-
-   if (SUnpkS16(&suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU032, (ErrVal)0, "UnPacking failed");
-#endif      
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &datInd, mBuf);
-   }
-   else 
-   {
-      if ((SGetStaticBuffer(pst->region, pst->pool, 
-                    (Data **)&datInd, sizeof(RguCDatIndInfo),0)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU033, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      if (cmUnpkRguCDatIndInfo(datInd, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU034, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, 
-                                       sizeof(RguCDatIndInfo),0);
-         RETVALUE(RFAILED);
-      }
-   }
-   SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, datInd));
+   //return ((*func)(pst, spId, datReq));
 }
 
 \f
@@ -918,30 +569,17 @@ Buffer *mBuf;
 *
 * @details
 *
-*     Function : cmPkRguDDatInd
+*     Function : packRcvdUlData
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SuId  suId
-*  @param[in]   RguDDatIndInfo  *  datInd
+*  @param[in]   RlcMacData *ulData
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-PUBLIC S16 cmPkRguDDatInd
-(
-Pst* pst,
-SuId suId,
-RguDDatIndInfo  * datInd
-)
-#else
-PUBLIC S16 cmPkRguDDatInd(pst, suId, datInd)
-Pst* pst;
-SuId suId;
-RguDDatIndInfo  * datInd;
-#endif
+uint8_t packRlcUlData(Pst* pst, RlcMacData  *ulData)
 {
    Buffer *mBuf = NULLP;
-   TRC3(cmPkRguDDatInd)
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -949,52 +587,41 @@ RguDDatIndInfo  * datInd;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU035, (ErrVal)0, "Packing failed");
 #endif      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
-      RETVALUE(RFAILED);
+      SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
+      return RFAILED;
    }
 
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) datInd, mBuf);
+      CMCHKPK(oduPackPointer,(PTR)ulData, mBuf);
    }
    else
    {
-      if (cmPkRguDDatIndInfo(datInd, mBuf) != ROK) {
+      if (packRlcMacDataInfo(ulData, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
             SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                 __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
                 (ErrVal)ERGU036, (ErrVal)0, "Packing failed");
 #endif            
-         SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
+         SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
 
       if (SPutStaticBuffer(pst->region, pst->pool, 
-                      (Data *)datInd, sizeof(RguDDatIndInfo),0) != ROK) {
+                      (Data *)ulData, sizeof(RlcMacData),0) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU038, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
-      datInd = NULLP;
-   }
-   if (SPkS16(suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU037, (ErrVal)0, "Packing failed");
-#endif      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      ulData = NULLP;
    }
-
-   pst->event = (Event) EVTRGUDDATIND;
-   RETVALUE(SPstTsk(pst,mBuf));
+   pst->event = (Event) EVTRLCULDAT;
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -1004,240 +631,53 @@ RguDDatIndInfo  * datInd;
 *
 * @details
 *
-*     Function : cmUnpkRguDDatInd
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguDDatIndInfo  *  datInd
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguDDatInd
-(
-RguDDatInd func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkRguDDatInd(func, pst, mBuf)
-RguDDatInd func;
-Pst *pst;
-Buffer *mBuf;
-#endif
-{
-   SuId suId;
-   RguDDatIndInfo *datInd;
-   
-   TRC3(cmUnpkRguDDatInd)
-
-   if (SUnpkS16(&suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU039, (ErrVal)0, "UnPacking failed");
-#endif      
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &datInd, mBuf);
-   }
-   else 
-   {
-       if ((SGetStaticBuffer(pst->region, pst->pool, 
-                    (Data **)&datInd, sizeof(RguDDatIndInfo),0)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU040, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      if (cmUnpkRguDDatIndInfo(datInd, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU041, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutStaticBuffer(pst->region, pst->pool, 
-                    (Data *)datInd, sizeof(RguDDatIndInfo),0);
-         RETVALUE(RFAILED);
-      }
-   }
-   SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, datInd));
-}
-
-\f
-/**
-* @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for common channels
-*
-* @details
-*
-*     Function : cmPkRguCStaRsp
+*     Function : unpackRcvdUlData
 *
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguCStaRspInfo  *  staRsp
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmPkRguCStaRsp
-(
-Pst* pst,
-SpId spId,
-RguCStaRspInfo  * staRsp
-)
-#else
-PUBLIC S16 cmPkRguCStaRsp(pst, spId, staRsp)
-Pst* pst;
-SpId spId;
-RguCStaRspInfo  * staRsp;
-#endif
-{
-   Buffer *mBuf = NULLP;
-   TRC3(cmPkRguCStaRsp)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU042, (ErrVal)0, "Packing failed");
-#endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguCStaRspInfo));
-      RETVALUE(RFAILED);
-   }
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKPK(cmPkPtr,(PTR) staRsp, mBuf);
-   }
-   else
-   {
-      if (cmPkRguCStaRspInfo(staRsp, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU043, (ErrVal)0, "Packing failed");
-#endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)staRsp, 
-                                     sizeof(RguCStaRspInfo));
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-
-      if (SPutSBuf(pst->region, pst->pool, (Data *)staRsp, 
-                                     sizeof(RguCStaRspInfo)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU045, (ErrVal)0, "Packing failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      staRsp = NULLP;
-   }
-   if (SPkS16(spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU044, (ErrVal)0, "Packing failed");
-#endif      
-      if (staRsp != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, 
-                       (Data *)staRsp, sizeof(RguCStaRspInfo));
-      }
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   pst->event = (Event) EVTRGUCSTARSP;
-   RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for common channels
-*
-* @details
-*
-*     Function : cmUnpkRguCStaRsp
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguCStaRspInfo  *  staRsp
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguCStaRsp
-(
-RguCStaRsp func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkRguCStaRsp(func, pst, mBuf)
-RguCStaRsp func;
-Pst *pst;
-Buffer *mBuf;
-#endif
+*  @param[in]   Pst*  pst
+*  @param[in]   SuId  suId
+*  @param[in]   RlcMacData  *ulData
+*  @return   S16
+*      -# ROK
+**/
+uint8_t unpackRcvdUlData(RlcMacUlDataFunc func, Pst *pst, Buffer *mBuf)
 {
-   SpId spId;
-   RguCStaRspInfo *staRsp;
+   RlcMacData *ulData;
    
-   TRC3(cmUnpkRguCStaRsp)
+   TRC3(unpackRcvdUlData)
 
-   if (SUnpkS16(&spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU046, (ErrVal)0, "UnPacking failed");
-#endif      
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staRsp, mBuf);
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &ulData, mBuf);
    }
    else 
    {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&staRsp
-                                    sizeof(RguCStaRspInfo))) != ROK) {
+       if ((SGetStaticBuffer(pst->region, pst->pool
+                    (Data **)&ulData, sizeof(RlcMacData),0)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU047, (ErrVal)0, "UnPacking failed");
+             (ErrVal)ERGU040, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
-      if (cmUnpkRguCStaRspInfo(staRsp, mBuf) != ROK) {
+      if (unpackRlcMacDataInfo(ulData, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU048, (ErrVal)0, "UnPacking failed");
+             (ErrVal)ERGU041, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)staRsp
-                                          sizeof(RguCStaRspInfo));
-         RETVALUE(RFAILED);
+         SPutStaticBuffer(pst->region, pst->pool
+                    (Data *)ulData, sizeof(RlcMacData),0);
+         return RFAILED;
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, staRsp));
+   return ((*func)(pst, ulData));
 }
 
+
 /*rgu_c_001.main_5 - ADD - L2M & R9 Support */
 #ifdef LTE_L2_MEAS
 
@@ -1272,15 +712,15 @@ Buffer *mBuf;
    S32 loop;
    TRC3(cmPkRguL2MUlThrpMeasReqInfo);
 
-   CMCHKPK(SPkU8, param->enbMeas, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->enbMeas, mBuf);
    for (loop=param->numLcId-1; loop >= 0; loop--)
    {
-      CMCHKPK(SPkU8, param->lcId[loop], mBuf);
+      CMCHKPK(oduUnpackUInt8, param->lcId[loop], mBuf);
    }
    CMCHKPK(cmPkLteLcId, param->numLcId, mBuf);
    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -1321,10 +761,10 @@ Buffer *mBuf;
    CMCHKUNPK(cmUnpkLteLcId, &param->numLcId, mBuf);
    for (loop=0; loop<param->numLcId; loop++)
    {
-      CMCHKUNPK(SUnpkU8, &param->lcId[loop], mBuf);
+      CMCHKUNPK(oduPackUInt8, &param->lcId[loop], mBuf);
    }
-   CMCHKUNPK(SUnpkU8, &param->enbMeas, mBuf);
-   RETVALUE(ROK);
+   CMCHKUNPK(oduPackUInt8, &param->enbMeas, mBuf);
+   return ROK;
 }
 
 /**
@@ -1366,11 +806,11 @@ RguL2MUlThrpMeasReqInfo* measReq;
           (ErrVal)ERGU049, (ErrVal)0, "Packing failed");
 #endif      
       SPutSBuf(pst->region, pst->pool, (Data *)measReq, sizeof(RguL2MUlThrpMeasReqInfo));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) measReq, mBuf);
+      CMCHKPK(oduPackPointer,(PTR) measReq, mBuf);
    }
    else
    {
@@ -1383,7 +823,7 @@ RguL2MUlThrpMeasReqInfo* measReq;
          SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
                                     sizeof(RguL2MUlThrpMeasReqInfo));
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
       if (SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
                            sizeof(RguL2MUlThrpMeasReqInfo)) != ROK) {
@@ -1393,7 +833,7 @@ RguL2MUlThrpMeasReqInfo* measReq;
              (ErrVal)ERGU052, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
       measReq = NULLP;
    }
@@ -1410,11 +850,11 @@ RguL2MUlThrpMeasReqInfo* measReq;
                              sizeof(RguL2MUlThrpMeasReqInfo));
       }
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTRGUL2MULTHRPMEASREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -1459,11 +899,11 @@ Buffer *mBuf;
           (ErrVal)ERGU053, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &measReq, mBuf);
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &measReq, mBuf);
    }
    else 
    {
@@ -1475,7 +915,7 @@ Buffer *mBuf;
              (ErrVal)ERGU054, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
       if (cmUnpkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -1486,11 +926,11 @@ Buffer *mBuf;
          SPutMsg(mBuf);
          SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
                                 sizeof(RguL2MUlThrpMeasReqInfo));
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, measReq));
+   return ((*func)(pst, spId, measReq));
 }
 
 #endif
@@ -1504,73 +944,65 @@ Buffer *mBuf;
 *
 * @details
 *
-*     Function : cmPkRguDStaRsp
+*     Function : packBOStatus,
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SpId  spId
-*  @param[in]   RguDStaRspInfo  *  staRsp
+*  @param[in]   RlcMacBOStatus  *  staRsp
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-PUBLIC S16 cmPkRguDStaRsp
+PUBLIC uint16_t packBOStatus
 (
 Pst* pst,
 SpId spId,
-RguDStaRspInfo  *staRsp
+RlcMacBOStatus  *boStatus
 )
-#else
-PUBLIC S16 cmPkRguDStaRsp(pst, spId, staRsp)
-Pst* pst;
-SpId spId;
-RguDStaRspInfo  *staRsp;
-#endif
 {
-
-   RguDStaRspInfo  *staRspInfo = NULL;
+   RlcMacBOStatus  *boStaInfo = NULL;
    Buffer *mBuf = NULLP;
 
-   if(SGetSBuf(pst->region, pst->pool, (Data **)&staRspInfo, sizeof(RguDStaRspInfo)) != ROK)
+   if(SGetSBuf(pst->region, pst->pool, (Data **)&boStaInfo, sizeof(RlcMacBOStatus)) != ROK)
    {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
 #endif      
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #ifdef ERRCLS_KW
-   /* staRspInfo cant be NULL here */
-   if (staRspInfo == NULLP)
+   /* boStaInfo cant be NULL here */
+   if (boStaInfo == NULLP)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
-   cmMemcpy((U8 *)staRspInfo, (U8 *)staRsp, sizeof(RguDStaRspInfo)); 
+   cmMemcpy((U8 *)boStaInfo, (U8 *)boStatus, sizeof(RlcMacBOStatus)); 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
 #endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)staRspInfo, sizeof(RguDStaRspInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
 
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) staRspInfo, mBuf);
+      CMCHKPK(oduPackPointer,(PTR) boStaInfo, mBuf);
    }
    else
    {
-      if (cmPkRguDStaRspInfo(staRsp, mBuf) != ROK) {
+      if (packBOStatusInfo(boStatus, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGU057, (ErrVal)0, "Packing failed");
 #endif      
         SPutMsg(mBuf);
-        RETVALUE(RFAILED);
+        return RFAILED;
      }
    }
    if (SPkS16(spId, mBuf) != ROK) {
@@ -1579,52 +1011,45 @@ RguDStaRspInfo  *staRsp;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU058, (ErrVal)0, "Packing failed");
 #endif      
-      if (staRspInfo != NULLP)
+      if (boStaInfo != NULLP)
       {
-         SPutSBuf(pst->region, pst->pool, (Data *)staRspInfo, sizeof(RguDStaRspInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
       }
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   pst->event = (Event) EVTRGUDSTARSP;
-   RETVALUE(SPstTsk(pst,mBuf));
+   pst->event = (Event)EVTRLCBOSTA;
+   return (SPstTsk(pst,mBuf));
    SPutMsg(mBuf);
 }
 
 \f
 /**
 * @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for dedicated channels
+* inform the BO report for dedicated channels
 *
 * @details
 *
-*     Function : cmUnpkRguDStaRsp
+*     Function : unpackBOStatus
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SpId  spId
-*  @param[in]   RguDStaRspInfo  *  staRsp
+*  @param[in]   RlcMacBOStatus *  staRsp
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguDStaRsp
+PUBLIC uint16_t unpackBOStatus
 (
-RguDStaRsp func,
+RlcMacBoStatus func,
 Pst *pst,
 Buffer *mBuf
 )
-#else
-PUBLIC S16 cmUnpkRguDStaRsp(func, pst, mBuf)
-RguDStaRsp func;
-Pst *pst;
-Buffer *mBuf;
-#endif
 {
    SpId spId;
-   RguDStaRspInfo *staRsp;
-   
-   TRC3(cmUnpkRguDStaRsp)
+   RlcMacBOStatus *boSta;
+
+   TRC3(unpackBOStatus)
 
    if (SUnpkS16(&spId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -1633,206 +1058,42 @@ Buffer *mBuf;
           (ErrVal)ERGU060, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staRsp, mBuf);
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &boSta, mBuf);
    }
    else
    {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&staRsp
-                                 sizeof(RguDStaRspInfo))) != ROK) {
+      if ((SGetSBuf(pst->region, pst->pool, (Data **)&boSta
+                                 sizeof(RlcMacBOStatus))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU061, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
-      if (cmUnpkRguDStaRspInfo(staRsp, mBuf) != ROK) {
+      if (unpackBOStatusInfo(boSta, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU062, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguDStaRspInfo));
-         RETVALUE(RFAILED);
+         SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
+         return RFAILED;
       }
    }
    SPutMsg(mBuf);
-   (*func)(pst, spId, staRsp);
-   SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguDStaRspInfo));
-   RETVALUE(ROK);
-}
-
-\f
-/**
-* @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on common channels.
-*
-* @details
-*
-*     Function : cmPkRguCStaInd
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguCStaIndInfo  *  staInd
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmPkRguCStaInd
-(
-Pst* pst,
-SuId suId,
-RguCStaIndInfo  * staInd
-)
-#else
-PUBLIC S16 cmPkRguCStaInd(pst, suId, staInd)
-Pst* pst;
-SuId suId;
-RguCStaIndInfo  * staInd;
-#endif
-{
-   Buffer *mBuf = NULLP;
-   TRC3(cmPkRguCStaInd)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU063, (ErrVal)0, "Packing failed");
-#endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
-      RETVALUE(RFAILED);
-   }
-      if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKPK(cmPkPtr,(PTR) staInd, mBuf);
-   }
-   else
-   {
-      if (cmPkRguCStaIndInfo(staInd, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-            SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-                (ErrVal)ERGU064, (ErrVal)0, "Packing failed");
-#endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      if (SPutSBuf(pst->region, pst->pool, 
-                    (Data *)staInd, sizeof(RguCStaIndInfo)) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU066, (ErrVal)0, "Packing failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      staInd = NULLP;
-  }
-  if (SPkS16(suId,mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU065, (ErrVal)0, "Packing failed");
-#endif      
-      if (staInd != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, (Data *)staInd,
-                                     sizeof(RguCStaIndInfo));
-      }
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-   pst->event = (Event) EVTRGUCSTAIND;
-   RETVALUE(SPstTsk(pst,mBuf));
+  // (*func)(pst, spId, boSta);
+   SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
+   return ROK;
 }
 
-\f
-/**
-* @brief Status Indication from MAC to RLC  
- * as a response to the staRsp primitive from RLC.
- * Informs RLC of the totalBufferSize and Timing Info 
- * for the transmission on common channels.
-*
-* @details
-*
-*     Function : cmUnpkRguCStaInd
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguCStaIndInfo  *  staInd
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguCStaInd
-(
-RguCStaInd func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkRguCStaInd(func, pst, mBuf)
-RguCStaInd func;
-Pst *pst;
-Buffer *mBuf;
-#endif
-{
-   SuId suId;
-   RguCStaIndInfo *staInd;
-   
-   TRC3(cmUnpkRguCStaInd)
-
-   if (SUnpkS16(&suId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU067, (ErrVal)0, "UnPacking failed");
-#endif      
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staInd, mBuf);
-   }
-   else
-   {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&staInd, sizeof(RguCStaIndInfo))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-           SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-               __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-               (ErrVal)ERGU068, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      if (cmUnpkRguCStaIndInfo(staInd, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU069, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
-         RETVALUE(RFAILED);
-      }
-   }
-   SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, staInd));
-}
 
    /*rgu_c_001.main_5 - ADD - L2M Support */
 #ifdef LTE_L2_MEAS
@@ -1882,7 +1143,7 @@ RguHarqStatusInd  *harqStatusInd;
             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
             (ErrVal)ERGU070, (ErrVal)0, "Packing failed");
 #endif      
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    cmMemcpy((U8 *)harqStaInd, (U8 *)harqStatusInd, sizeof(RguHarqStatusInd));
@@ -1898,24 +1159,24 @@ RguHarqStatusInd  *harqStatusInd;
 #else      
       SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
 #endif      
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) harqStaInd, mBuf); 
+      CMCHKPK(oduPackPointer,(PTR) harqStaInd, mBuf); 
    }
    else
    {
       for(idx = 0; idx < harqStaInd->numTbs; idx++)
       {
-         CMCHKPK(SPkU16, harqStaInd->status[idx], mBuf);
+         CMCHKPK(oduUnpackUInt16, harqStaInd->status[idx], mBuf);
       }
       for(idx = 0; idx < harqStaInd->numTbs; idx++)
       {
-         CMCHKPK(SPkU32, harqStaInd->tbId[idx], mBuf);
+         CMCHKPK(oduUnpackUInt32, harqStaInd->tbId[idx], mBuf);
       }
-      CMCHKPK(SPkU8, harqStaInd->numTbs, mBuf);
+      CMCHKPK(oduUnpackUInt8, harqStaInd->numTbs, mBuf);
       CMCHKPK(cmPkLteRnti, harqStaInd->ueId, mBuf);
       CMCHKPK(cmPkLteCellId, harqStaInd->cellId, mBuf);
    }
@@ -1932,13 +1193,13 @@ RguHarqStatusInd  *harqStatusInd;
       SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, sizeof(RguHarqStatusInd), 0);
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #ifdef XEON_SPECIFIC_CHANGES
    if (SPutSBuf(pst->region, pst->pool, (Data *)harqStaInd,
             sizeof(RguHarqStatusInd)) != ROK) {
 #else   
-   if (pst->selector != RGU_SEL_LWLC)
+   if (pst->selector != ODU_SELECTOR_LWLC)
    {
       if(SPutStaticBuffer(pst->region, pst->pool, (Data *)harqStaInd, 
                sizeof(RguHarqStatusInd), 0) != ROK)
@@ -1950,14 +1211,14 @@ RguHarqStatusInd  *harqStatusInd;
                (ErrVal)ERGU072, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
 #ifndef XEON_SPECIFIC_CHANGES      
    }
 #endif   
 
    pst->event = (Event) EVTRGUHQSTAIND;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 \f
 
@@ -2001,15 +1262,15 @@ Buffer *mBuf;
           (ErrVal)ERGU073, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #ifdef XEON_SPECIFIC_CHANGES
    if ((SGetSBuf(pst->region, pst->pool, (Data **)&hqStaInd, 
         sizeof(RguHarqStatusInd))) != ROK) {
 #else   
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &hqStaInd, mBuf);
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &hqStaInd, mBuf);
    }  
    else
    {   
@@ -2023,18 +1284,18 @@ Buffer *mBuf;
                (ErrVal)ERGU074, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
       CMCHKUNPK(cmUnpkLteCellId, &hqStaInd->cellId, mBuf);
       CMCHKUNPK(cmUnpkLteRnti, &hqStaInd->ueId, mBuf);
-      CMCHKUNPK(SUnpkU8, &hqStaInd->numTbs, mBuf);
+      CMCHKUNPK(oduPackUInt8, &hqStaInd->numTbs, mBuf);
       for(idx = hqStaInd->numTbs; idx > 0; idx--)
       {
-         CMCHKUNPK(SUnpkU32, &hqStaInd->tbId[idx - 1], mBuf);
+         CMCHKUNPK(oduPackUInt32, &hqStaInd->tbId[idx - 1], mBuf);
       }
       for(idx = hqStaInd->numTbs; idx > 0; idx--)
       {
-         CMCHKUNPK(SUnpkU16, &hqStaInd->status[idx - 1], mBuf);
+         CMCHKUNPK(oduPackUInt16, &hqStaInd->status[idx - 1], mBuf);
       }
 #ifndef XEON_SPECIFIC_CHANGES      
    }
@@ -2046,7 +1307,7 @@ Buffer *mBuf;
 #else   
    SPutStaticBuffer(pst->region, pst->pool, (Data *)hqStaInd, sizeof(RguHarqStatusInd), 0);
 #endif   
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif /* LTE_L2_MEAS */
 
@@ -2059,30 +1320,23 @@ Buffer *mBuf;
 *
 * @details
 *
-*     Function : cmPkRguDStaInd
+*     Function : packSchedRep
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SuId  suId
-*  @param[in]   RguDStaIndInfo  *  staInd
+*  @param[in]   RlcMacSchedRep*  schRep
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-PUBLIC S16 cmPkRguDStaInd
+PUBLIC S16 packSchedRep
 (
 Pst* pst,
 SuId suId,
-RguDStaIndInfo  * staInd
+RlcMacSchedRepInfo  * schRep
 )
-#else
-PUBLIC S16 cmPkRguDStaInd(pst, suId, staInd)
-Pst* pst;
-SuId suId;
-RguDStaIndInfo  * staInd;
-#endif
 {
    Buffer *mBuf = NULLP;
-   TRC3(cmPkRguDStaInd)
+   TRC3(packSchedRep)
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -2090,37 +1344,37 @@ RguDStaIndInfo  * staInd;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
 #endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguDStaIndInfo));
-      RETVALUE(RFAILED);
+      SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRepInfo));
+      return RFAILED;
    }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) staInd, mBuf);
+      CMCHKPK(oduPackPointer,(PTR) schRep, mBuf);
    }
    else
    {
-      if (cmPkRguDStaIndInfo(staInd, mBuf) != ROK) {
+      if (packSchedRepInfo(schRep, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
            SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
                (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
 #endif      
-        SPutSBuf(pst->region, pst->pool, (Data *)staInd
-                                         sizeof(RguDStaIndInfo));
+        SPutSBuf(pst->region, pst->pool, (Data *)schRep
+                                         sizeof(RlcMacSchedRepInfo));
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       } 
-      if (SPutSBuf(pst->region, pst->pool, (Data *)staInd,
-                                  sizeof(RguDStaIndInfo)) != ROK) {
+      if (SPutSBuf(pst->region, pst->pool, (Data *)schRep,
+                                  sizeof(RlcMacSchedRepInfo)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU079, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
-      staInd = NULLP;
+      schRep= NULLP;
    }
    if (SPkS16(suId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -2128,16 +1382,16 @@ RguDStaIndInfo  * staInd;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU078, (ErrVal)0, "Packing failed");
 #endif      
-      if (staInd != NULLP)
+      if (schRep != NULLP)
       {
-         SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguDStaIndInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRepInfo));
       }
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   pst->event = (Event) EVTRGUDSTAIND;
-   RETVALUE(SPstTsk(pst,mBuf));
+   pst->event = (Event) EVTSCHREP;
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -2149,7 +1403,7 @@ RguDStaIndInfo  * staInd;
 *
 * @details
 *
-*     Function : cmUnpkRguDStaInd
+*     Function : unpackSchedRep
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SuId  suId
@@ -2157,24 +1411,17 @@ RguDStaIndInfo  * staInd;
 *  @return   S16
 *      -# ROK
 **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguDStaInd
+PUBLIC S16 unpackSchedRep
 (
-RguDStaInd func,
+RlcMacSchedRep func,
 Pst *pst,
 Buffer *mBuf
 )
-#else
-PUBLIC S16 cmUnpkRguDStaInd(func, pst, mBuf)
-RguDStaInd func;
-Pst *pst;
-Buffer *mBuf;
-#endif
 {
    SuId suId;
-   RguDStaIndInfo *staInd;
+   RlcMacSchedRepInfo *schRep;
    
-   TRC3(cmUnpkRguDStaInd)
+   TRC3(unpackSchedRep)
 
    if (SUnpkS16(&suId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -2183,36 +1430,36 @@ Buffer *mBuf;
           (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staInd, mBuf);
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &schRep, mBuf);
    }
    else 
    {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&staInd, sizeof(RguDStaIndInfo))) != ROK) {
+      if ((SGetSBuf(pst->region, pst->pool, (Data **)&schRep, sizeof(RlcMacSchedRepInfo))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
          (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
-      if (cmUnpkRguDStaIndInfo(staInd, mBuf) != ROK) {
+      if (unpackSchedRepInfo(schRep, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
              (ErrVal)ERGU082, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguDStaIndInfo));
-         RETVALUE(RFAILED);
+         SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRepInfo));
+         return RFAILED;
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, staInd));
+   return ((*func)(pst, suId, schRep));
 }
 
 #ifdef ANSI
@@ -2228,11 +1475,11 @@ Buffer             *mBuf;
 #endif
 {
   TRC3(cmPkRguLcFlowCntrlInfo);
-  CMCHKPK(SPkU32, param->maxBo4FlowCtrl, mBuf);
-  CMCHKPK(SPkU32, param->pktAdmitCnt, mBuf);
+  CMCHKPK(oduUnpackUInt32, param->maxBo4FlowCtrl, mBuf);
+  CMCHKPK(oduUnpackUInt32, param->pktAdmitCnt, mBuf);
   CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
 
-  RETVALUE(ROK);
+  return ROK;
 }
 
 #ifdef ANSI
@@ -2255,9 +1502,9 @@ Buffer             *mBuf;
   {
     cmPkRguLcFlowCntrlInfo(&param->lcInfo[idx],mBuf);
   }
-  CMCHKPK(SPkU32, param->numLcs, mBuf);
+  CMCHKPK(oduUnpackUInt32, param->numLcs, mBuf);
   CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
-  RETVALUE(ROK);
+  return ROK;
 }
 
 #ifdef ANSI
@@ -2280,9 +1527,9 @@ Buffer          *mBuf;
   {
     cmPkRguUeFlowCntrlInfo(&param->ueFlowCntrlInfo[idx],mBuf);
   }
-  CMCHKPK(SPkU32, param->numUes, mBuf);
+  CMCHKPK(oduUnpackUInt32, param->numUes, mBuf);
   CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-  RETVALUE(ROK);
+  return ROK;
 }
 \f
 /**
@@ -2323,11 +1570,11 @@ RguFlowCntrlInd   *flowCntrlInd;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
 #endif      
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) flowCntrlInd, mBuf);
+      CMCHKPK(oduPackPointer,(PTR) flowCntrlInd, mBuf);
    }
    else
    {
@@ -2338,7 +1585,7 @@ RguFlowCntrlInd   *flowCntrlInd;
                (ErrVal)ERGU077, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       } 
    }
    if (SPkS16(suId, mBuf) != ROK) {
@@ -2348,11 +1595,11 @@ RguFlowCntrlInd   *flowCntrlInd;
           (ErrVal)ERGU078, (ErrVal)0, "Packing failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
    pst->event = (Event) EVTRGUFLOWCNTRLIND;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 #ifdef ANSI
@@ -2370,10 +1617,10 @@ Buffer           *mBuf;
   TRC3(cmUnpkRguLcFlowCntrlInfo);
 
   CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
-  CMCHKUNPK(SUnpkU32, &param->pktAdmitCnt, mBuf);
-  CMCHKUNPK(SUnpkU32, &param->maxBo4FlowCtrl, mBuf);
+  CMCHKUNPK(oduPackUInt32, &param->pktAdmitCnt, mBuf);
+  CMCHKUNPK(oduPackUInt32, &param->maxBo4FlowCtrl, mBuf);
   
-  RETVALUE(ROK);
+  return ROK;
 }
 #ifdef ANSI
 PUBLIC S16 cmUnpkRguUeFlowCntrlInfo
@@ -2390,12 +1637,12 @@ Buffer           *mBuf;
   U32 idx;
   TRC3(cmUnpkRguUeFlowCntrlInfo);
   CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
-  CMCHKUNPK(SUnpkU32, &param->numLcs, mBuf);
+  CMCHKUNPK(oduPackUInt32, &param->numLcs, mBuf);
   for(idx=0; idx < param->numLcs; idx++)
   {
     cmUnpkRguLcFlowCntrlInfo(&param->lcInfo[idx],mBuf);
   }
-  RETVALUE(ROK);
+  return ROK;
 }
 
 #ifdef ANSI
@@ -2415,12 +1662,12 @@ Buffer           *mBuf;
   TRC3(cmUnpkRguFlowCntrlInfo);
 
   CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
-  CMCHKUNPK(SUnpkU32, &param->numUes, mBuf);
+  CMCHKUNPK(oduPackUInt32, &param->numUes, mBuf);
   for (idx=0; idx < param->numUes; idx++)
   {
     cmUnpkRguUeFlowCntrlInfo(&param->ueFlowCntrlInfo[idx],mBuf);
   }
-  RETVALUE(ROK);
+  return ROK;
 }
 
 /**
@@ -2464,11 +1711,11 @@ Buffer *mBuf;
           (ErrVal)ERGU080, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
-   if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == ODU_SELECTOR_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &flowCntrlInd, mBuf);
+      CMCHKUNPK(oduUnpackPointer,(PTR *) &flowCntrlInd, mBuf);
    }
    else 
    {
@@ -2479,7 +1726,7 @@ Buffer *mBuf;
          (ErrVal)ERGU081, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
       if (cmUnpkRguFlowCntrlInfo(flowCntrlInd, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -2489,11 +1736,11 @@ Buffer *mBuf;
 #endif      
          SPutMsg(mBuf);
          SPutSBuf(pst->region, pst->pool, (Data *)flowCntrlInd, sizeof(RguFlowCntrlInd));
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, flowCntrlInd));
+   return ((*func)(pst, suId, flowCntrlInd));
 }
 
 /***********************************************************
@@ -2532,14 +1779,14 @@ Buffer *mBuf;
      /* rgu_c_001.main_3: ccpu00111328: S16 is renamed as MsgLen */
       MsgLen msgLen = 0;
       if (SFndLenMsg(param->mBuf[i], &msgLen) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
       if (SCatMsg(mBuf, param->mBuf[i], M1M2) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
       SPutMsg(param->mBuf[i]);
       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
    }
-   CMCHKPK(SPkU8, param->numPdu, mBuf);
-   RETVALUE(ROK);
+   CMCHKPK(oduUnpackUInt8, param->numPdu, mBuf);
+   return ROK;
 }
 
 
@@ -2576,16 +1823,16 @@ Buffer *mBuf;
 
    TRC3(cmUnpkRguPduInfo);
 
-   CMCHKUNPK(SUnpkU8, &param->numPdu, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->numPdu, mBuf);
    for (i=0; i<param->numPdu; i++) {
       MsgLen msgLen, totalMsgLen;
       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
       if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->mBuf[i]) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -2621,14 +1868,14 @@ Buffer *mBuf;
 
    TRC3(cmPkRguDBoReport);
 
-   CMCHKPK(SPkU32, param->oldestSduArrTime, mBuf);
-   CMCHKPK(SPkU32, param->staPduBo, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->oldestSduArrTime, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->staPduBo, mBuf);
 #ifdef CCPU_OPT
-   CMCHKPK(SPkU8, param->staPduPrsnt, mBuf);
-   CMCHKPK(SPkU16, param->estRlcHdrSz, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->staPduPrsnt, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->estRlcHdrSz, mBuf);
 #endif
    CMCHKPK(SPkS32, param->bo, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -2666,13 +1913,13 @@ Buffer *mBuf;
 
    CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
 #ifdef CCPU_OPT
-   CMCHKUNPK(SUnpkU16, &param->estRlcHdrSz, mBuf);
-   CMCHKUNPK(SUnpkU8, &param->staPduPrsnt, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->estRlcHdrSz, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->staPduPrsnt, mBuf);
 #endif
    
-   CMCHKUNPK(SUnpkU32, &param->staPduBo, mBuf);
-   CMCHKUNPK(SUnpkU32, &param->oldestSduArrTime, mBuf);
-   RETVALUE(ROK);
+   CMCHKUNPK(oduPackUInt32, &param->staPduBo, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->oldestSduArrTime, mBuf);
+   return ROK;
 }
 
 \f
@@ -2711,9 +1958,9 @@ Buffer *mBuf;
    if (param->pdu != NULLP)
    {
       if (SFndLenMsg(param->pdu, &msgLen) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
       if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
       SPutMsg(param->pdu);
       CMCHKPK(cmPkMsgLen, msgLen, mBuf);
    }
@@ -2725,17 +1972,17 @@ Buffer *mBuf;
       case CM_LTE_LCH_PCCH:
          CMCHKPK(cmPkLteTimingInfo, &param->u.timeToTx, mBuf);
 #ifdef EMTC_ENABLE
-        CMCHKPK(SPkU8,param->pnb,mBuf);
+        CMCHKPK(oduUnpackUInt8,param->pnb,mBuf);
 #endif
          break;
       default :
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
-   CMCHKPK(SPkU32, param->transId, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->transId, mBuf);
    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -2775,12 +2022,12 @@ Buffer *mBuf;
    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
    CMCHKUNPK(cmUnpkLteLcType, &param->lcType, mBuf);
-   CMCHKUNPK(SUnpkU32, &param->transId, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->transId, mBuf);
    switch(param->lcType) {
       case CM_LTE_LCH_BCCH:
       case CM_LTE_LCH_PCCH:
 #ifdef EMTC_ENABLE
-         CMCHKUNPK(SUnpkU8,&param->pnb, mBuf);
+         CMCHKUNPK(oduPackUInt8,&param->pnb, mBuf);
 #endif
          CMCHKUNPK(cmUnpkLteTimingInfo, &param->u.timeToTx, mBuf);
          break;
@@ -2788,18 +2035,18 @@ Buffer *mBuf;
          CMCHKUNPK(cmUnpkLteRnti, &param->u.rnti, mBuf);
          break;
       default :
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
    SFndLenMsg(mBuf, &msgLen);
    if (msgLen > 0)
    {
       CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
       if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
       if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->pdu) != ROK)
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -2836,13 +2083,13 @@ Buffer *mBuf;
    TRC3(cmPkRguLchDatReq);
 
 #ifdef L2_OPTMZ
-   CMCHKPK(SPkU8, param->freeBuff, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->freeBuff, mBuf);
 #endif
-   CMCHKPK(SPkU8, param->setMaxUlPrio, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->setMaxUlPrio, mBuf);
    CMCHKPK(cmPkRguPduInfo, &param->pdu, mBuf);
    CMCHKPK(cmPkRguDBoReport, &param->boReport, mBuf);
    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -2881,11 +2128,11 @@ Buffer *mBuf;
    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
    CMCHKUNPK(cmUnpkRguDBoReport, &param->boReport, mBuf);
    CMCHKUNPK(cmUnpkRguPduInfo, &param->pdu, mBuf);
-   CMCHKUNPK(SUnpkU8, &param->setMaxUlPrio, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->setMaxUlPrio, mBuf);
 #ifdef L2_OPTMZ
-   CMCHKUNPK(SUnpkU8, &param->freeBuff, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->freeBuff, mBuf);
 #endif
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
@@ -2922,13 +2169,13 @@ Buffer *mBuf;
    TRC3(cmPkRguDatReqTb);
    /*rgu_c_001.main_5 - ADD - L2M Support */
 #ifdef LTE_L2_MEAS
-   CMCHKPK(SPkU32, param->tbId, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->tbId, mBuf);
 #endif
    for (i=param->nmbLch-1; i >= 0; i--) {
       CMCHKPK(cmPkRguLchDatReq, &param->lchData[i], mBuf);
    }
-   CMCHKPK(SPkU8, param->nmbLch, mBuf);
-   RETVALUE(ROK);
+   CMCHKPK(oduUnpackUInt8, param->nmbLch, mBuf);
+   return ROK;
 }
 
 
@@ -2981,15 +2228,15 @@ Buffer *mBuf;
 
    TRC3(cmUnpkRguDatReqTb);
 
-   CMCHKUNPK(SUnpkU8, &param->nmbLch, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->nmbLch, mBuf);
    for (i=0; i<param->nmbLch; i++) {
       CMCHKUNPK(cmUnpkRguLchDatReq, &param->lchData[i], mBuf);
    }
    /*rgu_c_001.main_5 - ADD - L2M Support */
 #ifdef LTE_L2_MEAS
-   CMCHKUNPK(SUnpkU32, &param->tbId, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->tbId, mBuf);
 #endif
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
@@ -3050,13 +2297,13 @@ Buffer *mBuf;
       {
          CMCHKPK(cmPkRguDatReqTb, &datReq->datReqTb[i], mBuf);
       }
-      CMCHKPK(SPkU8, datReq->nmbOfTbs, mBuf);
-      CMCHKPK(SPkU32, datReq->transId, mBuf);
+      CMCHKPK(oduUnpackUInt8, datReq->nmbOfTbs, mBuf);
+      CMCHKPK(oduUnpackUInt32, datReq->transId, mBuf);
       CMCHKPK(cmPkLteRnti, datReq->rnti, mBuf);
    }
-   CMCHKPK(SPkU8, param->nmbOfUeGrantPerTti, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->nmbOfUeGrantPerTti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -3121,13 +2368,13 @@ Buffer *mBuf;
    retVal = ROK;
 #endif
    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
-   CMCHKUNPK(SUnpkU8, &param->nmbOfUeGrantPerTti, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->nmbOfUeGrantPerTti, mBuf);
    for(idx = 0; idx < param->nmbOfUeGrantPerTti; idx++)
    { 
       RguDDatReqPerUe *datReq = &param->datReq[idx];
       CMCHKUNPK(cmUnpkLteRnti, &datReq->rnti, mBuf);
-      CMCHKUNPK(SUnpkU32, &datReq->transId, mBuf);
-      CMCHKUNPK(SUnpkU8, &datReq->nmbOfTbs, mBuf);
+      CMCHKUNPK(oduPackUInt32, &datReq->transId, mBuf);
+      CMCHKUNPK(oduPackUInt8, &datReq->nmbOfTbs, mBuf);
       /* rgu_c_001.main_4 - Changes for MIMO feature addition */
       for (i=0; i<RGU_MAX_TB; i++) 
       {
@@ -3137,14 +2384,14 @@ Buffer *mBuf;
          retVal = cmUnpkRguDatReqTb(pst, &datReq->datReqTb[i], mBuf);
          if(retVal != ROK)
          {
-            RETVALUE(RFAILED);
+            return RFAILED;
          }
 #else
          CMCHKUNPK(cmUnpkRguDatReqTb, &datReq->datReqTb[i], mBuf);
 #endif
       }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -3182,15 +2429,15 @@ Buffer *mBuf;
    TRC3(cmPkRguCDatIndInfo);
 
    if (SFndLenMsg(param->pdu, &msgLen) != ROK)
-      RETVALUE(RFAILED);
+      return RFAILED;
    if (SCatMsg(mBuf, param->pdu, M1M2) != ROK)
-      RETVALUE(RFAILED);
+      return RFAILED;
    SPutMsg(param->pdu);
    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -3232,10 +2479,10 @@ Buffer *mBuf;
    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
-      RETVALUE(RFAILED);
+      return RFAILED;
    if (SSegMsg(mBuf, totalMsgLen-msgLen, &param->pdu) != ROK)
-      RETVALUE(RFAILED);
-   RETVALUE(ROK);
+      return RFAILED;
+   return ROK;
 }
 
 
@@ -3272,7 +2519,7 @@ Buffer *mBuf;
 
       CMCHKPK(cmPkRguPduInfo, &param->pdu, mBuf);
    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -3309,17 +2556,17 @@ Buffer *mBuf;
 
    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
    CMCHKUNPK(cmUnpkRguPduInfo, &param->pdu, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
 \f
 /***********************************************************
 *
-*     Func : cmPkRguDDatIndInfo
+*     Func : packRlcMacDataInfo
 *
 *
-*     Desc : RguDDatIndInfo
+*     Desc : RlcMacData
  * Data Indication from MAC to RLC for dedicated channels of a UE
 *
 *
@@ -3331,42 +2578,48 @@ Buffer *mBuf;
 *
 **********************************************************/
 #ifdef ANSI
-PUBLIC S16 cmPkRguDDatIndInfo
+PUBLIC S16 packRlcMacDataInfo
 (
-RguDDatIndInfo *param,
+RlcMacData *param,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmPkRguDDatIndInfo(param, mBuf)
-RguDDatIndInfo *param;
+PUBLIC S16 packRlcMacDataInfo(param, mBuf)
+RlcMacData *param;
 Buffer *mBuf;
 #endif
 {
    S32 i;
+   MsgLen msgLen;
 
-   TRC3(cmPkRguDDatIndInfo);
+   TRC3(packRlcMacDataInfo);
 
-#ifdef LTE_L2_MEAS
-   CMCHKPK(SPkU8, param->burstInd, mBuf);
-   CMCHKPK(SPkU32, param->ttiCnt, mBuf);
-#endif
-   for (i=param->numLch-1; i >= 0; i--) {
-      CMCHKPK(cmPkRguLchDatInd, &param->lchData[i], mBuf);
+   for (i=param->numPdu-1; i >= 0; i--)
+   {
+      msgLen = 0;
+      //if (SFndLenMsg(param->pduInfo[i].pduBuf, &msgLen) != ROK)
+      //   return RFAILED;
+      //if (SCatMsg(mBuf, param->pduInfo[i].pduBuf, M1M2) != ROK)
+      //    return RFAILED;      
+      CMCHKPK(cmPkMsgLen, msgLen, mBuf);
+      CMCHKPK(cmPkLteLcId, param->pduInfo[i].lcId, mBuf);
+      CMCHKPK(oduPackBool, param->pduInfo[i].commCh, mBuf);
    }
-   CMCHKPK(SPkU8, param->numLch, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->numPdu, mBuf);
    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
+   //CMCHKPK(cmPkLteTimingInfo, &param->timeToTx, mBuf);
+   return ROK;
 }
 
 
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRguDDatIndInfo
+*     Func : unpackRlcMacDataInfo
 *
 *
-*     Desc : RguDDatIndInfo
+*     Desc : RlcMacData
  * Data Indication from MAC to RLC for dedicated channels of a UE
 *
 *
@@ -3378,32 +2631,38 @@ Buffer *mBuf;
 *
 **********************************************************/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRguDDatIndInfo
+PUBLIC S16 unpackRlcMacDataInfo
 (
-RguDDatIndInfo *param,
+RlcMacData *param,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRguDDatIndInfo(param, mBuf)
-RguDDatIndInfo *param;
+PUBLIC S16 unpackRlcMacDataInfo(param, mBuf)
+RlcMacData *param;
 Buffer *mBuf;
 #endif
 {
    S32 i;
 
-   TRC3(cmUnpkRguDDatIndInfo);
-
+   TRC3(unpackRlcMacDataInfo);
+   
+   //CMCHKUNPK(cmUnpkLteTimingInfo, &param->timeToTx, mBuf);
    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
-   CMCHKUNPK(SUnpkU8, &param->numLch, mBuf);
-   for (i=0; i<param->numLch; i++) {
-      CMCHKUNPK(cmUnpkRguLchDatInd, &param->lchData[i], mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->numPdu, mBuf);
+   for (i=0; i<param->numPdu; i++) 
+   {
+      MsgLen totalMsgLen;
+
+      CMCHKUNPK(oduUnpackBool, &param->pduInfo[i].commCh, mBuf);
+      CMCHKUNPK(cmUnpkLteLcId, &param->pduInfo[i].lcId, mBuf);
+      CMCHKUNPK(cmUnpkMsgLen, &param->pduInfo[i].pduLen, mBuf);
+      if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
+         return RFAILED;
+      //if (SSegMsg(mBuf, totalMsgLen-param->pduInfo[i].pduLen, &param->pduInfo[i].pduBuf) != ROK)
+      //   return RFAILED;
    }
-#ifdef LTE_L2_MEAS
-   CMCHKUNPK(SUnpkU32, &param->ttiCnt, mBuf);
-   CMCHKUNPK(SUnpkU8, &param->burstInd, mBuf);
-#endif
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
@@ -3446,18 +2705,18 @@ Buffer *mBuf;
       case CM_LTE_LCH_PCCH:
          CMCHKPK(cmPkLteTimingInfo, &param->u.timeToTx, mBuf);
 #ifdef EMTC_ENABLE
-         CMCHKPK(SPkU8,param->pnb,mBuf);
-         CMCHKPK(SPkU8,param->emtcDiReason,mBuf);
+         CMCHKPK(oduUnpackUInt8,param->pnb,mBuf);
+         CMCHKPK(oduUnpackUInt8,param->emtcDiReason,mBuf);
 #endif
          break;
       default :
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
    CMCHKPK(SPkS32, param->bo, mBuf);
    CMCHKPK(cmPkLteLcType, param->lcType, mBuf);
    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -3501,8 +2760,8 @@ Buffer *mBuf;
       case CM_LTE_LCH_BCCH:
       case CM_LTE_LCH_PCCH:
 #ifdef EMTC_ENABLE
-         CMCHKUNPK(SUnpkU8,&param->emtcDiReason , mBuf);
-         CMCHKUNPK(SUnpkU8,&param->pnb , mBuf);
+         CMCHKUNPK(oduPackUInt8,&param->emtcDiReason , mBuf);
+         CMCHKUNPK(oduPackUInt8,&param->pnb , mBuf);
 #endif
          CMCHKUNPK(cmUnpkLteTimingInfo, &param->u.timeToTx, mBuf);
          break;
@@ -3510,19 +2769,19 @@ Buffer *mBuf;
          CMCHKUNPK(cmUnpkLteRnti, &param->u.rnti, mBuf);
          break;
       default :
-         RETVALUE(RFAILED);
+         return RFAILED;
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
 \f
 /***********************************************************
 *
-*     Func : cmPkRguDStaRspInfo
+*     Func : packBOStatusInfo
 *
 *
-*     Desc : RguDStaRspInfo
+*     Desc : RlcMacBOStatus
  * Status Response from RLC to MAC  for dedicated logical channel
 *
 *
@@ -3534,35 +2793,36 @@ Buffer *mBuf;
 *
 **********************************************************/
 #ifdef ANSI
-PUBLIC S16 cmPkRguDStaRspInfo
+PUBLIC S16 packBOStatusInfo
 (
-RguDStaRspInfo *param,
+RlcMacBOStatus *param,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmPkRguDStaRspInfo(param, mBuf)
-RguDStaRspInfo *param;
+PUBLIC S16 packBOStatusInfo(param, mBuf)
+RlcMacBOStatus *param;
 Buffer *mBuf;
 #endif
 {
 
-   TRC3(cmPkRguDStaRspInfo);
+   TRC3(packBOStatusInfo);
 
-   CMCHKPK(cmPkRguDBoReport, &param->boReport, mBuf);
+   CMCHKPK(SPkS32, param->bo, mBuf);
    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
+   CMCHKPK(oduPackBool, param->commCh, mBuf);
    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
-}
+   return ROK;
+} /* End of packBOStatusInfo */
 
 
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRguDStaRspInfo
+*     Func : unpackBOStatusInfo
 *
 *
-*     Desc : RguDStaRspInfo
+*     Desc : RlcMacBOStatus
  * Status Response from RLC to MAC  for dedicated logical channel
 *
 *
@@ -3574,114 +2834,27 @@ Buffer *mBuf;
 *
 **********************************************************/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRguDStaRspInfo
+PUBLIC S16 unpackBOStatusInfo
 (
-RguDStaRspInfo *param,
+RlcMacBOStatus *param,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRguDStaRspInfo(param, mBuf)
-RguDStaRspInfo *param;
+PUBLIC S16 unpackBOStatusInfo(param, mBuf)
+RlcMacBOStatus *param;
 Buffer *mBuf;
 #endif
 {
 
-   TRC3(cmUnpkRguDStaRspInfo);
+   TRC3(unpackBOStatusInfo);
 
    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
+   CMCHKUNPK(oduUnpackBool, &param->commCh, mBuf);
    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
-   CMCHKUNPK(cmUnpkRguDBoReport, &param->boReport, mBuf);
-   RETVALUE(ROK);
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRguCStaIndInfo
-*
-*
-*     Desc : RguCStaIndInfo
- * Status Indication from MAC to RLC for common logical channel
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmPkRguCStaIndInfo
-(
-RguCStaIndInfo *param,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmPkRguCStaIndInfo(param, mBuf)
-RguCStaIndInfo *param;
-Buffer *mBuf;
-#endif
-{
-
-   TRC3(cmPkRguCStaIndInfo);
-#ifdef EMTC_ENBALE
-   CMCHKPK(cmPkLteTimingInfo, &param->pagingTimingInfo, mBuf);
-   CMCHKPK(SPkU8, param->isEmtcPaging, mBuf);
-#endif
-   CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
-   CMCHKPK(SPkU32, param->transId, mBuf);
-   CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
-   CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRguCStaIndInfo
-*
-*
-*     Desc : RguCStaIndInfo
- * Status Indication from MAC to RLC for common logical channel
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguCStaIndInfo
-(
-RguCStaIndInfo *param,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkRguCStaIndInfo(param, mBuf)
-RguCStaIndInfo *param;
-Buffer *mBuf;
-#endif
-{
-
-   TRC3(cmUnpkRguCStaIndInfo);
-
-   CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
-   CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
-   CMCHKUNPK(SUnpkU32, &param->transId, mBuf);
-   /*TODO:Mukesh: Need to check why rnti unpacking is missing*/
-#ifdef EMTC_ENBALE
-   CMCHKUNPK(SUnpkU8, &param->isEmtcPaging, mBuf);
-   CMCHKUNPK(cmUnpkLteTimingInfo, &param->pagingTimingInfo, mBuf);
-#endif
-   RETVALUE(ROK);
-}
-
+   CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
+   return ROK;
+} /* End of unpackBOStatusInfo */
 
 \f
 /***********************************************************
@@ -3717,7 +2890,7 @@ Buffer *mBuf;
 
    CMCHKPK(SPkS16, param->totBufSize, mBuf);
    CMCHKPK(cmPkLteLcId, param->lcId, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -3755,7 +2928,7 @@ Buffer *mBuf;
 
    CMCHKUNPK(cmUnpkLteLcId, &param->lcId, mBuf);
    CMCHKUNPK(SUnpkS16, &param->totBufSize, mBuf);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
@@ -3792,14 +2965,14 @@ Buffer *mBuf;
    TRC3(cmPkRguStaIndTb);
 
 #ifdef LTE_L2_MEAS
-   CMCHKPK(SPkU16, param->status, mBuf);
-   CMCHKPK(SPkU32, param->tbId, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->status, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->tbId, mBuf);
 #endif   
    for (i=param->nmbLch-1; i >= 0; i--) {
       CMCHKPK(cmPkRguLchStaInd, &param->lchStaInd[i], mBuf);
    }
-   CMCHKPK(SPkU8, param->nmbLch, mBuf);
-   RETVALUE(ROK);
+   CMCHKPK(oduUnpackUInt8, param->nmbLch, mBuf);
+   return ROK;
 }
 
 
@@ -3836,24 +3009,24 @@ Buffer *mBuf;
 
    TRC3(cmUnpkRguStaIndTb);
 
-   CMCHKUNPK(SUnpkU8, &param->nmbLch, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->nmbLch, mBuf);
    for (i=0; i<param->nmbLch; i++) {
       CMCHKUNPK(cmUnpkRguLchStaInd, &param->lchStaInd[i], mBuf);
    }
 #ifdef LTE_L2_MEAS
-   CMCHKUNPK(SUnpkU32, &param->tbId, mBuf);
-   CMCHKUNPK(SUnpkU16, &param->status, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->tbId, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->status, mBuf);
 #endif   
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /***********************************************************
 *
-*     Func : cmPkRguDStaIndInfo
+*     Func : packSchedRepInfo
 *
 *
-*     Desc : RguDStaIndInfo
+*     Desc : RlcMacSchedRep
  * StaInd from MAC to RLC for dedicated logical channels of a UE
 *
 *
@@ -3864,47 +3037,37 @@ Buffer *mBuf;
 *     File  : 
 *
 **********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmPkRguDStaIndInfo
+PUBLIC S16 packSchedRepInfo
 (
-RguDStaIndInfo *param,
+RlcMacSchedRepInfo *param,
 Buffer *mBuf
 )
-#else
-PUBLIC S16 cmPkRguDStaIndInfo(param, mBuf)
-RguDStaIndInfo *param;
-Buffer *mBuf;
-#endif
 {
-   S32 i;
    S32 idx;
 
-   TRC3(cmPkRguDStaIndInfo);
+   TRC3(packSchedRepInfo);
 
-   for(idx = (param->nmbOfUeGrantPerTti - 1); idx >= 0 ; idx--)
+   for(idx = (param->nmbLch-1); idx >= 0; idx--)
    {
-      RguDStaIndPerUe *staInd = &param->staInd[idx];
-      CMCHKPK(SPkU8, staInd->fillCtrlPdu, mBuf);
-      for (i=staInd->nmbOfTbs-1; i >= 0; i--) {
-         CMCHKPK(cmPkRguStaIndTb, &staInd->staIndTb[i], mBuf);
-      }
-      CMCHKPK(SPkU8, staInd->nmbOfTbs, mBuf);
-      CMCHKPK(SPkU32,staInd->transId, mBuf);
-      CMCHKPK(cmPkLteRnti, staInd->rnti, mBuf);
+      CMCHKPK(cmPkRguLchStaInd, &param->lchSta[idx].lchStaInd, mBuf);
+      CMCHKPK(oduPackBool, param->lchSta[idx].commCh, mBuf);
    }
-   CMCHKPK(SPkU8, param->nmbOfUeGrantPerTti, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->nmbLch, mBuf);
+   CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
-   RETVALUE(ROK);
-}
+   CMCHKPK(cmPkLteTimingInfo, &param->timeToTx, mBuf);
+
+   return ROK;
+} /* End of packSchedRepInfo */
 
 
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRguDStaIndInfo
+*     Func : unpackSchedRepInfo
 *
 *
-*     Desc : RguDStaIndInfo
+*     Desc : RlcMacSchedRep
  * StaInd from MAC to RLC for dedicated logical channels of a UE
 *
 *
@@ -3915,39 +3078,28 @@ Buffer *mBuf;
 *     File  : 
 *
 **********************************************************/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguDStaIndInfo
+PUBLIC S16 unpackSchedRepInfo
 (
-RguDStaIndInfo *param,
+RlcMacSchedRepInfo *param,
 Buffer *mBuf
 )
-#else
-PUBLIC S16 cmUnpkRguDStaIndInfo(param, mBuf)
-RguDStaIndInfo *param;
-Buffer *mBuf;
-#endif
 {
-   S32 i;
    S32 idx;
 
-   TRC3(cmUnpkRguDStaIndInfo);
+   TRC3(unpackSchedRepInfo);
 
+   CMCHKUNPK(cmUnpkLteTimingInfo, &param->timeToTx, mBuf);
    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
-   CMCHKUNPK(SUnpkU8, &param->nmbOfUeGrantPerTti, mBuf);
-   for(idx = 0; idx < param->nmbOfUeGrantPerTti; idx++)
+   CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->nmbLch, mBuf);
+   for(idx = 0; idx < param->nmbLch; idx++)
    {
-      RguDStaIndPerUe *staInd = &param->staInd[idx];
-      CMCHKUNPK(cmUnpkLteRnti, &staInd->rnti, mBuf);
-      CMCHKUNPK(SUnpkU32, &staInd->transId, mBuf);
-      CMCHKUNPK(SUnpkU8, &staInd->nmbOfTbs, mBuf);
-      for (i=0; i<staInd->nmbOfTbs; i++) 
-      {
-         CMCHKUNPK(cmUnpkRguStaIndTb, &staInd->staIndTb[i], mBuf);
-      }
-      CMCHKUNPK(SUnpkU8, &staInd->fillCtrlPdu, mBuf);
+      CMCHKUNPK(oduUnpackBool, &param->lchSta[idx].commCh, mBuf);
+      CMCHKUNPK(cmUnpkRguLchStaInd, &param->lchSta[idx].lchStaInd, mBuf);
    }
-   RETVALUE(ROK);
-}
+
+   return ROK;
+} /* End of unpackSchedRepInfo */
 
 #endif