replaced cmMemSet, cmMemcpy with memset and memcpy resp AND Removed TRC() traces...
[o-du/l2.git] / src / 5gnrrlc / kw_ptli.c
index dd26729..811bc25 100755 (executable)
         File:    kw_ptli.c
   
 *********************************************************************21*/
-static const char* RLOG_MODULE_NAME="LIM";
-static int RLOG_MODULE_ID=2048;
-static int RLOG_FILE_ID=238;
+
 /** @file kw_ptli.c 
 @brief RLC Lower Interface
 */
 
 \f
 /* header (.h) include files */
-#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 "cm5.h"           /* common timer defines */
-#include "cm_tkns.h"       /* common tokens defines */
-#include "cm_mblk.h"       /* common memory allocation library 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 "lkw.h"           /* LKW defines */
 #include "ckw.h"           /* CKW defines */
 #include "kwu.h"           /* KWU defines */
@@ -62,16 +49,6 @@ static int RLOG_FILE_ID=238;
 #include "kw.h"            /* RLC defines */
 
 /* extern (.x) include files */
-#include "gen.x"           /* general */
-#include "ssi.x"           /* system services */
-
-#include "cm5.x"           /* common timer library */
-#include "cm_tkns.x"       /* common tokens */
-#include "cm_mblk.x"       /* common memory allocation */
-#include "cm_llist.x"      /* common link list */
-#include "cm_hash.x"       /* common hash list */
-#include "cm_lte.x"        /* common LTE includes */
-#include "cm_lib.x"        /* common memory allocation library */
 #include "lkw.x"           /* LKW */
 #include "ckw.x"           /* CKW */
 #include "kwu.x"           /* KWU */
