[Epic-ID: ODUHIGH-461][Task-ID: ODUHIGH-468]Unused files and functions removed/disabled
[o-du/l2.git] / src / cm / lrg.c
index 1b6dcfc..84a4d30 100755 (executable)
@@ -504,18 +504,18 @@ RgMngmt * cfm
 
 \f
 /**
-* @brief This API is used to send a 
-Statistics Confirm from MAC to LM.
-*
-* @details
-*
-*     Function: cmUnpkLrgStsCfm
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cfm
-*  @return   S16
-*      -# ROK
-**/
+ * * @brief This API is used to send a 
+ * Statistics Confirm from MAC to LM.
+ * *
+ * * @details
+ * *
+ * *     Function: cmUnpkLrgStsCfm
+ * *
+ * *  @param[in]   Pst *  pst
+ * *  @param[in]   RgMngmt *  cfm
+ * *  @return   S16
+ * *      -# ROK
+ * **/
 S16 cmUnpkLrgStsCfm
 (
 LrgStsCfm func,
@@ -524,7 +524,7 @@ Buffer *mBuf
 )
 {
    RgMngmt cfm;
-   
+
 
    if (cmUnpkRgMngmt(pst, &cfm, EVTLRGSTSCFM, mBuf) != ROK) {
       SPutMsg(mBuf);
@@ -540,170 +540,6 @@ Buffer *mBuf
 }
 
 \f
-/**
-* @brief This API is used to send a 
-Status Request from LM to MAC.
-*
-* @details
-*
-*     Function: cmPkLrgStaReq
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  sta
-*  @return   S16
-*      -# ROK
-**/
-S16 cmPkLrgStaReq
-(
-Pst * pst,
-RgMngmt * sta
-)
-{
-   Buffer *mBuf = NULLP;
-
-   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)ELRG019, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   if (cmPkRgMngmt(pst, sta, EVTLRGSSTAREQ, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG020, (ErrVal)0, "Packing failed");
-#endif
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-   
-   pst->event = (Event) EVTLRGSSTAREQ;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Status Request from LM to MAC.
-*
-* @details
-*
-*     Function: cmUnpkLrgStaReq
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  sta
-*  @return   S16
-*      -# ROK
-**/
-S16 cmUnpkLrgStaReq
-(
-LrgStaReq func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   RgMngmt sta;
-   
-   
-   memset(&sta, 0, sizeof(RgMngmt));
-   if (cmUnpkRgMngmt(pst, &sta, EVTLRGSSTAREQ, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG021, (ErrVal)0, "Packing failed");
-#endif
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, &sta));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Status Confirm from MAC to LM.
-*
-* @details
-*
-*     Function: cmPkLrgStaCfm
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cfm
-*  @return   S16
-*      -# ROK
-**/
-S16 cmPkLrgStaCfm
-(
-Pst * pst,
-RgMngmt * cfm
-)
-{
-   Buffer *mBuf = NULLP;
-
-   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)ELRG022, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   if (cmPkRgMngmt(pst, cfm, EVTLRGSSTACFM, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG023, (ErrVal)0, "Packing failed");
-#endif
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-   
-   pst->event = (Event) EVTLRGSSTACFM;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Status Confirm from MAC to LM.
-*
-* @details
-*
-*     Function: cmUnpkLrgStaCfm
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cfm
-*  @return   S16
-*      -# ROK
-**/
-S16 cmUnpkLrgStaCfm
-(
-LrgStaCfm func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   RgMngmt cfm;
-   
-  
-   memset(&cfm, 0, sizeof(RgMngmt));
-   if (cmUnpkRgMngmt(pst, &cfm, EVTLRGSSTACFM, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG024, (ErrVal)0, "Packing failed");
-#endif
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, &cfm));
-}
-
-\f
 /**
 * @brief This API is used to send a 
 Status Indication from MAC to LM.
@@ -870,961 +706,86 @@ Buffer *mBuf
 }
 
 \f
-/**
-* @brief This API is used to send a 
-Control Request from LM to MAC.
+/***********************************************************
 *
-* @details
+*     Func : cmPkRgGenCfg
 *
-*     Function: cmPkLrgCntrlReq
 *
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cntrl
-*  @return   S16
-*      -# ROK
-**/
-S16 cmPkLrgCntrlReq
+*     Desc :   This structure holds configuration parameters for MAC General Configuration.
+*
+*
+*     Ret  : S16
+*
+*     Notes:
+*
+*     File  : 
+*
+**********************************************************/
+S16 cmPkRgGenCfg
 (
-Pst * pst,
-RgMngmt * cntrl
+RgGenCfg *param,
+Buffer *mBuf
 )
 {
-   Buffer *mBuf = NULLP;
 
-   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)ELRG031, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LC) {
-      if (cmPkRgMngmt(pst, cntrl, EVTLRGCNTRLREQ, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG032, (ErrVal)0, "Packing failed");
+
+#ifdef LTE_ADV
+   CMCHKPK(oduUnpackUInt8, param->isSCellActDeactAlgoEnable, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->forceCntrlSrbBoOnPCel, mBuf);
 #endif
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-   }
-   
-   pst->event = (Event) EVTLRGCNTRLREQ;
-   return (SPstTsk(pst,mBuf));
+   CMCHKPK(oduUnpackUInt8, param->startCellId, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->numRguSaps, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->tmrRes, mBuf);
+   CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
+   CMCHKPK(cmPkPst, &param->lmPst, mBuf);
+   return ROK;
 }
 
+
 \f
-/**
-* @brief This API is used to send a 
-Control Request from LM to MAC.
+/***********************************************************
 *
-* @details
+*     Func : cmUnpkRgGenCfg
 *
-*     Function: cmUnpkLrgCntrlReq
 *
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cntrl
-*  @return   S16
-*      -# ROK
-**/
-S16 cmUnpkLrgCntrlReq
+*     Desc :   This structure holds configuration parameters for MAC General Configuration.
+*
+*
+*     Ret  : S16
+*
+*     Notes:
+*
+*     File  : 
+*
+**********************************************************/
+S16 cmUnpkRgGenCfg
 (
-LrgCntrlReq func,
-Pst *pst,
+RgGenCfg *param,
 Buffer *mBuf
 )
 {
-   RgMngmt cntrl;
-   
 
-   if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGCNTRLREQ, mBuf) != ROK) {
-      SPutMsg(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG033, (ErrVal)0, "Packing failed");
+
+   CMCHKUNPK(cmUnpkPst, &param->lmPst, mBuf);
+   CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->tmrRes, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->numRguSaps, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->startCellId, mBuf);
+#ifdef LTE_ADV
+   CMCHKUNPK(oduPackUInt8, &param->forceCntrlSrbBoOnPCel, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->isSCellActDeactAlgoEnable, mBuf);
 #endif
-      return RFAILED;
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, &cntrl));
+   return ROK;
 }
 
+
 \f
