comparison chipsetsw/drivers/drv_app/ffs/pcm.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-MFW (?) $Workfile:: pcm.h $|
4 | $Author: mmj $Revision:: 1 $|
5 | CREATED: 07.10.98 $Modtime:: 15.12.99 10:59 $|
6 | STATE : code |
7 +--------------------------------------------------------------------+
8
9 PURPOSE : Types definitions for the permanent memory configuration
10 */
11
12 #ifndef DEF_PCM
13 #define DEF_PCM
14
15 #ifndef TARGET
16 #include "ffs.cfg"
17 #endif
18
19 #if (TARGET == 1)
20 #include "rv/general.h"
21 #else
22 typedef unsigned char UBYTE;
23 typedef unsigned short USHORT;
24 #endif
25
26 #define LEN_MSCAP (NR_EF_MSCAP * SIZE_EF_MSCAP) + 2
27 #define LEN_IMEI (NR_EF_IMEI * SIZE_EF_IMEI) + 2
28 #define LEN_IMSI (NR_EF_IMSI * SIZE_EF_IMSI) + 2
29 #define LEN_SMS (NR_EF_SMS * SIZE_EF_SMS) + 2
30 #define LEN_CLASS2 (NR_EF_CLASS2 * SIZE_EF_CLASS2) + 2
31 #define LEN_CLASS3 (NR_EF_CLASS3 * SIZE_EF_CLASS3) + 2
32 #define LEN_MSSUP (NR_EF_MSSUP * SIZE_EF_MSSUP) + 2
33 #define LEN_CLNG (NR_EF_CLNG * SIZE_EF_CLNG) + 2
34 #define LEN_MSSET (NR_EF_MSSET * SIZE_EF_MSSET) + 2
35 #define LEN_HZCACHE (NR_EF_HZCACHE * SIZE_EF_HZCACHE) + 2
36 #define LEN_LDN (NR_EF_LDN * SIZE_EF_LDN) + 2
37 #define LEN_LRN (NR_EF_LRN * SIZE_EF_LRN) + 2
38 #define LEN_LMN (NR_EF_LMN * SIZE_EF_LMN) + 2
39 #define LEN_UPN (NR_EF_UPN * SIZE_EF_UPN) + 2
40 #define LEN_MBN (NR_EF_MBN * SIZE_EF_MBN) + 2
41 #define LEN_VMN (NR_EF_VMN * SIZE_EF_VMN) + 2
42 #define LEN_CTIM (NR_EF_CTIM * SIZE_EF_CTIM) + 2
43 #define LEN_CCNT (NR_EF_CCNT * SIZE_EF_CCNT) + 2
44 #define LEN_ECC (NR_EF_ECC * SIZE_EF_ECC) + 2
45 #define LEN_ORG (NR_EF_ORG * SIZE_EF_ORG) + 2
46 #define LEN_CCP (NR_EF_CCP * SIZE_EF_CCP) + 2
47 #define LEN_EXT1 (NR_EF_EXT1 * SIZE_EF_EXT1) + 2
48 #define LEN_SIMLCK (NR_EF_SIMLCK * SIZE_EF_SIMLCK) + 2
49 #define LEN_MAIN (NR_EF_MAIN * SIZE_EF_MAIN) + 2
50 #define LEN_SFK (NR_EF_SFK * SIZE_EF_SFK) + 2
51 #define LEN_FAULT (NR_EF_FAULT * SIZE_EF_FAULT) + 2
52 #define LEN_DEBUG (NR_EF_DEBUG * SIZE_EF_DEBUG) + 2
53 #define LEN_POWER (NR_EF_POWER * SIZE_EF_POWER) + 2
54 #define LEN_KEYB (NR_EF_KEYB * SIZE_EF_KEYB) + 2
55 #define LEN_RADIO (NR_EF_RADIO * SIZE_EF_RADIO) + 2
56 #define LEN_CGMI (NR_EF_CGMI * SIZE_EF_CGMI) + 2
57 #define LEN_INF0 (NR_EF_INF0 * SIZE_EF_INF0) + 2
58 #define LEN_CGMM (NR_EF_CGMM * SIZE_EF_CGMM) + 2
59 #define LEN_CGMR (NR_EF_CGMR * SIZE_EF_CGMR) + 2
60 #define LEN_CGSN (NR_EF_CGSN * SIZE_EF_CGSN) + 2
61 #define LEN_SMSPRFL (NR_EF_SMSPRFL * SIZE_EF_SMSPRFL) + 2
62 #define LEN_PLMN (NR_EF_PLMN * SIZE_EF_PLMN) + 2
63 #define LEN_BCCHINFO (NR_EF_BCCHINFO * SIZE_EF_BCCHINFO) + 2
64 #define LEN_ALS (NR_EF_ALS * SIZE_EF_ALS) + 2
65 #define LEN_LOCGPRS (NR_EF_LOCGPRS * SIZE_EF_LOCGPRS) + 2
66 #define LEN_KCGPRS (NR_EF_KCGPRS * SIZE_EF_KCGPRS) + 2
67 #define LEN_IMSIGPRS (NR_EF_IMSIGPRS * SIZE_EF_IMSIGPRS) + 2
68
69 #define PCM_SIZE (LEN_MSCAP + LEN_IMEI + LEN_IMSI + LEN_SMS + \
70 LEN_CLASS2 + LEN_CLASS3 + LEN_MSSUP + LEN_CLNG + \
71 LEN_MSSET + LEN_HZCACHE+ LEN_LDN + LEN_LRN + LEN_LMN + \
72 LEN_UPN + LEN_MBN + LEN_VMN + LEN_CTIM + \
73 LEN_CCNT + LEN_ECC + LEN_ORG + LEN_CCP + \
74 LEN_EXT1 + LEN_SIMLCK + LEN_MAIN + LEN_SFK + \
75 LEN_FAULT + LEN_DEBUG + LEN_POWER + LEN_KEYB + \
76 LEN_RADIO + LEN_CGMI + LEN_INF0 + LEN_CGMM + \
77 LEN_CGMR + LEN_CGSN + LEN_SMSPRFL + LEN_PLMN + \
78 LEN_BCCHINFO + LEN_ALS + LEN_LOCGPRS + LEN_KCGPRS + \
79 LEN_IMSIGPRS)
80
81 /********************************************************************
82 *
83 * Parameters written in flash memory
84 *
85 ********************************************************************/
86
87 #define PCM_SERIAL_CONFIG (0)
88
89 /********************************************************************
90 *
91 * Access functions to bit fields
92 *
93 ********************************************************************/
94
95 #define EXTERN extern
96
97 #ifndef __BF_FUNCCALL__
98 #define FldGet(f,n) ((((ULONG)f)&((ULONG)n##m))>>n##s)
99 #define FldSet(f,n,v) ((((ULONG)f)&(~((ULONG)n##m)))|(((ULONG)v)<<n##s))
100 #else
101 ULONG FldGet (ULONG f, ULONG m, int s)
102 { return ((f&m)>>s); }
103 ULONG FldSet (ULONG f, ULONG m, int s, ULONG v)
104 { return ((f&(~m))|((v<<s)&m)); }
105 #endif
106
107 /********************************************************************
108 *
109 * Field Identitifer
110 *
111 ********************************************************************/
112
113 #define EF_MSCAP_ID "MSCAP" /* Mobile Capabilities */
114 #define EF_IMEI_ID "IMEI" /* Int. Mobile Equipment Id. */
115 #define EF_IMSI_ID "IMSI" /* Int. Mobile Subscriber Id. */
116 #define EF_SMS_ID "SMS" /* Short Message Service */
117 #define EF_CLASS2_ID "CLASS2" /* MS Classmark 2 */
118 #define EF_CLASS3_ID "CLASS3" /* MS Classmark 3 */
119 #define EF_MSSUP_ID "MSSUP" /* Mobile Setup */
120 #define EF_CLNG_ID "CLNG" /* Current Language */
121 #define EF_MSSET_ID "MSSET" /* MS Settings */
122 #define EF_HZCACHE_ID "HZCACHE" /* Homezone cache */
123 #define EF_LDN_ID "LDN" /* Last MOC Numbers */
124 #define EF_LRN_ID "LRN" /* Last MTC Numbers */
125 #define EF_LMN_ID "LMN" /* Last MTC Missed Numbers */
126 #define EF_UPN_ID "UPN" /* User Personal Numbers */
127 #define EF_MBN_ID "MBN" /* Mailbox Numbers */
128 #define EF_VMN_ID "VMN" /* Voice Mail Number */
129 #define EF_CTIM_ID "CTIM" /* Call Timer */
130 #define EF_CCNT_ID "CCNT" /* Call Counter */
131 #define EF_ECC_ID "ECC" /* Emergency Call Codes */
132 #define EF_ORG_ID "ORG" /* Organizer and Alarm */
133 #define EF_CCP_ID "CCP" /* Cap and Config Params */
134 #define EF_EXT1_ID "EXT1" /* Extension 1 */
135 #define EF_SIMLCK_ID "SIMLCK" /* SIM Lock */
136 #define EF_SIMLCKEXT_ID "SIMLCKEXT" /* Extended SIM Lock */
137 #define EF_MAIN_ID "MAIN" /* Maintenance Information */
138 #define EF_SFK_ID "SFK" /* Special Function Keys */
139 #define EF_FAULT_ID "FAULT" /* Fault Conditions */
140 #define EF_DEBUG_ID "DEBUG" /* Debug Information */
141 #define EF_POWER_ID "POWER" /* Power Management */
142 #define EF_KEYB_ID "KEYB" /* Keyboard Mapping */
143 #define EF_RADIO_ID "RADIO" /* Radio Parameters */
144 #define EF_CGMI_ID "CGMI" /* Manufacturer */
145 #define EF_INF0_ID "INF0" /* Identification Information */
146 #define EF_CGMM_ID "CGMM" /* Model */
147 #define EF_CGMR_ID "CGMR" /* Revision */
148 #define EF_CGSN_ID "CGSN" /* Product Serial Number */
149 #define EF_SMSPRFL_ID "SMSPRFL" /* SMS Profile */
150 #define EF_PLMN_ID "PLMN" /* PLMN Identifier */
151 #define EF_BCCHINFO_ID "BCCHINF" /* BCCH Information */
152 #define EF_ALS_ID "ALS" /* Alternative Line Service */
153 #define EF_LOCGPRS_ID "LOCGPRS" /* Location Info. (GPRS) */
154 #define EF_KCGPRS_ID "KCGPRS" /* Ciphering Key (GPRS) */
155 #define EF_IMSIGPRS_ID "IMSIGPRS" /* IMSI (GPRS) */
156
157 /********************************************************************
158 *
159 * Return Values
160 *
161 ********************************************************************/
162
163 #define drv_Return_Type UBYTE
164 #define PCM_OK 0
165 #define PCM_INITIALIZED 1
166 #define PCM_INVALID_FILE 2
167 #define PCM_INVALID_SIZE 3
168 #define PCM_INVALID_CKSM 4
169 #define PCM_INVALID_RECORD 5
170 #define PCM_NVRAM_ACCS_FAIL 6
171 #define PCM_ERASE_ERROR 7
172 #define PCM_WRITE_ERROR 8
173
174 /*
175 * Field Info Structure
176 */
177 typedef struct pcm_FileInfo_Type
178 {
179 UBYTE *FileLocation;
180 USHORT FileSize;
181 UBYTE Version;
182 } pcm_FileInfo_Type;
183
184 typedef struct
185 {
186 char *identifier;
187 USHORT start;
188 USHORT length;
189 USHORT records;
190 } T_PCM_DESCRIPTION;
191
192
193 /********************************************************************
194 *
195 * Field MOBILE CAPABILITIES - MSCAP
196 *
197 ********************************************************************/
198
199 typedef struct pcm_EFmscap_Type
200 {
201 UBYTE chnMode; /* channel modes */
202 UBYTE datCap1; /* data capabilities */
203 UBYTE datCap2; /* data capabilities */
204 UBYTE featLst1; /* feature list */
205 UBYTE featLst2; /* feature list */
206 UBYTE featLst3; /* feature list */
207 } EF_MSCAP;
208
209 #define SIZE_EF_MSCAP 6
210 #define NR_EF_MSCAP 1
211
212 /*
213 * chnMode bits
214 * _______________________________________________________
215 * |8 |7 |6 |5 |4 |3 |2 |1 |
216 * |------|------|------|------|------|------|------|------|
217 * |L1 |Tm |afs |ahs |spV3 |efrV2 |hr |spV1 |
218 * -------------------------------------------------------
219 */
220 #define spchSupV1 0x00000001,0 /* speech support (vers. 1) */
221 #define spchSupV1m 0x00000001
222 #define spchSupV1s 0
223 #define hrSup 0x00000002,1 /* HR support */
224 #define hrSupm 0x00000002
225 #define hrSups 1
226 #define HR_EFRSup 0x00000006,1 /* HR and EFR support */
227 #define HR_EFRSupm 0x00000006
228 #define HR_EFRSups 1
229 #define EFRSupV2 0x00000004,2 /* enhanced FR support (v2) */
230 #define EFRSupV2m 0x00000004
231 #define EFRSupV2s 2
232 #define EFRSupV3 0x00000008,3 /* speech support (vers 3) */
233 #define EFRSupV3m 0x00000008
234 #define EFRSupV3s 3
235 #define VocSup 0x0000000F,0 /* vocoder support */
236 #define VocSupm 0x0000000F
237 #define VocSups 0
238 #define AHS 0x00000010,4 /* adaptive multirate half rate speech */
239 #define AHSm 0x00000010
240 #define AHSs 4
241 #define AFS 0x00000020,5 /* adaptive multirate full rate speech */
242 #define AFSm 0x00000020
243 #define AFSs 5
244 #define TestMobile 0x00000040,6 /* Test Mobile */
245 #define TestMobilem 0x00000040
246 #define TestMobiles 6
247 #define L1Ver 0x00000080,7 /* Layer 1 Version */
248 #define L1Verm 0x00000080
249 #define L1Vers 7
250
251 /*
252 * datCap1 bits
253 * _______________________________________________________
254 * |8 |7 |6 |5 |4 |3 |2 |1 |
255 * |------|------|------|------|------|------|------|------|
256 * |14.4 |tfax |ntfax |tsyn |syn |asyn |rlp |ds |
257 * -------------------------------------------------------
258 */
259 #define datSup 0x00000001,0 /* Data support */
260 #define datSupm 0x00000001
261 #define datSups 0
262 #define RLPSup 0x00000002,1 /* RLP data (NT Async) */
263 #define RLPSupm 0x00000002
264 #define RLPSups 1
265 #define AsySup 0x00000004,2 /* T Async data support */
266 #define AsySupm 0x00000004
267 #define AsySups 2
268 #define NTSynSup 0x00000008,3 /* NT Sync data support */
269 #define NTSynSupm 0x00000008
270 #define NTSynSups 3
271 #define TSynSup 0x00000010,4 /* T Sync data support */
272 #define TSynSupm 0x00000010
273 #define TSynSups 4
274 #define NTFaxSup 0x00000020,5 /* NT Fax support */
275 #define NTFaxSupm 0x00000020
276 #define NTFaxSups 5
277 #define TFaxSup 0x00000040,6 /* T Fax support */
278 #define TFaxSupm 0x00000040
279 #define TFaxSups 6
280 #define Dr14_4Sup 0x00000080,7 /* Data rate 14.4 support */
281 #define Dr14_4Supm 0x00000080
282 #define Dr14_4Sups 7
283
284 /*
285 * datCap2 bits
286 * _______________________________________________________
287 * |8 |7 |6 |5 |4 |3 |2 |1 |
288 * |------|------|------|------|------|------|------|------|
289 * |DHR | | |NAS |TPD |NTPD |TP |NTP |
290 * -------------------------------------------------------
291 */
292 #define NTPackSup 0x00000001,0 /* NT Packet Service */
293 #define NTPackSupm 0x00000001
294 #define NTPackSups 0
295 #define TPackSup 0x00000002,1 /* T Packet Service */
296 #define TPackSupm 0x00000002
297 #define TPackSups 1
298 #define NTPadSup 0x00000004,2 /* NT PAD Access Service */
299 #define NTPadSupm 0x00000004
300 #define NTPadSups 2
301 #define TPadSup 0x00000008,3 /* T PAD Access Service */
302 #define TPadSupm 0x00000008
303 #define TPadSups 3
304 #define NAltSrvSup 0x00000010,4 /* No Alternate Services */
305 #define NAltSrvSupm 0x00000010
306 #define NAltSrvSups 4
307 #define DHRSup 0x00000080,7 /* Data Halfrate support */
308 #define DHRSupm 0x00000080
309 #define DHRSups 7
310
311
312 /********************************************************************
313 *
314 * Field INTERNATIONAL MOBILE EQUIPMENT ID - IMEI
315 *
316 ********************************************************************/
317
318 typedef struct pcm_EFimei_Type
319 {
320 UBYTE tac1;
321 UBYTE tac2;
322 UBYTE tac3;
323 UBYTE fac;
324 UBYTE snr1;
325 UBYTE snr2;
326 UBYTE snr3;
327 UBYTE svn;
328 } EF_IMEI;
329
330 #define SIZE_EF_IMEI 8
331 #define NR_EF_IMEI 1
332
333
334 /********************************************************************
335 *
336 * Field INTERNATIONAL MOBILE SUBSCRIBER ID - IMSI
337 *
338 ********************************************************************/
339
340 typedef struct pcm_EFimsi_Type
341 {
342 UBYTE len; /* length IMSI */
343 UBYTE IMSI[8]; /* IMSI */
344 } EF_IMSI;
345
346 #define SIZE_EF_IMSI 9
347 #define NR_EF_IMSI 1
348
349
350 /********************************************************************
351 *
352 * Field SHORT MESSAGE SERVICE - SMS
353 *
354 ********************************************************************/
355
356 typedef struct pcm_EFsms_Type
357 {
358 UBYTE stat; /* status */
359 UBYTE rmd[175]; /* remainder */
360 } EF_SMS;
361
362 #define SIZE_EF_SMS 176
363 #define NR_EF_SMS 1
364
365 /*
366 * stat bits
367 * _______________________________________________________
368 * |8 |7 |6 |5 |4 |3 |2 |1 |
369 * |------|------|------|------|------|------|------|------|
370 * |reserved |status |
371 * -------------------------------------------------------
372 */
373
374
375 /********************************************************************
376 *
377 * Field MOBILE STATION CLASSMARK 2 - CLASS2
378 *
379 ********************************************************************/
380
381 typedef struct pcm_EFclass2_Type
382 {
383 UBYTE byte1; /* class2 byte 1 */
384 UBYTE byte2; /* class2 byte 2 */
385 UBYTE byte3; /* class2 byte 3 */
386 } EF_CLASS2;
387
388 #define SIZE_EF_CLASS2 3
389 #define NR_EF_CLASS2 1
390
391 /*
392 * byte1 bits
393 * _______________________________________________________
394 * |8 |7 |6 |5 |4 |3 |2 |1 |
395 * |------|------|------|------|------|------|------|------|
396 * |- |rev |es |a5/1 |rfpwr |
397 * -------------------------------------------------------
398 */
399 #define rfPwrCap 0x00000007,0 /* rf power capability */
400 #define rfPwrCapm 0x00000007
401 #define rfPwrCaps 0
402 #define a51 0x00000008,3 /* rf power capability */
403 #define a51m 0x00000008
404 #define a51s 3
405 #define esInd 0x00000010,4 /* ES indicator */
406 #define esIndm 0x00000010
407 #define esInds 4
408 #define revLev 0x00000060,5 /* revision level */
409 #define revLevm 0x00000060
410 #define revLevs 5
411
412 /*
413 * byte2 bits
414 * _______________________________________________________
415 * |8 |7 |6 |5 |4 |3 |2 |1 |
416 * |------|------|------|------|------|------|------|------|
417 * |- |ps |ss |sm |reserved |frq |
418 * -------------------------------------------------------
419 */
420 #define freqCap 0x00000001,0 /* frequency capability */
421 #define freqCapm 0x00000001
422 #define freqCaps 0
423 #define smCap 0x00000008,3 /* SM capability */
424 #define smCapm 0x00000008
425 #define smCaps 3
426 #define ssScrInd 0x00000030,4 /* SS Screen Indicator */
427 #define ssScrIndm 0x00000030
428 #define ssScrInds 4
429 #define psCap 0x00000040,6 /* PS capability */
430 #define psCapm 0x00000040
431 #define psCaps 6
432
433 /*
434 * byte3 bits
435 * _______________________________________________________
436 * |8 |7 |6 |5 |4 |3 |2 |1 |
437 * |------|------|------|------|------|------|------|------|
438 * |CM3 |reserved |A5/3 |A5/2 |
439 * -------------------------------------------------------
440 */
441 #define a52 0x00000001,0 /* encryption algorithm A5/2 */
442 #define a52m 0x00000001
443 #define a52s 0
444 #define a53 0x00000002,1 /* encryption algorithm A5/3 */
445 #define a53m 0x00000002
446 #define a53s 1
447 #define cm3 0x000000f8,7 /* CM3 */
448 #define cm3m 0x000000f8
449 #define cm3s 7
450
451
452 /********************************************************************
453 *
454 * Field MOBILE STATION CLASSMARK 3 - CLASS3
455 *
456 ********************************************************************/
457
458 typedef struct pcm_EFclass3_Type
459 {
460 UBYTE byte1; /* class3 byte 1 */
461 UBYTE byte2; /* class3 byte 2 */
462 UBYTE byte3; /* class3 byte 3 */
463 } EF_CLASS3;
464
465 #define SIZE_EF_CLASS3 3
466 #define NR_EF_CLASS3 1
467
468 /*
469 * byte1 bits
470 * _______________________________________________________
471 * |8 |7 |6 |5 |4 |3 |2 |1 |
472 * |------|------|------|------|------|------|------|------|
473 * |- |bnd3 |bnd2 |bnd1 |a5/7 |a5/6 |a5/5 |a5/4 |
474 * -------------------------------------------------------
475 */
476 #define a54 0x00000001,0 /* encryption algorithm A5/4 */
477 #define a54m 0x00000001
478 #define a54s 0
479 #define a55 0x00000002,1 /* encryption algorithm A5/5 */
480 #define a55m 0x00000002
481 #define a55s 1
482 #define a56 0x00000004,2 /* encryption algorithm A5/6 */
483 #define a56m 0x00000004
484 #define a56s 2
485 #define a57 0x00000008,3 /* encryption algorithm A5/7 */
486 #define a57m 0x00000008
487 #define a57s 3
488 #define bnd1 0x00000010,4 /* Band 1 */
489 #define bnd1m 0x00000010
490 #define bnd1s 4
491 #define bnd2 0x00000020,5 /* Band 2 */
492 #define bnd2m 0x00000020
493 #define bnd2s 5
494 #define bnd3 0x00000040,6 /* Band 3 */
495 #define bnd3m 0x00000040
496 #define bnd3s 6
497
498 /*
499 * byte2 bits
500 * _______________________________________________________
501 * |8 |7 |6 |5 |4 |3 |2 |1 |
502 * |------|------|------|------|------|------|------|------|
503 * |rfcap2 |rfcap1 |
504 * -------------------------------------------------------
505 */
506 #define rfCap1 0x0000000f,0 /* associated RF capability 1 */
507 #define rfCap1m 0x0000000f
508 #define rfCap1s 0
509 #define rfCap2 0x000000f0,4 /* associated RF capability 2 */
510 #define rfCap2m 0x000000f0
511 #define rfCap2s 4
512
513 /*
514 * byte3 bits
515 * _______________________________________________________
516 * |8 |7 |6 |5 |4 |3 |2 |1 |
517 * |------|------|------|------|------|------|------|------|
518 * |0 |0 |0 |xm |0 |0 |0 |0 |
519 * -------------------------------------------------------
520 */
521
522
523 /********************************************************************
524 *
525 * Field MOBILE SETUP - MSSUP
526 *
527 ********************************************************************/
528
529 typedef struct pcm_EFmssup_Type
530 {
531 UBYTE lng1; /* language 1 */
532 UBYTE lng2; /* language 2 */
533 UBYTE lng3; /* language 3 */
534 UBYTE feat1; /* features byte 1 */
535 UBYTE feat2; /* features byte 2 */
536 } EF_MSSUP;
537
538 #define SIZE_EF_MSSUP 5
539 #define NR_EF_MSSUP 1
540
541 /*
542 * lng1 bits
543 * _______________________________________________________
544 * |8 |7 |6 |5 |4 |3 |2 |1 |
545 * |------|------|------|------|------|------|------|------|
546 * |por |swe |spa |ita |dut |ger |fre |eng |
547 * -------------------------------------------------------
548 */
549 #define eng 0x00000001,0 /* English */
550 #define engm 0x00000001
551 #define engs 0
552 #define fre 0x00000002,1 /* French */
553 #define frem 0x00000002
554 #define fres 1
555 #define ger 0x00000004,2 /* German */
556 #define germ 0x00000004
557 #define gers 2
558 #define dut 0x00000008,3 /* Dutch */
559 #define dutm 0x00000008
560 #define duts 3
561 #define ita 0x00000010,4 /* Italian */
562 #define itam 0x00000010
563 #define itas 4
564 #define spa 0x00000020,5 /* Spanish */
565 #define spam 0x00000020
566 #define spas 5
567 #define swe 0x00000040,6 /* Swedish */
568 #define swem 0x00000040
569 #define swes 6
570 #define por 0x00000080,7 /* Portuguese */
571 #define porm 0x00000080
572 #define pors 7
573
574 /*
575 * lng2 bits
576 * _______________________________________________________
577 * |8 |7 |6 |5 |4 |3 |2 |1 |
578 * |------|------|------|------|------|------|------|------|
579 * |rus |pol |slo |hun |tur |gre |nor |fin |
580 * -------------------------------------------------------
581 */
582 #define fin 0x00000001,0 /* Finnish */
583 #define finm 0x00000001
584 #define fins 0
585 #define nor 0x00000002,1 /* Norwegian */
586 #define norm 0x00000002
587 #define nors 1
588 #define gre 0x00000004,2 /* Greek */
589 #define grem 0x00000004
590 #define gres 2
591 #define tur 0x00000008,3 /* Turkish */
592 #define turm 0x00000008
593 #define turs 3
594 #define hun 0x00000010,4 /* Hungarian */
595 #define hunm 0x00000010
596 #define huns 4
597 #define slo 0x00000020,5 /* Slovenian */
598 #define slom 0x00000020
599 #define slos 5
600 #define pol 0x00000040,6 /* Polish */
601 #define polm 0x00000040
602 #define pols 6
603 #define rus 0x00000080,7 /* Russian */
604 #define rusm 0x00000080
605 #define russ 7
606
607 /*
608 * lng3 bits
609 * _______________________________________________________
610 * |8 |7 |6 |5 |4 |3 |2 |1 |
611 * |------|------|------|------|------|------|------|------|
612 * |- |ara |tai |man |can |chi |cze |ind |
613 * -------------------------------------------------------
614 */
615 #define ind 0x00000001,0 /* Indonesian */
616 #define indm 0x00000001
617 #define inds 0
618 #define cze 0x00000002,1 /* Czech */
619 #define czem 0x00000002
620 #define czes 1
621 #define chi 0x00000004,2 /* Chinese */
622 #define chim 0x00000004
623 #define chis 2
624 #define can 0x00000008,3 /* Cantonese */
625 #define canm 0x00000008
626 #define cans 3
627 #define man 0x00000010,4 /* Mandarin */
628 #define manm 0x00000010
629 #define mans 4
630 #define tai 0x00000020,5 /* Taiwanese */
631 #define taim 0x00000020
632 #define tais 5
633 #define ara 0x00000040,6 /* Arabic */
634 #define aram 0x00000040
635 #define aras 6
636
637 /*
638 * feat1 bits
639 * _______________________________________________________
640 * |8 |7 |6 |5 |4 |3 |2 |1 |
641 * |------|------|------|------|------|------|------|------|
642 * |stk |irda |etc |ussd |cb |cf |dtmf |aoc |
643 * -------------------------------------------------------
644 */
645 #define AoC 0x00000001,0 /* Advice of Charge */
646 #define AoCm 0x00000001
647 #define AoCs 0
648 #define DTMF 0x00000002,1 /* DTMF */
649 #define DTMFm 0x00000002
650 #define DTMFs 1
651 #define CF 0x00000004,2 /* Call Forwarding */
652 #define CFm 0x00000004
653 #define CFs 2
654 #define CB 0x00000008,3 /* Call Barring */
655 #define CBm 0x00000008
656 #define CBs 3
657 #define USSD 0x00000010,4 /* USSD */
658 #define USSDm 0x00000010
659 #define USSDs 4
660 #define ETC 0x00000020,5 /* ETC */
661 #define ETCm 0x00000020
662 #define ETCs 5
663 #define IRDA 0x00000040,6 /* IRDA */
664 #define IRDAm 0x00000040
665 #define IRDAs 6
666
667
668 /********************************************************************
669 *
670 * Field CURRENT LANGUAGE - CLNG
671 *
672 ********************************************************************/
673
674 #define SIZE_EF_CLNG_DATA 2 /* two-letter abbreviation of the language */
675
676 typedef struct pcm_EFclng_Type
677 {
678 UBYTE data[SIZE_EF_CLNG_DATA]; /* abbreviation of the language */
679 } EF_CLNG;
680
681 #define SIZE_EF_CLNG (SIZE_EF_CLNG_DATA)
682 #define NR_EF_CLNG 1
683
684
685 /********************************************************************
686 *
687 * Field MOBILE STATION SETTTINGS - MSSET
688 *
689 ********************************************************************/
690
691 typedef struct pcm_EFmsset_Type
692 {
693 UBYTE buzzer1; /* buzzer byte 1 */
694 UBYTE buzzer2; /* buzzer byte 2 */
695 UBYTE buzzer3; /* buzzer byte 3 */
696 UBYTE audio; /* audio */
697 UBYTE misc; /* miscellaneous */
698 UBYTE display; /* display */
699 UBYTE language; /* language */
700 UBYTE recent_ldn_ref; /* recent ldn reference */
701 UBYTE recent_lrn_ref; /* recent lrn reference */
702 UBYTE recent_upn_ref; /* recent upn reference */
703 } EF_MSSET;
704
705 #define SIZE_EF_MSSET 10
706 #define NR_EF_MSSET 1
707
708 /*
709 * buzzer1 bits
710 * _______________________________________________________
711 * |8 |7 |6 |5 |4 |3 |2 |1 |
712 * |------|------|------|------|------|------|------|------|
713 * |vib |callvol |calltype |
714 * -------------------------------------------------------
715 */
716 #define calltype 0x00000007,0 /* ringer type incoming calls */
717 #define calltypem 0x00000007
718 #define calltypes 0
719 #define callvol 0x00000038,3 /* ringer volume incoming calls */
720 #define callvolm 0x00000038
721 #define callvols 3
722 #define vib 0x000000c0,6 /* vibrator */
723 #define vibm 0x000000c0
724 #define vibs 6
725
726 /*
727 * buzzer2 bits
728 * _______________________________________________________
729 * |8 |7 |6 |5 |4 |3 |2 |1 |
730 * |------|------|------|------|------|------|------|------|
731 * |reserved |msgvol |msgtype |
732 * -------------------------------------------------------
733 */
734 #define msgtype 0x00000007,0 /* ringer type messages */
735 #define msgtypem 0x00000007
736 #define msgtypes 0
737 #define msgvol 0x00000038,3 /* ringer volume messages */
738 #define msgvolm 0x00000038
739 #define msgvols 3
740
741 /*
742 * buzzer3 bits
743 * _______________________________________________________
744 * |8 |7 |6 |5 |4 |3 |2 |1 |
745 * |------|------|------|------|------|------|------|------|
746 * |reserved |batw |keytone |
747 * -------------------------------------------------------
748 */
749 #define keytone 0x00000003,0 /* key tone mode */
750 #define keytonem 0x00000003
751 #define keytones 0
752 #define batw 0x00000004,2 /* low battery warning */
753 #define batwm 0x00000004
754 #define batws 2
755
756 /*
757 * audio bits
758 * _________________________________________________________
759 * |8 |7 |6 |5 |4 |3 |2 |1 |
760 * |--------|------|------|------|------|------|------|------|
761 * |VoiceRec|Ext |Outvol |lnamp |
762 * ---------------------------------------------------------
763 */
764 #define lnamp 0x00000007,0 /* microphone amplification */
765 #define lnampm 0x00000007
766 #define lnamps 0
767 #define outvol 0x00000038,3 /* output volume */
768 #define outvolm 0x00000038
769 #define outvols 3
770 #define ext 0x00000040,6 /* external audio */
771 #define extm 0x00000040
772 #define exts 6
773 #define voicerec 0x00000080,7 /* voice recording */
774 #define voicerecm 0x00000080
775 #define voicerecs 7
776
777 /*
778 * miscellaneous bits
779 * _______________________________________________________
780 * |8 |7 |6 |5 |4 |3 |2 |1 |
781 * |------|------|------|------|------|------|------|------|
782 * | | |redial |calinf|clip |clir |pmod |
783 * -------------------------------------------------------
784 */
785 #define pmod 0x00000001,0 /* PLMN selection mode */
786 #define pmodm 0x00000001
787 #define pmods 0
788 #define clir 0x00000002,1 /* CLIR */
789 #define clirm 0x00000002
790 #define clirs 1
791 #define clip 0x00000004,2 /* CLIP */
792 #define clipm 0x00000004
793 #define clips 2
794 #define calinf 0x00000008,3 /* call information display */
795 #define calinfm 0x00000008
796 #define calinfs 3
797 #define redial 0x00000030,4 /* redial mode */
798 #define redialm 0x00000030
799 #define redials 4
800
801 /*
802 * display bits
803 * _______________________________________________________
804 * |8 |7 |6 |5 |4 |3 |2 |1 |
805 * |------|------|------|------|------|------|------|------|
806 * |bckdr |brgt |ctrt |
807 * -------------------------------------------------------
808 */
809 #define ctrt 0x00000007,0 /* contrast */
810 #define ctrtm 0x00000007
811 #define ctrts 0
812 #define brgt 0x00000018,3 /* brightness */
813 #define brgtm 0x00000018
814 #define brgts 3
815 #define bckdr 0x000000E0,5 /* duration for back light */
816 #define bckdrm 0x000000E0
817 #define bckdrs 5
818
819 /********************************************************************
820 *
821 * Field Homezone cache
822 *
823 ********************************************************************/
824
825 typedef struct pcm_EFhzcache_Type
826 {
827 UBYTE cid[2];
828 UBYTE zone;
829 } EF_HZCACHE;
830
831 #define SIZE_EF_HZCACHE 3
832 #define NR_EF_HZCACHE 5
833
834 /********************************************************************
835 *
836 * Field LAST MOC NUMBERS - LDN
837 *
838 ********************************************************************/
839
840 typedef struct pcm_EFldn_Type
841 {
842 UBYTE calDrMsb; /* call duration (MSB) */
843 UBYTE calDrLsb; /* call duration (LSB) */
844 UBYTE year; /* year } */
845 UBYTE month; /* month } = date */
846 UBYTE day; /* day } */
847 UBYTE hour; /* hour } */
848 UBYTE minute; /* minute } = time */
849 UBYTE second; /* second } */
850 UBYTE len; /* length of BCD number */
851 UBYTE numTp; /* TON and NPI */
852 UBYTE dldNum[10]; /* called number */
853 UBYTE ccp; /* capability/configuration identifier */
854 UBYTE ext1; /* extension1 record identifier */
855 } EF_LDN;
856
857 #define SIZE_EF_LDN 22
858 #define NR_EF_LDN 1
859
860 /*
861 * numTp bits
862 * _______________________________________________________
863 * |8 |7 |6 |5 |4 |3 |2 |1 |
864 * |------|------|------|------|------|------|------|------|
865 * |- |ton |npi |
866 * -------------------------------------------------------
867 */
868 #define numTp_npi 0x0000000F,0 /* numbering plan identification */
869 #define numTp_npim 0x0000000F
870 #define numTp_npis 0
871 #define numTp_ton 0x00000070,4 /* Type of number */
872 #define numTp_tonm 0x00000070
873 #define numTp_tons 4
874
875
876 /********************************************************************
877 *
878 * Field LAST MTC NUMBERS - LRN
879 *
880 ********************************************************************/
881
882 typedef struct pcm_EFlrn_Type
883 {
884 UBYTE calDrMsb; /* call duration (MSB) */
885 UBYTE calDrLsb; /* call duration (LSB) */
886 UBYTE year; /* year } */
887 UBYTE month; /* month } = date */
888 UBYTE day; /* day } */
889 UBYTE hour; /* hour } */
890 UBYTE minute; /* minute } = time */
891 UBYTE second; /* second } */
892 UBYTE id; /* identifier */
893 UBYTE len; /* length of BCD number */
894 UBYTE numTp; /* TON and NPI - bitmap same as EF_LDN */
895 UBYTE dldNum[10]; /* calling number */
896 UBYTE ccp; /* capability/configuration identifier */
897 UBYTE ext1; /* extension1 record identifier */
898 } EF_LRN;
899
900 #define SIZE_EF_LRN 23
901 #define NR_EF_LRN 1
902
903 /*
904 * id bits
905 * _______________________________________________________
906 * |8 |7 |6 |5 |4 |3 |2 |1 |
907 * |------|------|------|------|------|------|------|------|
908 * |reserved |type |
909 * -------------------------------------------------------
910 */
911
912
913 /********************************************************************
914 *
915 * Field LAST MTC MISSED NUMBERS - LMN
916 *
917 ********************************************************************/
918
919 typedef struct pcm_EFlmn_Type
920 {
921 UBYTE year; /* year } */
922 UBYTE month; /* month } = date */
923 UBYTE day; /* day } */
924 UBYTE hour; /* hour } */
925 UBYTE minute; /* minute } = time */
926 UBYTE second; /* second } */
927 UBYTE id; /* identifier - bitmap same as EF_LRN */
928 UBYTE len; /* length of BCD number */
929 UBYTE numTp; /* TON and NPI - bitmap same as EF_LDN */
930 UBYTE dldNum[10]; /* calling number */
931 UBYTE ccp; /* capability/configuration identifier */
932 UBYTE ext1; /* extension1 record identifier */
933 } EF_LMN;
934
935 #define SIZE_EF_LMN 21
936 #define NR_EF_LMN 1
937
938
939 /********************************************************************
940 *
941 * Field USER PERSONAL NUMBERS - UPN
942 *
943 ********************************************************************/
944
945 typedef struct pcm_EFupn_Type
946 {
947 UBYTE alphId[10]; /* alpha identifier */
948 UBYTE len; /* length of BCD number */
949 UBYTE numTp; /* TON and NPI - bitmap same as EF_LDN */
950 UBYTE usrNum[10]; /* number */
951 UBYTE ccp; /* capability/configuration identifier */
952 UBYTE ext1; /* extension1 record identifier */
953 } EF_UPN;
954
955 #define SIZE_EF_UPN 24
956 #define NR_EF_UPN 1
957
958
959 /********************************************************************
960 *
961 * Field MAILBOX NUMBERS - MBN
962 *
963 ********************************************************************/
964
965 typedef struct pcm_EFmbn_Type
966 {
967 UBYTE alphId[10]; /* alpha identifier */
968 UBYTE len; /* length of BCD number */
969 UBYTE numTp; /* TON and NPI - bitmap same as EF_LDN */
970 UBYTE mbNum[10]; /* number */
971 } EF_MBN;
972
973 #define SIZE_EF_MBN 22
974 #define NR_EF_MBN 4
975
976
977 /********************************************************************
978 *
979 * Field VOICE MAIL NUMBER - VMN
980 *
981 ********************************************************************/
982
983 /*
984 * note that with new 04.08 the called party bcd number of the CC
985 * protocol can have up to 43 octets, 3 are used for other things
986 * than the BCD coded digits
987 */
988
989 #define MAX_CALLED_PARTY_BCD_NO_OCTETS 40
990
991 typedef struct pcm_EFvmn_Type
992 {
993 UBYTE vmNum[MAX_CALLED_PARTY_BCD_NO_OCTETS + 1]; /* voice mail number */
994 UBYTE numTp; /* TON and NPI - bitmap same as EF_LDN */
995 } EF_VMN;
996
997 #define SIZE_EF_VMN (MAX_CALLED_PARTY_BCD_NO_OCTETS + 1 + 1)
998 #define NR_EF_VMN 1
999
1000
1001 /********************************************************************
1002 *
1003 * Field CALL TIMER - CTIM
1004 *
1005 ********************************************************************/
1006
1007 typedef struct pcm_EFctim_Type
1008 {
1009 UBYTE moVcDrHm[4]; /* MO voice duration home PLMN */
1010 UBYTE mtVcDrHm[4]; /* MT voice duration home PLMN */
1011 UBYTE moDtDrHm[4]; /* MO data duration home PLMN */
1012 UBYTE mtDtDrHm[4]; /* MT data duration home PLMN */
1013 UBYTE moFxDrHm[4]; /* MO fax duration home PLMN */
1014 UBYTE mtFxDrHm[4]; /* MT fax duration home PLMN */
1015 UBYTE moVcDrRm[4]; /* MO voice duration roaming */
1016 UBYTE mtVcDrRm[4]; /* MT voice duration roaming */
1017 UBYTE moDtDrRm[4]; /* MO data duration roaming */
1018 UBYTE mtDtDrRm[4]; /* MT data duration roaming */
1019 UBYTE moFxDrRm[4]; /* MO fax duration roaming */
1020 UBYTE mtFxDrRm[4]; /* MT fax duration roaming */
1021 } EF_CTIM;
1022
1023 #define SIZE_EF_CTIM 48
1024 #define NR_EF_CTIM 1
1025
1026
1027 /********************************************************************
1028 *
1029 * Field CALL COUNTER - CCNT
1030 *
1031 ********************************************************************/
1032
1033 typedef struct pcm_EFccnt_Type
1034 {
1035 UBYTE Total[4]; /* total duration */
1036 UBYTE moVcDrHm[4]; /* MO voice counter home PLMN */
1037 UBYTE mtVcDrHm[4]; /* MT voice counter home PLMN */
1038 UBYTE moDtDrHm[4]; /* MO data counter home PLMN */
1039 UBYTE mtDtDrHm[4]; /* MT data counter home PLMN */
1040 UBYTE moFxDrHm[4]; /* MO fax counter home PLMN */
1041 UBYTE mtFxDrHm[4]; /* MT fax counter home PLMN */
1042 UBYTE moVcDrRm[4]; /* MO voice counter roaming */
1043 UBYTE mtVcDrRm[4]; /* MT voice counter roaming */
1044 UBYTE moDtDrRm[4]; /* MO data counter roaming */
1045 UBYTE mtDtDrRm[4]; /* MT data counter roaming */
1046 UBYTE moFxDrRm[4]; /* MO fax counter roaming */
1047 UBYTE mtFxDrRm[4]; /* MT fax counter roaming */
1048 } EF_CCNT;
1049
1050 #define SIZE_EF_CCNT 52
1051 #define NR_EF_CCNT 1
1052
1053
1054 /********************************************************************
1055 *
1056 * Field EMERGENCY CALL CODES - ECC
1057 *
1058 ********************************************************************/
1059
1060 typedef struct pcm_EFecc_Type
1061 {
1062 UBYTE ecc1[3]; /* emergency call code 1 */
1063 UBYTE ecc2[3]; /* emergency call code 2 */
1064 UBYTE ecc3[3]; /* emergency call code 3 */
1065 UBYTE ecc4[3]; /* emergency call code 4 */
1066 UBYTE ecc5[3]; /* emergency call code 5 */
1067 } EF_ECC;
1068
1069 #define SIZE_EF_ECC 15
1070 #define NR_EF_ECC 1
1071
1072
1073 /********************************************************************
1074 *
1075 * Field ORGANIZER AND ALARM - ORG
1076 *
1077 ********************************************************************/
1078
1079 typedef struct pcm_EForg_Type
1080 {
1081 UBYTE date[6]; /* year, month, day, hour, minute, second */
1082 UBYTE alrm; /* alarm */
1083 UBYTE alphMem[16]; /* alpha memo */
1084 } EF_ORG;
1085
1086 #define SIZE_EF_ORG 23
1087 #define NR_EF_ORG 1
1088
1089 /*
1090 * alrm bits
1091 * _______________________________________________________
1092 * |8 |7 |6 |5 |4 |3 |2 |1 |
1093 * |------|------|------|------|------|------|------|------|
1094 * |reserved |type |stat |
1095 * -------------------------------------------------------
1096 */
1097 #define alrm_stat 0x00000001,0
1098 #define alrm_statm 0x00000001
1099 #define alrm_stats 0
1100 #define alrm_type 0x0000000E,1
1101 #define alrm_typem 0x0000000E
1102 #define alrm_types 1
1103
1104
1105 /********************************************************************
1106 *
1107 * Field CAPABILITY AND CONFIGURATION PARAMETERS - CCP
1108 *
1109 ********************************************************************/
1110
1111 typedef struct pcm_EFccp_Type
1112 {
1113 UBYTE usrRate; /* user rate */
1114 UBYTE bearServ; /* bearer service */
1115 UBYTE conElem; /* connection element */
1116 UBYTE stopBits; /* stop bits */
1117 UBYTE dataBits; /* data bits */
1118 UBYTE parity; /* parity */
1119 UBYTE flowCntrl; /* flow control */
1120 } EF_CCP;
1121
1122 #define SIZE_EF_CCP 7
1123 #define NR_EF_CCP 1
1124
1125
1126 /********************************************************************
1127 *
1128 * Field EXTENSION 1 - EXT1
1129 *
1130 ********************************************************************/
1131
1132 typedef struct pcm_EFext1_Type
1133 {
1134 UBYTE recTp; /* record type */
1135 UBYTE extDat[11]; /* extension data */
1136 UBYTE id; /* identifier */
1137 } EF_EXT1;
1138
1139 #define SIZE_EF_EXT1 13
1140 #define NR_EF_EXT1 1
1141
1142 /*
1143 * recTp bits
1144 * _______________________________________________________
1145 * |8 |7 |6 |5 |4 |3 |2 |1 |
1146 * |------|------|------|------|------|------|------|------|
1147 * |reserved |type |
1148 * -------------------------------------------------------
1149 */
1150
1151
1152 /********************************************************************
1153 *
1154 * Field SIM LOCK & EXTENDED SIM LOCK (use alternatively) - SIMLCK
1155 *
1156 ********************************************************************/
1157
1158 typedef struct pcm_EFsimlck_Type
1159 {
1160 UBYTE locks1; /* lock byte 1 */
1161 UBYTE locks2; /* lock byte 2 */
1162 UBYTE cnt; /* unlock attempt counter */
1163 UBYTE maxcnt; /* maximum attempt */
1164 UBYTE PKey[8]; /* P control key */
1165 UBYTE SPKey[8]; /* SP control key */
1166 UBYTE NSKey[8]; /* NS control key */
1167 UBYTE CKey[8]; /* C control key */
1168 UBYTE NKey[8]; /* N control key */
1169 UBYTE len_imsi; /* length of IMSI */
1170 UBYTE imsi[15]; /* IMSI */
1171 UBYTE gidl1; /* group identifier level 1 */
1172 UBYTE gidl2; /* group identifier level 2 */
1173 } EF_SIMLCK;
1174
1175 #define SIZE_EF_SIMLCK 62
1176 #define NR_EF_SIMLCK 1
1177
1178
1179 typedef struct pcm_EFsimlckext_Type
1180 {
1181 UBYTE locks1; /* lock byte 1 */
1182 UBYTE locks2; /* lock byte 2 */
1183 UBYTE cnt; /* unlock attempt counter */
1184 UBYTE maxcnt; /* maximum attempt */
1185 UBYTE PKey[8]; /* P control key */
1186 UBYTE SPKey[8]; /* SP control key */
1187 UBYTE NSKey[8]; /* NS control key */
1188 UBYTE CKey[8]; /* C control key */
1189 UBYTE NKey[8]; /* N control key */
1190 UBYTE len_p_imsi; /* length of IMSI P-Lock */
1191 UBYTE p_imsi[15]; /* IMSI P-Lock */
1192 UBYTE len_sp_imsi; /* length of IMSI SP-Lock */
1193 UBYTE sp_imsi[15]; /* IMSI SP-Lock */
1194 UBYTE len_ns_imsi; /* length of IMSI NS-Lock */
1195 UBYTE ns_imsi[15]; /* IMSI NS-Lock */
1196 UBYTE len_c_imsi; /* length of IMSI C-Lock */
1197 UBYTE c_imsi[15]; /* IMSI C-Lock */
1198 UBYTE len_n_imsi; /* length of IMSI N-Lock */
1199 UBYTE n_imsi[15]; /* IMSI N-Lock */
1200 UBYTE len_u_imsi; /* length of IMSI U-Lock */
1201 UBYTE u_imsi[15]; /* IMSI U-Lock */
1202 UBYTE gidl1; /* group identifier level 1 */
1203 UBYTE gidl2; /* group identifier level 2 */
1204 } EF_SIMLCKEXT;
1205
1206 #define SIZE_EF_SIMLCKEXT 142
1207 #define NR_EF_SIMLCKEXT 1
1208
1209 /*
1210 * locks1 bits
1211 * _______________________________________________________
1212 * |8 |7 |6 |5 |4 |3 |2 |1 |
1213 * |------|------|------|------|------|------|------|------|
1214 * |splock |nslock |nlock |plock |
1215 * -------------------------------------------------------
1216 */
1217 #define plock 0x00000003,0
1218 #define plockm 0x00000003
1219 #define plocks 0
1220 #define nlock 0x0000000C,2
1221 #define nlockm 0x0000000C
1222 #define nlocks 2
1223 #define nslock 0x00000030,4
1224 #define nslockm 0x00000030
1225 #define nslocks 4
1226 #define spslock 0x000000C0,6
1227 #define splockm 0x000000C0
1228 #define splocks 6
1229
1230 /*
1231 * locks2 bits
1232 * _______________________________________________________
1233 * |8 |7 |6 |5 |4 |3 |2 |1 |
1234 * |------|------|------|------|------|------|------|------|
1235 * |reserved |clock |
1236 * -------------------------------------------------------
1237 */
1238 #define clock 0x00000003,0
1239 #define clockm 0x00000003
1240 #define clocks 0
1241
1242
1243 /********************************************************************
1244 *
1245 * Field MAINTENANCE INFORMATION - MAIN
1246 *
1247 ********************************************************************/
1248
1249 /*
1250 * T.B.D.
1251 */
1252
1253 #define SIZE_EF_MAIN 8
1254 #define NR_EF_MAIN 1
1255
1256
1257 /********************************************************************
1258 *
1259 * Field SPECIAL FUNCTION KEY - SFK
1260 *
1261 ********************************************************************/
1262
1263 /*
1264 * T.B.D.
1265 */
1266
1267 #define SIZE_EF_SFK 8
1268 #define NR_EF_SFK 1
1269
1270
1271 /********************************************************************
1272 *
1273 * Field FAULT CONDITIONS - FAULT
1274 *
1275 ********************************************************************/
1276
1277 /*
1278 * T.B.D.
1279 */
1280
1281 #define SIZE_EF_FAULT 8
1282 #define NR_EF_FAULT 1
1283
1284
1285 /********************************************************************
1286 *
1287 * Field DEBUG INFORMATION - DEBUG
1288 *
1289 ********************************************************************/
1290
1291 /*
1292 * T.B.D.
1293 */
1294
1295 #define SIZE_EF_DEBUG 8
1296 #define NR_EF_DEBUG 1
1297
1298
1299 /********************************************************************
1300 *
1301 * Field POWER MANAGEMENT - POWER
1302 *
1303 ********************************************************************/
1304
1305 /*
1306 * T.B.D.
1307 */
1308
1309 #define SIZE_EF_POWER 8
1310 #define NR_EF_POWER 1
1311
1312
1313 /********************************************************************
1314 *
1315 * Field KEYBOARD MAPPING - KEYB
1316 *
1317 ********************************************************************/
1318
1319 typedef struct pcm_EFkbd_Type
1320 {
1321 UBYTE logical_key [32]; /* logical key map */
1322 UBYTE raw_key [32]; /* raw key map */
1323 } EF_KBD;
1324
1325 #define SIZE_EF_KEYB 64
1326 #define NR_EF_KEYB 1
1327
1328
1329 /********************************************************************
1330 *
1331 * Field RADIO PARAMETERS - RADIO
1332 *
1333 ********************************************************************/
1334
1335 /*
1336 * T.B.D.
1337 */
1338
1339 #define SIZE_EF_RADIO 8
1340 #define NR_EF_RADIO 1
1341
1342
1343 /********************************************************************
1344 *
1345 * Field MANUFACTURER - CGMI
1346 *
1347 ********************************************************************/
1348
1349 #define SIZE_EF_CGMI_DATA 20 /* value depends on manufacturer spec. */
1350
1351 typedef struct pcm_EFcgmi_Type
1352 {
1353 UBYTE data[SIZE_EF_CGMI_DATA]; /* name of manufacturer */
1354 } EF_CGMI;
1355
1356 #define SIZE_EF_CGMI (SIZE_EF_CGMI_DATA)
1357 #define NR_EF_CGMI 1
1358
1359
1360 /********************************************************************
1361 *
1362 * Field IDENTIFICATION INFORMATION - INF0
1363 *
1364 ********************************************************************/
1365
1366 #define SIZE_EF_INF0_DATA 20 /* value depends on manufacturer spec. */
1367
1368 typedef struct pcm_EFinf0_Type
1369 {
1370 UBYTE data[SIZE_EF_INF0_DATA]; /* identification information */
1371 } EF_INF0;
1372
1373 #define SIZE_EF_INF0 (SIZE_EF_INF0_DATA)
1374 #define NR_EF_INF0 2
1375
1376
1377 /********************************************************************
1378 *
1379 * Field MODEL - CGMM
1380 *
1381 ********************************************************************/
1382
1383 #define SIZE_EF_CGMM_DATA 20 /* value depends on manufacturer spec. */
1384
1385 typedef struct pcm_EFcgmm_Type
1386 {
1387 UBYTE data[SIZE_EF_CGMM_DATA]; /* name of product */
1388 } EF_CGMM;
1389
1390 #define SIZE_EF_CGMM (SIZE_EF_CGMM_DATA)
1391 #define NR_EF_CGMM 1
1392
1393
1394 /********************************************************************
1395 *
1396 * Field REVISION - CGMR
1397 *
1398 ********************************************************************/
1399
1400 #define SIZE_EF_CGMR_DATA 20 /* value depends on manufacturer spec. */
1401
1402 typedef struct pcm_EFcgmr_Type
1403 {
1404 UBYTE data[SIZE_EF_CGMR_DATA]; /* version of product */
1405 } EF_CGMR;
1406
1407 #define SIZE_EF_CGMR (SIZE_EF_CGMR_DATA)
1408 #define NR_EF_CGMR 1
1409
1410
1411 /********************************************************************
1412 *
1413 * Field PRODUCT SERIAL NUMBER - CGSN
1414 *
1415 ********************************************************************/
1416
1417 #define SIZE_EF_CGSN_DATA 20 /* value depends on manufacturer spec. */
1418
1419 typedef struct pcm_EFcgsn_Type
1420 {
1421 UBYTE data[SIZE_EF_CGSN_DATA]; /* serial number of product */
1422 } EF_CGSN;
1423
1424 #define SIZE_EF_CGSN (SIZE_EF_CGSN_DATA)
1425 #define NR_EF_CGSN 1
1426
1427
1428 /********************************************************************
1429 *
1430 * Field SMS PROFILE - SMSPRFL
1431 *
1432 ********************************************************************/
1433
1434 #define SIZE_EF_SMSPRFL_SCA 20
1435 #define SIZE_EF_SMSPRFL_MIDS 40
1436 #define SIZE_EF_SMSPRFL_DCSS 20
1437 #define SIZE_EF_SMSPRFL_VPABS 14
1438
1439 typedef struct pcm_EFsmsprfl_Type
1440 {
1441 UBYTE vldFlag; /* valid flag */
1442 UBYTE CSCAsca[SIZE_EF_SMSPRFL_SCA]; /* service center address */
1443 UBYTE CSCAlenSca; /* length of service center address */
1444 UBYTE CSCAton; /* type of number */
1445 UBYTE CSCAnpi; /* numbering plan identification */
1446 UBYTE CSCBmode; /* cell broadcast mode */
1447 UBYTE CSCBmids[SIZE_EF_SMSPRFL_MIDS]; /* message identifiers */
1448 UBYTE CSCBdcss[SIZE_EF_SMSPRFL_DCSS]; /* data coding schemes */
1449 UBYTE CSMPfo; /* first octet */
1450 UBYTE CSMPvprel; /* validity period relative */
1451 UBYTE CSMPvpabs[SIZE_EF_SMSPRFL_VPABS]; /* validity period absolute */
1452 UBYTE CSMPpid; /* protocol identifier */
1453 UBYTE CSMPdcs; /* data coding scheme */
1454 } EF_SMSPRFL;
1455
1456 #define SIZE_EF_SMSPRFL (SIZE_EF_SMSPRFL_SCA + \
1457 SIZE_EF_SMSPRFL_MIDS + \
1458 SIZE_EF_SMSPRFL_DCSS + \
1459 SIZE_EF_SMSPRFL_VPABS + 9)
1460 #define NR_EF_SMSPRFL 2
1461
1462 /*
1463 * vldFlag values
1464 */
1465 #define EF_SMSPRFL_VLD 0x00
1466 #define EF_SMSPRFL_INVLD 0xFF
1467
1468
1469 /********************************************************************
1470 *
1471 * Field PLMN IDENTIFIER - PLMN
1472 *
1473 ********************************************************************/
1474
1475 #define SIZE_EF_PLMN_MCC 2
1476 #define SIZE_EF_PLMN_MNC 2
1477 #define SIZE_EF_PLMN_LONG 20
1478 #define SIZE_EF_PLMN_SHRT 10
1479
1480 typedef struct pcm_EFplmn_Type
1481 {
1482 UBYTE mcc[SIZE_EF_PLMN_MCC]; /* mobile country code */
1483 UBYTE mnc[SIZE_EF_PLMN_MNC]; /* mobile network code */
1484 UBYTE lngNam[SIZE_EF_PLMN_LONG]; /* MT voice counter home PLMN */
1485 UBYTE shrtNam[SIZE_EF_PLMN_SHRT]; /* MO data counter home PLMN */
1486 } EF_PLMN;
1487
1488 #define SIZE_EF_PLMN (SIZE_EF_PLMN_MCC + \
1489 SIZE_EF_PLMN_MNC + \
1490 SIZE_EF_PLMN_LONG + \
1491 SIZE_EF_PLMN_SHRT)
1492 #define NR_EF_PLMN 2
1493
1494
1495 /********************************************************************
1496 *
1497 * Field BCCH INFORMATION - BCCHINF
1498 *
1499 ********************************************************************/
1500
1501 typedef struct pcm_EFbcchinfo_Type
1502 {
1503 UBYTE bcch_info[54]; /* content of bcch_info */
1504 } EF_BCCHINFO;
1505
1506 #define SIZE_EF_BCCHINFO 54
1507 #define NR_EF_BCCHINFO 1
1508
1509
1510 /********************************************************************
1511 *
1512 * Field ALTERNATIVE LINE SERVICE - ALS
1513 *
1514 ********************************************************************/
1515
1516 typedef struct pcm_EFals_Type
1517 {
1518 UBYTE selLine; /* selected line */
1519 UBYTE statLine; /* status line */
1520 } EF_ALS;
1521
1522 #define SIZE_EF_ALS 2
1523 #define NR_EF_ALS 1
1524
1525
1526 /********************************************************************
1527 *
1528 * Field LOCATION INFORMATION (GPRS) - LOCGPRS
1529 *
1530 ********************************************************************/
1531
1532 typedef struct pcm_EFlocgprs_Type
1533 {
1534 UBYTE ptmsi[4]; /* packet TMSI */
1535 UBYTE ptmsi_signature[3]; /* packet TMSI signature value */
1536 UBYTE rai[6]; /* routing area information */
1537 UBYTE ra_status; /* status of rai */
1538 } EF_LOCGPRS;
1539
1540 #define SIZE_EF_LOCGPRS sizeof (EF_LOCGPRS)
1541 #define NR_EF_LOCGPRS 1
1542
1543
1544 /********************************************************************
1545 *
1546 * Field CIPHERING KEY (GPRS) - KCGPRS
1547 *
1548 ********************************************************************/
1549
1550 typedef struct pcm_EFkcgprs_Type
1551 {
1552 UBYTE kc[8]; /* currently used cyphering key */
1553 UBYTE cksn; /* ciphering key sequence number of kc */
1554 } EF_KCGPRS;
1555
1556 #define SIZE_EF_KCGPRS sizeof (EF_KCGPRS)
1557 #define NR_EF_KCGPRS 1
1558
1559
1560 /********************************************************************
1561 *
1562 * Field IMSI (GPRS) - IMSIGPRS
1563 *
1564 ********************************************************************/
1565
1566 typedef struct pcm_EFimsigprs_Type
1567 {
1568 UBYTE len; /* length IMSI */
1569 UBYTE IMSI[8]; /* IMSI */
1570 } EF_IMSIGPRS;
1571
1572 #define SIZE_EF_IMSIGPRS sizeof (EF_IMSIGPRS)
1573 #define NR_EF_IMSIGPRS 1
1574
1575
1576 /********************************************************************
1577 *
1578 * Prototypes
1579 *
1580 ********************************************************************/
1581
1582 EXTERN unsigned char pcm_find_active_pcm_sector (void);
1583
1584 EXTERN void pcm_read_flash (UBYTE *pcm_mem,
1585 unsigned size,
1586 UBYTE pcm_sector);
1587
1588 EXTERN drv_Return_Type pcm_erase_flash_sector (UBYTE pcm_sector);
1589
1590 EXTERN drv_Return_Type pcm_write_flash (UBYTE *pcm_mem,
1591 unsigned size,
1592 UBYTE pcm_sector);
1593
1594 EXTERN drv_Return_Type pcm_Init (void);
1595
1596 EXTERN void pcm_Exit (void);
1597
1598 EXTERN drv_Return_Type pcm_ReadFile (UBYTE *in_FileName,
1599 USHORT in_BufferSize,
1600 UBYTE *out_BufferPtr,
1601 UBYTE *out_VersionPtr);
1602
1603 EXTERN drv_Return_Type pcm_GetFileInfo (UBYTE *in_FileName,
1604 pcm_FileInfo_Type *out_FileInfoPtr);
1605
1606 EXTERN drv_Return_Type pcm_ReadRecord (UBYTE *in_FileName,
1607 USHORT in_Record,
1608 USHORT in_BufferSize,
1609 UBYTE *out_BufferPtr,
1610 UBYTE *out_VersionPtr,
1611 USHORT *out_MaxRecordsPtr);
1612
1613 EXTERN drv_Return_Type pcm_WriteFile (UBYTE *in_FileName,
1614 USHORT in_BufferSize,
1615 UBYTE *in_BufferPtr);
1616
1617 EXTERN drv_Return_Type pcm_WriteRecord (UBYTE *in_FileName,
1618 USHORT in_Record,
1619 USHORT in_BufferSize,
1620 UBYTE *in_BufferPtr);
1621
1622 EXTERN drv_Return_Type pcm_Flush (void);
1623
1624 #endif // ifndef DEF_PCM