@@ -100,194 +77,48 @@ EXTERN "C" {
 
 
 #ifdef RLC_MAC_DAT_REQ_RBUF
-PUBLIC S16 kwLiRguDatReqRbuf(Pst *Post,SpId spId,Void *datReq);
+S16 rlcLiRguDatReqRbuf(Pst *Post,SpId spId,Void *datReq);
 #endif
 
 #ifdef RLC_MAC_STA_RSP_RBUF
-PUBLIC S16 kwLiRguStaRspRbuf(Pst *Post,SpId spId,Void  *staRsp);
+S16 rlcLiRguStaRspRbuf(Pst *Post,SpId spId,Void  *staRsp);
 #endif
 #if defined(MAC_RLC_HARQ_STA_RBUF) && defined(LTE_L2_MEAS)
-EXTERN S16 KwDlHarqStaBatchProc (Void);
+EXTERN S16 RlcDlHarqStaBatchProc (Void);
 #endif
 
 \f
-/*********************************************************************
- *             Forward Declaration of RGU Porting Functions
- ********************************************************************/
-EXTERN S16 PtLiRguBndReq ARGS((
-Pst         *post,
-SuId        suId,
-SpId        spId
-));
-
-EXTERN S16 PtLiRguUbndReq ARGS ((
-Pst         *post,
-SpId        spId,
-Reason      reason
-));
-
-EXTERN S16 PtLiRguCDatReq ARGS ((
-Pst               *post,
-SpId              spId,
-RguCDatReqInfo    *datReq
-));
-
-EXTERN S16 PtLiRguDDatReq ARGS ((
-Pst               *post,
-SpId              spId,
-RguDDatReqInfo    *datReq
-));
-
-EXTERN S16 PtLiRguCStaRsp ARGS ((
-Pst               *post,
-SpId              spId,
-RguCStaRspInfo    *staRsp
-));
-
-EXTERN S16 PtLiRguDStaRsp ARGS ((
-Pst               *post,
-SpId              spId,
-RguDStaRspInfo    *staRsp
-));
-/* kw005.201 added support for L2 Measurement */
-#ifdef LTE_L2_MEAS
-#ifdef LTE_RLC_R9
-EXTERN S16 PtLiRguL2mUlThrpMeasReq ARGS ((
-Pst                      *post,
-SpId                     spId,
-RguL2MUlThrpMeasReqInfo  *l2mUlThrpMeasReq
-));
-#endif /* LTE_RLC_R9 */
-#endif /* LTE_L2_MEAS  */
-
-\f
 /*********************************************************************
  *             Primitives for RGU interface 
  ********************************************************************/
 
 /* RGU Bind Request primitive */
 
-PUBLIC RguBndReq kwLiRguBndReqMt[] =
+RguBndReq kwLiRguBndReqMt[] =
 {
 #ifdef LCKWLIRGU
    cmPkRguBndReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguBndReq,            /* 0 - loosely coupled, portable  */
 #endif /* LCRGUIRGU */
 #ifdef RG 
    RgUiRguBndReq,            /* 1 - tightly coupled, MAC  */
-#else
-   PtLiRguBndReq,            /* 1 - tightly coupled, portable */
 #endif /* RG */
 #ifdef LCKWLIRGU
    cmPkRguBndReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguBndReq,            /* 0 - loosely coupled, portable  */
 #endif /* LCRGUIRGU */
 };
 
 /* RGU Unbind Request primitive */
 
-PUBLIC RguBndReq kwLiRguUbndReqMt[] =
+RguBndReq kwLiRguUbndReqMt[] =
 {
 #ifdef LCKWLIRGU
    cmPkRguUbndReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguUbndReq,            /* 0 - loosely coupled, portable  */
 #endif /* LCRGUIRGU */
 #ifdef RG 
    RgUiRguUbndReq,            /* 1 - tightly coupled, MAC  */
-#else
-   PtLiRguUbndReq,            /* 1 - tightly coupled, portable */ /* RG */
 #endif /* RG */
 #ifdef LCKWLIRGU
    cmPkRguUbndReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguUbndReq,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-};
-
-/* RGU Common Channel Data Request primitive */
-
-PUBLIC RguCDatReq kwLiRguCDatReqMt[] =
-{
-#ifdef LCKWLIRGU
-   cmPkRguCDatReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguCDatReq,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-#ifdef RG 
-   RgUiRguCDatReq,            /* 1 - tightly coupled, MAC  */
-#else
-   PtLiRguCDatReq,            /* 1 - tightly coupled, portable */
-#endif /* RG */
-#ifdef LCKWLIRGU
-   cmPkRguCDatReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguCDatReq,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-};
-
-/* RGU Dedicated Channel Data Request primitive */
-
-PUBLIC RguDDatReq kwLiRguDDatReqMt[] =
-{
-#ifdef LCKWLIRGU
-   cmPkRguDDatReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguDDatReq,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-#ifdef RG 
-   RgUiRguDDatReq,            /* 1 - tightly coupled, MAC  */
-#else
-   PtLiRguDDatReq,            /* 1 - tightly coupled, portable */
-#endif /* RG */
-#ifdef LCKWLIRGU
-   cmPkRguDDatReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguDDatReq,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-};
-
-/* RGU Common Channel Status Response primitive */
-
-PUBLIC RguCStaRsp kwLiRguCStaRspMt[] =
-{
-#ifdef LCKWLIRGU
-   cmPkRguCStaRsp,            /* 0 - loosely coupled */
-#else
-   PtLiRguCStaRsp,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-#ifdef RG 
-   RgUiRguCStaRsp,            /* 1 - tightly coupled, MAC  */
-#else
-   PtLiRguCStaRsp,            /* 1 - tightly coupled, portable */
-#endif /* RG */
-#ifdef LCKWLIRGU
-   cmPkRguCStaRsp,            /* 0 - loosely coupled */
-#else
-   PtLiRguCStaRsp,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-};
-
-/* RGU Dedicated Channel Status Response primitive */
-
-PUBLIC RguDStaRsp kwLiRguDStaRspMt[] =
-{
-#ifdef LCKWLIRGU
-   cmPkRguDStaRsp,            /* 0 - loosely coupled */
-#else
-   PtLiRguDStaRsp,            /* 0 - loosely coupled, portable  */
-#endif /* LCRGUIRGU */
-#ifdef RG 
-   RgUiRguDStaRsp,            /* 1 - tightly coupled, MAC  */
-#else
-   PtLiRguDStaRsp,            /* 1 - tightly coupled, portable */
-#endif /* RG */
-#ifdef LCKWLIRGU
-   cmPkRguDStaRsp,            /* 0 - LWLC loosely coupled */
-#else
-   PtLiRguDStaRsp,            /* 0 - LWLC loosely coupled, portable  */
 #endif /* LCRGUIRGU */
 };
 
@@ -296,17 +127,13 @@ PUBLIC RguDStaRsp kwLiRguDStaRspMt[] =
 #ifdef LTE_RLC_R9
 /* RGU L2 Measurement Ul Ip Throughput Measurement Request primitive */
 
-PUBLIC RguL2MUlThrpMeasReq kwLiRguL2MUlThrpMeasReqMt[] =
+RguL2MUlThrpMeasReq kwLiRguL2MUlThrpMeasReqMt[] =
 {
 #ifdef LCKWLIRGU
    cmPkRguL2MUlThrpMeasReq,            /* 0 - loosely coupled */
-#else
-   PtLiRguL2mUlThrpMeasReq,            /* 0 - loosely coupled, portable  */
 #endif /* LCRGUIRGU */
 #ifdef RG 
    RgUiRguL2MUlThrpMeasReq,            /* 1 - tightly coupled, MAC  */
-#else
-   PtLiRguL2mUlThrpMeasReq,            /* 1 - tightly coupled, portable */
 #endif /* RG */
 };
 #endif /* LTE_RLC_R9 */
@@ -337,27 +164,26 @@ PUBLIC RguL2MUlThrpMeasReq kwLiRguL2MUlThrpMeasReqMt[] =
  */
 
 #ifdef ANSI
-PUBLIC S16 KwLiRguBndReq
+S16 RlcLiRguBndReq
 (
 Pst  *post,                       /* post structure */
 SuId suId,                      /* Service User Id */
 SpId spId                       /* Service Provider Id */
 )
 #else
-PUBLIC S16 KwLiRguBndReq(post, suId, spId)
+S16 RlcLiRguBndReq(post, suId, spId)
 Pst  *post;                       /* post structure */
 SuId suId;                      /* Service User Id */
 SpId spId;                      /* Service Provider Id */
 #endif
 {
-   TRC3(KwLiRguBndReq)
 
    /* jump to specific primitive depending on configured selector */
    (*kwLiRguBndReqMt[post->selector])(post, suId, spId);
 
-   RETVALUE(ROK);
+   return ROK;
 
-} /* end of KwLiRguBndReq */
+} /* end of RlcLiRguBndReq */
 
 \f
 /**
@@ -380,235 +206,26 @@ SpId spId;                      /* Service Provider Id */
  */
 
 #ifdef ANSI
