comparison src/g23m-aci/aci/cmh_sim.h @ 1:d393cd9bb723

src/g23m-*: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
0:b6a5e36de839 1:d393cd9bb723
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 #ifdef FF_CPHS_REL4
48 #define ACI_SIZE_EF_CFIS 16
49 #define ACI_SIZE_EF_MBDN 34
50 #define ACI_SIZE_EF_MBI 4
51 #define ACI_SIZE_EF_MWIS 5
52 #endif /* FF_CPHS_REL4 */
53
54 typedef enum
55 {
56 EF_STAT_UNKNWN = 0, /* status of EF unknown */
57 EF_STAT_READ, /* EF already read */
58 EF_STAT_NOT_AVAIL /* EF is not available */
59 } EF_STAT;
60
61 typedef enum
62 {
63 CPOL_ACT_None = 0, /* no action */
64 CPOL_ACT_Write, /* write entry */
65 CPOL_ACT_Delete, /* delete entry */
66 CPOL_ACT_Read, /* read entry */
67 CPOL_ACT_Test /* test number of entries */
68 } ACI_CPOL_ACT;
69
70 typedef enum
71 {
72 CLAN_ACT_None = 0, /* no action */
73 CLAN_ACT_Write, /* write entry */
74 CLAN_ACT_Read /* read entry */
75 } ACI_CLAN_ACT;
76
77 /*==== TYPES ======================================================*/
78
79 /*==== PROTOTYPES =================================================*/
80
81 EXTERN void cmhSIM_SIMActivated ( void );
82 EXTERN void cmhSIM_PINVerified ( void );
83 EXTERN void cmhSIM_SIMSync ( void );
84 EXTERN void cmhSIM_SIMInserted ( void );
85 EXTERN void cmhSIM_SIMRemoved ( void );
86 #ifdef FF_DUAL_SIM
87 EXTERN void cmhSIM_SIMSelected ( void );
88 #endif /*FF_DUAL_SIM*/
89 EXTERN void cmhSIM_FillInPIN ( CHAR* PINStr,
90 CHAR* PINFld,
91 UBYTE len );
92 EXTERN void cmhSIM_GetHomePLMN ( SHORT* mccBuf,
93 SHORT* mncBuf );
94 GLOBAL BOOL cmhSIM_plmn_equal_sim ( SHORT bcch_mcc,
95 SHORT bcch_mnc,
96 SHORT sim_mcc,
97 SHORT sim_mnc);
98 EXTERN BOOL cmhSIM_plmn_is_hplmn ( SHORT bcch_mcc,
99 SHORT bcch_mnc);
100 EXTERN T_ACI_RETURN cmhSIM_ReqMsisdn ( T_ACI_CMD_SRC srcId,
101 UBYTE record );
102 EXTERN void cmhSIM_CnfMsisdn ( SHORT table_id );
103 EXTERN T_ACI_RETURN cmhSIM_ReqCcp ( T_ACI_CMD_SRC srcId,
104 UBYTE record );
105 EXTERN void cmhSIM_CnfCcp ( SHORT table_id );
106 EXTERN void cmhSIM_RdCnfPlmnSel ( SHORT table_id );
107 EXTERN void cmhSIM_WrCnfPlmnSel ( SHORT table_id );
108 EXTERN T_ACI_CME_ERR cmhSIM_GetCmeFromSim ( USHORT errCode );
109 EXTERN SHORT cmhSIM_FillPlmnSelList ( UBYTE index,
110 T_ACI_CPOL_FRMT frmt,
111 T_ACI_CPOL_OPDESC* operLst,
112 UBYTE length,
113 UBYTE* pData );
114
115 EXTERN T_ACI_RETURN getSupLangFromPCM ( T_ACI_LAN_SUP *lanlst,
116 SHORT *lastIdx );
117
118 EXTERN BOOL checkSuppLang (T_ACI_LAN_SUP *lanlst,
119 SHORT lastIdx,
120 T_ACI_LAN_SUP *clng);
121
122 EXTERN BOOL checkSuppLangInLP ( T_ACI_LAN_SUP *lanlst,
123 SHORT lastIdx,
124 T_ACI_LAN_SUP *clng);
125
126 EXTERN SHORT cmhSIM_UsdPlmnSelNtry ( UBYTE length,
127 UBYTE* pData );
128 EXTERN void cmhSIM_CmpctPlmnSel ( UBYTE length,
129 UBYTE* pData );
130 EXTERN T_ACI_BS_SPEED cmhSIM_GetUserRate ( UBYTE userRate );
131 EXTERN T_ACI_CNUM_ITC cmhSIM_GetItc ( UBYTE itc );
132 EXTERN T_ACI_CNUM_SERV cmhSIM_GetSrvFromSync ( UBYTE sync );
133 EXTERN T_ACI_CNUM_SERV cmhSIM_GetSrvFromItc ( UBYTE itc );
134 EXTERN void cmhSIM_getMncMccFrmPLMNsel( const UBYTE* ntry,
135 SHORT* mcc,
136 SHORT* mnc );
137 EXTERN BOOL cmhSIM_GetCodedPLMN ( const CHAR *oper,
138 T_ACI_CPOL_FRMT format,
139 UBYTE *sim_plmn );
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 void cmhSIM_RdCnfLangELP ( SHORT table_id );
155
156
157 EXTERN void cmhSIM_RdCnfLangPrfELP (SHORT table_id);
158
159 EXTERN void cmhSIM_RdCnfLangLP ( SHORT table_id );
160
161
162 EXTERN void cmhSIM_RdCnfLangPrfLP (SHORT table_id);
163
164 EXTERN BOOL cmhSIM_AD_Update ( int, T_SIM_FILE_UPDATE_IND *);
165 EXTERN BOOL cmhSIM_CSP_Update ( int, T_SIM_FILE_UPDATE_IND *);
166 EXTERN BOOL cmhSIM_ONS_Update ( int, T_SIM_FILE_UPDATE_IND *);
167 EXTERN void cmhSIM_Read_AD_cb(SHORT table_id);
168 EXTERN void cmhSIM_Read_AD_cb(SHORT table_id);
169 EXTERN T_opl_field* cmhSIM_GetOPL();
170 EXTERN void cmhSIM_GetSrvTab( UBYTE* ptrSrvTab );
171 EXTERN void cmhSIM_Get_CSP_cb(SHORT table_id);
172 EXTERN void cmhSIM_Read_CSP_cb(SHORT table_id);
173
174 #ifdef FF_CPHS_REL4
175 EXTERN void cmhSIM_RdCnfCfis( SHORT table_id );
176 EXTERN void cmhSIM_WrCnfCfis( SHORT table_id );
177 EXTERN T_ACI_RETURN cmhSIM_WrCfis (T_ACI_CMD_SRC srcId,
178 T_ACI_CFIS_MOD mode, UBYTE index,
179 UBYTE mspId,UBYTE cfuStat,CHAR *number,
180 T_ACI_TOA *type,UBYTE cc2_id);
181 EXTERN void cmhSIM_RdCnfMwis( SHORT table_id );
182 EXTERN void cmhSIM_WrCnfMwis( SHORT table_id );
183 EXTERN T_ACI_RETURN cmhSIM_WrMwis (T_ACI_CMD_SRC srcId,
184 T_ACI_MWIS_MOD mode,
185 UBYTE mspId,
186 T_ACI_MWIS_MWI *mwis);
187 EXTERN T_ACI_RETURN cmhSIM_WrMbdn (T_ACI_CMD_SRC srcId,
188 T_ACI_MBN_MODE mode, UBYTE index,
189 CHAR* number, T_ACI_TOA* type,
190 UBYTE cc2_id, T_ACI_PB_TEXT *text);
191 EXTERN void cmhSIM_WrCnfMbdn ( SHORT table_id );
192 EXTERN void cmhSIM_RdCnfMbi ( SHORT table_id );
193 EXTERN void cmhSIM_RdCnfMbdn ( SHORT table_id );
194 #endif /* FF_CPHS_REL4 */
195
196 #ifdef SIM_PERS_OTA
197 EXTERN BOOL cmhSIM_Register_Read_DCK ( int, T_SIM_FILE_UPDATE_IND *);
198 EXTERN void cmhSIM_Read_DCK_cb(SHORT table_id);
199 EXTERN void cmhSIM_Read_DCK_init_cb(SHORT table_id);
200 #endif
201
202 #ifdef SIM_PERS
203 EXTERN void cmhSIM_UnlockTimeout(void);
204 #endif
205
206 /* EONS */
207 EXTERN void cmhSIM_OpReadOplRcdCb(SHORT table_id);
208 EXTERN void cmhSIM_OpReadPnnRcdCb(SHORT table_id);
209 EXTERN BOOL cmhSIM_OpUpdate(int ref, T_SIM_FILE_UPDATE_IND* fu);
210 EXTERN void cmhSIM_InitOperatorName();
211 EXTERN BOOL cmhSIM_StartOperatorName();
212 EXTERN BOOL cmhSIM_UpdateOperatorName(USHORT reqDataFld);
213
214 EXTERN void cmhSIM_AD_Updated(UBYTE ad_len, UBYTE* ad_data);
215
216 #ifdef DTI
217 EXTERN BOOL SIM_ENT_CSDconnect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
218 #endif
219 #if defined (GPRS) AND defined (DTI)
220 EXTERN BOOL SIM_SNDCP_connect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
221 EXTERN BOOL SIM_ENT_GPRSconnect_dti_cb(UBYTE dti_id, T_DTI_CONN_STATE result_type);
222 #endif
223
224 EXTERN T_ACI_RETURN cmhSIM_Req_or_Write_PlmnSel ( T_ACI_CMD_SRC srcId,
225 T_SIM_ACTP accType );
226 EXTERN void cmhSIM_CardUnblocked_PINChanged ( BOOL PINChanged );
227 EXTERN void cmhSIM_PINEnabledDisabled ( void );
228 EXTERN BOOL cmhSIM_ReqLanguagePrf_LP_or_ELP ( USHORT reqDataFld,
229 UBYTE recMax,
230 UBYTE *exchData,
231 void (*rplyCB)(SHORT) );
232 EXTERN T_ACI_RETURN cmhSIM_ReqLanguage_LP_or_ELP ( T_ACI_CMD_SRC srcId,
233 USHORT reqDataFld );
234
235 /*==== EXPORT =====================================================*/
236
237 #ifdef CMH_SIMF_C
238
239 GLOBAL T_ENT_STAT simEntStat;
240
241 GLOBAL T_ACI_CFUN_FUN CFUNfun = CFUN_FUN_Minimum;
242
243 GLOBAL UBYTE CNUMMaxRec = 0;
244 GLOBAL T_ACI_CNUM_LST CNUMMsisdn;
245 GLOBAL UBYTE CNUMMsisdnIdx = 0;
246 GLOBAL UBYTE CNUMLenEfMsisdn = 0;
247 GLOBAL UBYTE EfPLMNselStat = EF_STAT_UNKNWN;
248 GLOBAL UBYTE CPOLSimEfDataLen;
249 GLOBAL UBYTE CPOLSimEfData[ACI_LEN_PLMN_SEL_FLD];
250
251 GLOBAL UBYTE CLANimEfDataLen;
252 GLOBAL UBYTE CLANSimEfData[ACI_LEN_LAN_FLD];
253 GLOBAL UBYTE CLANSimEfDataLP[ACI_LEN_LAN_LP_FLD];
254 #ifdef FF_CPHS_REL4
255 GLOBAL UBYTE CFISIndex = 0;
256 GLOBAL UBYTE MWISIndex = 0;
257 GLOBAL UBYTE MBI_Index = 0;
258 #endif
259 #else
260
261 EXTERN T_ENT_STAT simEntStat;
262
263 EXTERN T_ACI_CFUN_FUN CFUNfun;
264
265 EXTERN UBYTE CNUMMaxRec;
266 EXTERN T_ACI_CNUM_LST CNUMMsisdn;
267 EXTERN UBYTE CNUMMsisdnIdx;
268 EXTERN UBYTE CNUMLenEfMsisdn;
269 EXTERN UBYTE EfPLMNselStat;
270 EXTERN UBYTE CPOLSimEfDataLen;
271 EXTERN UBYTE CPOLSimEfData[];
272
273 EXTERN UBYTE CLANimEfDataLen;
274 EXTERN UBYTE CLANSimEfData[];
275 EXTERN UBYTE CLANSimEfDataLP[];
276 #ifdef FF_CPHS_REL4
277 EXTERN UBYTE CFISIndex ;
278 EXTERN UBYTE MWISIndex;
279 EXTERN UBYTE MBI_Index;
280 #endif
281 #endif /* CMH_SIMF_C */
282
283 #endif /* CMH_SIM_H */
284
285 /*==== EOF =======================================================*/