JIRA ID - ODUHIGH-241 Implementation of RRC DELIVERY REPORT
[o-du/l2.git] / src / mt / ss_rbuf.c
index d030e1b..a1581c0 100755 (executable)
@@ -45,13 +45,13 @@ U32 ssRngBufStatus = 0;
 SsRngBufTbl SsRngInfoTbl[SS_RNG_BUF_MAX];
 
 
-PUBLIC Void SsRngBufEnable(Void)
+Void SsRngBufEnable(Void)
 {
   ssRngBufStatus = TRUE;
 }
 
 
-PUBLIC Void SsRngBufDisable(Void)
+Void SsRngBufDisable(Void)
 {
   ssRngBufStatus = FALSE;
 
@@ -63,7 +63,7 @@ Desc: Creates Ring Buffer for the given Id.
       Region and Pool
 */
 #ifdef ANSI
-PUBLIC S16 SCreateSRngBuf
+S16 SCreateSRngBuf
 (
 U32 id,  
 Region region,
@@ -72,7 +72,7 @@ U32 elmSize,
 U32 rngSize
 )
 #else
-PUBLIC S16 SCreateSRngBuf (id, region, pool, elmSize, rngSize)
+S16 SCreateSRngBuf (id, region, pool, elmSize, rngSize)
 U32 id; 
 Region region;
 Pool pool;
@@ -88,7 +88,7 @@ U32 rngSize;
 #if (ERRCLASS & ERRCLS_DEBUG)
       SSLOGERROR(ERRCLS_DEBUG, ESSXXX, id, "Invalid RBUF ID");
 #endif
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    if(SsRngInfoTbl[id].r_addr != 0)
    {
@@ -96,7 +96,7 @@ U32 rngSize;
       SSLOGERROR(ERRCLS_DEBUG, ESSXXX, id, 
             "Failed to Create Ring Buffer Id Ring already exist");
 #endif
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    /* Get Element Size */
    
@@ -108,7 +108,7 @@ U32 rngSize;
 #if (ERRCLASS & ERRCLS_DEBUG)
       SSLOGERROR(ERRCLS_INT_PAR, ESSXXX, ERRZERO, "Allocating Ring  Failed!!!")
 #endif
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #if (ERRCLASS & ERRCLS_DEBUG)
       SSLOGERROR(ERRCLS_DEBUG, ESSXXX, ring, 
@@ -128,7 +128,7 @@ U32 rngSize;
       SSLOGERROR(ERRCLS_INT_PAR, ESSXXX, ERRZERO, "Allocating Ring  Failed!!!")
 #endif
       free(ring);
-      RETVALUE(RFAILED);
+      return RFAILED;
     }
     /* Update Buffer Id Table */
     SsRngInfoTbl[id].r_addr   = ring;
@@ -141,7 +141,7 @@ U32 rngSize;
 #else
     printf("Ring Buffer Created with id =%d rSize:%d eSize:%d %lx\n",id,ring->size,ring->type,(PTR)ring);
 #endif
-    RETVALUE(ROK);
+    return ROK;
 }
 
 /*
@@ -150,14 +150,14 @@ Desc: Attach the calling Entity to a ring buffer
       as consumer(Rx) or producer (Tx)
 */
 #ifdef ANSI
-PUBLIC S16 SAttachSRngBuf
+S16 SAttachSRngBuf
 (
 U32 id,  
 U32 ent,
 U32 txRx
 )
 #else
-PUBLIC S16 SAttachSRngBuf (id, ent, txRx)
+S16 SAttachSRngBuf (id, ent, txRx)
 U32 id;
 U32 ent;
 U32 txRx;
@@ -169,7 +169,7 @@ U32 txRx;
 #if (ERRCLASS & ERRCLS_DEBUG)
       SSLOGERROR(ERRCLS_DEBUG, ESSXXX, id, "Invalid RBUF ID");
 #endif
-       RETVALUE(RFAILED);
+       return RFAILED;
     }
     if(SsRngInfoTbl[id].rngState < SS_RNG_CREATED)
     {
@@ -184,7 +184,7 @@ U32 txRx;
        printf("Attach Request in Invalid Ring State %d id%d \n",
          SsRngInfoTbl[id].rngState,id);
 #endif
-       RETVALUE(RFAILED);
+       return RFAILED;
     }
     if(txRx == SS_RNG_TX)
     {
@@ -196,7 +196,7 @@ U32 txRx;
         SsRngInfoTbl[id].rxEnt = ent;
         SsRngInfoTbl[id].rngState = SS_RNG_RX_ATTACHED;
     }
