comparison g23m/condat/ms/src/mfw/mfw_sim.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
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 Nov 24, 2005 DR: OMAPS00045909 - Shashi Shekar B.S.
11 Description: Improve IMEI control mechanism
12 Solution : When MMI calls sAT_PLUSCFUN, if an IMEI invalid error is returned,
13 we will block on that screen & will not allow the user to browse menus further,
14 since the PS will not be booted at all!!!
15
16 July 19, 2005 REF: CRR LOCOSTO-ENH-28173 xpradipg
17 Description: To provide MMI Support to enable/disable/change password and
18 query all the Personalization locks
19 Solution: Integration of the changes for the same provided by the soldel
20 team
21
22 ***********************************************************************
23
24 PURPOSE: Types definitions for SIM management of MMI framework
25
26 */
27
28 #ifndef DEF_MFW_SIM
29 #define DEF_MFW_SIM
30
31 /*#ifndef BMI_TEST_MC_SIM_EVENT
32 #define BMI_TEST_MC_SIM_EVENT
33 #endif*/
34
35 /*
36 * events are organised as bitmaps
37 */
38 #define E_SIM_STATUS 0x0001
39 #define E_SIM_INSERTED 0x0002
40 #define E_SIM_RESET 0x0004
41 #define E_SIM_READ_CALLBACK 0x0008/*MC CONQ5862, 13/06/02*, added new event*/
42
43 #define E_SIM_ALL_SERVICES 0x000f
44
45 #define SIM_ACTIVE 0
46 #define SIM_NOT_ACTIVE 1
47 #define SIM_STK_RESET 2 // bugfix for SIM refresh
48 #define IMEI_NOT_VALID 3 // Nov 24, 2005, a0876501, DR: OMAPS00045909
49
50 typedef struct {
51 UBYTE sim_procedure;
52 UBYTE sim_status;
53 UBYTE sim_operation_mode;
54 UBYTE sim_pin_retries;
55 UBYTE sim_status_type;
56 } T_MFW_SIM_STATUS; /* type definition for E_SIM_STATUS event */
57
58 typedef struct {
59 UBYTE type; /* MFW_SIM_PIN1/MFW_SIM_PIN2 */
60 UBYTE set; /* MFW_SIM_ENABLE/MFW_SIM_DISABLE */
61 UBYTE stat ; /* MFW_SIM_NO_PIN/MFW_SIM_PIN_REQ/MFW_SIM_PIN2_REQ */
62 } T_MFW_SIM_PIN_STATUS;
63
64 /*MC CONQ5862, 13/06/02*, added new data struct for E_SIM_READ_CALLBACK event*/
65 typedef struct {
66 SHORT error_code;
67 UBYTE* read_buffer;
68 } T_MFW_READ_CALLBACK;
69
70 /* SIM configuration information */
71 typedef struct
72 {
73 UBYTE access_acm;
74 UBYTE access_acmmax;
75 UBYTE access_puct;
76 } T_MFW_AOC_ACCESS;
77
78 #ifdef SIM_PERS
79 #define UNBLOCK_SUCESS 1
80 #define UNBLOCK_FAILURE 2
81 #define BOOTUP_LOCK_SUCCESS 3
82 #define BOOTUP_LOCK_FAILURE 4
83 #define MFW_SIM_NOT_BLOCKED 10
84 #define MFW_SIM_PERM_BLOCKED 11
85 #endif
86
87 /* definition of SIM procedure in E_SIM_STATUS event */
88
89 #define MFW_SIM_ACTIVATION 1
90 #define MFW_SIM_VERIFY 2
91 #define MFW_SIM_UNBLOCK 3
92 #define MFW_SIM_CHANGE 4
93 #define MFW_SIM_ENABLE 5
94 #define MFW_SIM_DISABLE 6
95 #define MFW_SIM_LOCKED 7
96 #define MFW_SIM_BLOCKED 8
97 #define MFW_SIM_REMOVED 9
98
99
100
101 /* definition of SIM operation mode in E_SIM_STATUS event */
102
103 #define MFW_SIM_NO_OPERATION 0
104 #define MFW_SIM_ADN_ENABLED 1
105 #define MFW_SIM_FDN_ENABLED 2
106 #define MFW_SIM_ADN_BDN_ENABLED 5
107 #define MFW_SIM_FDN_BDN_ENABLED 6
108
109 /* definition of SIM status in E_SIM_STATUS event */
110
111 #define MFW_SIM_PIN_REQ 1
112 #define MFW_SIM_PUK_REQ 2
113 #define MFW_SIM_PIN2_REQ 3
114 #define MFW_SIM_PUK2_REQ 4
115 #define MFW_SIM_INVALID_CARD 5
116 #define MFW_SIM_NO_SIM_CARD 6
117 #define MFW_SIM_NO_PIN 7
118 #define MFW_SIM_SUCCESS 8
119 #define MFW_SIM_FAILURE 9
120 #ifdef SIM_PERS
121 #define MFW_SIM_NLOCK_REQ 10
122 #define MFW_SIM_NSLOCK_REQ 11
123 #define MFW_SIM_SPLOCK_REQ 12
124 #define MFW_SIM_CLOCK_REQ 13
125 #define MFW_SIM_PLOCK_REQ 14
126 #define MFW_SIM_PLOCK_ERR 15
127 #define MFW_SIM_PLOCK_OK 16
128 #endif
129 #define MFW_SIM_NO_DISABLE 10 /*MC CONQ-5578, PIN disabling forbidden*/
130 /* Shashi Shekar B.S. DR: OMAPS00045909, Improve IMEI control mechanism */
131 #define MFW_IMEI_NOT_VALID 20
132
133
134 #define MFW_SIM_PIN1 1
135 #define MFW_SIM_PUK1 2
136 #define MFW_SIM_PIN2 3
137 #define MFW_SIM_PUK2 4
138 #define MFW_SIM_UNKNOWN 0
139
140 #define MFW_SIM_NLOCK 1
141 #define MFW_SIM_SPLOCK 2
142 #define MFW_SIM_NSLOCK 3
143 #define MFW_SIM_CLOCK 4
144 #define MFW_SIM_PLOCK 5
145 #define MFW_SIM_UNLOCK_ERR 6
146 #ifdef SIM_PERS
147 #define MFW_SIM_FC 7
148 #define MFW_SIM_FCM 8
149 #endif
150
151
152
153 /*
154 * SIM Parameter
155 */
156 typedef union
157 {
158 T_MFW_SIM_STATUS status;
159 T_MFW_READ_CALLBACK callback;
160 } T_MFW_SIM_PARA;
161
162 #ifdef SIM_PERS
163 extern int C_KEY_REQ;
164 #endif
165
166 int sim_init (void);
167 MfwHnd sim_create (MfwHnd hWin, MfwEvt event, MfwCb cbfunc);
168 MfwRes sim_delete (MfwHnd h);
169 void sim_verify_pin (UBYTE pin_id, char *pin);
170 void sim_unblock_pin (UBYTE pin_id, char *puk, char *newpin);
171 void sim_change_pin (UBYTE pin_id, UBYTE *alt_pin, UBYTE *new_pin);
172 T_MFW sim_disable_pin (UBYTE *pin);/*SPR 2145, now returns status*/
173 T_MFW sim_enable_pin (UBYTE *pin);/*SPR 2145, now returns status*/
174 void sim_exit (void);
175 int sim_pin_count (UBYTE pin_id);
176 int SimHasPin (U8 pin_id);
177 void sim_pin_status (T_MFW_SIM_PIN_STATUS *status);
178 T_MFW sim_serv_table_check (UBYTE serv_num);
179 int sim_check_sim_Plock (void);
180 int sim_check_sim_Nlock (void);
181 int sim_check_sim_SPlock (void);
182 int sim_check_sim_NSlock (void);
183 int sim_check_sim_Clock (void);
184 MfwRes sim_configuration (UBYTE *phase, UBYTE *serv, UBYTE *slen,
185 UBYTE *lang, UBYTE *llen,
186 T_MFW_AOC_ACCESS *access);
187 void sim_save_pref_lang (UBYTE *lang, UBYTE len);
188 T_MFW sim_unlock_sim_lock (UBYTE type, UBYTE *passwd);
189 void sim_activate (void);
190 UBYTE * sim_get_imsi (void);
191 UBYTE sim_simlock_ok (void);
192
193 void mfwSimRestartPinEntry(void);
194
195 /*
196 Ciphering
197 */
198
199 // CPRImode :
200 #define MFW_SIM_CPRI_NO_SHOW 0
201 #define MFW_SIM_CPRI_SHOW 1
202
203 //Callback function
204 typedef void (* CallbackCPRI)(UBYTE, UBYTE);
205
206 //Initialize the ciphering indication
207 EXTERN UBYTE sim_init_CPRS (CallbackCPRI func, UBYTE CPRImode );
208
209
210 #endif