F1-U Data path changes 46/2946/1
authorBalaji Shankaran <balaji.shankaran@radisys.com>
Tue, 24 Mar 2020 15:35:08 +0000 (21:05 +0530)
committerBalaji Shankaran <balaji.shankaran@radisys.com>
Tue, 24 Mar 2020 15:35:16 +0000 (21:05 +0530)
Change-Id: I1fc33e0dbc5e6c736732ca5d98cd1ba1c798c670
Signed-off-by: Balaji Shankaran <balaji.shankaran@radisys.com>
25 files changed:
src/5gnrrlc/kw.h
src/5gnrrlc/kw_dl_ex_ms.c
src/5gnrrlc/kw_lim.c
src/5gnrrlc/kw_ptli.c
src/5gnrrlc/kw_ptui.c
src/5gnrrlc/kw_tmm_ul.c
src/5gnrrlc/kw_udx_dl.c
src/5gnrrlc/kw_uim.c
src/5gnrrlc/kw_utl_dl.c
src/5gnrrlc/kw_utl_ul.c
src/5gnrrlc/mac_stub.c [new file with mode: 0644]
src/5gnrrlc/mac_stub.h [new file with mode: 0644]
src/cm/kwu.c
src/cm/kwu.h
src/cm/kwu.x
src/cu_stub/cu_stub_egtp.c
src/du_app/du_cfg.h
src/du_app/du_egtp.c
src/du_app/du_mgr.h
src/du_app/du_mgr_ex_ms.c
src/du_app/du_msg_hdl.c
src/du_app/du_ue_mgr.c
src/du_app/du_ue_mgr.h
src/mt/mt_ss.h
src/phy_stub/l1_bdy2.c

index 709d6be..aa2755a 100755 (executable)
@@ -35,7 +35,7 @@
 #define __KWH__
 #include "rl_interface.h"
 #include "rl_common.h"
 #define __KWH__
 #include "rl_interface.h"
 #include "rl_common.h"
-
+#include "du_log.h"
 \f 
 #define KWLAYERNAME   "LTE RLC"     /* Layer Name */
 
 \f 
 #define KWLAYERNAME   "LTE RLC"     /* Layer Name */
 
index 9198e4f..fcdbd43 100755 (executable)
@@ -300,6 +300,14 @@ Buffer *mBuf;           /* message buffer */
                   }
                   /* kw005.201 added support for L2 Measurement */
 #endif  /* LCLKW */
                   }
                   /* kw005.201 added support for L2 Measurement */
 #endif  /* LCLKW */
+
+#ifdef LCKWU
+               case KWU_EVT_DAT_REQ:              /* Data request */
+                  {
+                     ret = cmUnpkKwuDatReq(KwUiKwuDatReq, pst, mBuf);
+                     break;
+                  }
+#endif /* LCKWU */
                default:
                   SPutMsg(mBuf);
                   if (pst->dstInst < KW_MAX_RLC_INSTANCES)
                default:
                   SPutMsg(mBuf);
                   if (pst->dstInst < KW_MAX_RLC_INSTANCES)
index f590955..303745a 100755 (executable)
@@ -234,8 +234,8 @@ PUBLIC S16 RlcMacProcUlData(Pst *pst, SuId suId, RlcMacData *ulData)
    U8              numDLch = 0;             /* Number of dedicated logical channel */
    Bool            dLchPduPres;             /* PDU received on dedicated logical channel */
    RguLchDatInd    dLchData[RGU_MAX_LC];  /* PDU info on dedicated logical channel */
    U8              numDLch = 0;             /* Number of dedicated logical channel */
    Bool            dLchPduPres;             /* PDU received on dedicated logical channel */
    RguLchDatInd    dLchData[RGU_MAX_LC];  /* PDU info on dedicated logical channel */
-   RguDDatIndInfo  dLchUlDat;               /* UL data on dedicated logical channel */
-   RguCDatIndInfo  cLchUlDat;               /* UL data on common logical channel */
+   RguDDatIndInfo  *dLchUlDat;               /* UL data on dedicated logical channel */
+   RguCDatIndInfo  *cLchUlDat;               /* UL data on common logical channel */
 
    /* Initializing dedicated logical channel Database */
    for(idx = 0; idx < RGU_MAX_LC; idx++)
 
    /* Initializing dedicated logical channel Database */
    for(idx = 0; idx < RGU_MAX_LC; idx++)
@@ -252,19 +252,21 @@ PUBLIC S16 RlcMacProcUlData(Pst *pst, SuId suId, RlcMacData *ulData)
    {
       if(ulData->pduInfo[idx].commCh)
       {
    {
       if(ulData->pduInfo[idx].commCh)
       {
-         cmMemset((U8*)&cLchUlDat, (U8)0, sizeof(RguCDatIndInfo));
+         KW_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, cLchUlDat, sizeof(RguCDatIndInfo));
+         cmMemset((U8*)cLchUlDat, (U8)0, sizeof(RguCDatIndInfo));
        
        
-         cLchUlDat.cellId = ulData->cellId;
-         cLchUlDat.rnti   = ulData->rnti;
-         cLchUlDat.lcId   = ulData->pduInfo[idx].lcId;
-         cLchUlDat.pdu    = ulData->pduInfo[idx].pduBuf;
+         cLchUlDat->cellId = ulData->cellId;
+         cLchUlDat->rnti   = ulData->rnti;
+         cLchUlDat->lcId   = ulData->pduInfo[idx].lcId;
+         cLchUlDat->pdu    = ulData->pduInfo[idx].pduBuf;
          
          
-         KwLiRguCDatInd(pst, suId, &cLchUlDat);
+         KwLiRguCDatInd(pst, suId, cLchUlDat);
       } 
       else
       {
          if(!dLchPduPres)
          {
       } 
       else
       {
          if(!dLchPduPres)
          {
+            KW_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, dLchUlDat, sizeof(RguDDatIndInfo));
             dLchPduPres = TRUE;
          }
 
             dLchPduPres = TRUE;
          }
 
@@ -278,21 +280,23 @@ PUBLIC S16 RlcMacProcUlData(Pst *pst, SuId suId, RlcMacData *ulData)
     * and call its handler */ 
    if(dLchPduPres)
    {
     * and call its handler */ 
    if(dLchPduPres)
    {
-      dLchUlDat.cellId = ulData->cellId;
-      dLchUlDat.rnti   = ulData->rnti;
+      dLchUlDat->cellId = ulData->cellId;
+      dLchUlDat->rnti   = ulData->rnti;
 
       for(idx = 0; idx < RGU_MAX_LC; idx++)
       {
          if(dLchData[idx].pdu.numPdu)
          {
 
       for(idx = 0; idx < RGU_MAX_LC; idx++)
       {
          if(dLchData[idx].pdu.numPdu)
          {
-            cmMemcpy((U8 *)&dLchUlDat.lchData[numDLch], (U8 *)&dLchData[idx], sizeof(RguLchDatInd));
+            cmMemcpy((U8 *)&dLchUlDat->lchData[numDLch], (U8 *)&dLchData[idx], sizeof(RguLchDatInd));
             numDLch++;      
          }
       }
             numDLch++;      
          }
       }
-      dLchUlDat.numLch = numDLch;
-      KwLiRguDDatInd(pst, suId, &dLchUlDat);
+      dLchUlDat->numLch = numDLch;
+      KwLiRguDDatInd(pst, suId, dLchUlDat);
    }
    }
+    
 
 
+   KW_FREE_SHRABL_BUF(pst->region, pst->pool, ulData, sizeof(RlcMacData));
    RETVALUE(ROK);
    
 }/* End of RlcMacProcUlData */
    RETVALUE(ROK);
    
 }/* End of RlcMacProcUlData */
@@ -469,12 +473,14 @@ RguDDatIndInfo   *datInd;
  *         RFAILED - failure
  *
  * ****************************************************************/
  *         RFAILED - failure
  *
  * ****************************************************************/
