RLC BO, BO response and DL Data handling. [Issue-ID: ODUHIGH-181]
[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 #define PDCP_SN 1
29
30 /* Fill Pst structure for sending msg from RLC to DUAPP */
31 #define FILL_PST_RLC_TO_DUAPP(_pst, _srcInst, _event) \
32 {                                                              \
33    _pst.selector    = ODU_SELECTOR_LWLC;                       \
34    _pst.srcEnt      = ENTRLC;                                  \
35    _pst.dstEnt      = ENTDUAPP;                                \
36    _pst.dstInst     = 0;                                       \
37    _pst.srcInst     = _srcInst;                                \
38    _pst.dstProcId   = ODU_GET_PROCID();                        \
39    _pst.srcProcId   = ODU_GET_PROCID();                        \
40    if(_srcInst == RLC_UL_INST)                                 \
41    {                                                           \
42       _pst.region   = RLC_MEM_REGION_UL;                       \
43    }                                                           \
44    else if(_srcInst == RLC_DL_INST)                            \
45    {                                                           \
46       _pst.region   = RLC_MEM_REGION_DL;                       \
47    }                                                           \
48    _pst.pool        = RLC_POOL;                                \
49    _pst.event       = _event;                                  \
50    _pst.route       = 0;                                       \
51    _pst.prior       = 0;                                       \
52    _pst.intfVer     = 0;                                       \
53 }
54
55 #define FILL_PST_RLC_TO_MAC(_pst, _srcInst, _event)    \
56 {                                                      \
57    pst.selector  = ODU_SELECTOR_LWLC;                  \
58    pst.srcEnt    = ENTRLC;                             \
59    pst.dstEnt    = ENTMAC;                             \
60    pst.dstInst   = 0;                                  \
61    pst.srcInst   = _srcInst;                           \
62    pst.dstProcId = ODU_GET_PROCID();                   \
63    pst.srcProcId = ODU_GET_PROCID();                   \
64    if(_srcInst == RLC_UL_INST)                         \
65    {                                                   \
66       pst.region    = RLC_MEM_REGION_UL;               \
67    }                                                   \
68    else if(_srcInst == RLC_DL_INST)                    \
69    {                                                   \
70       pst.region    = RLC_MEM_REGION_DL;               \
71    }                                                   \
72    pst.pool      = RLC_POOL;                           \
73    pst.event     = _event;                             \
74    pst.route     = 0;                                  \
75    pst.prior     = 0;                                  \
76    pst.intfVer   = 0;                                  \
77 }
78
79 uint16_t getTransId();
80
81 /**********************************************************************
82          End of file
83 **********************************************************************/