Fix for L2 compilation with WLS [Issue-ID: ODUHIGH-240]
[o-du/l2.git] / src / 5gnrrlc / kw_ptli.c
index 92cb98e..c41ca38 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 */
@@ -85,6 +62,10 @@ static int RLOG_FILE_ID=238;
 #include "ss_rbuf.h"
 #include "ss_rbuf.x"
 
+#ifdef EGTP_TEST
+#include "mac_stub.h"
+#endif /* EGTP_TEST */
+
 #ifndef LCKWLIRGU
 #define PTKWRGU
 #endif
@@ -100,14 +81,14 @@ 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
@@ -117,7 +98,7 @@ EXTERN S16 KwDlHarqStaBatchProc (Void);
 
 /* RGU Bind Request primitive */
 
-PUBLIC RguBndReq kwLiRguBndReqMt[] =
+RguBndReq kwLiRguBndReqMt[] =
 {
 #ifdef LCKWLIRGU
    cmPkRguBndReq,            /* 0 - loosely coupled */
@@ -132,7 +113,7 @@ PUBLIC RguBndReq kwLiRguBndReqMt[] =
 
 /* RGU Unbind Request primitive */
 
-PUBLIC RguBndReq kwLiRguUbndReqMt[] =
+RguBndReq kwLiRguUbndReqMt[] =
 {
 #ifdef LCKWLIRGU
    cmPkRguUbndReq,            /* 0 - loosely coupled */
@@ -147,33 +128,45 @@ PUBLIC RguBndReq kwLiRguUbndReqMt[] =
 
 /* RGU Dedicated Channel Data Request primitive */
 
-PUBLIC RguDDatReq rlcMacSendDlDataOpts[] =
+RlcMacDlData rlcMacSendDlDataOpts[] =
 {
+#ifdef EGTP_TEST
+   macStubSendDlData,
+   macStubSendDlData,
+   macStubSendDlData,
+#else /* EGTP_TEST */
 #ifdef LCKWLIRGU
    packDlData,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
 #ifdef RG 
-   RgUiRguDDatReq,            /* 1 - tightly coupled, MAC  */
+   MacRlcProcDlData,      /* 1 - tightly coupled, MAC  */
 #endif /* RG */
 #ifdef LCKWLIRGU
    packDlData,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
+#endif /* EGTP_TEST */
 };
 
 
 /* RLC logical Channel Status primitive */
 
-PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] =
+RlcMacBoStatus rlcMacSendBOStatusOpts[] =
 {
+#ifdef EGTP_TEST
+   macStubBOStatus,
+   macStubBOStatus,
+   macStubBOStatus,
+#else /* EGTP_TEST */
 #ifdef LCKWLIRGU
    packBOStatus,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
 #ifdef RG 
-   RgUiRguDStaRsp,            /* 1 - tightly coupled, MAC  */
+   MacRlcProcBOStatus,            /* 1 - tightly coupled, MAC  */
 #endif /* RG */
 #ifdef LCKWLIRGU
    packBOStatus,            /* 0 - LWLC loosely coupled */
 #endif /* LCRGUIRGU */
+#endif /* EGTP_TEST */
 };
 
 /* kw005.201 added support for L2 Measurement */
@@ -181,7 +174,7 @@ PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] =
 #ifdef LTE_RLC_R9
 /* RGU L2 Measurement Ul Ip Throughput Measurement Request primitive */
 
-PUBLIC RguL2MUlThrpMeasReq kwLiRguL2MUlThrpMeasReqMt[] =
+RguL2MUlThrpMeasReq kwLiRguL2MUlThrpMeasReqMt[] =
 {
 #ifdef LCKWLIRGU
    cmPkRguL2MUlThrpMeasReq,            /* 0 - loosely coupled */
@@ -218,27 +211,27 @@ 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)
+   TRC3(RlcLiRguBndReq)
 
    /* 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
 /**
@@ -261,27 +254,27 @@ 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)
+   TRC3(RlcLiRguUbndReq)
 
    /* jump to specific primitive depending on configured selector */
    (*kwLiRguUbndReqMt[post->selector])(post, spId, reason);
 
-   RETVALUE(ROK);
+   return ROK;
 
-} /* end of KwLiRguUbndReq */
+} /* end of RlcLiRguUbndReq */
 
 \f  
 /**
@@ -306,14 +299,14 @@ Reason      reason;
  *
  */
 #ifdef ANSI
-PUBLIC S16 RlcMacSendDlData
+S16 RlcMacSendDlData
 (
 Pst               *post,
 SpId              spId,
 RlcMacData       *dlData
 )
 #else