-PUBLIC S16 RlcMacProcSchedRep(Pst *pst, SuId suId,RlcMacSchedRep *schRep)
+PUBLIC S16 RlcMacProcSchedRep(Pst *pst, SuId suId, RlcMacSchedRep *schRep)
 {
    U8 idx;                     /* Iterator */
    U8 nmbDLch = 0;                 /* Number of dedicated logical channles */
 {
    U8 idx;                     /* Iterator */
    U8 nmbDLch = 0;                 /* Number of dedicated logical channles */
-   RguCStaIndInfo   cLchSchInfo;    /* Common logical channel scheduling result */
-   RguDStaIndInfo   dLchSchInfo;  /* Dedicated logical channel scheduling result */
+   RguCStaIndInfo   *cLchSchInfo;    /* Common logical channel scheduling result */
+   RguDStaIndInfo   *dLchSchInfo;  /* Dedicated logical channel scheduling result */
+
+   DU_LOG("\nRLC : Received scheduling report from MAC");
 
    for(idx=0; idx < schRep->nmbLch; idx++)
    {
 
    for(idx=0; idx < schRep->nmbLch; idx++)
    {
@@ -482,14 +488,15 @@ PUBLIC S16 RlcMacProcSchedRep(Pst *pst, SuId suId,RlcMacSchedRep *schRep)
         * and trigger the handler for each common lch separately */
        if(schRep->lchSta[idx].commCh)
        {
         * and trigger the handler for each common lch separately */
        if(schRep->lchSta[idx].commCh)
        {
-          cmMemset((U8*)&cLchSchInfo, (U8)0, sizeof(RguCStaIndInfo)); 
+          KW_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, cLchSchInfo, sizeof(RguCStaIndInfo));
+          cmMemset((U8*)cLchSchInfo, (U8)0, sizeof(RguCStaIndInfo)); 
 
 
-          cLchSchInfo.cellId  = schRep->cellId;
-          cLchSchInfo.lcId    = schRep->lchSta[idx].lchStaInd.lcId;
-          //cLchSchInfo.transId = schRep->timeToTx;  /* TODO : fill transId suing timeToTx */
-          cLchSchInfo.rnti    = schRep->rnti;
+          cLchSchInfo->cellId  = schRep->cellId;
+          cLchSchInfo->lcId    = schRep->lchSta[idx].lchStaInd.lcId;
+          //cLchSchInfo->transId = schRep->timeToTx;  /* TODO : fill transId suing timeToTx */
+          cLchSchInfo->rnti    = schRep->rnti;
 
 
-          KwLiRguCStaInd(pst, suId, &cLchSchInfo);
+          KwLiRguCStaInd(pst, suId, cLchSchInfo);
           
        }
        else
           
        }
        else
@@ -498,16 +505,18 @@ PUBLIC S16 RlcMacProcSchedRep(Pst *pst, SuId suId,RlcMacSchedRep *schRep)
            * scheduling report is received */
           if(nmbDLch == 0)
           {
            * scheduling report is received */
           if(nmbDLch == 0)
           {
-             dLchSchInfo.cellId = schRep->cellId;
-             dLchSchInfo.nmbOfUeGrantPerTti = 1;
-             dLchSchInfo.staInd[0].rnti = schRep->rnti;
-             //dLchSchInfo.staInd[0].transId = schRep->timeToTx;  /* TODO : fill transId suing timeToTx */
-             dLchSchInfo.staInd[0].nmbOfTbs = 1;
-             //dLchSchInfo.staInd[0].fillCrlPdu = /* TODO : Check the value needed to be filled */
+             KW_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, dLchSchInfo, sizeof(RguDStaIndInfo));
+
+             dLchSchInfo->cellId = schRep->cellId;
+             dLchSchInfo->nmbOfUeGrantPerTti = 1;
+             dLchSchInfo->staInd[0].rnti = schRep->rnti;
+             //dLchSchInfo->staInd[0].transId = schRep->timeToTx;  /* TODO : fill transId suing timeToTx */
+             dLchSchInfo->staInd[0].nmbOfTbs = 1;
+             //dLchSchInfo->staInd[0].fillCrlPdu = /* TODO : Check the value needed to be filled */
           }
 
           /* Fill logical channel scheduling info */
           }
 
           /* Fill logical channel scheduling info */
-          cmMemcpy((U8 *)&dLchSchInfo.staInd[0].staIndTb[0].lchStaInd[nmbDLch], (U8 *)&schRep->lchSta[idx].lchStaInd, sizeof(RguLchStaInd));
+          cmMemcpy((U8 *)&dLchSchInfo->staInd[0].staIndTb[0].lchStaInd[nmbDLch], (U8 *)&schRep->lchSta[idx].lchStaInd, sizeof(RguLchStaInd));
           nmbDLch++;
 
        }
           nmbDLch++;
 
        }
@@ -517,9 +526,11 @@ PUBLIC S16 RlcMacProcSchedRep(Pst *pst, SuId suId,RlcMacSchedRep *schRep)
    /* Calling handler for all dedicated channels scheduling*/
    if(nmbDLch)
    {
    /* Calling handler for all dedicated channels scheduling*/
    if(nmbDLch)
    {
-      dLchSchInfo.staInd[0].staIndTb[0].nmbLch = nmbDLch;
-      KwLiRguDStaInd(pst, suId, &dLchSchInfo);
+      dLchSchInfo->staInd[0].staIndTb[0].nmbLch = nmbDLch;
+      KwLiRguDStaInd(pst, suId, dLchSchInfo);
    }
    }
+   
+   KW_SHRABL_STATIC_BUF_FREE(pst->region, pst->pool, schRep, sizeof(RlcMacSchedRep));
 
    RETVALUE(ROK);
 }
 
    RETVALUE(ROK);
 }
index 92cb98e..6bc8f94 100755 (executable)
@@ -85,6 +85,10 @@ static int RLOG_FILE_ID=238;
 #include "ss_rbuf.h"
 #include "ss_rbuf.x"
 
 #include "ss_rbuf.h"
 #include "ss_rbuf.x"
 
+#ifdef EGTP_TEST
+#include "mac_stub.h"
+#endif /* EGTP_TEST */
+
 #ifndef LCKWLIRGU
 #define PTKWRGU
 #endif
 #ifndef LCKWLIRGU
 #define PTKWRGU
 #endif
@@ -149,6 +153,11 @@ PUBLIC RguBndReq kwLiRguUbndReqMt[] =
 
 PUBLIC RguDDatReq rlcMacSendDlDataOpts[] =
 {
 
 PUBLIC RguDDatReq rlcMacSendDlDataOpts[] =
 {
+#ifdef EGTP_TEST
+   macStubSendDlData,
+   macStubSendDlData,
+   macStubSendDlData,
+#else /* EGTP_TEST */
 #ifdef LCKWLIRGU
    packDlData,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
 #ifdef LCKWLIRGU
    packDlData,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
@@ -158,6 +167,7 @@ PUBLIC RguDDatReq rlcMacSendDlDataOpts[] =
 #ifdef LCKWLIRGU
    packDlData,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
 #ifdef LCKWLIRGU
    packDlData,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
+#endif /* EGTP_TEST */
 };
 
 
 };
 
 
@@ -165,6 +175,11 @@ PUBLIC RguDDatReq rlcMacSendDlDataOpts[] =
 
 PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] =
 {
 
 PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] =
 {
+#ifdef EGTP_TEST
+   macStubBOStatus,
+   macStubBOStatus,
+   macStubBOStatus,
+#else /* EGTP_TEST */
 #ifdef LCKWLIRGU
    packBOStatus,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
 #ifdef LCKWLIRGU
    packBOStatus,            /* 0 - loosely coupled */
 #endif /* LCRGUIRGU */
@@ -174,6 +189,7 @@ PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] =
 #ifdef LCKWLIRGU
    packBOStatus,            /* 0 - LWLC loosely coupled */
 #endif /* LCRGUIRGU */
 #ifdef LCKWLIRGU
    packBOStatus,            /* 0 - LWLC loosely coupled */
 #endif /* LCRGUIRGU */
+#endif /* EGTP_TEST */
 };
 
 /* kw005.201 added support for L2 Measurement */
 };
 
 /* kw005.201 added support for L2 Measurement */
index c056bc0..a1e49fb 100755 (executable)
@@ -341,14 +341,12 @@ U8   status;                    /* Status */
 PUBLIC S16 KwUiKwuDatInd
 (
 Pst               *pst,
 PUBLIC S16 KwUiKwuDatInd
 (
 Pst               *pst,
-SuId              suId,
 KwuDatIndInfo     *datInd,
 Buffer            *mBuf
 )
 #else
 KwuDatIndInfo     *datInd,
 Buffer            *mBuf
 )
 #else
-PUBLIC S16 KwUiKwuDatInd(pst, suId, datInd, mBuf)
+PUBLIC S16 KwUiKwuDatInd(pst, datInd, mBuf)
 Pst               *pst;
 Pst               *pst;
