Committing in PDCP code
[o-du/l2.git] / src / cm / cpj.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 /********************************************************************20**
20   
21         Name:    LTE PDCP Interface  
22     
23         Type:    C include file
24   
25         Desc:    This file contains the defines required by PDCP user
26  
27         File:    cpj.h
28   
29 *********************************************************************21*/
30 #ifndef __CPJ_H__
31 #define __CPJ_H__
32
33 #ifdef __cplusplus
34 EXTERN "C" {
35 #endif  /*for extern "C"*/
36
37 /**
38  * @file 
39  * @brief Macro for CPJ Interface 
40  */
41
42 #define CPJ_SEL_LC           0   /* CPJ loose couple selector */
43
44 #define CPJ_7BIT_SN_SIZE     7               /*!< Sequence length is 7-bit */
45 #define CPJ_12BIT_SN_SIZE    12              /*!< Sequence length is 12-bit */
46 #define CPJ_MAX_CFG    10                    /*!< Maximum PDCP entity to be configured */ 
47 #define CPJ_MAX_DRB    12                    /*!< Maximum DRBs per UE */
48
49 /* CPJ Configuration Failure Reasons */
50 #define CPJ_CFG_REAS_NONE                  0  /*!< No Failure */
51 #define CPJ_CFG_REAS_ENT_CREAT_FAIL        1  /*!< PDCP Entity Creation Failure*/
52 #define CPJ_CFG_REAS_UE_CREAT_FAIL         2  /*!< UE CB Creation Failure */
53 #define CPJ_CFG_REAS_INVALID_PDCPID        3  /*!< Invalid PDCP ID */
54 #define CPJ_CFG_REAS_PDCPID_PRSNT          4  /*!< PDCP ID already present */
55 #define CPJ_CFG_REAS_INVALID_RLCMODE       5  /*!< Invalid RLC Mode */
56 #define CPJ_CFG_REAS_PDCPID_UNKWN          6  /*!< PDCP ID Unknown */
57 #define CPJ_CFG_REAS_UE_UNKWN              7  /*!< UE Cb Unknown */
58 #define CPJ_CFG_REAS_CIPHER_ALGO_INVALID   8  /*!< Invalid Cipher Algo */
59 #define CPJ_CFG_REAS_ENT_DEL_FAIL          9  /*!< PDCP Entity Deletion Failure */
60 #define CPJ_CFG_REAS_UE_DEL_FAIL           10 /*!< UE Cb Deletion Failure */
61 #define CPJ_CFG_REAS_REEST_FAIL            11 /*!< PDCP Reestablish Failure */
62 #define CPJ_CFG_REAS_COMP_ALGO_INVALID     12 /*!< Compression Algo not
63                                                supported */
64 #define CPJ_CFG_REAS_RECFG_FAIL            13 /*!< PDCP Reconfiguration Failed */
65 #define CPJ_CFG_REAS_INVALID_CFG           14 /*!< Invalid Configuration Type */
66 #define CPJ_CFG_REAS_SAME_UEID             15 /*!< UE IDs match in ChngUeId 
67                                                    Request*/
68 #define CPJ_CFG_REAS_SAME_RBID             16 /*!< UE IDs match in ChngUeId 
69                                                    Request */
70 #define CPJ_CFG_REAS_INVALID_RBID          17 /*!< Invalid RB ID */
71
72 #define  CPJ_CFG_REAS_INTINIT_FAILED      18 /*!< Integrity Init Failed */
73 #define  CPJ_CFG_REAS_CCIPHR_FAILED       19 /*!< Control Plane Cihper Init Failed */
74 #define  CPJ_CFG_REAS_UCIPHR_FAILED       20 /*!< User Plane Cipher Init Failed */
75
76 #define  CPJ_CFG_REAS_NO_DRBS             21 /*!< No DRBs Present */
77 #define  CPJ_CFG_REAS_OBD_TIMEOUT         22 /*!< No DRBs Present */
78 #define  CPJ_CFG_REAS_INVALID_STATE       23 /*!< Invalid state to perform re-establishment */
79
80 #define CPJ_CFG_TRANSID_SIZE               9 /*!< Macro for Transaction ID size */
81
82 /* CPJ Configuration confirmations */
83 #define CPJ_CFG_CFM_OK                      1 /*!< Confirm status OK */
84 #define CPJ_CFG_CFM_NOK                     2 /*!< Confirm status NOK */
85    
86 /*Event Code*/
87 #define CPJ_EVC_RESET_FAILED                1 /*!< Reset Failed */ 
88
89 #define EVTCPJBNDREQ         0x20            /*!< Bind Request */
90 #define EVTCPJBNDCFM         0x21            /*!< Bind Confirmation */ 
91 #define EVTCPJUBNDREQ        0x22            /*!< Unbind Request */
92 #define EVTCPJCFGREQ         0x23            /*!< Config Request */
93 #define EVTCPJCFGCFM         0x24            /*!< Config Confirmation */
94 #define EVTCPJUEIDCHGREQ     0x25            /*!< UE ID Change Request */ 
95 #define EVTCPJUEIDCHGCFM     0x26            /*!< UE ID Change Confirmation */
96 #define EVTCPJSECCFGREQ      0x27            /*!< Security Config Request */
97 #define EVTCPJSECCFGCFM      0x28            /*!< Security Config Confirm */
98 #define EVTCPJREESTREQ       0x29            /*!< Count C Request */
99 #define EVTCPJREESTCFM       0x2A            /*!< Count C Confirm */
100 #define EVTCPJCOUNTREQ       0x2B            /*!< Count C Request */
101 #define EVTCPJCOUNTCFM       0x2C            /*!< Count C Confirm */
102 #define EVTCPJSDUSTAREQ      0x2D            /*!< SDU Status Request */
103 #define EVTCPJSDUSTACFM      0x2E            /*!< SDU Status Confirm */
104 #define EVTCPJKDFREQ         0x2F            /*!< Key derivation primitive
105                                                   request event*/
106 #define EVTCPJKDFCFM         0x30            /*!< Configuration Confirm
107                                                   event*/
108 #define EVTCPJSTARTDATAFWDREQ      0x31            /*!< Data Forward Request */
109 #define EVTCPJDATRESUMEREQ      0x32            /*!< Data Resume Request */
110 #define EVTCPJDATRESUMECFM      0x33            /*!< Data Resume Confirm */
111
112 #define CPJ_CIPHER_KEY_LEN       16          /*!< Ciphering key length */
113 #define CPJ_INTG_KEY_LEN         16          /*!< Integrity key length */
114 #define CPJ_MAX_ROHC_PROF_LIST   9           /*!< ROHC profile list */
115 #define CPJ_MAX_CFM              10          /*!< Maximum number of confirm */ 
116
117 #define CPJ_CFG_ADD            0x01          /*!< Configure new PDCP entity
118                                                in the requested UE */
119 #define CPJ_CFG_MODIFY         0x02          /*!< Reconfigure PDCP entity
120                                                in the requested UE */
121 #define CPJ_CFG_DELETE         0x03          /*!< Delete PDCP entity
122                                                in the requested UE */
123 #define CPJ_CFG_REESTABLISH    0x04          /*!< Reestablish PDCP entity
124                                                in the requested UE */
125 #define CPJ_CFG_DELETE_UE      0x05          /*!< Delete UE in PDCP */
126
127
128 #define CPJ_SEC_INTG_INFO      0x01          /*!< Integrity information */
129 #define CPJ_SEC_CIPHER_INFO    0x02          /*!< Ciphering information */
130
131 #ifdef CPJ_V2
132 #define CPJ_SEC_ALG_NULL       0x00          /*!< NULL algorithm */
133 #define CPJ_SEC_ALG_SNOW3G     0x01          /*!< Snow 3G algorithm */
134 #define CPJ_SEC_ALG_AES        0x02          /*!< AES algorithm */
135 #define CPJ_SEC_ALG_ZUC        0x03          /*!< ZUC algorithm */
136 #else
137 #define CPJ_SEC_ALG_NULL       0x01          /*!< NULL algorithm */
138 #define CPJ_SEC_ALG_SNOW3G     0x02          /*!< Snow 3G algorithm */
139 #define CPJ_SEC_ALG_AES        0x03          /*!< AES algorithm */
140 #define CPJ_SEC_ALG_ZUC        0x04          /*!< ZUC algorithm */
141 #endif
142
143
144 /* Defines which is used in ModCfg to set the bitflag */
145 #define CPJ_RECFG_DISRQD  0x01               /*!< Discard Required is present*/
146 #define CPJ_RECFG_CFMREQ  0x02               /*!< Confirm Required is present */
147 #define CPJ_RECFG_REORDTMR  0x04             /*!< t-Reorder reconfiguration is present */
148
149 /* Flags will be used to fill the Hand off information */
150 #define CPJ_HO_NOT_PRSNT  0       /*!< Hand of Info is not present */
151 #define CPJ_HO_UL         1       /*!< Uplink count present */
152 #define CPJ_HO_DL         2       /*!< Downlink count present */
153
154
155 #define CPJ_KDF_TYPE1     0       /*!< eNodeB key type for for deriving eNodeB*
156                                        Key(Horizontal key derivation 
157                                        ref: ts 33.401)*/ 
158 #define CPJ_KDF_TYPE2     1       /*!< eNodeB key type for for deriving AS
159                                        security keys */
160 #define CPJ_KDF_TYPE3     2       /*!< NH key type for for deriving eNodeB* Key
161                                        (Verticall key derivation
162                                        ref: ts 33.401) */
163
164 #define CPJ_SEC_KEY_LEN   32      /*!< size of the security keys*/
165
166 /* cpj_h_001.main_2 added support for L2 Measurement */   
167 #ifdef LTE_L2_MEAS
168 #define CPJ_MAX_QCI           10
169 #endif
170
171 /* Error Codes */
172 #define ECPJXXX              0   
173 #define ERRCPJ               0
174
175 #define ECPJ001         (ERRCPJ + 1)
176 #define ECPJ002         (ERRCPJ + 2)
177 #define ECPJ003         (ERRCPJ + 3)
178 #define ECPJ004         (ERRCPJ + 4)
179 #define ECPJ005         (ERRCPJ + 5)
180 #define ECPJ006         (ERRCPJ + 6)
181 #define ECPJ007         (ERRCPJ + 7)
182 #define ECPJ008         (ERRCPJ + 8)
183 #define ECPJ009         (ERRCPJ + 9)
184 #define ECPJ010         (ERRCPJ + 10)
185 #define ECPJ011         (ERRCPJ + 11)
186 #define ECPJ012         (ERRCPJ + 12)
187 #define ECPJ013         (ERRCPJ + 13)
188 #define ECPJ014         (ERRCPJ + 14)
189 #define ECPJ015         (ERRCPJ + 15)
190 #define ECPJ016         (ERRCPJ + 16)
191 #define ECPJ017         (ERRCPJ + 17)
192 #define ECPJ018         (ERRCPJ + 18)
193 #define ECPJ019         (ERRCPJ + 19)
194 #define ECPJ020         (ERRCPJ + 20)
195 #define ECPJ021         (ERRCPJ + 21)
196 #define ECPJ022         (ERRCPJ + 22)
197 #define ECPJ023         (ERRCPJ + 23)
198 #define ECPJ024         (ERRCPJ + 24)
199 #define ECPJ025         (ERRCPJ + 25)
200 #define ECPJ026         (ERRCPJ + 26)
201 #define ECPJ027         (ERRCPJ + 27)
202 #define ECPJ028         (ERRCPJ + 28)
203 #define ECPJ029         (ERRCPJ + 29)
204 #define ECPJ030         (ERRCPJ + 30)
205 #define ECPJ031         (ERRCPJ + 31)
206 #define ECPJ032         (ERRCPJ + 32)
207 #define ECPJ033         (ERRCPJ + 33)
208 #define ECPJ034         (ERRCPJ + 34)
209 #define ECPJ035         (ERRCPJ + 35)
210 #define ECPJ036         (ERRCPJ + 36)
211 #define ECPJ037         (ERRCPJ + 37)
212 #define ECPJ038         (ERRCPJ + 38)
213 #define ECPJ039         (ERRCPJ + 39)
214 #define ECPJ040         (ERRCPJ + 40)
215 #define ECPJ041         (ERRCPJ + 41)
216 #define ECPJ042         (ERRCPJ + 42)
217 #define ECPJ043         (ERRCPJ + 43)
218 #define ECPJ044         (ERRCPJ + 44)
219 #define ECPJ045         (ERRCPJ + 45)
220 #define ECPJ046         (ERRCPJ + 46)
221 #define ECPJ047         (ERRCPJ + 47)
222 #define ECPJ048         (ERRCPJ + 48)
223 #define ECPJ049         (ERRCPJ + 49)
224 #define ECPJ050         (ERRCPJ + 50)
225 #define ECPJ051         (ERRCPJ + 51)
226 #define ECPJ052         (ERRCPJ + 52)
227 #define ECPJ053         (ERRCPJ + 53)
228 #define ECPJ054         (ERRCPJ + 54)
229 #define ECPJ055         (ERRCPJ + 55)
230 #define ECPJ056         (ERRCPJ + 56)
231 #define ECPJ057         (ERRCPJ + 57)
232 #define ECPJ058         (ERRCPJ + 58)
233 #define ECPJ059         (ERRCPJ + 59)
234 #define ECPJ060         (ERRCPJ + 60)
235 #define ECPJ061         (ERRCPJ + 61)
236 #define ECPJ062         (ERRCPJ + 62)
237 #define ECPJ063         (ERRCPJ + 63)
238 #define ECPJ064         (ERRCPJ + 64)
239 #define ECPJ065         (ERRCPJ + 65)
240 #define ECPJ066         (ERRCPJ + 66)
241 #define ECPJ067         (ERRCPJ + 67)
242 #define ECPJ068         (ERRCPJ + 68)
243 #define ECPJ069         (ERRCPJ + 69)
244 #define ECPJ070         (ERRCPJ + 70)
245 #define ECPJ071         (ERRCPJ + 71)
246 #define ECPJ072         (ERRCPJ + 72)
247 #define ECPJ073         (ERRCPJ + 73)
248 #define ECPJ074         (ERRCPJ + 74)
249 #define ECPJ075         (ERRCPJ + 75)
250 #define ECPJ076         (ERRCPJ + 76)
251 #define ECPJ077         (ERRCPJ + 77)
252 #define ECPJ078         (ERRCPJ + 78)
253 #define ECPJ079         (ERRCPJ + 79)
254 #define ECPJ080         (ERRCPJ + 80)
255 #define ECPJ081         (ERRCPJ + 81)
256 #define ECPJ082         (ERRCPJ + 82)
257 #define ECPJ083         (ERRCPJ + 83)
258 #define ECPJ084         (ERRCPJ + 84)
259 #define ECPJ085         (ERRCPJ + 85)
260 #define ECPJ086         (ERRCPJ + 86)
261 #define ECPJ087         (ERRCPJ + 87)
262 #define ECPJ088         (ERRCPJ + 88)
263 #define ECPJ089         (ERRCPJ + 89)
264 #define ECPJ090         (ERRCPJ + 90)
265 #define ECPJ091         (ERRCPJ + 91)
266 #define ECPJ092         (ERRCPJ + 92)
267 #define ECPJ093         (ERRCPJ + 93)
268 #define ECPJ094         (ERRCPJ + 94)
269 #define ECPJ095         (ERRCPJ + 95)
270 #define ECPJ096         (ERRCPJ + 96)
271 #define ECPJ097         (ERRCPJ + 97)
272 #define ECPJ098         (ERRCPJ + 98)
273 #define ECPJ099         (ERRCPJ + 99)
274 #define ECPJ100         (ERRCPJ + 100)
275 #define ECPJ101         (ERRCPJ + 101)
276 #define ECPJ102         (ERRCPJ + 102)
277 #define ECPJ103         (ERRCPJ + 103)
278 #define ECPJ104         (ERRCPJ + 104)
279 #define ECPJ105         (ERRCPJ + 105)
280 #define ECPJ106         (ERRCPJ + 106)
281 #define ECPJ107         (ERRCPJ + 107)
282 #define ECPJ108         (ERRCPJ + 108)
283 #define ECPJ109         (ERRCPJ + 109)
284 #define ECPJ110         (ERRCPJ + 110)
285 #define ECPJ111         (ERRCPJ + 111)
286 #define ECPJ112         (ERRCPJ + 112)
287 #define ECPJ113         (ERRCPJ + 113)
288 #define ECPJ114         (ERRCPJ + 114)
289 #define ECPJ115         (ERRCPJ + 115)
290 #define ECPJ116         (ERRCPJ + 116)
291 #define ECPJ117         (ERRCPJ + 117)
292 #define ECPJ118         (ERRCPJ + 118)
293 #define ECPJ119         (ERRCPJ + 119)
294 #define ECPJ120         (ERRCPJ + 120)
295 #define ECPJ121         (ERRCPJ + 121)
296 #define ECPJ122         (ERRCPJ + 122)
297
298
299 #ifdef __cplusplus
300 }
301 #endif /* __cplusplus */
302 #endif /* __CPJ_H__ */
303
304 /********************************************************************30**
305   
306          End of file
307 **********************************************************************/