comparison g23m-gsm/mm/mm.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-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
412 #ifdef GPRS
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 /*
684 * This variable will be used to decide if SIM_SYNC_REQ should be sent or not.
685 * After receiving SIM_MM_INSERT_IND, MM should respond with a SIM_SYNC_REQ.
686 * This SIM_SYNC_REQ will be sent after reading either EFPLMNSel or EFPLMNwAct
687 * and EFOPLMNwAct
688 */
689 BOOL sim_sync_req_pending;
690
691 /*SET true is sim file update indication is received*/
692 BOOL sim_file_upd_ind_rec;
693
694 /* HPLMN search period, this is forwarded to RR and not evaluated by MM */
695 UBYTE thplmn;
696
697 /* TMSI, copy of the SIM data */
698 ULONG tmsi;
699
700 /* The update state as it is on the SIM. Possible values are
701 * MS_UPDATED, MS_NOT_UPDATED and MS_LA_NOT_ALLOWED */
702 UBYTE update_stat;
703
704 /* MMXXX_REG_CNF sent to MMI only if this has not already been done
705 * after last registration attempt / last loss of service or
706 * the cell has changed. */
707 BOOL full_service_indicated;
708
709 /* New cell from RR after last MMXXX_REG_CNF */
710 BOOL new_cell_ind;
711
712 /* Access class updated by SAT, update state */
713 UBYTE upd_sim_acc;
714
715 /* Preferred PLMN list updated by SAT, update state */
716 UBYTE upd_sim_plmnsel;
717
718 /* HPLMN search period updated by SAT, update state */
719 UBYTE upd_sim_hplmn;
720
721 /* Forbidden PLMN list updated by SAT, update state */
722 UBYTE upd_sim_fplmn;
723
724 #ifdef REL99
725
726 /* User controlled PLMN Selector with Access Technology update state */
727 UBYTE upd_sim_ucps_at;
728
729 /* User controlled PLMN Selector with Access Technology update state */
730 UBYTE upd_sim_ocps_at;
731
732 #endif
733
734 /* Acting HPLMN value updated by SAT, update state */
735 UBYTE upd_sim_act_hplmn;
736
737 /* If NEQ NULL, MM is performing the MM Restart procedure */
738 T_SIM_MM_INSERT_IND *sim_insert_info;
739
740 /* Contains a list of Equivalent PLMNs provided by the network. The list is
741 * replaced or deleted at the end of each location update procedure, routing
742 * area update procedure and GPRS attach procedure. */
743 //UBYTE eqv_plmn_list[EPLMNLIST_SIZE*UBYTES_PER_PLMN];
744
745 /*
746 * EPLMN List and IMSI store in Non-volatile memory
747 */
748 T_ffs_eplmn_imsi eqv_plmns;
749
750 /* If sim supports AHPLMN and the file has valid value acting_hplmn.v_plmn is TRUE and the
751 * actual value of AHPLMN will be contained in acting_hplmn. If sim doesnt support this
752 * feature or the value for AHPLMN is invalid acting_hplmn.v_plmn is FALSE and acting_hplmn
753 * contains 0xff 0xff 0xff
754 */
755
756 T_plmn acting_hplmn;
757
758 /* If the value read for AHPLMN is FFFFFF then acting_hplmn_invalid will be
759 * true.This will only be used if AHPLMN is modified via OTA
760 */
761 BOOL acting_hplmn_invalid;
762
763 /* If the PLMN is registered to AHPLMN at the time of REFRESH command by SMS,
764 * then this flag should be set to true.
765 */
766 BOOL reg_plmn_equal_ahplmn;
767
768 /* This flag shall be used to indicate Cingular Network */
769 BOOL is_cingular_sim;
770
771 /* This flag enables a quick search when coming back from VPLMN to HPLMN and RR_ABORT_IND gives
772 HPLMN as a part of its List*/
773 BOOL quick_hplmn_search;
774
775 } T_REG;
776
777 /*
778 This struct is used to store timer events and establishment requests
779 */
780 typedef struct
781 {
782 UBYTE comp;
783 UBYTE ti;
784 USHORT estcs;
785 } T_STORE_1;
786
787 typedef union
788 {
789 T_STORE_1 event;
790 T_PRIM_HEADER* primitive;
791 } T_STORE_MM;
792
793 typedef struct
794 {
795 UBYTE use;
796 U8 content_type;
797 U8 info;
798 T_STORE_MM content;
799 } T_STORE;
800
801 typedef struct
802 {
803 UBYTE comp;
804 UBYTE ti;
805 USHORT cause;
806 UBYTE service;
807 } T_PEND;
808
809 typedef struct
810 {
811 UBYTE state;
812 } T_CONN;
813
814 typedef struct
815 {
816 /* The BCCH information as delivered by the cell
817 * The better way would be to define this as T_bcch_info */
818 UBYTE bcch[SIZE_BCCH];
819
820 /* Location Area Identity of last/current selected cell,
821 * information will not be invalidated if coverage lost
822 * until new cell is selected. */
823 T_loc_area_ident lai;
824
825 /* Cell ID of last/current selected cell,
826 * information will not be invalidated if coverage lost
827 * until new cell is selected. */
828 USHORT cid;
829
830 /* Information broadcast by cell on BCCH */
831 T_mm_info mm_info;
832
833 #ifdef GPRS
834 /* Information braodcast on the BCCH whether the cell supports GPRS */
835 UBYTE gprs_indication;
836 #endif /* GPRS */
837 } T_MM;
838
839
840 #if defined (OPTION_TIMER)
841 typedef struct
842 {
843 UBYTE t_mode;
844 ULONG t_val;
845 } T_TIMER_CONFIG;
846 #endif /* #if defined (OPTION_TIMER) */
847
848
849
850 #ifdef GPRS
851
852 /*
853 * MM data solely used if GPRS is also delivered
854 */
855 typedef struct
856 {
857 /* TRUE if MM has to send MMGMM_REG_CNF after IDLE mode entry */
858 BOOL reg_cnf_on_idle_entry;
859
860 /* TRUE if SIM currently physically removed and SIM data not yet deleted.
861 * This variable is only used if GSM is not alone, otherwise MM can perform
862 * the necessary actions (e.g. IMSI detach) alone. */
863 BOOL sim_physically_removed;
864
865 /* TRUE if the MS is in a location area where combined attach is
866 * required (network mode I) and therefore MM shall not start T3212. */
867 BOOL combined_procedures;
868
869 /* The currently selected mobile class. Needed for reject cause #14. */
870 UBYTE mobile_class;
871
872 /* The current GPRS resumption state. Defaults to MMGMM_RESUMPTION_FAILURE
873 * excepts if processing RR_RELEASE_IND, in this case it is set according
874 * to the resumption state delivered by RR_RELEASE_IND. */
875 UBYTE resumption;
876
877 } T_GPRS_DATA;
878 #endif /* GPRS */
879
880
881 typedef struct
882 {
883 /* The variable ciphering_on is a write-only variable, not to be eliminated.
884 * It contains the state of ciphering on the air interface (on or off). */
885 BOOL ciphering_on;
886
887 /* The connection table. NUM_OF_CM_ENT equals to the number of CM entities,
888 * while NUM_OF_CONN_PER_CM_ENT equals to the number of parallel
889 * transactions each entitity can have */
890 UBYTE conn_state[NUM_OF_CM_ENT][NUM_OF_CONN_PER_CM_ENT];
891
892 /* May be zero, OPTIONAL_INFO_ERROR or RC_INVALID_MAND_MESSAGE.
893 * Related to the decoding of messages */
894 UBYTE error;
895
896 /* This variable is TRUE until either the first location updating
897 * procedure has ended either with an invalidation of the registration
898 * state or the first successful location updating. This variable should
899 * go into the registration data, but this is really only cosmetic.
900 * first_attach_mem holds the state of first attach before it is set to FALSE.
901 * It is used to determine if the HPLMN timer has to be started with 3 min for
902 * first search of HPLMN or if the normal hplmn timer value from registration
903 * data is to be used. After this check it is reset unconditional.
904 */
905 BOOL first_attach;
906 BOOL first_attach_mem;
907
908 /* RR release cause which leaded to idle entry after failed LUP. In case
909 * this is RELCS_ACCESS_BARRED or RELCS_RND_ACC_DELAY, MM is someway in
910 * state MM_IDLE_LUP_NEEDED, but this state is not used for this purpose
911 * in MM. A location updating attempt will be performed if RR informs MM
912 * by using RR_SYNC_IND with an appropriate cause. */
913 USHORT idle_entry;
914
915 /* Contains the type of the location update in progress and the state of
916 * the follow on request flag of this location update. */
917 T_loc_upd_type loc_upd_type;
918
919 /* Contains relevant data delivered by RR about the selected cell.
920 * A better name for this type instead T_MM may be T_CELL_DATA,
921 * for the variable itself cell_data */
922 T_MM mm;
923
924 /* The state of the MM state machines, the MM main state machine and
925 * the registration state machine. */
926 UBYTE state[NUM_OF_MM_STATES];
927
928 // TO_BE_DONE - write a good comment
929 UBYTE nreg_cause;
930
931 /* The variable nreg_request is TRUE if the deregistration was requested by
932 * MMR_NREG_REQ, otherwise FAISE. This is needed to decide whether MM
933 * will send an MMR_NREG_IND or MMR_NREG_CNF primitive at the end of the
934 * deregistration process. */
935 BOOL nreg_request;
936
937 /* All necessary information which is required for a pending connection
938 * is stored here. Note: There can be not more than one pending connection
939 * at a given time. */
940 T_PEND pend_conn;
941
942 /* The base for the internal random number generator, used to set the value
943 * for T3212 under certain cicumstances. */
944 ULONG rand_base;
945
946 /* All the data related to registration and SIM. */
947 T_REG reg;
948
949 /* In this location timer expiries and CM connection requests can be stored
950 * for later usage after a state change of one of the MM state machines */
951 T_STORE store[MAX_STORE_ENTRIES];
952
953 /* Use stored entries after end of transition */
954 BOOL use_stored_entries;
955
956 #if defined (NEW_FRAME)
957 /* TRUE if the appropriate timer is active */
958 BOOL t_running[NUM_OF_MM_TIMERS];
959 #else
960 /* The handles for all the MM timers. */
961 T_VSI_THANDLE t_handle[NUM_OF_MM_TIMERS];
962 #endif
963
964 /* This variable is a perfectly good substitute for missing MM state
965 * WAIT_FOR_ADDITIONAL_OUTGOING MM connection (#20). If in state
966 * MM_CONNECTION_ACTIVE (#6) and this flag is set,
967 * MM is really in state #20. */
968 // Identical with (TIMERACTIVE (T3230))
969 // Identical with (mm_count_connections (CM_PENDING) NEQ 0)
970 // => flag could be eliminated!
971 BOOL wait_for_accept;
972
973 /* Copy of the power field of the last RR_ACTIVATE_CNF/RR_ACTIVATE_IND */
974 UBYTE rf_power;
975
976 /* The counter for RR_ESTABLISH_REQ retransmissions for one CM connection
977 * attempt if a random access failure occured. */
978 UBYTE act_retrans;
979
980 /* The LOCATION UPDATE attempt counter */
981 UBYTE attempt_cnt;
982
983 /* The variables reject_cause and last_reject_cause store the
984 * current and the previous reject cause during location updating. */
985 USHORT rej_cause;
986 USHORT last_rej_cause;
987
988 /* Remember at RR establishment for emergency call and at start of the
989 * location update procedure the type of service state MM had. */
990 UBYTE idle_substate;
991
992 /* Variable solely used for debugging purposes */
993 USHORT debug_last_rej_cause;
994
995 /* Variable solely used for debugging purposes */
996 UBYTE mm_idle_no_imsi_marker;
997
998 /* Faked T3212 value for test only, will be used if not equal zero */
999 USHORT t3212_cfg_counter;
1000
1001 /* This variable stores whether a timeout of T3212 has occurred and
1002 * a periodic location updating procedure has to be performed ASAP. */
1003 BOOL t3212_timeout;
1004
1005 /* counts, how many times T3213 was started. Referres to the Note in 24.008 ch. 4.4.4.9
1006 * "the mobile station may as an option delay the repeated attempt for up to 8 seconds
1007 * to allow cell re-selection to take place" ---> 2 times T3213 as delay implemented.
1008 * 0 -> first run ...
1009 */
1010 U8 t3213_restart;
1011
1012 UBYTE reest_ti;
1013
1014 BOOL reest_cell_avail;
1015
1016 /* LOCATION UPDATING REJECT cause from the network or internal
1017 * cause for limited service (e.g. AUTHENTICATION REJECT received).
1018 * This is for MMR_NREG_IND to inform the MMI and is not intended to
1019 * be used by MM to control its own operation. */
1020 USHORT limited_cause;
1021
1022 /* A search for available networks was requested by the MMI */
1023 BOOL plmn_scan_mmi;
1024
1025 /* A search for available networks was requested by MM for own operation */
1026 BOOL plmn_scan_mm;
1027
1028 /* This boolean variable is used only together with available test SIM.
1029 * Is it set to a value of TRUE, the MS uses stored BCCH lists also
1030 * with test SIM. */
1031 BOOL config_use_stored_bcch;
1032
1033
1034 /* This variable is used to prevent an RR_ABORT_IND caused by a RR TABORT timer
1035 * timeout from interfering with FTA test 26.7.4.3.4
1036 */
1037 BOOL rr_abort_prior_to_tabort;
1038
1039
1040 /* Used to store the datafield used in the last sent SIM_READ_REQ. Default value will
1041 be NOT_PRESENT_16BIT, if no read request has been sent to SIM*/
1042 USHORT sim_read_req_data_field;
1043
1044 /* Sometimes the network sends multiple (two) authentication req messages
1045 * without waiting for an answer. SIM interface got modified to support
1046 * identifiers for requests sent to SIM. The following variable contains the req_id
1047 * in the last sent SIM_AUTHENTICATION_REQ.
1048 * On receiving SIM_AUTHENTICATION_CNF, response is sent to network only
1049 * if req_id matches the value in this variable. SIM_AUTHENTICATION_CNF with other
1050 * req_ids are ignored*/
1051 UBYTE last_auth_req_id;
1052
1053
1054 #if defined (FF_EOTD) AND defined (REL99)
1055 /* This flag is used to indicate if rrlp/lcs procedure is running. This flag is set
1056 * to true upon reception of RR_RRLP_START_IND. Flag will be set to false upon
1057 * reception of RR_RRLP_STOP_IND.
1058 */
1059 BOOL rrlp_lcs_started;
1060 #endif /* (FF_EOTD) AND defined (REL99) */
1061 /* This variable is used to keep count of repetitions for the network search if
1062 MM receives RR_ABORT_IND with cause RRCS_ABORT_PTM. Depending on its value
1063 MM behaviour will be decided.
1064 */
1065 UBYTE net_search_count;
1066
1067
1068 /* All the data needed for GPRS support */
1069 #ifdef GPRS
1070 T_GPRS_DATA gprs;
1071 #endif
1072 /* This is a bitwise mapping to indicate SIM which EFs are to be updated in SIM_MM_UPDATE_REQ */
1073 U8 ef_indicator;
1074 } T_MM_DATA;
1075
1076 /*==== EXPORT =====================================================*/
1077
1078 #define GET_BITS(value, shift, width) ((value >> shift) & ((1 << width) - 1))
1079
1080 /*
1081 * Prototypes Timer Modul
1082 */
1083 /*
1084 * If all entities are linked into one module this definitions
1085 * prefixes all this functions with the enity name
1086 */
1087 #ifdef OPTION_MULTITHREAD
1088 #define tim_t_reg _ENTITY_PREFIXED(tim_t_reg)
1089 #define tim_t3210 _ENTITY_PREFIXED(tim_t3210)
1090 #define tim_t3211 _ENTITY_PREFIXED(tim_t3211)
1091 #define tim_t3212 _ENTITY_PREFIXED(tim_t3212)
1092 #define tim_t3213 _ENTITY_PREFIXED(tim_t3213)
1093 #define tim_t3220 _ENTITY_PREFIXED(tim_t3220)
1094 #define tim_t3230 _ENTITY_PREFIXED(tim_t3230)
1095 #define tim_t3240 _ENTITY_PREFIXED(tim_t3240)
1096 #ifdef REL99
1097 #define tim_t3241 _ENTITY_PREFIXED(tim_t3241)
1098 #endif
1099 #define tim_t_hplmn _ENTITY_PREFIXED(tim_t_hplmn)
1100 #endif /* #ifdef OPTION_MULTITHREAD */
1101
1102 #if defined (NEW_FRAME)
1103 #ifdef OPTION_MULTITHREAD
1104 #define tim_exec_timeout _ENTITY_PREFIXED(tim_exec_timeout)
1105 #define tim_start_timer _ENTITY_PREFIXED(tim_start_timer)
1106 #define tim_stop_timer _ENTITY_PREFIXED(tim_stop_timer)
1107 #endif
1108 EXTERN void tim_exec_timeout (USHORT index);
1109 EXTERN void tim_start_timer (USHORT index, T_TIME value);
1110 EXTERN void tim_stop_timer (USHORT index);
1111 #else
1112
1113 #ifdef OPTION_MULTITHREAD
1114 #define tim_set_timeout_flag _ENTITY_PREFIXED(tim_set_timeout_flag)
1115 #define tim_handle_timeout _ENTITY_PREFIXED(tim_handle_timeout)
1116 #define tim_get_config_timer _ENTITY_PREFIXED(tim_get_config_timer)
1117 #define tim_start_timer _ENTITY_PREFIXED(tim_start_timer)
1118 #define tim_flush_fifo _ENTITY_PREFIXED(tim_flush_fifo)
1119 #endif
1120
1121 EXTERN void tim_set_timeout_flag (T_VSI_THANDLE handle,
1122 USHORT *t_flag);
1123 EXTERN void tim_handle_timeout (USHORT *t_flag);
1124 EXTERN void tim_get_config_timer (char *outString,
1125 UBYTE t_num,
1126 KW_DATA *t_name);
1127 EXTERN void tim_start_timer (UBYTE id,
1128 T_VSI_THANDLE handle,
1129 T_VSI_TVALUE value);
1130 EXTERN void tim_flush_fifo (T_VSI_THANDLE handle);
1131
1132 #endif /* else, #if defined (NEW_FRAME) */
1133
1134 #ifdef OPTION_MULTITHREAD
1135 #define tim_init_timer _ENTITY_PREFIXED(tim_init_timer)
1136 #define tim_config_timer _ENTITY_PREFIXED(tim_config_timer)
1137 #endif
1138
1139 EXTERN BOOL tim_init_timer (void);
1140
1141 EXTERN void tim_config_timer (UBYTE t_num,
1142 UBYTE t_mod,
1143 ULONG t_val);
1144
1145 /*
1146 * Prototypes MM
1147 */
1148
1149 /*
1150 * MM Mobility Management
1151 */
1152
1153 /*
1154 * mobility management primitives
1155 */
1156 EXTERN void mm_init_mm_data (void);
1157 EXTERN void mm_mdl_error_ind (T_MDL_ERROR_IND *mdl_error_ind);
1158 EXTERN void mm_mmcm_data_req (T_MMCM_DATA_REQ *mmcm_data_req);
1159 EXTERN void mm_mmcm_establish_req (T_MMCM_ESTABLISH_REQ *mmcm_establish_req);
1160 EXTERN void mm_mmcm_reestablish_req (T_MMCM_REESTABLISH_REQ *mmcm_reestablish_req);
1161 EXTERN void mm_mmcm_release_req (T_MMCM_RELEASE_REQ *mmcm_release_req);
1162 EXTERN void mm_mmcm_prompt_rej (T_MMCM_PROMPT_REJ *prompt_rej);
1163 EXTERN void mm_mmcm_prompt_res (T_MMCM_PROMPT_RES *prompt_rsp);
1164 EXTERN void mm_mmss_data_req (T_MMSS_DATA_REQ *mmss_data_req);
1165 EXTERN void mm_mmss_establish_req (T_MMSS_ESTABLISH_REQ *mmss_establish_req);
1166 EXTERN void mm_mmss_release_req (T_MMSS_RELEASE_REQ *mmss_release_req);
1167 EXTERN void mm_mmsms_data_req (T_MMSMS_DATA_REQ *mmsms_data_req);
1168 EXTERN void mm_mmsms_establish_req (T_MMSMS_ESTABLISH_REQ *mmsms_establish_req);
1169 EXTERN void mm_mmsms_release_req (T_MMSMS_RELEASE_REQ *mmsms_release_req);
1170 EXTERN void mm_mmxx_establish_req (UBYTE comp, UBYTE ti, USHORT estcs, U8 info);
1171 EXTERN void mm_rr_abort_ind (T_RR_ABORT_IND *rr_abort_ind);
1172 EXTERN void mm_rr_activate_cnf (T_RR_ACTIVATE_CNF *rr_activate_cnf);
1173 EXTERN void mm_rr_activate_ind (T_RR_ACTIVATE_IND *rr_activate_ind);
1174 EXTERN void mm_rr_establish_cnf (T_RR_ESTABLISH_CNF *rr_establish_cnf);
1175 EXTERN void mm_rr_establish_ind (T_RR_ESTABLISH_IND *rr_establish_ind);
1176 EXTERN void mm_rr_release_ind (T_RR_RELEASE_IND *rr_release_ind);
1177 EXTERN void mm_rr_sync_ind (T_RR_SYNC_IND *rr_sync_ind);
1178 #if defined (FF_EOTD) AND defined (REL99)
1179 EXTERN void mm_rr_rrlp_start_ind (T_RR_RRLP_START_IND *rr_rrlp_start_ind);
1180 EXTERN void mm_rr_rrlp_stop_ind (T_RR_RRLP_STOP_IND *rr_rrlp_stop_ind);
1181 #endif /* (FF_EOTD) AND defined (REL99) */
1182 EXTERN void mm_sim_set_imsi_marker (T_MSG_TYPE imsi_marker);
1183
1184
1185 /*
1186 * mobility management signalling
1187 */
1188 EXTERN void mm_abort (T_D_ABORT *d_abort);
1189 EXTERN void mm_auth_rej (void);
1190 EXTERN void mm_auth_req (T_D_AUTH_REQ *auth_req);
1191 EXTERN void mm_cm_message (UBYTE pd,
1192 UBYTE ti,
1193 T_RR_DATA_IND *rr_data_ind);
1194 EXTERN void mm_cm_serv_accept (void);
1195 EXTERN void mm_cm_serv_rej (T_D_CM_SERV_REJ *cm_serv_rej);
1196 EXTERN void mm_ident_req (T_D_IDENT_REQ *ident_req);
1197 EXTERN void mm_loc_upd_acc (T_D_LOC_UPD_ACCEPT *loc_upd_accept);
1198 EXTERN void mm_lup_rej (T_D_LOC_UPD_REJ *loc_upd_rej);
1199 EXTERN void mm_mm_status (void);
1200 EXTERN void mm_mmr_auth_cnf (T_SIM_AUTHENTICATION_CNF *sim_auth_cnf);
1201 EXTERN void mm_mmr_nreg_req (UBYTE nreg_cause,
1202 UBYTE detach_done);
1203 EXTERN void mm_mmr_reg_req (UBYTE func);
1204 EXTERN void mm_tmsi_realloc_cmd (T_D_TMSI_REALLOC_CMD *tmsi_realloc_cmd);
1205 EXTERN void mm_cm_service_prompt (T_D_CM_SERVICE_PROMPT *cm_service_prompt);
1206 EXTERN void mm_mm_information (T_D_MM_INFORMATION *mm_information);
1207
1208 /*
1209 * mobility management procedures
1210 */
1211 EXTERN void mm_auto_net_reg (void);
1212 EXTERN void mm_abort_connection (UBYTE abcs);
1213 EXTERN void mm_attach_loc_upd (void);
1214 EXTERN void mm_build_auth_res (T_SIM_AUTHENTICATION_CNF *sim_auth_cnf,
1215 T_U_AUTH_RES *auth_res);
1216 EXTERN void mm_build_ident_res (UBYTE id_type,
1217 T_U_IDENT_RES *ident_res);
1218 EXTERN void mm_build_mm_status (UBYTE cause,
1219 T_B_MM_STATUS *mm_status);
1220 EXTERN void mm_build_rr_sync_req_mode (void);
1221 EXTERN void mm_build_rr_sync_req_cause (USHORT cause);
1222 EXTERN void mm_build_rr_sync_req_ciph (void);
1223 EXTERN void mm_build_rr_sync_req (T_MSG_TYPE ciph);
1224 EXTERN void mm_build_rr_sync_req_tmsi (void);
1225 EXTERN void mm_build_rr_sync_hplmn_req (void);
1226 EXTERN void mm_check_error_flag (void);
1227 EXTERN BOOL mm_check_critical_error (void);
1228 EXTERN BOOL mm_send_status_on_error (void);
1229 EXTERN void mm_clear_mob_ident (T_imsi_struct *mob_ident);
1230 EXTERN void mm_clear_reg_data (void);
1231 EXTERN void mm_copy_rr_act_cnf_data (T_RR_ACTIVATE_CNF *rr_activate_cnf);
1232 EXTERN SHORT mm_count_connections (UBYTE conn_type);
1233 EXTERN void mm_create_est_message (USHORT est_cause,
1234 UBYTE service,
1235 UBYTE ti,
1236 USHORT *bit_size_message);
1237 EXTERN void mm_create_imsi_detach_message (void);
1238 EXTERN void mm_delete_entry (UBYTE comp,
1239 UBYTE ti);
1240 EXTERN void mm_init (void);
1241 EXTERN UBYTE mm_calculate_digits (const UBYTE *digits);
1242 EXTERN void mm_loc_upd_rej (void);
1243 EXTERN void mm_lup_restart (void);
1244 EXTERN void mm_mdl_rel_req (void);
1245 EXTERN void mm_mdl_rel_req_sapi_3 (void);
1246 EXTERN void mm_mmsms_rel_ind (USHORT cause,
1247 UBYTE conn_typ);
1248 EXTERN SHORT mm_mmxx_err_ind (USHORT cause);
1249 EXTERN void mm_mmxx_est_cnf (void);
1250 EXTERN void mm_mmxx_release_ind (UBYTE comp,
1251 UBYTE ti,
1252 USHORT relcs);
1253 EXTERN void mm_mmxx_rel_ind (USHORT cause,
1254 UBYTE conn_typ);
1255 EXTERN void mm_normal_loc_upd (void);
1256 EXTERN void mm_periodic_loc_upd (void);
1257 EXTERN void mm_power_off (void);
1258 EXTERN USHORT mm_random (USHORT n);
1259 EXTERN void mm_read_entry (void);
1260 EXTERN void mm_reest (UBYTE ti);
1261 EXTERN void mm_release_rr_connection (UBYTE resumption);
1262 EXTERN void mm_rr_act_req (void);
1263 EXTERN void mm_rr_data_req (USHORT est_cause,
1264 UBYTE service,
1265 UBYTE ti);
1266 EXTERN void mm_rr_est_req (USHORT est_cause,
1267 UBYTE service,
1268 UBYTE ti);
1269 EXTERN void mm_start_loc_upd (UBYTE lup_type);
1270 EXTERN void mm_continue_running_update (void);
1271 EXTERN void mm_start_net_req (void);
1272 EXTERN void mm_start_t3212_bcch (void);
1273 EXTERN void mm_change_t3212 (void);
1274 EXTERN void mm_use_entry (void);
1275 EXTERN void mm_write_entry (UBYTE comp,
1276 UBYTE ti,
1277 USHORT est_cs,
1278 U8 content_type,
1279 void* primitive,
1280 U8 info);
1281 EXTERN BOOL mm_check_lai (const T_loc_area_ident * lai1,
1282 const T_loc_area_ident * lai2);
1283 EXTERN BOOL mm_check_lai_from_RR (const T_loc_area_ident * lai1,
1284 const T_plmn * plmn2,
1285 USHORT lac2);
1286 EXTERN BOOL mm_normal_upd_needed (void);
1287 EXTERN BOOL mm_attach_upd_needed (void);
1288 EXTERN BOOL mm_periodic_upd_needed (void);
1289 EXTERN BOOL mm_set_follow_on_request (void);
1290 EXTERN void mm_end_of_detach (void);
1291 EXTERN UBYTE mm_get_service_state (void);
1292 EXTERN BOOL mm_full_service_pplmn_scan (void);
1293
1294 /* Implements Measure 29 and streamline encoding */
1295 EXTERN void mm_send_status (UBYTE cause);
1296
1297 /*
1298 * Registration
1299 */
1300
1301 /*
1302 * registration primitives and functions
1303 */
1304
1305 #ifndef GPRS
1306 EXTERN void reg_mmr_net_req (T_MMR_NET_REQ *mmr_net_req);
1307 EXTERN void reg_mmr_nreg_req (T_MMR_NREG_REQ *mmr_nreg_req);
1308 EXTERN void reg_mmr_plmn_mode_req (T_MMR_PLMN_MODE_REQ *plmn_mode_req);
1309 EXTERN void reg_mmr_plmn_res (T_MMR_PLMN_RES *mmr_plmn_res);
1310 EXTERN void reg_mmr_reg_req (T_MMR_REG_REQ *mmr_reg_req);
1311 #endif /* GPRS */
1312
1313 EXTERN void mm_func_mmgmm_net_req (void);
1314 EXTERN void mm_func_mmgmm_nreg_req (UBYTE detach_cause,
1315 UBYTE detach_done,
1316 USHORT cs);
1317 EXTERN void mm_func_mmgmm_plmn_mode_req (UBYTE mode);
1318 EXTERN void mm_func_mmgmm_plmn_res (const T_plmn *plmn,
1319 UBYTE reg_type,
1320 UBYTE mobile_class);
1321 EXTERN void mm_func_mmgmm_reg_req (UBYTE service_mode,
1322 UBYTE reg_type,
1323 UBYTE mobile_class,
1324 UBYTE bootup_act);
1325
1326 EXTERN void reg_sim_auth_cnf (T_SIM_AUTHENTICATION_CNF *sim_auth_cnf);
1327 EXTERN void reg_sim_mm_insert_ind (T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1328 EXTERN void reg_sim_remove_ind (T_SIM_REMOVE_IND *sim_remove_ind);
1329 EXTERN void reg_sim_mm_info_ind (T_SIM_MM_INFO_IND *sim_mm_info_ind);
1330 EXTERN void reg_sim_file_upd_ind (T_SIM_FILE_UPDATE_IND *file_upd);
1331 EXTERN void reg_sim_read_cnf (T_SIM_READ_CNF *sim_read_cnf);
1332 EXTERN void reg_sim_sync_cnf (T_SIM_SYNC_CNF *sim_sync_cnf);
1333 EXTERN void reg_send_sim_sync_req (void);
1334 /*
1335 * registration signalling
1336 */
1337 EXTERN void reg_mmr_auth_ind (T_SIM_AUTHENTICATION_REQ *sim_auth_req);
1338 EXTERN void reg_mm_success (UBYTE service);
1339 EXTERN void reg_mm_failure (UBYTE forb_ind);
1340 EXTERN void reg_net_list (const T_RR_ABORT_IND *rr_abort_ind);
1341 EXTERN void reg_mm_cell_selected (void);
1342
1343 /*
1344 * registration procedures
1345 */
1346 EXTERN BOOL reg_best_plmn_in_country (const T_plmn *bcch_plmn);
1347 EXTERN void reg_check_hplmn_tim (UBYTE decihours);
1348
1349 EXTERN void reg_build_sim_update (void);
1350 EXTERN void reg_copy_sim_data (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1351 EXTERN void reg_create_plmn_list (const T_RR_ABORT_IND *rr_abort_ind,
1352 UBYTE include_flag);
1353 EXTERN void reg_extract_hplmn (T_plmn *plmn);
1354 EXTERN void reg_init (void);
1355 EXTERN void reg_plmn_add_bad (UBYTE *forb_plmn_list,
1356 USHORT list_size,
1357 const T_plmn *plmn);
1358 EXTERN void reg_plmn_bad_del (UBYTE *forb_plmn_list,
1359 USHORT list_size,
1360 const T_plmn *plmn);
1361 EXTERN BOOL reg_plmn_empty (const T_plmn *plmn);
1362
1363 EXTERN BOOL reg_sim_ef_plmn_field_empty (UBYTE *plmn);
1364
1365 EXTERN BOOL reg_plmn_equal_sim (const T_plmn *bcch_plmn,
1366 const T_plmn *sim_plmn);
1367
1368 #ifdef REL99
1369 EXTERN BOOL reg_read_plmn_present (UBYTE* plmn_bytes);
1370 EXTERN BOOL reg_read_plmn_support_acctec(UBYTE* plmn_bytes);
1371 #endif
1372
1373 EXTERN BOOL reg_plmn_equal_eqv (const T_plmn *bcch_plmn,
1374 const T_plmn *req_plmn);
1375 EXTERN BOOL reg_plmn_is_NA_plmn (const T_plmn *bcch_plmn);
1376 EXTERN BOOL reg_plmn_equal_hplmn (const T_plmn *bcch_plmn);
1377 EXTERN BOOL reg_plmn_equal_rplmn (T_plmn *plmn);
1378 EXTERN BOOL reg_imsi_equal (const T_imsi_struct *imsi1,
1379 const T_imsi_struct *imsi2);
1380 EXTERN void reg_plmn_select (UBYTE forb_ind);
1381 EXTERN void reg_read_bcch_info (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1382
1383 EXTERN BOOL reg_sim_files_to_be_read (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1384
1385 EXTERN void reg_read_forb_plmn (const T_forb_plmn *forb_plmn);
1386 EXTERN void reg_read_imsi (T_imsi_struct *imsi_struct,
1387 const T_imsi_field *imsi_field);
1388 EXTERN void reg_read_kc_cksn (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1389 EXTERN void reg_read_loc_info (const T_loc_info *loc_info);
1390
1391 EXTERN void reg_read_pref_plmn (UBYTE* data,
1392 USHORT length);
1393 #ifdef REL99
1394 EXTERN void reg_read_ucps_acctec (UBYTE* data,
1395 USHORT length);
1396 EXTERN void reg_read_ocps_acctec (UBYTE* data,
1397 USHORT length);
1398 #endif
1399
1400 EXTERN void reg_copy_sim_ahplmn (const T_SIM_MM_INSERT_IND *sim_mm_insert_ind);
1401 EXTERN void reg_set_bcch_info (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1402 EXTERN void reg_set_forb_plmns (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1403 EXTERN void reg_set_kc (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1404 EXTERN void reg_set_loc_info (T_SIM_MM_UPDATE_REQ *sim_mm_update_req);
1405 EXTERN void reg_set_pref_plmns (T_SIM_MM_UPDATE_REQ *sim_mm_update_req); // #####
1406 EXTERN void reg_clear_plmn (T_plmn *plmn);
1407 EXTERN BOOL reg_clear_plmn_list (UBYTE *plmn_list,
1408 USHORT list_size);
1409 EXTERN void reg_unpack_plmn (T_plmn *plmn,
1410 const UBYTE *packed,
1411 USHORT index);
1412 EXTERN void reg_pack_plmn (UBYTE *packed,
1413 USHORT index,
1414 const T_plmn *plmn);
1415 EXTERN BOOL reg_plmn_in_list (const UBYTE *forb_plmn_list,
1416 USHORT list_size,
1417 const T_plmn *plmn);
1418 EXTERN void reg_rr_failure (T_RR_ABORT_IND *rr_abort_ind);
1419 EXTERN BOOL reg_read_next_sim_file (void);
1420 EXTERN void reg_end_of_deregistration (UBYTE nreg_cause,
1421 UBYTE service);
1422 #ifdef REL99
1423 EXTERN void reg_invalidate_upd_state (UBYTE new_update_state, BOOL tmsi_cksn_kc_not_deleted);
1424 #else
1425 EXTERN void reg_invalidate_upd_state (UBYTE new_update_state);
1426 #endif
1427 GLOBAL void reg_select_network (const T_plmn *plmn);
1428 EXTERN BOOL reg_plmn_in_pref_list (const T_plmn *plmn);
1429 EXTERN BOOL reg_same_country_plmn (const T_plmn *plmn1,
1430 const T_plmn *plmn2);
1431 EXTERN void reg_check_plmn_search (USHORT cause,
1432 const T_RR_ABORT_IND *rr_abort_ind);
1433 EXTERN void reg_check_hplmn_tim (UBYTE decihours);
1434 EXTERN void reg_stop_hplmn_tim (void);
1435 /*
1436 * Equivalent plmn procedures
1437 */
1438 EXTERN BOOL reg_store_eqv_plmns (T_eqv_plmn_list *eqv_plmn_list, T_plmn *plmn);
1439 EXTERN void reg_read_acting_hplmn (const U8 acting_hplmn[]);
1440
1441 EXTERN BOOL valid_acting_hplmn (T_plmn *acting_hplmn);
1442 GLOBAL void mm_read_ffs_init (void);
1443 GLOBAL void mm_write_eplmn_to_ffs (void);
1444 GLOBAL void mm_display_eplmn (void);
1445
1446 GLOBAL void mm_reset_ffs (void);
1447 GLOBAL BOOL mm_read_ffs (void);
1448 GLOBAL void check_if_cingular_sim (void);
1449
1450 /*
1451 * Formatter
1452 */
1453
1454 /*
1455 * formatter primitives
1456 */
1457 #if 0 /* Not referenced */
1458 EXTERN void for_init_mm_data (void);
1459 #endif /* #if 0 */
1460 EXTERN void for_rr_data_ind (T_RR_DATA_IND *rr_data_ind);
1461
1462 /*
1463 * formatter signalling
1464 */
1465 /*
1466 * If all entities are linked into one module this definitions
1467 * prefixes the global data with the enity name
1468 */
1469 #ifdef OPTION_MULTITHREAD
1470 #define for_est_req _ENTITY_PREFIXED(for_est_req)
1471 #endif /*OPTION_MULTITHREAD*/
1472 EXTERN void for_cm_message (T_RR_DATA_REQ *rr_data_req);
1473 EXTERN void for_data_req (USHORT bit_size_message);
1474 EXTERN void for_est_req (USHORT est_cause,
1475 USHORT bit_size_message);
1476
1477 /*
1478 * formatter procedures
1479 */
1480 /*
1481 * If all entities are linked into one module this definitions
1482 * prefixes the global data with the enity name
1483 */
1484 #ifdef OPTION_MULTITHREAD
1485 #define for_check_mobile_identity _ENTITY_PREFIXED(for_check_mobile_identity)
1486 #endif /*OPTION_MULTITHREAD*/
1487 EXTERN BOOL for_check_identity_type (UBYTE id);
1488 EXTERN BOOL for_check_mobile_identity (T_mob_id *mob_ident);
1489 EXTERN UBYTE for_check_reject_cause (UBYTE cause);
1490 EXTERN void mm_for_set_error (U8 cause);
1491 #if 0 /* Not referenced; body bag; 02.10.2003 */
1492 EXTERN void for_set_mandatory_error (void);
1493 EXTERN void for_set_content_error (void);
1494 EXTERN void for_set_optional_error (UBYTE iei);
1495 #endif /* #if 0 */
1496
1497 /*
1498 * csf procedures
1499 */
1500 EXTERN void csf_read_mobile_class_1 (T_mob_class_1 *mob_class_1);
1501 EXTERN void csf_read_mobile_class_2 (T_mob_class_2 *mob_class_2);
1502 EXTERN void csf_read_imei (T_imsi_struct *imei_struct);
1503
1504 /*
1505 * timer procedures
1506 */
1507 EXTERN void tim_t3210 (void);
1508 EXTERN void tim_t3211 (void);
1509 EXTERN void tim_t3212 (void);
1510 EXTERN void tim_t3213 (void);
1511 EXTERN void tim_t3220 (void);
1512 EXTERN void tim_t3230 (void);
1513 EXTERN void tim_t3240 (void);
1514 #ifdef REL99
1515 EXTERN void tim_t3241 (void);
1516 #endif
1517 EXTERN void tim_t_reg (void);
1518 EXTERN void tim_t_hplmn (void);
1519
1520 /*
1521 * timer
1522 */
1523 #if defined (NEW_FRAME)
1524 #define TIMERSTART(i,v) tim_start_timer (i, v)
1525 #define TIMERSTOP(i) tim_stop_timer (i)
1526 #define TIMERACTIVE(i) (mm_data->t_running[i])
1527 #else
1528 #define TIMERSTART(t, v) csf_alloc_timer (t, v, &mm_data->t_handle[t])
1529 #define TIMERSTOP(t) \
1530 { csf_free_timer (mm_data->t_handle[t]); mm_data->t_handle[t] = VSI_ERROR; }
1531 #define TIMERACTIVE(t) (mm_data->t_handle[t] NEQ VSI_ERROR)
1532
1533 #define T_TIME T_VSI_TVALUE
1534
1535 #endif /*(NEW_FRAME)*/
1536
1537
1538
1539 #ifdef GPRS
1540 /*
1541 * Prototypes for the primitive interface MMGMM (MM to GMM)
1542 */
1543 EXTERN void mm_send_mmgmm_reg_cnf (UBYTE bootup_cause);
1544 EXTERN void mm_mmgmm_reg_cnf (void);
1545 EXTERN void mm_mmgmm_nreg_ind (UBYTE service,
1546 UBYTE search_running,
1547 UBYTE forb_ind);
1548 EXTERN void mm_mmgmm_nreg_cnf (UBYTE detach_cause);
1549 EXTERN void mm_mmgmm_plmn_ind (USHORT cause,
1550 const T_RR_ABORT_IND *rr_abort_ind);
1551 EXTERN void mm_mmgmm_ahplmn_ind (T_plmn *acting_hplmn);
1552 #else
1553 /*
1554 * Prototypes for the primitive interface MMR (MM to ACI)
1555 */
1556 EXTERN void reg_send_mmr_reg_cnf (UBYTE bootup_cause);
1557 EXTERN void reg_build_mmr_reg_cnf (void);
1558 EXTERN void reg_build_mmr_nreg_ind (UBYTE service,
1559 UBYTE search_running,
1560 UBYTE forb_ind);
1561 EXTERN void reg_build_mmr_nreg_cnf (UBYTE detach_cause);
1562 EXTERN void reg_build_mmr_plmn_ind (USHORT cause,
1563 const T_RR_ABORT_IND *rr_abort_ind);
1564 EXTERN void reg_build_mmr_ahplmn_ind (T_plmn *acting_hplmn);
1565
1566 /*
1567 * By using this definitions, we avoid having a lot of ifdefs
1568 * in the code itself.
1569 */
1570 #define mm_send_mmgmm_reg_cnf(b) reg_send_mmr_reg_cnf(b)
1571 #define mm_mmgmm_reg_cnf() reg_build_mmr_reg_cnf()
1572 #define mm_mmgmm_nreg_ind(a,b,c) reg_build_mmr_nreg_ind(a,b,c)
1573 #define mm_mmgmm_nreg_cnf(detach_cause) reg_build_mmr_nreg_cnf(detach_cause)
1574 #define mm_mmgmm_plmn_ind(cause,ab) reg_build_mmr_plmn_ind(cause,ab)
1575 #define mm_mmgmm_ahplmn_ind(ahplmn) reg_build_mmr_ahplmn_ind(ahplmn)
1576 #endif /* GPRS */
1577
1578 #ifdef GPRS
1579 /*
1580 * These functions are only used in the GPRS protocol stack.
1581 */
1582 EXTERN void mm_mmgmm_auth_rej_ind (void);
1583 EXTERN void mm_mmgmm_cm_establish_ind (void);
1584 EXTERN void mm_mmgmm_cm_emergency_ind (void);
1585 EXTERN void mm_mmgmm_cm_release_ind (UBYTE resumption);
1586 EXTERN void mm_mmgmm_activate_ind (UBYTE status);
1587 EXTERN void mm_mmgmm_t3212_val_ind (void);
1588 EXTERN void mm_mmgmm_lup_accept_ind (void);
1589 EXTERN void mm_mmgmm_lup_needed_ind (UBYTE reason);
1590 EXTERN void mm_mmgmm_tmsi_ind (ULONG tmsi);
1591 #else
1592 /*
1593 * Define the functions only needed in GPRS to nothing.
1594 * This will help the compiler's optimizer to generate
1595 * efficient code for a GSM only protocol stack.
1596 */
1597 #define mm_mmgmm_auth_rej_ind()
1598 #define mm_mmgmm_cm_establish_ind()
1599 #define mm_mmgmm_cm_emergency_ind()
1600 #define mm_mmgmm_cm_release_ind(resumption)
1601 #define mm_mmgmm_activate_ind(status)
1602 #define mm_mmgmm_t3212_val_ind()
1603 #define mm_mmgmm_lup_accept_ind(plmn, lac)
1604 #define mm_mmgmm_lup_needed_ind(reason)
1605 #define mm_mmgmm_tmsi_ind(tmsi)
1606
1607 /*
1608 * There are some additional parameters in some function calls which
1609 * are only used by GPRS. This have no meaning for GSM, but it is undesirable
1610 * to #ifdef out all places where they are used, so they will be defined here.
1611 */
1612 #define MMGMM_RESUMPTION_FAILURE 1
1613 #define MMGMM_PERFORM_DETACH 0
1614 #define REG_GPRS_INACTIVE 0
1615 #define MMGMM_NO_ERROR 0xff
1616 #define MMGMM_CLASS_CC 5
1617 #endif /* else, #ifdef GPRS */
1618
1619 EXTERN T_MM_DATA mm_data_base;
1620 #define GET_INSTANCE_DATA register T_MM_DATA *mm_data= &mm_data_base
1621
1622
1623 /*
1624 * If all entities are linked into one module this definitions
1625 * prefixes the global data with the enity name
1626 */
1627 #ifdef OPTION_MULTITHREAD
1628 #if defined (TI_PS_HCOMM_CHANGE)
1629 #else
1630 #define hCommMMI _ENTITY_PREFIXED(hCommMMI)
1631 #define hCommCC _ENTITY_PREFIXED(hCommCC)
1632 #define hCommSS _ENTITY_PREFIXED(hCommSS)
1633 #define hCommSMS _ENTITY_PREFIXED(hCommSMS)
1634 #define hCommRR _ENTITY_PREFIXED(hCommRR)
1635 #define hCommDL _ENTITY_PREFIXED(hCommDL)
1636 #define hCommSIM _ENTITY_PREFIXED(hCommSIM)
1637 #endif
1638 #endif /* OPTION_MULTITHREAD */
1639
1640 #if defined (NEW_FRAME)
1641 #if defined (TI_PS_HCOMM_CHANGE)
1642 #else
1643 EXTERN T_HANDLE hCommMMI; /* MMI Communication */
1644 EXTERN T_HANDLE hCommCC; /* CC Communication */
1645 EXTERN T_HANDLE hCommSS; /* SS Communication */
1646 EXTERN T_HANDLE hCommSMS; /* SMS Communication */
1647 EXTERN T_HANDLE hCommRR; /* RR Communication */
1648 EXTERN T_HANDLE hCommDL; /* DL Communication */
1649 EXTERN T_HANDLE hCommSIM; /* SIM Communication */
1650 #endif /* (TI_PS_HCOMM_CHANGE) */
1651 EXTERN T_HANDLE mm_handle;
1652 #else
1653 #if defined (TI_PS_HCOMM_CHANGE)
1654 #else
1655 EXTERN T_VSI_CHANDLE hCommMMI; /* MMI Communication */
1656 EXTERN T_VSI_CHANDLE hCommCC; /* CC Communication */
1657 EXTERN T_VSI_CHANDLE hCommSS; /* SS Communication */
1658 EXTERN T_VSI_CHANDLE hCommSMS; /* SMS Communication */
1659 EXTERN T_VSI_CHANDLE hCommRR; /* RR Communication */
1660 EXTERN T_VSI_CHANDLE hCommDL; /* DL Communication */
1661 EXTERN T_VSI_CHANDLE hCommSIM; /* SIM Communication */
1662 #endif /* (TI_PS_HCOMM_CHANGE) */
1663 EXTERN T_VSI_THANDLE mm_act_handle;
1664 #endif /*NEW FRAME*/
1665 /*
1666 * If all entities are linked into one module this definitions
1667 * prefixes the global data with the enity name
1668 */
1669 #ifdef OPTION_MULTITHREAD
1670 #define _decodedMsg _ENTITY_PREFIXED(_decodedMsg)
1671 #endif /*OPTION_MULTITHREAD*/
1672
1673 EXTERN UBYTE _decodedMsg [];
1674
1675 #ifdef OPTION_TIMER
1676 /*
1677 * If all entities are linked into one module this definitions
1678 * prefixes the global data with the entity name
1679 */
1680 #ifdef OPTION_MULTITHREAD
1681 #define partab _ENTITY_PREFIXED(partab)
1682 #endif /*OPTION_MULTITHREAD*/
1683
1684 EXTERN const KW_DATA partab[];
1685 #endif /*OPTION_TIMER*/
1686
1687 #ifndef _TMS470
1688 int sprintf( char *buffer, const char *format, ... );
1689 #define Sprintf sprintf
1690 #endif /*_TMS470*/
1691
1692 #endif