-SuId              suId;
 KwuDatIndInfo     *datInd;
 Buffer            *mBuf;
 #endif
 KwuDatIndInfo     *datInd;
 Buffer            *mBuf;
 #endif
@@ -356,7 +354,7 @@ Buffer            *mBuf;
    TRC3(KwUiKwuDatInd)
 
    /* jump to specific primitive depending on configured selector */
    TRC3(KwUiKwuDatInd)
 
    /* jump to specific primitive depending on configured selector */
-   (*kwUiKwuDatIndMt[pst->selector])(pst, suId, datInd, mBuf);
+   (*kwUiKwuDatIndMt[pst->selector])(pst, datInd, mBuf);
 
    RETVALUE(ROK);
 
 
    RETVALUE(ROK);
 
index 4e3b487..268b870 100755 (executable)
@@ -147,7 +147,7 @@ U8 rrcUeCapabilityInfo[] =
 
    RLOG1(L_INFO,"Profiling Framework Sending RRC Connection Req to RRC for UE :%d\n",crnti);
    printf("Profiling Framework Sending RRC Connection Req to RRC for UE :%d\n",crnti);
 
    RLOG1(L_INFO,"Profiling Framework Sending RRC Connection Req to RRC for UE :%d\n",crnti);
    printf("Profiling Framework Sending RRC Connection Req to RRC for UE :%d\n",crnti);
-   KwUiKwuDatInd(&ulPst1, 1, datIndInfo, pdu);
+   KwUiKwuDatInd(&ulPst1, datIndInfo, pdu);
  }
  else if(2 == rrcMsgType)
  {
  }
  else if(2 == rrcMsgType)
  {
@@ -330,7 +330,7 @@ Buffer     *pdu;
       kwLmmSendTrc(gCb,KWU_EVT_DAT_IND, pdu);
    }
    KwUiKwuDatInd( &gCb->u.ulCb->kwuUlSap->pst, 
       kwLmmSendTrc(gCb,KWU_EVT_DAT_IND, pdu);
    }
    KwUiKwuDatInd( &gCb->u.ulCb->kwuUlSap->pst, 
-                  gCb->u.ulCb->kwuUlSap->suId, 
+                  //gCb->u.ulCb->kwuUlSap->suId, 
                   datIndInfo, pdu);
    
    RETVOID;
                   datIndInfo, pdu);
    
    RETVOID;
index 2cc94e4..6994b9d 100755 (executable)
@@ -298,18 +298,6 @@ CkwCfgInfo   *cfg;
 
    pstUdxCfm = &(tKwCb->u.dlCb->udxDlSap[spId].pst);
    KWDBGP_BRIEF(tKwCb,"spId(%d)\n", spId);
 
    pstUdxCfm = &(tKwCb->u.dlCb->udxDlSap[spId].pst);
    KWDBGP_BRIEF(tKwCb,"spId(%d)\n", spId);
-
-   /* Validate SAP ID under ERRORCLS */
-   KW_VALDATE_SAP(tKwCb,spId, 
-                  (&tKwCb->u.dlCb->udxDlSap[spId]), 
-                  ret);
-   if (ret != ROK)
-   {
-      /* kw002.201 Freeing from proper region */
-      /* only RLC UL will free it KW_PST_FREE(pst->region, pst->pool, cfg, sizeof(CkwCfgInfo)); */
-      RETVALUE(RFAILED);
-   }
-
    /* Allocate memory and memset to 0 for cfmInfo */
    KW_ALLOC_SHRABL_BUF_WC(pstUdxCfm->region,
                           pstUdxCfm->pool,
    /* Allocate memory and memset to 0 for cfmInfo */
    KW_ALLOC_SHRABL_BUF_WC(pstUdxCfm->region,
                           pstUdxCfm->pool,
index 5732c93..2276532 100755 (executable)
@@ -849,29 +849,26 @@ Reason   reason;
 PUBLIC S16 KwUiKwuDatReq
 (
 Pst             *pst,   
 PUBLIC S16 KwUiKwuDatReq
 (
 Pst             *pst,   
-SpId            spId,  
 KwuDatReqInfo   *datReq, 
 Buffer          *mBuf   
 )
 #else
 KwuDatReqInfo   *datReq, 
 Buffer          *mBuf   
 )
 #else
-PUBLIC S16 KwUiKwuDatReq(pst, spId, datReq, mBuf)
+PUBLIC S16 KwUiKwuDatReq(pst, datReq, mBuf)
 Pst             *pst;  
 Pst             *pst;  
-SpId            spId; 
 KwuDatReqInfo   *datReq; 
 Buffer          *mBuf;  
 #endif
 {
    S16          ret = ROK;   /* Return Value */
    KwDlRbCb     *rbCb;       /* RB Control Block */
 KwuDatReqInfo   *datReq; 
 Buffer          *mBuf;  
 #endif
 {
    S16          ret = ROK;   /* Return Value */
    KwDlRbCb     *rbCb;       /* RB Control Block */
-   KwKwuSapCb   *kwuSap;     /* SAP Config Block */
    KwCb         *tKwCb;
 
    TRC3(KwUiKwuDatReq)
 
    KwCb         *tKwCb;
 
    TRC3(KwUiKwuDatReq)
 
+   DU_LOG("\nRLC : Received DL Data");
+
 #if (ERRCLASS & ERRCLS_INT_PAR)
 #if (ERRCLASS & ERRCLS_INT_PAR)
-   if ((pst->dstInst >= KW_MAX_RLC_INSTANCES) ||
-       (spId >= (S16) kwCb[pst->dstInst]->genCfg.maxKwuSaps) ||
-       (spId < 0))
+   if(pst->dstInst >= KW_MAX_RLC_INSTANCES)
    {
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
    {
       SPutMsg(mBuf);
       RETVALUE(RFAILED);
@@ -880,17 +877,6 @@ Buffer          *mBuf;
 
    tKwCb = KW_GET_KWCB(pst->dstInst);
 
 
    tKwCb = KW_GET_KWCB(pst->dstInst);
 
-   /* Get Sap control block */
-   kwuSap = tKwCb->u.dlCb->kwuDlSap + spId;
-
-   /* Validate SAP ID under ERRORCLS */
-   KW_VALDATE_SAP(tKwCb,spId, kwuSap, ret);
-   if (ret != ROK)
-   {
-      KW_FREE_BUF(mBuf);
-      RETVALUE(RFAILED);
-   }
-
    /* Fetch the RbCb */
    kwDbmFetchDlRbCbByRbId(tKwCb, &datReq->rlcId, &rbCb);
    if(!rbCb)
    /* Fetch the RbCb */
    kwDbmFetchDlRbCbByRbId(tKwCb, &datReq->rlcId, &rbCb);
    if(!rbCb)
@@ -902,8 +888,6 @@ Buffer          *mBuf;
       RETVALUE(RFAILED);
    }
 
       RETVALUE(RFAILED);
    }
 
-   /* kw005.201 update the spId received in datReq to update statistics */
-   rbCb->kwuSapId = spId;
    /* Dispatch according to mode of the rbCb */
    switch (rbCb->mode)
    {
    /* Dispatch according to mode of the rbCb */
    switch (rbCb->mode)
    {
@@ -921,23 +905,17 @@ Buffer          *mBuf;
          }
 
          kwTmmQSdu(tKwCb,rbCb, datReq, mBuf);
          }
 
          kwTmmQSdu(tKwCb,rbCb, datReq, mBuf);
-         /* kw005.201 ccpu00117318, updated statistics */
-         kwuSap->sts.sduRx++;
          break;
       }
       case CM_LTE_MODE_UM:
       {
          kwUmmQSdu(tKwCb,rbCb, datReq, mBuf);
 
          break;
       }
       case CM_LTE_MODE_UM:
       {
          kwUmmQSdu(tKwCb,rbCb, datReq, mBuf);
 
-         /* kw005.201 ccpu00117318, updated statistics */
-         kwuSap->sts.sduRx++;
          break;
       }
       case CM_LTE_MODE_AM:
       {
          kwAmmQSdu(tKwCb,rbCb, mBuf, datReq);
          break;
       }
       case CM_LTE_MODE_AM:
       {
          kwAmmQSdu(tKwCb,rbCb, mBuf, datReq);
-         /* kw005.201 ccpu00117318, updated statistics */
-         kwuSap->sts.sduRx++;
          break;
       }
       default:
          break;
       }
       default:
index 2742a8a..d150d9c 100755 (executable)
@@ -303,11 +303,11 @@ RguDDatReqInfo    *datReqInfo;
    } /* For Data per UE */
 
    /* Check if to be freed here */
    } /* For Data per UE */
 
    /* Check if to be freed here */
