Revert "[Epic-ID: ODUHIGH-462][Task-ID: ODUHIGH-472] Implementation of drx timer"
[o-du/l2.git] / src / 5gnrmac / rg_prg.c
index 85d5318..ea572fc 100755 (executable)
   
 **********************************************************************/
 /* header include files -- defines (.h) */
-#include "envopt.h"        /* environment options */
-#include "envdep.h"        /* environment dependent */
-#include "envind.h"        /* environment independent */
-#include "gen.h"           /* general layer */
-#include "ssi.h"           /* system service interface */
-#include "cm_hash.h"       /* common hash list */
-#include "cm_mblk.h"       /* common memory link list library */
-#include "cm_llist.h"      /* common linked list library */
-#include "cm_err.h"        /* common error */
-#include "cm_lte.h"        /* common LTE */
+#include "common_def.h"
 #include "lrg.h"
 #include "crg.h"
 #include "rgu.h"
 #include "rg_err.h"
 
 /* header/extern include files (.x) */
-#include "gen.x"           /* general layer typedefs */
-#include "ssi.x"           /* system services typedefs */
-#include "cm5.x"           /* common timers */
-#include "cm_hash.x"       /* common hash list */
-#include "cm_lib.x"        /* common library */
-#include "cm_llist.x"      /* common linked list */
-#include "cm_mblk.x"       /* memory management */
-#include "cm_tkns.x"       /* common tokens */
-#include "cm_lte.x"       /* common tokens */
 #include "rgu.x"           /* RGU types */
 #include "tfu.x"           /* RGU types */
 #include "lrg.x"           /* layer management typedefs for MAC */
 #include "crg.x"           /* layer management typedefs for MAC */
 #include "rg_sch_inf.x"           /* layer management typedefs for MAC */
 #include "rg_prg.x"           /* Prg(MAC-MAC)interface includes */
