warning set 4
[o-du/l2.git] / src / cm / rgu.c
index ee3ef41..075f897 100755 (executable)
@@ -414,176 +414,13 @@ Buffer *mBuf;
 }
 
 \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));
-}
-
-\f
 /**
 * @brief Request from RLC to MAC for forwarding SDUs on 
  * dedicated channel for transmission
 *
 * @details
 *
-*     Function : cmPkRguDDatReq
+*     Function : packDlData
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SpId  spId
@@ -592,652 +429,332 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRguDDatReq
+PUBLIC S16 packDlData
 (
 Pst* pst,
 SpId spId,
-RguDDatReqInfo  * datReq
+RlcMacData  *dlData
 )
 #else
-PUBLIC S16 cmPkRguDDatReq(pst, spId, datReq)
+PUBLIC S16 packDlData(pst, spId, dlData)
 Pst* pst;
 SpId spId;
-RguDDatReqInfo  * datReq;
-#endif
-{
-   Buffer *mBuf = NULLP;
-   TRC3(cmPkRguDDatReq)
-
-   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)ERGU022, (ErrVal)0, "Packing failed");
-#endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)datReq, sizeof(RguDDatReqInfo));
-      RETVALUE(RFAILED);
-   }
-
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKPK(cmPkPtr,(PTR) datReq, mBuf);
-   }
-   else
-   {
-      /*rgu_c_001.main_5 - ADD - L2M Support */
-#ifdef LTE_L2_MEAS
-      if (cmPkRguDDatReqInfo(pst, datReq, mBuf) != ROK)
-#else
-      if (cmPkRguDDatReqInfo(datReq, mBuf) != ROK) 
-#endif
-      {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU023, (ErrVal)0, "Packing failed");
-#endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)datReq,
-                                       sizeof(RguDDatReqInfo));
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-
-      if (SPutSBuf(pst->region, pst->pool, 
-                   (Data *)datReq, sizeof(RguDDatReqInfo)) != 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);
-      }
-      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)ERGU024, (ErrVal)0, "Packing failed");
-#endif      
-      if (datReq != NULLP);
-      {
-         SPutSBuf(pst->region, pst->pool, 
-                  (Data *)datReq, sizeof(RguDDatReqInfo));
-      }
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-   pst->event = (Event) EVTRGUDDATREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief Request from RLC to MAC for forwarding SDUs on 
- * dedicated channel for transmission
-*
-* @details
-*
-*     Function : cmUnpkRguDDatReq
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguDDatReqInfo  *  datReq
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguDDatReq
-(
-RguDDatReq func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkRguDDatReq(func, pst, mBuf)
-RguDDatReq func;
-Pst *pst;
-Buffer *mBuf;
-#endif
-{
-   SpId spId;
-   RguDDatReqInfo *datReq;
-   
-   TRC3(cmUnpkRguDDatReq)
-
-   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(RguDDatReqInfo))) != 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);
-      }
-      cmMemset((U8*)datReq, (U8)0, sizeof(RguDDatReqInfo));
-  /*rgu_c_001.main_5 - ADD - L2M Support */
-#ifdef LTE_L2_MEAS
-      if (cmUnpkRguDDatReqInfo(pst,datReq, mBuf) != ROK)
-#else
-      if (cmUnpkRguDDatReqInfo(datReq, mBuf) != ROK) 
-#endif
-      {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU027, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)datReq,
-                                     sizeof(RguDDatReqInfo));
-         RETVALUE(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;
-   
-   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));
-}
-
-\f
-/**
-* @brief Data Indication from MAC to RLC to 
- * forward the data received for dedicated channels
-*
-* @details
-*
-*     Function : cmPkRguDDatInd
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguDDatIndInfo  *  datInd
-*  @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;
+RlcMacData  dlData;
 #endif
 {
    Buffer *mBuf = NULLP;
-   TRC3(cmPkRguDDatInd)
+   TRC3(packDlData)
 
    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)ERGU035, (ErrVal)0, "Packing failed");
+          (ErrVal)ERGU022, (ErrVal)0, "Packing failed");
 #endif      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
+      SPutSBuf(pst->region, pst->pool, (Data *)dlData, sizeof(RlcMacData));
       RETVALUE(RFAILED);
    }
 
    if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) datInd, mBuf);
+      CMCHKPK(cmPkPtr,(PTR) dlData, mBuf);
    }
    else
    {
-      if (cmPkRguDDatIndInfo(datInd, mBuf) != ROK) {
+      /*rgu_c_001.main_5 - ADD - L2M Support */
+#ifdef LTE_L2_MEAS
+      if (packRlcMacDataInfo(pst, dlData, mBuf) != ROK)
+#else
+      if (packRlcMacDataInfo(dlData, mBuf) != ROK) 
+#endif
+      {
 #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);
+         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
+          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
+          (ErrVal)ERGU023, (ErrVal)0, "Packing failed");
+#endif      
+         SPutSBuf(pst->region, pst->pool, (Data *)dlData,
+                                       sizeof(RlcMacData));
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
 