-   /*
-   SPutSBuf(post->region, 
+   
+   KW_FREE_SHRABL_BUF(post->region, 
             post->pool, 
             post->pool, 
-            (Data *)datReqInfo, sizeof(RguDDatReqInfo));
-   */
+            datReqInfo, sizeof(RguDDatReqInfo));
+   
    RETVALUE(ROK);
 }/* End of KwLiRguDDatReq */
 
    RETVALUE(ROK);
 }/* End of KwLiRguDDatReq */
 
index ff12ea8..d3ce168 100755 (executable)
@@ -289,7 +289,7 @@ Buffer     *sdu;
    }
 #ifndef KW_PDCP
 
    }
 #ifndef KW_PDCP
 
-   KwUiKwuDatInd(&kwKwSap->pst, kwKwSap->suId, datIndInfo, sdu);
+   KwUiKwuDatInd(&gCb->genCfg.lmPst, datIndInfo, sdu);
 #endif   
    RETVALUE(ROK);
 } /* kwUtlSndDatInd */
 #endif   
    RETVALUE(ROK);
 } /* kwUtlSndDatInd */
diff --git a/src/5gnrrlc/mac_stub.c b/src/5gnrrlc/mac_stub.c
new file mode 100644 (file)
index 0000000..bd0e1df
--- /dev/null
@@ -0,0 +1,207 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+
+#ifdef EGTP_TEST
+
+#include "mac_stub.h"
+
+uint8_t rlcDatSn = 0;
+uint64_t ulDatNum = 0;
+
+PUBLIC S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
+{
+  Pst rspPst;
+  RlcMacSchedRep *schRep;
+
+  DU_LOG("\nMAC_STUB : Received BO status from RLC");
+
+//  SGetSBuf(pst->region, pst->pool, (Data **)&rspPst, sizeof(Pst));
+
+  rspPst.selector  = RGU_SEL_TC;
+  rspPst.srcEnt    = pst->dstEnt;
+  rspPst.dstEnt    = pst->srcEnt;
+  rspPst.dstInst   = pst->srcInst;
+  rspPst.dstProcId = pst->srcProcId;
+  rspPst.srcProcId = pst->dstProcId;
+  rspPst.region    = pst->region; 
+  rspPst.pool    = pst->pool;
+
+  /* Filling Scheduling Report */
+  KW_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, schRep, sizeof(RlcMacSchedRep));
+   
+  schRep->cellId = boSta->cellId;
+  schRep->rnti   = boSta->rnti;
+  schRep->nmbLch = 1;
+  schRep->lchSta[0].commCh = boSta->commCh;
+  schRep->lchSta[0].lchStaInd.lcId = boSta->lcId;
+  schRep->lchSta[0].lchStaInd.totBufSize = boSta->bo + 5; /* Extra buffer space including RLC and MAC Header size */
+
+  DU_LOG("\nMAC_STUB : Sending scheduling report to RLC");
+  
+  RlcMacProcSchedRep(&rspPst, 1, schRep);
+
+  return ROK;
+
+}
+
+PUBLIC S16 macStubSendDlData(Pst *pst, SpId spId, RlcMacData *dlData)
+{
+   U32 availmem;
+
+   Pst rspPst;
+   Buffer *mBuf;
+   RlcMacData *ulData;
+
+   DU_LOG("\nMAC_STUB : Received DL data from RLC to be sent to PHY"); 
+
+   SPutMsg(dlData->pduInfo[0].pduBuf);
+   dlData->pduInfo[0].pduBuf = NULL;
+
+#if 0
+   KW_FREE_SHRABL_BUF(pst->region, pst->pool,
+                        dlData, sizeof(RlcMacData));
+{
+   KW_ALLOC_SHRABL_BUF(pst->region, pst->pool,
+                          ulData, sizeof(RlcMacData));
+
+   SRegInfoShow(2, &availmem);
+   cmMemcpy((U8 *)ulData, (U8 *)dlData, sizeof(RlcMacData));
+#endif
+   
+   ulData = dlData;
+   SGetMsg(pst->region, pst->pool, &mBuf);
+   macStubBuildUlData(mBuf);
+   ulData->pduInfo[0].pduBuf = mBuf;
+
+   /* Fill response post */
+   rspPst.selector  = RGU_SEL_TC;
+   rspPst.srcEnt    = pst->dstEnt;
+   rspPst.dstEnt    = pst->srcEnt;
+   rspPst.dstInst   = pst->srcInst;
+   rspPst.dstProcId = pst->srcProcId;
+   rspPst.srcProcId = pst->dstProcId;
+   rspPst.region    = pst->region;
+   rspPst.pool      = pst->pool;
+
+   ulDatNum++;
+   DU_LOG("\nMAC_STUB : UL data number %d", ulDatNum);
+   RlcMacProcUlData(&rspPst, 1, ulData);
+   return ROK;
+}
+
+void macStubBuildUlData(Buffer *mBuf)
+{
+   char data[30] = "This is EGTP data from DU";
+   int datSize = 30;
+   U32 availmem;
+
+   SAddPstMsgMult((Data *)data, datSize, mBuf);
+
+   /* filling IPv4 header */
+   CmIpv4Hdr ipv4Hdr;
+   MsgLen    mLen;
+   U32 ipv4_du, ipv4_cu;
+   
+   cmInetAddr((S8*)DU_IP_V4_ADDR, &ipv4_du);
+   cmInetAddr((S8*)CU_IP_V4_ADDR, &ipv4_cu);
+
+   mLen = 0;
+   SFndLenMsg(mBuf, &mLen);
+   cmMemset((U8 *)&ipv4Hdr, 0, sizeof(CmIpv4Hdr));
+   ipv4Hdr.length = CM_IPV4_HDRLEN + mLen;
+   ipv4Hdr.hdrVer = 0x45;
+   ipv4Hdr.proto = 1;
+   ipv4Hdr.srcAddr = CM_INET_NTOH_U32(ipv4_du);
+   ipv4Hdr.destAddr = CM_INET_NTOH_U32(ipv4_cu);
+  
+   /* Packing IPv4 header into buffer */
+   S16          ret, cnt, idx;
+   Data         revPkArray[CM_IPV4_HDRLEN];
+   Data         pkArray[CM_IPV4_HDRLEN];
+  
+   /* initialize locals */
+   cnt = 0;
+   cmMemset(revPkArray, 0, CM_IPV4_HDRLEN);
+   cmMemset(pkArray, 0, CM_IPV4_HDRLEN);
+   /* Pack Header Version */
+   pkArray[cnt++] = ipv4Hdr.hdrVer;
+  
+   /* Pack TOS */
+   pkArray[cnt++] = ipv4Hdr.tos;
+  
+   pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.length);
+   pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.length);
+    
+   /* Pack Id */
+   pkArray[cnt++] = (Data) GetHiByte(ipv4Hdr.id);
+   pkArray[cnt++] = (Data) GetLoByte(ipv4Hdr.id);
+    
+   /* Pack Offset */
+   pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.off);
+   pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.off);
+   
+   /* Pack TTL */
+   pkArray[cnt++] = ipv4Hdr.ttl;
+    
+   /* Pack Protocol */
+   pkArray[cnt++] = ipv4Hdr.proto;
+    
+   /* Pack Checksum */
+   pkArray[cnt++] = (Data)GetHiByte(ipv4Hdr.chkSum);
+   pkArray[cnt++] = (Data)GetLoByte(ipv4Hdr.chkSum);
+    
+   /* Pack Source Address */
+   pkArray[cnt++] = (Data)GetHiByte(GetHiWord(ipv4Hdr.srcAddr));
+   pkArray[cnt++] = (Data)GetLoByte(GetHiWord(ipv4Hdr.srcAddr));
+   pkArray[cnt++] = (Data)GetHiByte(GetLoWord(ipv4Hdr.srcAddr));
+   pkArray[cnt++] = (Data)GetLoByte(GetLoWord(ipv4Hdr.srcAddr));
+    
+   /* Pack Destination Address */
+   pkArray[cnt++] = (Data)GetHiByte(GetHiWord(ipv4Hdr.destAddr));
+   pkArray[cnt++] = (Data)GetLoByte(GetHiWord(ipv4Hdr.destAddr));
+   pkArray[cnt++] = (Data)GetHiByte(GetLoWord(ipv4Hdr.destAddr));
+   pkArray[cnt++] = (Data)GetLoByte(GetLoWord(ipv4Hdr.destAddr));
+    
+   for (idx = 0;  idx < CM_IPV4_HDRLEN;  idx++)
+        revPkArray[idx] = pkArray[CM_IPV4_HDRLEN - idx -1];
+    
+   /* this function automatically reverses revPkArray */
+   ret = SAddPreMsgMult(revPkArray, (MsgLen)cnt, mBuf);
+
+   SAddPreMsgMult((Data *)&rlcDatSn, sizeof(uint8_t), mBuf);
+#if 0
+   SRegInfoShow(0, &availmem);
+   SRegInfoShow(1, &availmem);
+   SRegInfoShow(2, &availmem);
+   SRegInfoShow(3, &availmem);
+   SRegInfoShow(4, &availmem);
+#endif
+   //rlcDatSn++;
+   //
+   if(rlcDatSn++ >15 )
+      rlcDatSn = 0;
+
+} /* macStubBuildUlData */
+
+#endif /* EGTP_TEST */
+
+/**********************************************************************
+         End of file
+**********************************************************************/
diff --git a/src/5gnrrlc/mac_stub.h b/src/5gnrrlc/mac_stub.h
new file mode 100644 (file)
index 0000000..46b7104
--- /dev/null
@@ -0,0 +1,67 @@
+/*******************************************************************************
+################################################################################
+#   Copyright (c) [2017-2019] [Radisys]                                        #
+#                                                                              #
+#   Licensed under the Apache License, Version 2.0 (the "License");            #
+#   you may not use this file except in compliance with the License.           #
+#   You may obtain a copy of the License at                                    #
+#                                                                              #
+#       http://www.apache.org/licenses/LICENSE-2.0                             #
+#                                                                              #
+#   Unless required by applicable law or agreed to in writing, software        #
+#   distributed under the License is distributed on an "AS IS" BASIS,          #
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
+#   See the License for the specific language governing permissions and        #
+#   limitations under the License.                                             #
+################################################################################
+*******************************************************************************/
+
+#ifdef EGTP_TEST
+
+#ifndef __MAC_STUB_H__
+#define __MAC_STUB_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 "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 "cm_tpt.h"
+#include "cm_inet.h"
+#include "du_log.h" 
+#include "rgu.h"
+#include "kw.h"
+
+#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_tpt.x"
+#include "cm_inet.x"
+#include "rgu.x"
+
+
+#define DU_IP_V4_ADDR "10.0.2.20"
+#define CU_IP_V4_ADDR "10.0.2.25"
+
+S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta);
+S16 macStubSendDlData(Pst *post, SpId spId, RlcMacData *dlData);
+void macStubBuildUlData(Buffer *mBuf);
+
+#endif /* __MAC_STUB_H__ */
+#endif /* EGTP_TEST */
+
+/**********************************************************************
+         End of file
+**********************************************************************/
index 7bbe952..04c7eee 100755 (executable)
@@ -244,14 +244,12 @@ Buffer *mBuf;
 PUBLIC S16 cmPkKwuDatReq
 (
 Pst * pst,
 PUBLIC S16 cmPkKwuDatReq
 (
 Pst * pst,
-SpId spId,
 KwuDatReqInfo* datReq,
 Buffer * mBuf
 )
 #else
 KwuDatReqInfo* datReq,
 Buffer * mBuf
 )
 #else