-/**
-* @brief This API is used to send a 
-Control Request from LM to SCH.
+/***********************************************************
 *
-* @details
+*     Func : cmPkRgUpSapCfg
 *
-*     Function: cmPkLrgSchCntrlReq
 *
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cntrl
-*  @return   S16
-*      -# ROK
-**/
-S16 cmPkLrgSchCntrlReq
-(
-Pst * pst,
-RgMngmt * cntrl
-)
-{
-   Buffer *mBuf = NULLP;
-
-   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)ELRG034, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LC) {
-      if (cmPkRgMngmt(pst, cntrl, EVTLRGSCHCNTRLREQ, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG035, (ErrVal)0, "Packing failed");
-#endif
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-   }
-   
-   pst->event = (Event) EVTLRGSCHCNTRLREQ;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Control Request from LM to SCH.
-*
-* @details
-*
-*     Function: cmUnpkLrgSchCntrlReq
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cntrl
-*  @return   S16
-*      -# ROK
-**/
-S16 cmUnpkLrgSchCntrlReq
-(
-LrgSchCntrlReq func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   RgMngmt cntrl;
-   
-
-   if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGSCHCNTRLREQ, mBuf) != ROK) {
-      SPutMsg(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG036, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, &cntrl));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Control Confirm from MAC to LM.
-*
-* @details
-*
-*     Function: cmPkLrgCntrlCfm
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cfm
-*  @return   S16
-*      -# ROK
-**/
-S16 cmPkLrgCntrlCfm
-(
-Pst * pst,
-RgMngmt * cfm
-)
-{
-   Buffer *mBuf = NULLP;
-
-   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)ELRG037, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LC) {
-      if (cmPkRgMngmt(pst, cfm, EVTLRGCNTRLCFM, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG038, (ErrVal)0, "Packing failed");
-#endif
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-   }
-   
-   pst->event = (Event) EVTLRGCNTRLCFM;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Control Confirm from MAC to LM.
-*
-* @details
-*
-*     Function: cmUnpkLrgCntrlCfm
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cfm
-*  @return   S16
-*      -# ROK
-**/
-S16 cmUnpkLrgCntrlCfm
-(
-LrgCntrlCfm func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   RgMngmt cfm;
-   
-
-   if (cmUnpkRgMngmt(pst, &cfm, EVTLRGCNTRLCFM, mBuf) != ROK) {
-      SPutMsg(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG039, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, &cfm));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Control Confirm from SCH to LM.
-*
-* @details
-*
-*     Function: cmPkLrgSchCntrlCfm
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cntrl
-*  @return   S16
-*      -# ROK
-**/
-S16 cmPkLrgSchCntrlCfm
-(
-Pst * pst,
-RgMngmt * cntrl
-)
-{
-   Buffer *mBuf = NULLP;
-
-   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)ELRG040, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LC) {
-      if (cmPkRgMngmt(pst, cntrl, EVTLRGSCHCNTRLCFM, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG041, (ErrVal)0, "Packing failed");
-#endif
-         SPutMsg(mBuf);
-         return RFAILED;
-      }
-   }
-   
-   pst->event = (Event) EVTLRGSCHCNTRLCFM;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Control Confirm from SCH to LM.
-*
-* @details
-*
-*     Function: cmUnpkLrgSchCntrlCfm
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  cntrl
-*  @return   S16
-*      -# ROK
-**/
-S16 cmUnpkLrgSchCntrlCfm
-(
-LrgSchCntrlCfm func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   RgMngmt cntrl;
-   
-
-   if (cmUnpkRgMngmt(pst, &cntrl, EVTLRGSCHCNTRLCFM, mBuf) != ROK) {
-      SPutMsg(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG042, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, &cntrl));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Trace Indication from MAC to LM.
-*
-* @details
-*
-*     Function: cmPkLrgTrcInd
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  trc
-*  @param[in]   Buffer *  trcBuf
-*  @return   S16
-*      -# ROK
-**/
-S16 cmPkLrgTrcInd
-(
-Pst * pst,
-RgMngmt * trc,
-Buffer * trcBuf
-)
-{
-   Buffer *mBuf = NULLP;
-
-   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)ELRG043, (ErrVal)0, "Packing failed");
-#endif
-      SPutMsg(trcBuf);
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LC) {
-      MsgLen msgLen;
-      if (SFndLenMsg(trcBuf, &msgLen) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG044, (ErrVal)0, "Packing failed");
-#endif
-         SPutMsg(trcBuf);
-         return RFAILED;
-      }
-      if (SCatMsg(mBuf, trcBuf, M1M2) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-         SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG045, (ErrVal)0, "Packing failed");
-#endif
-         SPutMsg(trcBuf);
-         return RFAILED;
-      }
-      SPutMsg(trcBuf);
-      CMCHKPK(cmPkMsgLen, msgLen, mBuf);
-   }
-   if (cmPkRgMngmt(pst, trc, EVTLRGTRCIND, mBuf) != ROK) {
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG046, (ErrVal)0, "Packing failed");
-#endif
-      SPutMsg(trcBuf);
-      SPutMsg(mBuf);
-      return RFAILED;
-   }
-   
-   pst->event = (Event) EVTLRGTRCIND;
-   return (SPstTsk(pst,mBuf));
-}
-
-\f
-/**
-* @brief This API is used to send a 
-Trace Indication from MAC to LM.
-*
-* @details
-*
-*     Function: cmUnpkLrgTrcInd
-*
-*  @param[in]   Pst *  pst
-*  @param[in]   RgMngmt *  trc
-*  @param[in]   Buffer *  trcBuf
-*  @return   S16
-*      -# ROK
-**/
-S16 cmUnpkLrgTrcInd
-(
-LrgTrcInd func,
-Pst *pst,
-Buffer *mBuf
-)
-{
-   RgMngmt trc;
-  /* lrg_c_001.main_3 - MODIFY -  Modified trcBuf to have it initialized to NULLP */
-   Buffer *trcBuf = NULLP;
-   
-   
-   if (cmUnpkRgMngmt(pst, &trc, EVTLRGTRCIND, mBuf) != ROK) {
-      SPutMsg(mBuf);
-#if (ERRCLASS & ERRCLS_ADD_RES)
-      SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-            __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-            (ErrVal)ELRG047, (ErrVal)0, "Packing failed");
-#endif
-      return RFAILED;
-   }
-   if (pst->selector == ODU_SELECTOR_LC) {
-      MsgLen msgLen, totalMsgLen;
-      CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
-      if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
-         return RFAILED;
-      if (SSegMsg(mBuf, totalMsgLen-msgLen, &trcBuf) != ROK)
-         return RFAILED;
-   }
-   SPutMsg(mBuf);
-   return ((*func)(pst, &trc, trcBuf));
-}
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgGenCfg
-*
-*
-*     Desc :   This structure holds configuration parameters for MAC General Configuration.
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgGenCfg
-(
-RgGenCfg *param,
-Buffer *mBuf
-)
-{
-
-
-#ifdef LTE_ADV
-   CMCHKPK(oduUnpackUInt8, param->isSCellActDeactAlgoEnable, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->forceCntrlSrbBoOnPCel, mBuf);
-#endif
-   CMCHKPK(oduUnpackUInt8, param->startCellId, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->numRguSaps, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->tmrRes, mBuf);
-   CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
-   CMCHKPK(cmPkPst, &param->lmPst, mBuf);
-   return ROK;
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRgGenCfg
-*
-*
-*     Desc :   This structure holds configuration parameters for MAC General Configuration.
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmUnpkRgGenCfg
-(
-RgGenCfg *param,
-Buffer *mBuf
-)
-{
-
-
-   CMCHKUNPK(cmUnpkPst, &param->lmPst, mBuf);
-   CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->tmrRes, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->numRguSaps, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->startCellId, mBuf);
-#ifdef LTE_ADV
-   CMCHKUNPK(oduPackUInt8, &param->forceCntrlSrbBoOnPCel, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->isSCellActDeactAlgoEnable, mBuf);
-#endif
-   return ROK;
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgUpSapCfg
-*
-*
-*     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgUpSapCfg
-(
-RgUpSapCfg *param,
-Buffer *mBuf
-)
-{
-
-
-   CMCHKPK(SPkS16, param->suId, mBuf);
-   CMCHKPK(SPkS16, param->spId, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->route, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
-   CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
-   return ROK;
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRgUpSapCfg
-*
-*
-*     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmUnpkRgUpSapCfg
-(
-RgUpSapCfg *param,
-Buffer *mBuf
-)
-{
-
-
-   CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
-   CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
-   CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
-   CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
-   return ROK;
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgLowSapCfg
-*
-*
-*     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgLowSapCfg
-(
-RgLowSapCfg *param,
-Buffer *mBuf
-)
-{
-
-
-   CMCHKPK(cmPkTmrCfg, &param->bndTmr, mBuf);
-   CMCHKPK(SPkS16, param->suId, mBuf);
-   CMCHKPK(SPkS16, param->spId, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->route, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
-   CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
-   return ROK;
-}
-
-
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRgLowSapCfg
-*
-*
-*     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmUnpkRgLowSapCfg
-(
-RgLowSapCfg *param,
-Buffer *mBuf
-)
-{
-
-
-   CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
-   CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
-   CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
-   CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
-   CMCHKUNPK(cmUnpkTmrCfg, &param->bndTmr, mBuf);
-   return ROK;
-}
-
-#ifdef MAC_SCH_STATS
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgAckNack
-*
-*
-*     Desc :   Ack and Nack statistics
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgAckNack
-(
-RgAckNack *param,
-Buffer *mBuf
-)
-{
-
-
-   CMCHKPK(oduUnpackUInt16, param->numOfAcks, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->numOfNacks, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
-
-   return ROK;
-} /* cmPkRgAckNack */
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgSchNackAckStats
-*
-*
-*     Desc :   
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgSchNackAckStats
-(
-RgSchNackAckStats *param,
-Buffer *mBuf
-)
-{
-
-   S32 i;
-
-   for (i=14; i >= 0; i--) {
-      CMCHKPK(cmPkRgAckNack, &param->ulCqiStat[i], mBuf);
-   }
-
-   for (i=14; i >= 0; i--) {
-      CMCHKPK(cmPkRgAckNack, &param->dlCqiStat[i], mBuf);
-   }
-
-   return ROK;
-}
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgHqNumRetx
-*
-*
-*     Desc :   Harq Retransmission statistics
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgHqNumRetx
-(
-RgSchHqNumRetx *param,
-Buffer *mBuf
-)
-{
-
-   CMCHKPK(oduUnpackUInt32, param->totalTx, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->numOfHQ_4, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->numOfHQ_3, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->numOfHQ_2, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->numOfHQ_1, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
-
-   return ROK;
-} /* cmPkRgHqNumRetx */
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgSchHqRetxStats
-*
-*
-*     Desc :   
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgSchHqRetxStats
-(
-RgSchHqRetxStats *param,
-Buffer *mBuf
-)
-{
-
-   S32 i;
-
-   for (i=14; i >= 0; i--) {
-      CMCHKPK(cmPkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
-   }
-
-   for (i=14; i >= 0; i--) {
-      CMCHKPK(cmPkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
-   }
-
-   return ROK;
-} /* cmPkRgSchHqRetxStats */
-
-/* unpcaking functions */
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRgAckNack
-*
-*
-*     Desc :   Ack and Nack statistics
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmUnpkRgAckNack
-(
-RgAckNack *param,
-Buffer *mBuf
-)
-{
-
-
-   CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numOfNacks, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numOfAcks, mBuf);
-
-   return ROK;
-} /* cmUnkRgAckNack */
-
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRgSchNackAckStats
-*
-*
-*     Desc :   
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmUnpkRgSchNackAckStats
-(
-RgSchNackAckStats *param,
-Buffer *mBuf
-)
-{
-   S32 i;
-
-   for (i=0; i <= 14; i++) {
-      CMCHKUNPK(cmUnpkRgAckNack, &param->dlCqiStat[i], mBuf);
-   }
-
-   for (i=0; i <= 14; i++) {
-      CMCHKUNPK(cmUnpkRgAckNack, &param->ulCqiStat[i], mBuf);
-   }
-
-   return ROK;
-} /* cmUnpkRgSchNackAckStats */
-
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRgHqNumRetx
-*
-*
-*     Desc :   Harq Retransmission statistics
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmUnpkRgHqNumRetx
-(
-RgSchHqNumRetx *param,
-Buffer *mBuf
-)
-{
-
-   CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_1, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_2, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_3, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_4, mBuf);
-   CMCHKUNPK(oduPackUInt32, &param->totalTx, mBuf);
-
-   return ROK;
-} /* cmUnpkRgHqNumRetx */
-
-\f
-/***********************************************************
-*
-*     Func : cmUnpkRgSchHqRetxStats
-*
-*
-*     Desc :   
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmUnpkRgSchHqRetxStats
-(
-RgSchHqRetxStats *param,
-Buffer *mBuf
-)
-{
-   S32 i;
-
-   for (i=0; i <= 14; i++) {
-      CMCHKUNPK(cmUnpkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
-   }
-
-   for (i=0; i <= 14; i++) {
-      CMCHKUNPK(cmUnpkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
-   }
-
-   return ROK;
-} /* cmUnpkRgSchHqRetxStats */
-
-#endif /* MAC_SCH_STATS */
-
-\f
-/***********************************************************
-*
-*     Func : cmPkRgGenSts
-*
-*
-*     Desc :   This structure holds General Statistical information of MAC.
+*     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
 *
 *
 *     Ret  : S16
@@ -1834,20 +795,23 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgGenSts
+S16 cmPkRgUpSapCfg
 (
-RgGenSts *param,
+RgUpSapCfg *param,
 Buffer *mBuf
 )
 {
 
-#ifdef MAC_SCH_STATS
-   CMCHKPK(cmPkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
-   CMCHKPK(cmPkRgSchNackAckStats, &param->nackAckStats, mBuf);
-#endif /* MAC_SCH_STATS */
-   CMCHKPK(oduUnpackUInt16, param->numCellCfg, mBuf);
-   CMCHKPK(oduUnpackUInt32, param->numUeCfg, mBuf);
-   CMCHKPK(oduUnpackUInt32, param->numHarqFail, mBuf);
+
+   CMCHKPK(SPkS16, param->suId, mBuf);
+   CMCHKPK(SPkS16, param->spId, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->route, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
+   CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
    return ROK;
 }
 
@@ -1855,10 +819,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgGenSts
+*     Func : cmUnpkRgUpSapCfg
 *
 *
-*     Desc :   This structure holds General Statistical information of MAC.
+*     Desc :   This structure holds configuration parameters for MAC Upper SAP Configuration.
 *
 *
 *     Ret  : S16
@@ -1868,20 +832,23 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgGenSts
+S16 cmUnpkRgUpSapCfg
 (
-RgGenSts *param,
+RgUpSapCfg *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(oduPackUInt32, &param->numHarqFail, mBuf);
-   CMCHKUNPK(oduPackUInt32, &param->numUeCfg, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numCellCfg, mBuf);
-#ifdef MAC_SCH_STATS
-   CMCHKUNPK(cmUnpkRgSchNackAckStats, &param->nackAckStats, mBuf);
-   CMCHKUNPK(cmUnpkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
-#endif /* MAC_SCH_STATS */
+
+   CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
+   CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
+   CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
+   CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
    return ROK;
 }
 
@@ -1889,10 +856,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmPkRgSapSts
+*     Func : cmPkRgLowSapCfg
 *
 *
-*     Desc :   This structure holds Statistical information of a SAP in MAC.
+*     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
 *
 *
 *     Ret  : S16
@@ -1902,16 +869,24 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgSapSts
+S16 cmPkRgLowSapCfg
 (
-RgSapSts *param,
+RgLowSapCfg *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKPK(oduUnpackUInt32, param->numPduDrop, mBuf);
-   CMCHKPK(oduUnpackUInt32, param->numPduTxmit, mBuf);
-   CMCHKPK(oduUnpackUInt32, param->numPduRcvd, mBuf);
+
+   CMCHKPK(cmPkTmrCfg, &param->bndTmr, mBuf);
+   CMCHKPK(SPkS16, param->suId, mBuf);
+   CMCHKPK(SPkS16, param->spId, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->route, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->inst, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->ent, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->procId, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->prior, mBuf);
+   CMCHKPK(cmPkMemoryId, &param->mem, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->selector, mBuf);
    return ROK;
 }
 
@@ -1919,10 +894,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgSapSts
+*     Func : cmUnpkRgLowSapCfg
 *
 *
-*     Desc :   This structure holds Statistical information of a SAP in MAC.
+*     Desc :   This structure holds configuration parameters for MAC Lower SAP Configuration.
 *
 *
 *     Ret  : S16
@@ -1932,27 +907,36 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgSapSts
+S16 cmUnpkRgLowSapCfg
 (
-RgSapSts *param,
+RgLowSapCfg *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(oduPackUInt32, &param->numPduRcvd, mBuf);
-   CMCHKUNPK(oduPackUInt32, &param->numPduTxmit, mBuf);
-   CMCHKUNPK(oduPackUInt32, &param->numPduDrop, mBuf);
+
+   CMCHKUNPK(oduPackUInt8, &param->selector, mBuf);
+   CMCHKUNPK(cmUnpkMemoryId, &param->mem, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->prior, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->procId, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->ent, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->inst, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->route, mBuf);
+   CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
+   CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
+   CMCHKUNPK(cmUnpkTmrCfg, &param->bndTmr, mBuf);
    return ROK;
 }
 
+#ifdef MAC_SCH_STATS
 
 \f
 /***********************************************************
 *
-*     Func : cmPkRgSchInstCfg
+*     Func : cmPkRgAckNack
 *
 *
-*     Desc : Scheduler Configuration
+*     Desc :   Ack and Nack statistics
 *
 *
 *     Ret  : S16
@@ -1962,38 +946,28 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgSchInstCfg
+S16 cmPkRgAckNack
 (
-RgSchInstCfg *param,
+RgAckNack *param,
 Buffer *mBuf
 )
 {
 
-   S32 i;
 
-   for (i=param->numSaps-1; i >= 0; i--) {
-      CMCHKPK(cmPkRgLowSapCfg, &param->tfuSap[i], mBuf);
-   }
-   for (i=param->numSaps-1; i >= 0; i--) {
-      CMCHKPK(cmPkRgUpSapCfg, &param->rgrSap[i], mBuf);
-   }
-   for (i=param->numSaps-1; i >= 0; i--) {
-      CMCHKPK(cmPkRgUpSapCfg, &param->rgmSap[i], mBuf);
-   }
-   CMCHKPK(oduUnpackUInt8, param->numSaps, mBuf);
-   CMCHKPK(cmPkRgGenCfg, &param->genCfg, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->instId, mBuf);
-   return ROK;
-}
+   CMCHKPK(oduUnpackUInt16, param->numOfAcks, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->numOfNacks, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
 
+   return ROK;
+} /* cmPkRgAckNack */
 
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgSchInstCfg
+*     Func : cmPkRgSchNackAckStats
 *
 *
-*     Desc : Scheduler Configuration
+*     Desc :   
 *
 *
 *     Ret  : S16
@@ -2003,85 +977,33 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgSchInstCfg
+S16 cmPkRgSchNackAckStats
 (
-RgSchInstCfg *param,
+RgSchNackAckStats *param,
 Buffer *mBuf
 )
 {
 
    S32 i;
 
-   CMCHKUNPK(oduPackUInt8, &param->instId, mBuf);
-   CMCHKUNPK(cmUnpkRgGenCfg, &param->genCfg, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->numSaps, mBuf);
-   for (i=0; i<param->numSaps; i++) {
-      CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgmSap[i], mBuf);
-   }
-   for (i=0; i<param->numSaps; i++) {
-      CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgrSap[i], mBuf);
-   }
-   for (i=0; i<param->numSaps; i++) {
-      CMCHKUNPK(cmUnpkRgLowSapCfg, &param->tfuSap[i], mBuf);
+   for (i=14; i >= 0; i--) {
+      CMCHKPK(cmPkRgAckNack, &param->ulCqiStat[i], mBuf);
    }
-   return ROK;
-}
-
 
-\f
-/***********************************************************
-*
-*     Func : cmPkRgCfg
-*
-*
-*     Desc :   This structure holds Configuration parameters for MAC.
-*
-*
-*     Ret  : S16
-*
-*     Notes:
-*
-*     File  : 
-*
-**********************************************************/
-S16 cmPkRgCfg
-(
-RgCfg *param,
-S16 elmnt,
-Buffer *mBuf
-)
-{
+   for (i=14; i >= 0; i--) {
+      CMCHKPK(cmPkRgAckNack, &param->dlCqiStat[i], mBuf);
+   }
 
-      switch(elmnt) {
-         case STSCHINST:
-            CMCHKPK(cmPkRgSchInstCfg, &param->s.schInstCfg, mBuf);
-            break;
-         case STTFUSAP:
-            CMCHKPK(cmPkRgLowSapCfg, &param->s.tfuSap, mBuf);
-            break;
-         case STCRGSAP:
-            CMCHKPK(cmPkRgUpSapCfg, &param->s.crgSap, mBuf);
-            break;
-         case STRGUSAP:
-            CMCHKPK(cmPkRgUpSapCfg, &param->s.rguSap, mBuf);
-            break;
-         case STGEN:
-            CMCHKPK(cmPkRgGenCfg, &param->s.genCfg, mBuf);
-            break;
-         default :
-            return RFAILED;
-      }
    return ROK;
 }
 
-
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgCfg
+*     Func : cmPkRgHqNumRetx
 *
 *
-*     Desc :   This structure holds Configuration parameters for MAC.
+*     Desc :   Harq Retransmission statistics
 *
 *
 *     Ret  : S16
@@ -2091,44 +1013,30 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgCfg
+S16 cmPkRgHqNumRetx
 (
-RgCfg *param,
-S16 elmnt,
+RgSchHqNumRetx *param,
 Buffer *mBuf
 )
 {
 
-      switch(elmnt) {
-         case STGEN:
-            CMCHKUNPK(cmUnpkRgGenCfg, &param->s.genCfg, mBuf);
-            break;
-         case STRGUSAP:
-            CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.rguSap, mBuf);
-            break;
-         case STCRGSAP:
-            CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.crgSap, mBuf);
-            break;
-         case STTFUSAP:
-            CMCHKUNPK(cmUnpkRgLowSapCfg, &param->s.tfuSap, mBuf);
-            break;
-         case STSCHINST:
-            CMCHKUNPK(cmUnpkRgSchInstCfg, &param->s.schInstCfg, mBuf);
-            break;
-         default :
-            return RFAILED;
-      }
-   return ROK;
-}
+   CMCHKPK(oduUnpackUInt32, param->totalTx, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->numOfHQ_4, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->numOfHQ_3, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->numOfHQ_2, mBuf);
+   CMCHKPK(oduUnpackUInt16, param->numOfHQ_1, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
 
+   return ROK;
+} /* cmPkRgHqNumRetx */
 
 \f
 /***********************************************************
 *
-*     Func : cmPkRgSapSta
+*     Func : cmPkRgSchHqRetxStats
 *
 *
-*     Desc :   This structure holds a SAP's status information.
+*     Desc :   
 *
 *
 *     Ret  : S16
@@ -2138,25 +1046,34 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgSapSta
+S16 cmPkRgSchHqRetxStats
 (
-RgSapSta *param,
+RgSchHqRetxStats *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKPK(oduUnpackUInt8, param->sapState, mBuf);
-   return ROK;
-}
+   S32 i;
+
+   for (i=14; i >= 0; i--) {
+      CMCHKPK(cmPkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
+   }
 
+   for (i=14; i >= 0; i--) {
+      CMCHKPK(cmPkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
+   }
+
+   return ROK;
+} /* cmPkRgSchHqRetxStats */
 
+/* unpcaking functions */
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgSapSta
+*     Func : cmUnpkRgAckNack
 *
 *
-*     Desc :   This structure holds a SAP's status information.
+*     Desc :   Ack and Nack statistics
 *
 *
 *     Ret  : S16
@@ -2166,25 +1083,28 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgSapSta
+S16 cmUnpkRgAckNack
 (
-RgSapSta *param,
+RgAckNack *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(oduPackUInt8, &param->sapState, mBuf);
-   return ROK;
-}
 
+   CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->numOfNacks, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->numOfAcks, mBuf);
+
+   return ROK;
+} /* cmUnkRgAckNack */
 
 \f
 /***********************************************************
 *
-*     Func : cmPkRgSts
+*     Func : cmUnpkRgSchNackAckStats
 *
 *
-*     Desc :   This structure holds MAC's Statistical information.
+*     Desc :   
 *
 *
 *     Ret  : S16
@@ -2194,47 +1114,32 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgSts
+S16 cmUnpkRgSchNackAckStats
 (
-RgSts *param,
-S16 elmnt,
+RgSchNackAckStats *param,
 Buffer *mBuf
 )
 {
+   S32 i;
 
-      switch(elmnt) {
-         case STTFUSAP:
-            CMCHKPK(cmPkRgSapSts, &param->s.tfuSts, mBuf);
-            break;
-         case STRGRSAP:
-            CMCHKPK(cmPkRgSapSts, &param->s.rgrSts, mBuf);
-            break;
-         case STCRGSAP:
-            CMCHKPK(cmPkRgSapSts, &param->s.crgSts, mBuf);
-            break;
-         case STRGUSAP:
-            CMCHKPK(cmPkRgSapSts, &param->s.rguSts, mBuf);
-            break;
-         case STGEN:
-            CMCHKPK(cmPkRgGenSts, &param->s.genSts, mBuf);
-            break;
-         default :
-            break;
-      }
-   CMCHKPK(cmPkAction, param->action, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
-   CMCHKPK(cmPkDateTime, &param->dt, mBuf);
-   return ROK;
-}
+   for (i=0; i <= 14; i++) {
+      CMCHKUNPK(cmUnpkRgAckNack, &param->dlCqiStat[i], mBuf);
+   }
+
+   for (i=0; i <= 14; i++) {
+      CMCHKUNPK(cmUnpkRgAckNack, &param->ulCqiStat[i], mBuf);
+   }
 
+   return ROK;
+} /* cmUnpkRgSchNackAckStats */
 
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgSts
+*     Func : cmUnpkRgHqNumRetx
 *
 *
-*     Desc :   This structure holds MAC's Statistical information.
+*     Desc :   Harq Retransmission statistics
 *
 *
 *     Ret  : S16
@@ -2244,47 +1149,30 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgSts
+S16 cmUnpkRgHqNumRetx
 (
-RgSts *param,
-S16 elmnt,
+RgSchHqNumRetx *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
-   CMCHKUNPK(cmUnpkAction, &param->action, mBuf);
-      switch(elmnt) {
-         case STGEN:
-            CMCHKUNPK(cmUnpkRgGenSts, &param->s.genSts, mBuf);
-            break;
-         case STRGUSAP:
-            CMCHKUNPK(cmUnpkRgSapSts, &param->s.rguSts, mBuf);
-            break;
-         case STCRGSAP:
-            CMCHKUNPK(cmUnpkRgSapSts, &param->s.crgSts, mBuf);
-            break;
-         case STRGRSAP:
-            CMCHKUNPK(cmUnpkRgSapSts, &param->s.rgrSts, mBuf);
-            break;
-         case STTFUSAP:
-            CMCHKUNPK(cmUnpkRgSapSts, &param->s.tfuSts, mBuf);
-            break;
-         default :
-            break;
-      }
-   return ROK;
-}
+   CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_1, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_2, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_3, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->numOfHQ_4, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->totalTx, mBuf);
 
+   return ROK;
+} /* cmUnpkRgHqNumRetx */
 
 \f
 /***********************************************************
 *
-*     Func : cmPkRgSsta
+*     Func : cmUnpkRgSchHqRetxStats
 *
 *
-*     Desc :   This structure holds MAC's Solicited Status information.
+*     Desc :   
 *
 *
 *     Ret  : S16
@@ -2294,68 +1182,34 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgSsta
+S16 cmUnpkRgSchHqRetxStats
 (
-Pst *pst,
-RgSsta *param,
-S16 elmnt,
-#ifdef LRG_V1
-uint8_t eventType,
-#endif
+RgSchHqRetxStats *param,
 Buffer *mBuf
 )
 {
+   S32 i;
+
+   for (i=0; i <= 14; i++) {
+      CMCHKUNPK(cmUnpkRgHqNumRetx, &param->dlCqiStat[i], mBuf);
+   }
+
+   for (i=0; i <= 14; i++) {
+      CMCHKUNPK(cmUnpkRgHqNumRetx, &param->ulCqiStat[i], mBuf);
+   }
 
-      switch(elmnt) {
-         case STTFUSAP:
-            CMCHKPK(cmPkRgSapSta, &param->s.tfuSapSta, mBuf);
-            break;
-         case STRGRSAP:
-            CMCHKPK(cmPkRgSapSta, &param->s.rgrSapSta, mBuf);
-            break;
-         case STCRGSAP:
-            CMCHKPK(cmPkRgSapSta, &param->s.crgSapSta, mBuf);
-            break;
-         case STRGUSAP:
-            CMCHKPK(cmPkRgSapSta, &param->s.rguSapSta, mBuf);
-            break;
-            /*ccpu00118255 - ADD - Check for eventType before Pack */
-         case STGEN:
-#ifdef LRG_V1 
-            if (eventType == EVTLRGSSTACFM)
-            {
-               CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
-               if (param->s.sysId.ptNmb != NULLP)
-               {
-                  SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, 
-                        (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
-               }
-            }
-#else /*LRG_V1 not defined */
-            if (param->s.sysId.ptNmb != NULLP)
-            {
-                 CMCHKPK(cmPkSystemId, &param->s.sysId, mBuf);
-                 SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data *)param->s.sysId.ptNmb, LRG_MAX_PT_NUM_SIZE);
-            }
-
-#endif /*end of LRG_V1 */
-            break;
-         default :
-            break;
-      }
-   CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
-   CMCHKPK(cmPkDateTime, &param->dt, mBuf);
    return ROK;
