comparison src/ui/mfw/mfw_sim.h @ 3:67bfe9f274f6

src/ui: import of src/ui3 from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:33:10 +0000
parents
children 92abb46dc1ba
comparison
equal deleted inserted replaced
2:3a14ee9a9843 3:67bfe9f274f6
1 /*
2 +--------------------------------------------------------------------+
3 | PROJECT: GSM-MFW (?) $Workfile:: mfw_sim.h $|
4 | $Author:: Vo $Revision:: 1 $|
5 | CREATED: 14.10.98 $Modtime:: 20.03.00 14:09 $|
6 | STATE : code |
7 +--------------------------------------------------------------------+
8 History:
9
10 Apr 03, 2007 ER: OMAPS00122561 x0pleela
11 Description: [ACI] Phone lock feature has to be supported by ACI
12 Solution: Phone Lock ER implementation
13
14 Sep 26, 2006 DR: OMAPS00095524 x0pleela
15 Description:Implement 2 missing SIM Lock types
16 Solution: Made the following changes
17 - Added new macros MFW_SIM_PBLOCK_REQ, MFW_SIM_PBLOCK for
18 Blocked Network category
19
20 xashmic 9 Sep 2006, OMAPS00092732
21 USBMS ER
22 Sep 08, 2006 DR: OMAPS00091250 x0pleela
23 Description:The phone resets if no MEPD data is presented
24 Solution: Added a new event MFW_MEPD_INVALID which will be returned to BMI
25 to display MEPD not present to the user
26
27 July 21, 2006 ER: OMAPS00087586, OMAPS00087587 x0pleela
28 Description: OMAPS00087586: MasterKey funtion in TCS3.2 SW
29 OMAPS00087587: Time Penaly feature extend handset security
30 Solution:Made the following changes
31 Defined new macros MFW_SIM_MKEY( Master Unlocking during bootup)
32 MFW_SIM_MKEYM (Master Unlocking through menu)
33
34 May 26, 2006 ER: OMAPS00079607 x0012849 :Jagannatha M
35 Description: CPHS: Display 'charge/Timers' menu based on AOC ( Advice of charge )
36 Solution:Made the following changes
37 1. Defined MFW_SIM_NO_AOC with value 11
38
39 May 15, 2006 DR: OMAPS00067919 x0pleela
40 Description: SIMP:On repeat Depersonalisation with invalid password MEPD unblock key should
41 be asked not Puk1.
42 Solution:Made the following changes
43 1. Added new macro BOOTUP_OK
44 2. Added new enumeration T_MFW_SIMP_CLCK_FLAG
45
46 Nov 24, 2005 DR: OMAPS00045909 - Shashi Shekar B.S.
47 Description: Improve IMEI control mechanism
48 Solution : When MMI calls sAT_PLUSCFUN, if an IMEI invalid error is returned,
49 we will block on that screen & will not allow the user to browse menus further,
50 since the PS will not be booted at all!!!
51
52 July 19, 2005 REF: CRR LOCOSTO-ENH-28173 xpradipg
53 Description: To provide MMI Support to enable/disable/change password and
54 query all the Personalization locks
55 Solution: Integration of the changes for the same provided by the soldel
56 team
57
58 ***********************************************************************
59
60 PURPOSE: Types definitions for SIM management of MMI framework
61
62 */
63
64 #ifndef DEF_MFW_SIM
65 #define DEF_MFW_SIM
66
67 /*#ifndef BMI_TEST_MC_SIM_EVENT
68 #define BMI_TEST_MC_SIM_EVENT
69 #endif*/
70
71 /*
72 * events are organised as bitmaps
73 */
74 #define E_SIM_STATUS 0x0001
75 #define E_SIM_INSERTED 0x0002
76 #define E_SIM_RESET 0x0004
77 #define E_SIM_READ_CALLBACK 0x0008/*MC CONQ5862, 13/06/02*, added new event*/
78
79 #define E_SIM_ALL_SERVICES 0x000f
80
81 #define SIM_ACTIVE 0
82 #define SIM_NOT_ACTIVE 1
83 #define SIM_STK_RESET 2 // bugfix for SIM refresh
84 #define IMEI_NOT_VALID 3 // Nov 24, 2005, a0876501, DR: OMAPS00045909
85
86 typedef struct {
87 UBYTE sim_procedure;
88 UBYTE sim_status;
89 UBYTE sim_operation_mode;
90 UBYTE sim_pin_retries;
91 UBYTE sim_status_type;
92 } T_MFW_SIM_STATUS; /* type definition for E_SIM_STATUS event */
93
94 typedef struct {
95 UBYTE type; /* MFW_SIM_PIN1/MFW_SIM_PIN2 */
96 UBYTE set; /* MFW_SIM_ENABLE/MFW_SIM_DISABLE */
97 UBYTE stat ; /* MFW_SIM_NO_PIN/MFW_SIM_PIN_REQ/MFW_SIM_PIN2_REQ */
98 } T_MFW_SIM_PIN_STATUS;
99
100 /*MC CONQ5862, 13/06/02*, added new data struct for E_SIM_READ_CALLBACK event*/
101 typedef struct {
102 SHORT error_code;
103 UBYTE* read_buffer;
104 } T_MFW_READ_CALLBACK;
105
106 /* SIM configuration information */
107 typedef struct
108 {
109 UBYTE access_acm;
110 UBYTE access_acmmax;
111 UBYTE access_puct;
112 } T_MFW_AOC_ACCESS;
113
114 //x0pleela 07 Mar, 2007 ER: OMAPS00122561
115 #ifdef FF_PHONE_LOCK
116 #define MFW_PH_LOCK_ENABLE 1
117 #define MFW_PH_LOCK_DISABLE 2
118 #define MFW_PH_LOCK_FAILURE 3
119
120 #define MFW_PH_LOCK 1 /* Phone lock type */
121 #define MFW_AUTO_PH_LOCK 2 /* Auto Phone lock type */
122 #endif /* FF_PHONE_LOCK */
123
124 #ifdef SIM_PERS
125 #define UNBLOCK_SUCESS 1
126 #define UNBLOCK_FAILURE 2
127 #define BOOTUP_LOCK_SUCCESS 3
128 #define BOOTUP_LOCK_FAILURE 4
129 #define BOOTUP_OK 5 //x0pleela 21 Apr, 2006 DR: OMAPS00067919
130 #define MFW_SIM_NOT_BLOCKED 10
131 #define MFW_SIM_PERM_BLOCKED 11
132 #endif
133
134 /* definition of SIM procedure in E_SIM_STATUS event */
135
136 #define MFW_SIM_ACTIVATION 1
137 #define MFW_SIM_VERIFY 2
138 #define MFW_SIM_UNBLOCK 3
139 #define MFW_SIM_CHANGE 4
140 #define MFW_SIM_ENABLE 5
141 #define MFW_SIM_DISABLE 6
142 #define MFW_SIM_LOCKED 7
143 #define MFW_SIM_BLOCKED 8
144 #define MFW_SIM_REMOVED 9
145
146
147
148 /* definition of SIM operation mode in E_SIM_STATUS event */
149
150 #define MFW_SIM_NO_OPERATION 0
151 #define MFW_SIM_ADN_ENABLED 1
152 #define MFW_SIM_FDN_ENABLED 2
153 #define MFW_SIM_ADN_BDN_ENABLED 5
154 #define MFW_SIM_FDN_BDN_ENABLED 6
155
156 /* definition of SIM status in E_SIM_STATUS event */
157
158 #define MFW_SIM_PIN_REQ 1
159 #define MFW_SIM_PUK_REQ 2
160 #define MFW_SIM_PIN2_REQ 3
161 #define MFW_SIM_PUK2_REQ 4
162 #define MFW_SIM_INVALID_CARD 5
163 #define MFW_SIM_NO_SIM_CARD 6
164 #define MFW_SIM_NO_PIN 7
165 #define MFW_SIM_SUCCESS 8
166 #define MFW_SIM_FAILURE 9
167 #ifdef SIM_PERS
168 #define MFW_SIM_NLOCK_REQ 10
169 #define MFW_SIM_NSLOCK_REQ 11
170 #define MFW_SIM_SPLOCK_REQ 12
171 #define MFW_SIM_CLOCK_REQ 13
172 #define MFW_SIM_PLOCK_REQ 14
173 #define MFW_SIM_PLOCK_ERR 15
174 #define MFW_SIM_PLOCK_OK 16
175 #define MFW_MEPD_INVALID 17 //x0pleela 23 Aug, 2006 DR: OMAPS00091250
176 #define MFW_SIM_PBLOCK_REQ 18 //x0pleela 25 Sep, 2006 ER: OMAPS00095524
177 #endif
178 #define MFW_SIM_NO_DISABLE 10 /*MC CONQ-5578, PIN disabling forbidden*/
179 //x0012849: Jagannatha 26 May, 2006 ER: OMAPS00079607 -Support AOC in CPHS
180 #ifdef FF_CPHS
181 #define MFW_SIM_NO_AOC 11
182 #endif
183 /* Shashi Shekar B.S. DR: OMAPS00045909, Improve IMEI control mechanism */
184 #define MFW_IMEI_NOT_VALID 20
185
186
187 #define MFW_SIM_PIN1 1
188 #define MFW_SIM_PUK1 2
189 #define MFW_SIM_PIN2 3
190 #define MFW_SIM_PUK2 4
191 #define MFW_SIM_UNKNOWN 0
192
193 #define MFW_SIM_NLOCK 1
194 #define MFW_SIM_SPLOCK 2
195 #define MFW_SIM_NSLOCK 3
196 #define MFW_SIM_CLOCK 4
197 #define MFW_SIM_PLOCK 5
198 #define MFW_SIM_UNLOCK_ERR 6
199 #ifdef SIM_PERS
200 #define MFW_SIM_FC 7
201 #define MFW_SIM_FCM 8
202
203 //x0pleela 20 July, 2006 ER: OMAPS00087586, OMAPS00087587
204
205 #define MFW_SIM_MKEY 9 //Master Unlocking during bootup
206 #define MFW_SIM_MKEYM 10 //Master Unlocking through menu
207 #define MFW_MASTER_UNLOCK_ACTIVE 1 //Master unlock enabled
208 #define MFW_MASTER_UNLOCK_DEACTIVE 0 //Master unlock disabled
209
210
211 //x0pleela 25 Sep, 2006 ER: OMAPS00095524
212 #define MFW_SIM_PBLOCK 11 //Blocked Network Type
213
214 #endif
215
216 //x0pleela 27 Apr, 2006 DR: OMAPS00067919
217
218 #ifdef SIM_PERS
219 typedef enum
220 {
221 SIMP_NONE,
222 SIMP_MENU,
223 SIMP_BOOTUP
224 }T_MFW_SIMP_CLCK_FLAG;
225
226 #endif
227
228 /*
229 * SIM Parameter
230 */
231 typedef union
232 {
233 T_MFW_SIM_STATUS status;
234 T_MFW_READ_CALLBACK callback;
235 } T_MFW_SIM_PARA;
236
237 #ifdef SIM_PERS
238 extern int C_KEY_REQ;
239 #endif
240
241 int sim_init (void);
242 MfwHnd sim_create (MfwHnd hWin, MfwEvt event, MfwCb cbfunc);
243 MfwRes sim_delete (MfwHnd h);
244 void sim_verify_pin (UBYTE pin_id, char *pin);
245 void sim_unblock_pin (UBYTE pin_id, char *puk, char *newpin);
246 void sim_change_pin (UBYTE pin_id, UBYTE *alt_pin, UBYTE *new_pin);
247 T_MFW sim_disable_pin (UBYTE *pin);/*SPR 2145, now returns status*/
248 T_MFW sim_enable_pin (UBYTE *pin);/*SPR 2145, now returns status*/
249 void sim_exit (void);
250 int sim_pin_count (UBYTE pin_id);
251 int SimHasPin (U8 pin_id);
252 void sim_pin_status (T_MFW_SIM_PIN_STATUS *status);
253 T_MFW sim_serv_table_check (UBYTE serv_num);
254 int sim_check_sim_Plock (void);
255 int sim_check_sim_Nlock (void);
256 int sim_check_sim_SPlock (void);
257 int sim_check_sim_NSlock (void);
258 int sim_check_sim_Clock (void);
259 MfwRes sim_configuration (UBYTE *phase, UBYTE *serv, UBYTE *slen,
260 UBYTE *lang, UBYTE *llen,
261 T_MFW_AOC_ACCESS *access);
262 void sim_save_pref_lang (UBYTE *lang, UBYTE len);
263 T_MFW sim_unlock_sim_lock (UBYTE type, UBYTE *passwd);
264 void sim_activate (void);
265 UBYTE * sim_get_imsi (void);
266 UBYTE sim_simlock_ok (void);
267
268 void mfwSimRestartPinEntry(void);
269 //xashmic 9 Sep 2006, OMAPS00092732
270 void sim_enable(void);
271 void sim_disable(void);
272
273 /*
274 Ciphering
275 */
276
277 // CPRImode :
278 #define MFW_SIM_CPRI_NO_SHOW 0
279 #define MFW_SIM_CPRI_SHOW 1
280
281 //Callback function
282 typedef void (* CallbackCPRI)(UBYTE, UBYTE);
283
284 //Initialize the ciphering indication
285 EXTERN UBYTE sim_init_CPRS (CallbackCPRI func, UBYTE CPRImode );
286 //TISH, patch for ASTec32515, modified by Jinshu Wang, 2007-06-15
287 //start
288 EXTERN void sim_invalid_ind(void);
289 //end
290 //x0pleela 03 Aug, 2006 ER: OMAPS00087586, OMAPS00087587
291 #ifdef SIM_PERS
292 //Set Simp_Busy_State to either TRUE or FALSE based on the ACI's busy error
293 void mfw_simlock_set_busy_state( UBYTE state );
294 //Get the current value of Simp_Busy_State
295 UBYTE mfw_simlock_get_busy_state( void );
296 #endif
297
298 #endif