X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Frg.h;h=13eb03bc5bb0334f0b8f8afced6725fd81c199f1;hb=531da47c7bfb6ce138a454f66eb184729860beef;hp=2c039006606a844f31190298ad3d6d68dee9d871;hpb=069ae37558afd5aee2d1072bbf5b517cf665bdd8;p=o-du%2Fl2.git diff --git a/src/5gnrmac/rg.h b/src/5gnrmac/rg.h index 2c0390066..13eb03bc5 100755 --- a/src/5gnrmac/rg.h +++ b/src/5gnrmac/rg.h @@ -36,8 +36,6 @@ #ifndef __RGH__ #define __RGH__ -#include "rl_interface.h" -#include "rl_common.h" #ifdef L2_OPTMZ @@ -52,8 +50,8 @@ #define RG_MAC_HDR_SIZE 250 #define RG_MAC_CE_SIZE 250 -U32 MacPtrAddress; -U32 macHeader[2]; +uint32_t MacPtrAddress; +uint32_t macHeader[2]; #define RG_ADD_DBuf(_dBuf,_size,_mBuf)\ { \ @@ -62,7 +60,7 @@ U32 macHeader[2]; ssGetDBufOfSize(mInfo->region,_size, &_dBuf); \ SUpdMsg(_mBuf, _dBuf,0);\ _dBuf->b_wptr = _dBuf->b_rptr = (_dBuf->b_datap->db_base + 5);\ - MacPtrAddress = (U32)_dBuf->b_wptr;\ + MacPtrAddress = (uint32_t)_dBuf->b_wptr;\ } #endif @@ -244,57 +242,9 @@ U32 macHeader[2]; #define RG_MAX_DL_HARQ_NUM 8 #endif -#define MAC_MEM_REGION 4 -#define MAC_POOL 1 -/* allocate and zero out a MAC static buffer */ -#define MAC_ALLOC(_datPtr, _size) \ -{ \ - S16 _ret; \ - _ret = SGetSBuf(MAC_MEM_REGION, MAC_POOL, \ - (Data **)&_datPtr, _size); \ - if(_ret == ROK) \ - cmMemset((U8*)_datPtr, 0, _size); \ - else \ - _datPtr = NULLP; \ -} - -/* free a static buffer */ -#define MAC_FREE(_datPtr, _size) \ - if(_datPtr) \ - SPutSBuf(MAC_MEM_REGION, MAC_POOL, \ - (Data *)_datPtr, _size); - -/* Allocate shared memory to be used for LWLC - * during inter-layer communication */ -#define MAC_ALLOC_SHRABL_BUF(_buf, _size) \ -{ \ - if(SGetStaticBuffer(MAC_MEM_REGION, MAC_POOL, \ - (Data **)&_buf, (Size) _size, 0) == ROK) \ - { \ - cmMemset((U8 *)(_buf), 0, _size); \ - } \ - else \ - { \ - (_buf) = NULLP; \ - } \ -} - -/* Free shared memory, received through LWLC */ -#define MAC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \ -{ \ - if (_buf != NULLP) \ - { \ - (Void) SPutStaticBuffer(_region, _pool, \ - (Data *) _buf, (Size) _size, 0); \ - _buf = NULLP; \ - } \ -} - /* Free shared memory, received through LWLC */ #define MAC_FREE_MEM(_region, _pool, _datPtr, _size) \ - if(_datPtr) \ - SPutSBuf(_region, _pool,(Data *)_datPtr, _size); \ - _datPtr = NULL; + MAC_FREE(_datPtr, _size); \ #define RG_LCG_ISCFGD(lcg) ((lcg)->lcgId != RG_INVALID_LCG_ID) /* Corrected the check for dlCcchId */ @@ -333,8 +283,8 @@ U32 macHeader[2]; ssGetDBufOfSize(mInfo->region,_size, &_padBuf); \ if (_padBuf == NULLP) \ { \ - RLOG0(L_ERROR, "RGERR_MUX_BLD_CEHDR_FAIL");\ - RETVALUE(RFAILED);\ + DU_LOG("\nERROR --> MAC : RGERR_MUX_BLD_CEHDR_FAIL");\ + return RFAILED;\ } \ if (mInfo->endptr == NULLP) { \ sduEnd = _sduBuf; \ @@ -424,13 +374,13 @@ toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAME #define RG_NULL_CHECK(_inst, _ptr ) \ if((_ptr) == NULLP) \ { \ - RGDBGERRNEW(_inst, (rgPBuf(_inst),"Null Pointer detected"));\ + DU_LOG("\nERROR --> MAC : Null Pointer detected");\ SExit();\ } #define RG_ARRAY_BOUND_CHECK(_inst, _array, _idxVal) \ if((_idxVal) >= (sizeof(_array)/sizeof(_array[0]))) \ { \ - RGDBGERRNEW(_inst, (rgPBuf(_inst),"Array Bound Check Failed"));\ + DU_LOG("\nERROR --> MAC : Array Bound Check Failed");\ SExit();\ } #else @@ -473,7 +423,7 @@ toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAME #ifdef L2_OPTMZ #define RG_FREE_TB(_tb)\ {\ - U32 lchIdx, pduIdx;\ + uint32_t lchIdx, pduIdx;\ SResetMBuf(_tb->macHdr);\ SResetMBuf(_tb->macCes);\ _tb->tbPres = FALSE;\ @@ -497,7 +447,7 @@ toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAME #define RG_FREE_SAVED_TB(_tb)\ {\ - U32 lchIdx, pduIdx;\ + uint32_t lchIdx, pduIdx;\ RG_FREE_MSG(_tb->macHdr);\ RG_FREE_MSG(_tb->macCes);\ _tb->tbPres = FALSE;\ @@ -537,7 +487,7 @@ toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAME **********************************************************/ #define RG_DROP_RGUDDATREQ_MBUF(_datReq)\ {\ - U32 idx5,idx6,idx7;\ + uint32_t idx5,idx6,idx7;\ for (idx5=0; idx5 < _datReq.nmbOfTbs; idx5++)\ {\ for (idx6=0; idx6 < _datReq.datReqTb[idx5].nmbLch; idx6++)\ @@ -690,7 +640,7 @@ toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAME {\ if(_inst >= RG_MAX_INST)\ {\ - RETVALUE(RFAILED);\ + return RFAILED;\ }\ } @@ -702,8 +652,6 @@ toFill.slot = (RG_NUM_SUB_FRAMES_5G + crntTime.slot - (dcr)) % (RG_NUM_SUB_FRAME /* Value used to set nDmrs in uplink grant if nDmrs is not applicable */ #define RG_INVALID_NDMRS 10 -#define RG_SEND_TRC_IND(_inst,_mBuf, _event) rgLMMTrcInd(_inst,_mBuf, _event) - /* Note: Any changes to these enums should reflect to */ /** @details Enums for special argument * @@ -718,7 +666,7 @@ typedef enum { \ if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL0) \ { \ - ssDiagFix(_tknId, _splArgEnum, ENTRG, rgCb[_inst].rgInit.inst, SS_DIAG_LVL0, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ + ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL0, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ } \ } @@ -729,7 +677,7 @@ typedef enum { \ if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL1) \ { \ - ssDiagFix(_tknId, _splArgEnum, ENTRG, rgCb[_inst].rgInit.inst, SS_DIAG_LVL1, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ + ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL1, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ } \ } @@ -740,7 +688,7 @@ typedef enum { \ if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL2) \ { \ - ssDiagFix(_tknId, _splArgEnum, ENTRG, rgCb[_inst].rgInit.inst, SS_DIAG_LVL2, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ + ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL2, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ } \ } @@ -751,7 +699,7 @@ typedef enum { \ if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL3) \ { \ - ssDiagFix(_tknId, _splArgEnum, ENTRG, rgCb[_inst].rgInit.inst, SS_DIAG_LVL3, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ + ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL3, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ } \ } @@ -762,7 +710,7 @@ typedef enum { \ if(rgCb[_inst].rgInit.logMask & SS_DIAG_LVL4) \ { \ - ssDiagFix(_tknId, _splArgEnum, ENTRG, rgCb[_inst].rgInit.inst, SS_DIAG_LVL4, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ + ssDiagFix(_tknId, _splArgEnum, ENTMAC, rgCb[_inst].rgInit.inst, SS_DIAG_LVL4, SS_DIAG_MSG_TYPE_FIXED, _splArg, _arg1, _arg2, _arg3, _arg4, _string);\ } \ } @@ -800,7 +748,6 @@ typedef enum { \ } #endif -#define DEFAULT_CELLS 1 #endif /* __RGH__ */ /**********************************************************************