-    RETVALUE(ROK);
+    return ROK;
 }
 /* 
 Func: SConnectSRngBuf
@@ -204,19 +204,19 @@ Desc: Establish a pipe between producer and consumer
 
 */
 #ifdef ANSI
-PUBLIC S16 SConnectSRngBuf
+S16 SConnectSRngBuf
 (
 U32 id,  
 U32 rxEnt
 )
 #else
-PUBLIC S16 SConnectSRngBuf (id, rxEnt)
+S16 SConnectSRngBuf (id, rxEnt)
 U32 id;
 U32 rxEnt;
 #endif
 {
    /* Send to Reciever ENT*/ 
-   RETVALUE(ROK)
+   return ROK
 }
 
 /*
@@ -251,7 +251,7 @@ inline static S16 IsEmpty(SsRngBuf* rBuf)
    return (rBuf->write == rBuf->read); 
 }
 
-PUBLIC S16 isRngEmpty(U32 id)
+S16 isRngEmpty(U32 id)
 {
    return (IsEmpty(SsRngInfoTbl[id].r_addr));
 }
@@ -260,13 +260,13 @@ Func: SEnqSRngBuf
 Desc: Perform Queue operation on Ring bufer
 */
 #ifdef ANSI
-PUBLIC S16 SEnqSRngBuf 
+S16 SEnqSRngBuf 
 (
 U32 id, 
 Void* elem
 )
 #else
-PUBLIC S16 SEnqSRngBuf(id,elem) 
+S16 SEnqSRngBuf(id,elem) 
 U32 id;
 Void* elem;
 #endif
@@ -281,7 +281,7 @@ Void* elem;
    if (IsFull(ring))
    {
         SsRngInfoTbl[id].nWriteFail++;
-        RETVALUE(RFAILED);
+        return RFAILED;
    }
    /* TBD Avoid multiplication for optimisation */
    w_ptr = (U8*)ring->elem + (ring->write * ring->type);
@@ -297,36 +297,36 @@ Void* elem;
     ring->write = (wrIndex == ring->size)?0: wrIndex;
    /* Update Statistics */
    SsRngInfoTbl[id].n_write++;
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #ifdef ANSI
-PUBLIC S16 SGetNumElemInRng
+S16 SGetNumElemInRng
 (
 U32 id
 )
 #else
-PUBLIC S16 SGetNumElemInRng (id)
+S16 SGetNumElemInRng (id)
 U32 id;
 #endif
 {
 
    S16 freeDist = (SsRngInfoTbl[id].n_write- SsRngInfoTbl[id].n_read);
 
-       RETVALUE(freeDist);
+       return (freeDist);
 }
 /*
 Func: SDeqSRngBuf
 Desc: Perform DeQueue operation on Ring bufer
 */
 #ifdef ANSI
-PUBLIC S16 SDeqSRngBuf
+S16 SDeqSRngBuf
 (
 U32 id,
 Void *elem
 )
 #else
-PUBLIC S16 SDeqSRngBuf (id,elem)
+S16 SDeqSRngBuf (id,elem)
 U8 id;
 Void *elem;
 #endif
@@ -340,7 +340,7 @@ Void *elem;
    if(IsEmpty(ring))
    {  
        SsRngInfoTbl[id].nReadFail++;
-       RETVALUE(RFAILED);
+       return RFAILED;
    }
    r_ptr = (U8*)ring->elem + (ring->read * ring->type);
    for(i=0; i<ring->type; i++)
