RLC BO, BO response and DL Data handling. [Issue-ID: ODUHIGH-181]
[o-du/l2.git] / src / 5gnrrlc / mac_stub.c
index 7bf768b..3a9e481 100644 (file)
 
 #ifdef EGTP_TEST
 #include "common_def.h"
-#include "mac_stub.h"
 
-uint8_t rlcDatSn = 0;
-uint64_t ulDatNum = 0;
-
-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"
 
-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_BUF(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_BUF(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;