-}
+} /* cmUnpkRgSchHqRetxStats */
 
+#endif /* MAC_SCH_STATS */
 
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgSsta
+*     Func : cmPkRgGenSts
 *
 *
-*     Desc :   This structure holds MAC's Solicited Status information.
+*     Desc :   This structure holds General Statistical information of MAC.
 *
 *
 *     Ret  : S16
@@ -2365,57 +1219,20 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgSsta
+S16 cmPkRgGenSts
 (
-Pst    *pst,
-RgSsta *param,
-S16 elmnt,
+RgGenSts *param,
 Buffer *mBuf
 )
 {
 
-
-   CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
-      switch(elmnt) {
-         case STGEN:
-            /*ccpu00118255 - ADD - Check for eventType before Unpack */
-            if (pst->event == EVTLRGSSTACFM)
-            {
-               /* After Merging */
-               if((SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,pst->region, pst->pool, (Data **)&param->s.sysId.ptNmb,
-                           LRG_MAX_PT_NUM_SIZE)) != ROK){
-#if (ERRCLASS & ERRCLS_ADD_RES)
-                  SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
-                        __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
-                        (ErrVal)ELRG048, (ErrVal)0, "Packing failed");
-#endif
-                  SPutMsg(mBuf);
-                  return RFAILED;
-               }
-               /* KWORK_FIX: Moved the memset under the NULL check */
-               if (param->s.sysId.ptNmb != NULLP)
-               {
-                  memset(param->s.sysId.ptNmb, 0, LRG_MAX_PT_NUM_SIZE);
-                  CMCHKUNPK(cmUnpkSystemId, &param->s.sysId, mBuf);
-               }
-            }
-            break;
-         case STRGUSAP:
-            CMCHKUNPK(cmUnpkRgSapSta, &param->s.rguSapSta, mBuf);
-            break;
-         case STCRGSAP:
-            CMCHKUNPK(cmUnpkRgSapSta, &param->s.crgSapSta, mBuf);
-            break;
-         case STRGRSAP:
-            CMCHKUNPK(cmUnpkRgSapSta, &param->s.rgrSapSta, mBuf);
-            break;
-         case STTFUSAP:
-            CMCHKUNPK(cmUnpkRgSapSta, &param->s.tfuSapSta, mBuf);
-            break;
-         default :
-            break;
-      }
+#ifdef MAC_SCH_STATS
+   CMCHKPK(cmPkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
+   CMCHKPK(cmPkRgSchNackAckStats, &param->nackAckStats, mBuf);
+#endif /* MAC_SCH_STATS */
+   CMCHKPK(oduUnpackUInt16, param->numCellCfg, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->numUeCfg, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->numHarqFail, mBuf);
    return ROK;
 }
 