-      if (SPutStaticBuffer(pst->region, pst->pool, 
-                      (Data *)datInd, sizeof(RguDDatIndInfo),0) != ROK) {
+      if (SPutSBuf(pst->region, pst->pool, 
+                   (Data *)dlData, sizeof(RlcMacData)) != 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");
+              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
+             (ErrVal)ERGU025, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
-      datInd = NULLP;
+      dlData = NULLP;
    }
-   if (SPkS16(suId, mBuf) != ROK) {
+   if (SPkS16(spId, 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");
+          (ErrVal)ERGU024, (ErrVal)0, "Packing failed");
 #endif      
-      SPutStaticBuffer(pst->region, pst->pool, (Data *)datInd, sizeof(RguDDatIndInfo),0);
+      if (dlData != NULLP);
+      {
+         SPutSBuf(pst->region, pst->pool, 
+                  (Data *)dlData, sizeof(RlcMacData));
+      }
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
    }
-
-   pst->event = (Event) EVTRGUDDATIND;
+   pst->event = (Event) EVTRLCDLDAT;
    RETVALUE(SPstTsk(pst,mBuf));
 }
 
 \f
 /**
-* @brief Data Indication from MAC to RLC to 
- * forward the data received for dedicated channels
+* @brief Request from RLC to MAC for forwarding SDUs on 
+ * dedicated channel for transmission
 *
 * @details
 *
-*     Function : cmUnpkRguDDatInd
+*     Function : unpackDlData
 *
 *  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguDDatIndInfo  *  datInd
+*  @param[in]   SpId  spId
+*  @param[in]   RguDDatReqInfo  *  datReq
 *  @return   S16
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRguDDatInd
+PUBLIC S16 unpackDlData
 (
-RguDDatInd func,
+RguDDatReq func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRguDDatInd(func, pst, mBuf)
-RguDDatInd func;
+PUBLIC S16 unpackDlData(func, pst, mBuf)
+RguDDatReq func;
 Pst *pst;
 Buffer *mBuf;
 #endif
 {
-   SuId suId;
-   RguDDatIndInfo *datInd;
+   SpId spId;
+//   RguDDatReqInfo *datReq;
+   RlcMacData *dlData;
    
-   TRC3(cmUnpkRguDDatInd)
+   TRC3(unpackDlData)
 
-   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      
+   if (SUnpkS16(&spId, mBuf) != ROK) {
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
    }
 
    if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &datInd, mBuf);
+      CMCHKUNPK(cmUnpkPtr,(PTR *) &dlData, mBuf);
    }
    else 
    {
-       if ((SGetStaticBuffer(pst->region, pst->pool, 
-                    (Data **)&datInd, sizeof(RguDDatIndInfo),0)) != ROK) {
+      if ((SGetSBuf(pst->region, pst->pool, 
+                     (Data **)&dlData, sizeof(RlcMacData))) != 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");
+             (ErrVal)ERGU026, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
-      if (cmUnpkRguDDatIndInfo(datInd, mBuf) != ROK) {
+      cmMemset((U8*)dlData, (U8)0, sizeof(RlcMacData));
+  /*rgu_c_001.main_5 - ADD - L2M Support */
+#ifdef LTE_L2_MEAS
+      if (unpackRlcMacDataInfo(pst,dlData, mBuf) != ROK)
+#else
+      if (unpackRlcMacDataInfo(dlData, mBuf) != ROK) 
+#endif
+      {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU041, (ErrVal)0, "UnPacking failed");
+             (ErrVal)ERGU027, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutStaticBuffer(pst->region, pst->pool, 
-                    (Data *)datInd, sizeof(RguDDatIndInfo),0);
+         SPutSBuf(pst->region, pst->pool, (Data *)dlData,
+                                     sizeof(RlcMacData));
          RETVALUE(RFAILED);
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, datInd));
+
+   /* TODO : change function call to send RlcMacData as below: */
+   RETVALUE((*func)(pst, spId, dlData));
+   
+   //RETVALUE((*func)(pst, spId, datReq));
 }
 
 \f
 /**
-* @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for common channels
+* @brief Data Indication from MAC to RLC to 
+ * forward the data received for dedicated channels
 *
 * @details
 *
-*     Function : cmPkRguCStaRsp
+*     Function : packRcvdUlData
 *
 *  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguCStaRspInfo  *  staRsp
+*  @param[in]   SuId  suId
+*  @param[in]   RlcMacData *ulData
 *  @return   S16
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRguCStaRsp
+PUBLIC S16 packRcvdUlData
 (
 Pst* pst,
-SpId spId,
-RguCStaRspInfo  * staRsp
+SuId suId,
+RlcMacData  *ulData
 )
 #else
-PUBLIC S16 cmPkRguCStaRsp(pst, spId, staRsp)
+PUBLIC S16 packRcvdUlData(pst, suId, ulData)
 Pst* pst;
-SpId spId;
-RguCStaRspInfo  * staRsp;
+SuId suId;
+RlcMacData  *ulData;
 #endif
 {
    Buffer *mBuf = NULLP;
-   TRC3(cmPkRguCStaRsp)
+   TRC3(packRcvdUlData)
 
    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");
+          (ErrVal)ERGU035, (ErrVal)0, "Packing failed");
 #endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguCStaRspInfo));
+      SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
       RETVALUE(RFAILED);
    }
+
    if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) staRsp, mBuf);
+      CMCHKPK(cmPkPtr,(PTR)ulData, mBuf);
    }
    else
    {
-      if (cmPkRguCStaRspInfo(staRsp, 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)ERGU043, (ErrVal)0, "Packing failed");
-#endif      
-         SPutSBuf(pst->region, pst->pool, (Data *)staRsp, 
-                                     sizeof(RguCStaRspInfo));
+            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 *)ulData, sizeof(RlcMacData),0);
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
 
-      if (SPutSBuf(pst->region, pst->pool, (Data *)staRsp
-                                     sizeof(RguCStaRspInfo)) != ROK) {
+      if (SPutStaticBuffer(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)ERGU045, (ErrVal)0, "Packing failed");
+         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
+             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
+             (ErrVal)ERGU038, (ErrVal)0, "Packing failed");
 #endif      
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
-      staRsp = NULLP;
+      ulData = NULLP;
    }
-   if (SPkS16(spId, mBuf) != ROK) {
+   if (SPkS16(suId, 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");
+          (ErrVal)ERGU037, (ErrVal)0, "Packing failed");
 #endif      
-      if (staRsp != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, 
-                       (Data *)staRsp, sizeof(RguCStaRspInfo));
-      }
+      SPutStaticBuffer(pst->region, pst->pool, (Data *)ulData, sizeof(RlcMacData),0);
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
    }
 
-   pst->event = (Event) EVTRGUCSTARSP;
+   pst->event = (Event) EVTRLCULDAT;
    RETVALUE(SPstTsk(pst,mBuf));
 }
 
 \f
 /**
-* @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for common channels
+* @brief Data Indication from MAC to RLC to 
+ * forward the data received for dedicated channels
 *
 * @details
 *
-*     Function : cmUnpkRguCStaRsp
+*     Function : unpackRcvdUlData
 *
 *  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguCStaRspInfo  *  staRsp
+*  @param[in]   SuId  suId
+*  @param[in]   RlcMacData  *ulData
 *  @return   S16
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRguCStaRsp
+PUBLIC S16 unpackRcvdUlData
 (
-RguCStaRsp func,
+RguDDatInd            func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRguCStaRsp(func, pst, mBuf)
-RguCStaRsp func;
+PUBLIC S16 unpackRcvdUlData(func, pst, mBuf)
+RguDDatInd      func;
 Pst *pst;
 Buffer *mBuf;
 #endif
 {
-   SpId spId;
-   RguCStaRspInfo *staRsp;
+   SuId suId;
+   RlcMacData *ulData;
    
-   TRC3(cmUnpkRguCStaRsp)
+   TRC3(unpackRcvdUlData)
 
-   if (SUnpkS16(&spId, mBuf) != ROK) {
+   if (SUnpkS16(&suId, 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");
+          (ErrVal)ERGU039, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
    }
+
    if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staRsp, mBuf);
+      CMCHKUNPK(cmUnpkPtr,(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);
       }
-      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));
+         SPutStaticBuffer(pst->region, pst->pool
+                    (Data *)ulData, sizeof(RlcMacData),0);
          RETVALUE(RFAILED);
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, staRsp));
+   RETVALUE((*func)(pst, suId, ulData));
 }
 
+
 /*rgu_c_001.main_5 - ADD - L2M & R9 Support */
 #ifdef LTE_L2_MEAS
 
