annotate gsm-fw/g23m-aci/aci/psa_simf.c @ 775:eedbf248bac0

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