From be7e4e372cc1d6f12f7af9c6b6d09a7ecedca58c Mon Sep 17 00:00:00 2001 From: Balaji Shankaran Date: Tue, 24 Mar 2020 21:05:08 +0530 Subject: [PATCH 1/1] F1-U Data path changes Change-Id: I1fc33e0dbc5e6c736732ca5d98cd1ba1c798c670 Signed-off-by: Balaji Shankaran --- src/5gnrrlc/kw.h | 2 +- src/5gnrrlc/kw_dl_ex_ms.c | 8 ++ src/5gnrrlc/kw_lim.c | 73 +++++++++------- src/5gnrrlc/kw_ptli.c | 16 ++++ src/5gnrrlc/kw_ptui.c | 6 +- src/5gnrrlc/kw_tmm_ul.c | 4 +- src/5gnrrlc/kw_udx_dl.c | 12 --- src/5gnrrlc/kw_uim.c | 30 +------ src/5gnrrlc/kw_utl_dl.c | 8 +- src/5gnrrlc/kw_utl_ul.c | 2 +- src/5gnrrlc/mac_stub.c | 207 +++++++++++++++++++++++++++++++++++++++++++++ src/5gnrrlc/mac_stub.h | 67 +++++++++++++++ src/cm/kwu.c | 22 ++--- src/cm/kwu.h | 2 +- src/cm/kwu.x | 11 +-- src/cu_stub/cu_stub_egtp.c | 2 +- src/du_app/du_cfg.h | 5 ++ src/du_app/du_egtp.c | 14 +-- src/du_app/du_mgr.h | 3 +- src/du_app/du_mgr_ex_ms.c | 8 ++ src/du_app/du_msg_hdl.c | 53 ++++++------ src/du_app/du_ue_mgr.c | 117 +++++++++++++++++++++---- src/du_app/du_ue_mgr.h | 8 +- src/mt/mt_ss.h | 2 +- src/phy_stub/l1_bdy2.c | 2 +- 25 files changed, 527 insertions(+), 157 deletions(-) create mode 100644 src/5gnrrlc/mac_stub.c create mode 100644 src/5gnrrlc/mac_stub.h diff --git a/src/5gnrrlc/kw.h b/src/5gnrrlc/kw.h index 709d6bede..aa2755a08 100755 --- a/src/5gnrrlc/kw.h +++ b/src/5gnrrlc/kw.h @@ -35,7 +35,7 @@ #define __KWH__ #include "rl_interface.h" #include "rl_common.h" - +#include "du_log.h" #define KWLAYERNAME "LTE RLC" /* Layer Name */ diff --git a/src/5gnrrlc/kw_dl_ex_ms.c b/src/5gnrrlc/kw_dl_ex_ms.c index 9198e4f33..fcdbd4368 100755 --- a/src/5gnrrlc/kw_dl_ex_ms.c +++ b/src/5gnrrlc/kw_dl_ex_ms.c @@ -300,6 +300,14 @@ Buffer *mBuf; /* message buffer */ } /* 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) diff --git a/src/5gnrrlc/kw_lim.c b/src/5gnrrlc/kw_lim.c index f59095566..303745a8f 100755 --- a/src/5gnrrlc/kw_lim.c +++ b/src/5gnrrlc/kw_lim.c @@ -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 */ - 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++) @@ -252,19 +252,21 @@ PUBLIC S16 RlcMacProcUlData(Pst *pst, SuId suId, RlcMacData *ulData) { 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) { + KW_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, dLchUlDat, sizeof(RguDDatIndInfo)); dLchPduPres = TRUE; } @@ -278,21 +280,23 @@ PUBLIC S16 RlcMacProcUlData(Pst *pst, SuId suId, RlcMacData *ulData) * 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) { - cmMemcpy((U8 *)&dLchUlDat.lchData[numDLch], (U8 *)&dLchData[idx], sizeof(RguLchDatInd)); + cmMemcpy((U8 *)&dLchUlDat->lchData[numDLch], (U8 *)&dLchData[idx], sizeof(RguLchDatInd)); 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 */ @@ -469,12 +473,14 @@ RguDDatIndInfo *datInd; * 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 */ - 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++) { @@ -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) { - 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 @@ -498,16 +505,18 @@ PUBLIC S16 RlcMacProcSchedRep(Pst *pst, SuId suId,RlcMacSchedRep *schRep) * 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 */ - 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++; } @@ -517,9 +526,11 @@ PUBLIC S16 RlcMacProcSchedRep(Pst *pst, SuId suId,RlcMacSchedRep *schRep) /* 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); } diff --git a/src/5gnrrlc/kw_ptli.c b/src/5gnrrlc/kw_ptli.c index 92cb98ed5..6bc8f9487 100755 --- a/src/5gnrrlc/kw_ptli.c +++ b/src/5gnrrlc/kw_ptli.c @@ -85,6 +85,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 @@ -149,6 +153,11 @@ PUBLIC RguBndReq kwLiRguUbndReqMt[] = PUBLIC RguDDatReq rlcMacSendDlDataOpts[] = { +#ifdef EGTP_TEST + macStubSendDlData, + macStubSendDlData, + macStubSendDlData, +#else /* EGTP_TEST */ #ifdef LCKWLIRGU packDlData, /* 0 - loosely coupled */ #endif /* LCRGUIRGU */ @@ -158,6 +167,7 @@ PUBLIC RguDDatReq rlcMacSendDlDataOpts[] = #ifdef LCKWLIRGU packDlData, /* 0 - loosely coupled */ #endif /* LCRGUIRGU */ +#endif /* EGTP_TEST */ }; @@ -165,6 +175,11 @@ PUBLIC RguDDatReq rlcMacSendDlDataOpts[] = PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] = { +#ifdef EGTP_TEST + macStubBOStatus, + macStubBOStatus, + macStubBOStatus, +#else /* EGTP_TEST */ #ifdef LCKWLIRGU packBOStatus, /* 0 - loosely coupled */ #endif /* LCRGUIRGU */ @@ -174,6 +189,7 @@ PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] = #ifdef LCKWLIRGU packBOStatus, /* 0 - LWLC loosely coupled */ #endif /* LCRGUIRGU */ +#endif /* EGTP_TEST */ }; /* kw005.201 added support for L2 Measurement */ diff --git a/src/5gnrrlc/kw_ptui.c b/src/5gnrrlc/kw_ptui.c index c056bc0ed..a1e49fbb8 100755 --- a/src/5gnrrlc/kw_ptui.c +++ b/src/5gnrrlc/kw_ptui.c @@ -341,14 +341,12 @@ U8 status; /* Status */ PUBLIC S16 KwUiKwuDatInd ( Pst *pst, -SuId suId, KwuDatIndInfo *datInd, Buffer *mBuf ) #else -PUBLIC S16 KwUiKwuDatInd(pst, suId, datInd, mBuf) +PUBLIC S16 KwUiKwuDatInd(pst, datInd, mBuf) Pst *pst; -SuId suId; KwuDatIndInfo *datInd; Buffer *mBuf; #endif @@ -356,7 +354,7 @@ Buffer *mBuf; 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); diff --git a/src/5gnrrlc/kw_tmm_ul.c b/src/5gnrrlc/kw_tmm_ul.c index 4e3b48738..268b87058 100755 --- a/src/5gnrrlc/kw_tmm_ul.c +++ b/src/5gnrrlc/kw_tmm_ul.c @@ -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); - KwUiKwuDatInd(&ulPst1, 1, datIndInfo, pdu); + KwUiKwuDatInd(&ulPst1, datIndInfo, pdu); } else if(2 == rrcMsgType) { @@ -330,7 +330,7 @@ Buffer *pdu; 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; diff --git a/src/5gnrrlc/kw_udx_dl.c b/src/5gnrrlc/kw_udx_dl.c index 2cc94e4de..6994b9d8f 100755 --- a/src/5gnrrlc/kw_udx_dl.c +++ b/src/5gnrrlc/kw_udx_dl.c @@ -298,18 +298,6 @@ CkwCfgInfo *cfg; 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, diff --git a/src/5gnrrlc/kw_uim.c b/src/5gnrrlc/kw_uim.c index 5732c9381..22765324f 100755 --- a/src/5gnrrlc/kw_uim.c +++ b/src/5gnrrlc/kw_uim.c @@ -849,29 +849,26 @@ Reason reason; PUBLIC S16 KwUiKwuDatReq ( Pst *pst, -SpId spId, KwuDatReqInfo *datReq, Buffer *mBuf ) #else -PUBLIC S16 KwUiKwuDatReq(pst, spId, datReq, mBuf) +PUBLIC S16 KwUiKwuDatReq(pst, datReq, mBuf) Pst *pst; -SpId spId; KwuDatReqInfo *datReq; Buffer *mBuf; #endif { S16 ret = ROK; /* Return Value */ KwDlRbCb *rbCb; /* RB Control Block */ - KwKwuSapCb *kwuSap; /* SAP Config Block */ KwCb *tKwCb; TRC3(KwUiKwuDatReq) + DU_LOG("\nRLC : Received DL Data"); + #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); @@ -880,17 +877,6 @@ Buffer *mBuf; 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) @@ -902,8 +888,6 @@ Buffer *mBuf; 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) { @@ -921,23 +905,17 @@ Buffer *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); - /* kw005.201 ccpu00117318, updated statistics */ - kwuSap->sts.sduRx++; break; } case CM_LTE_MODE_AM: { kwAmmQSdu(tKwCb,rbCb, mBuf, datReq); - /* kw005.201 ccpu00117318, updated statistics */ - kwuSap->sts.sduRx++; break; } default: diff --git a/src/5gnrrlc/kw_utl_dl.c b/src/5gnrrlc/kw_utl_dl.c index 2742a8aa6..d150d9c15 100755 --- a/src/5gnrrlc/kw_utl_dl.c +++ b/src/5gnrrlc/kw_utl_dl.c @@ -303,11 +303,11 @@ RguDDatReqInfo *datReqInfo; } /* For Data per UE */ /* Check if to be freed here */ - /* - SPutSBuf(post->region, + + KW_FREE_SHRABL_BUF(post->region, post->pool, - (Data *)datReqInfo, sizeof(RguDDatReqInfo)); - */ + datReqInfo, sizeof(RguDDatReqInfo)); + RETVALUE(ROK); }/* End of KwLiRguDDatReq */ diff --git a/src/5gnrrlc/kw_utl_ul.c b/src/5gnrrlc/kw_utl_ul.c index ff12ea81b..d3ce168f0 100755 --- a/src/5gnrrlc/kw_utl_ul.c +++ b/src/5gnrrlc/kw_utl_ul.c @@ -289,7 +289,7 @@ Buffer *sdu; } #ifndef KW_PDCP - KwUiKwuDatInd(&kwKwSap->pst, kwKwSap->suId, datIndInfo, sdu); + KwUiKwuDatInd(&gCb->genCfg.lmPst, datIndInfo, sdu); #endif RETVALUE(ROK); } /* kwUtlSndDatInd */ diff --git a/src/5gnrrlc/mac_stub.c b/src/5gnrrlc/mac_stub.c new file mode 100644 index 000000000..bd0e1dfa8 --- /dev/null +++ b/src/5gnrrlc/mac_stub.c @@ -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 index 000000000..46b7104a5 --- /dev/null +++ b/src/5gnrrlc/mac_stub.h @@ -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 +**********************************************************************/ diff --git a/src/cm/kwu.c b/src/cm/kwu.c index 7bbe95211..04c7eee62 100755 --- a/src/cm/kwu.c +++ b/src/cm/kwu.c @@ -244,14 +244,12 @@ Buffer *mBuf; PUBLIC S16 cmPkKwuDatReq ( Pst * pst, -SpId spId, KwuDatReqInfo* datReq, Buffer * mBuf ) #else -PUBLIC S16 cmPkKwuDatReq(pst, spId, datReq, mBuf) +PUBLIC S16 cmPkKwuDatReq(pst, datReq, mBuf) Pst * pst; -SpId spId; KwuDatReqInfo* datReq; Buffer * mBuf; #endif @@ -270,7 +268,7 @@ Buffer * mBuf; { 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 @@ -334,7 +332,6 @@ Buffer * mBuf; RETVALUE(RFAILED); } - CMCHKPKLOG(SPkS16, spId, mBuf, EKWU011, pst); #ifdef L2_L3_SPLIT if(datReq->rlcId.rbType == CM_LTE_SRB) { @@ -446,14 +443,12 @@ Buffer *mBuf; PUBLIC S16 cmPkKwuDatInd ( Pst * pst, -SuId suId, KwuDatIndInfo* datInd, Buffer * mBuf ) #else -PUBLIC S16 cmPkKwuDatInd(pst, suId, datInd, mBuf) +PUBLIC S16 cmPkKwuDatInd(pst, datInd, mBuf) Pst * pst; -SuId suId; KwuDatIndInfo* datInd; Buffer * mBuf; #endif @@ -531,7 +526,6 @@ Buffer * mBuf; RETVALUE(RFAILED); } - CMCHKPKLOG(SPkS16, suId, mBuf, EKWU013, pst); pst->event = (Event) KWU_EVT_DAT_IND; RETVALUE(SPstTsk(pst,mBuf)); @@ -1271,9 +1265,6 @@ Buffer *mBuf; TRC3(cmUnpkKwuDatReq) - - CMCHKUNPK(SUnpkS16, &(spId), mBuf); - switch(pst->selector) { case KWU_SEL_LWLC: @@ -1312,7 +1303,7 @@ Buffer *mBuf; 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) @@ -1363,14 +1354,11 @@ Buffer *mBuf; #endif { S16 ret1 = ROK, retVal; - SuId suId = 0; KwuDatIndInfo *datInd = NULLP; KwuDatIndInfo datIndTmp; TRC3(cmUnpkKwuDatInd) - CMCHKUNPK(SUnpkS16, &(suId), mBuf); - switch(pst->selector) { case KWU_SEL_LWLC: @@ -1423,7 +1411,7 @@ Buffer *mBuf; (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)) diff --git a/src/cm/kwu.h b/src/cm/kwu.h index da1b35f63..89c475098 100755 --- a/src/cm/kwu.h +++ b/src/cm/kwu.h @@ -45,7 +45,7 @@ EXTERN "C" { /* 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 diff --git a/src/cm/kwu.x b/src/cm/kwu.x index 2e0249219..ee40f9b3f 100755 --- a/src/cm/kwu.x +++ b/src/cm/kwu.x @@ -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 (*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)); @@ -216,7 +215,6 @@ EXTERN S16 KwUiKwuUbndReq ARGS((Pst *pst, * -# RFAILED */ EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst, - SpId spId, KwuDatReqInfo* datReq, Buffer *buf)); @@ -234,7 +232,6 @@ EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst, * -# RFAILED */ EXTERN S16 KwUiKwuDatInd ARGS((Pst *pst, - SuId suId, KwuDatIndInfo* datInd, Buffer *mBuf)); @@ -359,7 +356,6 @@ EXTERN S16 NhLiKwuDatReq ARGS((Pst *pst, Buffer *buf)); EXTERN S16 NhLiKwuDatInd ARGS((Pst *pst, - SuId suId, KwuDatIndInfo* datInd, Buffer *buf)); #endif /* NH */ @@ -413,7 +409,6 @@ EXTERN S16 PjLiKwuDatReq ARGS((Pst *pst, Buffer *buf)); EXTERN S16 PjLiKwuDatInd ARGS((Pst *pst, - SuId suId, KwuDatIndInfo* datInd, Buffer *buf)); @@ -495,14 +490,12 @@ U8 status EXTERN S16 cmPkKwuDatReq ARGS (( Pst * pst, -SpId spId, KwuDatReqInfo* datReq, Buffer * mBuf )); EXTERN S16 cmPkKwuDatInd ARGS (( Pst * pst, -SuId suId, KwuDatIndInfo* datInd, Buffer * mBuf )); diff --git a/src/cu_stub/cu_stub_egtp.c b/src/cu_stub/cu_stub_egtp.c index b8a82dead..1db83d2e9 100644 --- a/src/cu_stub/cu_stub_egtp.c +++ b/src/cu_stub/cu_stub_egtp.c @@ -636,7 +636,7 @@ S16 cuEgtpDatReq() BuildEgtpMsg(&egtpMsg); /* Send Message to peer */ - while(cnt < 20) + while(cnt < 1) { DU_LOG("\nEGTP : Sending message[%d]", cnt+1); cuEgtpSendMsg(egtpMsg.msg); diff --git a/src/du_app/du_cfg.h b/src/du_app/du_cfg.h index f7dd4d88f..d2dd80d07 100644 --- a/src/du_app/du_cfg.h +++ b/src/du_app/du_cfg.h @@ -133,6 +133,11 @@ #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 { diff --git a/src/du_app/du_egtp.c b/src/du_app/du_egtp.c index 2fca6e2b4..e3d8d2e1c 100644 --- a/src/du_app/du_egtp.c +++ b/src/du_app/du_egtp.c @@ -20,6 +20,7 @@ #include #include "du_egtp.h" +#include "du_ue_mgr.h" /* Global variable declaration */ EgtpGlobalCb egtpCb; @@ -587,13 +588,13 @@ S16 egtpHdlDatInd(EgtpMsg egtpMsg) 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); - 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 */ @@ -820,7 +821,7 @@ S16 egtpRecvMsg() 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); } @@ -838,6 +839,7 @@ S16 egtpHdlRecvData(Buffer *mBuf) egtpDecodeHdr(mBuf, &egtpMsg); /* TODO : Send received message to RLC */ + duHdlEgtpDlData(&egtpMsg); RETVALUE(ROK); } @@ -994,8 +996,10 @@ S16 egtpDecodeHdr(Buffer *mBuf, EgtpMsg *egtpMsg) { 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 */ diff --git a/src/du_app/du_mgr.h b/src/du_app/du_mgr.h index 562aaef4e..3066c529b 100644 --- a/src/du_app/du_mgr.h +++ b/src/du_app/du_mgr.h @@ -234,7 +234,8 @@ S16 duSendEgtpSrvOpenReq(); 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 diff --git a/src/du_app/du_mgr_ex_ms.c b/src/du_app/du_mgr_ex_ms.c index 9e4662606..21c639d6c 100644 --- a/src/du_app/du_mgr_ex_ms.c +++ b/src/du_app/du_mgr_ex_ms.c @@ -24,6 +24,9 @@ #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); @@ -160,6 +163,11 @@ S16 duActvTsk(Pst *pst, Buffer *mBuf) { 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", \ diff --git a/src/du_app/du_msg_hdl.c b/src/du_app/du_msg_hdl.c index f7ae39945..053fcf1b9 100644 --- a/src/du_app/du_msg_hdl.c +++ b/src/du_app/du_msg_hdl.c @@ -1175,7 +1175,9 @@ S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm) 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(); @@ -1190,38 +1192,52 @@ S16 duHdlEgtpTnlMgmtCfm(EgtpTnlEvt tnlEvtCfm) 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 /******************************************************************* * - * @brief Simulate RLC to EGTP data indication + * @brief Simulate UL Data for intial test * * @details * - * Function : duSendEgtpDatInd + * Function : duSendEgtpTestData * * Functionality: - * Simulate RLC to EGTP data indication + * Simulate UL data for initial test * * @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; - EgtpMsg egtpMsg; 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); @@ -1302,19 +1318,8 @@ S16 duSendEgtpDatInd() /* 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); } diff --git a/src/du_app/du_ue_mgr.c b/src/du_app/du_ue_mgr.c index 080b8bf4d..91ad96c2d 100644 --- a/src/du_app/du_ue_mgr.c +++ b/src/du_app/du_ue_mgr.c @@ -19,6 +19,10 @@ #include "du_ue_mgr.h" #include "du_cfg.h" +#ifdef EGTP_TEST +U32 sduId = 0; +#endif + /****************************************************************** * * @brief Send UE configuration to RLC @@ -37,23 +41,30 @@ S16 duSendUeCreateReqToRlc() { U8 idx; Pst pst; - CkwCfgInfo ueCfg; + CkwCfgInfo *ueCfg; 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: { @@ -62,9 +73,9 @@ S16 duSendUeCreateReqToRlc() 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; } @@ -88,11 +99,87 @@ S16 duSendUeCreateReqToRlc() pst.region = duCb.init.region; /* Sending to RLC */ - packUeCreateReq(&pst, &ueCfg); + packUeCreateReq(&pst, ueCfg); 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 ***********************************************************************/ diff --git a/src/du_app/du_ue_mgr.h b/src/du_app/du_ue_mgr.h index c459e80e9..381a2a088 100644 --- a/src/du_app/du_ue_mgr.h +++ b/src/du_app/du_ue_mgr.h @@ -24,7 +24,13 @@ #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 diff --git a/src/mt/mt_ss.h b/src/mt/mt_ss.h index 884c7f121..b209052b0 100755 --- a/src/mt/mt_ss.h +++ b/src/mt/mt_ss.h @@ -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 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 diff --git a/src/phy_stub/l1_bdy2.c b/src/phy_stub/l1_bdy2.c index a636f172f..7a800afc7 100644 --- a/src/phy_stub/l1_bdy2.c +++ b/src/phy_stub/l1_bdy2.c @@ -8,7 +8,7 @@ void *GenerateTicks(void *arg) { while(1) { - sleep(10); + sleep(1); printf("\nTTI indication"); /* Send TTI indication to CL */ duSendEgtpTTIInd(); -- 2.16.6