Jira id - ODUHIGH-227
[o-du/l2.git] / src / cm / rgm.c
index 4e9e42d..95b57dd 100755 (executable)
 */
 
 /* header include files (.h) */
-#include "envopt.h"        /* environment options */
-#include "envdep.h"        /* environment dependent */
-#include "envind.h"        /* environment independent */
-#include "gen.h"           /* general */
-#include "ssi.h"           /* system services */
-#include "cm_tkns.h"       /* Common Token Defines */
-#include "cm_llist.h"      /* Common Link List Defines */
-#include "cm_hash.h"       /* Common Hash List Defines */
-#include "cm_lte.h"        /* Common LTE Defines */
+#include "common_def.h"
 #include "rgm.h"           /* RGM Interface defines */
-
 /* header/extern include files (.x) */
-#include "gen.x"           /* general */
-#include "ssi.x"           /* system services */
-#include "cm_tkns.x"       /* Common Token Definitions */
-#include "cm_llist.x"      /* Common Link List Definitions */
-#include "cm_lib.x"        /* Common Library Definitions */
-#include "cm_hash.x"       /* Common Hash List Definitions */
-#include "cm_lte.x"        /* Common LTE Defines */
 #include "rgm.x"           /* RGM Interface includes */
 
 #ifdef RGM_LWLC
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkLwLcRgmBndReq
+S16 cmPkLwLcRgmBndReq
 (
 Pst* pst,
 SuId suId,
 SpId spId
 )
 #else
-PUBLIC S16 cmPkLwLcRgmBndReq(pst, suId, spId)
+S16 cmPkLwLcRgmBndReq(pst, suId, spId)
 Pst* pst;
 SuId suId;
 SpId spId;
