blob: 341347d92f7f01d618f26d23d8047f9596c54b7c [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2012
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * el2_sap_common.h
41 *
42 * Project:
43 * --------
44 * MOLY
45 *
46 * Description:
47 * ------------
48 * Common header file for all EL2 SAPs.
49 * This file defines the common structures used by all EL2 SAPs.
50 *
51 * Author:
52 * -------
53 * -------
54 *
55 * ==========================================================================
56 * $Log$
57 *
58 * 08 17 2017 steve.kao
59 * [MOLY00271504] [6293][SRLTE Enhancement][EL2][EPDCP] Sync from LR11.MP5
60 * [UMOLYA][TRUNK][EPDCP] SRLTE enhancement.
61 *
62 * 02 06 2017 peter.yu
63 * [MOLY00207733] [MT6293][EL2] ERLCDL development
64 * [M-SIM] Sync R-SIM related interfaces, remove redundant message IDs related to ERLC.
65 *
66 * 09 26 2016 slifer.hsueh
67 * [MOLY00205085] [MT6293][EL2] ERLC source codes integration from DEV to TRUNK
68 * ERLC source codes integration from DEV to TRUNK
69 *
70 * 04 08 2015 katie.tseng
71 * [MOLY00104186] [UMOLY] UMOLY code maintenance.
72 * 1. March 2015 MOLY CR sync on ERLC-DL: (1) VoLTE early RLF (2) log reduction
73 * 2. RLC gtest UT fix: set/reset gERLC_Trap_Msg_EN at setup() and teardown()
74 *
75 * 11 11 2014 yiting.cheng
76 * [MOLY00084042] [UMOLY] merge UMOLY_DEV to UMOLY trunk
77 * .
78 *
79 * 10 27 2014 sh.yang
80 * [MOLY00082211] [MT6291_DEV] EMBMS check-in
81 * embms check-in
82 *
83 * 09 19 2014 chi-chung.lin
84 * [MOLY00073836] [MT6291][ERRC][CHM] LTE-A CHM development code check-in
85 * [CHM] MBMS interface check in
86 *
87 * 07 29 2014 sh.yang
88 * [MOLY00073922] [MT6291_DEV] EMBMS general check-in
89 * .
90 *
91 * 07 28 2014 yiting.cheng
92 * [MOLY00073830] [MT6291_DEV] check-in MT6291 modification
93 * Check-in EMAC-ERRC interface
94 ****************************************************************************/
95
96/// @date 08/10/11
97
98#ifndef _MTK_LTE_EL2_COMMON_SAP_H_
99#define _MTK_LTE_EL2_COMMON_SAP_H_
100
101#include "kal_public_api.h"
102
103/*--------------------------------------------------------------------------
104 * RBID (used RLCUL SAP, RLCDL SAP, and PDCP SAP)
105 *--------------------------------------------------------------------------*/
106
107/// RBID (radio bearer identity)
108typedef enum
109{
110 RBID_SRB0 = 0x00,
111 RBID_SRB1 = 0x01,
112 RBID_SRB2 = 0x02,
113 RBID_DRB1 = 0x10,
114 RBID_DRB2 = 0x11,
115 RBID_DRB3 = 0x12,
116 RBID_DRB4 = 0x13,
117 RBID_DRB5 = 0x14,
118 RBID_DRB6 = 0x15,
119 RBID_DRB7 = 0x16,
120 RBID_DRB8 = 0x17,
121 RBID_DRB9 = 0x18,
122 RBID_DRB10 = 0x19,
123 RBID_DRB11 = 0x1A,
124 RBID_DRB12 = 0x1B,
125 RBID_DRB13 = 0x1C,
126 RBID_DRB14 = 0x1D,
127 RBID_DRB15 = 0x1E,
128 RBID_DRB16 = 0x1F,
129 RBID_DRB17 = 0x20,
130 RBID_DRB18 = 0x21,
131 RBID_DRB19 = 0x22,
132 RBID_DRB20 = 0x23,
133 RBID_DRB21 = 0x24,
134 RBID_DRB22 = 0x25,
135 RBID_DRB23 = 0x26,
136 RBID_DRB24 = 0x27,
137 RBID_DRB25 = 0x28,
138 RBID_DRB26 = 0x29,
139 RBID_DRB27 = 0x2A,
140 RBID_DRB28 = 0x2B,
141 RBID_DRB29 = 0x2C,
142 RBID_DRB30 = 0x2D,
143 RBID_DRB31 = 0x2E,
144 RBID_DRB32 = 0x2F
145
146} errc_el2_rbid_enum;
147
148
149/*--------------------------------------------------------------------------
150 * RRC configuration result (used by all SAPs)
151 *--------------------------------------------------------------------------*/
152
153/// result of RRC configuration
154typedef enum
155{
156 ERRC_EL2_CFG_SUCCESS = 0x00,
157 ERRC_EL2_CFG_PARAM_ERR = 0x10,
158 ERRC_EL2_CFG_STATUS_ERR = 0x20
159
160} errc_el2_cfg_result_enum;
161
162
163/*--------------------------------------------------------------------------
164 * RRC configuration to enter/leave virtual connected state
165 *--------------------------------------------------------------------------*/
166
167/// command to pdcp and rlc
168typedef enum
169{
170 ERRC_EL2_VIRTUAL_CONNECTED_ENTER_PREPARE = 0, // RLC-UL
171 ERRC_EL2_VIRTUAL_CONNECTED_ENTER = 1, // PDCP, RLC-UL, RLC-DL
172 ERRC_EL2_VIRTUAL_CONNECTED_ENTER_END = 2, // PDCP
173 ERRC_EL2_VIRTUAL_CONNECTED_LEAVE_PREPARE = 3, // PDCP
174 ERRC_EL2_VIRTUAL_CONNECTED_LEAVE = 4, // PDCP, RLC-UL, RLC-DL
175 ERRC_EL2_VIRTUAL_CONNECTED_LEAVE_FAIL = 5, // PDCP, RLC-UL, RLC-DL
176 ERRC_EL2_VIRTUAL_CONNECTED_ENTER_PREPARE_FOR_SRLTE = 6, // RLC-UL
177 ERRC_EL2_VIRTUAL_CONNECTED_ENTER_FOR_SRLTE = 7, // PDCP, RLC-UL, RLC-DL
178 ERRC_EL2_VIRTUAL_CONNECTED_ENTER_END_FOR_SRLTE = 8, // PDCP
179 ERRC_EL2_VIRTUAL_CONNECTED_LEAVE_PREPARE_FOR_SRLTE = 9, // PDCP
180 ERRC_EL2_VIRTUAL_CONNECTED_LEAVE_FOR_SRLTE = 10, // PDCP, RLC-UL, RLC-DL
181 ERRC_EL2_VIRTUAL_CONNECTED_LEAVE_FAIL_FOR_SRLTE = 11, // PDCP, RLC-UL, RLC-DL
182 ERRC_EL2_VIRTUAL_CONNECTED_INVALID_CAUSE = 12,
183} errc_el2_switch_virtual_connected_enum;
184
185
186/*--------------------------------------------------------------------------
187 * EL1-EL2 result
188 *--------------------------------------------------------------------------*/
189
190/// result of EL1<->EL2 configuration
191typedef enum
192{
193 EL2_EL1_SUCCESS = 0x00,
194 EL2_EL1_PARAM_ERR = 0x10,
195 EL2_EL1_STATUS_ERR = 0x20
196
197} el2_el1_result_enum;
198
199
200/*--------------------------------------------------------------------------
201 * logical channel configuration (used by EMAC SAP and ERLCUL SAP)
202 *--------------------------------------------------------------------------*/
203
204/// prioritised bit rate (PBR)
205typedef enum
206{
207 PBR_KBPS_0 = 0x00,
208 PBR_KBPS_8 = 0x01,
209 PBR_KBPS_16 = 0x02,
210 PBR_KBPS_32 = 0x03,
211 PBR_KBPS_64 = 0x04,
212 PBR_KBPS_128 = 0x05,
213 PBR_KBPS_256 = 0x06,
214 PBR_KBPS_512 = 0x07,
215 PBR_KBPS_1024= 0x08,
216 PBR_KBPS_2048= 0x09,
217 PBR_KBPS_INF = 0x0a
218} errc_el2_pbr_enum;
219
220
221/// bucket size duration (BSD)
222typedef enum
223{
224 BSD_MS50 = 0x00,
225 BSD_MS100 = 0x01,
226 BSD_MS150 = 0x02,
227 BSD_MS300 = 0x03,
228 BSD_MS500 = 0x04,
229 BSD_MS1000 = 0x05,
230 BSD_INVALID = 0x06
231} errc_el2_bsd_enum;
232
233
234#define INVALID_LCG (0x04)
235
236/// logical channel configuration
237typedef struct
238{
239 kal_uint8 pri; ///< priority
240 errc_el2_pbr_enum pbr; ///< prioritised bit rate (PBR)
241 errc_el2_bsd_enum bsd; ///< bucket size duration (BSD)
242 kal_uint8 lcg; ///< logical channel group (LCG)
243
244} errc_el2_lch_cfg;
245
246
247
248/*--------------------------------------------------------------------------
249 * RB configuration (used by ERLCUL SAP and ERLCDL SAP)
250 *--------------------------------------------------------------------------*/
251
252/// maximum number of RBs in ERLC configured by ERRC
253#define MAX_NUM_RLC_CONFIG_RB (10)
254
255/// maximum number of MRBs in ERLC configured by ERRC
256#define MAX_NUM_RLC_CONFIG_MRB (29)
257
258/// RB configuration mode in ERLCUL and ERLCDL
259typedef enum
260{
261 ERLC_MODE_REL = 0x00,
262 ERLC_MODE_EST = 0x10,
263 ERLC_MODE_REEST = 0x20,
264 ERLC_MODE_RECFG = 0x30,
265 ERLC_MODE_REEST_NO_CFG = 0x40,
266 ERLC_MODE_EST_AND_SUSPEND = 0x50,
267 ERLC_MODE_SUSPEND = 0x60,
268 ERLC_MODE_RESUME = 0x70
269
270} errc_erlc_rb_mode_enum;
271
272
273/// RLC mode
274typedef enum
275{
276 ERLC_AM = 0,
277 ERLC_UM = 1
278
279} errc_erlc_rb_type_enum;
280
281
282/// RLC SN field length
283typedef enum
284{
285 SN_SIZE_5 = 0,
286 SN_SIZE_10 = 1
287
288} errc_erlc_sn_field_len_enum;
289
290/*--------------------------------------------------------------------------
291 * EMBMS configuration
292 *--------------------------------------------------------------------------*/
293#define MAX_EMBMS_MTCH_SUPPORT 8
294#define MAX_EMBMS_MRB_SUPPORT MAX_EMBMS_MTCH_SUPPORT
295#define MAX_EMBMS_MCCH_SUPPORT 8
296#define MAX_AREA_NUM_PER_CELL 8
297#define MAX_MTCH_NUM_PER_PMCH_29 29
298#define MAX_SF_IN_ONE_RF 6
299#define MAX_MBSFN_ALLOCATIONS 8
300#define MAX_PMCH_PER_MBSFN 15
301#define MAX_NUM_MTCH_PER_PMCH 29
302
303
304/*--------------------------------------------------------------------------
305 * radio link failure (RLF) (used by ERLCUL SAP and ERLCDL SAP)
306 *--------------------------------------------------------------------------*/
307
308/// cause of ERRC-ERLC RLF indication
309typedef enum
310{
311 ERLC_UL_MAX_RETX = 0x00, ///< max retransmission for a specific SN (TS36.322)
312 ERLC_DL_MAX_RETX = 0x01 ///< max duplication for a specific SN (MTK proprietary)
313
314} errc_erlc_rlf_enum;
315
316/// additional information about RLF indication
317typedef enum
318{
319 ERLC_RLF_ADD_INVALID = 0x00, ///< No additional information
320 ERLC_RLF_ADD_UL_EAR_REEST = 0x01, ///< UL early re-establishment
321 ERLC_RLF_ADD_DL_EAR_REEST = 0x02 ///< DL early re-establishment
322
323} errc_erlc_rlf_ind_add_enum;
324
325/// message structure of ERRC_ERLC_RLF_IND
326typedef struct
327{
328 LOCAL_PARA_HDR
329
330 errc_el2_rbid_enum rbid; // RB ID
331 kal_uint8 rb_idx; // RB index
332 kal_bool is_old_rb; // is old RB RLF or not
333 errc_erlc_rlf_enum cause; // reason of RLF
334
335 kal_uint8 add_info; // additional information (MTK proprietary)
336 kal_uint8 rsvd8; // reserved 1 byte
337 kal_uint16 rsvd16; // reserved 2 bytes
338
339} errc_erlc_rlf_ind_struct;
340
341#endif