X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Fkw.h;h=f23f1deb95425f7c0f46c600b13518afb7f89b84;hb=d75d1b078091768f45b83f2a745a25917e03b39d;hp=73775d7c814de8ea2f4c1e0a83a135b4b51acf49;hpb=def50dc175cebc67238db5f1acd5ff322a2279bd;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/kw.h b/src/5gnrrlc/kw.h index 73775d7c8..f23f1deb9 100755 --- a/src/5gnrrlc/kw.h +++ b/src/5gnrrlc/kw.h @@ -113,7 +113,7 @@ { \ SPutMsg(_sdu->mBuf); \ cmLListDelFrm(_sduQ,&_sdu->lstEnt); \ - RLC_FREE_WC(_cb,_sdu, sizeof(RlcSdu)); \ + RLC_FREE(_cb,_sdu, sizeof(RlcSdu)); \ } #define RLC_FREE(_cb,_buf, _size) \ @@ -123,12 +123,6 @@ _buf = NULLP; \ } -#define RLC_FREE_BUF(_buf) \ -{ \ - SPutMsg(_buf); \ - _buf = NULLP; \ -} - #else #define RLC_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \ @@ -203,26 +197,8 @@ } \ } -#define RLC_FREE_BUF(_buf) \ -{ \ - if (_buf != NULLP) \ - { \ - SPutMsg(_buf); \ - } \ - _buf = NULLP; \ -} #endif - - - -#define RLC_FREE_WC(_cb,_buf, _size) \ -{ \ - (Void) SPutSBuf(_cb->init.region, _cb->init.pool, \ - (Data *) _buf, (Size) _size); \ - _buf = NULLP; /*assigning NULLP after free*/ \ -} - /* kw002.201 Freeing from region of pst */ #define RLC_PST_FREE(_region, _pool, _buf, _size) \ { \ @@ -290,8 +266,6 @@ } #endif -#define RLC_FREE_BUF_WC(_buf) SPutMsg((_buf)); - #define RLC_MEM_CPY(_dst, _src, _size) memcpy(_dst, _src, _size); #define RLC_MEM_ZERO(_buf, _size) memset((_buf), 0, _size); @@ -353,6 +327,11 @@ #define RLC_TRANS_ID_LST_BKT_SIZE 10 #define RLC_MAX_RB 32 +/* RLC Mode defines */ +#define RLC_MODE_TM 1 +#define RLC_MODE_UM 2 +#define RLC_MODE_AM 3 + /* Direction defines */ #define RLC_DIR_UL 1 /*!< Unlink direction */ #define RLC_DIR_DL 2 /*!< Downlink direction */ @@ -464,14 +443,16 @@ #define RLC_TMR_LEN 10 #define RLC_MAX_UM_TMR 1 #define RLC_MAX_AM_TMR 3 -#define RLC_EVT_UMUL_REORD_TMR 1 -#define RLC_EVT_AMUL_REORD_TMR 2 -#define RLC_EVT_AMUL_STA_PROH_TMR 3 -#define RLC_EVT_AMDL_POLL_RETX_TMR 4 -#define RLC_EVT_WAIT_BNDCFM 5 + +/* Timer events */ +#define EVENT_RLC_UMUL_REASSEMBLE_TMR 1 +#define EVENT_RLC_AMUL_REASSEMBLE_TMR 2 +#define EVENT_RLC_AMUL_STA_PROH_TMR 3 +#define EVENT_RLC_AMDL_POLL_RETX_TMR 4 +#define EVENT_RLC_WAIT_BNDCFM 5 /* kw005.201 added support for L2 Measurement */ #ifdef LTE_L2_MEAS -#define RLC_EVT_L2_TMR 6 +#define EVENT_RLC_L2_TMR 6 #endif /* LTE_L2_MEAS */ /******************************************************************************* @@ -513,9 +494,9 @@ #define RLC_UMUL rbCb->m.umUl /* Sequence Number length defines */ -#define RLC_UM_CFG_5BIT_SN_LEN 1 /**< UM 5-bit Sequence number length +#define RLC_UM_CFG_6BIT_SN_LEN 1 /**< UM 6-bit Sequence number length in bytes*/ -#define RLC_UM_CFG_10BIT_SN_LEN 2 /**< UM 10-bit Sequence number length +#define RLC_UM_CFG_12BIT_SN_LEN 2 /**< UM 12-bit Sequence number length in bytes*/ /* 5GNR */ /* Sequence Number length defines */ @@ -551,8 +532,8 @@ /******************************************************************************* * AMM Defines ******************************************************************************/ -#define AMDL rbCb->m.amDl -#define AMUL rbCb->m.amUl +#define RLC_AMDL rbCb->m.amDl +#define RLC_AMUL rbCb->m.amUl /* PDU Types */ #define RLC_DATA_PDU 1 @@ -566,7 +547,6 @@ #define RLC_POLL_SET 0x40 /* 01000000 */ #define RLC_POLL_UNSET 0xbf /* 10111111 */ -#define RLC_AM_WIN_SZ 512 #define RLC_MAX_NACK_CNT 100 /*RLC_MAX_CNTRL_FIELDS (Maximum size of Status Pdu) * = MAX_NACK_CNT * sizeof(NACK_SN,E1,E2,E3,soStart,soEnd, nackRange) @@ -575,6 +555,7 @@ /* Each LI(Length Indicator) holds approx 1+1/2 byte and some other fields thus keeping Header Size equal to twice of MAX LI */ /* 5GNR_RLC: Need to change value of HDRSZ as per number of PDUs going in one datReq */ +#define RLC_MIN_HDRSZ 1 #define RLC_MAX_HDRSZ 5 #define RLC_AM_PDU_FIXED_HDRSZ 2 #define RLC_AM_PDU_12BIT_SN_HDRSZ 2 @@ -620,10 +601,8 @@ #define RLC_SN_POS_12BIT 0x0F #define RLC_SN_POS_18BIT 0x03 #define RLC_AM_GET_WIN_SZ(_snLen) ((RLC_AM_CFG_12BIT_SN_LEN == (_snLen)) ? (2048) : (131072)) /* 5GNR */ -#define RLC_RCV_BUF_BIN_SIZE 512 /* Could be increased to avoid the search time. - with the memory trade-off */ -#define RLC_TX_BUF_BIN_SIZE 512 /* Could be increased to avoid the search time. - with the memory trade-off */ +#define RLC_RCV_BUF_BIN_SIZE 512 /* receive buffer size */ +#define RLC_TX_BUF_BIN_SIZE 512 /* receive buffer size */ #define RLC_SDU_LST 1 #define RLC_SEG_LST 2 @@ -655,7 +634,6 @@ nod = NULLP; \ } - #define RLC_LLIST_FIRST_RETX(lstCp, nod) \ { \ CmLList *tmpNode; \ @@ -751,18 +729,37 @@ cmLListInsCrnt(&lstCp, nodeToIns); \ } -#define RLC_LLIST_DEL_RECBUF(_recBuf) \ +#define RLC_LLIST_DEL_RECBUF(_recBuf) \ { \ - RlcSeg *_seg = NULLP; \ - RLC_LLIST_FIRST_SEG(_recBuf->segLst, _seg); \ + RlcSeg *_seg = NULLP; \ + RLC_LLIST_FIRST_SEG(_recBuf->segLst, _seg); \ while (_seg) \ { \ cmLListDelFrm(&_recBuf->segLst, &_seg->lstEnt); \ - RLC_FREE(_seg, sizeof(RlcSeg)); \ - RLC_LLIST_NEXT_SEG(_recBuf->segLst, _seg); \ + RLC_FREE(_seg, sizeof(RlcSeg)); \ + RLC_LLIST_NEXT_SEG(_recBuf->segLst, _seg); \ } \ } +#define RLC_UMM_LLIST_FIRST_SEG(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + if((tmpNode=cmLListFirst(&lstCp))) \ + nod = (RlcUmSeg *)tmpNode->node; \ + else \ + nod = NULLP; \ +} /*!< um mode first segment of linked list*/ + +#define RLC_UMM_LLIST_NEXT_SEG(lstCp, nod) \ +{ \ + CmLList *tmpNode; \ + (lstCp).crnt = &((nod)->lstEnt); \ + if((tmpNode = cmLListNext(&lstCp))) \ + nod = (RlcUmSeg *)tmpNode->node; \ + else \ + nod = NULLP; \ +}/*!< next segment in um mode linked list*/ + #define MODAMT(x, y, z,_snModMask) \ { \ y = (x - z) & _snModMask; \ @@ -794,7 +791,7 @@ #endif #define RLC_AM_IS_POLL_BIT_SET(_amDl) \ - (AMDL.pollSn == ((AMDL.txNext - 1) & AMDL.snModMask)) + (RLC_AMDL.pollSn == ((RLC_AMDL.txNext - 1) & RLC_AMDL.snModMask)) #define RLC_FILL_CNTRL_INFO(cntrlInfo, _val, _len, _idx, _eb)\ { \