-#include "du_mgr_mac_inf.h"
+#include "du_app_mac_inf.h"
 #include "rg.x"            /* typedefs for MAC */
 
 #ifdef LTE_ADV
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmPkPrgPMacSMacUeSCellCfgReq
-(
-Pst           *pst,
-RgPrgUeSCellCfgInfo   *ueSCellCfgInfo
-)
-#else
-PUBLIC S16 cmPkPrgPMacSMacUeSCellCfgReq(pst, ueSCellCfgInfo)
-Pst            *pst;
-RgPrgUeSCellCfgInfo    *ueSCellCfgInfo;
-#endif
+S16 cmPkPrgPMacSMacUeSCellCfgReq(Pst  *pst,RgPrgUeSCellCfgInfo   *ueSCellCfgInfo)
 {
    Buffer *mBuf = NULLP;
 
-   TRC2(cmPkPrgPMacSMacUeSCellCfgReq)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
    if(SAddPstMsgMult((Data *)ueSCellCfgInfo, sizeof(RgPrgUeSCellCfgInfo),\
             mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTPRGUESCELLCFGREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 /** 
@@ -128,32 +98,18 @@ RgPrgUeSCellCfgInfo    *ueSCellCfgInfo;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellCfgReq
-(
-RgPrgUeSCellCfgReq   func,
-Pst                  *pst,
-Buffer               *mBuf
-)
-#else
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellCfgReq(func, pst, mBuf)
-RgPrgUeSCellCfgReq   func;
-Pst                  *pst;
-Buffer               *mBuf;
-#endif
+S16 cmUnpkPrgPMacSMacUeSCellCfgReq(RgPrgUeSCellCfgReq   func,Pst *pst,Buffer  *mBuf)
 {
    RgPrgUeSCellCfgInfo    ueSCellCfgInfo;
    
-   TRC2(cmUnpkPrgPMacSMacUeSCellCfgReq)
-
    if(SRemPreMsgMult((Data *)&ueSCellCfgInfo, sizeof(RgPrgUeSCellCfgInfo), mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    RGPRG_FREE_MSG(mBuf);
-   RETVALUE((*func)(pst, &ueSCellCfgInfo));
+   return ((*func)(pst, &ueSCellCfgInfo));
 }
 
 /** 
@@ -169,31 +125,19 @@ Buffer               *mBuf;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmPkPrgSMacPMacCfgCfm
-(
-Pst               *pst,
-RgPrgCfgCfmInfo   *cfgCfm
-)
-#else
-PUBLIC S16 cmPkPrgSMacPMacCfgCfm(pst, cfgCfm)
-Pst                *pst;
-RgPrgCfgCfmInfo    *cfgCfm;
-#endif
+S16 cmPkPrgSMacPMacCfgCfm(Pst *pst,RgPrgCfgCfmInfo   *cfgCfm)
 {
    Buffer *mBuf = NULLP;
 
-   TRC2(cmPkPrgSMacPMacCfgCfm)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
    if(SAddPstMsgMult((Data *)cfgCfm, sizeof(RgPrgCfgCfmInfo), mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    switch(cfgCfm->event)
    {
@@ -218,7 +162,7 @@ RgPrgCfgCfmInfo    *cfgCfm;
       }
       break;
    }
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 /** 
@@ -235,32 +179,23 @@ RgPrgCfgCfmInfo    *cfgCfm;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkPrgSMacPMacCfgCfm
+S16 cmUnpkPrgSMacPMacCfgCfm
 (
 RgSMacPMacCfgCfm    func,
 Pst                 *pst,
 Buffer              *mBuf
 )
-#else
-PUBLIC S16 cmUnpkPrgSMacPMacCfgCfm(func, pst, mBuf)
-RgSMacPMacCfgCfm    func;
-Pst                 *pst;
-Buffer              *mBuf;
-#endif
 {
    RgPrgCfgCfmInfo   cfgCfm;
    
-   TRC2(cmUnpkPrgSMacPMacCfgCfm)
-
    if(SRemPreMsgMult((Data *)&cfgCfm, sizeof(RgPrgCfgCfmInfo), mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    RGPRG_FREE_MSG(mBuf);
-   RETVALUE((*func)(pst, &cfgCfm));
+   return ((*func)(pst, &cfgCfm));
 }
 
 /** 
@@ -276,36 +211,24 @@ Buffer              *mBuf;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmPkPrgPMacSMacUeSCellDelReq
-(
-Pst                   *pst,
-RgPrgUeSCellDelInfo   *ueSCellDelInfo
-)
-#else
-PUBLIC S16 cmPkPrgPMacSMacUeSCellDelReq(pst, ueSCellDelInfo)
-Pst                    *pst;
-RgPrgUeSCellDelInfo    *ueSCellDelInfo;
-#endif
+S16 cmPkPrgPMacSMacUeSCellDelReq(Pst *pst,RgPrgUeSCellDelInfo   *ueSCellDelInfo)
 {
    Buffer *mBuf = NULLP;
 
-   TRC2(cmPkPrgPMacSMacUeSCellDelReq)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
    if(SAddPstMsgMult((Data *)ueSCellDelInfo, sizeof(RgPrgUeSCellDelInfo), mBuf)\
          != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTPRGUESCELLDELREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 /** 
@@ -322,33 +245,24 @@ RgPrgUeSCellDelInfo    *ueSCellDelInfo;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellDelReq
+S16 cmUnpkPrgPMacSMacUeSCellDelReq
 (
 RgUeSCellDelReq    func,
 Pst                *pst,
 Buffer             *mBuf
 )
-#else
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellDelReq(func, pst, mBuf)
-RgUeSCellDelReq  func;
-Pst              *pst;
-Buffer           *mBuf;
-#endif
 {
   RgPrgUeSCellDelInfo ueSCellDelInfo;
    
-   TRC2(cmUnpkPrgPMacSMacUeSCellDelReq)
-
    if(SRemPreMsgMult((Data *)&ueSCellDelInfo, sizeof(RgPrgUeSCellDelInfo),\
             mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    RGPRG_FREE_MSG(mBuf);
-   RETVALUE((*func)(pst, &ueSCellDelInfo));
+   return ((*func)(pst, &ueSCellDelInfo));
 }
 
 /** 
@@ -364,36 +278,24 @@ Buffer           *mBuf;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmPkPrgPMacSMacUeSCellLchAddReq
-(
-Pst                      *pst,
-RgPrgUeSCellLchAddInfo   *lchCfgInfo,
-)
-#else
-PUBLIC S16 cmPkPrgPMacSMacUeSCellLchAddReq(pst, lchCfgInfo)
-Pst                       *pst;
-RgPrgUeSCellLchAddInfo    *lchCfgInfo;
-#endif
+S16 cmPkPrgPMacSMacUeSCellLchAddReq(Pst *pst,RgPrgUeSCellLchAddInfo   *lchCfgInfo)
 {
    Buffer *mBuf = NULLP;
 
-   TRC2(cmPkPrgPMacSMacUeSCellLchAddReq)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
    if(SAddPstMsgMult((Data *)lchCfgInfo, sizeof(RgPrgUeSCellLchAddInfo),\
             mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTPRGUESCELLLCHADDREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 /** 
@@ -410,32 +312,23 @@ RgPrgUeSCellLchAddInfo    *lchCfgInfo;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellLchAddReq
+S16 cmUnpkPrgPMacSMacUeSCellLchAddReq
 (
 RgPrgUeSCellLchAddInfo       func,
 Pst                          *pst,
 Buffer                       *mBuf
 )
-#else
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellLchAddReq(func, pst, mBuf)
-RgPrgUeSCellLchAddInfo       func;
-Pst                          *pst;
-Buffer                       *mBuf;
-#endif
 {
    RgPrgLchRecfgInfo    lchCfgInfo;
    
-   TRC2(cmUnpkPrgPMacSMacUeSCellLchAddReq)
-
    if(SRemPreMsgMult((Data *)&lchCfgInfo, sizeof(RgPrgUeSCellLchAddInfo), mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    RGPRG_FREE_MSG(mBuf);
-   RETVALUE((*func)(pst, &lchCfgInfo));
+   return ((*func)(pst, &lchCfgInfo));
 }
 
 /** 
@@ -451,36 +344,24 @@ Buffer                       *mBuf;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmPkPrgPMacSMacUeSCellLchDelReq
-(
-Pst                       *pst,
-RgPrgUeSCellLchDelInfo    *delLcCb
-)
-#else
-PUBLIC S16 cmPkPrgPMacSMacUeSCellLchDelReq(pst, delLcCb)
-Pst                       *pst;
-RgPrgUeSCellLchDelInfo    *delLcCb;
-#endif
+S16 cmPkPrgPMacSMacUeSCellLchDelReq(Pst *pst,RgPrgUeSCellLchDelInfo *delLcCb)
 {
    Buffer *mBuf = NULLP;
 
-   TRC2(cmPkPrgPMacSMacUeSCellLchDelReq)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
    if(SAddPstMsgMult((Data *)delLcCb, sizeof(RgPrgUeSCellLchDelInfo),\
             mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTPRGUESCELLLCHDELREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 
@@ -497,36 +378,24 @@ RgPrgUeSCellLchDelInfo    *delLcCb;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmPkPrgPMacSMacUeSCellLchModReq
-(
-Pst                      *pst,
-RgPrgUeSCellLchModInfo   *lchCfgInfo
-)
-#else
-PUBLIC S16 cmPkPrgPMacSMacUeSCellLchModReq(pst, lchCfgInfo)
-Pst                       *pst;
-RgPrgUeSCellLchModInfo    *lchCfgInfo;
-#endif
+S16 cmPkPrgPMacSMacUeSCellLchModReq(Pst  *pst,RgPrgUeSCellLchModInfo  *lchCfgInfo)
 {
    Buffer *mBuf = NULLP;
 
-   TRC2(cmPkPrgPMacSMacUeSCellLchModReq)
-
-   if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) 
+   if (ODU_GET_MSG_BUF(pst->region, pst->pool, &mBuf) != ROK) 
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    
    if(SAddPstMsgMult((Data *)lchCfgInfo, sizeof(RgPrgUeSCellLchModInfo),\
             mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    pst->event = (Event) EVTPRGUESCELLLCHMODREQ;
-   RETVALUE(SPstTsk(pst,mBuf));
+   return (SPstTsk(pst,mBuf));
 }
 
 
@@ -544,32 +413,23 @@ RgPrgUeSCellLchModInfo    *lchCfgInfo;
  *  @return   S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellLchModReq
+S16 cmUnpkPrgPMacSMacUeSCellLchModReq
 (
 RgPrgUeScellModLchReq   func,
 Pst                     *pst,
 Buffer                  *mBuf
 )
-#else
-PUBLIC S16 cmUnpkPrgPMacSMacAddLchCfgReq(func, pst, mBuf)
-RgPrgUeScellModLchReq   func;
-Pst                     *pst;
-Buffer                  *mBuf;
-#endif
 {
    RgPrgUeSCellLchModInfo   lchCfgInfo;
    
-   TRC2(cmUnpkPrgPMacSMacAddLchCfgReq)
-
    if(SRemPreMsgMult((Data *)&lchCfgInfo, sizeof(RgPrgUeSCellLchModInfo), mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    RGPRG_FREE_MSG(mBuf);
-   RETVALUE((*func)(pst, &lchCfgInfo));
+   return ((*func)(pst, &lchCfgInfo));
 }
 
 
@@ -587,32 +447,23 @@ Buffer                  *mBuf;
  *  @return      S16
  *      -# ROK
  **/
-#ifdef ANSI
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellLchDelReq
+S16 cmUnpkPrgPMacSMacUeSCellLchDelReq
 (
 RgPrgUeScellDelLchReq   func,
 Pst                     *pst,
 Buffer                  *mBuf
 )
-#else
-PUBLIC S16 cmUnpkPrgPMacSMacUeSCellLchDelReq(func, pst, mBuf)
-RgPrgUeScellDelLchReq   func;
-Pst                     *pst;
-Buffer                  *mBuf;
-#endif
 {
    RgPrgUeSCellLchDelInfo   lchCfgInfo;
    
-   TRC2(cmUnpkPrgPMacSMacUeSCellLchDelReq)
-
    if(SRemPreMsgMult((Data *)&lchCfgInfo, sizeof(RgPrgUeSCellLchDelInfo), mBuf) != ROK)
    {
       RGPRG_FREE_MSG(mBuf);
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    RGPRG_FREE_MSG(mBuf);
-   RETVALUE((*func)(pst, &lchCfgInfo));
+   return ((*func)(pst, &lchCfgInfo));
 }
 
 #endif /*LCPRG*/