comparison src/aci2/aci/psa_simf.c @ 3:93999a60b835

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