FreeCalypso > hg > freecalypso-citrine
comparison g23m-aci/aci/psa_simf.c @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : PSA_SIMF | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This module defines the functions for the protocol | |
18 | stack adapter for the subscriber identity module. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef PSA_SIMF_C | |
23 #define PSA_SIMF_C | |
24 #endif | |
25 | |
26 #include "config.h" | |
27 #include "fixedconf.h" | |
28 #include "condat-features.h" | |
29 #include "aci_conf.h" | |
30 | |
31 #include "aci_all.h" | |
32 | |
33 #undef TRACING | |
34 | |
35 /*==== INCLUDES ===================================================*/ | |
36 #include "aci_cmh.h" | |
37 #include "ati_cmd.h" | |
38 #include "aci_cmd.h" | |
39 #include "aci.h" | |
40 #include "psa.h" | |
41 #include "psa_sim.h" | |
42 #include "psa_util.h" | |
43 | |
44 #ifdef UART | |
45 #include "dti.h" | |
46 #include "dti_conn_mng.h" | |
47 #endif | |
48 | |
49 #ifdef SIM_TOOLKIT | |
50 #include "psa_cc.h" | |
51 #include "psa_sat.h" | |
52 #include "aci_fd.h" /* necessary for cmh.h */ | |
53 #include "cmh.h" /* necessary for cmh_sat.h */ | |
54 #include "cmh_sat.h" | |
55 #include "cmh_sim.h" | |
56 #endif /* SIM_TOOLKIT */ | |
57 | |
58 /*==== CONSTANTS ==================================================*/ | |
59 | |
60 #ifdef TRACING | |
61 #define ITM_WDT (14) /* item width in chars */ | |
62 #define HDR_WDT (10) /* header width in chars */ | |
63 #endif /* TRACING */ | |
64 | |
65 /*==== TYPES ======================================================*/ | |
66 | |
67 /*==== EXPORT =====================================================*/ | |
68 | |
69 /*==== VARIABLES ==================================================*/ | |
70 | |
71 /*==== FUNCTIONS ==================================================*/ | |
72 | |
73 /* | |
74 +-------------------------------------------------------------------+ | |
75 | PROJECT : GSM-PS (6147) MODULE : SAT | | |
76 | ROUTINE : psaSIM_ChkSIMSrvSup | | |
77 +-------------------------------------------------------------------+ | |
78 | |
79 PURPOSE : Check if the SIM service is supported or not. | |
80 | |
81 */ | |
82 | |
83 GLOBAL BOOL psaSIM_ChkSIMSrvSup( UBYTE srvNr ) | |
84 { | |
85 srvNr--; | |
86 | |
87 if( srvNr/4 >= SRV_TAB_LEN ) return ( FALSE ); | |
88 | |
89 if( ((simShrdPrm.srvTab[srvNr/4] >> ((srvNr%4)*2))&0x03) EQ | |
90 SRV_ALLOC_ACTIV ) | |
91 | |
92 return( TRUE ); | |
93 | |
94 return( FALSE ); | |
95 } | |
96 | |
97 /* | |
98 +-------------------------------------------------------------------+ | |
99 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMF | | |
100 | ROUTINE : psaSIM_atbNewEntry | | |
101 +-------------------------------------------------------------------+ | |
102 | |
103 PURPOSE : returns the access table index for an entry that is | |
104 free to use. -1 indicates that the access table is full. | |
105 */ | |
106 | |
107 GLOBAL SHORT psaSIM_atbNewEntry ( void ) | |
108 { | |
109 SHORT atbIdx; /* holds access table index */ | |
110 | |
111 for( atbIdx = 0; atbIdx < ACC_MAX; atbIdx++ ) | |
112 { | |
113 if( simShrdPrm.atb[atbIdx].ntryUsdFlg EQ FALSE ) | |
114 { | |
115 psaSIM_InitAtbNtry( atbIdx ); | |
116 | |
117 #if defined _SIMULATION_ | |
118 TRACE_EVENT_P1("SIM table ID = %d", atbIdx); | |
119 #endif | |
120 return( atbIdx ); | |
121 } | |
122 } | |
123 | |
124 TRACE_ERROR("[psaSIM_atbNewEntry]: did not find a new SIM table entry"); | |
125 return( -1 ); | |
126 } | |
127 | |
128 /* | |
129 +-------------------------------------------------------------------+ | |
130 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMF | | |
131 | ROUTINE : psaSIM_CloseAtb | | |
132 +-------------------------------------------------------------------+ | |
133 | |
134 PURPOSE : close all ATB entries with the provided SIM error code. | |
135 | |
136 */ | |
137 | |
138 GLOBAL void psaSIM_CloseAtb ( USHORT error ) | |
139 { | |
140 int atbIdx; /* holds access table index */ | |
141 | |
142 for( atbIdx = 0; atbIdx < ACC_MAX; atbIdx++ ) | |
143 { | |
144 if( simShrdPrm.atb[atbIdx].ntryUsdFlg ) | |
145 { | |
146 simShrdPrm.atb[atbIdx].errCode = error; | |
147 | |
148 if( simShrdPrm.atb[atbIdx].rplyCB ) | |
149 simShrdPrm.atb[atbIdx].rplyCB( (SHORT)atbIdx ); | |
150 | |
151 simShrdPrm.atb[atbIdx].ntryUsdFlg = FALSE; | |
152 } | |
153 } | |
154 } | |
155 /* | |
156 +-------------------------------------------------------------------+ | |
157 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMF | | |
158 | ROUTINE : psaSIM_InitAtbNtry | | |
159 +-------------------------------------------------------------------+ | |
160 | |
161 PURPOSE : initialize the indexed access table entry. | |
162 | |
163 */ | |
164 | |
165 GLOBAL void psaSIM_InitAtbNtry ( SHORT idx ) | |
166 { | |
167 | |
168 /* | |
169 *------------------------------------------------------------------- | |
170 * initialize access table entry | |
171 *------------------------------------------------------------------- | |
172 */ | |
173 simShrdPrm.atb[idx].ntryUsdFlg = FALSE; | |
174 simShrdPrm.atb[idx].accType = NO_VLD_ACT; | |
175 simShrdPrm.atb[idx].v_path_info = FALSE; | |
176 simShrdPrm.atb[idx].reqDataFld = 0; | |
177 simShrdPrm.atb[idx].dataOff = 0; | |
178 simShrdPrm.atb[idx].recNr = 0; | |
179 simShrdPrm.atb[idx].check_dataLen = FALSE; /* in case of read record operation, | |
180 datalen passed to SIM in the rquest will always be 0xFF. However when a buffer | |
181 has been passed, the size of data received from SIM to be copied in it has to | |
182 be checked...*/ | |
183 simShrdPrm.atb[idx].dataLen = 0; | |
184 simShrdPrm.atb[idx].exchData = NULL; | |
185 simShrdPrm.atb[idx].recMax = 0; | |
186 simShrdPrm.atb[idx].errCode = SIM_NO_ERROR; | |
187 simShrdPrm.atb[idx].rplyCB = NULL; | |
188 } | |
189 | |
190 | |
191 /* | |
192 +-------------------------------------------------------------------+ | |
193 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMF | | |
194 | ROUTINE : psaSIM_cnvrtIMSI2ASCII | | |
195 +-------------------------------------------------------------------+ | |
196 | |
197 PURPOSE : converts the IMSI into ASCII representation and returns | |
198 pointer to IMSI ASCII string. | |
199 */ | |
200 | |
201 GLOBAL CHAR* psaSIM_cnvrtIMSI2ASCII ( CHAR * imsiBuf ) | |
202 { | |
203 psaSIM_decodeIMSI ( simShrdPrm.imsi.field, | |
204 simShrdPrm.imsi.c_field, | |
205 imsiBuf); | |
206 return( imsiBuf ); | |
207 } | |
208 | |
209 | |
210 /* | |
211 PURPOSE : convert imsi (packed bcd to ASCIIZ; ->11.11) | |
212 */ | |
213 GLOBAL void psaSIM_decodeIMSI (UBYTE* imsi_field, | |
214 UBYTE imsi_c_field, | |
215 CHAR* imsi_asciiz) | |
216 { | |
217 UBYTE imsi_len; | |
218 UBYTE i; | |
219 UBYTE digit; | |
220 | |
221 TRACE_FUNCTION ("aci_slock_sim_decodeIMSI()"); | |
222 | |
223 /* | |
224 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | | |
225 +---+---+---+---+---+---+---+---+ | |
226 imsi_c_field = | Length indicator | | |
227 imsi_field[0] = | IMSI digit 1 | p | 0 | 0 | 1 | | |
228 imsi_field[1] = | IMSI digit 3 | IMSI digit 2 | | |
229 | |
230 | |
231 imsi_c_field = length indicator: | |
232 The length indicator refers to the number of significant bytes, | |
233 not including this length byte, required for the IMSI. | |
234 p = parity | |
235 0: Even number of IMSI digits | |
236 1: Odd number of IMSI digits | |
237 | |
238 If the number of IMSI digits is even then bits 5 to 8 of the last octet | |
239 shall be filled with an end mark coded as 1111b | |
240 */ | |
241 | |
242 /* | |
243 * Check length | |
244 */ | |
245 if ((imsi_c_field EQ 0) OR (imsi_c_field > (MAX_IMSI-1))) /* maybe 0xFF on some testcards */ | |
246 { | |
247 TRACE_EVENT_P1("[WRN] imsi_c_field = %d is not valid", imsi_c_field); | |
248 imsi_asciiz[0] = '\0'; /* return empty string in case of error */ | |
249 return; | |
250 } | |
251 | |
252 /* | |
253 * calculate number of digits | |
254 */ | |
255 imsi_len = (imsi_c_field)*2-1; /* -1 goes off for parity nibble */ | |
256 | |
257 /* | |
258 * if even number of digits then last upper nibble is an end mark '1111' | |
259 */ | |
260 if ((imsi_field[0] & 0x08) EQ 0) | |
261 { | |
262 imsi_len--; | |
263 } | |
264 | |
265 /* | |
266 * extract all digits | |
267 */ | |
268 for (i=0; i<imsi_len; i++) | |
269 { | |
270 if ((i & 1) EQ 0) | |
271 { | |
272 /* process IMSI digit 1,3,5,... at i=0,2,4,...*/ | |
273 digit = (imsi_field[(i+1)/2] & 0xf0) >> 4; /* +1 is to skip parity nibble */ | |
274 } | |
275 else | |
276 { | |
277 /* process IMSI digit 2,4,6,... at i=1,3,5,...*/ | |
278 digit = (imsi_field[(i+1)/2] & 0x0f); | |
279 } | |
280 | |
281 if (digit > 9) /* 3.03/2.3 IMSI shall consist of numerical characters (0 through 9) only.*/ | |
282 { | |
283 TRACE_EVENT("[WRN] invalid BCD digit found in IMSI, aborting"); | |
284 imsi_asciiz[0] = '\0'; /* return empty string in case of error */ | |
285 return; | |
286 } | |
287 else | |
288 { | |
289 imsi_asciiz[i] = '0' + digit; | |
290 } | |
291 } | |
292 imsi_asciiz[i] = '\0'; | |
293 return; | |
294 } | |
295 | |
296 /* | |
297 PURPOSE : convert imsi (ASCIIZ to packed bcd; ->11.11) | |
298 */ | |
299 GLOBAL void psaSIM_encodeIMSI (CHAR* imsi_asciiz, | |
300 UBYTE* imsi_c_field, | |
301 UBYTE* imsi_field) | |
302 { | |
303 UBYTE i; | |
304 UBYTE digit; | |
305 UBYTE imsi_len; | |
306 | |
307 TRACE_FUNCTION ("aci_slock_sim_encodeIMSI()"); | |
308 imsi_len = strlen(imsi_asciiz); | |
309 if (imsi_len > 15) /* 3.03/2.3 The overall number of digits in IMSI shall not exceed 15 digits. */ | |
310 { | |
311 TRACE_EVENT_P1("[WRN] imsi_len shall not exceed 15 digits, but is %d, truncating!", imsi_len); | |
312 imsi_len = 15; | |
313 } | |
314 | |
315 /* Calculate the Length indicator */ | |
316 *imsi_c_field = (imsi_len+1+1)/2; /* +1 for parity nibble and +1 to round up */ | |
317 imsi_field[0] = (imsi_len%2 ? 0x09:0x01); /* fill parity and some default bits */ | |
318 for (i=0; i<MAX_IMSI_LEN; i++) /* fill the whole EF field, pad remaining with 0xf */ | |
319 { | |
320 if (i<imsi_len) | |
321 { | |
322 digit = imsi_asciiz[i]; | |
323 if (digit >= '0' OR digit <= '9') | |
324 { | |
325 digit-= '0'; | |
326 } | |
327 else | |
328 { | |
329 TRACE_EVENT_P1("[WRN] invalid digit in IMSI \"%d\", skipping!", digit); | |
330 digit = 0x0f; | |
331 } | |
332 } | |
333 else | |
334 { | |
335 digit = 0x0f; /* 11.11/10.3.2 If a network operator chooses an IMSI of less than 15 digits, | |
336 unused nibbles shall be set to 'F'. */ | |
337 } | |
338 | |
339 if ((i & 1) EQ 0) | |
340 { | |
341 /* process IMSI digit 1,3,5,... at i=0,2,4,...*/ | |
342 imsi_field[(i+1)/2] |= digit << 4; /* first +1 is to skop parity nibble */ | |
343 } | |
344 else | |
345 { | |
346 /* process IMSI digit 2,4,6,... at i=1,3,5,...*/ | |
347 imsi_field[(i+1)/2] = digit; | |
348 } | |
349 } | |
350 } | |
351 | |
352 | |
353 | |
354 | |
355 /* | |
356 +-------------------------------------------------------------------+ | |
357 | PROJECT : GSM-PS (6147) MODULE : PSA_SIM | | |
358 | ROUTINE : psaSIM_Init | | |
359 +-------------------------------------------------------------------+ | |
360 | |
361 PURPOSE : initialize the protocol stack adapter for SIM. | |
362 | |
363 */ | |
364 | |
365 /* MACRO: initializer for set parameter */ | |
366 #define INIT_SIM_SET_PARM( dest, def )\ | |
367 for( LpCnt = 0; LpCnt < OWN_SRC_MAX; LpCnt++ )\ | |
368 simShrdPrm.setPrm[LpCnt].dest = def | |
369 | |
370 GLOBAL void psaSIM_Init (T_ACI_INIT_TYPE init_type) | |
371 { | |
372 UBYTE LpCnt; /* holds loop counter for macro */ | |
373 UBYTE atbIdx; /* holds index to access table */ | |
374 | |
375 #ifdef SIM_TOOLKIT | |
376 T_ACI_CMD_SRC cmd_src; /* for setting up SIMEF mode */ | |
377 UBYTE idx; /* holds profile index */ | |
378 #endif | |
379 | |
380 /* | |
381 *------------------------------------------------------------------- | |
382 * initialize access table | |
383 *------------------------------------------------------------------- | |
384 */ | |
385 for( atbIdx = 0; atbIdx < ACC_MAX; atbIdx++ ) | |
386 { | |
387 psaSIM_InitAtbNtry( atbIdx ); | |
388 } | |
389 | |
390 /* | |
391 *------------------------------------------------------------------- | |
392 * set default parms | |
393 *------------------------------------------------------------------- | |
394 */ | |
395 memset( simShrdPrm.setPrm, 0, sizeof(T_SIM_SET_PRM)); | |
396 memset( simShrdPrm.imsi.field, 0, MAX_IMSI); | |
397 simShrdPrm.rslt = SIM_NO_ERROR; | |
398 simShrdPrm.pn1Cnt = 0; | |
399 simShrdPrm.pn2Cnt = 0; | |
400 simShrdPrm.pk1Cnt = 0; | |
401 simShrdPrm.pk2Cnt = 0; | |
402 simShrdPrm.PINStat = NO_VLD_PS; | |
403 simShrdPrm.pn1Stat = NO_VLD_PS; | |
404 simShrdPrm.pn2Stat = NO_VLD_PS; | |
405 simShrdPrm.PINQuery = 0; | |
406 simShrdPrm.crdPhs = 0xFF; | |
407 simShrdPrm.SIMStat = NO_VLD_SS; | |
408 simShrdPrm.PEDStat = NO_VLD_PEDS; | |
409 simShrdPrm.imsi.c_field = 0; | |
410 simShrdPrm.PLMN_Mode_Bit = NOT_PRESENT_8BIT; | |
411 simShrdPrm.crdFun = SIM_NO_OPERATION; | |
412 simShrdPrm.ciSIMEnabled = TRUE; | |
413 simShrdPrm.imei_blocked = FALSE; | |
414 simShrdPrm.opl_list.opl_status = FALSE; | |
415 simShrdPrm.pnn_list.pnn_status = FALSE; | |
416 memset( simShrdPrm.srvTab, 0, SRV_TAB_LEN ); | |
417 #ifdef FF_SAT_E | |
418 simShrdPrm.sat_class_e_dti_id = DTI_DTI_ID_NOTPRESENT; | |
419 #endif /*FF_SAT_E*/ | |
420 #ifdef TI_PS_FF_AT_P_CMD_ATR | |
421 simShrdPrm.atr.len = 0; | |
422 #endif /* TI_PS_FF_AT_P_CMD_ATR */ | |
423 #ifdef FF_DUAL_SIM | |
424 simShrdPrm.SIM_Powered_on = 0; | |
425 simShrdPrm.SIM_Selection = FALSE; | |
426 #endif /*FF_DUAL_SIM*/ | |
427 INIT_SIM_SET_PARM( actProc, SIM_INITIALISATION ); | |
428 INIT_SIM_SET_PARM( PINType, 0 ); | |
429 | |
430 for( LpCnt = 0; LpCnt < OWN_SRC_MAX; LpCnt++ ) | |
431 { | |
432 memset( simShrdPrm.setPrm[LpCnt].curPIN, NOT_PRESENT_CHAR, PIN_LEN ); | |
433 memset( simShrdPrm.setPrm[LpCnt].newPIN, NOT_PRESENT_CHAR, PIN_LEN ); | |
434 memset( simShrdPrm.setPrm[LpCnt].unblkKey, NOT_PRESENT_CHAR, PUK_LEN ); | |
435 | |
436 #ifdef TI_PS_FF_AT_P_CMD_CUST | |
437 simShrdPrm.setPrm[LpCnt].cust_mode = (UBYTE)CUST_NORMAL_BEHAVIOUR; | |
438 #endif /* TI_PS_FF_AT_P_CMD_CUST */ | |
439 simShrdPrm.setPrm[LpCnt].sat_cc_mode = SATCC_CONTROL_BY_SIM_ACTIVE; | |
440 } | |
441 | |
442 #ifdef TI_PS_FF_AT_P_CMD_CUST | |
443 simShrdPrm.overall_cust_mode = (UBYTE)CUST_NORMAL_BEHAVIOUR; | |
444 #endif /* TI_PS_FF_AT_P_CMD_CUST */ | |
445 simShrdPrm.pb_stat = PB_STAT_Blocked; | |
446 | |
447 #ifdef SIM_TOOLKIT | |
448 | |
449 for (cmd_src=CMD_SRC_LCL;cmd_src<CMD_SRC_MAX;cmd_src++) | |
450 { | |
451 simShrdPrm.SIMEFMode[cmd_src]=SIMEF_MODE_OFF; | |
452 } | |
453 for( idx = 0; idx < MAX_STK_PRF; idx++ ) | |
454 { | |
455 INIT_SIM_SET_PARM( STKprof[idx], satDefPrfl[idx] ); | |
456 } | |
457 | |
458 if (init_type EQ ACI_INIT_TYPE_ALL) | |
459 { | |
460 if (!psaSAT_FURegister (cmhSIM_AD_Update)) | |
461 { | |
462 TRACE_EVENT ("FAILED to register the handler cmhSIM_AD_Update() for FU"); | |
463 } | |
464 if (!psaSAT_FURegister (cmhSIM_OpUpdate)) | |
465 { | |
466 TRACE_EVENT ("FAILED to register the handler cmhSIM_OpUpdate() for FU"); | |
467 } | |
468 if (!psaSAT_FURegister (cmhSIM_CSP_Update)) | |
469 { | |
470 TRACE_EVENT ("FAILED to register the handler cmhSIM_CSP_Update() for FU"); | |
471 } | |
472 if (!psaSAT_FURegister (cmhSIM_ONS_Update)) | |
473 { | |
474 TRACE_EVENT ("FAILED to register the handler cmhSIM_ONS_Update() for FU"); | |
475 } | |
476 } | |
477 else | |
478 { | |
479 cmhSAT_CBMDestroyList(); | |
480 } | |
481 #endif | |
482 | |
483 } | |
484 | |
485 /* | |
486 +-------------------------------------------------------------------+ | |
487 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMF | | |
488 | ROUTINE : psaSIM_shrPrmDump | | |
489 +-------------------------------------------------------------------+ | |
490 | |
491 PURPOSE : this function dumps the shared parameter to the debug | |
492 output. | |
493 */ | |
494 | |
495 #ifdef TRACING | |
496 GLOBAL void psaSIM_shrPrmDump ( void ) | |
497 { | |
498 char lnBuf [80]; /* holds buffer for output line */ | |
499 char pinBuf [PIN_LEN+1]; /* holds buffer for pin */ | |
500 SHORT chrNr; /* holds number of processed chars */ | |
501 | |
502 /* --- PIN type -------------------------------------------------*/ | |
503 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " PIN type" ); | |
504 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
505 simShrdPrm.setPrm[0].PINType ); | |
506 TRACE_EVENT( lnBuf ); | |
507 | |
508 /* --- current PIN ----------------------------------------------*/ | |
509 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " curr. PIN" ); | |
510 sprintf( pinBuf, "%*.*s", PIN_LEN, PIN_LEN, simShrdPrm.setPrm[0].curPIN ); | |
511 chrNr += sprintf( lnBuf+chrNr, "%*.*s", ITM_WDT, ITM_WDT, pinBuf ); | |
512 TRACE_EVENT( lnBuf ); | |
513 | |
514 /* --- new PIN --------------------------------------------------*/ | |
515 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " new PIN" ); | |
516 sprintf( pinBuf, "%*.*s", PIN_LEN, PIN_LEN, simShrdPrm.setPrm[0].newPIN ); | |
517 chrNr += sprintf( lnBuf+chrNr, "%*.*s", ITM_WDT, ITM_WDT, pinBuf ); | |
518 TRACE_EVENT( lnBuf ); | |
519 | |
520 /* --- unblock key ----------------------------------------------*/ | |
521 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "unblck.key" ); | |
522 sprintf( pinBuf, "%*.*s", PIN_LEN, PIN_LEN, simShrdPrm.setPrm[0].unblkKey ); | |
523 chrNr += sprintf( lnBuf+chrNr, "%*.*s", ITM_WDT, ITM_WDT, pinBuf ); | |
524 TRACE_EVENT( lnBuf ); | |
525 | |
526 /* --- PIN status -----------------------------------------------*/ | |
527 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "PIN status" ); | |
528 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
529 simShrdPrm.PINStat ); | |
530 TRACE_EVENT( lnBuf ); | |
531 | |
532 /* --- result ---------------------------------------------------*/ | |
533 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " result" ); | |
534 chrNr += sprintf( lnBuf+chrNr, "%*X", ITM_WDT, | |
535 simShrdPrm.rslt ); | |
536 TRACE_EVENT( lnBuf ); | |
537 | |
538 /* --- PIN 1 count ----------------------------------------------*/ | |
539 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " PIN 1 cnt" ); | |
540 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
541 simShrdPrm.pn1Cnt ); | |
542 TRACE_EVENT( lnBuf ); | |
543 | |
544 /* --- PIN 2 count ----------------------------------------------*/ | |
545 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " PIN 2 cnt" ); | |
546 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
547 simShrdPrm.pn2Cnt ); | |
548 TRACE_EVENT( lnBuf ); | |
549 | |
550 /* --- PUK 1 count ----------------------------------------------*/ | |
551 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " PUK 1 cnt" ); | |
552 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
553 simShrdPrm.pk1Cnt ); | |
554 TRACE_EVENT( lnBuf ); | |
555 | |
556 /* --- PUK 2 count ----------------------------------------------*/ | |
557 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " PUK 2 cnt" ); | |
558 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
559 simShrdPrm.pk2Cnt ); | |
560 TRACE_EVENT( lnBuf ); | |
561 | |
562 /* --- card phase -----------------------------------------------*/ | |
563 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "card phase" ); | |
564 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
565 simShrdPrm.crdPhs ); | |
566 TRACE_EVENT( lnBuf ); | |
567 | |
568 /* --- SIM status -----------------------------------------------*/ | |
569 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "SIM status" ); | |
570 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
571 simShrdPrm.SIMStat ); | |
572 TRACE_EVENT( lnBuf ); | |
573 | |
574 /* --- card functionality ---------------------------------------*/ | |
575 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "card funct" ); | |
576 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
577 simShrdPrm.crdFun ); | |
578 TRACE_EVENT( lnBuf ); | |
579 } | |
580 #endif /* of #ifdef TRACING */ | |
581 | |
582 #ifdef SIM_PERS_OTA | |
583 /* | |
584 +----------------------------------------------------------+ | |
585 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMF | | |
586 | ROUTINE : aci_slock_ota_init | | |
587 +----------------------------------------------------------+ | |
588 | |
589 PURPOSE : this function registers the ccmhSIM_Register_Read_DCKduring init | |
590 and also reads the contents of EF_DCK at the init | |
591 */ | |
592 | |
593 /* | |
594 +------------------------------------------------------------------------------ | |
595 | Function : aci_slock_ota_init | |
596 +------------------------------------------------------------------------------ | |
597 | Description : this function registers the ccmhSIM_Register_Read_DCKduring init | |
598 | and also reads the contents of EF_DCK at the init | |
599 | | |
600 | Parameters : None | |
601 | | |
602 | Return : None | |
603 | | |
604 +------------------------------------------------------------------------------ | |
605 */ | |
606 | |
607 GLOBAL void aci_slock_ota_init() | |
608 { | |
609 TRACE_FUNCTION("aci_slock_ota_init()"); | |
610 psaSAT_FURegister(cmhSIM_Register_Read_DCK); | |
611 } | |
612 #endif | |
613 /*==== EOF ========================================================*/ |