Jira id - ODUHIGH-227
[o-du/l2.git] / src / 5gnrrlc / mac_stub.c
index bd0e1df..873886d 100644 (file)
 *******************************************************************************/
 
 #ifdef EGTP_TEST
-
+#include "common_def.h"
 #include "mac_stub.h"
 
 uint8_t rlcDatSn = 0;
 uint64_t ulDatNum = 0;
 
-PUBLIC S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
+uint8_t macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
 {
   Pst rspPst;
-  RlcMacSchedRep *schRep;
+  RlcMacSchedRepInfo *schRep;
 
-  DU_LOG("\nMAC_STUB : Received BO status from RLC");
+  DU_LOG("\nMAC : Received BO status from RLC");
 
 //  SGetSBuf(pst->region, pst->pool, (Data **)&rspPst, sizeof(Pst));
 
-  rspPst.selector  = RGU_SEL_TC;
+  rspPst.selector  = ODU_SELECTOR_TC;
   rspPst.srcEnt    = pst->dstEnt;
   rspPst.dstEnt    = pst->srcEnt;
   rspPst.dstInst   = pst->srcInst;
@@ -42,7 +42,7 @@ PUBLIC S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
   rspPst.pool    = pst->pool;
 
   /* Filling Scheduling Report */
-  KW_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, schRep, sizeof(RlcMacSchedRep));
+  RLC_SHRABL_STATIC_BUF_ALLOC(pst->region, pst->pool, schRep, sizeof(RlcMacSchedRepInfo));
    
   schRep->cellId = boSta->cellId;
   schRep->rnti   = boSta->rnti;
@@ -51,7 +51,7 @@ PUBLIC S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
   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");
+  DU_LOG("\nMAC : Sending scheduling report to RLC");
   
   RlcMacProcSchedRep(&rspPst, 1, schRep);
 
@@ -59,7 +59,7 @@ PUBLIC S16 macStubBOStatus(Pst *pst, SpId spId, RlcMacBOStatus *boSta)
 
 }
 
-PUBLIC S16 macStubSendDlData(Pst *pst, SpId spId, RlcMacData *dlData)
+uint8_t macStubSendDlData(Pst *pst, SpId spId, RlcMacData *dlData)
 {
    U32 availmem;
 
@@ -69,14 +69,14 @@ PUBLIC S16 macStubSendDlData(Pst *pst, SpId spId, RlcMacData *dlData)
 
    DU_LOG("\nMAC_STUB : Received DL data from RLC to be sent to PHY"); 
 
-   SPutMsg(dlData->pduInfo[0].pduBuf);
+   ODU_PUT_MSG(dlData->pduInfo[0].pduBuf);
    dlData->pduInfo[0].pduBuf = NULL;
 
 #if 0
-   KW_FREE_SHRABL_BUF(pst->region, pst->pool,
+   RLC_FREE_SHRABL_BUF(pst->region, pst->pool,
                         dlData, sizeof(RlcMacData));
 {
-   KW_ALLOC_SHRABL_BUF(pst->region, pst->pool,
+   RLC_ALLOC_SHRABL_BUF(pst->region, pst->pool,
                           ulData, sizeof(RlcMacData));
 
    SRegInfoShow(2, &availmem);
@@ -84,12 +84,12 @@ PUBLIC S16 macStubSendDlData(Pst *pst, SpId spId, RlcMacData *dlData)
 #endif
    
    ulData = dlData;
-   SGetMsg(pst->region, pst->pool, &mBuf);
+   ODU_GET_MSG(pst->region, pst->pool, &mBuf);
    macStubBuildUlData(mBuf);
    ulData->pduInfo[0].pduBuf = mBuf;
 
    /* Fill response post */
-   rspPst.selector  = RGU_SEL_TC;
+   rspPst.selector  = ODU_SELECTOR_TC;
    rspPst.srcEnt    = pst->dstEnt;
    rspPst.dstEnt    = pst->srcEnt;
    rspPst.dstInst   = pst->srcInst;
@@ -100,7 +100,7 @@ PUBLIC S16 macStubSendDlData(Pst *pst, SpId spId, RlcMacData *dlData)
 
    ulDatNum++;
    DU_LOG("\nMAC_STUB : UL data number %d", ulDatNum);
-   RlcMacProcUlData(&rspPst, 1, ulData);
+   RlcProcUlData(&rspPst, 1, ulData);
    return ROK;
 }
 
@@ -110,7 +110,7 @@ void macStubBuildUlData(Buffer *mBuf)
    int datSize = 30;
    U32 availmem;
 
-   SAddPstMsgMult((Data *)data, datSize, mBuf);
+   ODU_ADD_POST_MSG_MULT((Data *)data, datSize, mBuf);
 
    /* filling IPv4 header */
    CmIpv4Hdr ipv4Hdr;
@@ -183,9 +183,9 @@ void macStubBuildUlData(Buffer *mBuf)
         revPkArray[idx] = pkArray[CM_IPV4_HDRLEN - idx -1];
     
    /* this function automatically reverses revPkArray */
-   ret = SAddPreMsgMult(revPkArray, (MsgLen)cnt, mBuf);
+   ret = ODU_ADD_PRE_MSG_MULT(revPkArray, (MsgLen)cnt, mBuf);
 
-   SAddPreMsgMult((Data *)&rlcDatSn, sizeof(uint8_t), mBuf);
+   ODU_ADD_PRE_MSG_MULT((Data *)&rlcDatSn, sizeof(uint8_t), mBuf);
 #if 0
    SRegInfoShow(0, &availmem);
    SRegInfoShow(1, &availmem);