1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2017-2019] [Radisys] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /* Utility definitions to be used in du app */
21 /* Memory related configs */
22 #define DU_APP_MEM_REGION 0
23 #define RLC_UL_MEM_REGION 1
24 #define RLC_DL_MEM_REGION 4
25 #define MAC_MEM_REGION 4
30 #define MAX_SLIV_CONFIG_IDX 105
35 #define EVENT_CU_DATA 2
36 #define EVENT_SCTP_NTFY 3
37 #define EVTSRVOPENREQ 4
38 #define EVTSRVOPENCFM 5
39 #define EVTTNLMGMTREQ 6
40 #define EVTTNLMGMTCFM 7
42 #define EVTSTARTPOLL 9
43 #define EVENT_RIC_DATA 10
45 /* allocate and zero out a static buffer */
47 #ifdef ODU_MEMORY_DEBUG_LOG
48 #define DU_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\
50 printf("\n%s=== %s +%d, %s, %lu, %p", \
51 _macro, _file, _line, _func, (uint64_t)_size, _datPtr); \
54 #define DU_MEM_LOG(_macro, _file, _line, _func, _size, _dataPtr) {\
58 #define DU_ALLOC(_datPtr, _size) \
61 _ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, \
62 (Data **)&_datPtr, _size); \
65 DU_MEM_LOG("DU_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
66 memset(_datPtr, 0, _size); \
72 /* free a static buffer */
73 #define DU_FREE(_datPtr, _size) \
75 if(_datPtr != NULLP) \
77 DU_MEM_LOG("DU_FREE", __FILE__, __LINE__, __FUNCTION__, _size, _datPtr);\
78 SPutSBuf(DU_APP_MEM_REGION, DU_POOL, \
79 (Data *)_datPtr, _size); \
83 /* Allocate shared memory to be used for LWLC
84 * during inter-layer communication */
85 #define DU_ALLOC_SHRABL_BUF(_buf, _size) \
87 if(SGetStaticBuffer(DU_APP_MEM_REGION, DU_POOL, \
88 (Data **)&_buf, (Size) _size, 0) == ROK) \
90 DU_MEM_LOG("DU_ALLOC_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
91 memset((_buf), 0, _size); \
99 /* Free shared memory, received through LWLC */
100 #define DU_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
104 DU_MEM_LOG("DU_FREE_SHRABL_BUF", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\
105 (Void) SPutStaticBuffer(_region, _pool, \
106 (Data *) _buf, (Size) _size, 0); \
111 /* Fill Pst structure for sending msg from DU APP to MAC */
112 #define FILL_PST_DUAPP_TO_MAC(_pst, _event) \
114 _pst.selector = ODU_SELECTOR_LWLC; \
115 _pst.srcEnt = ENTDUAPP; \
116 _pst.dstEnt = ENTMAC; \
119 _pst.dstProcId = DU_PROC; \
120 _pst.srcProcId = DU_PROC; \
121 _pst.region = DU_APP_MEM_REGION; \
122 _pst.pool = DU_POOL; \
123 _pst.event = _event; \
129 /* Fill Pst structure for sending msg from DU_APP to RLC */
130 #define FILL_PST_DUAPP_TO_RLC(_pst, _dstInst, _event) \
132 _pst.selector = ODU_SELECTOR_LWLC; \
133 _pst.srcEnt = ENTDUAPP; \
134 _pst.dstEnt = ENTRLC; \
135 _pst.dstInst = _dstInst; \
136 _pst.srcInst = DU_INST; \
137 _pst.dstProcId = DU_PROC; \
138 _pst.srcProcId = DU_PROC; \
139 _pst.region = DU_APP_MEM_REGION; \
140 _pst.pool = DU_POOL; \
141 _pst.event = _event; \
148 void fillStartSymbolAndLen(uint8_t numRsrcAlloc, PdschConfig *pdschCfg, PuschCfg *puschCfg);
149 uint8_t duAddNodeToLList(CmLListCp *llist, void *blockToAdd, CmLList *currNode);
150 uint8_t duDelNodeFromLList(CmLListCp *llist, CmLList *node);
152 DuPagUeRecord* handlePageUeLL(uint16_t pagUeId, uint64_t sTmsi, CmLListCp *pageUeLL, ActionTypeLL action);
153 DuPagUeList* handlePageInfoLL(uint16_t pf, uint8_t i_s, CmLListCp *pagInfoLL, ActionTypeLL action);
154 DuPagInfoList* findPagingInfoFromMap(uint16_t pf, CmHashListCp *pagingInfoMap);
156 void printPageList(CmHashListCp *pagingInfoMap);
159 /**********************************************************************
161 **********************************************************************/