@@ -1468,337 +985,168 @@ Buffer *mBuf;
    else 
    {
       if ((SGetSBuf(pst->region, pst->pool, (Data **)&measReq,
-                              sizeof(RguL2MUlThrpMeasReqInfo))) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU054, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      if (cmUnpkRguL2MUlThrpMeasReqInfo(measReq, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-             (ErrVal)ERGU055, (ErrVal)0, "UnPacking failed");
-#endif      
-         SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
-                                sizeof(RguL2MUlThrpMeasReqInfo));
-         RETVALUE(RFAILED);
-      }
-   }
-   SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, measReq));
-}
-
-#endif
-
-
-
-\f
-/**
-* @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for dedicated channels
-*
-* @details
-*
-*     Function : cmPkRguDStaRsp
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguDStaRspInfo  *  staRsp
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmPkRguDStaRsp
-(
-Pst* pst,
-SpId spId,
-RguDStaRspInfo  *staRsp
-)
-#else
-PUBLIC S16 cmPkRguDStaRsp(pst, spId, staRsp)
-Pst* pst;
-SpId spId;
-RguDStaRspInfo  *staRsp;
-#endif
-{
-
-   RguDStaRspInfo  *staRspInfo = NULL;
-   Buffer *mBuf = NULLP;
-
-   if(SGetSBuf(pst->region, pst->pool, (Data **)&staRspInfo, sizeof(RguDStaRspInfo)) != 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);
-   }
-#ifdef ERRCLS_KW
-   /* staRspInfo cant be NULL here */
-   if (staRspInfo == NULLP)
-   {
-      RETVALUE(RFAILED);
-   }
-#endif
-   cmMemcpy((U8 *)staRspInfo, (U8 *)staRsp, sizeof(RguDStaRspInfo)); 
-   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));
-
-      RETVALUE(RFAILED);
-   }
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKPK(cmPkPtr,(PTR) staRspInfo, mBuf);
-   }
-   else
-   {
-      if (cmPkRguDStaRspInfo(staRsp, 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);
-     }
-   }
-   if (SPkS16(spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU058, (ErrVal)0, "Packing failed");
-#endif      
-      if (staRspInfo != NULLP)
-      {
-         SPutSBuf(pst->region, pst->pool, (Data *)staRspInfo, sizeof(RguDStaRspInfo));
-      }
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   pst->event = (Event) EVTRGUDSTARSP;
-   RETVALUE(SPstTsk(pst,mBuf));
-   SPutMsg(mBuf);
-}
-
-\f
-/**
-* @brief Primitive invoked from RLC to MAC to 
- * inform the BO report for dedicated channels
-*
-* @details
-*
-*     Function : cmUnpkRguDStaRsp
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   RguDStaRspInfo  *  staRsp
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkRguDStaRsp
-(
-RguDStaRsp 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)
-
-   if (SUnpkS16(&spId, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)      
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-          (ErrVal)ERGU060, (ErrVal)0, "UnPacking failed");
-#endif      
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-
-   if (pst->selector == RGU_SEL_LWLC)
-   {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staRsp, mBuf);
-   }
-   else
-   {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&staRsp, 
-                                 sizeof(RguDStaRspInfo))) != ROK) {
+                              sizeof(RguL2MUlThrpMeasReqInfo))) != 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");
+             (ErrVal)ERGU054, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
-      if (cmUnpkRguDStaRspInfo(staRsp, mBuf) != ROK) {
+      if (cmUnpkRguL2MUlThrpMeasReqInfo(measReq, 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");
+             (ErrVal)ERGU055, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguDStaRspInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)measReq, 
+                                sizeof(RguL2MUlThrpMeasReqInfo));
          RETVALUE(RFAILED);
       }
    }
    SPutMsg(mBuf);
-   (*func)(pst, spId, staRsp);
-   SPutSBuf(pst->region, pst->pool, (Data *)staRsp, sizeof(RguDStaRspInfo));
-   RETVALUE(ROK);
+   RETVALUE((*func)(pst, spId, measReq));
 }
 
+#endif
+
+
+
 \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.
+* @brief Primitive invoked from RLC to MAC to 
+ * inform the BO report for dedicated channels
 *
 * @details
 *
-*     Function : cmPkRguCStaInd
+*     Function : packBOStatus,
 *
 *  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguCStaIndInfo  *  staInd
+*  @param[in]   SpId  spId
+*  @param[in]   RlcMacBOStatus  *  staRsp
 *  @return   S16
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRguCStaInd
+PUBLIC S16 packBOStatus
 (
 Pst* pst,
-SuId suId,
-RguCStaIndInfo  * staInd
+SpId spId,
+RlcMacBOStatus  *boStatus
 )
 #else
-PUBLIC S16 cmPkRguCStaInd(pst, suId, staInd)
+PUBLIC S16 packBOStatus(pst, spId, staRsp)
 Pst* pst;
-SuId suId;
-RguCStaIndInfo  * staInd;
+SpId spId;
+RlcMacBOStatus  *boStatus;
 #endif
 {
+   RlcMacBOStatus  *boStaInfo = NULL;
    Buffer *mBuf = NULLP;
-   TRC3(cmPkRguCStaInd)
 
+   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);
+   }
+#ifdef ERRCLS_KW
+   /* boStaInfo cant be NULL here */
+   if (boStaInfo == NULLP)
+   {
+      RETVALUE(RFAILED);
+   }
+#endif
+   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)ERGU063, (ErrVal)0, "Packing failed");
+          (ErrVal)ERGU056, (ErrVal)0, "Packing failed");
 #endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
