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_api.h |
| 49 | * |
| 50 | * Project: |
| 51 | * -------- |
| 52 | * MAUI |
| 53 | * |
| 54 | * Description: |
| 55 | * ------------ |
| 56 | * API provided by SIM task and outside-PS task uses also |
| 57 | * |
| 58 | * Author: |
| 59 | * ------- |
| 60 | * ------- |
| 61 | * |
| 62 | *******************************************************************************/ |
| 63 | |
| 64 | #ifndef SIM_PUBLIC_API_H |
| 65 | #define SIM_PUBLIC_API_H |
| 66 | |
| 67 | #include "kal_general_types.h" |
| 68 | #include "sim_public_enum.h" |
| 69 | #include "sim_ps_enum.h" |
| 70 | #ifdef __SIM_MULTI_PIN__ |
| 71 | #include "ps_public_struct.h" |
| 72 | #endif |
| 73 | |
| 74 | /*******************************************************************************/ |
| 75 | /* Merge sim_ps_api.h */ |
| 76 | #if defined (__GEMINI__) |
| 77 | kal_bool is_usim_type(sim_interface_enum ps_id); |
| 78 | #else |
| 79 | kal_bool is_usim_type(void); |
| 80 | #endif |
| 81 | kal_bool is_usim_type_by_ps_id(protocol_id_enum ps_id); |
| 82 | |
| 83 | kal_uint8 sim_query_mnc_num(sim_interface_enum simInterface); |
| 84 | |
| 85 | #if defined (__GEMINI__) |
| 86 | usim_acl_type_enum usim_query_acl_type(sim_interface_enum ps_id); |
| 87 | #else |
| 88 | usim_acl_type_enum usim_query_acl_type(void); |
| 89 | #endif |
| 90 | usim_acl_type_enum usim_query_acl_type_by_ps_id(protocol_id_enum ps_id); |
| 91 | |
| 92 | uicc_app_type_enum sim_application_id_query(sim_interface_enum simInterface, usim_logic_channel_enum channel); |
| 93 | |
| 94 | sim_dn_enum sim_dn_type_query(sim_interface_enum simInterface); |
| 95 | |
| 96 | #if defined (__GEMINI__) |
| 97 | kal_bool is_vsim_on(kal_uint8 simInterface); |
| 98 | #else |
| 99 | kal_bool is_vsim_on(void); |
| 100 | #endif |
| 101 | kal_bool is_vsim_on_by_ps_id(protocol_id_enum ps_id); |
| 102 | |
| 103 | kal_uint8 sim_read_vsim_profileid(kal_uint8 simInterface); |
| 104 | |
| 105 | kal_uint8 sim_read_vsim_type(kal_uint8 simInterface, kal_uint8 profile_id); |
| 106 | |
| 107 | kal_uint8 sim_read_vsim_auth_algo(kal_uint8 simInterface, kal_uint8 profile_id); |
| 108 | |
| 109 | void sim_read_vsim_auth_res(kal_uint8 simInterface, kal_uint8 profile_id, kal_uint16 *auth_len, kal_uint8 *auth_res); |
| 110 | |
| 111 | vsim_ver_type_enum sim_read_vsim_ver(kal_uint8 simInterface); |
| 112 | #ifdef __GEMINI__ |
| 113 | kal_uint8 *get_sim_context_g_sat_event_list(kal_uint8 simInterface); |
| 114 | #else |
| 115 | kal_uint8 *get_sim_context_g_sat_event_list(void); |
| 116 | #endif |
| 117 | |
| 118 | void deactivate_fetch(sim_interface_enum simInterface); |
| 119 | void activate_fetch(sim_interface_enum simInterface); |
| 120 | |
| 121 | extern void sim_get_full_path(sim_file_index_enum file_index, kal_uint8 *full_path); |
| 122 | /*******************************************************************************/ |
| 123 | |
| 124 | |
| 125 | |
| 126 | kal_bool is_sim1_test_sim(void); |
| 127 | |
| 128 | #if defined( __GEMINI__) |
| 129 | kal_bool is_test_sim(kal_uint8 simInterface); |
| 130 | #else |
| 131 | kal_bool is_test_sim(void); |
| 132 | #endif |
| 133 | kal_bool is_test_sim_by_ps_id(protocol_id_enum ps_id); |
| 134 | |
| 135 | |
| 136 | usim_logic_channel_enum l4c_sim_get_app_channel_id(kal_uint8 simInterface, kal_uint8 applicationid); |
| 137 | |
| 138 | #if defined(__ECALL_SUPPORT__) || defined(__NG_ECALL_SUPPORT__) |
| 139 | sim_ecall_mode_enum sim_ecall_mode_query(sim_interface_enum simInterface); |
| 140 | kal_bool sim_set_ecall_test_mode(sim_interface_enum simInterface,sim_ecall_mode_enum mode); |
| 141 | #endif |
| 142 | #ifdef __NG_ECALL_SUPPORT__ |
| 143 | sim_ecall_mode_enum sim_ecall_mode_ims_query(sim_interface_enum simInterface); |
| 144 | #endif |
| 145 | #if defined( __GEMINI__) |
| 146 | sim_type_query_enum sim_query_type(sim_interface_enum which_sim); |
| 147 | #else |
| 148 | sim_type_query_enum sim_query_type(void); |
| 149 | #endif |
| 150 | sim_type_query_enum sim_query_type_by_ps_id(protocol_id_enum ps_id); |
| 151 | |
| 152 | #if defined( __GEMINI__) |
| 153 | sim_service_state_enum sim_service_table_query(sim_service_enum service_id, kal_uint8 ps_id); |
| 154 | #else |
| 155 | sim_service_state_enum sim_service_table_query(sim_service_enum service_id); |
| 156 | #endif |
| 157 | sim_service_state_enum sim_service_table_query_by_ps_id(sim_service_enum service_id, protocol_id_enum ps_id); |
| 158 | |
| 159 | #if defined(__GEMINI__) |
| 160 | sim_card_status_enum check_sim_card_status(kal_uint8 simInterface); |
| 161 | #else |
| 162 | sim_card_status_enum check_sim_card_status(void); |
| 163 | #endif |
| 164 | |
| 165 | #if defined(__ICUSB_SUPPORT__) && defined(__MTK_TARGET__) |
| 166 | extern void sim_icusb_error_ind_call_back(kal_uint32 which_sim); |
| 167 | #endif |
| 168 | |
| 169 | extern kal_bool is_sim_registered(kal_uint8 simInterface); |
| 170 | |
| 171 | extern kal_uint8 sim_get_cdma_info(kal_uint8 sim_indx); |
| 172 | |
| 173 | extern kal_bool sim_get_3GCT_card_info(kal_uint8 sim_indx); |
| 174 | |
| 175 | extern kal_bool is_op20_imei_lock(kal_uint8 sim_indx); |
| 176 | |
| 177 | extern kal_uint8 is_isim_exist(kal_uint8 sim_indx); |
| 178 | |
| 179 | #ifdef __SAT__ |
| 180 | kal_bool sat_set_profile_download_config(sat_profile_download_enum dl_setting, protocol_id_enum sim_ps_id); |
| 181 | sat_profile_download_enum sat_get_profile_download_config(protocol_id_enum sim_ps_id); |
| 182 | |
| 183 | kal_bool sat_set_profile_activate_config(sat_profile_activate_enum act_setting, protocol_id_enum sim_ps_id); |
| 184 | |
| 185 | sat_profile_activate_enum sat_get_profile_activate_config(protocol_id_enum sim_ps_id); |
| 186 | |
| 187 | #endif |
| 188 | |
| 189 | extern void usim_get_ust(kal_uint8* ust, kal_uint8 *ust_len, kal_uint8 sim_ps_id); |
| 190 | |
| 191 | extern kal_uint8 sim_query_L1_SIM_insert_status(void); |
| 192 | |
| 193 | extern kal_uint8 get_uicc_type_from_channel_id(kal_uint8 simInterface, kal_uint8 channel_id); |
| 194 | |
| 195 | extern void l4c_usim_get_aid_info_by_channel(kal_uint8 simInterface, kal_uint8 applicationid, kal_uint8 *channel_id, kal_uint8* aid, kal_uint8 *aid_len, kal_uint8 *app_label, kal_uint8 *app_label_len); |
| 196 | |
| 197 | extern kal_bool usim_is_uicc_app_exist(kal_uint8 sim_indx, kal_uint8 app_id); |
| 198 | |
| 199 | /*******************************************************************************/ |
| 200 | |
| 201 | /* Add new functions */ |
| 202 | |
| 203 | /* Check whether SIM slot has card, including CT3G, UIM, recovery */ |
| 204 | /* Workaround for CT3G recovery */ |
| 205 | extern kal_bool sim_is_card_in_slot(kal_uint8 sim_ps_id); |
| 206 | |
| 207 | /* |
| 208 | READ BINARY/RECORD from SIM file cache |
| 209 | Currently only support: |
| 210 | Default channel |
| 211 | Valid file_idx |
| 212 | SFI not used |
| 213 | */ |
| 214 | kal_bool sim_read_file_cache(kal_uint8 sim_ps_id, |
| 215 | sim_file_index_enum file_idx, |
| 216 | kal_uint32 cmd, // smu_common_enums.h - (smu_sim_access_cmd_enum) READ_BINARY or READ_RECORD |
| 217 | kal_uint16 fileid, |
| 218 | kal_uint8 *pathid, |
| 219 | kal_uint8 pathid_length, |
| 220 | kal_uint8 p1, |
| 221 | kal_uint8 p2, |
| 222 | kal_uint8 p3, |
| 223 | kal_uint8 channel_id, |
| 224 | kal_uint8 sfi, |
| 225 | kal_uint8 *res_data); |
| 226 | |
| 227 | |
| 228 | /* Pass ICCID stored in SIM context */ |
| 229 | void sim_get_iccid(kal_uint8 sim_ps_id, kal_uint8 *iccid); |
| 230 | |
| 231 | /*******************************************************************************/ |
| 232 | |
| 233 | #if defined (__GEMINI__) |
| 234 | kal_bool is_apvsim_on(kal_uint8 simInterface); |
| 235 | #else |
| 236 | kal_bool is_apvsim_on(void); |
| 237 | #endif |
| 238 | |
| 239 | kal_bool sim_is_any_hotswap_poll_timer_start(void); |
| 240 | |
| 241 | |
| 242 | /***************************************************************************** |
| 243 | * FUNCTION |
| 244 | * sim_query_atr_info |
| 245 | * DESCRIPTION |
| 246 | * To query ATR info |
| 247 | * PARAMETERS |
| 248 | * length [OUT] ATR length |
| 249 | * atr [OUT] ATR value(Hex) |
| 250 | * ps_id [IN] which SIM |
| 251 | * RETURNS |
| 252 | * KAL_TRUE SIM exist |
| 253 | * KAL_FALSE SIM absent |
| 254 | * GLOBALS AFFECTED |
| 255 | * void |
| 256 | *****************************************************************************/ |
| 257 | kal_bool sim_query_atr_info(kal_uint8 *length, kal_uint8 *atr, protocol_id_enum ps_id); |
| 258 | |
| 259 | /***************************************************************************** |
| 260 | * FUNCTION |
| 261 | * sim_ps_data_off_exempt_query_by_ps_id |
| 262 | * DESCRIPTION |
| 263 | * Check if the service is 3GPP PS Data Off Exempt |
| 264 | * PARAMETERS |
| 265 | * exempt_id [IN] service to be queried |
| 266 | * this_sim |
| 267 | * RETURNS |
| 268 | * Boolean |
| 269 | * GLOBALS AFFECTED |
| 270 | * None |
| 271 | *****************************************************************************/ |
| 272 | sim_ps_data_off_exempt_state_enum sim_ps_data_off_exempt_query_by_ps_id(sim_ps_data_off_exempt_enum exempt_id, protocol_id_enum ps_id); |
| 273 | |
| 274 | extern kal_bool sim_get_if_immediate_auth_needed(kal_uint8 sim_ps_id); |
| 275 | extern void sim_set_immediate_auth_flag(kal_uint8 sim_ps_id); |
| 276 | |
| 277 | /***************************************************************************** |
| 278 | * FUNCTION |
| 279 | * sim_check_curr_disable_by_ps |
| 280 | * DESCRIPTION |
| 281 | * To query the current ps sim state is disable or enable |
| 282 | * PARAMETERS |
| 283 | * sim_ps_id [IN] protocol id |
| 284 | * RETURNS |
| 285 | * Boolean Disable state |
| 286 | * GLOBALS AFFECTED |
| 287 | * None |
| 288 | *****************************************************************************/ |
| 289 | extern kal_bool sim_check_curr_disable_by_ps(kal_uint8 sim_ps_id); |
| 290 | |
| 291 | /***************************************************************************** |
| 292 | * FUNCTION |
| 293 | * sim_check_curr_disable_card_exist_by_ps |
| 294 | * DESCRIPTION |
| 295 | * To query the current ps sim state is disable or enable |
| 296 | * PARAMETERS |
| 297 | * sim_ps_id [IN] protocol id |
| 298 | * RETURNS |
| 299 | * Boolean Disable state and the card in slot |
| 300 | *****************************************************************************/ |
| 301 | extern kal_bool sim_check_curr_disable_card_exist_by_ps (kal_uint8 sim_ps_id); |
| 302 | |
| 303 | /***************************************************************************** |
| 304 | * FUNCTION |
| 305 | * sim_get_file_idx_from_path |
| 306 | * DESCRIPTION |
| 307 | * To get the sim file index from file path. |
| 308 | * PARAMETERS |
| 309 | * path [IN] the array carry the file id path |
| 310 | * path_len [IN] the valid path length |
| 311 | * app_type [IN] the file is belong to which application (ADF) |
| 312 | * RETURNS |
| 313 | * sim file index |
| 314 | * GLOBALS AFFECTED |
| 315 | * None |
| 316 | *****************************************************************************/ |
| 317 | kal_uint32 sim_get_file_idx_from_path (const kal_uint8 *path, kal_uint16 path_len, uicc_app_type_enum app_type); |
| 318 | |
| 319 | /***************************************************************************** |
| 320 | * FUNCTION |
| 321 | * sim_get_file_meta_cache_by_ps |
| 322 | * DESCRIPTION |
| 323 | * This function is to get the meta info of FCP data in sim context cache |
| 324 | * PARAMETERS |
| 325 | * sim_ps_id [IN] which PS to be check |
| 326 | * file_idx [IN] which file to be check |
| 327 | * file_exist [OUT] the file exist or not |
| 328 | * file_type [OUT] the file type. TRANSPARENT or RECORD type |
| 329 | * file_size [OUT] the file size for TRANSPARNET file/ the record size for RECORD file |
| 330 | * total_rec_num [OUT] total number of records. |
| 331 | * RETURNS |
| 332 | * Boolean FALSE means the file to be checked is not in sim context cache. |
| 333 | * GLOBALS AFFECTED |
| 334 | * void |
| 335 | *****************************************************************************/ |
| 336 | kal_bool sim_get_file_meta_cache_by_ps(kal_uint8 sim_ps_id, |
| 337 | sim_file_index_enum file_idx, |
| 338 | kal_bool *file_exist, |
| 339 | sim_file_structure_enum *file_type, |
| 340 | kal_uint16 *file_size, |
| 341 | kal_uint16 *total_rec_num); |
| 342 | |
| 343 | /***************************************************************************** |
| 344 | * FUNCTION |
| 345 | * sim_get_cached_file_size_by_ps |
| 346 | * DESCRIPTION |
| 347 | * Query SIM cached data profile by file index |
| 348 | * PARAMETERS |
| 349 | * sim_ps_id [IN] which PS to be check |
| 350 | * file_idx [IN] which file to be check |
| 351 | * cached_rec_num [OUT] the number of record cached |
| 352 | * cached_rec_size [OUT] the cached record size |
| 353 | * RETURNS |
| 354 | * KAL_TRUE The file in cache |
| 355 | * KAL_FALSE The file not in cache |
| 356 | * GLOBALS AFFECTED |
| 357 | * void |
| 358 | *****************************************************************************/ |
| 359 | kal_bool sim_get_cached_file_size_by_ps (kal_uint8 sim_ps_id, |
| 360 | sim_file_index_enum file_idx, |
| 361 | kal_uint8 *cached_rec_num, |
| 362 | kal_uint16 *cached_rec_size); |
| 363 | |
| 364 | /***************************************************************************** |
| 365 | * FUNCTION |
| 366 | * sim_get_cached_file_data_by_ps |
| 367 | * DESCRIPTION |
| 368 | * Get the SIM cached data by file index |
| 369 | * PARAMETERS |
| 370 | * sim_ps_id [IN] which PS to be check |
| 371 | * file_idx [IN] which file to be check |
| 372 | * cmd [IN] read command, READ_RECORD or READ_BINARY |
| 373 | * rec_id [IN] the 1-based record id to be read. |
| 374 | * res_buffer_size [IN] the size of the respose buffer, res_data |
| 375 | * res_data [OUT] the response buffer |
| 376 | * RETURNS |
| 377 | * The length of data in res_data buffer |
| 378 | * GLOBALS AFFECTED |
| 379 | * void |
| 380 | *****************************************************************************/ |
| 381 | kal_uint16 sim_get_cached_file_data_by_ps (kal_uint8 sim_ps_id, |
| 382 | sim_file_index_enum file_idx, |
| 383 | kal_uint8 rec_id, |
| 384 | kal_uint16 res_buffer_size, |
| 385 | kal_uint8 *res_data); |
| 386 | |
| 387 | /***************************************************************************** |
| 388 | * FUNCTION |
| 389 | * sim_query_operator_card |
| 390 | * DESCRIPTION |
| 391 | * Query the operator name based on ICCID/EHPLMN/IMSI in SIM context |
| 392 | * PARAMETERS |
| 393 | * ps_id [IN] which PS to be query |
| 394 | * RETURNS |
| 395 | * operator name |
| 396 | *****************************************************************************/ |
| 397 | sim_operator_type_enum sim_query_operator_card(protocol_id_enum ps_id); |
| 398 | |
| 399 | /***************************************************************************** |
| 400 | * FUNCTION |
| 401 | * is_extended_length_fields_support |
| 402 | * DESCRIPTION |
| 403 | * This function is to check if card supports extended length fields |
| 404 | * PARAMETERS |
| 405 | * ps_id [IN] which PS to be query |
| 406 | * RETURNS |
| 407 | * KAL_TRUE extended length fields supported |
| 408 | * KAL_FALSE extended length fields not supported |
| 409 | * GLOBALS AFFECTED |
| 410 | * void |
| 411 | *****************************************************************************/ |
| 412 | kal_bool is_extended_length_fields_support(protocol_id_enum ps_id); |
| 413 | |
| 414 | #ifdef __FAKEID_SUPPORT__ |
| 415 | /***************************************************************************** |
| 416 | * FUNCTION |
| 417 | * sim_is_fake_imsi_by_ps_id |
| 418 | * DESCRIPTION |
| 419 | * This function is to check if the current protocol is using fake IMSI |
| 420 | * Caller should use this API after SIM ready |
| 421 | * PARAMETERS |
| 422 | * protocol_id_enum ps_id [?] |
| 423 | * RETURNS |
| 424 | * KAL_TRUE fake IMSI used |
| 425 | * KAL_FALSE fake IMSI not used |
| 426 | * GLOBALS AFFECTED |
| 427 | * void |
| 428 | *****************************************************************************/ |
| 429 | extern kal_bool sim_is_fake_imsi_by_ps_id(protocol_id_enum ps_id); |
| 430 | |
| 431 | /***************************************************************************** |
| 432 | * FUNCTION |
| 433 | * sim_get_fake_imsi |
| 434 | * DESCRIPTION |
| 435 | * This function is to get the fake IMSI set by the tester |
| 436 | * Caller should use this API after SIM ready |
| 437 | * Caller should allocate the MAX_SIM_IMSI_LEN memory for imsi_p |
| 438 | * PARAMETERS |
| 439 | * kal_uint8 sim_ps_id [IN] |
| 440 | * RETURNS |
| 441 | * imsi_p fake IMSI |
| 442 | * mnc_length_p MNC length of fake IMSI |
| 443 | * GLOBALS AFFECTED |
| 444 | * void |
| 445 | *****************************************************************************/ |
| 446 | extern void sim_get_fake_imsi(protocol_id_enum sim_ps_id, kal_uint8 *imsi_p, kal_uint8 *mnc_length_p); |
| 447 | |
| 448 | #endif |
| 449 | |
| 450 | /***************************************************************************** |
| 451 | * FUNCTION |
| 452 | * sim_is_euicc |
| 453 | * DESCRIPTION |
| 454 | * To check the present card is eUICC. |
| 455 | * PARAMETERS |
| 456 | * ps_id [IN] Protocol ID |
| 457 | * RETURNS |
| 458 | * KAL_TRUE SIM is eUICC |
| 459 | * KAL_FALSE SIM is not eUICC |
| 460 | * GLOBALS AFFECTED |
| 461 | * void |
| 462 | *****************************************************************************/ |
| 463 | kal_bool sim_is_euicc(protocol_id_enum ps_id); |
| 464 | |
| 465 | /***************************************************************************** |
| 466 | * FUNCTION |
| 467 | * sim_is_empty_euicc |
| 468 | * DESCRIPTION |
| 469 | * To check the present card is empty eUICC. |
| 470 | * PARAMETERS |
| 471 | * ps_id [IN] Protocol ID |
| 472 | * RETURNS |
| 473 | * KAL_TRUE SIM is empty eUICC |
| 474 | * KAL_FALSE SIM is not empty eUICC |
| 475 | * GLOBALS AFFECTED |
| 476 | * void |
| 477 | *****************************************************************************/ |
| 478 | kal_bool sim_is_empty_euicc(protocol_id_enum ps_id); |
| 479 | |
| 480 | /***************************************************************************** |
| 481 | * FUNCTION |
| 482 | * sim_query_eid |
| 483 | * DESCRIPTION |
| 484 | * To query EID |
| 485 | * PARAMETERS |
| 486 | * eid [OUT] EID value(Hex) |
| 487 | * ps_id [IN] Protocol ID |
| 488 | * RETURNS |
| 489 | * KAL_TRUE SIM exist and EID retrieved |
| 490 | * KAL_FALSE SIM absent or EID not retrieved |
| 491 | * GLOBALS AFFECTED |
| 492 | * void |
| 493 | *****************************************************************************/ |
| 494 | kal_bool sim_query_eid(kal_uint8 *eid, protocol_id_enum ps_id); |
| 495 | |
| 496 | #ifdef __SIM_MULTI_PIN__ |
| 497 | /***************************************************************************** |
| 498 | * FUNCTION |
| 499 | * sim_get_app_pin_remaining_count_by_ps_id |
| 500 | * DESCRIPTION |
| 501 | * |
| 502 | * PARAMETERS |
| 503 | * RETURNS |
| 504 | * KAL_TRUE |
| 505 | * KAL_FALSE |
| 506 | *****************************************************************************/ |
| 507 | kal_bool sim_get_app_pin_remaining_count_by_ps_id(uicc_app_type_enum app_type, sim_chv_info_struct *chv_info, protocol_id_enum ps_id); |
| 508 | #endif |
| 509 | /***************************************************************************** |
| 510 | * FUNCTION |
| 511 | * sim_get_imsi_null_suci_by_ps |
| 512 | * DESCRIPTION |
| 513 | * Get the SUCI with Null Scheme by protocol stack. |
| 514 | * PARAMETERS |
| 515 | * sim_ps_id [IN] which PS to be check |
| 516 | * res_len [IN/OUT] the size of suci_ptr buffer and the data length in suci_ptr for return |
| 517 | * suci_ptr [OUT] array buffer to carry response data |
| 518 | * RETURNS |
| 519 | * Result of process the command |
| 520 | *****************************************************************************/ |
| 521 | kal_bool sim_get_imsi_null_suci_by_ps (kal_uint8 sim_ps_id, kal_uint16 *res_len, kal_uint8 *suci_ptr); |
| 522 | |
| 523 | /***************************************************************************** |
| 524 | * FUNCTION |
| 525 | * usim_get_sfi_from_fcp |
| 526 | * DESCRIPTION |
| 527 | * Get the SFI (short file id) from FCP. |
| 528 | * Support of SFI for a specific file is indicated if the FCP of the file contains a |
| 529 | * TLV DO with tag '88'. If the length is 0 it indicates that the file does not support |
| 530 | * referencing by SFI. If the TLV DO is not present in the FCP it indicates that the |
| 531 | * 5 least significant bits of the FID are used as SFI. |
| 532 | * PARAMETERS |
| 533 | * fcp [IN] fcp data to be checked |
| 534 | * fcp_len [IN] the length of whole fcp data |
| 535 | * RETURNS |
| 536 | * SFI. 0 means no SFI found |
| 537 | *****************************************************************************/ |
| 538 | kal_uint8 usim_get_sfi_from_fcp (kal_uint8 *fcp, kal_uint16 fcp_len); |
| 539 | |
| 540 | #ifdef __TC10__ |
| 541 | extern void sim_get_last_commnad_APDU(kal_uint8 simInterface, kal_uint8 *command_header_p); |
| 542 | extern sim_dss_state_enum sim_get_dss_state(protocol_id_enum ps_id); /*ALPS03779598*/ |
| 543 | /***************************************************************************** |
| 544 | * FUNCTION |
| 545 | * sim_check_hplmnwact_3g_only |
| 546 | * DESCRIPTION |
| 547 | * To query E-UTRAN bit available from EF_HPLMNwAcT. |
| 548 | * PARAMETERS |
| 549 | * ps_id [IN] Protocol ID |
| 550 | * RETURNS |
| 551 | * KAL_TRUE VzW 3G USIM not supported condition match, i.e. no E-UTRAN in HPLMNwAcT |
| 552 | *****************************************************************************/ |
| 553 | kal_bool sim_check_hplmnwact_3g_only(protocol_id_enum ps_id); |
| 554 | extern kal_bool sim_query_vzpf(kal_uint8 *vzpf, protocol_id_enum ps_id); |
| 555 | #endif |
| 556 | |
| 557 | extern kal_bool sim_query_gid1(kal_uint8 *gid1, protocol_id_enum ps_id); |
| 558 | extern kal_bool sim_query_gid2(kal_uint8 *gid2, protocol_id_enum ps_id); |
| 559 | |
| 560 | |
| 561 | extern kal_uint8 sim_query_voltage_info(protocol_id_enum ps_id); |
| 562 | extern kal_uint8 sim_query_tray_info(protocol_id_enum ps_id); |
| 563 | |
| 564 | extern kal_bool sim_check_operator_card(sim_operator_type_enum operator_type, kal_uint8 sim_indx); |
| 565 | extern kal_bool sim_check_operator_card_by_iccid(sim_operator_type_enum operator_type, kal_uint8 sim_indx); |
| 566 | extern sim_op01_enum sim_query_op_mode(kal_uint8 ps_id); |
| 567 | #ifdef __TC10_JPN_FACTORY__ |
| 568 | extern void sim_set_factory_mode(kal_bool is_factory); |
| 569 | #endif |
| 570 | #ifdef __SIM_TERMINAL_CAP__ |
| 571 | void sim_get_host_terminal_capabilities_by_ps_id(kal_uint16 tc_data_len, kal_uint8 *tc_data_ptr, protocol_id_enum ps_id); |
| 572 | #endif |
| 573 | #ifdef __SIM_PASS_THROUGH__ |
| 574 | /***************************************************************************** |
| 575 | * FUNCTION |
| 576 | * sim_get_esimpower_state_by_ps_id |
| 577 | * DESCRIPTION |
| 578 | * To query the current esimpower state ps sim |
| 579 | * PARAMETERS |
| 580 | * sim_ps_id [IN] protocol id |
| 581 | * RETURNS |
| 582 | * ESIMPOWER state |
| 583 | *****************************************************************************/ |
| 584 | sim_esimpower_state_enum sim_get_esimpower_state_by_ps_id(protocol_id_enum ps_id); |
| 585 | #endif |
| 586 | #endif |