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
34 #define EVENT_CU_DATA 2
35 #define EVENT_SCTP_NTFY 3
36 #define EVTSRVOPENREQ 4
37 #define EVTSRVOPENCFM 5
38 #define EVTTNLMGMTREQ 6
39 #define EVTTNLMGMTCFM 7
41 #define EVTSTARTPOLL 9
42 #define EVENT_RIC_DATA 10
44 /* allocate and zero out a static buffer */
45 #define DU_ALLOC(_datPtr, _size) \
48 _ret = SGetSBuf(DU_APP_MEM_REGION, DU_POOL, \
49 (Data **)&_datPtr, _size); \
51 memset(_datPtr, 0, _size); \
56 /* free a static buffer */
57 #define DU_FREE(_datPtr, _size) \
59 SPutSBuf(DU_APP_MEM_REGION, DU_POOL, \
60 (Data *)_datPtr, _size);
62 /* Allocate shared memory to be used for LWLC
63 * during inter-layer communication */
64 #define DU_ALLOC_SHRABL_BUF(_buf, _size) \
66 if(SGetStaticBuffer(DU_APP_MEM_REGION, DU_POOL, \
67 (Data **)&_buf, (Size) _size, 0) == ROK) \
69 memset((_buf), 0, _size); \
77 /* Free shared memory, received through LWLC */
78 #define DU_FREE_SHRABL_BUF(_region, _pool,_buf, _size) \
82 (Void) SPutStaticBuffer(_region, _pool, \
83 (Data *) _buf, (Size) _size, 0); \
88 /* Fill Pst structure for sending msg from DU APP to MAC */
89 #define FILL_PST_DUAPP_TO_MAC(_pst, _event) \
91 _pst.selector = ODU_SELECTOR_LWLC; \
92 _pst.srcEnt = ENTDUAPP; \
93 _pst.dstEnt = ENTMAC; \
96 _pst.dstProcId = DU_PROC; \
97 _pst.srcProcId = DU_PROC; \
98 _pst.region = DU_APP_MEM_REGION; \
99 _pst.pool = DU_POOL; \
100 _pst.event = _event; \
106 /* Fill Pst structure for sending msg from DU_APP to RLC */
107 #define FILL_PST_DUAPP_TO_RLC(_pst, _dstInst, _event) \
109 _pst.selector = ODU_SELECTOR_LWLC; \
110 _pst.srcEnt = ENTDUAPP; \
111 _pst.dstEnt = ENTRLC; \
112 _pst.dstInst = _dstInst; \
113 _pst.srcInst = DU_INST; \
114 _pst.dstProcId = DU_PROC; \
115 _pst.srcProcId = DU_PROC; \
116 _pst.region = DU_APP_MEM_REGION; \
117 _pst.pool = DU_POOL; \
118 _pst.event = _event; \
124 /**********************************************************************
126 **********************************************************************/