+
       RETVALUE(RFAILED);
    }
-      if (pst->selector == RGU_SEL_LWLC)
+   if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) staInd, mBuf);
+      CMCHKPK(cmPkPtr,(PTR) boStaInfo, 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 (packBOStatusInfo(boStatus, mBuf) != 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");
+        SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
+            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
+            (ErrVal)ERGU057, (ErrVal)0, "Packing failed");
 #endif      
-         SPutMsg(mBuf);
-         RETVALUE(RFAILED);
-      }
-      staInd = NULLP;
-  }
-  if (SPkS16(suId,mBuf) != ROK) {
+        SPutMsg(mBuf);
+        RETVALUE(RFAILED);
+     }
+   }
+   if (SPkS16(spId, 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");
+          (ErrVal)ERGU058, (ErrVal)0, "Packing failed");
 #endif      
-      if (staInd != NULLP)
+      if (boStaInfo != NULLP)
       {
-         SPutSBuf(pst->region, pst->pool, (Data *)staInd,
-                                     sizeof(RguCStaIndInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)boStaInfo, sizeof(RlcMacBOStatus));
       }
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
    }
-   pst->event = (Event) EVTRGUCSTAIND;
+
+   pst->event = (Event)EVTRLCBOSTA;
    RETVALUE(SPstTsk(pst,mBuf));
