comparison src/g23m-gsm/mm/mm.h @ 104:27a4235405c6

src/g23m-gsm: import from LoCosto source
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 04 Oct 2016 18:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
103:76d139c7a25e 104:27a4235405c6
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS (8410)
4 | Modul : MM
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Definitions for the Protocol Stack Entity
18 | Radio Resource
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef MM_H
23 #define MM_H
24
25 #ifdef GPRS
26 #include "mm_gprs.h"
27 #endif /* GPRS */
28 #if defined (TI_PS_HCOMM_CHANGE)
29 #include "cl_hComm_handle.h"
30 #endif
31
32 #ifdef TI_GSP_STR2IND_S2I_STRING
33 typedef unsigned int T_S2I_STRING;
34 #else
35 typedef char * T_S2I_STRING;
36 #define S2I_STRING(x) (x)
37 #endif
38
39 #ifdef TI_PS_OP_VSI_NO_CALL_ID
40 #define TIMER_START(C,I,T) vsi_t_start_nc(I,T)
41 #define TIMER_PSTART(C,I,T,R) vsi_t_pstart_nc(I,T,R)
42 #define TIMER_STOP(C,I) vsi_t_stop_nc(I)
43 #define TIMER_STATUS(C,I,T) vsi_t_status_nc(I,T)
44 #define SUSPEND_SELF(C,T) vsi_t_sleep_nc(T)
45 #define SYSTEM_TIME(C,T) vsi_t_time_nc(T)
46 #else /* TI_PS_OP_VSI_NO_CALL_ID */
47 #define TIMER_START(C,I,T) vsi_t_start(C,I,T)
48 #define TIMER_PSTART(C,I,T,R) vsi_t_pstart(C,I,T,R)
49 #define TIMER_STOP(C,I) vsi_t_stop(C,I)
50 #define TIMER_STATUS(C,I,T) vsi_t_status(C,I,T)
51 #define SUSPEND_SELF(C,T) vsi_t_sleep(C,T)
52 #define SYSTEM_TIME(C,T) vsi_t_time(C,T)
53 #endif /* TI_PS_OP_VSI_NO_CALL_ID */
54
55 #if !defined(_SIMULATION_) && defined(WIN32)
56 #define _SIMULATION_
57 #endif /* !_SIMULATION_ && WIN32 */
58
59
60 /*==== TEST =====================================================*/
61
62 /*
63 * Dynamic Configuration Numbers
64 */
65 #define TIMER_SET 1
66 #define TIMER_RESET 2
67 #define TIMER_SPEED_UP 3
68 #define TIMER_SLOW_DOWN 4
69 #define TIMER_SUPPRESS 5
70 #define T3212_CNT 6
71 #define USE_STORED_BCCH 7
72 #define FFS_READ_EPLMN 8
73 #define FFS_WRITE_EPLMN 9
74 #define FFS_RESET_EPLMN 10
75 #define FFS_READ_EPLMN_INIT 11
76
77
78 #define ENTITY_DATA mm_data
79
80 /*
81 * PLMN constants
82 */
83 #define MAX_FORB_PLMN_ID 8 /* Arbitrary, >= MAX_SIM_FORB_PLMN_ID */
84 #define MAX_SIM_FORB_PLMN_ID 4
85 #define UBYTES_PER_PLMN 3 /* Number of UBYTEs for packed PLMN */
86
87 #ifdef REL99
88 #define UBYTES_PER_PLMN_WITH_ACC_TECH 5 /* Number of UBYTEs for packed PLMN with access technology*/
89 #endif
90
91 #ifdef GPRS
92 #define MAX_GPRS_FORB_PLMN_ID 4
93 #endif /* #ifdef GPRS */
94
95 #define MAX_PREF_PLMN_ID (MAX_PREF_PLMN/UBYTES_PER_PLMN)
96
97 #define SIZE_LOC_INFO 11
98 #define PD_MM_TI_0 PD_MM
99 #ifdef REL99
100 #define MAX_DEFINED_CAUSES 23
101 #else
102 #define MAX_DEFINED_CAUSES 22
103 #endif
104 #define TMSI_INVALID_VALUE 0xFFFFFFFFL
105 #define LAC_INVALID_VALUE 0xFFFE
106
107 /*
108 * initial HPLMN search after switch on delayed for ms
109 */
110 #define HPLMN_INITIAL_DELAY 120000 /* 2 minutes */
111
112 /*
113 * HPLMN search constants in steps of 6 minutes
114 */
115 #define HPLMN_REARM_DELAY 1 /* 6 minutes */
116 #define HPLMN_DEF_SEARCH_PERIOD 10 /* 1 hour */
117 #define HPLMN_MAX_SEARCH_PERIOD 80 /* 8 hours */
118
119 /*
120 * Flags for creating a plmn list
121 */
122 #define WITH_OTHER_PLMNS 0 /* Non-forbidden, RPLMN no or low prio */
123 #define WITH_ALL_PLMNS 1 /* All available PLMNs */
124 #define WITH_RPLMN 2 /* Non-forbidden */
125
126 /*
127 * Timer Identifier
128 */
129 #define T_REGISTRATION 0
130 #define T3210 1
131 #define T3211 2
132 #define T3212 3
133 #define T3213 4
134 #define T3220 5
135 #define T3230 6
136 #define T3240 7
137 #define T_HPLMN 8
138 #ifdef REL99
139 #define T3241 9
140 #define NUM_OF_MM_TIMERS 10
141 #else
142 #define NUM_OF_MM_TIMERS 9
143 #endif
144
145 #define MAX_REST_T3213 2
146
147
148 /*
149 * CM_SERVICE_TYPES
150 */
151 #define NO_CM_SERVICE 0
152 #define CALL_SERVICE ST_MOC
153 #define EMERGENCY_SERVICE ST_EMERGENCY
154 #define SMS_SERVICE ST_SMS
155 #define SS_SERVICE ST_SS
156
157
158 /*
159 * MM Cause
160 */
161 #define MM_CAUSE MMCM_MM_CAUSE
162
163
164
165 /*
166 * COMPONENTS
167 */
168 #define CC_COMP MMCM_ORG_ENTITY_CC
169 #define SS_COMP MMCM_ORG_ENTITY_SS
170 #define SMS_COMP MMCM_ORG_ENTITY_SMS
171
172 #define REG_COMP 3
173 #define TIMEOUT 4
174
175 /*
176 * FAILURES
177 */
178 #define OPTIONAL_INFO_ERROR 102
179
180 /*
181 * LOC-UPD-TYPES
182 */
183 #define NORMAL_LUP 0
184 #define PERIODIC_LUP 1
185 #define IMSI_ATTACH_LUP 2
186 #define NOT_RUNNING 3
187
188 /*
189 * MISC.CONSTANTS FOR QEUEING
190 */
191 #define ENTRY_FREE 0
192 #define USE 1
193 #define STORED 2
194
195 /*
196 * Constants describing the stored information type
197 */
198 #define NO_ENTRY 0
199 #define PRIMITIVE_ENTRY 1
200 #define EVENT_ENTRY 2
201
202 /*
203 * UPDATE-STATUS
204 */
205 #define MS_UPDATED 0
206 #define MS_NOT_UPDATED 1
207 #define MS_LA_NOT_ALLOWED 3
208
209
210 typedef enum
211 {
212 MSG_RR_ACT,
213 MSG_MM_REE,
214 MSG_MM_CIPH,
215 MSG_MM_MODE
216 }T_MSG_TYPE;
217
218 typedef enum
219 {
220 PRIM_EST_IND,
221 PRIM_DATA_IND
222 }T_PRIM_TYPE;
223
224
225 /*
226 * Macros
227 */
228 #ifdef FRAME_OFFSET_ZERO
229
230 #define GET_PD(s,p) p=s.buf[3] & 0x0F
231 #define GET_TI(s,t) t=(s.buf[3] & 0xF0)>>4
232
233 #else
234
235 #define GET_PD(s,p) ccd_decodeByte(s.buf, (USHORT)(s.o_buf+4), 4, &p)
236 #define GET_TI(s,t) ccd_decodeByte(s.buf, s.o_buf, 4, &t)
237
238 #endif
239
240 #define MSG(TYPE) ((T_##TYPE *)(_decodedMsg))
241 #define USE_STORED_ENTRIES() { ENTITY_DATA->use_stored_entries = TRUE; }
242
243 /*
244 * The assert() macro as defined by the frame stops the task,
245 * not only in simulation but also on the target. For the
246 * simulation this is a desired behaviour, for the target it is not.
247 */
248 #ifndef WIN32
249 #undef assert
250 #define assert(x) if (!(x)) { TRACE_ERROR ("Assertion failed"); }
251 #endif
252
253 /*
254 * Bitoffset for encoding/decoding
255 */
256 #define ENCODE_OFFSET 24
257
258 /*
259 * a modified version of the S/GET_STATE macros for tracing CM_INST states
260 */
261
262 #define CMSTATE(PROCESS,N) ENTITY_DATA->conn_state[(PROCESS)][(N)]
263
264 #ifdef NTRACE
265 #define CM_SET_STATE(PROCESS,N,STATE) CMSTATE((PROCESS),(N)) = (STATE)
266 #define CM_GET_STATE(PROCESS,N) CMSTATE((PROCESS),(N))
267 #else
268 #if defined (NEW_FRAME)
269 #define CM_SET_STATE(PROCESS,N,STATE)\
270 {\
271 vsi_o_strace (VSI_CALLER\
272 PROCESS_NAME_CM[(PROCESS)],\
273 STATE_CM_NAME [(PROCESS)] [ CMSTATE(PROCESS,N) ],\
274 STATE_CM_NAME [(PROCESS)] [ (STATE) ]);\
275 CMSTATE((PROCESS),(N)) = (STATE);\
276 }
277
278 #define CM_GET_STATE(PROCESS,N)\
279 (vsi_o_strace (VSI_CALLER\
280 PROCESS_NAME_CM[(PROCESS)],\
281 STATE_CM_NAME [(PROCESS)] [ CMSTATE((PROCESS),(N)) ],\
282 NULL), CMSTATE((PROCESS),(N)))
283 #else
284 #define CM_SET_STATE(PROCESS,N,STATE)\
285 CMSTATE((PROCESS),(N)) =\
286 vsi_o_strace (VSI_CALLER\
287 PROCESS_NAME_CM[(PROCESS)],\
288 STATE_CM_NAME [(PROCESS)] [ CMSTATE(PROCESS,N) ],\
289 STATE_CM_NAME [(PROCESS)] [ (STATE) ],\
290 (STATE) )
291 #define CM_GET_STATE(PROCESS,N)\
292 vsi_o_strace (VSI_CALLER\
293 PROCESS_NAME_CM[(PROCESS)],\
294 STATE_CM_NAME [(PROCESS)] [ CMSTATE((PROCESS),(N)) ],\
295 NULL ,\
296 CMSTATE((PROCESS),(N)) )
297 #endif /* NEW_FRAME */
298 #endif /* NTRACE */
299
300 /*
301 * buffer sizes
302 */
303 #define SIZE_BCCH 16
304 #define NUM_OF_CM_ENT 3
305 #define NUM_OF_CONN_PER_CM_ENT 16
306
307 /*
308 * CONNECTION STATES
309 */
310 #define CM_IDLE 0
311 #define CM_PENDING 1
312 #define CM_ACTIVE 2
313 #define CM_REEST_PENDING 3
314 #define CM_STORE 4
315 #define CM_NOT_IDLE 0xff
316
317 EXTERN const char * const * const STATE_CM_NAME[];
318
319 #define STATE_CM_CC_NAME_INIT \
320 "CM_CC_IDLE", \
321 "CM_CC_PENDING", \
322 "CM_CC_ACTIVE", \
323 "CM_CC_REEST_PENDING", \
324 "CM_CC_STORE"
325
326 #define STATE_CM_SS_NAME_INIT \
327 "CM_SS_IDLE", \
328 "CM_SS_PENDING", \
329 "CM_SS_ACTIVE", \
330 "CM_SS_REEST_PENDING", \
331 "CM_SS_STORE"
332
333 #define STATE_CM_SMS_NAME_INIT \
334 "CM_SMS_IDLE", \
335 "CM_SMS_PENDING", \
336 "CM_SMS_ACTIVE", \
337 "CM_SMS_REEST_PENDING", \
338 "CM_SMS_STORE"
339
340 /*
341 * CM manages 3 (NUM_OF_CM_ENT) states: CC, SS, SMS
342 */
343 #define STATE_CC CC_COMP
344 #define STATE_SS SS_COMP
345 #define STATE_SMS SMS_COMP
346
347 #define UNSPEC 0
348 #define CM_LUP_TRIGGER 1
349
350 EXTERN const char * const
351 PROCESS_NAME_CM[];
352 #define PROCESS_NAME_CM_INIT \
353 "STATE_CC" , \
354 "STATE_SS" , \
355 "STATE_SMS"
356
357 /*
358 * A definition of the states of CMSTATE is provided in MM_PEI.C
359 */
360 #if defined(MM_PEI_C) && ! defined(NTRACE)
361 LOCAL const char * const STATE_CC_NAME [] = { STATE_CM_CC_NAME_INIT };
362 LOCAL const char * const STATE_SS_NAME [] = { STATE_CM_SS_NAME_INIT };
363 LOCAL const char * const STATE_SMS_NAME[] = { STATE_CM_SMS_NAME_INIT };
364 GLOBAL const char * const * const STATE_CM_NAME [] = { STATE_CC_NAME,
365 STATE_SS_NAME,
366 STATE_SMS_NAME };
367 GLOBAL const char * const PROCESS_NAME_CM[] = { PROCESS_NAME_CM_INIT };
368
369 #endif
370
371 /*
372 * States of the Mobility Management
373 */
374 #define MM_NULL 0
375 #define MM_LUP_INITIATED 3
376 #define MM_WAIT_FOR_OUTG_MM_CONN 5
377 #define MM_CONN_ACTIVE 6
378 #define MM_IMSI_DETACH_INIT 7
379 #define MM_PROCESS_PROMPT 8
380 #define MM_WAIT_FOR_NW_CMD 9
381 #define MM_LUP_REJECTED 10
382 #define MM_WAIT_FOR_RR_CONN_LUP 13
383 #define MM_WAIT_FOR_RR_CONN_MM 14
384 #define MM_WAIT_FOR_RR_CONN_DETACH 15
385 #define MM_WAIT_FOR_REESTABLISH 17
386 #define MM_WAIT_FOR_RR_ACTIVE 18
387 #define MM_IDLE_NORMAL_SERVICE 19 /* 19.1 */
388 #define MM_LOCATION_UPDATING_PENDING 23 /* Not defined for GSM only stack */
389 #define MM_IMSI_DETACH_PENDING 24 /* Not defined for GSM only stack */
390 #ifdef REL99
391 #define MM_RR_CONN_RELEASE_NOT_ALLOWED 25
392 #define MM_IDLE_ATTEMPT_TO_UPDATE 26 // 19.2
393 #define MM_IDLE_LIMITED_SERVICE 27 // 19.3
394 #define MM_IDLE_NO_IMSI 28 // 19.4
395 #define MM_IDLE_NO_CELL_AVAILABLE 29 // 19.5
396 #define MM_IDLE_LUP_NEEDED 30 // 19.6, not used by GSM only stack
397 #define MM_IDLE_PLMN_SEARCH 31 // 19.7
398 #define MM_PLMN_SEARCH_NORMAL_SERVICE 32 // 19.8
399 #else
400 #define MM_IDLE_ATTEMPT_TO_UPDATE 25 // 19.2
401 #define MM_IDLE_LIMITED_SERVICE 26 // 19.3
402 #define MM_IDLE_NO_IMSI 27 // 19.4
403 #define MM_IDLE_NO_CELL_AVAILABLE 28 // 19.5
404 #define MM_IDLE_LUP_NEEDED 29 // 19.6, not used by GSM only stack
405 #define MM_IDLE_PLMN_SEARCH 30 // 19.7
406 #define MM_PLMN_SEARCH_NORMAL_SERVICE 31 // 19.8
407 #endif
408
409 /* N950 Memory Optimization - Implements Measure #39*/
410 EXTERN T_S2I_STRING const STATE_MM_NAME[];
411 #ifdef GPRS
412
413 /*
414 * States of CM establishment if GPRS is present
415 */
416 #define CM_GPRS_EST_IDLE 0 /* No outstanding MMGMM_CM_ESTABLISH_RES */
417 #define CM_GPRS_EST_PEND 1 /* MMGMM_CM_ESTABLISH_RES outstanding */
418 #define CM_GPRS_EMERGE_PEND 2 /* MMGMM_CM_EMERGENCY_RES outstanding */
419 #define CM_GPRS_EST_OK 3 /* MM is allowed to establish RR connection */
420
421 /*
422 * States for connection management. You may think of a process
423 * in terms of SDL here, but this is not obvious by looking into the C code,
424 * as the separation of state machines is not elaborated at all.
425 */
426 EXTERN const char * const STATE_GPRS_CM_EST_NAME[];
427 #define STATE_GPRS_CM_EST_INIT \
428 "CM_GPRS_EST_IDLE", \
429 "CM_GPRS_EST_PEND", \
430 "CM_GPRS_EMERGE_PEND", \
431 "CM_GPRS_EST_OK"
432
433 /*
434 * States for registration control.
435 * Don't think of a state and a process in term of SDL here.
436 * The only reason why this is a state and not only a ordinary variable
437 * is because it eases debugging a lot for now.
438 */
439 EXTERN const char * const STATE_REG_TYPE_NAME[];
440 #endif /* GPRS */
441
442 /*
443 * MM manages 1 (NUM_OF_MM_STATES) state (GSM only) : MM
444 * MM manages 3 (NUM_OF_MM_STATES) states (GPRS present): MM, GPRS_CM_EST, REG_TYPE
445 */
446 #ifdef OPTION_MULTITHREAD
447 #define PROCESS_NAME _ENTITY_PREFIXED(PROCESS_NAME)
448 #endif
449
450 EXTERN const char * const PROCESS_NAME[];
451 #ifdef GPRS
452 #define STATE_MM 0
453 #define STATE_GPRS_CM_EST 1
454 #define STATE_REG_TYPE 2
455 #define NUM_OF_MM_STATES 3
456 #define PROCESS_NAME_INIT \
457 "MM", \
458 "GPRS_CM_EST", \
459 "REG_TYPE"
460 #else
461 #define STATE_MM 0
462 #define NUM_OF_MM_STATES 1
463 #define PROCESS_NAME_INIT \
464 "MM"
465 #endif /* GPRS */
466
467 /*
468 * A definition of the states is provided in MM_PEI.C
469 */
470 #if defined(MM_PEI_C) && ! defined(NTRACE)
471 /* N950 Memory Optimization - Implements Measure #39*/
472 GLOBAL T_S2I_STRING const STATE_MM_NAME[] =
473 {
474 S2I_STRING("MM_NULL"),
475 S2I_STRING("MM_1_INVALID"),
476 S2I_STRING("MM_2_INVALID"),
477 S2I_STRING("MM_LUP_INITIATED"),
478 S2I_STRING("MM_4_INVALID"),
479 S2I_STRING("MM_WAIT_FOR_OUTG_MM_CONN"),
480 S2I_STRING("MM_CONN_ACTIVE"),
481 S2I_STRING("MM_IMSI_DETACH_INIT"),
482 S2I_STRING("MM_PROCESS_PROMPT"),
483 S2I_STRING("MM_WAIT_FOR_NW_CMD"),
484 S2I_STRING("MM_LUP_REJECTED"),
485 S2I_STRING("MM_11_INVALID"),
486 S2I_STRING("MM_12_INVALID"),
487 S2I_STRING("MM_WAIT_FOR_RR_CONN_LUP"),
488 S2I_STRING("MM_WAIT_FOR_RR_CONN_MM"),
489 S2I_STRING("MM_WAIT_FOR_RR_CONN_DETACH"),
490 S2I_STRING("MM_16_INVALID"),
491 S2I_STRING("MM_WAIT_FOR_REESTABLISH"),
492 S2I_STRING("MM_WAIT_FOR_RR_ACTIVE"),
493 S2I_STRING("MM_IDLE_NORMAL_SERVICE"),
494 S2I_STRING("MM_20_INVALID"),
495 S2I_STRING("MM_21_INVALID"),
496 S2I_STRING("MM_22_INVALID"),
497 S2I_STRING("MM_LOCATION_UPDATING_PENDING"),
498 S2I_STRING("MM_IMSI_DETACH_PENDING"),
499 #ifdef REL99
500 S2I_STRING("MM_RR_CONN_RELEASE_NOT_ALLOWED"),
501 #endif
502 S2I_STRING("MM_IDLE_ATTEMPT_TO_UPDATE"),
503 S2I_STRING("MM_IDLE_LIMITED_SERVICE"),
504 S2I_STRING("MM_IDLE_NO_IMSI"),
505 S2I_STRING("MM_IDLE_NO_CELL_AVAILABLE"),
506 S2I_STRING("MM_IDLE_LUP_NEEDED"),
507 S2I_STRING("MM_IDLE_PLMN_SEARCH"),
508 S2I_STRING("MM_PLMN_SEARCH_NORMAL_SERVICE")
509 };
510 #ifdef GPRS
511
512 GLOBAL const char * const STATE_GPRS_CM_EST_NAME[] =
513 { STATE_GPRS_CM_EST_INIT };
514
515 GLOBAL const char * const STATE_REG_TYPE_NAME[] =
516 { "REG_GPRS_INACTIVE",
517 "REG_REMOTE_CONTROLLED",
518 "REG_CELL_SEARCH_ONLY"
519 };
520
521 #endif /* GPRS */
522 GLOBAL const char * const PROCESS_NAME[] = { PROCESS_NAME_INIT };
523 #endif /* defined(MM_PEI_C) && ! defined(NTRACE) */
524
525 #ifndef NTRACE
526 #define UNEXPECTED_IN_STATE "Unexpected in state"
527 #define UNEXPECTED_DEFAULT "Unexpected default"
528 #define UNEXPECTED_PARAMETER "Unexpected parameter"
529 #define PRIMITIVE_IGNORED "Primitive ignored"
530 #endif
531
532 /*
533 * State of elementary file after SIM_FILE_CHANGE_IND
534 */
535 #define SAT_UNCHANGED 0 /* SAT didn't change the file */
536 #define SAT_READ_FILE 1 /* SAT changed file, still to read */
537 #define SAT_PEND_CNF 2 /* SIM_READ_REQ underway for elementary file */
538 #define SAT_PEND_ACT 3 /* File read, but not yet activated */
539
540 /*
541 * Get registration type. Use this macro to make it easy for the optimizer
542 * to optimize some expressions away if compiling a GSM only protocol stack.
543 * These macros help to avoid making an #ifdef grave from MM.
544 */
545 #ifdef GPRS
546 #define mm_gsm_alone() (GET_STATE (STATE_REG_TYPE) EQ REG_GPRS_INACTIVE)
547 #define mm_cm_est_allowed() (GET_STATE (STATE_GPRS_CM_EST) EQ CM_GPRS_EST_OK)
548 #define mm_lup_allowed_by_gmm() (GET_STATE (STATE_REG_TYPE) NEQ REG_CELL_SEARCH_ONLY)
549 #else
550 #define mm_gsm_alone() TRUE
551 #define mm_cm_est_allowed() TRUE
552 #define mm_lup_allowed_by_gmm() TRUE
553 #endif /* GPRS */
554
555 #define EPLMNLIST_SIZE 6
556
557 /******************Specially for Cingular********************/
558 #define MAX_CINGULAR_PLMN 14
559
560 /*==== TYPES ======================================================*/
561
562 typedef struct
563 {
564 /* IMSI EPLMNList was received with */
565 T_imsi_struct eqv_plmn_imsi;
566
567 /* Contains a list of Equivalent PLMNs provided by the network. The list is
568 * replaced or deleted at the end of each location update procedure, routing
569 * area update procedure and GPRS attach procedure. */
570 UBYTE eqv_plmn_list[EPLMNLIST_SIZE*UBYTES_PER_PLMN];
571 } T_ffs_eplmn_imsi;
572
573
574 typedef struct
575 {
576 /* Access class for RR from the SIM */
577 USHORT acc_class;
578
579 /* PLMN on which MM actually tries to register */
580 T_plmn actual_plmn;
581
582 /* Room for BCCH information from the SIM/RR.
583 * The better way would be to define this as T_bcch_info */
584 UBYTE bcch[SIZE_BCCH];
585
586 /* TRUE if the BCCH information shall be used. The sense of this variable
587 * is questionable */
588 BOOL bcch_encode;
589
590 /* Cell test mode, possible values are
591 * CELL_TEST_ENABLE and CELL_TEST_DISABLE */
592 UBYTE cell_test;
593
594 /* The ciphering key sequence number */
595 UBYTE cksn;
596
597 /* The list of forbidden PLMNs, copy of SIM data */
598 UBYTE forb_plmn[MAX_FORB_PLMN_ID * UBYTES_PER_PLMN];
599
600 #ifdef GPRS
601 /* The list of forbidden PLMNs for GPRS services */
602 UBYTE gprs_forb_plmn[MAX_GPRS_FORB_PLMN_ID * UBYTES_PER_PLMN];
603 #endif /* #ifdef GPRS */
604
605 /* The PLMN which sent recently a LUP reject with cause #13 */
606 T_plmn low_prio_plmn;
607
608 /* The IMSI, copy of SIM data */
609 T_imsi_struct imsi_struct;
610
611 /* The ciphering key */
612 UBYTE kc[MAX_KC];
613
614 /* The location area where the mobile currently is registered */
615 T_loc_area_ident lai;
616
617 /* Operation mode. Valid flag v_op set to valid after first reg. attempt
618 * Also contains information whether a sim and a test sim is inserted. */
619 T_op op;
620
621 /* Length of MNC in IMSI.SIM should send the length of mnc and MM should use
622 * this value to see if third digit of MNC is valid or not
623 */
624 U8 length_mnc;
625
626 /* The found PLMNs during network search */
627 UBYTE plmn[MAX_PLMN_ID * UBYTES_PER_PLMN];
628
629 /* The LACs of the found PLMNs */
630 USHORT plmn_lac [MAX_PLMN_ID];
631
632 /* The reception levels of the found PLMNs */
633 UBYTE plmn_rx [MAX_PLMN_ID];
634
635 #ifdef GPRS
636 /* The GPRS capabilities of the found PLMNs */
637 UBYTE gprs_status[MAX_PLMN_ID];
638
639 /* The indicated value of the TMSI */
640 ULONG indicated_tmsi;
641 #endif /* #ifdef GPRS */
642
643 /* Number of found PLMN */
644 UBYTE plmn_cnt;
645
646 /* Index of currently checked PLMN in automatic mode */
647 UBYTE plmn_index;
648
649 /* Preferred PLMN list */
650 UBYTE pref_plmn[MAX_PREF_PLMN_ID * UBYTES_PER_PLMN];
651
652 #ifdef REL99
653
654 /*
655 * Actual length of User controlled PLMN Selector with Access Technology (EFPLMNwAcT)
656 * as indicated in sim_mm_insert_ind
657 */
658 USHORT sim_ucps_at_len;
659 /*
660 * Actual length of Operator controlled PLMN Selector with Access Technology (EFOPLMNwAcT)
661 * as indicated in sim_mm_insert_ind
662 */
663 USHORT sim_ocps_at_len;
664
665 /*
666 * Flag indicates which SIM EFs are being used for pref_plmn
667 * TRUE: Indicated SIM EFs EFPLMNwAcT and EFOPLMNwAcT are being used.
668 * FALSE: Indicated SIM EF EFPLMNsel is being used.
669 */
670 BOOL sim_uocps_at_used;
671 #endif
672
673 /*Actual length of PLMN Selector (EFPLMNsel) as indicated in sim_mm_insert_ind*/
674 USHORT sim_plmnsel_len;
675
676 /*
677 * Flag indicates if the SIM INSERT INDICATION is in progress i.e. after SIM_MM_INSERT_IND,
678 * MM is reading SIM files.
679 * TRUE: SIM MM insert indication and Reading of files is in progress
680 */
681 BOOL sim_read_in_progress;
682
683 /* This variable will be used to decide if SIM_SYNC_REQ should be sent or not.
684 * After receiving SIM_MM_INSERT_IND, MM should respond with a SIM_SYNC_REQ.
685 * This SIM_SYNC_REQ will be sent after reading either EFPLMNSel or EFPLMNwAct
686 * and EFOPLMNwAct
687 */
688 BOOL sim_sync_req_pending;
689
690 /*SET true is sim file update indication is received*/
691 BOOL sim_file_upd_ind_rec;
692
693
694
695 /* HPLMN search period, this is forwarded to RR and not evaluated by MM */
696 UBYTE thplmn;
697
698 /* TMSI, copy of the SIM data */
699 ULONG tmsi;
700
701 /* The update state as it is on the SIM. Possible values are
702 * MS_UPDATED, MS_NOT_UPDATED and MS_LA_NOT_ALLOWED */
703 UBYTE update_stat;
704
705 /* MMXXX_REG_CNF sent to MMI only if this has not already been done
706 * after last registration attempt / last loss of service or
707 * the cell has changed. */
708 BOOL full_service_indicated;
709
710 /* New cell from RR after last MMXXX_REG_CNF */
711 BOOL new_cell_ind;
712
713 /* Access class updated by SAT, update state */
714 UBYTE upd_sim_acc;
715
716 /* Preferred PLMN list updated by SAT, update state */
717 UBYTE upd_sim_plmnsel;
718
719 /* HPLMN search period updated by SAT, update state */
720 UBYTE upd_sim_hplmn;
721
722 /* Forbidden PLMN list updated by SAT, update state */
723 UBYTE upd_sim_fplmn;
724
725 #ifdef REL99
726
727 /* User controlled PLMN Selector with Access Technology update state */
728 UBYTE upd_sim_ucps_at;
729
730 /* User controlled PLMN Selector with Access Technology update state */
731 UBYTE upd_sim_ocps_at;
732
733 #endif
734
735 /* Acting HPLMN value updated by SAT, update state */
736 UBYTE upd_sim_act_hplmn;
737
738 /* If NEQ NULL, MM is performing the MM Restart procedure */
739 T_SIM_MM_INSERT_IND *sim_insert_info;
740
741 /* Contains a list of Equivalent PLMNs provided by the network. The list is
742 * replaced or deleted at the end of each location update procedure, routing
743 * area update procedure and GPRS attach procedure. */
744 //UBYTE eqv_plmn_list[EPLMNLIST_SIZE*UBYTES_PER_PLMN];
745
746 /*
747 * EPLMN List and IMSI store in Non-volatile memory
748 */
749 T_ffs_eplmn_imsi eqv_plmns;
750
751 /* If sim supports AHPLMN and the file has valid value acting_hplmn.v_plmn is TRUE and the
752 * actual value of AHPLMN will be contained in acting_hplmn. If sim doesnt support this
753 * feature or the value for AHPLMN is invalid acting_hplmn.v_plmn is FALSE and acting_hplmn
754 * contains 0xff 0xff 0xff
755 */
756
757 T_plmn acting_hplmn;
758
759 /* If the value read for AHPLMN is FFFFFF then acting_hplmn_invalid will be
760 * true.This will only be used if AHPLMN is modified via OTA
761 */
762 BOOL acting_hplmn_invalid;
763
764 /* If the PLMN is registered to AHPLMN at the time of REFRESH command by SMS,
765 * then this flag should be set to true.
766 */
767 BOOL reg_plmn_equal_ahplmn;
768
769 /* This flag shall be used to indicate Cingular Network */
770 BOOL is_cingular_sim;
771
772 /* This flag enables a quick search when coming back from VPLMN to HPLMN and RR_ABORT_IND gives
773 HPLMN as a part of its List*/
774 BOOL quick_hplmn_search;
775
776
777 } T_REG;
778
779 /*
780 This struct is used to store timer events and establishment requests
781 */
782 typedef struct
783 {
784 UBYTE comp;
785 UBYTE ti;
786 USHORT estcs;
787 } T_STORE_1;
788
789 typedef union
790 {
791 T_STORE_1 event;
792 T_PRIM_HEADER* primitive;
793 } T_STORE_MM;
794
795 typedef struct
796 {
797 UBYTE use;
798 U8 content_type;
799 U8 info;
800 T_STORE_MM content;
801 } T_STORE;
802
803 typedef struct
804 {
805 UBYTE comp;
806 UBYTE ti;
807 USHORT cause;
808 UBYTE service;
809 } T_PEND;
810
811 typedef struct
812 {
813 UBYTE state;
814 } T_CONN;
815
816 typedef struct
817 {
818 /* The BCCH information as delivered by the cell
819 * The better way would be to define this as T_bcch_info */
820 UBYTE bcch[SIZE_BCCH];
821
822 /* Location Area Identity of last/current selected cell,
823 * information will not be invalidated if coverage lost
824 * until new cell is selected. */
825 T_loc_area_ident lai;
826
827 /* Cell ID of last/current selected cell,
828 * information will not be invalidated if coverage lost
829 * until new cell is selected. */
830 USHORT cid;
831
832 /* Information broadcast by cell on BCCH */
833 T_mm_info mm_info;
834
835 #ifdef GPRS
836 /* Information braodcast on the BCCH whether the cell supports GPRS */
837 UBYTE gprs_indication;
838 #endif /* GPRS */
839 } T_MM;
840
841
842 #if defined (OPTION_TIMER)
843 typedef struct
844 {
845 UBYTE t_mode;
846 ULONG t_val;
847 } T_TIMER_CONFIG;
848 #endif /* #if defined (OPTION_TIMER) */
849
850
851
852 #ifdef GPRS
853
854 /*
855 * MM data solely used if GPRS is also delivered
856 */
857 typedef struct
858 {
859 /* TRUE if MM has to send MMGMM_REG_CNF after IDLE mode entry */
860 BOOL reg_cnf_on_idle_entry;
861
862 /* TRUE if SIM currently physically removed and SIM data not yet deleted.
863 * This variable is only used if GSM is not alone, otherwise MM can perform
864 * the necessary actions (e.g. IMSI detach) alone. */
865 BOOL sim_physically_removed;
866
867 /* TRUE if the MS is in a location area where combined attach is
868 * required (network mode I) and therefore MM shall not start T3212. */
869 BOOL combined_procedures;
870
871 /* The currently selected mobile class. Needed for reject cause #14. */
872 UBYTE mobile_class;
873
874 /* The current GPRS resumption state. Defaults to MMGMM_RESUMPTION_FAILURE
875 * excepts if processing RR_RELEASE_IND, in this case it is set according
876 * to the resumption state delivered by RR_RELEASE_IND. */
877 UBYTE resumption;
878
879 } T_GPRS_DATA;
880 #endif /* GPRS */
881
882
883 typedef struct
884 {
885 /* The variable ciphering_on is a write-only variable, not to be eliminated.
886 * It contains the state of ciphering on the air interface (on or off). */
887 BOOL ciphering_on;
888
889 /* The connection table. NUM_OF_CM_ENT equals to the number of CM entities,
890 * while NUM_OF_CONN_PER_CM_ENT equals to the number of parallel
891 * transactions each entitity can have */
892 UBYTE conn_state[NUM_OF_CM_ENT][NUM_OF_CONN_PER_CM_ENT];
893
894 /* May be zero, OPTIONAL_INFO_ERROR or RC_INVALID_MAND_MESSAGE.
895 * Related to the decoding of messages */
896 UBYTE error;
897
898 /* This variable is TRUE until either the first location updating
899 * procedure has ended either with an invalidation of the registration
900 * state or the first successful location updating. This variable should
901 * go into the registration data, but this is really only cosmetic.
902 * first_attach_mem holds the state of first attach before it is set to FALSE.
903 * It is used to determine if the HPLMN timer has to be started with 3 min for
904 * first search of HPLMN or if the normal hplmn timer value from registration
905 * data is to be used. After this check it is reset unconditional.
906 */
907 BOOL first_attach;
908 BOOL first_attach_mem;
909
910 /* RR release cause which leaded to idle entry after failed LUP. In case
911 * this is RELCS_ACCESS_BARRED or RELCS_RND_ACC_DELAY, MM is someway in
912 * state MM_IDLE_LUP_NEEDED, but this state is not used for this purpose
913 * in MM. A location updating attempt will be performed if RR informs MM
914 * by using RR_SYNC_IND with an appropriate cause. */
915 USHORT idle_entry;
916
917 /* Contains the type of the location update in progress and the state of
918 * the follow on request flag of this location update. */
919 T_loc_upd_type loc_upd_type;
920
921 /* Contains relevant data delivered by RR about the selected cell.
922 * A better name for this type instead T_MM may be T_CELL_DATA,
923 * for the variable itself cell_data */
924 T_MM mm;
925
926 /* The state of the MM state machines, the MM main state machine and
927 * the registration state machine. */
928 UBYTE state[NUM_OF_MM_STATES];
929
930 // TO_BE_DONE - write a good comment
931 UBYTE nreg_cause;
932
933 /* The variable nreg_request is TRUE if the deregistration was requested by
934 * MMR_NREG_REQ, otherwise FAISE. This is needed to decide whether MM
935 * will send an MMR_NREG_IND or MMR_NREG_CNF primitive at the end of the
936 * deregistration process. */
937 BOOL nreg_request;
938
939 /* All necessary information which is required for a pending connection
940 * is stored here. Note: There can be not more than one pending connection
941 * at a given time. */
942 T_PEND pend_conn;
943
944 /* The base for the internal random number generator, used to set the value
945 * for T3212 under certain cicumstances. */
946 ULONG rand_base;
947
948 /* All the data related to registration and SIM. */
949 T_REG reg;
950
951 /* In this location timer expiries and CM connection requests can be stored
952 * for later usage after a state change of one of the MM state machines */
953 T_STORE store[MAX_STORE_ENTRIES];
954
955 /* Use stored entries after end of transition */
956 BOOL use_stored_entries;
957
958 #if defined (NEW_FRAME)
959 /* TRUE if the appropriate timer is active */
960 BOOL t_running[NUM_OF_MM_TIMERS];
961 #else
962 /* The handles for all the MM timers. */
963 T_VSI_THANDLE t_handle[NUM_OF_MM_TIMERS];
964 #endif
965
966 /* This variable is a perfectly good substitute for missing MM state
967 * WAIT_FOR_ADDITIONAL_OUTGOING MM connection (#20). If in state
968 * MM_CONNECTION_ACTIVE (#6) and this flag is set,
969 * MM is really in state #20. */
970 // Identical with (TIMERACTIVE (T3230))
971 // Identical with (mm_count_connections (CM_PENDING) NEQ 0)
972 // => flag could be eliminated!
973 BOOL wait_for_accept;
974
975 /* Copy of the power field of the last RR_ACTIVATE_CNF/RR_ACTIVATE_IND */
976 UBYTE rf_power;
977
978 /* The counter for RR_ESTABLISH_REQ retransmissions for one CM connection
979 * attempt if a random access failure occured. */
980 UBYTE act_retrans;
981
982 /* The LOCATION UPDATE attempt counter */
983 UBYTE attempt_cnt;
984
985 /* The variables reject_cause and last_reject_cause store the
986 * current and the previous reject cause during location updating. */
987 USHORT rej_cause;
988 USHORT last_rej_cause;
989
990 /* Remember at RR establishment for emergency call and at start of the
991 * location update procedure the type of service state MM had. */
992 UBYTE idle_substate;
993
994 /* Variable solely used for debugging purposes */
995 USHORT debug_last_rej_cause;
996
997 /* Variable solely used for debugging purposes */
998 UBYTE mm_idle_no_imsi_marker;
999
1000 /* Faked T3212 value for test only, will be used if not equal zero */
1001 USHORT t3212_cfg_counter;
1002
1003 /* This variable stores whether a timeout of T3212 has occurred and
1004 * a periodic location updating procedure has to be performed ASAP. */
1005 BOOL t3212_timeout;
1006
1007 /* counts, how many times T3213 was started. Referres to the Note in 24.008 ch. 4.4.4.9
1008 * "the mobile station may as an option delay the repeated attempt for up to 8 seconds
1009 * to allow cell re-selection to take place" ---> 2 times T3213 as delay implemented.
1010 * 0 -> first run ...
1011 */
1012 U8 t3213_restart;
1013
1014 UBYTE reest_ti;
1015
1016 BOOL reest_cell_avail;
1017
1018 /* LOCATION UPDATING REJECT cause from the network or internal
1019 * cause for limited service (e.g. AUTHENTICATION REJECT received).
1020 * This is for MMR_NREG_IND to inform the MMI and is not intended to
1021 * be used by MM to control its own operation. */
1022 USHORT limited_cause;
1023
1024 /* A search for available networks was requested by the MMI */
1025 BOOL plmn_scan_mmi;
1026
1027 /* A search for available networks was requested by MM for own operation */
1028 BOOL plmn_scan_mm;
1029
1030 /* This boolean variable is used only together with available test SIM.
1031 * Is it set to a value of TRUE, the MS uses stored BCCH lists also
1032 * with test SIM. */
1033 BOOL config_use_stored_bcch;
1034
1035
1036 /* This variable is used to prevent an RR_ABORT_IND caused by a RR TABORT timer
1037 * timeout from interfering with FTA test 26.7.4.3.4
1038 */
1039 BOOL rr_abort_prior_to_tabort;
1040
1041
1042 /* Used to store the datafield used in the last sent SIM_READ_REQ. Default value will
1043 be NOT_PRESENT_16BIT, if no read request has been sent to SIM*/
1044 USHORT sim_read_req_data_field;
1045
1046 /* Sometimes the network sends multiple (two) authentication req messages
1047 * without waiting for an answer. SIM interface got modified to support
1048 * identifiers for requests sent to SIM. The following variable contains the req_id
1049 * in the last sent SIM_AUTHENTICATION_REQ.
1050 * On receiving SIM_AUTHENTICATION_CNF, response is sent to network only
1051 * if req_id matches the value in this variable. SIM_AUTHENTICATION_CNF with other
1052 * req_ids are ignored*/
1053 UBYTE last_auth_req_id;
1054
1055
1056 #if defined (FF_EOTD) AND defined (REL99)
1057 /* This flag is used to indicate if rrlp/lcs procedure is running. This flag is set
1058 * to true upon reception of RR_RRLP_START_IND. Flag will be set to false upon
1059 * reception of RR_RRLP_STOP_IND.
1060 */
1061 BOOL rrlp_lcs_started;
1062 #endif /* (FF_EOTD) AND defined (REL99) */
1063 /* This variable is used to keep count of repetitions for the network search if
1064 MM receives RR_ABORT_IND with cause RRCS_ABORT_PTM. Depending on its value
1065 MM behaviour will be decided.
1066 */
1067 UBYTE net_search_count;
1068
1069
1070 /* All the data needed for GPRS support */
1071 #ifdef GPRS
1072 T_GPRS_DATA gprs;
1073 #endif
1074 /* This is a bitwise mapping to indicate SIM which EFs are to be updated in SIM_MM_UPDATE_REQ */
1075 U8 ef_indicator;
1076 } T_MM_DATA;
1077
1078 /*==== EXPORT =====================================================*/
1079
1080 #define GET_BITS(value, shift, width) ((value >> shift) & ((1 << width) - 1))
1081
1082 /*
1083 * Prototypes Timer Modul
1084 */
1085 /*
1086 * If all entities are linked into one module this definitions
1087 * prefixes all this functions with the enity name
1088 */
1089 #ifdef OPTION_MULTITHREAD
1090 #define tim_t_reg _ENTITY_PREFIXED(tim_t_reg)
1091 #define tim_t3210 _ENTITY_PREFIXED(tim_t3210)
1092 #define tim_t3211 _ENTITY_PREFIXED(tim_t3211)
1093 #define tim_t3212 _ENTITY_PREFIXED(tim_t3212)
1094 #define tim_t3213 _ENTITY_PREFIXED(tim_t3213)
1095 #define tim_t3220 _ENTITY_PREFIXED(tim_t3220)
1096 #define tim_t3230 _ENTITY_PREFIXED(tim_t3230)
1097 #define tim_t3240 _ENTITY_PREFIXED(tim_t3240)
1098 #ifdef REL99
1099 #define tim_t3241 _ENTITY_PREFIXED(tim_t3241)
1100 #endif
1101 #define tim_t_hplmn _ENTITY_PREFIXED(tim_t_hplmn)
1102 #endif /* #ifdef OPTION_MULTITHREAD */
1103
1104 #if defined (NEW_FRAME)
1105 #ifdef OPTION_MULTITHREAD
1106 #define tim_exec_timeout _ENTITY_PREFIXED(tim_exec_timeout)
1107 #define tim_start_timer _ENTITY_PREFIXED(tim_start_timer)
1108 #define tim_stop_timer _ENTITY_PREFIXED(tim_stop_timer)
1109 #endif
1110 EXTERN void tim_exec_timeout (USHORT index);
1111 EXTERN void tim_start_timer (USHORT index, T_TIME value);
1112 EXTERN void tim_stop_timer (USHORT index);
1113 #else
1114
1115 #ifdef OPTION_MULTITHREAD
1116 #define tim_set_timeout_flag _ENTITY_PREFIXED(tim_set_timeout_flag)
1117 #define tim_handle_timeout _ENTITY_PREFIXED(tim_handle_timeout)
1118 #define tim_get_config_timer _ENTITY_PREFIXED(tim_get_config_timer)
1119 #define tim_start_timer _ENTITY_PREFIXED(tim_start_timer)
1120 #define tim_flush_fifo _ENTITY_PREFIXED(tim_flush_fifo)
1121 #endif
1122
1123 EXTERN void tim_set_timeout_flag (T_VSI_THANDLE handle,
1124 USHORT *t_flag);
1125 EXTERN void tim_handle_timeout (USHORT *t_flag);
1126 EXTERN void tim_get_config_timer (char *outString,
1127 UBYTE t_num,
1128 KW_DATA *t_name);
1129 EXTERN void tim_start_timer (UBYTE id,
1130 T_VSI_THANDLE handle,
1131 T_VSI_TVALUE value);
1132 EXTERN void tim_flush_fifo (T_VSI_THANDLE handle);
1133
1134 #endif /* else, #if defined (NEW_FRAME) */
1135
1136 #ifdef OPTION_MULTITHREAD
1137 #define tim_init_timer _ENTITY_PREFIXED(tim_init_timer)
1138 #define tim_config_timer _ENTITY_PREFIXED(tim_config_timer)
1139 #endif
1140
1141 EXTERN BOOL tim_init_timer (void);
1142
1143 EXTERN void tim_config_timer (UBYTE t_num,
1144 UBYTE t_mod,
1145 ULONG t_val);
1146
1147 /*
1148 * Prototypes MM
1149 */
1150
1151 /*
1152 * MM Mobility Management
1153 */
1154
1155 /*
1156 * mobility management primitives
1157 */
1158 EXTERN void mm_init_mm_data (void);
1159 EXTERN void mm_mdl_error_ind (T_MDL_ERROR_IND *mdl_error_ind);
1160 EXTERN void mm_mmcm_data_req (T_MMCM_DATA_REQ *mmcm_data_req);
1161 EXTERN void mm_mmcm_establish_req (T_MMCM_ESTABLISH_REQ *mmcm_establish_req);
1162 EXTERN void mm_mmcm_reestablish_req (T_MMCM_REESTABLISH_REQ *mmcm_reestablish_req);
1163 EXTERN void mm_mmcm_release_req (T_MMCM_RELEASE_REQ *mmcm_release_req);
1164 EXTERN void mm_mmcm_prompt_rej (T_MMCM_PROMPT_REJ *prompt_rej);
1165 EXTERN void mm_mmcm_prompt_res (T_MMCM_PROMPT_RES *prompt_rsp);
1166 EXTERN void mm_mmss_data_req (T_MMSS_DATA_REQ *mmss_data_req);
1167 EXTERN void mm_mmss_establish_req (T_MMSS_ESTABLISH_REQ *mmss_establish_req);
1168 EXTERN void mm_mmss_release_req (T_MMSS_RELEASE_REQ *mmss_release_req);
1169 EXTERN void mm_mmsms_data_req (T_MMSMS_DATA_REQ *mmsms_data_req);
1170 EXTERN void mm_mmsms_establish_req (T_MMSMS_ESTABLISH_REQ *mmsms_establish_req);
1171 EXTERN void mm_mmsms_release_req (T_MMSMS_RELEASE_REQ *mmsms_release_req);
1172 EXTERN void mm_mmxx_establish_req (UBYTE comp, UBYTE ti, USHORT estcs, U8 info);
1173 EXTERN void mm_rr_abort_ind (T_RR_ABORT_IND *rr_abort_ind);
1174 EXTERN void mm_rr_activate_cnf (T_RR_ACTIVATE_CNF *rr_activate_cnf);
1175 EXTERN void mm_rr_activate_ind (T_RR_ACTIVATE_IND *rr_activate_ind);
1176 EXTERN void mm_rr_establish_cnf (T_RR_ESTABLISH_CNF *rr_establish_cnf);
1177 EXTERN void mm_rr_establish_ind (T_RR_ESTABLISH_IND *rr_establish_ind);
1178 EXTERN void mm_rr_release_ind (T_RR_RELEASE_IND *rr_release_ind);
1179 EXTERN void mm_rr_sync_ind (T_RR_SYNC_IND *rr_sync_ind);
1180 #if defined (FF_EOTD) AND defined (REL99)
1181 EXTERN void mm_rr_rrlp_start_ind (T_RR_RRLP_START_IND *rr_rrlp_start_ind);
1182 EXTERN void mm_rr_rrlp_stop_ind (T_RR_RRLP_STOP_IND *rr_rrlp_stop_ind);
1183 #endif /* (FF_EOTD) AND defined (REL99) */
1184 EXTERN void mm_sim_set_imsi_marker (T_MSG_TYPE imsi_marker);
1185
1186
1187 /*
1188 * mobility management signalling
1189 */
1190 EXTERN void mm_abort (T_D_ABORT *d_abort);
1191 EXTERN void mm_auth_rej (void);
1192 EXTERN void mm_auth_req (T_D_AUTH_REQ *auth_req);
1193 EXTERN void mm_cm_message (UBYTE pd,
1194 UBYTE ti,
1195 T_RR_DATA_IND *rr_data_ind);
1196 EXTERN void mm_cm_serv_accept (void);
1197 EXTERN void mm_cm_serv_rej (T_D_CM_SERV_REJ *cm_serv_rej);
1198 EXTERN void mm_ident_req (T_D_IDENT_REQ *ident_req);
1199 EXTERN void mm_loc_upd_acc (T_D_LOC_UPD_ACCEPT *loc_upd_accept);
1200 EXTERN void mm_lup_rej (T_D_LOC_UPD_REJ *loc_upd_rej);
1201 EXTERN void mm_mm_status (void);
1202 EXTERN void mm_mmr_auth_cnf (T_SIM_AUTHENTICATION_CNF *sim_auth_cnf);
1203 EXTERN void mm_mmr_nreg_req (UBYTE nreg_cause,
1204 UBYTE detach_done);
1205 EXTERN void mm_mmr_reg_req (UBYTE func);
1206 EXTERN void mm_tmsi_realloc_cmd (T_D_TMSI_REALLOC_CMD *tmsi_realloc_cmd);
1207 EXTERN void mm_cm_service_prompt (T_D_CM_SERVICE_PROMPT *cm_service_prompt);
1208 EXTERN void mm_mm_information (T_D_MM_INFORMATION *mm_information);
1209
1210 /*
1211 * mobility management procedures
1212 */
1213 EXTERN void mm_auto_net_reg (void);
1214 EXTERN void mm_abort_connection (UBYTE abcs);
1215 EXTERN void mm_attach_loc_upd (void);
1216 EXTERN void mm_build_auth_res (T_SIM_AUTHENTICATION_CNF *sim_auth_cnf,
1217 T_U_AUTH_RES *auth_res);
1218 EXTERN void mm_build_ident_res (UBYTE id_type,
1219 T_U_IDENT_RES *ident_res);
1220 EXTERN void mm_build_mm_status (UBYTE cause,
1221 T_B_MM_STATUS *mm_status);
1222 EXTERN void mm_build_rr_sync_req_mode (void);
1223 EXTERN void mm_build_rr_sync_req_cause (USHORT cause);
1224 EXTERN void mm_build_rr_sync_req_ciph (void);
1225 EXTERN void mm_build_rr_sync_req (T_MSG_TYPE ciph);
1226 EXTERN void mm_build_rr_sync_req_tmsi (void);
1227 EXTERN void mm_build_rr_sync_hplmn_req (void);
1228 EXTERN void mm_check_error_flag (void);
1229 EXTERN BOOL mm_check_critical_error (void);
1230 EXTERN BOOL mm_send_status_on_error (void);
1231 EXTERN void mm_clear_mob_ident (T_imsi_struct *mob_ident);
1232 EXTERN void mm_clear_reg_data (void);
1233 EXTERN void mm_copy_rr_act_cnf_data (T_RR_ACTIVATE_CNF *rr_activate_cnf);
1234 EXTERN SHORT mm_count_connections (UBYTE conn_type);
1235 EXTERN void mm_create_est_message (USHORT est_cause,
1236 UBYTE service,
1237 UBYTE ti,
1238 USHORT *bit_size_message);
1239 EXTERN void mm_create_imsi_detach_message (void);
1240 EXTERN void mm_delete_entry (UBYTE comp,
1241 UBYTE ti);
1242 EXTERN void mm_init (void);
1243 EXTERN UBYTE mm_calculate_digits (const UBYTE *digits);
1244 EXTERN void mm_loc_upd_rej (void);
1245 EXTERN void mm_lup_restart (void);
1246 EXTERN void mm_mdl_rel_req (void);
1247 EXTERN void mm_mdl_rel_req_sapi_3 (void);
1248 EXTERN void mm_mmsms_rel_ind (USHORT cause,
1249 UBYTE conn_typ);
1250 EXTERN SHORT mm_mmxx_err_ind (USHORT cause);
1251 EXTERN void mm_mmxx_est_cnf (void);
1252 EXTERN void mm_mmxx_release_ind (UBYTE comp,
1253 UBYTE ti,
1254 USHORT relcs);
1255 EXTERN void mm_mmxx_rel_ind (USHORT cause,
1256 UBYTE conn_typ);
1257 EXTERN void mm_normal_loc_upd (void);
1258 EXTERN void mm_periodic_loc_upd (void);
1259 EXTERN void mm_power_off (void);
1260 EXTERN USHORT mm_random (USHORT n);
1261 EXTERN void mm_read_entry (void);
1262 EXTERN void mm_reest (UBYTE ti);
1263 EXTERN void mm_release_rr_connection (UBYTE resumption);
1264 EXTERN void mm_rr_act_req (void);
1265 EXTERN void mm_rr_data_req (USHORT est_cause,
1266 UBYTE service,
1267 UBYTE ti);
1268 EXTERN void mm_rr_est_req (USHORT est_cause,
1269 UBYTE service,
1270 UBYTE ti);
1271 EXTERN void mm_start_loc_upd (UBYTE lup_type);
1272 EXTERN void mm_continue_running_update (void);
1273 EXTERN void mm_start_net_req (void);
1274 EXTERN void mm_start_t3212_bcch (void);
1275 EXTERN void mm_change_t3212 (void);
1276 EXTERN void mm_use_entry (void);
1277 EXTERN void mm_write_entry (UBYTE comp,
1278 UBYTE ti,
1279 USHORT est_cs,
1280 U8 content_type,
1281 void* primitive,
1282 U8 info);
1283 EXTERN BOOL mm_check_lai (const T_loc_area_ident * lai1,
1284 const T_loc_area_ident * lai2);
1285 EXTERN BOOL mm_check_lai_from_RR (const T_loc_area_ident * lai1,
1286 const T_plmn * plmn2,
1287 USHORT lac2);
1288 EXTERN BOOL mm_normal_upd_needed (void);
1289 EXTERN BOOL mm_attach_upd_needed (void);
1290 EXTERN BOOL mm_periodic_upd_needed (void);
1291 EXTERN BOOL mm_set_follow_on_request (void);
1292 EXTERN void mm_end_of_detach (void);
1293 EXTERN UBYTE mm_get_service_state (void);
1294 EXTERN BOOL mm_full_service_pplmn_scan (void);
1295
1296 /* Implements Measure 29 and streamline encoding */
1297 EXTERN void mm_send_status (UBYTE cause);
1298
1299 /*
1300 * Registration
1301 */
1302
1303 /*
1304 * registration primitives and functions
1305 */
1306
1307 #ifndef GPRS
1308 EXTERN void reg_mmr_net_req (T_MMR_NET_REQ *mmr_net_req);
1309 EXTERN void reg_mmr_nreg_req (T_MMR_NREG_REQ *mmr_nreg_req);
1310 EXTERN void reg_mmr_plmn_mode_req (T_MMR_PLMN_MODE_REQ *plmn_mode_req);
1311 EXTERN void reg_mmr_plmn_res (T_MMR_PLMN_RES *mmr_plmn_res);
1312 EXTERN void reg_mmr_reg_req (T_MMR_REG_REQ *mmr_reg_req);
1313 #endif /* GPRS */
1314
1315 EXTERN void mm_func_mmgmm_net_req (void);
1316 EXTERN void mm_func_mmgmm_nreg_req (UBYTE detach_cause,
1317 UBYTE detach_done,
1318 USHORT cs);
1319 EXTERN void mm_func_mmgmm_plmn_mode_req (UBYTE mode);
1320 EXTERN void mm_func_mmgmm_plmn_res (const T_plmn *plmn,
1321 UBYTE reg_type,
1322 UBYTE mobile_class);
1323 EXTERN void mm_func_mmgmm_reg_req (UBYTE service_mode,
1324 UBYTE reg_type,
1325 UBYTE mobile_class,
1326 UBYTE bootup_act);
1327
1328 EXTERN void reg_sim_auth_cnf (T_SIM_AUTHENTICATION_CNF *sim_auth_cnf);
1329 EXTERN void reg_sim_mm_insert_ind (T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1330 EXTERN void reg_sim_remove_ind (T_SIM_REMOVE_IND *sim_remove_ind);
1331 EXTERN void reg_sim_mm_info_ind (T_SIM_MM_INFO_IND *sim_mm_info_ind);
1332 EXTERN void reg_sim_file_upd_ind (T_SIM_FILE_UPDATE_IND *file_upd);
1333 EXTERN void reg_sim_read_cnf (T_SIM_READ_CNF *sim_read_cnf);
1334 EXTERN void reg_sim_sync_cnf (T_SIM_SYNC_CNF *sim_sync_cnf);
1335 EXTERN void reg_send_sim_sync_req (void);
1336 /*
1337 * registration signalling
1338 */
1339 EXTERN void reg_mmr_auth_ind (T_SIM_AUTHENTICATION_REQ *sim_auth_req);
1340 EXTERN void reg_mm_success (UBYTE service);
1341 EXTERN void reg_mm_failure (UBYTE forb_ind);
1342 EXTERN void reg_net_list (const T_RR_ABORT_IND *rr_abort_ind);
1343 EXTERN void reg_mm_cell_selected (void);
1344
1345 /*
1346 * registration procedures
1347 */
1348 EXTERN BOOL reg_best_plmn_in_country (const T_plmn *bcch_plmn);
1349 EXTERN void reg_check_hplmn_tim (UBYTE decihours);
1350
1351 EXTERN void reg_build_sim_update (void);
1352 EXTERN void reg_copy_sim_data (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1353 EXTERN void reg_create_plmn_list (const T_RR_ABORT_IND *rr_abort_ind,
1354 UBYTE include_flag);
1355 EXTERN void reg_extract_hplmn (T_plmn *plmn);
1356 EXTERN void reg_init (void);
1357 EXTERN void reg_plmn_add_bad (UBYTE *forb_plmn_list,
1358 USHORT list_size,
1359 const T_plmn *plmn);
1360 EXTERN void reg_plmn_bad_del (UBYTE *forb_plmn_list,
1361 USHORT list_size,
1362 const T_plmn *plmn);
1363 EXTERN BOOL reg_plmn_empty (const T_plmn *plmn);
1364
1365 EXTERN BOOL reg_sim_ef_plmn_field_empty (UBYTE *plmn);
1366
1367 EXTERN BOOL reg_plmn_equal_sim (const T_plmn *bcch_plmn,
1368 const T_plmn *sim_plmn);
1369
1370 #ifdef REL99
1371 EXTERN BOOL reg_read_plmn_present (UBYTE* plmn_bytes);
1372 EXTERN BOOL reg_read_plmn_support_acctec(UBYTE* plmn_bytes);
1373 #endif
1374
1375 EXTERN BOOL reg_plmn_equal_eqv (const T_plmn *bcch_plmn,
1376 const T_plmn *req_plmn);
1377 EXTERN BOOL reg_plmn_is_NA_plmn (const T_plmn *bcch_plmn);
1378 EXTERN BOOL reg_plmn_equal_hplmn (const T_plmn *bcch_plmn);
1379 EXTERN BOOL reg_plmn_equal_rplmn (T_plmn *plmn);
1380 EXTERN BOOL reg_imsi_equal (const T_imsi_struct *imsi1,
1381 const T_imsi_struct *imsi2);
1382 EXTERN void reg_plmn_select (UBYTE forb_ind);
1383 EXTERN void reg_read_bcch_info (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1384
1385 EXTERN BOOL reg_sim_files_to_be_read (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1386
1387 EXTERN void reg_read_forb_plmn (const T_forb_plmn *forb_plmn);
1388 EXTERN void reg_read_imsi (T_imsi_struct *imsi_struct,
1389 const T_imsi_field *imsi_field);
1390 EXTERN void reg_read_kc_cksn (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1391 EXTERN void reg_read_loc_info (const T_loc_info *loc_info);
1392
1393 EXTERN void reg_read_pref_plmn (UBYTE* data,
1394 USHORT length);
1395 #ifdef REL99
1396 EXTERN void reg_read_ucps_acctec (UBYTE* data,
1397 USHORT length);
1398 EXTERN void reg_read_ocps_acctec (UBYTE* data,
1399 USHORT length);
1400 #endif
1401
1402 EXTERN void reg_copy_sim_ahplmn (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1403 EXTERN void reg_set_bcch_info (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1404 EXTERN void reg_set_forb_plmns (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1405 EXTERN void reg_set_kc (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1406 EXTERN void reg_set_loc_info (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1407 EXTERN void reg_set_pref_plmns (T_SIM_MM_UPDATE_REQ *sim_mm_update_req); // #####
1408 EXTERN void reg_clear_plmn (T_plmn *plmn);
1409 EXTERN BOOL reg_clear_plmn_list (UBYTE *plmn_list,
1410 USHORT list_size);
1411 EXTERN void reg_unpack_plmn (T_plmn *plmn,
1412 const UBYTE *packed,
1413 USHORT index);
1414 EXTERN void reg_pack_plmn (UBYTE *packed,
1415 USHORT index,
1416 const T_plmn *plmn);
1417 EXTERN BOOL reg_plmn_in_list (const UBYTE *forb_plmn_list,
1418 USHORT list_size,
1419 const T_plmn *plmn);
1420 EXTERN void reg_rr_failure (T_RR_ABORT_IND *rr_abort_ind);
1421 EXTERN BOOL reg_read_next_sim_file (void);
1422 EXTERN void reg_end_of_deregistration (UBYTE nreg_cause,
1423 UBYTE service);
1424 #ifdef REL99
1425 EXTERN void reg_invalidate_upd_state (UBYTE new_update_state, BOOL tmsi_cksn_kc_not_deleted);
1426 #else
1427 EXTERN void reg_invalidate_upd_state (UBYTE new_update_state);
1428 #endif
1429 GLOBAL void reg_select_network (const T_plmn *plmn);
1430 EXTERN BOOL reg_plmn_in_pref_list (const T_plmn *plmn);
1431 EXTERN BOOL reg_same_country_plmn (const T_plmn *plmn1,
1432 const T_plmn *plmn2);
1433 EXTERN void reg_check_plmn_search (USHORT cause,
1434 const T_RR_ABORT_IND *rr_abort_ind);
1435 EXTERN void reg_check_hplmn_tim (UBYTE decihours);
1436 EXTERN void reg_stop_hplmn_tim (void);
1437 /*
1438 * Equivalent plmn procedures
1439 */
1440 EXTERN BOOL reg_store_eqv_plmns (T_eqv_plmn_list *eqv_plmn_list, T_plmn *plmn);
1441 EXTERN void reg_read_acting_hplmn (const U8 acting_hplmn[]);
1442
1443 EXTERN BOOL valid_acting_hplmn (T_plmn *acting_hplmn);
1444 GLOBAL void mm_read_ffs_init (void);
1445 GLOBAL void mm_write_eplmn_to_ffs (void);
1446 GLOBAL void mm_display_eplmn (void);
1447
1448 GLOBAL void mm_reset_ffs (void);
1449 GLOBAL BOOL mm_read_ffs (void);
1450 GLOBAL void check_if_cingular_sim (void);
1451
1452 /*
1453 * Formatter
1454 */
1455
1456 /*
1457 * formatter primitives
1458 */
1459 #if 0 /* Not referenced */
1460 EXTERN void for_init_mm_data (void);
1461 #endif /* #if 0 */
1462 EXTERN void for_rr_data_ind (T_RR_DATA_IND *rr_data_ind);
1463
1464 /*
1465 * formatter signalling
1466 */
1467 /*
1468 * If all entities are linked into one module this definitions
1469 * prefixes the global data with the enity name
1470 */
1471 #ifdef OPTION_MULTITHREAD
1472 #define for_est_req _ENTITY_PREFIXED(for_est_req)
1473 #endif /*OPTION_MULTITHREAD*/
1474 EXTERN void for_cm_message (T_RR_DATA_REQ *rr_data_req);
1475 EXTERN void for_data_req (USHORT bit_size_message);
1476 EXTERN void for_est_req (USHORT est_cause,
1477 USHORT bit_size_message);
1478
1479 /*
1480 * formatter procedures
1481 */
1482 /*
1483 * If all entities are linked into one module this definitions
1484 * prefixes the global data with the enity name
1485 */
1486 #ifdef OPTION_MULTITHREAD
1487 #define for_check_mobile_identity _ENTITY_PREFIXED(for_check_mobile_identity)
1488 #endif /*OPTION_MULTITHREAD*/
1489 EXTERN BOOL for_check_identity_type (UBYTE id);
1490 EXTERN BOOL for_check_mobile_identity (T_mob_id *mob_ident);
1491 EXTERN UBYTE for_check_reject_cause (UBYTE cause);
1492 EXTERN void mm_for_set_error (U8 cause);
1493 #if 0 /* Not referenced; body bag; 02.10.2003 */
1494 EXTERN void for_set_mandatory_error (void);
1495 EXTERN void for_set_content_error (void);
1496 EXTERN void for_set_optional_error (UBYTE iei);
1497 #endif /* #if 0 */
1498
1499 /*
1500 * csf procedures
1501 */
1502 EXTERN void csf_read_mobile_class_1 (T_mob_class_1 *mob_class_1);
1503 EXTERN void csf_read_mobile_class_2 (T_mob_class_2 *mob_class_2);
1504 EXTERN void csf_read_imei (T_imsi_struct *imei_struct);
1505
1506 /*
1507 * timer procedures
1508 */
1509 EXTERN void tim_t3210 (void);
1510 EXTERN void tim_t3211 (void);
1511 EXTERN void tim_t3212 (void);
1512 EXTERN void tim_t3213 (void);
1513 EXTERN void tim_t3220 (void);
1514 EXTERN void tim_t3230 (void);
1515 EXTERN void tim_t3240 (void);
1516 #ifdef REL99
1517 EXTERN void tim_t3241 (void);
1518 #endif
1519 EXTERN void tim_t_reg (void);
1520 EXTERN void tim_t_hplmn (void);
1521
1522 /*
1523 * timer
1524 */
1525 #if defined (NEW_FRAME)
1526 #define TIMERSTART(i,v) tim_start_timer (i, v)
1527 #define TIMERSTOP(i) tim_stop_timer (i)
1528 #define TIMERACTIVE(i) (mm_data->t_running[i])
1529 #else
1530 #define TIMERSTART(t, v) csf_alloc_timer (t, v, &mm_data->t_handle[t])
1531 #define TIMERSTOP(t) \
1532 { csf_free_timer (mm_data->t_handle[t]); mm_data->t_handle[t] = VSI_ERROR; }
1533 #define TIMERACTIVE(t) (mm_data->t_handle[t] NEQ VSI_ERROR)
1534
1535 #define T_TIME T_VSI_TVALUE
1536
1537 #endif /*(NEW_FRAME)*/
1538
1539
1540
1541 #ifdef GPRS
1542 /*
1543 * Prototypes for the primitive interface MMGMM (MM to GMM)
1544 */
1545 EXTERN void mm_send_mmgmm_reg_cnf (UBYTE bootup_cause);
1546 EXTERN void mm_mmgmm_reg_cnf (void);
1547 EXTERN void mm_mmgmm_nreg_ind (UBYTE service,
1548 UBYTE search_running,
1549 UBYTE forb_ind);
1550 EXTERN void mm_mmgmm_nreg_cnf (UBYTE detach_cause);
1551 EXTERN void mm_mmgmm_plmn_ind (USHORT cause,
1552 const T_RR_ABORT_IND *rr_abort_ind);
1553 EXTERN void mm_mmgmm_ahplmn_ind (T_plmn *acting_hplmn);
1554 #else
1555 /*
1556 * Prototypes for the primitive interface MMR (MM to ACI)
1557 */
1558 EXTERN void reg_send_mmr_reg_cnf (UBYTE bootup_cause);
1559 EXTERN void reg_build_mmr_reg_cnf (void);
1560 EXTERN void reg_build_mmr_nreg_ind (UBYTE service,
1561 UBYTE search_running,
1562 UBYTE forb_ind);
1563 EXTERN void reg_build_mmr_nreg_cnf (UBYTE detach_cause);
1564 EXTERN void reg_build_mmr_plmn_ind (USHORT cause,
1565 const T_RR_ABORT_IND *rr_abort_ind);
1566 EXTERN void reg_build_mmr_ahplmn_ind (T_plmn *acting_hplmn);
1567
1568 /*
1569 * By using this definitions, we avoid having a lot of ifdefs
1570 * in the code itself.
1571 */
1572 #define mm_send_mmgmm_reg_cnf(b) reg_send_mmr_reg_cnf(b)
1573 #define mm_mmgmm_reg_cnf() reg_build_mmr_reg_cnf()
1574 #define mm_mmgmm_nreg_ind(a,b,c) reg_build_mmr_nreg_ind(a,b,c)
1575 #define mm_mmgmm_nreg_cnf(detach_cause) reg_build_mmr_nreg_cnf(detach_cause)
1576 #define mm_mmgmm_plmn_ind(cause,ab) reg_build_mmr_plmn_ind(cause,ab)
1577 #define mm_mmgmm_ahplmn_ind(ahplmn) reg_build_mmr_ahplmn_ind(ahplmn)
1578 #endif /* GPRS */
1579
1580 #ifdef GPRS
1581 /*
1582 * These functions are only used in the GPRS protocol stack.
1583 */
1584 EXTERN void mm_mmgmm_auth_rej_ind (void);
1585 EXTERN void mm_mmgmm_cm_establish_ind (void);
1586 EXTERN void mm_mmgmm_cm_emergency_ind (void);
1587 EXTERN void mm_mmgmm_cm_release_ind (UBYTE resumption);
1588 EXTERN void mm_mmgmm_activate_ind (UBYTE status);
1589 EXTERN void mm_mmgmm_t3212_val_ind (void);
1590 EXTERN void mm_mmgmm_lup_accept_ind (void);
1591 EXTERN void mm_mmgmm_lup_needed_ind (UBYTE reason);
1592 EXTERN void mm_mmgmm_tmsi_ind (ULONG tmsi);
1593 #else
1594 /*
1595 * Define the functions only needed in GPRS to nothing.
1596 * This will help the compiler's optimizer to generate
1597 * efficient code for a GSM only protocol stack.
1598 */
1599 #define mm_mmgmm_auth_rej_ind()
1600 #define mm_mmgmm_cm_establish_ind()
1601 #define mm_mmgmm_cm_emergency_ind()
1602 #define mm_mmgmm_cm_release_ind(resumption)
1603 #define mm_mmgmm_activate_ind(status)
1604 #define mm_mmgmm_t3212_val_ind()
1605 #define mm_mmgmm_lup_accept_ind(plmn, lac)
1606 #define mm_mmgmm_lup_needed_ind(reason)
1607 #define mm_mmgmm_tmsi_ind(tmsi)
1608
1609 /*
1610 * There are some additional parameters in some function calls which
1611 * are only used by GPRS. This have no meaning for GSM, but it is undesirable
1612 * to #ifdef out all places where they are used, so they will be defined here.
1613 */
1614 #define MMGMM_RESUMPTION_FAILURE 1
1615 #define MMGMM_PERFORM_DETACH 0
1616 #define REG_GPRS_INACTIVE 0
1617 #define MMGMM_NO_ERROR 0xff
1618 #define MMGMM_CLASS_CC 5
1619 #endif /* else, #ifdef GPRS */
1620
1621 EXTERN T_MM_DATA mm_data_base;
1622 #define GET_INSTANCE_DATA register T_MM_DATA *mm_data= &mm_data_base
1623
1624
1625 /*
1626 * If all entities are linked into one module this definitions
1627 * prefixes the global data with the enity name
1628 */
1629 #ifdef OPTION_MULTITHREAD
1630 #if defined (TI_PS_HCOMM_CHANGE)
1631 #else
1632 #define hCommMMI _ENTITY_PREFIXED(hCommMMI)
1633 #define hCommCC _ENTITY_PREFIXED(hCommCC)
1634 #define hCommSS _ENTITY_PREFIXED(hCommSS)
1635 #define hCommSMS _ENTITY_PREFIXED(hCommSMS)
1636 #define hCommRR _ENTITY_PREFIXED(hCommRR)
1637 #define hCommDL _ENTITY_PREFIXED(hCommDL)
1638 #define hCommSIM _ENTITY_PREFIXED(hCommSIM)
1639 #endif
1640 #endif /* OPTION_MULTITHREAD */
1641
1642 #if defined (NEW_FRAME)
1643 #if defined (TI_PS_HCOMM_CHANGE)
1644 #else
1645 EXTERN T_HANDLE hCommMMI; /* MMI Communication */
1646 EXTERN T_HANDLE hCommCC; /* CC Communication */
1647 EXTERN T_HANDLE hCommSS; /* SS Communication */
1648 EXTERN T_HANDLE hCommSMS; /* SMS Communication */
1649 EXTERN T_HANDLE hCommRR; /* RR Communication */
1650 EXTERN T_HANDLE hCommDL; /* DL Communication */
1651 EXTERN T_HANDLE hCommSIM; /* SIM Communication */
1652 #endif /* (TI_PS_HCOMM_CHANGE) */
1653 EXTERN T_HANDLE mm_handle;
1654 #else
1655 #if defined (TI_PS_HCOMM_CHANGE)
1656 #else
1657 EXTERN T_VSI_CHANDLE hCommMMI; /* MMI Communication */
1658 EXTERN T_VSI_CHANDLE hCommCC; /* CC Communication */
1659 EXTERN T_VSI_CHANDLE hCommSS; /* SS Communication */
1660 EXTERN T_VSI_CHANDLE hCommSMS; /* SMS Communication */
1661 EXTERN T_VSI_CHANDLE hCommRR; /* RR Communication */
1662 EXTERN T_VSI_CHANDLE hCommDL; /* DL Communication */
1663 EXTERN T_VSI_CHANDLE hCommSIM; /* SIM Communication */
1664 #endif /* (TI_PS_HCOMM_CHANGE) */
1665 EXTERN T_VSI_THANDLE mm_act_handle;
1666 #endif /*NEW FRAME*/
1667 /*
1668 * If all entities are linked into one module this definitions
1669 * prefixes the global data with the enity name
1670 */
1671 #ifdef OPTION_MULTITHREAD
1672 #define _decodedMsg _ENTITY_PREFIXED(_decodedMsg)
1673 #endif /*OPTION_MULTITHREAD*/
1674
1675 EXTERN UBYTE _decodedMsg [];
1676
1677 #ifdef OPTION_TIMER
1678 /*
1679 * If all entities are linked into one module this definitions
1680 * prefixes the global data with the entity name
1681 */
1682 #ifdef OPTION_MULTITHREAD
1683 #define partab _ENTITY_PREFIXED(partab)
1684 #endif /*OPTION_MULTITHREAD*/
1685
1686 EXTERN const KW_DATA partab[];
1687 #endif /*OPTION_TIMER*/
1688
1689 #ifndef _TMS470
1690 int sprintf( char *buffer, const char *format, ... );
1691 #define Sprintf sprintf
1692 #endif /*_TMS470*/
1693
1694 #endif