-PUBLIC S16 KwLiRguUbndReq
+S16 RlcLiRguUbndReq
 (
 Pst         *post,
 SpId        spId,
 Reason      reason
 )
 #else
-PUBLIC S16 KwLiRguUbndReq(post, spId, reason)
+S16 RlcLiRguUbndReq(post, spId, reason)
 Pst         *post;
 SpId        spId;
 Reason      reason;
 #endif
 {
-   TRC3(KwLiRguUbndReq)
 
    /* jump to specific primitive depending on configured selector */
    (*kwLiRguUbndReqMt[post->selector])(post, spId, reason);
 
-   RETVALUE(ROK);
-
-} /* end of KwLiRguUbndReq */
-
-\f  
-/**
- *
- * @brief 
- *
- *        Handler for sending the PDU from RLC to MAC for common logical channels. 
- *
- * @b Description:
- *
- *        This function sends a PDU of a common logical channel to MAC
- *        along with timing info for BCCH and PCCH and RNTI for CCCH. 
- *
- *  @param[in] post         Post structure  
- *  @param[in] spId        Service Provider ID
- *  @param[in] datIndInfo  Data Request Information 
- *
- *  @return  S16
- *      -# ROK 
- *      -# RFAILED
- *
- */
-#ifdef ANSI
-PUBLIC S16 KwLiRguCDatReq
-(
-Pst               *post,
-SpId              spId,
-RguCDatReqInfo    *datReq
-)
-#else
-PUBLIC S16 KwLiRguCDatReq(post, spId, datReq)
-Pst               *post;
-SpId              spId;
-RguCDatReqInfo    *datReq;
-#endif
-{
-   TRC3(KwLiRguCDatReq)
-//    printf("CSHP: KwLiRguCDatReq  ");
-#ifdef RLC_MAC_DAT_REQ_RBUF
-    //printf("to RING  \n");
-       post->event=EVTRGUCDATREQ;
-      if((kwLiRguDatReqRbuf(post, spId, datReq)) != ROK)
-      {
-
-            SPutStaticBuffer(post->region, post->pool,                      
-                      (Data *) datReq, sizeof(RguCDatReqInfo), 0);             
-         RETVALUE(RFAILED);
-      }
-#else
-
-   // printf("to Pack Sel is %d  \n",post->selector);
-   /* jump to specific primitive depending on configured selector */
-   (*kwLiRguCDatReqMt[post->selector])(post, spId, datReq);
-#endif
-   RETVALUE(ROK);
-
-} /* end of KwLiRguCDatReq */
-
-\f  
-/**
- *
- * @brief 
- *
- *        Handler for sending PDU(s) from RLC to MAC for dedicated logical channels. 
- *
- * @b Description:
- *
- *        This function sends PDU(s) to MAC via one or more dedicated 
- *        logical channels along with the Buffer Occupancy of these
- *        channels.
- *
- *  @param[in] post         Post structure  
- *  @param[in] spId        Service Provider ID
- *  @param[in] datIndInfo  Data Request Information 
- *
- *  @return  S16
- *      -# ROK 
- *      -# RFAILED
- *
- */
-#ifdef ANSI
-PUBLIC S16 KwLiRguDDatReq
-(
-Pst               *post,
-SpId              spId,
-RguDDatReqInfo    *datReq
-)
-#else
-PUBLIC S16 KwLiRguDDatReq(post, spId, datReq)
-Pst               *post;
-SpId              spId;
-RguDDatReqInfo    *datReq;
-#endif
-{
-   TRC3(KwLiRguDDatReq)
-#ifdef RLC_MAC_DAT_REQ_RBUF
-        post->event=EVTRGUDDATREQ;
-      if((kwLiRguDatReqRbuf(post, spId, datReq)) != ROK)
-      {
-
-      SPutStaticBuffer(post->region, post->pool,                      
-                      (Data *) datReq, sizeof(RguDDatReqInfo), 0);             
-         RETVALUE(RFAILED);
-      }
-#else
-   /* jump to specific primitive depending on configured selector */
-   (*kwLiRguDDatReqMt[post->selector])(post, spId, datReq);
-#endif 
-   RETVALUE(ROK);
-
-} /* end of KwLiRguDDatReq */
-
-\f  
-/**
- *
- * @brief  
- *
- *        Handler for reporting the Buffer Occupancy to MAC 
- *     for common logical channels.
- *
- * @b Description:
- *
- *        This function reports the Buffer Occupancy of a common logical
- *        channel to MAC along with timing information for BCCH and PCCH
- *        and RNTI for CCCH. 
- *
- *  @param[in] post         Post structure  
- *  @param[in] spId        Service Provider ID
- *  @param[in] staRspInfo  Status Response Information 
- *
- *  @return  S16
- *      -# ROK 
- *      -# RFAILED
- *
- */
-#ifdef ANSI
-PUBLIC S16 KwLiRguCStaRsp
-(
-Pst               *post,
-SpId              spId,
-RguCStaRspInfo    *staRsp
-)
-#else
-PUBLIC S16 KwLiRguCStaRsp(post, spId, staRsp)
-Pst               *post;
-SpId              spId;
-RguCStaRspInfo    *staRsp;
-#endif
-{
-   TRC3(KwLiRguCStaRsp)
-
-   /* jump to specific primitive depending on configured selector */
-   (*kwLiRguCStaRspMt[post->selector])(post, spId, staRsp);
-   RETVALUE(ROK);
-
-} /* end of KwLiRguCStaRsp */
-
-\f  
-/**
- *
- * @brief  
- *
- *        Handler for reporting the Buffer Occupancy to MAC 
- *        for dedicated logical channels.
- *
- * @b Description:
- *
- *        This function reports the Buffer Occupancy of one or more
- *        dedicated logical channels to MAC. 
- *
- *  @param[in] post         Post structure  
- *  @param[in] spId        Service Provider ID
- *  @param[in] staRspInfo  Status Response Information 
- *
- *  @return  S16
- *      -# ROK 
- *      -# RFAILED
- *
- */
-#ifdef ANSI
-PUBLIC S16 KwLiRguDStaRsp
-(
-Pst               *post,
-SpId              spId,
-RguDStaRspInfo    *staRsp
-)
-#else
-PUBLIC S16 KwLiRguDStaRsp(post, spId, staRsp)
-Pst               *post;
-SpId              spId;
-RguDStaRspInfo    *staRsp;
-#endif
-{
-   TRC3(KwLiRguDStaRsp)
-#if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
-       post->event= EVTRGUDSTARSP;
-      if((kwLiRguStaRspRbuf(post, spId, staRsp)) != ROK)
-      {
-         RETVALUE(RFAILED);
-      }
-#else
-     /* jump to specific primitive depending on configured selector */
-     (*kwLiRguDStaRspMt[post->selector])(post, spId, staRsp);
-#endif 
-   RETVALUE(ROK);
-
-} /* end of KwLiRguDStaRsp */
+   return ROK;
 
