comparison g23m/condat/ms/src/aci/cmh_sim.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (6147)
4 | Modul : CMH
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Definitions for the command handler of the
18 | Subscriber Identity Module ( SIM )
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef CMH_SIM_H
23 #define CMH_SIM_H
24
25 /*==== CONSTANTS ==================================================*/
26
27 #define ACI_SIZE_EF_CCP 14
28 #define ACI_MIN_SIZE_EF_MSISDN 14
29 #define ACI_MIN_SIZE_EF_PLMN_SEL 24
30 #define ACI_LEN_PLMN_SEL_NTRY 3 /* length of an entry in bytes */
31 #define ACI_LEN_PLMN_SEL_FLD MAX_PREF_PLMN /* Moved to SAP SIM to be consistent with MM */
32
33
34 #define ACI_LEN_LAN_NTRY 2 /* length of an entry in bytes */
35 #define ACI_MAX_LAN_NTRY 10 /* number of supported entries */
36 #define ACI_MIN_SIZE_EF_LAN 16
37 #define ACI_LEN_LAN_FLD (ACI_LEN_LAN_NTRY*ACI_MAX_LAN_NTRY)
38
39
40 #define ACI_LEN_LAN_LP_NTRY 1 /* length of an entry in bytes */
41 #define ACI_MAX_LAN_LP_NTRY 5 /* number of supported entries */
42 #define ACI_LEN_LAN_LP_FLD (ACI_LEN_LAN_LP_NTRY*ACI_MAX_LAN_LP_NTRY)
43
44 #define SIM_ALS_LOCK (SIM_FDN_DISABLE+1) /* To distinguish between the different operations */
45 #define SIM_ALS_UNLOCK (SIM_FDN_DISABLE+2) /* which require a CHV2 authentication */
46
47
48 typedef enum
49 {
50 EF_STAT_UNKNWN = 0, /* status of EF unknown */
51 EF_STAT_READ, /* EF already read */
52 EF_STAT_NOT_AVAIL /* EF is not available */
53 } EF_STAT;
54
55 typedef enum
56 {
57 CPOL_ACT_None = 0, /* no action */
58 CPOL_ACT_Write, /* write entry */
59 CPOL_ACT_Delete, /* delete entry */
60 CPOL_ACT_Read, /* read entry */
61 CPOL_ACT_Test /* test number of entries */
62 } ACI_CPOL_ACT;
63
64 typedef enum
65 {
66 CLAN_ACT_None = 0, /* no action */
67 CLAN_ACT_Write, /* write entry */
68 CLAN_ACT_Read /* read entry */
69 } ACI_CLAN_ACT;
70
71 /*==== TYPES ======================================================*/
72
73 /*==== PROTOTYPES =================================================*/
74
75 EXTERN void cmhSIM_SIMActivated ( void );
76 EXTERN void cmhSIM_PINVerified ( void );
77 EXTERN void cmhSIM_SIMSync ( void );
78 EXTERN void cmhSIM_SIMInserted ( void );
79 EXTERN void cmhSIM_SIMRemoved ( void );
80 EXTERN void cmhSIM_PINChanged ( void );
81 EXTERN void cmhSIM_PINEnabled ( void );
82 EXTERN void cmhSIM_PINDisabled ( void );
83 EXTERN void cmhSIM_CardUnblocked ( void );
84 #ifdef FF_DUAL_SIM
85 EXTERN void cmhSIM_SIMSelected ( void );
86 #endif /*FF_DUAL_SIM*/
87 EXTERN void cmhSIM_FillInPIN ( CHAR* PINStr,
88 CHAR* PINFld,
89 UBYTE len );
90 EXTERN void cmhSIM_GetHomePLMN ( SHORT* mccBuf,
91 SHORT* mncBuf );
92 GLOBAL BOOL cmhSIM_plmn_equal_sim ( SHORT bcch_mcc,
93 SHORT bcch_mnc,
94 SHORT sim_mcc,
95 SHORT sim_mnc);
96 EXTERN BOOL cmhSIM_plmn_is_hplmn ( SHORT bcch_mcc,
97 SHORT bcch_mnc);
98 EXTERN T_ACI_RETURN cmhSIM_ReqMsisdn ( T_ACI_CMD_SRC srcId,
99 UBYTE record );
100 EXTERN void cmhSIM_CnfMsisdn ( SHORT table_id );
101 EXTERN T_ACI_RETURN cmhSIM_ReqCcp ( T_ACI_CMD_SRC srcId,
102 UBYTE record );
103 EXTERN void cmhSIM_CnfCcp ( SHORT table_id );
104 EXTERN T_ACI_RETURN cmhSIM_ReqPlmnSel ( T_ACI_CMD_SRC srcId);
105 EXTERN void cmhSIM_RdCnfPlmnSel ( SHORT table_id );
106 EXTERN void cmhSIM_WrCnfPlmnSel ( SHORT table_id );
107 EXTERN T_ACI_CME_ERR cmhSIM_GetCmeFromSim ( USHORT errCode );
108 EXTERN SHORT cmhSIM_FillPlmnSelList ( UBYTE index,
109 T_ACI_CPOL_FRMT frmt,
110 T_ACI_CPOL_OPDESC* operLst,
111 UBYTE length,
112 UBYTE* pData );
113
114 EXTERN T_ACI_RETURN getSupLangFromPCM ( T_ACI_LAN_SUP *lanlst,
115 SHORT *lastIdx );
116
117 EXTERN BOOL checkSuppLang (T_ACI_LAN_SUP *lanlst,
118 SHORT lastIdx,
119 T_ACI_LAN_SUP *clng);
120
121 EXTERN BOOL checkSuppLangInLP ( T_ACI_LAN_SUP *lanlst,
122 SHORT lastIdx,
123 T_ACI_LAN_SUP *clng);
124
125 EXTERN SHORT cmhSIM_UsdPlmnSelNtry ( UBYTE length,
126 UBYTE* pData );
127 EXTERN void cmhSIM_CmpctPlmnSel ( UBYTE length,
128 UBYTE* pData );
129 EXTERN T_ACI_BS_SPEED cmhSIM_GetUserRate ( UBYTE userRate );
130 EXTERN T_ACI_CNUM_ITC cmhSIM_GetItc ( UBYTE itc );
131 EXTERN T_ACI_CNUM_SERV cmhSIM_GetSrvFromSync ( UBYTE sync );
132 EXTERN T_ACI_CNUM_SERV cmhSIM_GetSrvFromItc ( UBYTE itc );
133 EXTERN void cmhSIM_getMncMccFrmPLMNsel( const UBYTE* ntry,
134 SHORT* mcc,
135 SHORT* mnc );
136 EXTERN BOOL cmhSIM_GetCodedPLMN ( const CHAR *oper,
137 T_ACI_CPOL_FRMT format,
138 UBYTE *sim_plmn );
139 EXTERN T_ACI_RETURN cmhSIM_WritePlmnSel ( T_ACI_CMD_SRC srcId );
140 EXTERN T_ACI_RETURN cmhSIM_DelPlmnSel ( T_ACI_CMD_SRC srcId,
141 SHORT index,
142 T_ACI_CPOL_MOD mode );
143 EXTERN T_ACI_RETURN cmhSIM_FndEmptyPlmnSel ( T_ACI_CMD_SRC srcId,
144 UBYTE *plmn );
145 EXTERN T_ACI_RETURN cmhSIM_UpdPlmnSel ( T_ACI_CMD_SRC srcId,
146 SHORT index,
147 UBYTE *plmn,
148 T_ACI_CPOL_MOD mode );
149 EXTERN T_ACI_RETURN cmhSIM_ChgPlmnSel ( T_ACI_CMD_SRC srcId,
150 SHORT index,
151 SHORT index2 );
152 EXTERN void cmhSIM_SIMResponseData ( T_SIM_TRNS_RSP_PRM* rsp );
153
154 EXTERN T_ACI_RETURN cmhSIM_ReqLanguage ( T_ACI_CMD_SRC srcId);
155
156 EXTERN void cmhSIM_RdCnfLangELP ( SHORT table_id );
157
158 EXTERN BOOL cmhSIM_ReqLanguagePrf (void);
159
160 EXTERN void cmhSIM_RdCnfLangPrfELP (SHORT table_id);
161
162
163 EXTERN T_ACI_RETURN cmhSIM_ReqLanguageLP ( T_ACI_CMD_SRC srcId);
164 EXTERN void cmhSIM_RdCnfLangLP ( SHORT table_id );
165
166 EXTERN BOOL cmhSIM_ReqLanguagePrfLP (void);
167 EXTERN void cmhSIM_RdCnfLangPrfLP (SHORT table_id);
168
169 EXTERN BOOL cmhSIM_AD_Update ( int, T_SIM_FILE_UPDATE_IND *);
170 EXTERN BOOL cmhSIM_CSP_Update ( int, T_SIM_FILE_UPDATE_IND *);
171 EXTERN BOOL cmhSIM_ONS_Update ( int, T_SIM_FILE_UPDATE_IND *);
172 EXTERN void cmhSIM_Read_AD_cb(SHORT table_id);
173 EXTERN void cmhSIM_Read_AD_cb(SHORT table_id);
174 EXTERN T_opl_field* cmhSIM_GetOPL();
175 EXTERN void cmhSIM_GetSrvTab( UBYTE* ptrSrvTab );
176 EXTERN void cmhSIM_Get_CSP_cb(SHORT table_id);
177 EXTERN void cmhSIM_Read_CSP_cb(SHORT table_id);
178 #ifdef SIM_PERS_OTA
179 EXTERN BOOL cmhSIM_Register_Read_DCK ( int, T_SIM_FILE_UPDATE_IND *);
180 EXTERN void cmhSIM_Read_DCK_cb(SHORT table_id);
181 EXTERN void cmhSIM_Read_DCK_init_cb(SHORT table_id);
182 #endif
183
184 /* EONS */
185 EXTERN BOOL cmhSIM_OpReadOplRcd( UBYTE rcd);
186 EXTERN void cmhSIM_OpReadOplRcdCb(SHORT table_id);
187 EXTERN BOOL cmhSIM_OpReadPnnRcd( UBYTE rcd);
188 EXTERN void cmhSIM_OpReadPnnRcdCb(SHORT table_id);
189 EXTERN BOOL cmhSIM_OpUpdate(int ref, T_SIM_FILE_UPDATE_IND* fu);
190 EXTERN void cmhSIM_InitOperatorName();
191 EXTERN BOOL cmhSIM_StartOperatorName();
192 EXTERN BOOL cmhSIM_UpdateOperatorName(USHORT reqDataFld);
193
194 #ifdef DTI
195 EXTERN BOOL SIM_ENT_CSDconnect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
196 #endif
197 #if defined (GPRS) AND defined (DTI)
198 EXTERN BOOL SIM_SNDCP_connect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
199 EXTERN BOOL SIM_ENT_GPRSconnect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
200 #endif
201
202 /*==== EXPORT =====================================================*/
203
204 #ifdef CMH_SIMF_C
205
206 GLOBAL T_ENT_STAT simEntStat;
207
208 GLOBAL T_ACI_CFUN_FUN CFUNfun = CFUN_FUN_Minimum;
209
210 GLOBAL UBYTE CNUMMaxRec = 0;
211 GLOBAL T_ACI_CNUM_LST CNUMMsisdn;
212 GLOBAL UBYTE CNUMMsisdnIdx = 0;
213 GLOBAL UBYTE CNUMLenEfMsisdn = 0;
214 GLOBAL UBYTE EfPLMNselStat = EF_STAT_UNKNWN;
215 GLOBAL UBYTE CPOLSimEfDataLen;
216 GLOBAL UBYTE CPOLSimEfData[ACI_LEN_PLMN_SEL_FLD];
217
218 GLOBAL UBYTE CLANimEfDataLen;
219 GLOBAL UBYTE CLANSimEfData[ACI_LEN_LAN_FLD];
220 GLOBAL UBYTE CLANSimEfDataLP[ACI_LEN_LAN_LP_FLD];
221
222 #else
223
224 EXTERN T_ENT_STAT simEntStat;
225
226 EXTERN T_ACI_CFUN_FUN CFUNfun;
227
228 EXTERN UBYTE CNUMMaxRec;
229 EXTERN T_ACI_CNUM_LST CNUMMsisdn;
230 EXTERN UBYTE CNUMMsisdnIdx;
231 EXTERN UBYTE CNUMLenEfMsisdn;
232 EXTERN UBYTE EfPLMNselStat;
233 EXTERN UBYTE CPOLSimEfDataLen;
234 EXTERN UBYTE CPOLSimEfData[];
235
236 EXTERN UBYTE CLANimEfDataLen;
237 EXTERN UBYTE CLANSimEfData[];
238 EXTERN UBYTE CLANSimEfDataLP[];
239 #endif /* CMH_SIMF_C */
240
241 #endif /* CMH_SIM_H */
242
243 /*==== EOF =======================================================*/