@@ -2423,10 +1240,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmPkRgUstaDgn
+*     Func : cmUnpkRgGenSts
 *
 *
-*     Desc :   Alarm diagnostics structure.
+*     Desc :   This structure holds General Statistical information of MAC.
 *
 *
 *     Ret  : S16
@@ -2436,21 +1253,20 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgUstaDgn
+S16 cmUnpkRgGenSts
 (
-RgUstaDgn *param,
+RgGenSts *param,
 Buffer *mBuf
 )
 {
 
-      switch(param->type) {
-         case LRG_USTA_DGNVAL_MEM:
-            CMCHKPK(cmPkMemoryId, &param->u.mem, mBuf);
-            break;
-         default :
-            break;
-      }
-   CMCHKPK(oduUnpackUInt8, param->type, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->numHarqFail, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->numUeCfg, mBuf);
+   CMCHKUNPK(oduPackUInt16, &param->numCellCfg, mBuf);
+#ifdef MAC_SCH_STATS
+   CMCHKUNPK(cmUnpkRgSchNackAckStats, &param->nackAckStats, mBuf);
+   CMCHKUNPK(cmUnpkRgSchHqRetxStats, &param->hqRetxStats, mBuf);
+#endif /* MAC_SCH_STATS */
    return ROK;
 }
 