+} /* end of RlcLiRguUbndReq */
 
 /* kw005.201 added support for L2 Measurement */
 #ifdef LTE_L2_MEAS
@@ -636,377 +253,49 @@ RguDStaRspInfo    *staRsp;
  *
  */
 #ifdef ANSI
-PUBLIC S16 KwLiRguL2MUlThrpMeasReq
+S16 RlcLiRguL2MUlThrpMeasReq
 (
 Pst                     *post,
 SpId                    spId,
 RguL2MUlThrpMeasReqInfo *l2mUlThrpMeasReq
 )
 #else
-PUBLIC S16 KwLiRguL2MUlThrpMeasReq(post, spId, l2mUlThrpMeasReq)
+S16 RlcLiRguL2MUlThrpMeasReq(post, spId, l2mUlThrpMeasReq)
 Pst                     *post;
 SpId                    spId;
 RguL2MUlThrpMeasReqInfo *l2mUlThrpMeasReq;
 #endif
 {
-   TRC3(KwLiRguL2MUlThrpMeasReq)
 
    /* jump to specific primitive depending on configured selector */
    (*kwLiRguL2MUlThrpMeasReqMt[post->selector])(post, spId, l2mUlThrpMeasReq);
 
-   RETVALUE(ROK);
+   return ROK;
 
-} /* end of KwLiRguL2MUlThrpMeasReq */
+} /* end of RlcLiRguL2MUlThrpMeasReq */
 
 #endif /* LTE_RLC_R9 */
 #endif /* LTE_L2_MEAS */
 
 