+   SPutMsg(mBuf);
 }
 
 \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.
+* @brief Primitive invoked from RLC to MAC to 
+* inform the BO report for dedicated channels
 *
 * @details
 *
-*     Function : cmUnpkRguCStaInd
+*     Function : unpackBOStatus
 *
 *  @param[in]   Pst*  pst
-*  @param[in]   SuId  suId
-*  @param[in]   RguCStaIndInfo  *  staInd
+*  @param[in]   SpId  spId
+*  @param[in]   RlcMacBOStatus *  staRsp
 *  @return   S16
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRguCStaInd
+PUBLIC S16 unpackBOStatus
 (
-RguCStaInd func,
+RguDStaRsp func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRguCStaInd(func, pst, mBuf)
-RguCStaInd func;
+PUBLIC S16 unpackBOStatus(func, pst, mBuf)
+RguDStaRsp func;
 Pst *pst;
 Buffer *mBuf;
 #endif
 {
-   SuId suId;
-   RguCStaIndInfo *staInd;
-   
-   TRC3(cmUnpkRguCStaInd)
+   SpId spId;
+   RlcMacBOStatus *boSta;
 
-   if (SUnpkS16(&suId, mBuf) != ROK) {
+   TRC3(unpackBOStatus)
+
+   if (SUnpkS16(&spId, 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");
+          (ErrVal)ERGU060, (ErrVal)0, "UnPacking failed");
 #endif      
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
@@ -1806,109 +1154,40 @@ Buffer *mBuf;
 
    if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staInd, mBuf);
+      CMCHKUNPK(cmUnpkPtr,(PTR *) &boSta, mBuf);
    }
    else
    {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&staInd, sizeof(RguCStaIndInfo))) != 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)ERGU068, (ErrVal)0, "UnPacking failed");
+         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
+             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
+             (ErrVal)ERGU061, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
-      if (cmUnpkRguCStaIndInfo(staInd, 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)ERGU069, (ErrVal)0, "UnPacking failed");
+             (ErrVal)ERGU062, (ErrVal)0, "UnPacking failed");
 #endif      
          SPutMsg(mBuf);
