comparison services/pcm/pcm.h @ 0:75a11d740a02

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