-
-/****************************************************************************
- *                         Porting Functions
- ***************************************************************************/
-\f
-/**
- *
- * @brief 
- *
- *        PtLiRguBndReq - portable bind request
- *
- *  @param[in] post   - Post structure  
- *  @param[in] suId  - Service user SAP ID 
- *  @param[in] spId  - Service provider ID
- *
- *  @return  S16
- *      -# ROK 
- */
-
-#ifdef ANSI
-PUBLIC S16 PtLiRguBndReq
-(
-Pst         *post,
-SuId        suId,
-SpId        spId
-)
-#else
-PUBLIC S16 PtLiRguBndReq(post, suId, spId)
-Pst         *post;
-SuId        suId;
-SpId        spId;
-#endif /* ANSI */
-{
-#if (ERRCLASS & ERRCLS_DEBUG)
-   KwCb   *tKwCb;
-#endif
-
-   TRC3(PtLiRguBndReq)
-#if (ERRCLASS & ERRCLS_DEBUG)
-   tKwCb = KW_GET_KWCB(post->srcInst);
-   RLOG0(L_ERROR,"Improper selector value");
-#endif /* (ERRCLASS & ERRCLS_DEBUG) */
-   RLOG0(L_ERROR,"Improper selector value");
-   UNUSED(post);
-   UNUSED(suId);
-   UNUSED(spId);
-
-   RETVALUE(ROK);
-} /* end of PtLiRguBndReq() */
-
-\f  
-/**
- *
- * @brief 
- *
- *        PtLiRguUbndReq - portable bind request
- *
- *  @param[in] post    -  Post structure  
- *  @param[in] spId   -  Service user SAP ID 
- *  @param[in] reason -  Service provider ID
- *
- *  @return  S16
- *      -# ROK 
- */
-
-#ifdef ANSI
-PUBLIC S16 PtLiRguUbndReq
-(
-Pst         *post,
-SpId        spId,
-Reason      reason
-)
-#else
-PUBLIC S16 PtLiRguUbndReq(post, spId, reason)
-Pst         *post;
-SpId        spId;
-Reason      reason;
-#endif /* ANSI */
-{
-#if (ERRCLASS & ERRCLS_DEBUG)
-   KwCb   *tKwCb;
-#endif
-
-   TRC3(PtLiRguUbndReq)
-#if (ERRCLASS & ERRCLS_DEBUG)
-   tKwCb = KW_GET_KWCB(post->srcInst);
-   RLOG0(L_ERROR,"Improper selector value");
-#endif /* (ERRCLASS & ERRCLS_DEBUG) */
-   UNUSED(post);
-   UNUSED(spId);
-   UNUSED(reason);
-
-   RETVALUE(ROK);
-} /* end of PtLiRguUbndReq() */
-
-\f  
-/**
- *
- * @brief 
- *
- *        PtLiRguCDatReq - portable common channel data request
- *
- *  @param[in] post    -  Post structure  
- *  @param[in] spId   -  Service user SAP ID 
- *  @param[in] datReq -  Service provider ID
- *
- *  @return  S16
- *      -# ROK 
- */
-
-#ifdef ANSI
-PUBLIC S16 PtLiRguCDatReq
-(
-Pst               *post,
-SpId              spId,
-RguCDatReqInfo    *datReq
-)
-#else
-PUBLIC S16 PtLiRguCDatReq(post, spId, datReq)
-Pst               *post;
-SpId              spId;
-RguCDatReqInfo    *datReq;
-#endif /* ANSI */
-{
-#if (ERRCLASS & ERRCLS_DEBUG)
-   KwCb   *tKwCb;
-#endif
-
-   TRC3(PtLiRguCDatReq)
-#if (ERRCLASS & ERRCLS_DEBUG)
-   tKwCb = KW_GET_KWCB(post->srcInst);
-   RLOG0(L_ERROR,"Improper selector value");
-#endif /* (ERRCLASS & ERRCLS_DEBUG) */
-   UNUSED(post);
-   UNUSED(spId);
-   UNUSED(datReq);
-
-   RETVALUE(ROK);
-} /* end of PtLiRguCDatReq() */
-
-\f  
-/**
- *
- * @brief 
- *
- *        PtLiRguDDatReq - portable dedicated channel data request
- *
- *  @param[in] post    -  Post structure  
- *  @param[in] spId   -  Service user SAP ID 
- *  @param[in] datReq -  Service provider ID
- *
- *  @return  S16
- *      -# ROK 
- */
-
-#ifdef ANSI
-PUBLIC S16 PtLiRguDDatReq
-(
-Pst               *post,
-SpId              spId,
-RguDDatReqInfo    *datReq
-)
-#else
-PUBLIC S16 PtLiRguDDatReq( post, spId, datReq)
-Pst               *post;
-SpId              spId;
-RguDDatReqInfo    *datReq;
-#endif /* ANSI */
-{
-#if (ERRCLASS & ERRCLS_DEBUG)
-   KwCb   *tKwCb;
-#endif
-
-   TRC3(PtLiRguDDatReq)
-#if (ERRCLASS & ERRCLS_DEBUG)
-   tKwCb = KW_GET_KWCB(post->srcInst);
-   RLOG0(L_ERROR,"Improper selector value");
-#endif /* (ERRCLASS & ERRCLS_DEBUG) */
-   UNUSED(post);
-   UNUSED(spId);
-   UNUSED(datReq);
-
-   RETVALUE(ROK);
-} /* end of PtLiRguDDatReq() */
-
-\f  
-/**
- *
- * @brief 
- *
- *        PtLiRguCStaRsp - portable common channel Status Response
- *
- *  @param[in] post    -  Post structure  
- *  @param[in] spId   -  Service user SAP ID 
- *  @param[in] staRsp -  Service provider ID
- *
- *  @return  S16
- *      -# ROK 
- */
-
-#ifdef ANSI
-PUBLIC S16 PtLiRguCStaRsp
-(
-Pst               *post,
-SpId              spId,
-RguCStaRspInfo    *staRsp
-)
-#else
-PUBLIC S16 PtLiRguCStaRsp(post, spId, staRsp)
-Pst               *post;
-SpId              spId;
-RguCStaRspInfo    *staRsp;
-#endif /* ANSI */
-{
-#if (ERRCLASS & ERRCLS_DEBUG)
-   KwCb   *tKwCb;
-#endif
-
-   TRC3(PtLiRguCStaRsp)
-#if (ERRCLASS & ERRCLS_DEBUG)
-   tKwCb = KW_GET_KWCB(post->srcInst);
-   RLOG0(L_ERROR,"Improper selector value");
-#endif /* (ERRCLASS & ERRCLS_DEBUG) */
-   UNUSED(post);
-   UNUSED(spId);
-   UNUSED(staRsp);
-
-   RETVALUE(ROK);
-} /* end of PtLiRguCStaRsp() */
-
-\f  
-/**
- *
- * @brief 
- *
- *        PtLiRguDStaRsp - portable dedicated channel Status Response
- *
- *  @param[in] post    -  Post structure  
- *  @param[in] spId   -  Service user SAP ID 
- *  @param[in] staRsp -  Service provider ID
- *
- *  @return  S16
- *      -# ROK 
- */
-
-#ifdef ANSI
-PUBLIC S16 PtLiRguDStaRsp
-(
-Pst               *post,
-SpId              spId,
-RguDStaRspInfo    *staRsp
-)
-#else
-PUBLIC S16 PtLiRguDStaRsp(post, spId, staRsp)
-Pst               *post;
-SpId              spId;
-RguDStaRspInfo    *staRsp;
-#endif /* ANSI */
-{
-#if (ERRCLASS & ERRCLS_DEBUG)
-   KwCb   *tKwCb;
-#endif
-
-   TRC3(PtLiRguDStaRsp)
-#if (ERRCLASS & ERRCLS_DEBUG)
-   tKwCb = KW_GET_KWCB(post->srcInst);
-   RLOG0(L_ERROR,"Improper selector value");
-#endif /* (ERRCLASS & ERRCLS_DEBUG) */
-   UNUSED(post);
-   UNUSED(spId);
-   UNUSED(staRsp);
-
-   RETVALUE(ROK);
-} /* end of PtLiRguDStaRsp() */
-
-/* kw005.201 added support for L2 Measurement */
-#ifdef LTE_L2_MEAS
-#ifdef LTE_RLC_R9
-\f  
-/**
- *
- * @brief 
- *
- *      PtLiRguL2mUlThrpMeasReq - portable L2 Measurement Ul Thoughput Measurement Request
- *
- *  @param[in] post    -  Post structure  
- *  @param[in] spId   -  Service user SAP ID 
- *  @param[in] l2mUlThrpMeasReq -  Ul Throughput Measurement Request
- *
- *  @return  S16
- *      -# ROK 
- */
-
-#ifdef ANSI
-PUBLIC S16 PtLiRguL2mUlThrpMeasReq
-(
-Pst                     *post,
-SpId                    spId,
-RguL2MUlThrpMeasReqInfo *l2mUlThrpMeasReq
-)
-#else
-PUBLIC S16 PtLiRguL2mUlThrpMeasReq(post, spId, l2mUlThrpMeasReq)
-Pst                     *post,
-Pst                      *post;
-SpId                     spId;
-RguL2MUlThrpMeasReqInfo  *l2mUlThrpMeasReq;
-#endif /* ANSI */
-{
-#if (ERRCLASS & ERRCLS_DEBUG)
-   KwCb   *tKwCb;
-#endif
-
-   TRC3(PtLiRguL2mUlThrpMeasReq)
-#if (ERRCLASS & ERRCLS_DEBUG)
-   tKwCb = KW_GET_KWCB(post->srcInst);
-   RLOG0(L_ERROR,"Improper selector value");
-#endif /* (ERRCLASS & ERRCLS_DEBUG) */
-   UNUSED(post);
-   UNUSED(spId);
-   UNUSED(l2mUlThrpMeasReq);
-
-   RETVALUE(ROK);
-} /* end of PtLiRguL2mUlThrpMeasReq() */
-
-#endif /* LTE_RLC_R9 */
-#endif /* LTE_L2_MEAS */
-
 #ifdef MAC_RLC_UL_RBUF