-         SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguCStaIndInfo));
+         SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
          RETVALUE(RFAILED);
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, staInd));
-}
-
-   /*rgu_c_001.main_5 - ADD - L2M Support */
-#ifdef LTE_L2_MEAS
-#if 0
-\f
-/**
-* @brief Packing function for RguLchMapInfo
-*
-* @details
-*
-*     Function : cmPkRguLchMapInfo
-*  @param[in]   RguLchMapInfo  *param
-*  @param[out]  Buffer         *mBuf 
-*  @return  Void 
-**/
-#ifdef ANSI
-PRIVATE S16 cmPkRguLchMapInfo
-(
-RguLchMapInfo   *param,
-Buffer          *mBuf
-)
-#else
-PRIVATE S16 cmPkRguLchMapInfo(param, mBuf)
-RguLchMapInfo   *param;
-Buffer          *mBuf;
-#endif
-{
-   U8    idx;
-
-   TRC3(cmPkRguLchMapInfo);
-
-   for(idx = 0; idx < RGU_MAX_LC; idx++)
-   {
-      CMCHKPK(SPkU16, param->snList[idx], mBuf);
-   }
-   CMCHKPK(cmPkLteLcId, param->lChId, mBuf);
-
+  // (*func)(pst, spId, boSta);
+   SPutSBuf(pst->region, pst->pool, (Data *)boSta, sizeof(RlcMacBOStatus));
    RETVALUE(ROK);
 }
 
