X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Fmac_stub.c;h=3a9e48193dc2fa262f9e02998fe19e87dca9bd1a;hb=2193e4cf01012809495be026097e8d7eacb9f0ac;hp=da96e98aee74ca8ce5d04aea06ef9af426739739;hpb=4d45b914f9e94203603d3b9fdbcb1aad361301dd;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/mac_stub.c b/src/5gnrrlc/mac_stub.c index da96e98ae..3a9e48193 100644 --- a/src/5gnrrlc/mac_stub.c +++ b/src/5gnrrlc/mac_stub.c @@ -18,97 +18,16 @@ #ifdef EGTP_TEST #include "common_def.h" -#include "mac_stub.h" -uint8_t rlcDatSn = 0; -uint64_t ulDatNum = 0; - -PUBLIC uint8_t macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta) -{ - Pst rspPst; - RlcMacSchedRepInfo *schRep; - - DU_LOG("\nMAC : Received BO status from RLC"); - -// SGetSBuf(pst->region, pst->pool, (Data **)&rspPst, sizeof(Pst)); - - rspPst.selector = ODU_SELECTOR_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 */ - RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, schRep, sizeof(RlcMacSchedRepInfo)); - - 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 : Sending scheduling report to RLC"); - - RlcMacProcSchedRep(&rspPst, 1, schRep); - - return ROK; - -} +#define DU_IP_V4_ADDR "192.168.130.81" +#define CU_IP_V4_ADDR "192.168.130.82" -PUBLIC uint8_t 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"); - - ODU_PUT_MSG(dlData->pduInfo[0].pduBuf); - dlData->pduInfo[0].pduBuf = NULL; - -#if 0 - RLC_FREE_SHRABL_BUF(pst->region, pst->pool, - dlData, sizeof(RlcMacData)); -{ - RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool, - ulData, sizeof(RlcMacData)); - - SRegInfoShow(2, &availmem); - cmMemcpy((U8 *)ulData, (U8 *)dlData, sizeof(RlcMacData)); -#endif - - ulData = dlData; - ODU_GET_MSG(pst->region, pst->pool, &mBuf); - macStubBuildUlData(mBuf); - ulData->pduInfo[0].pduBuf = mBuf; - - /* Fill response post */ - rspPst.selector = ODU_SELECTOR_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); - RlcProcUlData(&rspPst, 1, ulData); - return ROK; -} +uint8_t rlcDatSn = 0; void macStubBuildUlData(Buffer *mBuf) { char data[30] = "This is EGTP data from DU"; int datSize = 30; - U32 availmem; ODU_ADD_POST_MSG_MULT((Data *)data, datSize, mBuf); @@ -186,15 +105,7 @@ void macStubBuildUlData(Buffer *mBuf) ret = ODU_ADD_PRE_MSG_MULT(revPkArray, (MsgLen)cnt, mBuf); ODU_ADD_PRE_MSG_MULT((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;