-PUBLIC S16 kwUlBatchProc ARGS ((Void));
-EXTERN Void kwUtlFreeUlRBuf ARGS((void));
+S16 rlcUlBatchProc ARGS ((Void));
+EXTERN Void rlcUtlFreeUlRBuf ARGS((void));
 
 #ifdef ANSI
-PUBLIC S16 kwUlBatchProc
+S16 rlcUlBatchProc
 (
 Void
 )
 #else
-PUBLIC S16 kwUlBatchProc()
+S16 rlcUlBatchProc()
 Void;
 #endif
 {
 /* Read from Ring Buffer and process PDCP packets */
    RguDDatIndInfo   *datInd;
    Void *elmIndx = NULLP;
-   PRIVATE Pst rlcUlRbfuPst={1,1,ENTKW,0,ENTRG,0,PRIOR0,RTESPEC,EVTRGUDDATIND,0,0,0,0};
+   PRIVATE Pst rlcUlRbfuPst={1,1,ENTRLC,0,ENTMAC,0,PRIOR0,RTESPEC,EVTRLCULDAT,0,0,0,0};
 /* Read from Ring Buffer and process PDCP packets */
 
 #ifndef SS_RBUF
@@ -1021,7 +310,7 @@ Void;
       SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].nPktProc++;;//Number of pkt processed in tti
       if(datInd != NULLP)
       {
-         KwLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
+         RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd);
       }
       else
       {
@@ -1045,7 +334,7 @@ Void;
    while(NULLP != elmIndx)
    {
       datInd = (RguDDatIndInfo *)elmIndx;
-      KwLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
+      RlcProcDedLcUlData(&rlcUlRbfuPst, 0, datInd);
 
       elmIndx = NULLP;
       datInd = NULLP;
@@ -1055,7 +344,7 @@ Void;
        break;
    }
 #endif
-   RETVALUE(ROK);
+   return ROK;
 
 }
 