-/**
-* @brief Unpacking function for RguLchMapInfo
-*
-* @details
-*
-*     Function : cmUnpkRguLchMapInfo
-*
-*  @param[out] RguLchMapInfo  *param
-*  @param[in]  Buffer        *mBuf
-*  @return   Void
-**/
-#ifdef ANSI
-PRIVATE S16 cmUnpkRguLchMapInfo
-(
-RguLchMapInfo *param, 
-Buffer       *mBuf
-)
-#else
-PRIVATE S16 cmUnpkRguLchMapInfo(param, mBuf)
-RguLchMapInfo *param;   
-Buffer       *mBuf;
-#endif
-{
-   U8    idx;
-
-   TRC3(cmUnpkRguLchMapInfo)
 
-   CMCHKUNPK(cmUnpkLteLcId, &param->lChId, mBuf);
-   for(idx = RGU_MAX_LC; idx > 0; idx--)
-   {
-      CMCHKUNPK(SUnpkU16, &param->snList[idx - 1], mBuf);
-   }
-
-   RETVALUE(ROK);
-}
-#endif
+   /*rgu_c_001.main_5 - ADD - L2M Support */
+#ifdef LTE_L2_MEAS
 \f
 /**
 * @brief Harq Status Indication from MAC to RLC  
@@ -2034,44 +1313,6 @@ RguHarqStatusInd  *harqStatusInd;
 }
 \f
 
-#if 0
-/**
-* @brief Unpacking function for RguSnMapInfo
-*
-* @details
-*
-*     Function : cmUnpkRguSnMapInfo
-*
-*  @param[out] RguSnMapInfo  *param
-*  @param[in]  Buffer        *mBuf
-*  @return  Void
-**/
-#ifdef ANSI
-PRIVATE S16 cmUnpkRguSnMapInfo
-(
-RguSnMapInfo *param, 
-Buffer       *mBuf
-)
-#else
-PRIVATE S16 cmUnpkRguSnMapInfo(param, mBuf)
-RguSnMapInfo *param;   
-Buffer       *mBuf;
-#endif
-{
-   U8    idx;
-   
-   TRC3(cmUnpkRguSnMapInfo)
-   
-   CMCHKUNPK(SUnpkU32, &param->tbId, mBuf);   
-   CMCHKUNPK(SUnpkU8, &param->numLch, mBuf);   
-   for(idx = param->numLch; idx > 0; idx--)
-   {
-      CMCHKUNPK(cmUnpkRguLchMapInfo, &param->lchMap[idx - 1], mBuf);
-   }
-   RETVALUE(ROK);
-}
-#endif
-\f
 /**
 * @brief Harq Status Indication from MAC to RLC  
 *
@@ -2170,30 +1411,30 @@ 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
+RlcMacSchedRep  * schRep
 )
 #else
-PUBLIC S16 cmPkRguDStaInd(pst, suId, staInd)
+PUBLIC S16 packSchedRep(pst, suId, staInd)
 Pst* pst;
 SuId suId;
-RguDStaIndInfo  * staInd;
+RlcMacSchedRep  * schRep;
 #endif
 {
    Buffer *mBuf = NULLP;
-   TRC3(cmPkRguDStaInd)
+   TRC3(packSchedRep)
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -2201,28 +1442,28 @@ RguDStaIndInfo  * staInd;
           __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
           (ErrVal)ERGU076, (ErrVal)0, "Packing failed");
 #endif      
-      SPutSBuf(pst->region, pst->pool, (Data *)staInd, sizeof(RguDStaIndInfo));
+      SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRep));
       RETVALUE(RFAILED);
    }
    if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKPK(cmPkPtr,(PTR) staInd, mBuf);
+      CMCHKPK(cmPkPtr,(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(RlcMacSchedRep));
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       } 
-      if (SPutSBuf(pst->region, pst->pool, (Data *)staInd,
-                                  sizeof(RguDStaIndInfo)) != ROK) {
+      if (SPutSBuf(pst->region, pst->pool, (Data *)schRep,
+                                  sizeof(RlcMacSchedRep)) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
              __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -2231,7 +1472,7 @@ RguDStaIndInfo  * staInd;
          SPutMsg(mBuf);
          RETVALUE(RFAILED);
       }
-      staInd = NULLP;
+      schRep= NULLP;
    }
    if (SPkS16(suId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -2239,15 +1480,15 @@ 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(RlcMacSchedRep));
       }
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
    }
 
-   pst->event = (Event) EVTRGUDSTAIND;
+   pst->event = (Event) EVTSCHREP;
    RETVALUE(SPstTsk(pst,mBuf));
 }
 
@@ -2260,7 +1501,7 @@ RguDStaIndInfo  * staInd;
 *
 * @details
 *
-*     Function : cmUnpkRguDStaInd
+*     Function : unpackSchedRep
 *
 *  @param[in]   Pst*  pst
 *  @param[in]   SuId  suId
@@ -2269,23 +1510,24 @@ RguDStaIndInfo  * staInd;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRguDStaInd
+PUBLIC S16 unpackSchedRep
 (
 RguDStaInd func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRguDStaInd(func, pst, mBuf)
+PUBLIC S16 unpackSchedRep(func, pst, mBuf)
 RguDStaInd func;
 Pst *pst;
 Buffer *mBuf;
 #endif
 {
    SuId suId;
-   RguDStaIndInfo *staInd;
+//   RguDStaIndInfo *staInd;
+   RlcMacSchedRep *schRep;
    
-   TRC3(cmUnpkRguDStaInd)
+   TRC3(unpackSchedRep)
 
    if (SUnpkS16(&suId, mBuf) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
@@ -2298,11 +1540,11 @@ Buffer *mBuf;
    }
    if (pst->selector == RGU_SEL_LWLC)
    {
-      CMCHKUNPK(cmUnpkPtr,(PTR *) &staInd, mBuf);
+      CMCHKUNPK(cmUnpkPtr,(PTR *) &schRep, mBuf);
    }
    else 
    {
-      if ((SGetSBuf(pst->region, pst->pool, (Data **)&staInd, sizeof(RguDStaIndInfo))) != ROK) {
+      if ((SGetSBuf(pst->region, pst->pool, (Data **)&schRep, sizeof(RlcMacSchedRep))) != ROK) {
 #if (ERRCLASS & ERRCLS_ADD_RES)      
          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
@@ -2311,19 +1553,19 @@ Buffer *mBuf;
          SPutMsg(mBuf);
          RETVALUE(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));
+         SPutSBuf(pst->region, pst->pool, (Data *)schRep, sizeof(RlcMacSchedRep));
          RETVALUE(RFAILED);
       }
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, staInd));
+   RETVALUE((*func)(pst, suId, schRep));
 }
 
 #ifdef ANSI
@@ -3427,10 +2669,10 @@ Buffer *mBuf;
 \f
 /***********************************************************
 *
-*     Func : cmPkRguDDatIndInfo
+*     Func : packRlcMacDataInfo
 *
 *
-*     Desc : RguDDatIndInfo
+*     Desc : RlcMacData
  * Data Indication from MAC to RLC for dedicated channels of a UE
 *
 *
@@ -3442,31 +2684,37 @@ 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->nmbPdu-1; i >= 0; i--)
+   {
+      msgLen = 0;
+      if (SFndLenMsg(param->pduInfo[i].pduBuf, &msgLen) != ROK)
+         RETVALUE(RFAILED);
+      if (SCatMsg(mBuf, param->pduInfo[i].pduBuf, M1M2) != ROK)
+          RETVALUE(RFAILED);      
+      CMCHKPK(cmPkMsgLen, msgLen, mBuf);
+      CMCHKPK(cmPkLteLcId, param->pduInfo[i].lcId, mBuf);
+      CMCHKPK(cmPkBool, param->pduInfo[i].commCh, mBuf);
    }
-   CMCHKPK(SPkU8, param->numLch, mBuf);
+   CMCHKPK(SPkU8, param->nmbPdu, mBuf);
    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
+   CMCHKPK(cmPkLteTimingInfo, &param->timeToTx, mBuf);
    RETVALUE(ROK);
 }
 
@@ -3474,10 +2722,10 @@ Buffer *mBuf;
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRguDDatIndInfo
+*     Func : unpackRlcMacDataInfo
 *
 *
-*     Desc : RguDDatIndInfo
+*     Desc : RlcMacData
  * Data Indication from MAC to RLC for dedicated channels of a UE
 *
 *
@@ -3489,31 +2737,37 @@ 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(SUnpkU8, &param->nmbPdu, mBuf);
+   for (i=0; i<param->nmbPdu; i++) 
+   {
+      MsgLen totalMsgLen;
+
+      CMCHKUNPK(cmUnpkBool, &param->pduInfo[i].commCh, mBuf);
+      CMCHKUNPK(cmUnpkLteLcId, &param->pduInfo[i].lcId, mBuf);
+      CMCHKUNPK(cmUnpkMsgLen, &param->pduInfo[i].pduLen, mBuf);
+      if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
+         RETVALUE(RFAILED);
+      if (SSegMsg(mBuf, totalMsgLen-param->pduInfo[i].pduLen, &param->pduInfo[i].pduBuf) != ROK)
+         RETVALUE(RFAILED);
    }
-#ifdef LTE_L2_MEAS
-   CMCHKUNPK(SUnpkU32, &param->ttiCnt, mBuf);
-   CMCHKUNPK(SUnpkU8, &param->burstInd, mBuf);
-#endif
    RETVALUE(ROK);
 }
 
@@ -3630,10 +2884,10 @@ Buffer *mBuf;
 \f
 /***********************************************************
 *
-*     Func : cmPkRguDStaRspInfo
+*     Func : packBOStatusInfo
 *
 *
-*     Desc : RguDStaRspInfo
+*     Desc : RlcMacBOStatus
  * Status Response from RLC to MAC  for dedicated logical channel
 *
 *
@@ -3645,35 +2899,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(cmPkBool, param->commCh, mBuf);
    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
    RETVALUE(ROK);
-}
+} /* End of packBOStatusInfo */
 
 
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRguDStaRspInfo
+*     Func : unpackBOStatusInfo
 *
 *