@@ -2458,10 +1274,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgUstaDgn
+*     Func : cmPkRgSapSts
 *
 *
-*     Desc :   Alarm diagnostics structure.
+*     Desc :   This structure holds Statistical information of a SAP in MAC.
 *
 *
 *     Ret  : S16
@@ -2471,23 +1287,46 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgUstaDgn
+S16 cmPkRgSapSts
 (
-RgUstaDgn *param,
+RgSapSts *param,
 Buffer *mBuf
 )
 {
 
+   CMCHKPK(oduUnpackUInt32, param->numPduDrop, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->numPduTxmit, mBuf);
+   CMCHKPK(oduUnpackUInt32, param->numPduRcvd, mBuf);
+   return ROK;
+}
+
 
-   CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
-   switch(param->type) 
-   {
-      case LRG_USTA_DGNVAL_MEM:
-        CMCHKUNPK(cmUnpkMemoryId, &param->u.mem, mBuf);
-        break;
-      default :
-        break;
-      }
+\f
+/***********************************************************
+*
+*     Func : cmUnpkRgSapSts
+*
+*
+*     Desc :   This structure holds Statistical information of a SAP in MAC.
+*
+*
+*     Ret  : S16
+*
+*     Notes:
+*
+*     File  : 
+*
+**********************************************************/
+S16 cmUnpkRgSapSts
+(
+RgSapSts *param,
+Buffer *mBuf
+)
+{
+
+   CMCHKUNPK(oduPackUInt32, &param->numPduRcvd, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->numPduTxmit, mBuf);
+   CMCHKUNPK(oduPackUInt32, &param->numPduDrop, mBuf);
    return ROK;
 }
 