@@ -1073,9 +362,9 @@ Void;
  *
  */
 #ifdef ANSI
-PUBLIC Void kwUtlFreeUlRBuf(void)
+Void rlcUtlFreeUlRBuf(void)
 #else
-PUBLIC Void kwUtlFreeUlRBuf()  
+Void rlcUtlFreeUlRBuf()  
 #endif
 {
    RguDDatIndInfo *datInd;
@@ -1083,7 +372,6 @@ PUBLIC Void kwUtlFreeUlRBuf()
    U8             numLch;
    U8             numPdu;
 
-   TRC2(kwUtlFreeUlRBuf)
    /* Free SS_RNG_BUF_ULMAC_TO_ULRLC  */
    while((SDeqSRngBuf (SS_RNG_BUF_ULMAC_TO_ULRLC, &elem) == ROK))
    {
@@ -1094,24 +382,24 @@ PUBLIC Void kwUtlFreeUlRBuf()
          {
             if(datInd->lchData[numLch].pdu.mBuf[numPdu])
             {
-               KW_FREE_BUF_WC(datInd->lchData[numLch].pdu.mBuf[numPdu]);
+               RLC_FREE_BUF_WC(datInd->lchData[numLch].pdu.mBuf[numPdu]);
             }
          }
       }
-      KW_PST_FREE(0, 0, datInd, sizeof(RguDDatIndInfo)); 
+      RLC_PST_FREE(0, 0, datInd, sizeof(RguDDatIndInfo)); 
    }
 }
 #endif
 #ifdef RLC_MAC_STA_RSP_RBUF
 #ifdef ANSI