@@ -92,23 +76,23 @@ SpId spId;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTRGMBNDREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -126,14 +110,14 @@ SpId spId;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkLwLcRgmBndReq
+S16 cmUnpkLwLcRgmBndReq
 (
 RgmBndReq func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkLwLcRgmBndReq(func, pst, mBuf)
+S16 cmUnpkLwLcRgmBndReq(func, pst, mBuf)
 RgmBndReq func;
 Pst *pst;
 Buffer *mBuf;
@@ -148,20 +132,20 @@ Buffer *mBuf;
    if (SUnpkS16(&suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SUnpkS16(&spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    ret = ((*func)(pst, suId, spId));
 
    SPutMsg(mBuf);
 
-   RETVALUE(ret);
+   return (ret);
 }
 
 /**
@@ -178,14 +162,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkLwLcRgmUbndReq
+S16 cmPkLwLcRgmUbndReq
 (
 Pst* pst,
 SpId spId,
 Reason reason
 )
 #else
-PUBLIC S16 cmPkLwLcRgmUbndReq(pst, spId, reason)
+S16 cmPkLwLcRgmUbndReq(pst, spId, reason)
 Pst* pst;
 SpId spId;
 Reason reason;
@@ -196,72 +180,23 @@ Reason reason;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(reason, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTRGMUBNDREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
-#if 0
-\f
-/**
-* @brief Request from RRM to MAC to Unbind the interface saps
-*
-* @details
-*
-*     Function : cmUnpkLwLcRgmUbndReq
-*
-*  @param[in]   Pst*  pst
-*  @param[in]   SpId  spId
-*  @param[in]   Reason  reason
-*  @return   S16
-*      -# ROK
-**/
-#ifdef ANSI
-PUBLIC S16 cmUnpkLwLcRgmUbndReq
-(
-RgmUbndReq func,
-Pst *pst,
-Buffer *mBuf
-)
-#else
-PUBLIC S16 cmUnpkLwLcRgmUbndReq(func, pst, mBuf)
-RgmUbndReq func;
-Pst *pst;
-Buffer *mBuf;
-#endif
-{
-   SpId spId;
-   Reason reason;
-   
-   TRC3(cmUnpkLwLcRgmUbndReq)
-
-   if (SUnpkS16(&spId, mBuf) != ROK)
-   {
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-   if (SUnpkS16(&reason, mBuf) != ROK)
-   {
-      SPutMsg(mBuf);
-      RETVALUE(RFAILED);
-   }
-   SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, reason));
-}
-#endif
-
 /**
 * @brief Confirmation from MAC to RRM for the bind/Unbind 
  * request for the interface saps
@@ -277,14 +212,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkLwLcRgmBndCfm
+S16 cmPkLwLcRgmBndCfm
 (
 Pst* pst,
 SuId suId,
 U8 status
 )
 #else
-PUBLIC S16 cmPkLwLcRgmBndCfm(pst, suId, status)
+S16 cmPkLwLcRgmBndCfm(pst, suId, status)
 Pst* pst;
 SuId suId;
 U8 status;
@@ -295,23 +230,23 @@ U8 status;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if (SPkU8(status, mBuf) != ROK) 
+   if (oduUnpackUInt8(status, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
   pst->event = (Event) EVTRGMBNDCFM;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -330,14 +265,14 @@ U8 status;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkLwLcRgmBndCfm
+S16 cmUnpkLwLcRgmBndCfm
 (
 RgmBndCfm func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkLwLcRgmBndCfm(func, pst, mBuf)
+S16 cmUnpkLwLcRgmBndCfm(func, pst, mBuf)
 RgmBndCfm func;
 Pst *pst;
 Buffer *mBuf;
@@ -348,19 +283,19 @@ Buffer *mBuf;
    
    TRC3(cmUnpkLwLcRgmBndCfm)
 
-   if (SUnpkU8(&status, mBuf) != ROK) 
+   if (oduPackUInt8(&status, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SUnpkS16(&suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, status));
+   return ((*func)(pst, suId, status));
 }
 
 \f
@@ -378,14 +313,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkLwLcRgmCfgPrbRprt
+S16 cmPkLwLcRgmCfgPrbRprt
 (
 Pst* pst,
 SpId spId,
 RgmPrbRprtCfg  * prbRprtCfg
 )
 #else
-PUBLIC S16 cmPkLwLcRgmCfgPrbRprt(pst, spId, prbRprtCfg)
+S16 cmPkLwLcRgmCfgPrbRprt(pst, spId, prbRprtCfg)
 Pst* pst;
 SpId spId;
 RgmPrbRprtCfg  * prbRprtCfg;
@@ -398,25 +333,25 @@ RgmPrbRprtCfg  * prbRprtCfg;
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-    if(cmPkPtr((PTR)prbRprtCfg, mBuf) != ROK)
+    if(oduPackPointer((PTR)prbRprtCfg, mBuf) != ROK)
     {
        SPutMsg(mBuf); 
        SPutSBuf(pst->region, pst->pool, (Data*)prbRprtCfg, len);
-       RETVALUE(RFAILED);
+       return RFAILED;
     }
 
    if (SPkS16(spId, mBuf) != ROK) 
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTRGMCFGPRBRPRT;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -434,14 +369,14 @@ RgmPrbRprtCfg  * prbRprtCfg;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkLwLcRgmCfgPrbRprt
+S16 cmUnpkLwLcRgmCfgPrbRprt
 (
 RgmCfgPrbRprtFptr func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkLwLcRgmCfgPrbRprt(func, pst, mBuf)
+S16 cmUnpkLwLcRgmCfgPrbRprt(func, pst, mBuf)
 RgmCfgPrbRprtFptr func;
 Pst *pst;
 Buffer *mBuf;
@@ -456,20 +391,20 @@ Buffer *mBuf;
    if (SUnpkS16(&spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if (cmUnpkPtr((PTR *)&prbRprtCfg, mBuf) != ROK)
+   if (oduUnpackPointer((PTR *)&prbRprtCfg, mBuf) != ROK)
    {
       SPutMsg(mBuf);
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    ret =  ((*func)(pst, spId, prbRprtCfg));
 
    SPutMsg(mBuf);
-   RETVALUE(ret);
+   return (ret);
 }
 
 
@@ -487,14 +422,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkLwLcRgmPrbRprtInd
+S16 cmPkLwLcRgmPrbRprtInd
 (
 Pst* pst,
 SuId suId,
 RgmPrbRprtInd  * prbRprtInd
 )
 #else
-PUBLIC S16 cmPkLwLcRgmPrbRprtInd(pst, suId, prbRprtInd)
+S16 cmPkLwLcRgmPrbRprtInd(pst, suId, prbRprtInd)
 Pst* pst;
 SuId suId;
 RgmPrbRprtInd  * prbRprtInd;
@@ -506,25 +441,25 @@ RgmPrbRprtInd  * prbRprtInd;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if(cmPkPtr((PTR)prbRprtInd, mBuf) != ROK)
+   if(oduPackPointer((PTR)prbRprtInd, mBuf) != ROK)
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTRGMCFGPRBRPRT;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 
@@ -542,14 +477,14 @@ RgmPrbRprtInd  * prbRprtInd;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkLwLcRgmPrbRprtInd
+S16 cmUnpkLwLcRgmPrbRprtInd
 (
 RgmPrbRprtIndFptr func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkLwLcRgmPrbRprtInd(func, pst, mBuf)
+S16 cmUnpkLwLcRgmPrbRprtInd(func, pst, mBuf)
 RgmPrbRprtIndFptr func;
 Pst *pst;
 Buffer *mBuf;
@@ -564,14 +499,14 @@ Buffer *mBuf;
    if (SUnpkS16(&suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if (cmUnpkPtr((PTR *)&prbRprtInd, mBuf) != ROK) 
+   if (oduUnpackPointer((PTR *)&prbRprtInd, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 
@@ -579,7 +514,7 @@ Buffer *mBuf;
 
    SPutMsg(mBuf);
 
-   RETVALUE(ret);
+   return (ret);
 }
 #endif
 
@@ -598,14 +533,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRgmBndReq
+S16 cmPkRgmBndReq
 (
 Pst* pst,
 SuId suId,
 SpId spId
 )
 #else
-PUBLIC S16 cmPkRgmBndReq(pst, suId, spId)
+S16 cmPkRgmBndReq(pst, suId, spId)
 Pst* pst;
 SuId suId;
 SpId spId;
@@ -616,23 +551,23 @@ SpId spId;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTRGMBNDREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -650,14 +585,14 @@ SpId spId;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRgmBndReq
+S16 cmUnpkRgmBndReq
 (
 RgmBndReq func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRgmBndReq(func, pst, mBuf)
+S16 cmUnpkRgmBndReq(func, pst, mBuf)
 RgmBndReq func;
 Pst *pst;
 Buffer *mBuf;
@@ -672,20 +607,20 @@ Buffer *mBuf;
    if (SUnpkS16(&suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SUnpkS16(&spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    ret = ((*func)(pst, suId, spId));
 
    SPutMsg(mBuf);
 
-   RETVALUE(ret);
+   return (ret);
 }
 
 /**
@@ -702,14 +637,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRgmUbndReq
+S16 cmPkRgmUbndReq
 (
 Pst* pst,
 SpId spId,
 Reason reason
 )
 #else
-PUBLIC S16 cmPkRgmUbndReq(pst, spId, reason)
+S16 cmPkRgmUbndReq(pst, spId, reason)
 Pst* pst;
 SpId spId;
 Reason reason;
@@ -720,21 +655,21 @@ Reason reason;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(reason, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SPkS16(spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTRGMUBNDREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 #if 1 
@@ -753,14 +688,14 @@ Reason reason;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRgmUbndReq
+S16 cmUnpkRgmUbndReq
 (
 RgmUbndReq func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRgmUbndReq(func, pst, mBuf)
+S16 cmUnpkRgmUbndReq(func, pst, mBuf)
 RgmUbndReq func;
 Pst *pst;
 Buffer *mBuf;
@@ -774,15 +709,15 @@ Buffer *mBuf;
    if (SUnpkS16(&spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if (SUnpkS16(&reason, mBuf) != ROK)
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, reason));
+   return ((*func)(pst, spId, reason));
 }
 #endif
 
@@ -801,14 +736,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRgmBndCfm
+S16 cmPkRgmBndCfm
 (
 Pst* pst,
 SuId suId,
 U8 status
 )
 #else
-PUBLIC S16 cmPkRgmBndCfm(pst, suId, status)
+S16 cmPkRgmBndCfm(pst, suId, status)
 Pst* pst;
 SuId suId;
 U8 status;
@@ -819,23 +754,23 @@ U8 status;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
-   if (SPkU8(status, mBuf) != ROK) 
+   if (oduUnpackUInt8(status, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
   pst->event = (Event) EVTRGMBNDCFM;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 \f
@@ -854,14 +789,14 @@ U8 status;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRgmBndCfm
+S16 cmUnpkRgmBndCfm
 (
 RgmBndCfm func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRgmBndCfm(func, pst, mBuf)
+S16 cmUnpkRgmBndCfm(func, pst, mBuf)
 RgmBndCfm func;
 Pst *pst;
 Buffer *mBuf;
@@ -872,19 +807,19 @@ Buffer *mBuf;
    
    TRC3(cmUnpkRgmBndCfm)
 
-   if (SUnpkU8(&status, mBuf) != ROK) 
+   if (oduPackUInt8(&status, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SUnpkS16(&suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, status));
+   return ((*func)(pst, suId, status));
 }
 
 \f
@@ -903,22 +838,22 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkCfgPrbRprt
+S16 cmPkCfgPrbRprt
 (
 RgmPrbRprtCfg  * prbRprtCfg,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmPkCfgPrbRprt(prbRprtCfg, mBuf)
+S16 cmPkCfgPrbRprt(prbRprtCfg, mBuf)
 RgmPrbRprtCfg  * prbRprtCfg;
 Buffer *mBuf;
 #endif
 {
    TRC3(cmPkCfgPrbRprt);
-   CMCHKPK(SPkU16, prbRprtCfg->usPrbAvgPeriodicty, mBuf);
-   CMCHKPK(SPkU8, prbRprtCfg->bConfigType, mBuf);
-   CMCHKPK(SPkU8, prbRprtCfg->bCellId, mBuf);
-   RETVALUE(ROK);
+   CMCHKPK(oduUnpackUInt16, prbRprtCfg->usPrbAvgPeriodicty, mBuf);
+   CMCHKPK(oduUnpackUInt8, prbRprtCfg->bConfigType, mBuf);
+   CMCHKPK(oduUnpackUInt8, prbRprtCfg->bCellId, mBuf);
+   return ROK;
 }
 /**
 * @brief Configure the PRB Report Preparation Start/Stop from RRM to MAC 
@@ -933,22 +868,22 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnPkCfgPrbRprt
+S16 cmUnPkCfgPrbRprt
 (
 RgmPrbRprtCfg  * prbRprtCfg,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnPkCfgPrbRprt(prbRprtCfg, mBuf)
+S16 cmUnPkCfgPrbRprt(prbRprtCfg, mBuf)
 RgmPrbRprtCfg  * prbRprtCfg;
 Buffer *mBuf;
 #endif
 {
    TRC3(cmUnPkCfgPrbRprt);
-   CMCHKUNPK(SUnpkU8, &prbRprtCfg->bCellId, mBuf);
-   CMCHKUNPK(SUnpkU8, &prbRprtCfg->bConfigType, mBuf);
-   CMCHKUNPK(SUnpkU16, &prbRprtCfg->usPrbAvgPeriodicty, mBuf);
-   RETVALUE(ROK);
+   CMCHKUNPK(oduPackUInt8, &prbRprtCfg->bCellId, mBuf);
+   CMCHKUNPK(oduPackUInt8, &prbRprtCfg->bConfigType, mBuf);
+   CMCHKUNPK(oduPackUInt16, &prbRprtCfg->usPrbAvgPeriodicty, mBuf);
+   return ROK;
 }
 
 
@@ -968,14 +903,14 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRgmCfgPrbRprt
+S16 cmPkRgmCfgPrbRprt
 (
 Pst* pst,
 SpId spId,
 RgmPrbRprtCfg  * prbRprtCfg
 )
 #else
-PUBLIC S16 cmPkRgmCfgPrbRprt(pst, spId, prbRprtCfg)
+S16 cmPkRgmCfgPrbRprt(pst, spId, prbRprtCfg)
 Pst* pst;
 SpId spId;
 RgmPrbRprtCfg  * prbRprtCfg;
@@ -988,27 +923,27 @@ RgmPrbRprtCfg  * prbRprtCfg;
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
     if(cmPkCfgPrbRprt(prbRprtCfg, mBuf) != ROK)
     {
        SPutMsg(mBuf); 
        SPutSBuf(pst->region, pst->pool, (Data*)prbRprtCfg, len);
-       RETVALUE(RFAILED);
+       return RFAILED;
     }
 
    if (SPkS16(spId, mBuf) != ROK) 
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    SPutSBuf(pst->region, pst->pool, (Data *)prbRprtCfg, sizeof(RgmPrbRprtCfg));
 
    pst->event = (Event) EVTRGMCFGPRBRPRT;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 
@@ -1027,14 +962,14 @@ RgmPrbRprtCfg  * prbRprtCfg;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRgmCfgPrbRprt
+S16 cmUnpkRgmCfgPrbRprt
 (
 RgmCfgPrbRprtFptr func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRgmCfgPrbRprt(func, pst, mBuf)
+S16 cmUnpkRgmCfgPrbRprt(func, pst, mBuf)
 RgmCfgPrbRprtFptr func;
 Pst *pst;
 Buffer *mBuf;
@@ -1047,23 +982,23 @@ Buffer *mBuf;
    if ((SGetSBuf(pst->region, pst->pool, (Data **)&prbRprtCfg, sizeof(RgmPrbRprtCfg))) != ROK)
       {
          SPutMsg(mBuf);
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
 
    if (SUnpkS16(&spId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (cmUnPkCfgPrbRprt(prbRprtCfg, mBuf) != ROK)
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, spId, prbRprtCfg));
+   return ((*func)(pst, spId, prbRprtCfg));
 }
 
 /* RRM_SP1_START */
@@ -1081,22 +1016,22 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRgmPrbQciRpt 
+S16 cmPkRgmPrbQciRpt 
 (
  RgmPrbRptPerQci *qciPrbRprt,
  Buffer *mBuf
  )
 #else
-PUBLIC S16 cmPkRgmPrbQciRpt(qciPrbRprt, mBuf)
+S16 cmPkRgmPrbQciRpt(qciPrbRprt, mBuf)
 RgmPrbRptPerQci *qciPrbRprt;
 Buffer *mBuf = NULLP;
 #endif
 {
-   CMCHKPK(SPkU8, qciPrbRprt->bQci, mBuf);
-   CMCHKPK(SPkU8, qciPrbRprt->bAvgPrbUlUsage, mBuf);
-   CMCHKPK(SPkU8, qciPrbRprt->bAvgPrbDlUsage, mBuf);
+   CMCHKPK(oduUnpackUInt8, qciPrbRprt->bQci, mBuf);
+   CMCHKPK(oduUnpackUInt8, qciPrbRprt->bAvgPrbUlUsage, mBuf);
+   CMCHKPK(oduUnpackUInt8, qciPrbRprt->bAvgPrbDlUsage, mBuf);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**
@@ -1112,22 +1047,22 @@ Buffer *mBuf = NULLP;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRgmPrbQciRpt 
+S16 cmUnpkRgmPrbQciRpt 
 (
  RgmPrbRptPerQci *qciPrbRprt,
  Buffer *mBuf
  )
 #else
-PUBLIC S16 cmUnpkRgmPrbQciRpt(qciPrbRprt, mBuf)
+S16 cmUnpkRgmPrbQciRpt(qciPrbRprt, mBuf)
 RgmPrbRptPerQci *qciPrbRprt;
 Buffer *mBuf = NULLP;
 #endif
 {
-   CMCHKUNPK(SUnpkU8, &qciPrbRprt->bAvgPrbDlUsage, mBuf);
-   CMCHKUNPK(SUnpkU8, &qciPrbRprt->bAvgPrbUlUsage, mBuf);
-   CMCHKUNPK(SUnpkU8, &qciPrbRprt->bQci, mBuf);
+   CMCHKUNPK(oduPackUInt8, &qciPrbRprt->bAvgPrbDlUsage, mBuf);
+   CMCHKUNPK(oduPackUInt8, &qciPrbRprt->bAvgPrbUlUsage, mBuf);
+   CMCHKUNPK(oduPackUInt8, &qciPrbRprt->bQci, mBuf);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 /* RRM_SP1_END */
 
@@ -1144,13 +1079,13 @@ Buffer *mBuf = NULLP;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkPrbRprtInd
+S16 cmPkPrbRprtInd
 (
  RgmPrbRprtInd  * prbRprtInd,
  Buffer *mBuf
  )
 #else
-PUBLIC S16 cmPkPrbRprtInd(prbRprtInd, mBuf)
+S16 cmPkPrbRprtInd(prbRprtInd, mBuf)
    RgmPrbRprtInd  * prbRprtInd;
    Buffer *mBuf = NULLP;
 #endif
@@ -1164,10 +1099,10 @@ PUBLIC S16 cmPkPrbRprtInd(prbRprtInd, mBuf)
    {
       CMCHKPK(cmPkRgmPrbQciRpt, &prbRprtInd->stQciPrbRpts[idx], mBuf);
    }
-   CMCHKPK(SPkU8, prbRprtInd->bPrbUsageMask, mBuf);
-   CMCHKPK(SPkU8, prbRprtInd->bCellId, mBuf);
+   CMCHKPK(oduUnpackUInt8, prbRprtInd->bPrbUsageMask, mBuf);
+   CMCHKPK(oduUnpackUInt8, prbRprtInd->bCellId, mBuf);
    /* RRM_SP1_END */
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**
@@ -1183,13 +1118,13 @@ PUBLIC S16 cmPkPrbRprtInd(prbRprtInd, mBuf)
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkPrbRprtInd
+S16 cmUnpkPrbRprtInd
 (
  RgmPrbRprtInd  * prbRprtInd,
  Buffer *mBuf
  )
 #else
-PUBLIC S16 cmUnpkPrbRprtInd(prbRprtInd, mBuf)
+S16 cmUnpkPrbRprtInd(prbRprtInd, mBuf)
    RgmPrbRprtInd  * prbRprtInd;
    Buffer *mBuf;
 #endif
@@ -1199,15 +1134,15 @@ PUBLIC S16 cmUnpkPrbRprtInd(prbRprtInd, mBuf)
    TRC3(cmUnpkPrbRprtInd);
 
    /* RRM_SP1_START */
-   CMCHKUNPK(SUnpkU8, &prbRprtInd->bCellId, mBuf);
-   CMCHKUNPK(SUnpkU8, &prbRprtInd->bPrbUsageMask, mBuf);
+   CMCHKUNPK(oduPackUInt8, &prbRprtInd->bCellId, mBuf);
+   CMCHKUNPK(oduPackUInt8, &prbRprtInd->bPrbUsageMask, mBuf);
    for(idx = 0; idx < RGM_MAX_QCI_REPORTS; idx++)
    {
       CMCHKUNPK(cmUnpkRgmPrbQciRpt, &prbRprtInd->stQciPrbRpts[idx], mBuf);
    }
 
    /* RRM_SP1_END */
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
@@ -1226,14 +1161,14 @@ PUBLIC S16 cmUnpkPrbRprtInd(prbRprtInd, mBuf)
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRgmPrbRprtInd
+S16 cmPkRgmPrbRprtInd
 (
 Pst* pst,
 SuId suId,
 RgmPrbRprtInd  * prbRprtInd
 )
 #else
-PUBLIC S16 cmPkRgmPrbRprtInd(pst, suId, prbRprtInd)
+S16 cmPkRgmPrbRprtInd(pst, suId, prbRprtInd)
 Pst* pst;
 SuId suId;
 RgmPrbRprtInd  * prbRprtInd;
@@ -1245,27 +1180,27 @@ RgmPrbRprtInd  * prbRprtInd;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if(cmPkPrbRprtInd(prbRprtInd, mBuf) != ROK)
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
       SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    SPutSBuf(pst->region, pst->pool, (Data *)prbRprtInd, sizeof(RgmPrbRprtInd));
 
    pst->event = (Event) EVTRGMPRBRPRTIND;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 /**
 * @brief PRB Usage Report Indication from MAC to RRM 
@@ -1281,14 +1216,14 @@ RgmPrbRprtInd  * prbRprtInd;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRgmPrbRprtInd
+S16 cmUnpkRgmPrbRprtInd
 (
 RgmPrbRprtIndFptr func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRgmPrbRprtInd(func, pst, mBuf)
+S16 cmUnpkRgmPrbRprtInd(func, pst, mBuf)
 RgmPrbRprtIndFptr func;
 Pst *pst;
 Buffer *mBuf;
@@ -1302,17 +1237,17 @@ Buffer *mBuf;
    if (SUnpkS16(&suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (cmUnpkPrbRprtInd(&prbRprtInd, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, &prbRprtInd));
+   return ((*func)(pst, suId, &prbRprtInd));
 }
 
 /**
@@ -1328,22 +1263,22 @@ Buffer *mBuf;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkTransModeInd
+S16 cmPkTransModeInd
 (
  RgmTransModeInd *transModeInd,
  Buffer *mBuf
  )
 #else
-PUBLIC S16 cmPkTransModeInd(transModeInd, mBuf)
+S16 cmPkTransModeInd(transModeInd, mBuf)
    RgmTransModeInd *transModeInd;
    Buffer *mBuf;
 #endif
 {
    TRC3(cmPkTransModeInd); 
-   CMCHKPK(SPkU32, transModeInd->eMode, mBuf);
-   CMCHKPK(SPkU16, transModeInd->usCrnti, mBuf);
-   CMCHKPK(SPkU8, transModeInd->bCellId, mBuf);
-   RETVALUE(ROK);
+   CMCHKPK(oduUnpackUInt32, transModeInd->eMode, mBuf);
+   CMCHKPK(oduUnpackUInt16, transModeInd->usCrnti, mBuf);
+   CMCHKPK(oduUnpackUInt8, transModeInd->bCellId, mBuf);
+   return ROK;
 }
 
 /**
@@ -1359,24 +1294,24 @@ PUBLIC S16 cmPkTransModeInd(transModeInd, mBuf)
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkTransModeInd
+S16 cmUnpkTransModeInd
 (
  RgmTransModeInd *transModeInd,
  Buffer *mBuf
  )
 #else
-PUBLIC S16 cmUnpkTransModeInd(transModeInd, mBuf)
+S16 cmUnpkTransModeInd(transModeInd, mBuf)
    RgmTransModeInd *transModeInd;
    Buffer *mBuf;
 #endif
 {
    U32 tmpModeEnum;
    TRC3(cmUnpkTransModeInd);
-   CMCHKUNPK(SUnpkU8, &transModeInd->bCellId, mBuf);
-   CMCHKUNPK(SUnpkU16, &transModeInd->usCrnti, mBuf);
-   CMCHKUNPK(SUnpkU32, (U32 *)&tmpModeEnum, mBuf);
+   CMCHKUNPK(oduPackUInt8, &transModeInd->bCellId, mBuf);
+   CMCHKUNPK(oduPackUInt16, &transModeInd->usCrnti, mBuf);
+   CMCHKUNPK(oduPackUInt32, (U32 *)&tmpModeEnum, mBuf);
    transModeInd->eMode = (RgmTxnMode)tmpModeEnum;
-   RETVALUE(ROK);
+   return ROK;
 }
 /**
 * @brief Transmission Mode Change Indication  from MAC to RRM 
@@ -1392,14 +1327,14 @@ PUBLIC S16 cmUnpkTransModeInd(transModeInd, mBuf)
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmPkRgmTransModeInd 
+S16 cmPkRgmTransModeInd 
 (
 Pst* pst,
 SuId suId,
 RgmTransModeInd *transModeInd
 )
 #else
-PUBLIC S16 cmPkRgmTransModeInd(pst, suId, transModeInd)
+S16 cmPkRgmTransModeInd(pst, suId, transModeInd)
 Pst* pst;
 SuId suId;
 RgmTransModeInd *transModeInd;
@@ -1411,27 +1346,27 @@ RgmTransModeInd *transModeInd;
 
    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
       SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if(cmPkTransModeInd(transModeInd, mBuf) != ROK)
    {
       SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (SPkS16(suId, mBuf) != ROK) 
    {
       SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    SPutSBuf(pst->region, pst->pool, (Data *)transModeInd, sizeof(RgmTransModeInd));
 
    pst->event = (Event) EVTRGMTRANSMODEIND;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 /**
 * @brief Transmission Mode Change Indication  from MAC to RRM 
@@ -1447,14 +1382,14 @@ RgmTransModeInd *transModeInd;
 *      -# ROK
 **/
 #ifdef ANSI
-PUBLIC S16 cmUnpkRgmTransModeInd
+S16 cmUnpkRgmTransModeInd
 (
 RgmTransModeIndFptr func,
 Pst *pst,
 Buffer *mBuf
 )
 #else
-PUBLIC S16 cmUnpkRgmTransModeInd(func, pst, mBuf)
+S16 cmUnpkRgmTransModeInd(func, pst, mBuf)
 RgmTransModeIndFptr func;
 Pst *pst;
 Buffer *mBuf;
@@ -1468,17 +1403,17 @@ Buffer *mBuf;
    if (SUnpkS16(&suId, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    if (cmUnpkTransModeInd(&transModeInd, mBuf) != ROK) 
    {
       SPutMsg(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    SPutMsg(mBuf);
-   RETVALUE((*func)(pst, suId, &transModeInd));
+   return ((*func)(pst, suId, &transModeInd));
 }
 /**********************************************************************