Release A code commit
[o-du/l2.git] / src / du_app / du_mgr.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 /* This file contains message handling functionality for DU cell management */
20 #ifndef __DU_MGR_H__
21 #define __DU_MGR_H__
22
23 #include "stdio.h"
24 #include "ctype.h"
25 #include "envopt.h"        /* Environment options */
26 #include "envdep.h"        /* Environment dependent */
27 #include "envind.h"        /* Environment independent */
28 #include "gen.h"           /* General */
29 #include "ssi.h"           /* System services */
30 #include "cm5.h"           /* Common timer defines */
31 #include "cm_tkns.h"       /* Common tokens defines */
32 #include "cm_mblk.h"       /* Common memory allocation library defines */
33 #include "cm_llist.h"      /* Common link list  defines  */
34 #include "cm_hash.h"       /* Common hashlist  defines */
35 #include "cm_lte.h"
36 #include "cm_inet.h"
37 #include "lkw.h"
38 #include "lrg.h"
39
40 #include "du_common.h"
41
42 #include "gen.x"           /* General */
43 #include "ssi.x"           /* System services */
44
45 #include "cm5.x"           /* Common timer library */
46 #include "cm_tkns.x"       /* Common tokens */
47 #include "cm_mblk.x"       /* Common memory allocation */
48 #include "cm_llist.x"      /* Common link list */
49 #include "cm_hash.x"       /* Common hashlist */
50 #include "cm_lte.x"
51 #include "cm_inet.x"
52 #include "cm_lib.x"
53 #include "lkw.x"
54 #include "lrg.x"
55
56 #define DU_PROC  0
57 /* Memory related configs */
58 #define DU_APP_MEM_REGION    1
59 #define RLC_UL_MEM_REGION     1
60 #define RLC_DL_MEM_REGION     4
61 #define RG_MEM_REGION     4
62
63 #define DU_POOL  1
64 #define RLC_POOL  1
65 #define RG_POOL 1
66
67 /* Events */
68 #define EVTCFG 0
69 #define EVTSCTPSTRT 1
70 #define EVTSCTPDATA 2
71 #define EVTSCTPNTFY 3
72
73 /* Selector */
74 #define DU_SELECTOR_LC   0
75 #define DU_SELECTOR_TC   1
76 #define DU_SELECTOR_LWLC 2
77
78 /* SAP IDs */
79 #define DU_RG_SUID 0
80 #define DU_RG_SPID 0
81
82 /* Instance */
83 #define RLC_UL_INST 0
84 #define RLC_DL_INST 1
85
86 #define DU_ZERO_VAL 0
87
88 /* Macros */
89 #define DEFAULT_CELLS    1
90
91 #define RLC_GEN_CFG      1
92 #define RLC_MAC_SAP_CFG  2
93 #define RLC_UDX_SAP_CFG  4
94
95 #define MAC_GEN_CFG   1
96 #define MAC_SAP_CFG   2
97 #define MAX_MAC_SAP   2
98
99 #define DU_RLC_UL_CONFIGURED  (RLC_GEN_CFG |  \
100       RLC_MAC_SAP_CFG | RLC_UDX_SAP_CFG)
101 #define DU_RLC_DL_CONFIGURED DU_RLC_UL_CONFIGURED
102
103 #define MAC_CONFIGURED (MAC_GEN_CFG | MAC_SAP_CFG)
104
105 #define DU_SET_ZERO(_buf, _size)   \
106    cmMemset((U8 *)(_buf), 0, _size);
107
108
109 /* DU APP DB */
110 typedef struct duCb
111 {
112    Mem      mem;
113    TskInit  init;
114    Bool     sctpStatus;
115    Bool     f1Status;
116    Bool     duStatus;
117
118 }DuCb;
119
120 typedef struct duLSapCfg
121 {
122    SuId        suId;
123    SpId        spId;
124    Ent         srcEnt;
125    Inst        srcInst;
126    ProcId      dstProcId;
127    Ent         dstEnt;
128    Inst        dstInst;
129    Priority    dstPrior;
130    Route       dstRoute;
131    Selector    dstSel;
132    Mem         mem;
133    U8          maxBndRetry;
134    TmrCfg      bndTmr;
135    TmrCfg      connTmr;
136 }DuLSapCfg;
137
138 /* global variables */
139 DuCb duCb;
140 DuCfgParams duCfgParam;
141
142 /* DU Cell Functions */
143 S16 duActvInit(Ent entity, Inst inst, Region region, Reason reason);
144 S16 duActvTsk(Pst *pst, Buffer *mBuf);
145 S16 duSendRlcUlCfg();
146 S16 duSendRlcDlCfg();
147 S16 duBuildRlcCfg(Inst inst);
148 S16 duBuildRlcLsapCfg(Ent ent, Inst inst, U8 lsapInst);
149 S16 duBuildRlcUsapCfg(U8 elemId, Ent ent, Inst inst);
150 S16 duHdlRlcCfgComplete(Pst *pst, KwMngmt *cfm);
151 S16 duHdlRlcCntrlCfgComplete(Pst *pst, KwMngmt *cfm);
152 S16 duProcRlcUlCfgComplete(Pst *pst, KwMngmt *cfm);
153 S16 duProcRlcDlCfgComplete(Pst *pst, KwMngmt *cfm);
154 S16 duSendMacCfg();
155 S16 duBuildMacGenCfg();
156 S16 duBuildMacUsapCfg(SpId sapId);
157 S16 duHdlMacCfgComplete(Pst *pst, RgMngmt *cfm);
158 S16 duBindUnbindRlcToMacSap(U8 inst, U8 action);
159 S16 duSctpStartReq();
160 S16 duSctpNtfyHdl(Buffer *mBuf, CmInetSctpNotification *ntfy);
161 #endif
162
163 /**********************************************************************
164          End of file
165 **********************************************************************/