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