-PUBLIC S16 cmPkKwuDatReq(pst, spId, datReq, mBuf)
+PUBLIC S16 cmPkKwuDatReq(pst, datReq, mBuf)
 Pst * pst;
 Pst * pst;
-SpId spId;
 KwuDatReqInfo* datReq;
 Buffer * mBuf;
 #endif
 KwuDatReqInfo* datReq;
 Buffer * mBuf;
 #endif
@@ -270,7 +268,7 @@ Buffer * mBuf;
    {
      case KWU_SEL_LWLC:
         {
    {
      case KWU_SEL_LWLC:
         {
-           if(pst->srcEnt == ENTPJ)
+           if(pst->srcEnt == ENTDUAPP)
            {
              /* When the Selector is LWLC, we need to allocate memory, copy
               * the contents and pass the pointer of the allocated memory. The
            {
              /* When the Selector is LWLC, we need to allocate memory, copy
               * the contents and pass the pointer of the allocated memory. The
@@ -334,7 +332,6 @@ Buffer * mBuf;
           RETVALUE(RFAILED);
    }
 
           RETVALUE(RFAILED);
    }
 
-    CMCHKPKLOG(SPkS16, spId, mBuf, EKWU011, pst);
 #ifdef L2_L3_SPLIT
     if(datReq->rlcId.rbType == CM_LTE_SRB)
     {
 #ifdef L2_L3_SPLIT
     if(datReq->rlcId.rbType == CM_LTE_SRB)
     {
@@ -446,14 +443,12 @@ Buffer *mBuf;
 PUBLIC S16 cmPkKwuDatInd
 (
 Pst * pst,
 PUBLIC S16 cmPkKwuDatInd
 (
 Pst * pst,
-SuId suId,
 KwuDatIndInfo* datInd,
 Buffer * mBuf
 )
 #else
 KwuDatIndInfo* datInd,
 Buffer * mBuf
 )
 #else
-PUBLIC S16 cmPkKwuDatInd(pst, suId, datInd, mBuf)
+PUBLIC S16 cmPkKwuDatInd(pst, datInd, mBuf)
 Pst * pst;
 Pst * pst;
-SuId suId;
 KwuDatIndInfo* datInd;
 Buffer * mBuf;
 #endif
 KwuDatIndInfo* datInd;
 Buffer * mBuf;
 #endif
@@ -531,7 +526,6 @@ Buffer * mBuf;
           RETVALUE(RFAILED);
     }
 
           RETVALUE(RFAILED);
     }
 
-    CMCHKPKLOG(SPkS16, suId, mBuf, EKWU013, pst);
     pst->event = (Event) KWU_EVT_DAT_IND;
 
     RETVALUE(SPstTsk(pst,mBuf));
     pst->event = (Event) KWU_EVT_DAT_IND;
 
     RETVALUE(SPstTsk(pst,mBuf));
@@ -1271,9 +1265,6 @@ Buffer *mBuf;
 
    TRC3(cmUnpkKwuDatReq)
 
 
    TRC3(cmUnpkKwuDatReq)
 
-
-      CMCHKUNPK(SUnpkS16, &(spId), mBuf);
-
    switch(pst->selector)
    {
       case KWU_SEL_LWLC:
    switch(pst->selector)
    {
       case KWU_SEL_LWLC:
@@ -1312,7 +1303,7 @@ Buffer *mBuf;
          RETVALUE(RFAILED);
    }
 
          RETVALUE(RFAILED);
    }
 
-   retVal = (*func)(pst, spId, datReq, mBuf);
+   retVal = (*func)(pst, datReq, mBuf);
    /* If LWLC is configured, we need to
     * free the memory here. */
    if(pst->selector == KWU_SEL_LWLC)
    /* If LWLC is configured, we need to
     * free the memory here. */
    if(pst->selector == KWU_SEL_LWLC)
@@ -1363,14 +1354,11 @@ Buffer *mBuf;
 #endif
 {
     S16 ret1 = ROK, retVal;
 #endif
 {
     S16 ret1 = ROK, retVal;
-    SuId          suId = 0;
     KwuDatIndInfo *datInd = NULLP;
     KwuDatIndInfo datIndTmp;
     
     TRC3(cmUnpkKwuDatInd)
 
     KwuDatIndInfo *datInd = NULLP;
     KwuDatIndInfo datIndTmp;
     
     TRC3(cmUnpkKwuDatInd)
 
-    CMCHKUNPK(SUnpkS16, &(suId), mBuf);
-    
     switch(pst->selector)
     {
       case KWU_SEL_LWLC:
     switch(pst->selector)
     {
       case KWU_SEL_LWLC:
@@ -1423,7 +1411,7 @@ Buffer *mBuf;
                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
          RETVALUE(RFAILED);
     }
                (ErrVal)ERRKWU, (ErrVal)ret1, "pst->selector is invalid\n");
          RETVALUE(RFAILED);
     }
-    retVal = (*func)(pst, suId, datInd, mBuf);
+    retVal = (*func)(pst, datInd, mBuf);
     /* If LWLC is configured and the destination entity is PDCP, we need to
      * free the memory here. */
     if((pst->selector == KWU_SEL_LWLC) && (pst->dstEnt == ENTPJ))
     /* If LWLC is configured and the destination entity is PDCP, we need to
      * free the memory here. */
     if((pst->selector == KWU_SEL_LWLC) && (pst->dstEnt == ENTPJ))
index da1b35f..89c4750 100755 (executable)
@@ -45,7 +45,7 @@ EXTERN "C" {
 /* CKW Interface Hash Defines */
 /* selector(coupling) values */
 #define KWU_SEL_LC              0
 /* CKW Interface Hash Defines */
 /* selector(coupling) values */
 #define KWU_SEL_LC              0
-#define KWU_SEL_LWLC            3
+#define KWU_SEL_LWLC            2
 
 /***********************************************************************
         Defines for  KWU Interface Events
 
 /***********************************************************************
         Defines for  KWU Interface Events
index 2e02492..ee40f9b 100755 (executable)
@@ -125,9 +125,8 @@ typedef S16 (*KwuBndReq)      ARGS((Pst *pst, SuId suId,  SpId spId));
 typedef S16 (*KwuBndCfm)      ARGS((Pst *pst, SuId suId, U8 status));
 typedef S16 (*KwuUbndReq)     ARGS((Pst *pst, SuId suId, Reason reason));
 
 typedef S16 (*KwuBndCfm)      ARGS((Pst *pst, SuId suId, U8 status));
 typedef S16 (*KwuUbndReq)     ARGS((Pst *pst, SuId suId, Reason reason));
 
-typedef S16 (*KwuDatReq)      ARGS((Pst *pst, SpId spId, KwuDatReqInfo* datReq,
-         Buffer *mBuf));
-typedef S16 (*KwuDatInd)      ARGS((Pst *pst, SuId suId, KwuDatIndInfo* datInd,
+typedef S16 (*KwuDatReq)      ARGS((Pst *pst, KwuDatReqInfo* datReq, Buffer *mBuf));
+typedef S16 (*KwuDatInd)      ARGS((Pst *pst, KwuDatIndInfo* datInd,
          Buffer *mBuf));
 typedef S16 (*KwuDatCfm)      ARGS((Pst *pst, SuId suId, KwuDatCfmInfo* datCfm));
 typedef S16 (*KwuDiscSduReq)  ARGS((Pst *pst, SpId spId, KwuDiscSduInfo* discSdu));
          Buffer *mBuf));
 typedef S16 (*KwuDatCfm)      ARGS((Pst *pst, SuId suId, KwuDatCfmInfo* datCfm));
 typedef S16 (*KwuDiscSduReq)  ARGS((Pst *pst, SpId spId, KwuDiscSduInfo* discSdu));
@@ -216,7 +215,6 @@ EXTERN S16 KwUiKwuUbndReq ARGS((Pst *pst,
  *   -# RFAILED
  */
 EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst,
  *   -# RFAILED
  */
 EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst,
-         SpId spId,
          KwuDatReqInfo* datReq,
          Buffer *buf));
 
          KwuDatReqInfo* datReq,
          Buffer *buf));
 
@@ -234,7 +232,6 @@ EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst,
  *   -# RFAILED
  */
 EXTERN S16 KwUiKwuDatInd ARGS((Pst *pst,
  *   -# RFAILED
  */
 EXTERN S16 KwUiKwuDatInd ARGS((Pst *pst,
-         SuId suId,
          KwuDatIndInfo* datInd,
          Buffer *mBuf));
 
          KwuDatIndInfo* datInd,
          Buffer *mBuf));
 
@@ -359,7 +356,6 @@ EXTERN S16 NhLiKwuDatReq ARGS((Pst *pst,
          Buffer *buf));
 
 EXTERN S16 NhLiKwuDatInd ARGS((Pst *pst,
          Buffer *buf));
 
 EXTERN S16 NhLiKwuDatInd ARGS((Pst *pst,
-         SuId suId,
          KwuDatIndInfo* datInd,
          Buffer *buf));
 #endif /* NH */
          KwuDatIndInfo* datInd,
          Buffer *buf));
 #endif /* NH */
@@ -413,7 +409,6 @@ EXTERN S16 PjLiKwuDatReq ARGS((Pst *pst,
          Buffer *buf));
 
 EXTERN S16 PjLiKwuDatInd ARGS((Pst *pst,
          Buffer *buf));
 
 EXTERN S16 PjLiKwuDatInd ARGS((Pst *pst,
-         SuId suId,
          KwuDatIndInfo* datInd,
          Buffer *buf));
 
          KwuDatIndInfo* datInd,
          Buffer *buf));
 