-*     Desc : RguDStaRspInfo
+*     Desc : RlcMacBOStatus
  * Status Response from RLC to MAC  for dedicated logical channel
 *
 *
@@ -3685,114 +2940,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(cmUnpkBool, &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
+   CMCHKUNPK(SUnpkS32, &param->bo, mBuf);
    RETVALUE(ROK);
-}
-
+} /* End of unpackBOStatusInfo */
 
 \f
 /***********************************************************
@@ -3961,10 +3129,10 @@ Buffer *mBuf;
 \f
 /***********************************************************
 *
-*     Func : cmPkRguDStaIndInfo
+*     Func : packSchedRepInfo
 *
 *
-*     Desc : RguDStaIndInfo
+*     Desc : RlcMacSchedRep
  * StaInd from MAC to RLC for dedicated logical channels of a UE
 *
 *
@@ -3976,46 +3144,42 @@ Buffer *mBuf;
 *
 **********************************************************/
 #ifdef ANSI
-PUBLIC S16 cmPkRguDStaIndInfo
+PUBLIC S16 packSchedRepInfo
 (
-RguDStaIndInfo *param,
+RlcMacSchedRep *param,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmPkRguDStaIndInfo(param, mBuf)
-RguDStaIndInfo *param;
+PUBLIC S16 packSchedRepInfo(param, mBuf)
+RlcMacSchedRep *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(cmPkBool, param->lchSta[idx].commCh, mBuf);
    }
-   CMCHKPK(SPkU8, param->nmbOfUeGrantPerTti, mBuf);
+   CMCHKPK(SPkU8, param->nmbLch, mBuf);
+   CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
+   CMCHKPK(cmPkLteTimingInfo, &param->timeToTx, mBuf);
+
    RETVALUE(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
 *
 *
@@ -4027,38 +3191,33 @@ Buffer *mBuf;
 *
 **********************************************************/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRguDStaIndInfo
+PUBLIC S16 unpackSchedRepInfo
 (
-RguDStaIndInfo *param,
+RlcMacSchedRep *param,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRguDStaIndInfo(param, mBuf)
-RguDStaIndInfo *param;
+PUBLIC S16 unpackSchedRepInfo(param, mBuf)
+RlcMacSchedRep *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(SUnpkU8, &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(cmUnpkBool, &param->lchSta[idx].commCh, mBuf);
+      CMCHKUNPK(cmUnpkRguLchStaInd, &param->lchSta[idx].lchStaInd, mBuf);
    }
+
    RETVALUE(ROK);
-}
+} /* End of unpackSchedRepInfo */
 
 #endif