-PUBLIC S16 kwLiRguStaRspRbuf
+S16 rlcLiRguStaRspRbuf
 (
 Pst               *post,
 SpId              spId,
 Void             *staRsp
 )
 #else
-PUBLIC S16 kwLiRguStaRspRbuf(post, spId, staRsp)
+S16 rlcLiRguStaRspRbuf(post, spId, staRsp)
 Pst               *post;
 SpId              spId;
 Void              *staRsp;
@@ -1126,7 +414,7 @@ Void              *staRsp;
    if (NULLP != elem)
    {
       staRspInfo = (RguDStaRspInfo *)elem;
-      cmMemcpy((U8 *)staRspInfo, (U8 *)staRsp, sizeof(RguDStaRspInfo)); 
+      memcpy(staRspInfo, staRsp, sizeof(RguDStaRspInfo)); 
       staRspInfo->post = *post;
       SRngIncrWIndx(SS_RNG_BUF_DLRLC_TO_DLMAC);
       SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].pktRate++;
@@ -1137,20 +425,20 @@ Void              *staRsp;
       SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC].pktDrop++;
       ret1 = RFAILED;
    }
-   RETVALUE(ret1);
+   return (ret1);
 } /* cmPkKwuDatReq */
 
 #endif
 #ifdef RLC_MAC_DAT_REQ_RBUF
 #ifdef ANSI
-PUBLIC S16 kwLiRguDatReqRbuf
+S16 rlcLiRguDatReqRbuf
 (
 Pst               *post,
 SpId              spId,
 Void             *datReq
 )
 #else
-PUBLIC S16 kwLiRguDatReqRbuf(post, spId, datReq)
+S16 rlcLiRguDatReqRbuf(post, spId, datReq)
 Pst               *post;
 SpId              spId;
 Void             *datReq;
@@ -1176,7 +464,7 @@ Void             *datReq;
       SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].pktDrop++;
       ret1 = RFAILED;
    }
-   RETVALUE(ret1);
+   return (ret1);
 } /* cmPkKwuDatReq */
 
 #endif