@@ -2495,10 +1334,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmPkRgUsta
+*     Func : cmPkRgSchInstCfg
 *
 *
-*     Desc :   This structure holds MAC's Unsolicited Status information.
+*     Desc : Scheduler Configuration
 *
 *
 *     Ret  : S16
@@ -2508,15 +1347,27 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgUsta
+S16 cmPkRgSchInstCfg
 (
-RgUsta *param,
+RgSchInstCfg *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKPK(cmPkRgUstaDgn, &param->dgn, mBuf);
-   CMCHKPK(cmPkCmAlarm, &param->cmAlarm, mBuf);
+   S32 i;
+
+   for (i=param->numSaps-1; i >= 0; i--) {
+      CMCHKPK(cmPkRgLowSapCfg, &param->tfuSap[i], mBuf);
+   }
+   for (i=param->numSaps-1; i >= 0; i--) {
+      CMCHKPK(cmPkRgUpSapCfg, &param->rgrSap[i], mBuf);
+   }
+   for (i=param->numSaps-1; i >= 0; i--) {
+      CMCHKPK(cmPkRgUpSapCfg, &param->rgmSap[i], mBuf);
+   }
+   CMCHKPK(oduUnpackUInt8, param->numSaps, mBuf);
+   CMCHKPK(cmPkRgGenCfg, &param->genCfg, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->instId, mBuf);
    return ROK;
 }
 
@@ -2524,10 +1375,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgUsta
+*     Func : cmUnpkRgSchInstCfg
 *
 *
-*     Desc :   This structure holds MAC's Unsolicited Status information.
+*     Desc : Scheduler Configuration
 *
 *
 *     Ret  : S16
@@ -2537,15 +1388,27 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgUsta
+S16 cmUnpkRgSchInstCfg
 (
-RgUsta *param,
+RgSchInstCfg *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(cmUnpkCmAlarm, &param->cmAlarm, mBuf);
-   CMCHKUNPK(cmUnpkRgUstaDgn, &param->dgn, mBuf);
+   S32 i;
+
+   CMCHKUNPK(oduPackUInt8, &param->instId, mBuf);
+   CMCHKUNPK(cmUnpkRgGenCfg, &param->genCfg, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->numSaps, mBuf);
+   for (i=0; i<param->numSaps; i++) {
+      CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgmSap[i], mBuf);
+   }
+   for (i=0; i<param->numSaps; i++) {
+      CMCHKUNPK(cmUnpkRgUpSapCfg, &param->rgrSap[i], mBuf);
+   }
+   for (i=0; i<param->numSaps; i++) {
+      CMCHKUNPK(cmUnpkRgLowSapCfg, &param->tfuSap[i], mBuf);
+   }
    return ROK;
 }
 
@@ -2553,10 +1416,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmPkRgTrc
+*     Func : cmPkRgCfg
 *
 *
-*     Desc :   This structure holds MAC's Trace Indication information.
+*     Desc :   This structure holds Configuration parameters for MAC.
 *
 *
 *     Ret  : S16
@@ -2566,15 +1429,33 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgTrc
+S16 cmPkRgCfg
 (
-RgTrc *param,
+RgCfg *param,
+S16 elmnt,
 Buffer *mBuf
 )
 {
 
-   CMCHKPK(oduUnpackUInt8, param->evnt, mBuf);
-   CMCHKPK(cmPkDateTime, &param->dt, mBuf);
+      switch(elmnt) {
+         case STSCHINST:
+            CMCHKPK(cmPkRgSchInstCfg, &param->s.schInstCfg, mBuf);
+            break;
+         case STTFUSAP:
+            CMCHKPK(cmPkRgLowSapCfg, &param->s.tfuSap, mBuf);
+            break;
+         case STCRGSAP:
+            CMCHKPK(cmPkRgUpSapCfg, &param->s.crgSap, mBuf);
+            break;
+         case STRGUSAP:
+            CMCHKPK(cmPkRgUpSapCfg, &param->s.rguSap, mBuf);
+            break;
+         case STGEN:
+            CMCHKPK(cmPkRgGenCfg, &param->s.genCfg, mBuf);
+            break;
+         default :
+            return RFAILED;
+      }
    return ROK;
 }
 