-PUBLIC S16 RlcMacSendDlData(post, spId, dlData)
+S16 RlcMacSendDlData(post, spId, dlData)
 Pst               *post;
 SpId              spId;
 RlcMacData        *dlData;
@@ -322,20 +315,20 @@ RlcMacData        *dlData;
    TRC3(RlcMacSendDlData)
 #ifdef RLC_MAC_DAT_REQ_RBUF
         post->event=EVTRGUDDATREQ;
-      if((kwLiRguDatReqRbuf(post, spId, datReq)) != ROK)
+      if((rlcLiRguDatReqRbuf(post, spId, datReq)) != ROK)
       {
 
       SPutStaticBuffer(post->region, post->pool,                      
                       (Data *) datReq, sizeof(RguDDatReqInfo), 0);             
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
 #else
    /* jump to specific primitive depending on configured selector */
    (*rlcMacSendDlDataOpts[post->selector])(post, spId, dlData);
 #endif 
-   RETVALUE(ROK);
+   return ROK;
 
-} /* end of KwLiRguDDatReq */
+} /* end of RlcLiRguDDatReq */
 
 
 \f  
@@ -361,14 +354,14 @@ RlcMacData        *dlData;
  *
  */
 #ifdef ANSI
-PUBLIC S16 RlcMacSendBOStatus
+S16 RlcMacSendBOStatus
 (
 Pst               *post,
 SpId              spId,
 RlcMacBOStatus    *boSta
 )
 #else
-PUBLIC S16 RlcMacSendBOStatus(post, spId, staRsp)
+S16 RlcMacSendBOStatus(post, spId, staRsp)
 Pst               *post;
 SpId              spId;
 RlcMacBOStatus    *boSta;
@@ -377,15 +370,15 @@ RlcMacBOStatus    *boSta;
    TRC3(RlcMacSendBOStatus)
 #if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
        post->event= EVTRGUDSTARSP;
-      if((kwLiRguStaRspRbuf(post, spId, staRsp)) != ROK)
+      if((rlcLiRguStaRspRbuf(post, spId, staRsp)) != ROK)
       {
-         RETVALUE(RFAILED);
+         return RFAILED;
       }
 #endif 
    /* jump to specific primitive depending on configured selector */
    (*rlcMacSendBOStatusOpts[post->selector])(post, spId, boSta);
 
-   RETVALUE(ROK);
+   return ROK;
 
 } /* end of RlcMacSendBOStatus */
 
@@ -416,50 +409,50 @@ RlcMacBOStatus    *boSta;
  *
  */
 #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)
+   TRC3(RlcLiRguL2MUlThrpMeasReq)
 
    /* 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 */
 
 
 #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,EVTRLCULDAT,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
@@ -474,7 +467,7 @@ Void;
       SsRngInfoTbl[SS_RNG_BUF_ULMAC_TO_ULRLC].nPktProc++;;//Number of pkt processed in tti
       if(datInd != NULLP)
       {
-         KwLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
+         RlcLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
       }
       else
       {
@@ -498,7 +491,7 @@ Void;
    while(NULLP != elmIndx)
    {
       datInd = (RguDDatIndInfo *)elmIndx;
-      KwLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
+      RlcLiRguDDatInd(&rlcUlRbfuPst, 0, datInd);
 
       elmIndx = NULLP;
       datInd = NULLP;
@@ -508,7 +501,7 @@ Void;
        break;
    }
 #endif
-   RETVALUE(ROK);
+   return ROK;
 
 }
 
@@ -526,9 +519,9 @@ Void;
  *
  */
 #ifdef ANSI
-PUBLIC Void kwUtlFreeUlRBuf(void)
+Void rlcUtlFreeUlRBuf(void)
 #else
-PUBLIC Void kwUtlFreeUlRBuf()  
+Void rlcUtlFreeUlRBuf()  
 #endif
 {
    RguDDatIndInfo *datInd;
@@ -536,7 +529,7 @@ PUBLIC Void kwUtlFreeUlRBuf()
    U8             numLch;
    U8             numPdu;
 
-   TRC2(kwUtlFreeUlRBuf)
+   TRC2(rlcUtlFreeUlRBuf)
    /* Free SS_RNG_BUF_ULMAC_TO_ULRLC  */
    while((SDeqSRngBuf (SS_RNG_BUF_ULMAC_TO_ULRLC, &elem) == ROK))
    {
@@ -547,24 +540,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;
@@ -590,20 +583,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;
@@ -629,7 +622,7 @@ Void             *datReq;
       SsRngInfoTbl[SS_RNG_BUF_DLRLC_TO_DLMAC_DAT_REQ].pktDrop++;
       ret1 = RFAILED;
    }
-   RETVALUE(ret1);
+   return (ret1);
 } /* cmPkKwuDatReq */
 
 #endif