@@ -495,14 +490,12 @@ U8 status
 
 EXTERN S16 cmPkKwuDatReq ARGS ((
 Pst * pst,
 
 EXTERN S16 cmPkKwuDatReq ARGS ((
 Pst * pst,
-SpId spId,
 KwuDatReqInfo* datReq,
 Buffer * mBuf
 ));
 
 EXTERN S16 cmPkKwuDatInd ARGS ((
 Pst * pst,
 KwuDatReqInfo* datReq,
 Buffer * mBuf
 ));
 
 EXTERN S16 cmPkKwuDatInd ARGS ((
 Pst * pst,
-SuId suId,
 KwuDatIndInfo* datInd,
 Buffer * mBuf
 ));
 KwuDatIndInfo* datInd,
 Buffer * mBuf
 ));
index b8a82de..1db83d2 100644 (file)
@@ -636,7 +636,7 @@ S16 cuEgtpDatReq()
    BuildEgtpMsg(&egtpMsg);
 
    /* Send Message to peer */
    BuildEgtpMsg(&egtpMsg);
 
    /* Send Message to peer */
-   while(cnt < 20)
+   while(cnt < 1)
    {
       DU_LOG("\nEGTP : Sending message[%d]", cnt+1);
       cuEgtpSendMsg(egtpMsg.msg);
    {
       DU_LOG("\nEGTP : Sending message[%d]", cnt+1);
       cuEgtpSendMsg(egtpMsg.msg);
index f7dd4d8..d2dd80d 100644 (file)
 #define DU_RANAC 1
 #define CELL_IDENTITY 1
 
 #define DU_RANAC 1
 #define CELL_IDENTITY 1
 
+#ifdef EGTP_TEST
+#define UE_ID 1
+#define RB_ID 1
+#define LC_ID 1
+#endif
 
 typedef enum
 {
 
 typedef enum
 {
index 2fca6e2..e3d8d2e 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <stdio.h>
 #include "du_egtp.h"
 
 #include <stdio.h>
 #include "du_egtp.h"
+#include "du_ue_mgr.h"
 
 /* Global variable declaration */
 EgtpGlobalCb egtpCb;
 
 /* Global variable declaration */
 EgtpGlobalCb egtpCb;
@@ -587,13 +588,13 @@ S16 egtpHdlDatInd(EgtpMsg egtpMsg)
       teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT2);
    }
 
       teidCb->preEncodedHdr.hdr[EGTP_MAX_HDR_LEN - 1] &= ~(EGTP_MASK_BIT2);
    }
 
-   DU_LOG("\nEGTP : Data buffer before encoding header");
+   DU_LOG("\nEGTP : UL Data buffer before encoding header");
    SPrntMsg(egtpMsg.msg, 0, 0);
 
    SAddPreMsgMult(&teidCb->preEncodedHdr.hdr[hdrLen], (EGTP_MAX_HDR_LEN - hdrLen), egtpMsg.msg);
 
 
    SPrntMsg(egtpMsg.msg, 0, 0);
 
    SAddPreMsgMult(&teidCb->preEncodedHdr.hdr[hdrLen], (EGTP_MAX_HDR_LEN - hdrLen), egtpMsg.msg);
 
 
-   DU_LOG("\nEGTP : Data buffer after encoding header");
+   DU_LOG("\nEGTP : UL Data buffer after encoding header");
    SPrntMsg(egtpMsg.msg, 0, 0);
 
    /* Send over UDP */
    SPrntMsg(egtpMsg.msg, 0, 0);
 
    /* Send over UDP */
@@ -820,7 +821,7 @@ S16 egtpRecvMsg()
       ret = cmInetRecvMsg(&(egtpCb.recvTptSrvr.sockFd), &fromAddr, &memInfo, &recvBuf, &bufLen, CM_INET_NO_FLAG);
       if(ret == ROK && recvBuf != NULLP)
       {  
       ret = cmInetRecvMsg(&(egtpCb.recvTptSrvr.sockFd), &fromAddr, &memInfo, &recvBuf, &bufLen, CM_INET_NO_FLAG);
       if(ret == ROK && recvBuf != NULLP)
       {  
-         DU_LOG("\nEGTP : Received Message[%d]\n", nMsg+1);
+         DU_LOG("\nEGTP : Received DL Message[%d]\n", nMsg+1);
          SPrntMsg(recvBuf, 0 ,0);
          egtpHdlRecvData(recvBuf);
       }
          SPrntMsg(recvBuf, 0 ,0);
          egtpHdlRecvData(recvBuf);
       }
@@ -838,6 +839,7 @@ S16 egtpHdlRecvData(Buffer *mBuf)
    egtpDecodeHdr(mBuf, &egtpMsg);
 
    /* TODO : Send received message to RLC */
    egtpDecodeHdr(mBuf, &egtpMsg);
 
    /* TODO : Send received message to RLC */
+   duHdlEgtpDlData(&egtpMsg);
 
    RETVALUE(ROK);
 }
 
    RETVALUE(ROK);
 }