@@ -2582,10 +1463,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgTrc
+*     Func : cmUnpkRgCfg
 *
 *
-*     Desc :   This structure holds MAC's Trace Indication information.
+*     Desc :   This structure holds Configuration parameters for MAC.
 *
 *
 *     Ret  : S16
@@ -2595,15 +1476,33 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgTrc
+S16 cmUnpkRgCfg
 (
-RgTrc *param,
+RgCfg *param,
+S16 elmnt,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->evnt, mBuf);
+      switch(elmnt) {
+         case STGEN:
+            CMCHKUNPK(cmUnpkRgGenCfg, &param->s.genCfg, mBuf);
+            break;
+         case STRGUSAP:
+            CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.rguSap, mBuf);
+            break;
+         case STCRGSAP:
+            CMCHKUNPK(cmUnpkRgUpSapCfg, &param->s.crgSap, mBuf);
+            break;
+         case STTFUSAP:
+            CMCHKUNPK(cmUnpkRgLowSapCfg, &param->s.tfuSap, mBuf);
+            break;
+         case STSCHINST:
+            CMCHKUNPK(cmUnpkRgSchInstCfg, &param->s.schInstCfg, mBuf);
+            break;
+         default :
+            return RFAILED;
+      }
    return ROK;
 }
 
@@ -2611,10 +1510,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmPkRgDbgCntrl
+*     Func : cmPkRgSapSta
 *
 *
-*     Desc :   This structure holds MAC's Debug Control information.
+*     Desc :   This structure holds a SAP's status information.
 *
 *
 *     Ret  : S16
@@ -2624,24 +1523,25 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgDbgCntrl
+S16 cmPkRgSapSta
 (
-RgDbgCntrl *param,
+RgSapSta *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKPK(oduUnpackUInt32, param->dbgMask, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->sapState, mBuf);
    return ROK;
 }
 
-#ifdef PHY_ERROR_LOGING
+
+\f
 /***********************************************************
 *
-*     Func : cmPkRgSchUlAllocCntrl
+*     Func : cmUnpkRgSapSta
 *
 *
-*     Desc :   This structure holds MAC's Debug Control information.
+*     Desc :   This structure holds a SAP's status information.
 *
 *
 *     Ret  : S16
@@ -2651,29 +1551,25 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgSchUlAllocCntrl
+S16 cmUnpkRgSapSta
 (
-RgSchUlAllocCntrl *param,
+RgSapSta *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKPK(oduUnpackUInt8, param->mcs, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->numOfRb, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->rbStart, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->testStart, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->enaLog, mBuf);
-   CMCHKPK(oduUnpackUInt16, param->logTime, mBuf);
-
+   CMCHKUNPK(oduPackUInt8, &param->sapState, mBuf);
    return ROK;
 }
 
+
+\f
 /***********************************************************
 *
-*     Func : cmUnpkRgSchUlAllocCntrl
+*     Func : cmPkRgSts
 *
 *
-*     Desc :   This structure holds MAC's Scheduler Configuration for Ul Allocation.
+*     Desc :   This structure holds MAC's Statistical information.
 *
 *
 *     Ret  : S16
@@ -2683,32 +1579,47 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgSchUlAllocCntrl
+S16 cmPkRgSts
 (
-RgSchUlAllocCntrl *param,
+RgSts *param,
+S16 elmnt,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(oduPackUInt16, &param->logTime, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->enaLog, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->testStart, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->rbStart, mBuf);
-   CMCHKUNPK(oduPackUInt16, &param->numOfRb, mBuf);   
-   CMCHKUNPK(oduPackUInt8, &param->mcs, mBuf);
-
+      switch(elmnt) {
+         case STTFUSAP:
+            CMCHKPK(cmPkRgSapSts, &param->s.tfuSts, mBuf);
+            break;
+         case STRGRSAP:
+            CMCHKPK(cmPkRgSapSts, &param->s.rgrSts, mBuf);
+            break;
+         case STCRGSAP:
+            CMCHKPK(cmPkRgSapSts, &param->s.crgSts, mBuf);
+            break;
+         case STRGUSAP:
+            CMCHKPK(cmPkRgSapSts, &param->s.rguSts, mBuf);
+            break;
+         case STGEN:
+            CMCHKPK(cmPkRgGenSts, &param->s.genSts, mBuf);
+            break;
+         default :
+            break;
+      }
+   CMCHKPK(cmPkAction, param->action, mBuf);
+   CMCHKPK(oduUnpackUInt8, param->sapInst, mBuf);
+   CMCHKPK(cmPkDateTime, &param->dt, mBuf);
    return ROK;
 }
 
 
-#endif
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgDbgCntrl
+*     Func : cmUnpkRgSts
 *
 *
-*     Desc :   This structure holds MAC's Debug Control information.
+*     Desc :   This structure holds MAC's Statistical information.
 *
 *
 *     Ret  : S16
@@ -2718,25 +1629,46 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgDbgCntrl
+S16 cmUnpkRgSts
 (
-RgDbgCntrl *param,
+RgSts *param,
+S16 elmnt,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(oduPackUInt32, &param->dbgMask, mBuf);
+   CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
+   CMCHKUNPK(oduPackUInt8, &param->sapInst, mBuf);
+   CMCHKUNPK(cmUnpkAction, &param->action, mBuf);
+      switch(elmnt) {
+         case STGEN:
+            CMCHKUNPK(cmUnpkRgGenSts, &param->s.genSts, mBuf);
+            break;
+         case STRGUSAP:
+            CMCHKUNPK(cmUnpkRgSapSts, &param->s.rguSts, mBuf);
+            break;
+         case STCRGSAP:
+            CMCHKUNPK(cmUnpkRgSapSts, &param->s.crgSts, mBuf);
+            break;
+         case STRGRSAP:
+            CMCHKUNPK(cmUnpkRgSapSts, &param->s.rgrSts, mBuf);
+            break;
+         case STTFUSAP:
+            CMCHKUNPK(cmUnpkRgSapSts, &param->s.tfuSts, mBuf);
+            break;
+         default :
+            break;
+      }
    return ROK;
 }
 
-
 \f
 /***********************************************************
 *
-*     Func : cmPkRgSapCntrl
+*     Func : cmPkRgUstaDgn
 *
 *
-*     Desc :   This structure holds MAC's SAP Control information.
+*     Desc :   Alarm diagnostics structure.
 *
 *
 *     Ret  : S16
@@ -2746,15 +1678,21 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgSapCntrl
+S16 cmPkRgUstaDgn
 (
-RgSapCntrl *param,
+RgUstaDgn *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKPK(SPkS16, param->spId, mBuf);
-   CMCHKPK(SPkS16, param->suId, mBuf);
+      switch(param->type) {
+         case LRG_USTA_DGNVAL_MEM:
+            CMCHKPK(cmPkMemoryId, &param->u.mem, mBuf);
+            break;
+         default :
+            break;
+      }
+   CMCHKPK(oduUnpackUInt8, param->type, mBuf);
    return ROK;
 }
 
@@ -2762,10 +1700,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgSapCntrl
+*     Func : cmUnpkRgUstaDgn
 *
 *
-*     Desc :   This structure holds MAC's SAP Control information.
+*     Desc :   Alarm diagnostics structure.
 *
 *
 *     Ret  : S16
@@ -2775,15 +1713,23 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgSapCntrl
+S16 cmUnpkRgUstaDgn
 (
-RgSapCntrl *param,
+RgUstaDgn *param,
 Buffer *mBuf
 )
 {
 
-   CMCHKUNPK(SUnpkS16, &param->suId, mBuf);
-   CMCHKUNPK(SUnpkS16, &param->spId, mBuf);
+
+   CMCHKUNPK(oduPackUInt8, &param->type, mBuf);
+   switch(param->type) 
+   {
+      case LRG_USTA_DGNVAL_MEM:
+        CMCHKUNPK(cmUnpkMemoryId, &param->u.mem, mBuf);
+        break;
+      default :
+        break;
+      }
    return ROK;
 }
 
@@ -2791,10 +1737,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmPkRgCntrl
+*     Func : cmPkRgUsta
 *
 *
-*     Desc :   This structure holds MAC's Control information.
+*     Desc :   This structure holds MAC's Unsolicited Status information.
 *
 *
 *     Ret  : S16
@@ -2804,56 +1750,15 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmPkRgCntrl
+S16 cmPkRgUsta
 (
-RgCntrl *param,
-S16 elmnt,
+RgUsta *param,
 Buffer *mBuf
 )
 {
 
-
-      switch(elmnt) {
-         case STTFUSAP:
-         case STRGUSAP:
-         case STRGRSAP:
-         case STCRGSAP:
-            switch(param->subAction) {
-               default :
-                  CMCHKPK(cmPkRgSapCntrl, &param->s.rgSapCntrl, mBuf);
-                  break;
-            }
-         break;
-         case STGEN:
-            switch(param->subAction) {
-               case SATRC:
-                  CMCHKPK(SPkS16, param->s.trcLen, mBuf);
-                  break;
-               case SADBG:
-                  CMCHKPK(cmPkRgDbgCntrl, &param->s.rgDbgCntrl, mBuf);
-                  break;
-               case SAUSTA:
-                  break;
-#ifdef SS_DIAG
-               case SALOG:
-                  CMCHKPK(oduUnpackUInt32,  param->s.logMask, mBuf);
-                  break;
-#endif
-#ifdef PHY_ERROR_LOGING
-               case SAELMNT:
-             CMCHKPK(cmPkRgSchUlAllocCntrl, &param->s.rgSchUlAllocCntrl, mBuf);
-                 break;
-#endif                    
-               default :
-                  break;
-            }
-            break;
-         default :
-            break;
-      }
-   CMCHKPK(oduUnpackUInt8, param->subAction, mBuf);
-   CMCHKPK(oduUnpackUInt8, param->action, mBuf);
-   CMCHKPK(cmPkDateTime, &param->dt, mBuf);
+   CMCHKPK(cmPkRgUstaDgn, &param->dgn, mBuf);
+   CMCHKPK(cmPkCmAlarm, &param->cmAlarm, mBuf);
    return ROK;
 }
 
@@ -2861,10 +1766,10 @@ Buffer *mBuf
 \f
 /***********************************************************
 *
-*     Func : cmUnpkRgCntrl
+*     Func : cmUnpkRgUsta
 *
 *
-*     Desc :   This structure holds MAC's Control information.
+*     Desc :   This structure holds MAC's Unsolicited Status information.
 *
 *
 *     Ret  : S16
@@ -2874,60 +1779,18 @@ Buffer *mBuf
 *     File  : 
 *
 **********************************************************/
