comparison cdg-hybrid/cdginc/uicc.h @ 9:6da1d56a96a3

cdg-hybrid: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 21:08:11 +0000
parents
children
comparison
equal deleted inserted replaced
8:ed162c9cd29f 9:6da1d56a96a3
1 /*
2 +--------------------------------------------------------------------------+
3 | PROJECT : PROTOCOL STACK |
4 | FILE : uicc.h |
5 | SOURCE : "sap\8010_136_SIMDRV_SAP.pdf" |
6 | LastModified : "2004-06-10" |
7 | IdAndVersion : "8010.136.03.009" |
8 | SrcFileTime : "Thu Nov 29 09:27:56 2007" |
9 | Generated by CCDGEN_2.5.5A on Fri Oct 14 21:41:52 2016 |
10 | !!DO NOT MODIFY!!DO NOT MODIFY!!DO NOT MODIFY!! |
11 +--------------------------------------------------------------------------+
12 */
13
14 /* PRAGMAS
15 * PREFIX : SIMDRV
16 * COMPATIBILITY_DEFINES : NO
17 * ALWAYS_ENUM_IN_VAL_FILE: YES
18 * ENABLE_GROUP: YES
19 * CAPITALIZE_TYPENAME: NO
20 */
21
22 #ifndef UICC_INCLUDE
23 #define UICC_INCLUDE
24
25
26 #define PUB_L1_MISC_ENTER__Uicc_H
27
28 #define PUB_L1_MISC_ENTER__FILENAME _Uicc_H
29 #define PUB_L1_MISC_ENTER__Uicc_H__FILE_TYPE CDGINC
30 #define PUB_L1_MISC_ENTER__Uicc_H__LAST_MODIFIED _2004_06_10
31 #define PUB_L1_MISC_ENTER__Uicc_H__ID_AND_VERSION _8010_136_03_009
32
33 #define PUB_L1_MISC_ENTER__Uicc_H__SRC_FILE_TIME _Thu_Nov_29_09_27_56_2007
34
35 #include "pub_L1_misc_enter.h"
36
37 #undef PUB_L1_MISC_ENTER__Uicc_H
38
39 #undef PUB_L1_MISC_ENTER__FILENAME
40
41
42 /*
43 * Enum to value table VAL_reset_return_val
44 * CCDGEN:WriteEnum_Count==30
45 */
46 #ifndef UICC_VAL_RESET_RETURN_VAL_CLASS
47 #define UICC_VAL_RESET_RETURN_VAL_CLASS
48 enum
49 {
50 UICC_SIM_INSERTED = 0x0, /* A SIM is inserted and ATR/PPS was successful */
51 UICC_SIM_NOT_INSERTED = 0x1, /* No SIM inserted (hardware detected) */
52 UICC_INVALID_CARD = 0x2, /* Card is not responding or gives unintelligible answers, communications time out. */
53 UICC_ME_FAILURE = 0x3, /* Power management related problems, e.g. voltage selection */
54 UICC_IMPROPER_CALL_BACK = 0x4, /* simdrv_register function called with pointer improperly set, e.g. NULL. */
55 UICC_ME_READER_NOT_AVAILABLE = 0x5 /* The reader requested is not available */
56 };
57 typedef Uint8 Uicc_ValResetReturnVal;
58 #endif /* UICC_VAL_RESET_RETURN_VAL_CLASS */
59
60 /*
61 * Enum to value table VAL_len
62 * CCDGEN:WriteEnum_Count==32
63 */
64 #ifndef UICC_VAL_LEN_CLASS
65 #define UICC_VAL_LEN_CLASS
66 enum
67 {
68 UICC_VAL_LEN__RANGE_MIN = 0x0, /* minimum */
69 UICC_VAL_LEN__RANGE_MAX = 0x100, /* maximum */
70 UICC_LENGTH_UNKNOWN = 0xffff /* Indicating that the length expected is unknown. */
71 };
72 typedef Uint16 Uicc_ValLen;
73 #endif /* UICC_VAL_LEN_CLASS */
74
75 /*
76 * Enum to value table VAL_sw1_2
77 * CCDGEN:WriteEnum_Count==34
78 */
79 #ifndef UICC_VAL_SW_1_2_CLASS
80 #define UICC_VAL_SW_1_2_CLASS
81 enum
82 {
83 UICC_ERR_NOCARD = 0x1, /* No SIM inserted (hardware detected) */
84 UICC_ERR_NOT_RESET = 0x2, /* A reset has not been performed on the driver with the requested Id. */
85 UICC_ERR_ME_FAIL = 0x3, /* Unrecoverable ME failure (for instance interrupt fails to occur) */
86 UICC_ERR_RETRY_FAIL = 0x4, /* ME/SIM communication failed after certain retries, SIM reset required */
87 UICC_ERR_PARAM_WRONG = 0x5 /* A driver function is called with invalid parameters */
88 };
89 typedef Uint8 Uicc_ValSw1_2;
90 #endif /* UICC_VAL_SW_1_2_CLASS */
91
92 /*
93 * Enum to value table VAL_cla
94 * CCDGEN:WriteEnum_Count==36
95 */
96 #ifndef UICC_VAL_CLA_CLASS
97 #define UICC_VAL_CLA_CLASS
98 enum
99 {
100 UICC_GSM_CLASS_BYTE = 0xa0, /* GSM Class byte according to [GSM 11.11 / 3GPP 51.011] */
101 UICC_UMTS_CLASS_BYTE = 0x80, /* UMTS Class byte according to [ETSI 102 221 10.1.2] */
102 UICC_UICC_CLASS_BYTE = 0x0 /* UICC Class byte according to [ISO 7816-4] */
103 };
104 typedef Uint8 Uicc_ValCla;
105 #endif /* UICC_VAL_CLA_CLASS */
106
107 /*
108 * Enum to value table VAL_ins
109 * CCDGEN:WriteEnum_Count==38
110 */
111 #ifndef UICC_VAL_INS_CLASS
112 #define UICC_VAL_INS_CLASS
113 enum
114 {
115 UICC_INS_SELECT = 0xa4, /* Select Instruction */
116 UICC_INS_STATUS = 0xf2, /* Status Instruction */
117 UICC_INS_READ_BINARY = 0xb0, /* Read Binary Instruction */
118 UICC_INS_UPDATE_BINARY = 0xd6, /* Update Binary Instruction */
119 UICC_INS_READ_RECORD = 0xb2, /* Read Record Instruction */
120 UICC_INS_UPDATE_RECORD = 0xdc, /* Update Record Instruction */
121 UICC_INS_SEEK = 0xa2, /* Seek Instruction */
122 UICC_INS_INCREASE = 0x32, /* Increase Instruction */
123 UICC_INS_VERIFY_CHV = 0x20, /* Verify Chv Instruction */
124 UICC_INS_CHANGE_CHV = 0x24, /* Change Chv Instruction */
125 UICC_INS_DISABLE_CHV = 0x26, /* Disable Chv Instruction */
126 UICC_INS_ENABLE_CHV = 0x28, /* Ensable Chv Instruction */
127 UICC_INS_UNBLOCK_CHV = 0x2c, /* Unblock Chv Instruction */
128 UICC_INS_INVALIDATE = 0x4, /* Invalidate Instruction */
129 UICC_INS_REHABILITATE = 0x44, /* Rehabilitate Instruction */
130 UICC_INS_AUTHENTICATE = 0x88, /* Run GSM Algorithm (2/2.5G) / Authenticate (3G) Instruction */
131 UICC_INS_TERMINAL_PROFILE = 0x10, /* Terminal Profile Instruction */
132 UICC_INS_ENVELOPE = 0xc2, /* Envelope Instruction */
133 UICC_INS_FETCH = 0x12, /* Fetch Instruction */
134 UICC_INS_TERMINAL_RESPONSE = 0x14, /* Terminal Response Instruction */
135 UICC_INS_GET_RESPONSE = 0xc0 /* Get Response Instruction */
136 };
137 typedef Uint8 Uicc_ValIns;
138 #endif /* UICC_VAL_INS_CLASS */
139
140 /*
141 * Enum to value table VAL_voltage_select
142 * CCDGEN:WriteEnum_Count==40
143 */
144 #ifndef UICC_VAL_VOLTAGE_SELECT_CLASS
145 #define UICC_VAL_VOLTAGE_SELECT_CLASS
146 enum
147 {
148 UICC_REQ_VOLTAGE_SEL = 0x0, /* The SIM reader driver shall perform voltage selection */
149 UICC_OMIT_VOLTAGE_SEL = 0x1 /* The SIM reader driver shall restart with the current voltage */
150 };
151 typedef Uint8 Uicc_ValVoltageSelect;
152 #endif /* UICC_VAL_VOLTAGE_SELECT_CLASS */
153
154 /*
155 * Enum to value table VAL_config_requested
156 * CCDGEN:WriteEnum_Count==42
157 */
158 #ifndef UICC_VAL_CONFIG_REQUESTED_CLASS
159 #define UICC_VAL_CONFIG_REQUESTED_CLASS
160 enum
161 {
162 UICC_OMIT_CONFIG_CHARACTERISTICS = 0x0, /* PS Shall not retrieve Configuration Characteristics */
163 UICC_REQUEST_CONFIG_CHARACTERISTICS = 0x1 /* PS Shall retrieve Configuration Characteristics */
164 };
165 typedef Uint8 Uicc_ValConfigRequested;
166 #endif /* UICC_VAL_CONFIG_REQUESTED_CLASS */
167
168 /*
169 * Enum to value table VAL_reader_id
170 * CCDGEN:WriteEnum_Count==44
171 */
172 #ifndef UICC_VAL_READER_ID_CLASS
173 #define UICC_VAL_READER_ID_CLASS
174 enum
175 {
176 UICC_VAL_READER_ID__RANGE_MIN = 0x1, /* minimum */
177 UICC_VAL_READER_ID__RANGE_MAX = 0x2 /* maximum */
178 };
179 typedef Uint8 Uicc_ValReaderId;
180 #endif /* UICC_VAL_READER_ID_CLASS */
181 #define UICC_SIZE_ATR_INFO (0x21)
182 #ifndef UICC_ATR_STRING_INFO_CLASS
183 #define UICC_ATR_STRING_INFO_CLASS
184 /*
185 * SIM Card Info
186 * CCDGEN:WriteStruct_Count==1284
187 */
188 typedef struct
189 {
190 Uint8 atrStringArrayCount; /*< 0: 1> counter */
191 Uint8 atrStringArray[UICC_SIZE_ATR_INFO]; /*< 1: 33> SIM Card Answer to reset string */
192 Uint8 __dummy0; /*< 34: 1> alignment */
193 Uint8 __dummy1; /*< 35: 1> alignment */
194 } Uicc_AtrStringInfo;
195 #endif /* UICC_ATR_STRING_INFO_CLASS */
196
197
198 /*
199 * typedef between var and valtab enums
200 */
201 #ifndef UICC_LEN_CLASS
202 #define UICC_LEN_CLASS
203 typedef Uicc_ValLen Uicc_Len;
204 #endif /* Uicc_Len_CLASS */
205 #define UICC_MAX_RESULT (0x100)
206 #ifndef UICC_RESULT_INFO_CLASS
207 #define UICC_RESULT_INFO_CLASS
208 /*
209 * Result Buffer
210 * CCDGEN:WriteStruct_Count==1286
211 */
212 typedef struct
213 {
214 Uicc_Len len; /*< 0: 2> Uicc_Len, Maximum length of expected data */
215 Uint16 resultArrayCount; /*< 2: 2> counter */
216 Uint8 *resultArray; /*< 4: 4> pointer codetransparent to Result byte */
217 } Uicc_ResultInfo;
218 #endif /* UICC_RESULT_INFO_CLASS */
219
220 #define UICC_MAX_DATA_SIZE (0xff)
221 #ifndef UICC_DATA_INFO_CLASS
222 #define UICC_DATA_INFO_CLASS
223 /*
224 * Data element info
225 * CCDGEN:WriteStruct_Count==1288
226 */
227 typedef struct
228 {
229 Uint8 __dummy0; /*< 0: 1> alignment */
230 Uint8 __dummy1; /*< 1: 1> alignment */
231 Uint8 __dummy2; /*< 2: 1> alignment */
232 Uint8 dataArrayCount; /*< 3: 1> counter */
233 Uint8 *dataArray; /*< 4: 4> pointer codetransparent to Data element */
234 } Uicc_DataInfo;
235 #endif /* UICC_DATA_INFO_CLASS */
236
237
238 /*
239 * typedef between var and valtab enums
240 */
241 #ifndef UICC_CLA_CLASS
242 #define UICC_CLA_CLASS
243 typedef Uicc_ValCla Uicc_Cla;
244 #endif /* Uicc_Cla_CLASS */
245 #ifndef UICC_INS_CLASS
246 #define UICC_INS_CLASS
247 typedef Uicc_ValIns Uicc_Ins;
248 #endif /* Uicc_Ins_CLASS */
249 #ifndef UICC_CMD_HEADER_CLASS
250 #define UICC_CMD_HEADER_CLASS
251 /*
252 * Transparent command header
253 * CCDGEN:WriteStruct_Count==1290
254 */
255 typedef struct
256 {
257 Uicc_Cla cla; /*< 0: 1> Uicc_Cla, Class Byte */
258 Uicc_Ins ins; /*< 1: 1> Uicc_Ins, instruction code */
259 Uint8 p1; /*< 2: 1> Parameter 1 of the SIM APDU */
260 Uint8 p2; /*< 3: 1> Parameter 2 of the SIM APDU */
261 } Uicc_CmdHeader;
262 #endif /* UICC_CMD_HEADER_CLASS */
263
264 #ifndef UICC_CONFIG_CHARACTERISTICS_CLASS
265 #define UICC_CONFIG_CHARACTERISTICS_CLASS
266 /*
267 * Configuration Characteristics
268 * CCDGEN:WriteStruct_Count==1292
269 */
270 typedef struct
271 {
272 Uint8 uiccCharacteristics; /*< 0: 1> UICC Characteristics */
273 Uint8 __dummy0; /*< 1: 1> alignment */
274 Uint8 __dummy1; /*< 2: 1> alignment */
275 Uint8 __dummy2; /*< 3: 1> alignment */
276 } Uicc_ConfigCharacteristics;
277 #endif /* UICC_CONFIG_CHARACTERISTICS_CLASS */
278
279
280 /*
281 * typedef between var and valtab enums
282 */
283 #ifndef UICC_RESET_RETURN_VAL_CLASS
284 #define UICC_RESET_RETURN_VAL_CLASS
285 typedef Uicc_ValResetReturnVal Uicc_ResetReturnVal;
286 #endif /* Uicc_ResetReturnVal_CLASS */
287 #ifndef UICC_LEN_CLASS
288 #define UICC_LEN_CLASS
289 typedef Uicc_ValLen Uicc_Len;
290 #endif /* Uicc_Len_CLASS */
291 #ifndef UICC_SW_1_2_CLASS
292 #define UICC_SW_1_2_CLASS
293 typedef Uicc_ValSw1_2 Uicc_Sw1_2;
294 #endif /* Uicc_Sw1_2_CLASS */
295 #ifndef UICC_CLA_CLASS
296 #define UICC_CLA_CLASS
297 typedef Uicc_ValCla Uicc_Cla;
298 #endif /* Uicc_Cla_CLASS */
299 #ifndef UICC_INS_CLASS
300 #define UICC_INS_CLASS
301 typedef Uicc_ValIns Uicc_Ins;
302 #endif /* Uicc_Ins_CLASS */
303 #ifndef UICC_VOLTAGE_SELECT_CLASS
304 #define UICC_VOLTAGE_SELECT_CLASS
305 typedef Uicc_ValVoltageSelect Uicc_VoltageSelect;
306 #endif /* Uicc_VoltageSelect_CLASS */
307 #ifndef UICC_CONFIG_REQUESTED_CLASS
308 #define UICC_CONFIG_REQUESTED_CLASS
309 typedef Uicc_ValConfigRequested Uicc_ConfigRequested;
310 #endif /* Uicc_ConfigRequested_CLASS */
311 #ifndef UICC_READER_ID_CLASS
312 #define UICC_READER_ID_CLASS
313 typedef Uicc_ValReaderId Uicc_ReaderId;
314 #endif /* Uicc_ReaderId_CLASS */
315 #ifndef UICC_DUMMY_CLASS
316 #define UICC_DUMMY_CLASS
317 /*
318 *
319 * CCDGEN:WriteStruct_Count==1294
320 */
321 typedef struct
322 {
323 Puf_PrimHdr primHdr;
324 Uicc_AtrStringInfo *atrStringInfoPtr; /*< 0: 4> pointer to SIM Card Info */
325 Uicc_ResetReturnVal resetReturnVal; /*< 4: 1> Uicc_ResetReturnVal, Reset return value */
326 Uint8 __dummy0; /*< 5: 1> alignment */
327 Uint8 __dummy1; /*< 6: 1> alignment */
328 Uint8 __dummy2; /*< 7: 1> alignment */
329 Uicc_ResultInfo *resultInfoPtr; /*< 8: 4> pointer to Result Buffer */
330 Uicc_Len len; /*< 12: 2> Uicc_Len, Maximum length of expected data */
331 Uint8 __dummy3; /*< 14: 1> alignment */
332 Uint8 __dummy4; /*< 15: 1> alignment */
333 Uicc_DataInfo *dataInfoPtr; /*< 16: 4> pointer to Data element info */
334 Uicc_Sw1_2 sw1_2; /*< 20: 2> Uicc_Sw1_2, Status Words */
335 Uicc_Cla cla; /*< 22: 1> Uicc_Cla, Class Byte */
336 Uicc_Ins ins; /*< 23: 1> Uicc_Ins, instruction code */
337 Uicc_CmdHeader cmdHeader; /*< 24: 4> Transparent command header */
338 Uicc_VoltageSelect voltageSelect; /*< 28: 1> Uicc_VoltageSelect, Perform Voltage Selection */
339 Uint8 p1; /*< 29: 1> Parameter 1 of the SIM APDU */
340 Uint8 p2; /*< 30: 1> Parameter 2 of the SIM APDU */
341 Uicc_ConfigRequested configRequested; /*< 31: 1> Uicc_ConfigRequested, Configuration Characteristics requested */
342 Uicc_ConfigCharacteristics *configCharacteristicsPtr; /*< 32: 4> pointer to Configuration Characteristics */
343 Uicc_ReaderId readerId; /*< 36: 1> Uicc_ReaderId, Reader Id */
344 Uint8 uiccCharacteristics; /*< 37: 1> UICC Characteristics */
345 Uint8 __dummy5; /*< 38: 1> alignment */
346 Uint8 __dummy6; /*< 39: 1> alignment */
347 } Uicc_Dummy;
348
349 #define UICC_DUMMY_SIZE() \
350 ( \
351 sizeof(Uicc_Dummy) \
352 )
353 #endif /* UICC_DUMMY_CLASS */
354
355 #define UICC_MIN_RESULT (0x1)
356 #define UICC_MIN_DATA_SIZE (0x1)
357 #define UICC_MAX_READERS (0x2)
358
359 #include "pub_L1_misc_leave.h"
360
361
362 #endif