blob: 659821b3fde6292a58d6dbd459b46b80e892fd24 [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) 2005
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 * Copyright Statement:
37 * --------------------
38 * This software is protected by Copyright and the information contained
39 * herein is confidential. The software may not be copied and the information
40 * contained herein may not be used or disclosed except with the written
41 * permission of MediaTek Inc. (C) 2001
42 *
43 *******************************************************************************/
44
45 /*******************************************************************************
46 * Filename:
47 * ---------
48 * sim_public_struct.h
49 *
50 * Project:
51 * --------
52 * MAUI
53 *
54 * Description:
55 * ------------
56 * SIM related message structure (outside PS)
57 *
58 * Author:
59 * -------
60 * -------
61 *
62 *==============================================================================
63 *******************************************************************************/
64#ifndef SIM_PUBLIC_STRUCT_H
65#define SIM_PUBLIC_STRUCT_H
66
67#include "kal_general_types.h"
68#include "kal_public_defs.h"
69#include "sim_public_enum.h"
70#include "ps_public_struct.h"
yu.donge372c322023-08-30 20:25:04 -070071#include "l5_structs.h"
rjw6c1fd8f2022-11-30 14:33:01 +080072
73typedef struct {
74 LOCAL_PARA_HDR
75 kal_uint8 ef_imsi[9];
76} sim_ready_ind_struct;
77
78/* MAUI_01949579 mtk02374 20090903 for CTA GEMINI new bootup*/
79typedef struct {
80 LOCAL_PARA_HDR
81 kal_uint8 src_id;
82} sim_reset_req_struct;
83
84typedef struct {
85 LOCAL_PARA_HDR
86 kal_uint8 src_id;
87 kal_bool is_sim_inserted;
88 kal_bool is_sim_exist; // For C2K fatcory mode detect SIM insert or not
89 // Because for C2K project, UIM only or CSIM only or 3G CT card is_sim_inserted will be KAL_FALSE
90 kal_bool is_ct3g_sim_inserted;
91} sim_reset_cnf_struct;
92
93/*mtk01612: [MAUI_02023545] BT_SIM_Profile for MAUI and DUMA*/
94typedef struct
95{
96 LOCAL_PARA_HDR
97 kal_uint8 src_id;
98} bt_sim_connect_req_struct;
99
100typedef struct
101{
102 LOCAL_PARA_HDR
103 kal_uint16 result;
104 kal_uint8 current_transport_protocol_type;
105 kal_uint8 supported_transport_protocol_type_capability;
106 kal_uint16 atr_len;
107 kal_uint8 atr[ATR_MAX_LEN];
108 kal_uint8 src_id;
109} bt_sim_connect_cnf_struct;
110
111typedef struct
112{
113 LOCAL_PARA_HDR
114 kal_uint8 transport_protocol_type;
115 kal_uint8 src_id;
116} bt_sim_reset_req_struct;
117
118typedef struct
119{
120 LOCAL_PARA_HDR
121 kal_uint16 result;
122 kal_uint8 current_transport_protocol_type;
123 kal_uint16 atr_len;
124 kal_uint8 atr[ATR_MAX_LEN];
125 kal_uint8 src_id;
126 kal_uint8 supported_transport_protocol_type_capability;
127} bt_sim_reset_cnf_struct;
128
129typedef struct
130{
131 LOCAL_PARA_HDR
132 kal_uint8 transport_protocol_type;
133 kal_uint16 apdu_req_len;
134 kal_uint8 apdu_req[APDU_REQ_MAX_LEN];
135 kal_uint8 src_id;
136} bt_sim_apdu_req_struct;
137
138typedef struct
139{
140 LOCAL_PARA_HDR
141 kal_uint16 result;
142 kal_uint16 apdu_rsp_len;
143 kal_uint8 apdu_rsp[APDU_RSP_MAX_LEN];
144 kal_uint8 src_id;
145} bt_sim_apdu_cnf_struct;
146
147typedef struct
148{
149 LOCAL_PARA_HDR
150 kal_uint8 src_id;
151} bt_sim_disconnect_req_struct;
152
153typedef struct
154{
155 LOCAL_PARA_HDR
156 kal_uint16 result;
157 kal_uint8 src_id;
158} bt_sim_disconnect_cnf_struct;
159
160typedef struct
161{
162 LOCAL_PARA_HDR
163 kal_uint8 src_id;
164} bt_sim_power_off_req_struct;
165
166typedef struct
167{
168 LOCAL_PARA_HDR
169 kal_uint16 result;
170 kal_uint8 src_id;
171} bt_sim_power_off_cnf_struct;
172
173typedef bt_sim_reset_req_struct bt_sim_power_on_req_struct;
174typedef bt_sim_reset_cnf_struct bt_sim_power_on_cnf_struct;
175
176/* MAUI_02953154 */
177typedef struct
178{
179 LOCAL_PARA_HDR
180 kal_uint16 file_idx;
181 kal_uint16 para; /* Low byte(P1) is record index. High byte(P2) indicate search mode but now it's RFU, only support search forward from index P1 */
182 kal_uint8 access_id;
183 kal_uint8 path[6];
184 kal_uint8 src_id;
185 kal_uint8 pattern_len; /* pattern data size is MAX_SUPPORT_RECORD_SIZE at most */
186 kal_uint8 data[MAX_SUPPORT_RECORD_SIZE+6]; /* max pattern data size + 6 bytes space for command header */
187 kal_uint8 sfi;
188} sim_search_record_req_struct;
189
190typedef struct
191{
192 LOCAL_PARA_HDR
193 kal_uint16 file_idx;
194 kal_uint16 para;
195 kal_uint8 access_id;
196 kal_uint8 src_id;
197 kal_uint16 result;
198 kal_uint16 status_word;
199 kal_uint8 record_num; /* number of pattern matched records. MAX_SUPPORT_RECORD_NUM at most */
200 kal_uint8 record[258]; /* max APDU response data size 256 + 2 bytes preserved for SIM dirver */
201} sim_search_record_cnf_struct;
202
203typedef struct {
204 LOCAL_PARA_HDR
205 kal_uint8 rand[16];
206 kal_bool is_auth_present;
207 kal_uint8 auth[16];
208 kal_uint8 src_id; /*[MAUI_02602650] mtk01612: AT+EAUTH authentication through AT cmd*/
209 kal_uint8 trans_id; /*[ALPS02825711] NAS shall only use the CNF with the same trans_id of REQ.*/
210 uicc_auth_mode_enum mode;
211 kal_uint8 channel_id;
212 kal_uint8 command_len;
213 kal_uint8 command_data[256];
214} sim_authenticate_req_struct, sim_app_authenticate_req_struct;
215
216typedef struct {
217 LOCAL_PARA_HDR
218 sim_cmd_result_enum result;
219 kal_uint16 status_word;
220 kal_uint8 kc[8];
221 kal_uint8 sres[4];
222 kal_uint8 ck[16];
223 kal_uint8 ik[16];
224 kal_uint8 res[16];
225 kal_uint8 res_len;
226 kal_uint8 auts[16];
227 kal_uint8 auts_len;
228 kal_uint8 auth_res[256]; /*[MAUI_02602650] mtk01612: AT+EAUTH authentication through AT cmd. This should be the same as USIM_MAX_AUTHENTICATE_RSP_LEN */
229 kal_uint16 auth_res_len; /*[MAUI_02602650] mtk01612: AT+EAUTH authentication through AT cmd.*/
230 kal_uint8 src_id; /*[MAUI_02602650] mtk01612: AT+EAUTH authentication through AT cmd.*/
231 kal_uint8 trans_id; /*[ALPS02825711] NAS shall only use the CNF with the same trans_id of REQ.*/
232} sim_authenticate_cnf_struct, sim_app_authenticate_cnf_struct;
233
234typedef struct{
235 kal_uint8 length;
236 kal_uint8 atr[ATR_MAX_LEN];
237}sim_atr_struct;
238
239typedef struct{
240 kal_bool is_sim_inserted;
241 kal_bool is_df_gsm_existed;
242 kal_bool is_df_cdma_existed;
243 kal_bool is_csim_app_existed;
244 kal_bool is_usim_app_existed;
245 kal_bool is_isim_app_existed;
246 kal_bool try_usim_success;
247 kal_bool try_sim_success;
248 kal_uint8 csim_aid_len;
249 kal_uint8 csim_aid[16];
250 kal_uint8 usim_aid_len;
251 kal_uint8 usim_aid[16];
252 kal_uint8 isim_aid_len;
253 kal_uint8 isim_aid[16];
254}sim_cdma_struct;
255
256typedef struct{
257 LOCAL_PARA_HDR
258 kal_uint16 card_type;
259 usim_logic_channel_enum USIMchan;
260 usim_logic_channel_enum ISIMchan;
261 kal_uint8 atr_length;
262 kal_uint8 atr[ATR_MAX_LEN];
263 kal_uint8 remote_sim_protocol_task;
264 kal_uint8 sim_slot_id;
265 kal_bool is_imsi_valid;
266 kal_uint8 imsi[9];
267 kal_bool sim_start_req;
268 kal_bool is_ad_valid;
269 kal_uint8 ad[4];
270 kal_bool is_iccid_valid;
271 kal_uint8 iccid[10];
272 kal_uint8 iccid_fcp_len;
273 kal_uint8 iccid_fcp[50];
274 kal_bool is_pl_valid;
275 kal_uint8 pl_len;
276 kal_uint8 pl[10];
277 kal_uint8 pl_fcp_len;
278 kal_uint8 pl_fcp[50];
279 kal_uint8 dir_record_size; // size of 1 record
280 kal_uint8 dir_record_num;
281 kal_uint8 dir_content[255];
282 sim_chv_info_struct chv_info;
283 kal_uint8 imsi_m_fcp_len;
284 kal_uint8 imsi_m_fcp[50];
285 // Is there valid PIN DO in the application USIM?
286 kal_bool is_usim_valid_pin_do;
287 // To info the task UIM if the STARTUP_READ_FINISH_IND and APP INIT have to be sent in the task UIM or not
288 // KAL_TRUE: UIM DOESN'T NEED to send STARTUP_READ_FINISH_IND
289 // KAL_FALE: Default value. the task UIM keep the original logic
290 kal_bool is_start_finish_ind_noneeded;
291}sim_status_ind_struct;
292
293/* <modem_status>:
294 0: only MD1 active
295 1: MD1's RF is closed, but MD1's SIM task is still working only for MD3 SIM remote access and MD3 active
296 2: both MD1 and MD3 active, but there is at least USIM application existed on the MD1's card
297 <remote_sim_protocol_task>:
298 0: MD3 access local card
299 1: MD3 access MD1's SIM task1
300 2: MD3 access MD1's SIM task2 */
301typedef struct{
302 LOCAL_PARA_HDR
303 kal_uint8 modem_status;
304 kal_uint8 remote_sim_protocol_task;
305}sim_mdstatus_update_req_struct;
306
307typedef union {
308 sim_atr_struct atr;
309 sim_cdma_struct cdma;
310 kal_uint8 sim_reset_volt; /* 1 = 5V, 2 = 3V. 3 = 1.8V */
311 kal_uint8 command_header[CMD_HEADER_LEN]; /* 5 bytes header information: CLA,INS,P1,P2,P3 */
312} sim_query_info_field;
313
314typedef struct {
315 LOCAL_PARA_HDR
316 kal_uint8 src_id;
317 sim_query_info_enum info_id;
318} sim_query_info_req_struct;
319
320typedef struct {
321 LOCAL_PARA_HDR
322 kal_uint8 src_id;
323 sim_cmd_result_enum result;
324 sim_query_info_enum info_id;
325 sim_query_info_field info_data;
326} sim_query_info_cnf_struct;
327
328/* Skyroam Start */
329typedef struct {
330 LOCAL_PARA_HDR
331 kal_uint8 src_id;
332 kal_bool is_apvsim_on;
333 kal_bool is_apvsim_ready;
334} sim_set_apvsim_mode_req_struct;
335
336typedef struct {
337 LOCAL_PARA_HDR
338 kal_uint8 src_id;
339 sim_cmd_result_enum result;
340} sim_set_apvsim_mode_cnf_struct;
341
342typedef struct {
343 LOCAL_PARA_HDR
344 kal_uint8 src_id;
345 kal_uint8 atr_status;
346 kal_uint32 atr_length;
347 kal_uint8 atr[ATR_MAX_LEN];
348} sim_rsa_atr_req_struct;
349
350typedef struct {
351 LOCAL_PARA_HDR
352 kal_uint8 src_id;
353 sim_cmd_result_enum result;
354} sim_rsa_atr_cnf_struct;
355
356typedef struct {
357 LOCAL_PARA_HDR
358} sim_rsa_reset_ind_struct;
359
360typedef struct {
361 LOCAL_PARA_HDR
362 kal_uint32 apdu_len;
363 kal_uint8 apdu[APDU_REQ_MAX_LEN];
364} sim_rsa_apdu_ind_struct;
365
366typedef struct {
367 LOCAL_PARA_HDR
368 kal_uint8 src_id;
369 //kal_uint8 apdu_status;
370 kal_uint32 rsp_len;
371 kal_uint8 rsp[APDU_RSP_MAX_LEN];
372} sim_rsa_apdu_rsp_req_struct;
373
374typedef struct {
375 LOCAL_PARA_HDR
376 kal_uint8 src_id;
377 sim_cmd_result_enum result;
378} sim_rsa_apdu_rsp_cnf_struct;
379
380typedef struct {
381 LOCAL_PARA_HDR
382 kal_uint8 src_id;
383} sim_rsa_hot_plug_out_req_struct;
384
385typedef struct {
386 LOCAL_PARA_HDR
387 kal_uint8 src_id;
388 sim_cmd_result_enum result;
389} sim_rsa_hot_plug_out_cnf_struct;
390
391typedef struct {
392 LOCAL_PARA_HDR
393 kal_uint8 src_id;
394} sim_rsa_hot_plug_in_req_struct;
395
396typedef struct {
397 LOCAL_PARA_HDR
398 kal_uint8 src_id;
399 sim_cmd_result_enum result;
400} sim_rsa_hot_plug_in_cnf_struct;
401
402typedef struct {
403 LOCAL_PARA_HDR
404 kal_uint8 mode;
405} sim_rsa_power_down_ind_struct;
406/* Skyroam End */
407
408typedef struct {
409 LOCAL_PARA_HDR
410 kal_uint8 config_bin_name[30];
411} sim_ut_set_config_bin_req_struct;
412
413typedef struct
414{
415 kal_bool repeat_mode;
416 kal_uint16 prefix_len;
417 kal_uint8 c_apdu_prefix[256];
418 kal_bool is_sw0000;
419} sim_ut_monitor_apdu_struct;
420
421typedef struct {
422 LOCAL_PARA_HDR
423 kal_uint8 num_prefix;
424 sim_ut_monitor_apdu_struct monitor_capdu[5];
425} sim_ut_config_ind_struct;
426
427typedef struct {
428 LOCAL_PARA_HDR
429 kal_uint8 which_prefix;
430 kal_uint16 apdu_len;
431 kal_uint8 apdu[APDU_REQ_MAX_LEN];
432} sim_ut_capdu_ind_struct;
433
434typedef struct {
435 LOCAL_PARA_HDR
436 kal_uint16 rsp_len;
437 kal_uint8 rsp[256];
438 kal_uint16 status_word;
439} sim_ut_rapdu_rsp_struct;
440
441typedef struct
442{
443 LOCAL_PARA_HDR
444 kal_uint16 src_id; /* source module to send this request */
445 kal_uint8 mode; /* 0 - query, 1 - set */
446 kal_uint8 control; /* 0 - disable multiple SIM, 1 - enable multiple SIM */
447 sim_restrict_card_type_enum card_type;
448} sim_restrict_card_type_req_struct;
449
450typedef struct
451{
452 LOCAL_PARA_HDR
453 kal_uint16 src_id; /* same to the value in request message */
454 kal_uint8 mode; /* 0 - query, 1 - set */
455 kal_uint8 control; /* 0 - disable multiple SIM, 1 - enable multiple SIM */
456 sim_restrict_card_type_enum card_type;
457 kal_bool result;
458} sim_restrict_card_type_cnf_struct;
459
yu.donge372c322023-08-30 20:25:04 -0700460typedef l5_l4c_set_ecall_mode_req_struct l4c_sim_set_ecall_mode_req_struct;
461typedef l5_l4c_set_ecall_mode_cnf_struct l4c_sim_set_ecall_mode_cnf_struct;
462typedef l5_l4c_get_ecall_mode_req_struct l4c_sim_get_ecall_mode_req_struct;
463typedef l5_l4c_get_ecall_mode_cnf_struct l4c_sim_get_ecall_mode_cnf_struct;
464
rjw6c1fd8f2022-11-30 14:33:01 +0800465#endif
466