#define __KWH__
#include "rl_interface.h"
#include "rl_common.h"
-
+#include "du_log.h"
\f
#define KWLAYERNAME "LTE RLC" /* Layer Name */
}
/* 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)
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++)
{
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;
}
* 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 */
* 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++)
{
* 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
* 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++;
}
/* 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);
}
#include "ss_rbuf.h"
#include "ss_rbuf.x"
+#ifdef EGTP_TEST
+#include "mac_stub.h"
+#endif /* EGTP_TEST */
+
#ifndef LCKWLIRGU
#define PTKWRGU
#endif
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 */
+#endif /* EGTP_TEST */
};
PUBLIC RguDStaRsp rlcMacSendBOStatusOpts[] =
{
+#ifdef EGTP_TEST
+ macStubBOStatus,
+ macStubBOStatus,
+ macStubBOStatus,
+#else /* EGTP_TEST */
#ifdef LCKWLIRGU
packBOStatus, /* 0 - loosely coupled */
#endif /* LCRGUIRGU */
#ifdef LCKWLIRGU
packBOStatus, /* 0 - LWLC loosely coupled */
#endif /* LCRGUIRGU */
+#endif /* EGTP_TEST */
};
/* kw005.201 added support for L2 Measurement */
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
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);
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)
{
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;
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,
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);
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)
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)
{
}
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:
} /* 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 */
}
#ifndef KW_PDCP
- KwUiKwuDatInd(&kwKwSap->pst, kwKwSap->suId, datIndInfo, sdu);
+ KwUiKwuDatInd(&gCb->genCfg.lmPst, datIndInfo, sdu);
#endif
RETVALUE(ROK);
} /* kwUtlSndDatInd */
--- /dev/null
+/*******************************************************************************
+################################################################################
+# 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
+**********************************************************************/
--- /dev/null
+/*******************************************************************************
+################################################################################
+# 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
+**********************************************************************/
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
{
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
RETVALUE(RFAILED);
}
- CMCHKPKLOG(SPkS16, spId, mBuf, EKWU011, pst);
#ifdef L2_L3_SPLIT
if(datReq->rlcId.rbType == CM_LTE_SRB)
{
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
RETVALUE(RFAILED);
}
- CMCHKPKLOG(SPkS16, suId, mBuf, EKWU013, pst);
pst->event = (Event) KWU_EVT_DAT_IND;
RETVALUE(SPstTsk(pst,mBuf));
TRC3(cmUnpkKwuDatReq)
-
- CMCHKUNPK(SUnpkS16, &(spId), mBuf);
-
switch(pst->selector)
{
case KWU_SEL_LWLC:
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)
#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:
(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))
/* 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
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));
* -# RFAILED
*/
EXTERN S16 KwUiKwuDatReq ARGS((Pst *pst,
- SpId spId,
KwuDatReqInfo* datReq,
Buffer *buf));
* -# RFAILED
*/
EXTERN S16 KwUiKwuDatInd ARGS((Pst *pst,
- SuId suId,
KwuDatIndInfo* datInd,
Buffer *mBuf));
Buffer *buf));
EXTERN S16 NhLiKwuDatInd ARGS((Pst *pst,
- SuId suId,
KwuDatIndInfo* datInd,
Buffer *buf));
#endif /* NH */
Buffer *buf));
EXTERN S16 PjLiKwuDatInd ARGS((Pst *pst,
- SuId suId,
KwuDatIndInfo* datInd,
Buffer *buf));
EXTERN S16 cmPkKwuDatReq ARGS ((
Pst * pst,
-SpId spId,
KwuDatReqInfo* datReq,
Buffer * mBuf
));
EXTERN S16 cmPkKwuDatInd ARGS ((
Pst * pst,
-SuId suId,
KwuDatIndInfo* datInd,
Buffer * mBuf
));
BuildEgtpMsg(&egtpMsg);
/* Send Message to peer */
- while(cnt < 20)
+ while(cnt < 1)
{
DU_LOG("\nEGTP : Sending message[%d]", cnt+1);
cuEgtpSendMsg(egtpMsg.msg);
#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
{
#include <stdio.h>
#include "du_egtp.h"
+#include "du_ue_mgr.h"
/* Global variable declaration */
EgtpGlobalCb egtpCb;
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 */
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);
}
egtpDecodeHdr(mBuf, &egtpMsg);
/* TODO : Send received message to RLC */
+ duHdlEgtpDlData(&egtpMsg);
RETVALUE(ROK);
}
{
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 */
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
#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);
{
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", \
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();
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);
/* 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);
}
#include "du_ue_mgr.h"
#include "du_cfg.h"
+#ifdef EGTP_TEST
+U32 sduId = 0;
+#endif
+
/******************************************************************
*
* @brief Send UE configuration to RLC
{
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:
{
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;
}
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
***********************************************************************/
#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
#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
{
while(1)
{
- sleep(10);
+ sleep(1);
printf("\nTTI indication");
/* Send TTI indication to CL */
duSendEgtpTTIInd();