-S16 cmUnpkRgCntrl
+S16 cmUnpkRgUsta
 (
-RgCntrl *param,
-S16 elmnt,
+RgUsta *param,
 Buffer *mBuf
 )
 {
 
-
-   CMCHKUNPK(cmUnpkDateTime, &param->dt, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->action, mBuf);
-   CMCHKUNPK(oduPackUInt8, &param->subAction, mBuf);
-   switch(elmnt) {
-      case STGEN:
-        switch(param->subAction) {
-           case SADBG:
-              CMCHKUNPK(cmUnpkRgDbgCntrl, &param->s.rgDbgCntrl, mBuf);
-              break;
-           case SATRC:
-              CMCHKUNPK(SUnpkS16, &param->s.trcLen, mBuf);
-              break;
-           case SAUSTA:
-              break;
-#ifdef SS_DIAG
-           case SALOG:
-              CMCHKUNPK(oduPackUInt32, &param->s.logMask, mBuf);
-              break;
-#endif
-#ifdef PHY_ERROR_LOGING
-           case SAELMNT:
-              CMCHKUNPK(cmUnpkRgSchUlAllocCntrl, &param->s.rgSchUlAllocCntrl, mBuf);
-              break;
-#endif                    
-           default :
-              break;
-        }
-        break;
-      case STTFUSAP:
-      case STRGUSAP:
-      case STRGRSAP:
-      case STCRGSAP:
-        switch(param->subAction) {
-           default :
-              CMCHKUNPK(cmUnpkRgSapCntrl, &param->s.rgSapCntrl, mBuf);
-              break;
-        }
-        break;
-      default :
-        break;
-      }
+   CMCHKUNPK(cmUnpkCmAlarm, &param->cmAlarm, mBuf);
+   CMCHKUNPK(cmUnpkRgUstaDgn, &param->dgn, mBuf);
    return ROK;
 }
 
-
 \f
 /***********************************************************
 *
@@ -2955,32 +1818,10 @@ Buffer *mBuf
 
 
       switch(eventType) {
-         case EVTLRGCNTRLREQ:
-         case  EVTLRGCNTRLCFM:
-         case EVTLRGSCHCNTRLREQ:
-         case  EVTLRGSCHCNTRLCFM:
-            if(cmPkRgCntrl(&param->t.cntrl, param->hdr.elmId.elmnt, mBuf) != ROK)
-               return RFAILED;
-            break;
-         case EVTLRGTRCIND:
-            CMCHKPK(cmPkRgTrc, &param->t.trc, mBuf);
-            break;
          case EVTLRGUSTAIND:
          case EVTLRGSCHSTAIND:
             CMCHKPK(cmPkRgUsta, &param->t.usta, mBuf);
             break;
-         case EVTLRGSSTAREQ:
-         case  EVTLRGSSTACFM:
-            /*ccpu00118255 - ADD - eventType param */
-#ifdef LRG_V1
-            if(cmPkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt,
-                     eventType, mBuf) != ROK)
-               return RFAILED;
-#else /* LRG_V1 is not defined */
-            if(cmPkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt, mBuf) != ROK)
-               return RFAILED;
-#endif /* end of LRG_V1*/            
-            break;
          case EVTLRGSTSREQ:
          case  EVTLRGSTSCFM:
             if(cmPkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf)!= ROK)
@@ -3046,25 +1887,10 @@ Buffer *mBuf
         if(cmUnpkRgSts(&param->t.sts, param->hdr.elmId.elmnt, mBuf) != ROK)
            return RFAILED;
         break;
-      case EVTLRGSSTAREQ:
-      case  EVTLRGSSTACFM:
-        if(cmUnpkRgSsta(pst, &param->t.ssta, param->hdr.elmId.elmnt, mBuf) != ROK)
-           return RFAILED;
-        break;
       case EVTLRGUSTAIND:
       case EVTLRGSCHSTAIND:
         CMCHKUNPK(cmUnpkRgUsta, &param->t.usta, mBuf);
         break;
-      case EVTLRGTRCIND:
-        CMCHKUNPK(cmUnpkRgTrc, &param->t.trc, mBuf);
-        break;
-      case EVTLRGCNTRLREQ:
-      case  EVTLRGCNTRLCFM:
-      case EVTLRGSCHCNTRLREQ:
-      case  EVTLRGSCHCNTRLCFM:
-        if(cmUnpkRgCntrl(&param->t.cntrl, param->hdr.elmId.elmnt, mBuf) != ROK)
-           return RFAILED;
-        break;
       default :
         return RFAILED;
       }