@@ -994,8 +996,10 @@ S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg  *egtpMsg)
    {
       SRemPreMsg(&extHdrType, mBuf);
    }
    {
       SRemPreMsg(&extHdrType, mBuf);
    }
-   DU_LOG("\nEGTP : Data Buffer after decoding header ");
+
+   egtpMsg->msg = mBuf;
+
+   DU_LOG("\nEGTP : DL Data Buffer after decoding header ");
    SPrntMsg(mBuf, 0, 0);
 
    /* Forward the data to duApp/RLC */
    SPrntMsg(mBuf, 0, 0);
 
    /* Forward the data to duApp/RLC */
index 562aaef..3066c52 100644 (file)
@@ -234,7 +234,8 @@ S16 duSendEgtpSrvOpenReq();
 S16 duHdlEgtpSrvOpenComplete(CmStatus cfm);
 S16 duSendEgtpTnlMgmtReq(U8 action, U32 lclTeid, U32 remTeid);
 S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm);
 S16 duHdlEgtpSrvOpenComplete(CmStatus cfm);
 S16 duSendEgtpTnlMgmtReq(U8 action, U32 lclTeid, U32 remTeid);
 S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm);
-S16 duSendEgtpDatInd();
+S16 duSendEgtpTestData();
+S16 duSendEgtpDatInd(Buffer *mBuf);
 S16 duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
 
 #endif
 S16 duHdlSchCfgComplete(Pst *pst, RgMngmt *cfm);
 
 #endif
index 9e46626..21c639d 100644 (file)
@@ -24,6 +24,9 @@
 #include "lsctp.h"
 #include "legtp.h"
 #include "du_app_mac_inf.h"
 #include "lsctp.h"
 #include "legtp.h"
 #include "du_app_mac_inf.h"
+#include "du_ue_mgr.h"
+
+#include "kwu.x"
 
 extern S16 cmUnpkLkwCfgCfm(LkwCfgCfm func,Pst *pst, Buffer *mBuf);
 extern S16 cmUnpkLkwCntrlCfm(LkwCntrlCfm func,Pst *pst, Buffer *mBuf);
 
 extern S16 cmUnpkLkwCfgCfm(LkwCfgCfm func,Pst *pst, Buffer *mBuf);
 extern S16 cmUnpkLkwCntrlCfm(LkwCntrlCfm func,Pst *pst, Buffer *mBuf);
@@ -160,6 +163,11 @@ S16 duActvTsk(Pst *pst, Buffer *mBuf)
                   {
                      break;
                   }
                   {
                      break;
                   }
