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