blob: c7c6f06ecac8014c8e94d7e0d2fa28a19a90187e [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/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * sim_al.h
41 *
42 * Project:
43 * --------
44 * Maui_Software
45 *
46 * Description:
47 * ------------
48 * This file is used for including files for AL_SIM
49 *
50 * Author:
51 * -------
52 * -------
53 *
54 *============================================================================
55 * HISTORY
56 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
57 *------------------------------------------------------------------------------
58 * removed!
59 * removed!
60 * removed!
61 *
62 * removed!
63 * removed!
64 * removed!
65 * removed!
66 *
67 * removed!
68 * removed!
69 *
70 * removed!
71 * removed!
72 *
73 * removed!
74 * removed!
75 * removed!
76 *
77 * removed!
78 * removed!
79 * removed!
80 *
81 * removed!
82 * removed!
83 * removed!
84 *
85 * removed!
86 * removed!
87 * removed!
88 *
89 * removed!
90 * removed!
91 *
92 *
93 * removed!
94 * removed!
95 *
96 *
97 * removed!
98 * removed!
99 *
100 *
101 * removed!
102 * removed!
103 *
104 *
105 * removed!
106 * removed!
107 * removed!
108 *
109 * removed!
110 * removed!
111 *
112 * removed!
113 * removed!
114 * removed!
115 *
116 * removed!
117 * removed!
118 * removed!
119 *
120 * removed!
121 * removed!
122 * removed!
123 *
124 * removed!
125 * removed!
126 *------------------------------------------------------------------------------
127 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
128 *============================================================================
129 ****************************************************************************/
130#ifndef SIM_AL_H
131#define SIM_AL_H
132
133//#define TEST /* test option for win32 simulation */
134/*Besnon 20040407 add for Jensen's request*/
135#define RESET_18V 0 /* Driver reset result = 1.8V */
136#define RESET_30V 1 /* Driver reset result = 3V */
137/*End Benson 20040407*/
138
139#define SIM_NO_ERROR 0 /* return value for SIM no error found */
140#define SIM_NO_INSERT 1 /* return value for no SIM insert */
141#define SIM_CARD_ERROR 3 /* return value for SIM error found */
142
143#define CLOCK_STOP_AT_HIGH 0x00 /* config SIM colck stop at high */
144#define CLOCK_STOP_AT_LOW 0x01 /* config SIM clock stop at low */
145#define CLOCK_STOP_NOT_ALLOW 0x02 /* config SIM clock stop not allowed */
146
147/* Define SIM command instruction ID */
148#define GSM_CLS 0xA0
149#define CMD_SELECT 0xA4
150#define CMD_GETRES 0xC0
151#define CMD_STATUS 0xF2
152#define CMD_READB 0xB0
153#define CMD_UPDATEB 0xD6
154#define CMD_READR 0xB2
155#define CMD_UPDATER 0xDC
156#define CMD_INCREASE 0x32
157#define CMD_VERIFYCHV 0x20
158#define CMD_CHANGECHV 0x24
159#define CMD_DISABLECHV 0x26
160#define CMD_ENABLECHV 0x28
161#define CMD_UNBLOCKCHV 0x2C
162#define CMD_INVALIDATE 0x04
163#define CMD_REHABILITATE 0x44
164#define CMD_RUNGSMALGO 0x88
165#define CMD_TERMINALPRO 0x10
166#define CMD_TERMINALRES 0x14
167#define CMD_ENVELOPE 0xC2
168#define CMD_FETCH 0x12
169
170/* define SIM file ID */
171#define SIM_DF_GSM 0x7F20
172#define SIM_DF_1800 0x7F21
173
174typedef enum
175{
176 ME_UNKNOW = 0,
177 ME_18V_30V,
178 ME_30V_ONLY,
179 ME_18V_ONLY
180} sim_env;
181
182typedef enum
183{
184 sim_card_normal_speed = 0,
185 sim_card_enhance_speed_64,
186 sim_card_enhance_speed_32,
187 sim_card_enhance_speed_16,
188 sim_card_enhance_speed_8
189} sim_card_speed_type;
190
191/* define ATR data Structure */
192typedef struct
193{
194 kal_uint8 info [40];
195} AtrStruct;
196
197#if !defined(DRV_MULTIPLE_SIM) && !defined(__SIM_DRV_MULTI_DRV_ARCH__)
198 /*this definition is only used when build old single SIM driver, the latest definitions are moved to sim_drv_sw_api.h*/
199 extern kal_uint8 L1sim_Reset(kal_uint8 resetVolt, kal_uint8 *resultVolt, AtrStruct *Info);
200 extern void L1sim_Configure(kal_uint8 clockMode);
201 extern kal_uint16 L1sim_Cmd(kal_uint8 *txData, kal_uint16 txSize, kal_uint8 *result, kal_uint16 *rcvSize, kal_uint8 *Error);
202 extern void L1sim_PowerOff(void);
203 extern void L1sim_Init(void);
204 extern sim_env SIM_GetCurrentEnv(void);
205#endif
206
207#endif /*SIM_AL_H*/
208
209