DL RRC Message Transfer from DU APP to RLC [Issue-ID: ODUHIGH-45]
[o-du/l2.git] / src / 5gnrrlc / rlc_utils.h
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
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                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
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 *******************************************************************************/
18
19 /* Memory */
20 #define RLC_MEM_REGION_UL    1
21 #define RLC_MEM_REGION_DL    4
22 #define RLC_POOL 1
23
24 /* Inst */
25 #define RLC_UL_INST   0
26 #define RLC_DL_INST   1
27
28 /* Fill Pst structure for sending msg from RLC to DUAPP */
29 #define FILL_PST_RLC_TO_DUAPP(_pst, _procId, _srcInst, _event) \
30 {                                                              \
31    _pst.selector    = ODU_SELECTOR_LWLC;                       \
32    _pst.srcEnt      = ENTRLC;                                   \
33    _pst.dstEnt      = ENTDUAPP;                                \
34    _pst.dstInst     = 0;                                       \
35    _pst.srcInst     = _srcInst;                                \
36    _pst.dstProcId   = _procId;                                 \
37    _pst.srcProcId   = _procId;                                 \
38    if(_srcInst == RLC_UL_INST)                                 \
39    {                                                           \
40       _pst.region   = RLC_MEM_REGION_UL;                       \
41    }                                                           \
42    else if(_srcInst == RLC_DL_INST)                            \
43    {                                                           \
44       _pst.region   = RLC_MEM_REGION_DL;                       \
45    }                                                           \
46    _pst.pool        = RLC_POOL;                                \
47    _pst.event       = _event;                                  \
48    _pst.route       = 0;                                       \
49    _pst.prior       = 0;                                       \
50    _pst.intfVer     = 0;                                       \
51 }
52
53 void reverseFixBuf(uint8_t *buf, uint16_t len);
54 uint16_t getTransId();
55
56 /**********************************************************************
57          End of file
58 **********************************************************************/