@@ -353,18 +353,18 @@ Void *elem;
    rdIndex= ring->read + 1;
    ring->read = (rdIndex == ring->size)?0:rdIndex;
    SsRngInfoTbl[id].n_read++;
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #ifdef ANSI
-PUBLIC S16 SDestroySRngBuf 
+S16 SDestroySRngBuf 
 (
 U32 id,
 Region region,
 Pool pool
 )
 #else
-PUBLIC S16 SDestroySRngBuf(id, region, pool)
+S16 SDestroySRngBuf(id, region, pool)
 U32 id;
 Region region;
 Pool pool;
@@ -384,16 +384,16 @@ Pool pool;
       SsRngInfoTbl[id].rngState = SS_RNG_DESTROYED;
       SsRngInfoTbl[id].r_addr = 0;
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #ifdef ANSI
-PUBLIC S16 SPrintSRngStats
+S16 SPrintSRngStats
 (
 Void
 )
 #else
-PUBLIC S16 SPrintSRngStats ()
+S16 SPrintSRngStats ()
 Void;
 #endif
 {
@@ -402,7 +402,7 @@ U32 i;
    Txt   prntBuf[100];
 
 #ifdef RGL_SPECIFIC_CHANGES
-   RETVALUE(ROK);
+   return ROK;
 #endif
    for(i=0; i< SS_RNG_BUF_MAX;i++)
    {
@@ -458,16 +458,16 @@ U32 i;
 #endif
       }
    }
-   RETVALUE(ROK)
+   return ROK
 }
 
 #ifdef ANSI
-PUBLIC Void* SRngGetWIndx
+Void* SRngGetWIndx
 (
 U32 rngId
 )
 #else
-PUBLIC Void* SRngGetWIndx (rngId)
+Void* SRngGetWIndx (rngId)
 U32 rngId;
 #endif
 {
@@ -476,21 +476,21 @@ U32 rngId;
    if (IsFull(ring))
    {
       SsRngInfoTbl[rngId].nWriteFail++;
-      RETVALUE(NULLP);
+      return (NULLP);
    }
    else
    {
-      RETVALUE(((U8 *)ring->elem) + (ring->type * ring->write));
+      return (((U8 *)ring->elem) + (ring->type * ring->write));
    }
 }
 
 #ifdef ANSI
-PUBLIC Void* SRngGetRIndx
+Void* SRngGetRIndx
 (
 U32 rngId
 )
 #else
-PUBLIC Void* SRngGetRIndx (rngId)
+Void* SRngGetRIndx (rngId)
 U32 rngId;
 #endif
 {
@@ -499,21 +499,21 @@ U32 rngId;
    if(IsEmpty(ring))
    {
       SsRngInfoTbl[rngId].nReadFail++;
-      RETVALUE(NULLP);
+      return (NULLP);
    }
    else
    {
-      RETVALUE(((U8 *)ring->elem) + (ring->type * ring->read));
+      return (((U8 *)ring->elem) + (ring->type * ring->read));
    }
 }
 
 #ifdef ANSI
-PUBLIC Void SRngIncrWIndx
+Void SRngIncrWIndx
 (
 U32 rngId
 )
 #else
-PUBLIC Void SRngIncrWIndx (rngId)
+Void SRngIncrWIndx (rngId)
 U32 rngId;
 #endif
 {
@@ -527,12 +527,12 @@ U32 rngId;
 }
 
 #ifdef ANSI
-PUBLIC Void SRngIncrRIndx
+Void SRngIncrRIndx
 (
 U32 rngId
 )
 #else
-PUBLIC Void SRngIncrRIndx (rngId)
+Void SRngIncrRIndx (rngId)
 U32 rngId;
 #endif
 {
@@ -572,7 +572,7 @@ S16 mtAddBufToRing(SsRngBufId ringId,void *bufPtr,U8 freeType)
       SsRngInfoTbl[ringId].pktDrop++;
       ret1 = RFAILED;
    }
-   RETVALUE(ret1);
+   return (ret1);
 }
 #endif
 #endif