+               case KWU_EVT_DAT_IND:
+                  {
+                     ret = cmUnpkKwuDatInd(duHdlRlcUlData, pst, mBuf);
+                     break;
+                  }
                default:
                   {
                      DU_LOG("\nDU_APP : Invalid event %d received at duActvTsk from ENTKW", \
                default:
                   {
                      DU_LOG("\nDU_APP : Invalid event %d received at duActvTsk from ENTKW", \
index f7ae399..053fcf1 100644 (file)
@@ -1175,7 +1175,9 @@ S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
       DU_LOG("\nDU_APP : Tunnel management confirm OK");
 
 #ifdef EGTP_TEST
       DU_LOG("\nDU_APP : Tunnel management confirm OK");
 
 #ifdef EGTP_TEST
-      duSendEgtpDatInd();
+      duSendUeCreateReqToRlc();
+
+      duSendEgtpTestData();
       
       /* For testing purpose. TTI thread should actually be in L1 */
       duStartTtiThread();
       
       /* For testing purpose. TTI thread should actually be in L1 */
       duStartTtiThread();
@@ -1190,38 +1192,52 @@ S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm)
    RETVALUE(ret);
 }
 
    RETVALUE(ret);
 }
 
+S16 duSendEgtpDatInd(Buffer *mBuf)
+{
+   EgtpMsg  egtpMsg;
+
+   /* Fill EGTP header */
+   egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
+   egtpMsg.msgHdr.nPdu.pres = FALSE;
+   egtpMsg.msgHdr.seqNum.pres = FALSE;
+   egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
+   egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
+   egtpMsg.msgHdr.teId = 1;
+   egtpMsg.msg = mBuf;
+   
+   egtpHdlDatInd(egtpMsg);
+
+   return ROK;
+
+}
+
 #ifdef EGTP_TEST
 /*******************************************************************
  *
 #ifdef EGTP_TEST
 /*******************************************************************
  *
- * @brief Simulate RLC to EGTP data indication 
+ * @brief Simulate UL Data for intial test
  *
  * @details
  *
  *
  * @details
  *
- *    Function : duSendEgtpDatInd
+ *    Function : duSendEgtpTestData
  *
  *    Functionality:
  *
  *    Functionality:
- *      Simulate RLC to EGTP data indication
+ *      Simulate UL data for initial test
  *
  * @params[in] 
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
  *
  * @params[in] 
  * @return ROK     - success
  *         RFAILED - failure
  *
  * ****************************************************************/
-S16 duSendEgtpDatInd()
+S16 duSendEgtpTestData()
 {
    char data[30] = "This is EGTP data from DU";
    int datSize = 30;
 
    Buffer   *mBuf;
 {
    char data[30] = "This is EGTP data from DU";
    int datSize = 30;
 
    Buffer   *mBuf;
-   EgtpMsg  egtpMsg;
 
    if(SGetMsg(DU_APP_MEM_REGION, DU_POOL, &mBuf) == ROK)
    {
 
    if(SGetMsg(DU_APP_MEM_REGION, DU_POOL, &mBuf) == ROK)
    {
-      if(SAddPstMsgMult((Data *)data, datSize, mBuf) == ROK)
-      {
-         SPrntMsg(mBuf, 0,0);
-      }
-      else
+      if(SAddPstMsgMult((Data *)data, datSize, mBuf) != ROK)
       {
          DU_LOG("\nDU_APP : SAddPstMsgMult failed");
          SPutMsg(mBuf);
       {
          DU_LOG("\nDU_APP : SAddPstMsgMult failed");
          SPutMsg(mBuf);
@@ -1302,19 +1318,8 @@ S16 duSendEgtpDatInd()
 
    /* this function automatically reverses revPkArray */
    ret = SAddPreMsgMult(revPkArray, (MsgLen)cnt, mBuf);
 
    /* this function automatically reverses revPkArray */
    ret = SAddPreMsgMult(revPkArray, (MsgLen)cnt, mBuf);
-
-
-   egtpMsg.msgHdr.msgType = EGTPU_MSG_GPDU;
-   egtpMsg.msgHdr.nPdu.pres = FALSE;
-   egtpMsg.msgHdr.seqNum.pres = FALSE;
-   egtpMsg.msgHdr.extHdr.udpPort.pres = FALSE;
-   egtpMsg.msgHdr.extHdr.pdcpNmb.pres = FALSE;
-   egtpMsg.msgHdr.teId = 1;
-   egtpMsg.msg = mBuf;
-
-   SPrntMsg(mBuf, 0, 0);
-
-   egtpHdlDatInd(egtpMsg);
+    
+   duSendEgtpDatInd(mBuf);
  
    RETVALUE(ROK);
 }
  
    RETVALUE(ROK);
 }
index 080b8bf..91ad96c 100644 (file)
 #include "du_ue_mgr.h"
 #include "du_cfg.h"
 
 #include "du_ue_mgr.h"
 #include "du_cfg.h"
 
+#ifdef EGTP_TEST
+U32 sduId = 0;
+#endif
+
 /******************************************************************
  *
  * @brief Send UE configuration to RLC
 /******************************************************************
  *
  * @brief Send UE configuration to RLC
@@ -37,23 +41,30 @@ S16 duSendUeCreateReqToRlc()
 {
    U8  idx;
    Pst pst;
 {
    U8  idx;
    Pst pst;
-   CkwCfgInfo ueCfg;
+   CkwCfgInfo *ueCfg;
    
    DU_SET_ZERO(&ueCfg, sizeof(ueCfg));
    DU_SET_ZERO(&pst, sizeof(Pst));
 
    
    DU_SET_ZERO(&ueCfg, sizeof(ueCfg));
    DU_SET_ZERO(&pst, sizeof(Pst));
 
-   ueCfg.ueId = 1;
-   ueCfg.cellId = NR_CELL_ID;
-   ueCfg.numEnt = 1;
+   DU_ALLOC(ueCfg, sizeof(CkwCfgInfo));
+
+#ifdef EGTP_TEST
+   ueCfg->ueId = UE_ID;
+#endif
+   ueCfg->cellId = NR_CELL_ID;
+   ueCfg->numEnt = 1;
    
    
-   for(idx = 0; idx < ueCfg.numEnt; idx++)
+   for(idx = 0; idx < ueCfg->numEnt; idx++)
    {
    {
-      ueCfg.entCfg[idx].rbId = 1;
-      ueCfg.entCfg[idx].rbType = CM_LTE_DRB;
-      ueCfg.entCfg[idx].entMode = CM_LTE_MODE_UM;
-      ueCfg.entCfg[idx].dir = CKW_CFG_DIR_BOTH;
-
-      switch(ueCfg.entCfg[idx].entMode)
+#ifdef EGTP_TEST
+      ueCfg->entCfg[idx].rbId           = RB_ID;
+      ueCfg->entCfg[idx].rbType         = CM_LTE_DRB;
+      ueCfg->entCfg[idx].lCh[0].lChId   = LC_ID;
+      ueCfg->entCfg[idx].lCh[0].type    = CM_LTE_LCH_DTCH;
+#endif
+      ueCfg->entCfg[idx].entMode        = CM_LTE_MODE_UM;
+      ueCfg->entCfg[idx].dir            = CKW_CFG_DIR_BOTH;
+      switch(ueCfg->entCfg[idx].entMode)
       {
          case CM_LTE_MODE_TM:
          {
       {
          case CM_LTE_MODE_TM:
          {
@@ -62,9 +73,9 @@ S16 duSendUeCreateReqToRlc()
 
          case CM_LTE_MODE_UM:
          {
 
          case CM_LTE_MODE_UM:
          {
-            ueCfg.entCfg[idx].m.umInfo.dl.snLen = 1;      /* For 12 bit SN */
-            ueCfg.entCfg[idx].m.umInfo.ul.snLen = 1;      /* For 12 bit SN */
-            ueCfg.entCfg[idx].m.umInfo.ul.reOrdTmr = 10;  /* in msec */
+            ueCfg->entCfg[idx].m.umInfo.dl.snLen = 1;      /* For 12 bit SN */
+            ueCfg->entCfg[idx].m.umInfo.ul.snLen = 1;      /* For 12 bit SN */
+            ueCfg->entCfg[idx].m.umInfo.ul.reOrdTmr = 10;  /* in msec */
             break;
          }
 
             break;
          }
 
@@ -88,11 +99,87 @@ S16 duSendUeCreateReqToRlc()
    pst.region    = duCb.init.region;
 
    /* Sending to RLC */
    pst.region    = duCb.init.region;
 
    /* Sending to RLC */
-   packUeCreateReq(&pst, &ueCfg);
+   packUeCreateReq(&pst, ueCfg);
 
    RETVALUE(ROK); 
 } /* End of duSendUeCreateReqToRlc */
 
 
    RETVALUE(ROK); 
 } /* End of duSendUeCreateReqToRlc */
 
+/*******************************************************************
+ *
+ * @brief Handles EGTP data from CU 
+ *
+ * @details
+ *
+ *    Function : duHdlEgtpData
+ *
+ *    Functionality: 
+ *      Processes EGTP header and sends data to RLC
+ *
+ * @params[in]  Pointer to EGTP Message 
+ * @return ROK     - success
+ *         RFAILED - failure
+ *
+ * ****************************************************************/
+S16 duHdlEgtpDlData(EgtpMsg  *egtpMsg)
+{
+   /* TODO : Extract RbId/UeID/CellID/SduId from database
+      using tunnel id in egtp header */
+   
+   DU_LOG("\nDU_APP : Processing DL data");
+   
+   Pst pst;
+   KwuDatReqInfo datReqInfo;
+
+#ifdef EGTP_TEST
+   datReqInfo.rlcId.rbId = RB_ID;
+   datReqInfo.rlcId.rbType = CM_LTE_DRB;
+   datReqInfo.rlcId.ueId = UE_ID;
+   datReqInfo.rlcId.cellId = NR_CELL_ID;
+   
+   datReqInfo.sduId = ++sduId;
+   datReqInfo.lcType = CM_LTE_LCH_DTCH;
+#endif
+   /* Filling pst and Sending to RLC DL */
+   pst.selector  = DU_SELECTOR_LWLC;
+   pst.srcEnt    = ENTDUAPP;
+   pst.dstEnt    = ENTKW;
+   pst.dstInst   = RLC_DL_INST;
+   pst.dstProcId = DU_PROC;
+   pst.srcProcId = DU_PROC;
+   pst.region    = duCb.init.region;
+
+   cmPkKwuDatReq(&pst, &datReqInfo, egtpMsg->msg);
+   return ROK;
+}
+
+/*******************************************************************
+ *
+ * @brief Handles UL data and send to CU
+ *
+ * @details
+ *
+ *    Function : duHdlRlcUlData
+ *
+ *    Functionality: 
+ *     Processes UL Data from RLC and sends to CU
+ * 
+ *  @params[in]  Pointer to EGTP Message 
+ *  @return ROK     - success
+ *          RFAILED - failure
+ * 
+ *****************************************************************/
+
+PUBLIC S16 duHdlRlcUlData(Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf)
+{
+   DU_LOG("\nDU_APP : Received UL Data at DU_APP");
+   /* Send UL data to CU via EGTP */
+   duSendEgtpDatInd(mBuf);
+   SPutMsg(mBuf);
+
+   return ROK;
+}
+
 /**********************************************************************
          End of file
 ***********************************************************************/
 /**********************************************************************
          End of file
 ***********************************************************************/
index c459e80..381a2a0 100644 (file)
 #include "du_mgr.h"
 #include "du_log.h"
 #include "ckw.h"
 #include "du_mgr.h"
 #include "du_log.h"
 #include "ckw.h"
-#include "ckw.c"
+#include "kwu.h"
+
+#include "ckw.x"
+#include "kwu.x"
+
+S16 duHdlEgtpDlData(EgtpMsg  *egtpMsg);
+S16 duHdlRlcUlData(Pst *pst, KwuDatIndInfo* datInd, Buffer *mBuf);
 
 #endif
 
 
 #endif
 
index 884c7f1..b209052 100755 (executable)
@@ -256,7 +256,7 @@ that are configured below.
 #define MT_BKT_3_DSIZE     4224      /* Fill in this value as required */
 #define MT_BKT_3_NUMBLKS   5248 /*10496 */       /* Fill in this value as required */
 #else
 #define MT_BKT_3_DSIZE     4224      /* Fill in this value as required */
 #define MT_BKT_3_NUMBLKS   5248 /*10496 */       /* Fill in this value as required */
 #else
-#define MT_BKT_3_DSIZE     8196      /* Fill in this value as required */
+#define MT_BKT_3_DSIZE     12000      /* Fill in this value as required */
 #define MT_BKT_3_NUMBLKS   1000 /*10496 */       /* Fill in this value as required */
 #endif
 #endif
 #define MT_BKT_3_NUMBLKS   1000 /*10496 */       /* Fill in this value as required */
 #endif
 #endif
index a636f17..7a800af 100644 (file)
@@ -8,7 +8,7 @@ void *GenerateTicks(void *arg)
 {
    while(1)
    {
 {
    while(1)
    {
-      sleep(10);
+      sleep(1);
       printf("\nTTI indication");
       /* Send TTI indication to CL */
       duSendEgtpTTIInd();
       printf("\nTTI indication");
       /* Send TTI indication to CL */
       duSendEgtpTTIInd();