comparison src/g23m-gsm/rr/rr.h @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
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 : Declarations for the Protocol Stack Entity
18 | Radio Resource
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef RR_H
23 #define RR_H
24
25 #ifdef GPRS
26 #include "rr_gprs.h"
27 #endif
28
29 #include "cl_list.h"
30 #ifdef TI_PS_HCOMM_CHANGE
31 #include "cl_hComm_handle.h"
32 #endif
33
34 #ifdef TI_GSP_STR2IND_S2I_STRING
35 typedef unsigned int T_S2I_STRING;
36 #else
37 typedef char * T_S2I_STRING;
38 #define S2I_STRING(x) (x)
39 #endif
40
41 #ifdef TI_PS_OP_VSI_NO_CALL_ID
42 #define TIMER_START(C,I,T) vsi_t_start_nc(I,T)
43 #define TIMER_PSTART(C,I,T,R) vsi_t_pstart_nc(I,T,R)
44 #define TIMER_STOP(C,I) vsi_t_stop_nc(I)
45 #define TIMER_STATUS(C,I,T) vsi_t_status_nc(I,T)
46 #define SUSPEND_SELF(C,T) vsi_t_sleep_nc(T)
47 #define SYSTEM_TIME(C,T) vsi_t_time_nc(T)
48 #else /* TI_PS_OP_VSI_NO_CALL_ID */
49 #define TIMER_START(C,I,T) vsi_t_start(C,I,T)
50 #define TIMER_PSTART(C,I,T,R) vsi_t_pstart(C,I,T,R)
51 #define TIMER_STOP(C,I) vsi_t_stop(C,I)
52 #define TIMER_STATUS(C,I,T) vsi_t_status(C,I,T)
53 #define SUSPEND_SELF(C,T) vsi_t_sleep(C,T)
54 #define SYSTEM_TIME(C,T) vsi_t_time(C,T)
55 #endif /* TI_PS_OP_VSI_NO_CALL_ID */
56
57 #define _SIMULATION_FFS_
58
59 /* Enum values for clearing White List */
60 enum clr_white_list_e
61 {
62 CLR_WHITE_LIST_RAM = 1,
63 CLR_WHITE_LIST_SIM = (CLR_WHITE_LIST_RAM << 1),
64 CLR_WHITE_LIST_FFS = (CLR_WHITE_LIST_SIM << 1)
65 };
66
67 /* Enum values for clearing Black List
68 * CSI-LLD section:4.1.1.4
69 */
70 enum clr_black_list_e
71 {
72 CLR_BLACK_LIST_RAM = 1,
73 CLR_BLACK_LIST_FFS = (CLR_BLACK_LIST_RAM << 1)
74 };
75
76 /* Enum values for identifying scan mode
77 * CSI-LLD section:4.4
78 */
79 enum scan_mode_e
80 {
81 CS_NO_SCAN,
82 CS_FIRST_SCAN_FIRST_ATTEMPT,
83 CS_FIRST_SCAN_SECOND_ATTEMPT,
84 CS_SECOND_SCAN
85 };
86
87 /* Enum values for Initial PLMN search state
88 * CSI-LLD section:4.1.1.4
89 */
90 enum initial_plmn_search_e
91 {
92 INITIAL_PLMN_SEARCH_NOT_ACTIVE,
93 INITIAL_PLMN_SEARCH_ACTIVE,
94 INITIAL_PLMN_SEARCH_DONE
95 };
96
97 /*
98 * look at explanations at rr_data->mode_after_dedi!
99 */
100 #define ARRAY_TRACE
101
102 #if defined(_SIMULATION_)
103 #undef SET_STATE
104 #define SET_STATE(PROCESS,STATE)\
105 { vsi_o_ttrace (VSI_CALLER 0x08, "%s:%s->%s (#%u %s)",\
106 PROCESS_NAME[PROCESS],\
107 PROCESS##_NAME [ ENTITY_DATA->state[PROCESS] ],\
108 PROCESS##_NAME [ STATE ],\
109 __LINE__, __FILE10__);\
110 ENTITY_DATA->state[PROCESS] = STATE;}
111 #endif /* _SIMULATION_ */
112
113 #if !defined(NTRACE)
114 #define TRACE_DATA_IND(a,fn,t) TRACE_EVENT_P5 ("[%u] %s FN=%lu CR=%d SC=%d",\
115 (a)&ARFCN_MASK, t, fn,\
116 (short)(rr_data->nc_data[CR_INDEX].arfcn),\
117 (short)(rr_data->nc_data[SC_INDEX].arfcn))
118 #else /* !NTRACE */
119 #define TRACE_DATA_IND(a,fn,t)
120 #endif /* !NTRACE */
121
122
123
124 #if !defined(NTRACE)
125 #define TRACE_DATA_IND(a,fn,t) TRACE_EVENT_P5 ("[%u] %s FN=%lu CR=%d SC=%d",\
126 (a)&ARFCN_MASK, t, fn,\
127 (short)(rr_data->nc_data[CR_INDEX].arfcn),\
128 (short)(rr_data->nc_data[SC_INDEX].arfcn))
129 #else /* !NTRACE */
130 #define TRACE_DATA_IND(a,fn,t)
131 #endif /* !NTRACE */
132
133 #define RR_ALLOCATE_NEW_BA(v) ((((v)+1) % (RR_BA_HIGH-RR_BA_LOW+1)) + RR_BA_LOW)
134
135 /*lint -esym(526,std) : not defined | defined in PCM */
136 EXTERN UBYTE std;
137
138 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
139 EXTERN const UBYTE std_bands[12];
140 #else
141 EXTERN const UBYTE std_bands[8];
142 #endif
143
144
145 /*
146 * CS priorities
147 */
148 #define CS_LOW_PRIORITY 0x00
149 #define CS_MID_PRIORITY 0x01
150 #define CS_HIGH_PRIORITY 0x02
151 #define CS_PRIORITY 0x03
152 #define CS_NON_CHECKED_BITS 0xF7
153 #define CS_CHECK_FLAG 0x08
154 #define CS_BCCH_READ 0x10
155 #define CS_SET_TO_LOW_PRIORITY 0xFC
156 #define CS_BLACK_LIST_FLAG 0x04 /* CSI-LLD section:4.1.1.3 */
157
158 #define SC_INDEX 6
159 #define CR_INDEX 7
160 #define NCELL_SIZE 8
161
162
163 #define LOW_PRIORITY_CELL 0x40
164 #define EMERGENCY_CELL 0x20
165 #define CHECKED_FLAG 0x08
166
167 #define MAX_MCC_SHIELD 4
168
169 /* CSI-LLD section:4.1.1.3 */
170 #define MAX_SYNC_FAILURES 5
171 #define MAX_SFC_PER_REGION 512
172
173 #define STD_NOT_PRESENT 0x00
174
175 /*
176 * Macros
177 */
178 #ifdef FRAME_OFFSET_ZERO
179
180 #define GET_PD(s,p) p=(UBYTE)(s.buf[3] & 0x0F)
181 #define GET_TI(s,t) t=(UBYTE)(s.buf[3] >> 4 )
182
183 #define GET_UI_PD(s,p) p=(UBYTE)(s.buf[1] & 0x0F)
184 #define GET_UI_TI(s,t) t=(UBYTE)(s.buf[1] >> 4 )
185
186 #else
187
188 #define GET_PD(s,p) ccd_decodeByte(s.buf, (USHORT)(s.o_buf+4), 4, &p)
189 #define GET_TI(s,t) ccd_decodeByte(s.buf, (USHORT)(s.o_buf ), 4, &t)
190
191 #define GET_UI_PD(s,p) ccd_decodeByte(s.buf, (USHORT)(s.o_buf+4), 4, &p)
192 #define GET_UI_TI(s,t) ccd_decodeByte(s.buf, (USHORT)(s.o_buf ), 4, &t)
193
194 #endif
195
196 #define USE_STORED_ENTRIES() { ENTITY_DATA->use_stored_entries = TRUE; }
197
198 /* add resp. get the std value to resp. from arfcn */
199 /*#define STD_ADD_TO_ARFCN(a,std) (((a)&~STD_BIT_MASK) | ((std)<<STD_BIT_SHIFT))*/
200 #define STD_GET_FROM_ARFCN(a) ((((a)&STD_BIT_MASK)>>STD_BIT_SHIFT))
201
202
203 /* Returns the region(european or american)the requested carrier belongs to
204 * CSI-LLD section:4.1.1.2.1
205 */
206 #define CS_GET_REGION_FROM_FREQ(arfcn) ((arfcn&US_BIT)?AMERICAN_REGION:EUROPEAN_REGION)
207
208 /* Sets the current search mode
209 * CSI-LLD section:4.1.3.1.1
210 */
211 #define CS_SET_CURRENT_SEARCH_MODE(mode) (rr_data->cs_data.current_search_mode=mode)
212
213 /* Returns the current search mode
214 * CSI-LLD section:4.1.3.1.1
215 */
216 #define CS_GET_CURRENT_SEARCH_MODE (rr_data->cs_data.current_search_mode)
217
218 /* Sets the previous search mode
219 * CSI-LLD section:4.1.3.1.1
220 */
221 #define CS_SET_PREVIOUS_SEARCH_MODE(mode) (rr_data->cs_data.previous_search_mode=mode)
222
223 /* Returns the previous search mode
224 * CSI-LLD section:4.1.3.1.1
225 */
226 #define CS_GET_PREVIOUS_SEARCH_MODE (rr_data->cs_data.previous_search_mode)
227
228 /* This macro sets Bit : 2 of attributes[ ] field n T_CS_DATA structure for the
229 * carrier identified by the index. This bit indicates whether a carrier is a
230 * candidate for "Black List" or not. The BLACK_LIST_FLAG in the attribute filed
231 * shall be set during initial PLMN search( as indicated by the flag
232 * ini-tial_plmn_search_active) whenever MS fails to synchronize to a carrier.
233 * After the completion of initial PLMN search, Black list flag shall be used to
234 * update the Black List database based on the outcome of initial PLMN search.
235 * CSI-LLD section:4.1.1.2.2
236 */
237 #define CS_SET_BLACK_LIST_FLAG(index) (rr_data->cs_data.attributes[index]|=CS_BLACK_LIST_FLAG)
238
239 /* Returns the value of bit:2 of attributes[]field in T_CS_DATA structure for the
240 * the carrier identified by index. This bit indicates whether a carrier is a
241 * candidate for "Black List" or not. This macro will be called while updating Black
242 * list database following the completion of initial PLMN search.
243 * CSI-LLD section:4.1.1.2.3
244 */
245 #define CS_GET_BLACK_LIST_FLAG(index) (rr_data->cs_data.attributes[index]&CS_BLACK_LIST_FLAG)
246
247 /*
248 * Protocol Discriminator and
249 * Transaction Identifier of RR
250 */
251 #define PD_RR_TI_0 0x06
252 /*
253 * Ignore Value
254 */
255 #define IG NOT_PRESENT_8BIT
256
257 /*
258 * Paging Indication
259 */
260 #define ANYCH 0
261 #define SDCCHCH 1
262 #define TCHFCH 2
263 #define TCHHFCH 3
264 #define TCHHCH 4
265
266 /*
267 * MS Capability
268 */
269 #define FULL 0
270 #define DUAL 1
271 #define SIGN 2
272
273 /*
274 * Maximum value for cell ranking
275 */
276 #define MAX_C2 255
277
278 /*
279 * Power Classes
280 */
281 #define MAX_CLASSES 5
282 #define P_CLASS_2_900 39
283 #define P_CLASS_3_900 37
284 #define P_CLASS_4_900 33
285 #define P_CLASS_5_900 29
286 #define P_CLASS_1_1800 30
287 #define P_CLASS_2_1800 24
288 #define P_CLASS_3_1800 36
289 #define P_CLASS_1_1900 30
290 #define P_CLASS_2_1900 24
291 #define P_CLASS_3_1900 33
292
293 /*
294 * Values for BSIC status
295 */
296 #define EMPTY 0
297 #define NON_DECODED 1
298 #define DECODED 2
299
300 #define CELL_IS_INSERTED 0
301 #define BSIC_HAS_CHANGED 1
302 #define CELL_IS_NOT_INSERTED 2
303
304 #ifdef GPRS
305 #define CR_PAR_INVALID 0
306 #define CR_PAR_VALID 1
307 #endif
308 /*
309 * Times defined by multiplies of TDMA frames
310 */
311 #define PERIOD_1_SEC 217L
312 #define PERIOD_700_SEC 151680L
313
314 /*
315 * Hierarchy defined by multiplies of TDMA frames
316 */
317 #define HYPERFRAME 2715648
318 #define STARTING_TIME_INTERVAL 42432
319 #define STARTING_TIME_INTERVAL0 10808
320 #define STARTING_TIME_INTERVAL1 31623
321 /* The Starting Time IE can encode only an interval of time of 42 432 frames,
322 * that is to say around 195.8 s. To remove any ambiguity, the specification
323 * for a reception at time T is that the encoded interval is
324 * (FN-10808, FN+31623). In rigorous terms, if we note ST the starting time:
325 *
326 * - if 0 <= (ST-FN) mod 42432 <= 31623, the indicated time is the next time
327 * when FN mod 42432 is equal to ST
328 * - if 32024 <= (ST-FN) mod 42432 <= 42431, the indicated time has already
329 * elapsed.
330 * The reception time FN is not specified here precisely. To allow room for
331 * various MS implementations, the limit between the two behaviours above may
332 * be anywhere within the interval defined by
333 *
334 * - 31624 <= (ST-FN) mod 42432 <= 32023.
335 *
336 * 3GPP TS 04.18, section 10.5.2.38 Starting Time
337 */
338
339
340 /*
341 * Flags for sending rr status message
342 */
343 #define SEND_RR_STATUS 1
344 #define SEND_NO_RR_STATUS 0
345
346 /*
347 * Bitoffset for encoding/decoding
348 */
349 #define ENCODE_OFFSET 24
350
351 /*
352 * Protocol Discrimator
353 */
354 #define PD_CC 3
355 #define PD_MM 5
356 #define PD_RR 6
357 #define PD_SMS 9
358 #define PD_SS 11
359 #define PD_TST 15
360
361 /*
362 * Test Messages
363 */
364 #define CLOSE_TCH_LOOP_CMD 0
365 #define OPEN_LOOP_CMD 6
366 #define TEST_INTERFACE 0x14
367
368 /*
369 * Delay for the CLOSE_TCH_LOOP_ACK to allow L1 switching
370 */
371 #define DELAY_CLOSE_TCH_LOOP_ACK 35
372
373 /*
374 * Release Causes
375 */
376 #define OPTIONAL_INFO_ERROR 0x66
377
378 /*
379 * System Information Type Flags
380 */
381 #define CELL_SELECTION 0
382 #define CELL_RESELECTION 1
383 #define BACK_FROM_DEDICATED 2
384 #define CELL_RESELECTION_NC 3
385 #define BACK_FROM_DEDICATED_RLF 4
386 #define CELL_RESELECTION_RACH 5
387 #define CELL_RESELECTION_CR 6
388 #ifdef GPRS
389 #define CELL_RESELECTION_ON_GPRS_ACT 7
390 #endif
391 #define MM_ORIGINATED TRUE
392 #define RR_ORIGINATED FALSE
393
394 #define CS_PARALLEL 1
395 #define CS_NOT_PARALLEL 0
396
397 #define NO_SYS_INFO_READ 0
398
399 #ifdef GPRS
400 #define ALL_SYS_INFO_READ 0x007f
401 #else
402 #define ALL_SYS_INFO_READ 0x003f
403 #endif
404
405 #define SYS_INFO_1_READ 0x0001
406 #define SYS_INFO_2_READ 0x0002
407 #define SYS_INFO_2BIS_READ 0x0004
408 #define SYS_INFO_2TER_READ 0x0008
409 #define SYS_INFO_3_READ 0x0010
410 #define SYS_INFO_4_READ 0x0020
411 #if defined (REL99) && defined (TI_PS_FF_EMR)
412 #define SYS_INFO_2QUATER_READ 0x2000
413 #endif
414 #define SYS_INFO_EXCEPT_2TER (ALL_SYS_INFO_READ & (~SYS_INFO_2TER_READ))
415
416 #ifdef GPRS
417 #define SYS_INFO_13_READ 0x0040
418 #define SYS_INFO_EXCEPT_SI13 (ALL_SYS_INFO_READ & (~SYS_INFO_13_READ))
419 #endif
420
421 #define SYS_INFO_5_READ 0x0100
422 #define SYS_INFO_5BIS_READ 0x0200
423 #define SYS_INFO_5TER_READ 0x0400
424 #define ALL_DEDI_SYS_INFOS 0x0700
425
426 #define NO_AVAILABLE 255
427
428 #define SYS_INFO_2_MSG 0x1a
429 #define SYS_INFO_2bis_MSG 0x02
430 #define SYS_INFO_2ter_MSG 0x03
431
432 #if defined (REL99) && defined (TI_PS_FF_EMR)
433 #define MAX_MULTI_INST 16 /* max.number of instances in multi-instance msg (SI-2quater or MI)*/
434 #define MSG_SIZE_EMR 168 /* 21 * 8 */
435 #define MAND_SIZE_EMR 15 /*Max mandatory bits in EMR*/
436 #define SC_INFO_SIZE_EMR 23 /*size for serving cell, if included*/
437 #define NC_INVBSIC_EMR 18 /* size for each neighbour cell, if included in Invalid BSIC structure of EMR*/
438 #define NC_BMP_EMR 7 /* size for each neighbour cell, if included in BSIC BMP structure of EMR*/
439 #endif
440
441 /*
442 * Values for the V(SD) bit
443 */
444 #define SET_ONLY 0
445 #define SET_AND_RESET 1
446 #define RESET_ONLY 2
447
448 /*
449 * Content Flags
450 */
451 #define NO_CONTENT 0
452 #define WITH_CHANGED_CONTENT 1
453 #define WITH_CONTENT 2
454
455 /*
456 * Establishment Causes
457 */
458 #define ESTCS_LOCATION_UPDATING 0x0400
459 #define ESTCS_PAGING 0x0480
460 #define ESTCS_EMERGENCY_CALL 0x04A0
461 #define ESTCS_REESTABLISHMENT 0x04C0
462 #define ESTCS_MOC_SPEECH 0x04E0
463 #define ESTCS_MOC_DATA 0x04E1
464 #define ESTCS_MOC_DATA_HR_SUFF 0x04E2
465 #define ESTCS_MOC_SS_SMS 0x04F0
466
467 #define MAX_RACH_RETRANS_VAL 4
468 #define MAX_TX_INTEGER 16
469
470 #define RX_QUAL_UNAVAILABLE 0xFF
471 #ifdef FF_PS_RSSI
472 #define RX_ACCE_UNAVAILABLE 0xFF
473 #endif
474
475 /*
476 * Application Information: constant name synomyms
477 */
478
479 #define LAST_SEG ( L_SEG ) /* 0x00 */
480 #define NOT_LAST_SEG (NL_SEG ) /* 0x01 */
481 #define FIRST_SEG ( F_SEG ) /* 0x00 */
482 #define NOT_FIRST_SEG (NF_SEG<<1) /* 0x02 */
483
484 #define APDU_FULL_L2_FRAME 247
485 #define MAX_PRIMPART_SIZE 1600 /* actually defined in "frm_types.h" */
486 #if defined FF_EOTD
487 #define MAX_APDU_SIZE (MAX_PRIMPART_SIZE-sizeof(T_PRIM_HEADER)-sizeof(T_RRRRLP_DATA_IND))
488 #endif /* FF_EOTD */
489
490 #define NULLSTRING ""
491 #define ARFCN_NOT_PRESENT 0xFFFF
492 #define FRAME_NUM_NOT_PRESENT 0xFFFFFFFFL
493
494 /*
495 * Timer
496 */
497 enum timer_index_e
498 {
499 T3110, /* Channel Release Timer */
500 T3122, /* Wait Indication Timer */
501 T3126, /* Imm Assignment Timer */
502 T_RESELECT, /* Reselection Timer */
503 TREG, /* Registration Timer */
504 TABORT, /* RR_ABORT_IND Timer */
505 T_NO_RESELECT, /* exception of path loss criteria after reselection */
506 TIM_EXT_MEAS, /* Extended Measurement */
507 #if defined FF_EOTD
508 TAPDU, /* Application PDU Timer */
509 #endif /* FF_EOTD */
510 TNNN,
511 TCSVALID, /* CS measurements are valid or not */
512 T_DEDICATED_MODE,/* cell re-selection after leaving dedicated mode */
513 T_PLMN_SEARCH, /* Manual cell selection timer */
514 T_FAST_CS, /* controls FAST search */
515 T_NORMAL_CS, /* controls NORMAL search */
516 NUM_OF_RR_TIMERS
517 };
518
519 #define TIMER_TRACE
520
521 #if defined(TIMER_TRACE)
522 #define TRACE_TIMER(FMT) TRACE_EVENT((FMT))
523 #define TRACE_TIMER_P1(FMT,P1) TRACE_EVENT_P1((FMT),(P1))
524 #define TRACE_TIMER_P2(FMT,P1,P2) TRACE_EVENT_P2((FMT),(P1),(P2))
525 #define TRACE_TIMER_P3(FMT,P1,P2,P3) TRACE_EVENT_P3((FMT),(P1),(P2),(P3))
526 #else
527 #define TRACE_TIMER(FMT)
528 #define TRACE_TIMER_P1(FMT,P1)
529 #define TRACE_TIMER_P2(FMT,P1,P2)
530 #define TRACE_TIMER_P3(FMT,P1,P2,P2)
531 #endif
532
533 /*
534 * Dynamic Configuration Numbers
535 */
536 #define TIMER_SET 1
537 #define TIMER_RESET 2
538 #define TIMER_SPEED_UP 3
539 #define TIMER_SLOW_DOWN 4
540 #define TIMER_SUPPRESS 5
541 #define TIM_FAST 6
542 #define TIM_NORMAL 7
543
544 #define NO_SYS_TIME 20
545 #define FCR 21
546 #define SCR 22
547 #define DLE 23
548 #define FCA 24
549 #define FRL 25
550 #define FHO 26
551 #define GSM_OFFSET 27
552 #define DCS_OFFSET 28
553 #define CTO 29
554 #define NKC 30
555 #define INIT_FFS 31
556 #define WRITE_FFS 32
557 #define SET_LAST_USED_SC 33
558 #define IHO 34 /* lock the DUT to the cell it is already camping */
559 #define FBLS 35
560
561 #define ID_RESTRICTED_BAND 50
562 #define ID_MULTISLOT_CLASS 51
563 #if defined(_TARGET_)
564 #define ID_FFS_CHECK 52
565 #endif /* _TARGET_ */
566 #define ID_CMSP 54
567 #define SCS 55
568 #define SHIELD 56
569
570 #define RR_MT_CALL 37
571 #define RR_MT_SMS_0 38
572 #define RR_MT_SMS_2 39
573 #define RR_SERVICE_FULL 40
574 #define RR_SERVICE_LIMITED 41
575 #define RR_SERVICE_NO 42
576 #define RR_MO_CONNECT 43
577 #define ID_PSEUDO_SYNC_HO 44
578 #define ID_PCM 45
579 #define DCS_PCLASS_3 46
580 #define BL_CS 60
581 #define U_RXT 61
582 #define M_RXT 62
583 #define L_RXT 63
584 #define SHOW_BL 64
585 #define SHOW_WL 65
586 #define SET_NPS_DELAY 66
587 #if defined (_SIMULATION_FFS_)
588 #define ERASE_WL 70
589 #define ERASE_BL 71
590 #endif
591 #define SET_WL 72
592 #define SET_BL 73
593 #define SET_WL_REGION 74
594 #define SET_WL_PLMN 75
595
596 #ifdef TI_PS_FF_AT_P_CMD_CTREG
597 /*
598 * %CTREG tab_id value
599 */
600 #define RR_MOD_NOSERVICE_TIME 1
601 #define RR_MOD_LIMSERVICE_TIME 2
602 #endif /* TI_PS_FF_AT_P_CMD_CTREG */
603 typedef enum{
604 SI_TYPE_NONE,
605 SI_TYPE_2,
606 SI_TYPE_2BIS,
607 SI_TYPE_2TER,
608 SI_TYPE_3,
609 SI_TYPE_4,
610 SI_TYPE_5,
611 SI_TYPE_5BIS
612 }T_SI_TYPE;
613
614 typedef enum {
615 CR_STATUS_OFF = 0,
616 CR_STATUS_ON
617 } T_CR;
618
619 typedef enum {
620 MOB_ALLOC_BEFORE = 0,
621 MOB_ALLOC_AFTER
622 } T_MOB_ALLOC_TYPE;
623
624
625 /*
626 * Parameter of dynamic configuration commands
627 */
628 #if !defined(NTRACE)
629 #if defined(RR_PEI_C)
630 /* Implements Measure#32: Row 36, 39 and 40 */
631 GLOBAL T_S2I_STRING const _rr_str_FUNC[] = {
632 S2I_STRING("LIM"), /* FUNC_LIM_SERV_ST_SRCH (0x0) limited service state search */
633 S2I_STRING("PLMN"), /* FUNC_PLMN_SRCH (1) PLMN search */
634 S2I_STRING("NET") /* FUNC_NET_SRCH_BY_MMI (0x2) Net search by MMI */
635 };
636 GLOBAL const char* const _rr_str_PARFUNC[] = {
637 "", /* (0) cleared */
638 "", /* (1) invalid value */
639 "parallel PLMN " /* FUNC_NET_SRCH_BY_MMI (0x2) Net search by MMI */
640 };
641 /* Implements Measure#32: Row 36, 39 and 40 */
642 GLOBAL T_S2I_STRING const _rr_str_SERVICE[] = {
643 S2I_STRING("NO"), /* NO_SERVICE (0x0) no service available */
644 S2I_STRING("LIM"), /* LIMITED_SERVICE (0x1) Limited service available */
645 S2I_STRING("FULL") /* FULL_SERVICE (0x2) Full service available */
646 };
647 GLOBAL const char* const _rr_str_stored_bcch_info[]=
648 {
649 "SI2", "SI2bis", "SI2ter", "SI2"
650 };
651 #else /* RR_PEI_C */
652 EXTERN const char* const _rr_str_FUNC[];
653 EXTERN const char* const _rr_str_PARFUNC[];
654 EXTERN const char* const _rr_str_SERVICE[];
655 EXTERN const char* const _rr_str_stored_bcch_info[];
656 #endif /* RR_PEI_C */
657 #endif /* !NTRACE */
658
659 /*
660 * States of the Attachment
661 */
662 #define ATT_NULL 0
663 #define ATT_CS1 1 /* Power measurement, Sync (MPH_BSIC_REQ/CNF) */
664 #define ATT_CS2 2 /* BCCH reading (Cell selection) */
665 #define ATT_CS3 3 /* Cell reselection */
666 #define ATT_DEDICATED 4
667 #define ATT_IDLE 5
668 #define ATT_NO_SERVICE 6
669 #define ATT_CON_EST 7
670 #define ATT_CS_INIT 8 /* Initial RR_ACTIVATE_REQ got and Power measurements started */
671
672 /* N950 Memory Optimization - Implements Measure #39*/
673 EXTERN T_S2I_STRING const
674 STATE_ATT_NAME[];
675
676 /*
677 * States of the Process Data Transfer
678 */
679 #define DAT_NULL 0
680 #define DAT_CELL_RESELECT 1
681 #define DAT_CHAN_ASS 2
682 #define DAT_CHAN_ASS_1 3
683 #define DAT_CHAN_ASS_2 4
684 #define DAT_PDCH_ASS 5
685 #define DAT_PDCH_ASS_1 6
686 #define DAT_PDCH_ASS_2 7
687 #define DAT_PDCH_ASS_3 8
688 #define DAT_PDCH_ASS_4 9
689 #define DAT_CCO_3 10
690 #define DAT_CCO_4 11
691 #define DAT_CHAN_REL 12
692 #define DAT_DEDICATED 13
693 #define DAT_HANDOVER 14
694 #define DAT_HANDOVER_4 15
695 #define DAT_HANDOVER_5 16
696 #define DAT_IDLE 17
697 #define DAT_IMM_ASS 18
698 #define DAT_IMM_ASS_1 19
699
700 /* N950 Memory Optimization - Implements Measure #39*/
701 EXTERN T_S2I_STRING const
702 STATE_DAT_NAME[];
703 /*
704 * States for short message service (Sapi 3)
705 */
706 #define SMS_IDLE 0
707 #define SMS_PENDING 1
708 #define SMS_ESTABLISHED 2
709
710 /* N950 Memory Optimization - Implements Measure #39*/
711 EXTERN T_S2I_STRING const
712 STATE_SAPI_3_NAME[];
713 /*
714 * States for cell selection
715 */
716 #define CS_NULL 0 /* after system start or before 'cs_start_scan' */
717 #define CS_NULL_ACTIVE 1 /* after MPH_POWER_REQ sent in CS_NULL */
718 #define CS_CCO 2
719 #define CS_XMEAS 3
720 #define CS_IDLE 4 /* all ARFCNs provided by MPH_POWER_CNF are used by MPH_BSIC_REQ/CNF */
721 #define CS_IDLE_ACTIVE 5 /* after MPH_POWER_REQ sent in CS_IDLE or MPH_BSIC_REQ sent */
722
723 /* N950 Memory Optimization - Implements Measure #39*/
724 EXTERN T_S2I_STRING const
725 STATE_CELL_SEL_NAME[];
726 /*
727 * RR manages 5 (MAX_STATE) states: ATT, DAT, SAPI_3, GPRS, CS
728 */
729 #ifdef OPTION_MULTITHREAD
730 #define PROCESS_NAME _ENTITY_PREFIXED(PROCESS_NAME)
731 #endif
732
733 #define STATE_ATT 0
734 #define STATE_DAT 1
735 #define STATE_SAPI_3 2
736 #define STATE_CELL_SEL 3
737 #ifdef GPRS
738 #define STATE_GPRS 4
739 #define MAX_STATE 5
740 #else
741 #define MAX_STATE 4
742 #endif
743
744 /* N950 Memory Optimization - Implements Measure #39*/
745 EXTERN T_S2I_STRING const
746 PROCESS_NAME[];
747
748
749 #define MAX_STK_LENGTH 80
750 #define NOT_INITIALISED NOT_PRESENT_8BIT /*Used for initialising element 'c_ncell_bcch'*/
751
752 /*
753 * A definition is provided in RR_PEI.C
754 */
755 #ifdef RR_PEI_C
756 /* N950 Memory Optimization - Implements Measure #39*/
757 GLOBAL T_S2I_STRING const STATE_ATT_NAME[] =
758 {
759 S2I_STRING("ATT_NULL") ,
760 S2I_STRING("ATT_CS1") ,
761 S2I_STRING("ATT_CS2") ,
762 S2I_STRING("ATT_CS3") ,
763 S2I_STRING("ATT_DEDICATED"),
764 S2I_STRING("ATT_IDLE") ,
765 S2I_STRING("ATT_NO_SERVICE"),
766 S2I_STRING("ATT_CON_EST")
767 };
768 GLOBAL T_S2I_STRING const STATE_DAT_NAME[] =
769 {
770 S2I_STRING("DAT_NULL") ,
771 S2I_STRING("DAT_CELL_RESELECT"),
772 S2I_STRING("DAT_CHAN_ASS") ,
773 S2I_STRING("DAT_CHAN_ASS_1") ,
774 S2I_STRING("DAT_CHAN_ASS_2") ,
775 S2I_STRING("DAT_PDCH_ASS") ,
776 S2I_STRING("DAT_PDCH_ASS_1") ,
777 S2I_STRING("DAT_PDCH_ASS_2") ,
778 S2I_STRING("DAT_PDCH_ASS_3") ,
779 S2I_STRING("DAT_PDCH_ASS_4") ,
780 S2I_STRING("DAT_CCO_3") ,
781 S2I_STRING("DAT_CCO_4") ,
782 S2I_STRING("DAT_CHAN_REL") ,
783 S2I_STRING("DAT_HANDOVER") ,
784 S2I_STRING("DAT_HANDOVER_4") ,
785 S2I_STRING("DAT_HANDOVER_5") ,
786 S2I_STRING("DAT_IDLE") ,
787 S2I_STRING("DAT_IMM_ASS") ,
788 S2I_STRING("DAT_IMM_ASS_1")
789 };
790
791 GLOBAL T_S2I_STRING const STATE_SAPI_3_NAME[] =
792 {
793 S2I_STRING("SMS_IDLE") ,
794 S2I_STRING("SMS_PENDING") ,
795 S2I_STRING("SMS_ESTABLISHED")
796 };
797
798 GLOBAL T_S2I_STRING const STATE_CELL_SEL_NAME[] =
799 {
800
801 S2I_STRING("CS_NULL") ,
802 S2I_STRING("CS_NULL_ACTIVE") ,
803 S2I_STRING("CS_CCO") ,
804 S2I_STRING("CS_XMEAS") ,
805 S2I_STRING("CS_IDLE") ,
806 S2I_STRING("CS_IDLE_ACTIVE")
807 };
808 #ifdef GPRS
809 GLOBAL T_S2I_STRING const PROCESS_NAME[] =
810 {
811 S2I_STRING("ATT") ,
812 S2I_STRING("DAT") ,
813 S2I_STRING("SAPI_3"),
814 S2I_STRING("CELL_SEL"),
815 S2I_STRING("GPRS")
816 };
817 #else
818 GLOBAL T_S2I_STRING const PROCESS_NAME[] =
819 {
820 S2I_STRING("ATT") ,
821 S2I_STRING("DAT") ,
822 S2I_STRING("SAPI_3"),
823 S2I_STRING("CELL_SEL")
824 };
825 #endif
826
827 #endif
828
829 /*
830 * Shifts for 'operation_mode'
831 */
832 #define SHIFT_FOR_SIM_TYPE 7
833 #define SHIFT_FOR_SEARCH_OFFSET 6
834 #define SHIFT_FOR_SIM_INSERTED 5
835
836 /*
837 * To check multiband restrictions
838 */
839 #define UNKNOWN_BAND_USED 0
840 #define INVALID_BAND_USED 1
841 #define LOW_BAND_USED 2
842 #define HIGH_BAND_USED 4
843 #define EXT_BAND_USED 8
844
845 /*
846 * Defines for Equivalent PLMNs
847 */
848 #define UBYTES_PER_PLMN 3
849 #define RR_EPLMNLIST_SIZE (SIZE_EPLMN/UBYTES_PER_PLMN)
850
851 /*
852 * Maximum lenght of the string that can be passed to sprintf
853 */
854 #define MAX_SPRINTF_STRING_LEN 80
855
856 /*==== TYPES ======================================================*/
857 typedef struct
858 {
859 UBYTE length;
860 UBYTE count;
861 } T_W_PARAM;
862
863 typedef struct
864 {
865 UBYTE cs;
866 UBYTE val;
867 } T_ERROR;
868
869
870 /* range check with the fastest way for ARM */
871 /* corresponds with ((min <= x) AND (x <= max)) */
872 #define INRANGE(min, x, max) ((unsigned) ( (x)-(min) ) <= (unsigned)( (max)-(min) ) )
873
874 /*
875 * This data structure stores a list of frequencies.
876 * The frequencies are stored in bitmap format.
877 * In GSM the frequencies have a range of 0 - 1023
878 * where some of the frequencies are not yet used.
879 * For the calculation of the needs of bytes and the bit representations of
880 * the channels within the T_LIST please have a look at rr_srv.c
881 * (comment with 'List processing Functions')
882 */
883
884 #define L3_SDU_BUF_SIZE 30
885 typedef struct
886 {
887 /*lint -esym(768,length) : not referenced */
888 USHORT length;
889 USHORT offset;
890 UBYTE buffer [L3_SDU_BUF_SIZE];
891 } T_L3_SDU;
892
893 typedef enum
894 {
895 SAI_NULL, /* no APDU transfer is ongoing */
896 SAI_SEGM /* segmentation or re-segmentation is ongoing */
897 } T_APPLIC_STATE;
898
899 #if defined FF_EOTD
900 typedef struct
901 {
902 T_APPLIC_STATE state; /* state of application procedure */
903 T_RRRRLP_DATA_IND *rrrrlp_data_ind; /* APDU Data during re-segmentation */
904 } T_APPLIC_RX;
905 #endif /* FF_EOTD */
906
907 typedef struct
908 {
909 UBYTE param_ind;
910 UBYTE cbq;
911 UBYTE cell_reselect_offset;
912 UBYTE temp_offset;
913 UBYTE penalty_time;
914 UBYTE power_off_ind;
915 UBYTE power_off;
916 UBYTE two_ter;
917 UBYTE ecsc;
918 } T_C2_PARAMETER;
919
920 typedef struct
921 {
922 UBYTE ia_p;
923 UBYTE ia_maio;
924 UBYTE c_ia_mac;
925 UBYTE ia_mac[9];
926 } T_IA_REST;
927
928 #if defined(_SIMULATION_FFS_)
929 typedef struct
930 {
931 UBYTE mcc[MAX_MCC_SHIELD][SIZE_MCC];
932 UBYTE enabled;
933 UBYTE index;
934 }T_shield_mcc;
935 #endif
936
937 /* CSI-LLD section:3.2.1
938 * Black list contains the carriers that cannot be synchronized
939 * Carriers belonging to either european or american bands can
940 * be part of black list
941 */
942 typedef struct
943 {
944 T_LIST list[MAX_REGIONS]; /* Seperate lists for European & American regions */
945 U8 sfc[MAX_REGIONS][MAX_SFC_PER_REGION]; /* Seperate sync fail counters for European & American regions */
946 }T_CS_BLACK_LIST;
947
948 /* CSI-LLD 3.2.2
949 * White List Data of RR.White List contains carriers that are good candidates
950 * for full service.
951 */
952 typedef struct
953 {
954 T_LIST list;
955 T_loc_area_ident last_sc_lac; /* stores the LAC of the last serving cell */
956 U16 last_sc_arfcn; /* stores the last serving cell ARFCN */
957 U8 region; /* stores the region information */
958 } T_CS_WHITE_LIST;
959
960 typedef struct
961 {
962 U8 si2[BA_BITMAP_SIZE]; /* stores the BA list received in SI2 */
963 U8 si2bis[BA_BITMAP_SIZE]; /* stores the BA list received in SI2BIS */
964 U8 si2ter[BA_BITMAP_SIZE]; /* stores the BA list received in SI2TER */
965 } T_CR_WHITE_LIST;
966
967 /*
968 * ms data of RR
969 */
970 typedef struct
971 {
972 UBYTE rr_service; /* actual rr service mode */
973 UBYTE req_mm_service; /* by mm requested service mode*/
974 BOOL multislot_class_configured;
975 BOOL cmsp_configured;
976 T_rf_cap rf_cap; /* MS RF Capability */
977 T_mob_class_1 classmark1; /* mobile station classmark 1 */
978 T_mob_class_2 classmark2; /* mobile station classmark 2 */
979 T_mob_class_3 classmark3; /* mobile station classmark 3 */
980 #ifdef GPRS
981 T_ra_cap ra_cap; /* MS Radio Access Capability */
982 #endif
983 T_mob_ident imei; /* IMEI */
984 UBYTE operation_mode; /* Operation Parameters from MM*/
985
986 /*
987 * The purpose of 'parallel_net_plmn_search_type?and ‘current_plmn_search_type? * is to record the request for a parallel search (i.e. to action a network
988 * search whilst an existing search (for a limited/plmn) is already underway)
989 *
990 * The original request is stored in ‘current_plmn_search_type?and the parallel
991 * net search request is stored in ‘parallel_net_plmn_search_type?
992 *
993 * When the NET search is completed, ‘parallel_net_plmn_search_type?is cleared
994 * and ‘mm_req_service?is set the stored search value in ‘current_plmn_search_type?
995 */
996 UBYTE parallel_net_plmn_search_type;
997 UBYTE current_plmn_search_type;
998
999
1000 T_plmn plmn; /* requested network by MM */
1001 BOOL v_eq_plmn; /* EPLMN List is valid or not */
1002 T_plmn eq_plmn_list[RR_EPLMNLIST_SIZE]; /* eq PLMN list from MM */
1003 UBYTE cksn; /* cipher key sequence number */
1004 UBYTE kc [KC_STRING_SIZE]; /* authentication parameter Kc */
1005 UBYTE new_kc [KC_STRING_SIZE]; /* new auth parameter from SIM */
1006 USHORT access_classes; /* access classes from SIM */
1007 T_mob_ident imsi; /* IMSI from SIM card */
1008 UBYTE imsi_available; /* IMSI available flag */
1009 ULONG tmsi_binary; /* binary representation TMSI */
1010 UBYTE tmsi_available; /* TMSI available flag */
1011 T_loc_area_ident forb_lac_list[MAX_LAI];
1012 /* forbidden lai list */
1013 T_loc_area_ident roam_forb_lac_list[MAX_LAI];
1014 /* roaming forbidden lai list */
1015 UBYTE c2_tab [NCELL_SIZE]; /* ranked list for C2 */
1016 UBYTE access_counter; /* counts random bursts */
1017 UBYTE all_conf_received; /* flag all randoms confirmed */
1018 UBYTE channel_needed; /* for mobile terminated call */
1019 T_ERROR error; /* in incoming messages */
1020 USHORT establish_cause; /* for outgoing call */
1021 ULONG fn_offset; /* time between measurements */
1022 T_synch_ind ho_type; /* handover type information */
1023 USHORT index; /* for random number generation*/
1024 T_L3_SDU l3msg; /* layer 3 message for establ. */
1025 UBYTE last_used_channel; /* for building random ref */
1026 UBYTE max_attempt; /* number of random bursts */
1027 T_MPH_MEASUREMENT_IND measurement_report;/* last measurement report */
1028 T_TIME reg_time_gap; /* Time gap between Non parallel search in Lim Ser */
1029 UBYTE reg_counter; /* registration counter */
1030 UBYTE old_cell_tried; /* flag during cell reselection*/
1031 T_plmn ahplmn; /* Acting HPLMN ID */
1032 #if defined (REL99) AND defined (TI_PS_FF_EMR) AND (GPRS)
1033 BOOL enable_ps_emr;
1034 #endif
1035 } T_MS_DATA;
1036
1037 #if defined (REL99) && defined (TI_PS_FF_EMR)
1038 /* indicates from where the enhanced para are taken - SI2quater or MI*/
1039 #define ENH_PARA_IDLE 0
1040 #define ENH_PARA_DEDICATED 1
1041 #define ENH_PARA_INVALID_STATE 2
1042 #endif
1043
1044 #if defined (TI_PS_FF_RTD) AND defined (REL99)
1045 /* start of constants related to RTD */
1046 #define RTD_DEFAULT_INDEX 0
1047 #define RTD_NOT_AVAILABLE 0xFFFF
1048 #define RTD_12BIT 0x8000
1049 #define MAX_NR_OF_NCELL 0x20
1050 /* end of constants related to RTD */
1051 #endif /* #if defined (TI_PS_FF_RTD) AND defined (REL99) */
1052
1053
1054 /*
1055 * data area for cell selection / reselection
1056 */
1057 typedef struct
1058 {
1059 UBYTE v_cell_chan_desc; /* cell chan desc flag */
1060 T_LIST cell_chan_desc; /* cell channel description */
1061 T_chan_desc cbch_chan_desc; /* cbch channel description */
1062 UBYTE cbch_chan_desc_avail;/* cbch available flag */
1063 UBYTE cbch_mob_alloc [65]; /* cbch mobile allocation */
1064 UBYTE ncc_permitted; /* NCC permitted bitmap */
1065 T_cell_opt_sacch cell_options; /* cell options */
1066 UBYTE ncell_ext; /* neighbourcell extension flag*/
1067 UBYTE dtx; /* dtx flag */
1068 UBYTE dtx_half;
1069 UBYTE dtx_full;
1070 USHORT sys_info_read; /* bitmap of read sys infos */
1071 T_LIST ncell_list; /* neighbour cell list */
1072 #if defined (REL99) && defined (TI_PS_FF_EMR)
1073 UBYTE si2quater_status; /*Indicates the SI-2quater status on cell that can be used
1074 once the cell is selected */
1075 BOOL si2quater_pos; /* 0 - NBCCH, 1 - EBCCH*/
1076 #endif
1077 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1078 UBYTE band_indicator; /* 0 - 1800, 1 - 1900 */
1079 #endif
1080 } T_CELL_DATA;
1081
1082 typedef struct
1083 {
1084 T_plmn plmn; /* Idetification of Network */
1085 USHORT lac; /* Location Area Code */
1086 USHORT arfcn; /* Frequency Number */
1087 UBYTE rxlev; /* The received signal level */
1088 UBYTE cell_ok; /* cell allows network access */
1089 UBYTE region; /* Identification of region */
1090 } T_FOUND_ELEMENT;
1091
1092 typedef struct
1093 {
1094 T_FOUND_ELEMENT element [MAX_PLMN];
1095 } T_FOUND_LIST;
1096
1097 #if defined (REL99) && defined (TI_PS_FF_EMR)
1098 typedef struct {
1099 BOOL is_data_valid; /*Indicates whether the maintained Enhanced parameters
1100 is valid or not.*/
1101 UBYTE mp_change_mark; /*Current change mark value of the measurement parameters
1102 received in Air message*/
1103 UBYTE msg_count; /*Number of instances to be received*/
1104 UBYTE rep_type; /* 'Normal' or 'Enhanced': Report type to be used in dedicated mode*/
1105 UBYTE grr_rep_type; /* 'Normal' or 'Enhanced': Report type to be used in PIM/PTM*/
1106 T_enh_para_struct enh_para;/* Actual parameters */
1107 #ifdef GPRS
1108 T_nc_para_struct nc_para; /*Network control parameters*/
1109 #endif
1110 ULONG ba2bsic_map_pending;/*1 in a bit pos indicates BA-BSIC mapping is pending for that index
1111 may be due to incomplete BA (SI-5ter awaited)*/
1112 UBYTE scale_used_last;
1113 } T_rr_enh_para;
1114
1115 /*In a multi instance message where this BSIC info is received,
1116 not all instances carry BSIC list. The instance that carries
1117 this info will have is_valid set to TRUE*/
1118 typedef struct {
1119 BOOL is_valid;
1120 T_gprs_bsic bsic_info;
1121 } T_bsic_list;
1122 #endif
1123
1124 /*
1125 * serving cell data of RR
1126 */
1127 typedef struct
1128 {
1129 UBYTE ciph_on; /* ciphering status */
1130 UBYTE algo; /* cipher algorithm */
1131 UBYTE ciph_received; /* flag ciphering received */
1132 UBYTE selection_type; /* type of cell selection */
1133 BOOL mm_started; /* originated of cell selection*/
1134 UBYTE found_entries; /* number of found PLMNs */
1135 T_FOUND_ELEMENT found[MAX_PLMN]; /* list of found PLMNs */
1136 UBYTE first_attempt; /* high priority attempt */
1137
1138 T_chan_desc chan_desc; /* actual channel description */
1139 UBYTE new_ta; /* timing advance */
1140 UBYTE ch_mode; /* actual channel mode */
1141 UBYTE ba_index; /* band allocation index */
1142 ULONG observed_ta; /* observed timing advance */
1143 T_LIST five_ter_list; /* contains sys info 5ter list */
1144 T_LIST ncell_list_idle; /* neighbour cell list build in idle mode */
1145 /*
1146 * data area for cell selection / reselection
1147 */
1148 T_CELL_DATA cd; /* cell data */
1149 T_multirate_conf amr_conf; /* MultiRate configuration */
1150 #if defined(STORE_FN)
1151 ULONG fn; /* last indicated framenumber */
1152 #endif /* STORE_FN */
1153 #if defined (REL99) && defined (TI_PS_FF_EMR)
1154 /*
1155 * Data area for EMR
1156 */
1157 /*
1158 * Parameters that are permanent
1159 */
1160 UBYTE enh_para_status; /* Indicates Whether the existing enh_para are from SI-2quater or MI*/
1161 T_rr_enh_para emr_data_current; /*Parameters for EMR - for RR in dedicated
1162 mode and for GRR in PIM/PTM mode. Not required in Idle*/
1163 BOOL ba_list_ded; /*Indicates whether BA list is already received in dedicated mode*/
1164 BOOL ba_list_idle;/*Indicates whether BA list is already received in Idle mode*/
1165 /*
1166 * Parameters that are required only during message processing
1167 */
1168 T_rr_enh_para emr_data_temp; /* Temporary storage till we get all the instances of Air message*/
1169 UBYTE prev_highest_index; /*To keep track of highest index*/
1170 ULONG rep_bmp; /*temporary storage of report priority in bit map form*/
1171 USHORT instance_bmp; /*A bit set indicates that the instance is received. Bit 0- instance '0'
1172 bit 15 - instance '15'*/
1173 T_bsic_list bsic_list[MAX_MULTI_INST]; /* To store the received BSIC lists before performing
1174 BA-BSIC mapping*/
1175 UBYTE rep_count[MAX_NEIGHBOURCELLS]; /* this is used to get how many times a cell in
1176 enhanced neighbour cell list is reported. Will be of use when reporting low priority cells
1177 at reduced rate*/
1178 UBYTE emr_count; /*Keeps track (MOD4) of number of EMR messages sent*/
1179 UBYTE ba_index_idle; /*To store BA_INDEX used in Idle before going to Dedicated*/
1180 UBYTE new_ba_index;
1181 #endif
1182 } T_SC_DATA;
1183
1184 /*
1185 * cell reselection data of RR (during handover or hplmn search)
1186 */
1187 typedef struct
1188 {
1189 UBYTE ciph_on; /* ciphering status */
1190 UBYTE algo; /* cipher algorithm */
1191 UBYTE ch_mode; /* actual channel mode */
1192 T_chan_desc chan_desc; /* actual channel description */
1193 T_CR_WHITE_LIST cr_white_list; /* stores si2x temporarily during BCCH reading */
1194 T_CELL_DATA cd; /* cell data */
1195 T_multirate_conf amr_conf; /* MultiRate configuration */
1196 #if defined (REL99) && defined (TI_PS_FF_EMR)
1197 UBYTE ba_index; /* BA-IND received in BA(list) of SI-2*/
1198 #endif
1199
1200 } T_CR_DATA;
1201 #ifdef GPRS
1202 typedef enum
1203 {
1204 NORMAL_BCCH,
1205 EXTENDED_BCCH,
1206 SI13_NOT_PRESENT
1207 } T_SI13_LOC_IND;
1208 #endif
1209 /*
1210 * Neighbour cell data of RR
1211 */
1212
1213 /* DRAM Optimization: This structure is re-allign with 4 bytes
1214 * sothat will have minimum wastage */
1215 typedef struct
1216 {
1217 T_ctrl_chan_desc control_descr; /* Control Channel Description */
1218 T_cell_select select_para; /* Cell Selection Parameter */
1219 T_rach_ctrl rach; /* random control parameter */
1220 T_loc_area_ident lai; /* location area identification*/
1221
1222 ULONG avail_time; /* time ncell is available */
1223 ULONG c1_counter; /* measurement report counter */
1224 ULONG bcch_counter;
1225
1226 USHORT arfcn; /* channel number */
1227 SHORT c1; /* C1 Path Loss Criterion */
1228 SHORT c2; /* C2 Reselection Criterion */
1229 USHORT cell_id; /* cell identifier */
1230
1231 T_C2_PARAMETER c2_par; /* C2 Parameter for Calculation*/
1232 UBYTE rxlev; /* fieldstrength */
1233 UBYTE v_acs; /* read of sys info 7 & 8 */
1234 UBYTE c2_used; /* calculated c2 values */
1235
1236 UBYTE bcch_error; /* couter BCCH errors */
1237 UBYTE bcch_status; /* status of neighbour cell */
1238 UBYTE bsic; /* BSIC */
1239 UBYTE tnnn; /* 5 sec counter reselection */
1240
1241 SHORT c2_corr;
1242 #ifdef GPRS
1243 SHORT c31;
1244 SHORT c32;
1245 UBYTE c32_used;
1246 UBYTE v_cr_par;
1247 T_cr_par cr_par;
1248 #endif
1249
1250 #ifdef GPRS
1251 T_SI13_LOC_IND si13_loc_ind;
1252 #endif
1253
1254 #ifdef GPRS
1255 UBYTE rac; /* routing area color */
1256 #endif
1257
1258 #ifdef REL99
1259 UBYTE mscr_flag;
1260 #endif
1261
1262 } T_NC_DATA;
1263
1264 /*
1265 * Cell Selection Process Data
1266 */
1267 typedef struct
1268 {
1269 UBYTE max_arfcn; /* number of valid channels */
1270 UBYTE act_index; /* actual index */
1271 BOOL check_hplmn; /* check HPLMN */
1272 USHORT arfcn [MAX_CHANNELS]; /* channel number */
1273 UBYTE rxlev [MAX_CHANNELS]; /* fieldstrength */
1274 UBYTE attributes[MAX_CHANNELS]; /* attributes of channel */
1275 /* Bit 7 Bcch Info List Flag
1276 0 : not member of the BCCH info List
1277 1 : member of the BCCH info List
1278 Bit 6 Low Priority Flag
1279 0 : high priority flag
1280 1 : low priority flag
1281 Bit 5 Emergency Cell Flag
1282 0 : emergency services possible
1283 1 : emergency services not possible
1284 Bit 4 BCCH Detected Flag
1285 0 : BCCH not decoded
1286 1 : BCCH decoded
1287 Bit 3 BCCH Checked Flag
1288 0 : BCCH not checked
1289 1 : BCCH checked
1290 Bit 2 reserved
1291 Bit 1/0 Priority
1292 0 : low priority
1293 1 : middle priority
1294 2 : high priority
1295 */
1296 USHORT arfcn_sc;
1297 USHORT arfcn_cr;
1298 T_CS_BLACK_LIST black_list; /* Stores the black_list information */
1299 T_CS_WHITE_LIST white_list; /* Stores the white list information */
1300 U8 previous_search_mode; /* stores the previous search mode */
1301 U8 current_search_mode; /* stores the current search mode */
1302 U8 scan_mode; /* Identifies the scan mode */
1303 U8 initial_plmn_search; /* Identifies first FUNC_PLMN search */
1304 U8 black_list_search_pending;
1305 U8 region; /* This stores the region */
1306 BOOL all_freq_area; /* Identifies presence of both Euro and American coverage */
1307 T_plmn last_reg_plmn; /* Stores the last registered PLMN */
1308 } T_CS_DATA;
1309
1310 /* CSI-LLD Section 3.8
1311 * Dynamic configuration commands data
1312 */
1313 typedef struct
1314 {
1315 U32 tfast_cs_val; /* TFAST_CS timer value in minutes */
1316 U32 tnormal_cs_val; /* TNORMAL_CS timer value in minutes */
1317 U8 upper_rxlev_thr[MAX_NUM_BANDS]; /* Upper RxLev threshold */
1318 U8 medium_rxlev_thr[MAX_NUM_BANDS]; /* Medium RxLev threshold */
1319 U8 lower_rxlev_thr[MAX_NUM_BANDS]; /* Lower RxLev threshold */
1320 U8 bl_cs_en; /* Controls Black List search */
1321 U8 fcr; /* dynamic configuration, Fast Cell Recelection */
1322 U8 scr; /* dynamic configuration, Slow Cell Recelection */
1323 U8 fca; /* dynamic configuration, Failed Channel Assignment */
1324 U8 fho; /* dynamic configuration, Force Handover */
1325 U8 iho; /* dynamic configuration, lock the DUT to the cell it is already camping */
1326 U8 set_band; /* dynamic configuration, Frequency Band control */
1327 U8 no_sys_time; /* dynamic configuration, control time dependent random generation */
1328 S16 gsm_offset; /* dynamic configuration, offset to path loss criterium C1 */
1329 S16 dcs_offset; /* dynamic configuration, offset to path loss criterium C1 */
1330 U8 nkc; /* dynamic configuration, user specific, ciphering when no ciphering key available */
1331 T_TIME lim_ser_nps_delay;/* dynamic configuration, delay between Non parallel search in Lim ser in all freq area */
1332 #if defined(_SIMULATION_FFS_)
1333 T_shield_mcc mcc_shield; /* This structure contains the shielded MCC values*/
1334 #endif
1335 } T_DYNAMIC_CONFIG;
1336
1337 typedef struct
1338 {
1339 UBYTE state[MAX_STATE];
1340 T_MS_DATA ms_data;
1341 T_SC_DATA sc_data;
1342 T_CR_DATA cr_data;
1343 T_NC_DATA nc_data [NCELL_SIZE]; /* 0-5 = ncell, 6 = serving cell
1344 * 7 = cell reselection
1345 */
1346 T_CS_DATA cs_data;
1347 #ifdef GPRS
1348 T_GPRS_DATA gprs_data;
1349 T_LIST ba_ncell_list; /* Used to store Original BA list, when BA list is midified by PMO */
1350 #endif
1351 UBYTE lup_rxlev;
1352 UBYTE c1_offset;
1353 /*
1354 * primitive storing variables
1355 */
1356 T_PRIM *stored_prim [MAX_RR_STORED_PRIM];
1357 UBYTE stored_prim_in;
1358 UBYTE stored_prim_out;
1359 UBYTE stored_prim_read;
1360 UBYTE stored_prim_write;
1361 /*
1362 * must be checked ...
1363 */
1364 UBYTE old_serving_cell;
1365 USHORT old_cell_id;
1366 T_loc_area_ident old_lai;
1367 UBYTE page_identity_type;
1368 USHORT power_on_low;
1369 USHORT power_on_high;
1370 USHORT rel_cause;
1371 USHORT dcch_stop_cause;
1372 UBYTE reselect_index;
1373 UBYTE repeat_est;
1374 UBYTE t_running[NUM_OF_RR_TIMERS];
1375 void (*t_expire[NUM_OF_RR_TIMERS])(void);
1376 UBYTE treg_pending;
1377 UBYTE tch_loop_subch;
1378 UBYTE used_channel_ref[MAX_RACH_REQ];
1379 T_frame_no used_frame_no[MAX_RACH_REQ];
1380 UBYTE bcch_error;
1381
1382 UBYTE pag_rec;
1383 UBYTE imm_ass_rej_rec;
1384 EF_MSCAP mscap;
1385 USHORT act_ncell_list [MAX_NEIGHBOURCELLS];
1386 UBYTE ncell_mb;
1387 UBYTE start_cell_reselection;
1388 UBYTE first_meas_received;
1389 UBYTE mode_after_dedi; /* MODE_CELL_RESELECTION or MODE_CELL_SELECTION or MODE_CELL_CHANGE_ORDER*/
1390 BOOL net_lost; /* a RLF Radio Link Failure or DSF Downlink Signalling Failure has occured */
1391 USHORT found_channel; /* ARFCN of requested PLMN (obtained from 'previous' Cell Selection data) */
1392 UBYTE ba_id; /* BA identifier used with Neighbour Cell Measurement */
1393
1394 #if defined FF_EOTD
1395 USHORT eotd_req_id; /* indicate explicit position measurement requests */
1396 T_APPLIC_RX applic_rx; /* Application Information transfer */
1397 #endif /* FF_EOTD */
1398
1399 UBYTE emo_seq; /* EMO sequence number */
1400 UBYTE c_emo_arfcn; /* number of elements in emo_arfcn */
1401 USHORT *emo_arfcn; /* request list of EMO ARFCNs */
1402
1403 UBYTE resel_pending; /* cell reselection was deferred */
1404 UBYTE c_ncell_bcch; /* # of outstanding ncell BCCH info. Default=NOT_INITIALISED */
1405 UBYTE cell_test_operation; /* dynamic configuration, as defined in TS 11.11, section 10.3.18 EFAD (Administrative data) */
1406 T_DYNAMIC_CONFIG dyn_config; /* Holds dynamic configuration data */
1407 #ifdef GPRS
1408 U8 old_rac; /* Holds old Routing area code */
1409 #endif
1410 BOOL cr_treselect_exp; /* Flag to indicate whether cell reselection after TRESELECT
1411 * expiry waiting for SI2TER is suceesfull or not */
1412 BOOL use_stored_entries; /* Use stored entries after end of transition */
1413 } T_RR_DATA;
1414
1415 typedef struct
1416 {
1417 USHORT l_f;
1418 USHORT o_f;
1419 UBYTE b_f[32];
1420 } T_f_range;
1421
1422
1423 /*
1424 * Used for requesting location information from RR for proactive polling in sim
1425 */
1426 typedef struct
1427 {
1428 /*lint -esym(768,stk_class) : not referenced */
1429 /*lint -esym(768,stk_subclass) */
1430 /*lint -esym(768,stk_type) */
1431 UBYTE stk_class;
1432 UBYTE stk_subclass;
1433 UBYTE stk_type;
1434 UBYTE stk_length;
1435 UBYTE stk_parameter [MAX_STK_LENGTH];
1436 } stk_data_type;
1437
1438 /*==== EXPORT =====================================================*/
1439
1440 /*
1441 * Prototypes Timer
1442 */
1443 /*
1444 * If all entities are linked into one module this definitions
1445 * prefixes all this functions with the enity name
1446 */
1447
1448 #ifdef OPTION_MULTITHREAD
1449 #define tim_exec_timeout _ENTITY_PREFIXED(tim_exec_timeout)
1450 #define tim_start_timer _ENTITY_PREFIXED(tim_start_timer)
1451 #define tim_stop_timer _ENTITY_PREFIXED(tim_stop_timer)
1452 #if defined(TIMER_TRACE)
1453 #define tim_check_timer _ENTITY_PREFIXED(tim_check_timer)
1454 #endif /* TIMER_TRACE */
1455 #endif /* OPTION_MULTITHREAD*/
1456 EXTERN void tim_exec_timeout (USHORT index);
1457 EXTERN void tim_start_timer (USHORT index, T_TIME value);
1458 EXTERN void tim_stop_timer (USHORT index);
1459 #if defined(TIMER_TRACE)
1460 EXTERN BOOL tim_check_timer(USHORT index);
1461 #endif /* TIMER_TRACE */
1462
1463 EXTERN void tim_t3110 (void);
1464 EXTERN void tim_t3122 (void);
1465 EXTERN void tim_t3126 (void);
1466 EXTERN void tim_treselect (void);
1467 EXTERN void tim_treg (void);
1468 EXTERN void tim_ext_meas (void);
1469 #if defined FF_EOTD
1470 EXTERN void tim_apdu (void);
1471 #endif /* FF_EOTD */
1472 EXTERN void tim_tnnn (void);
1473 EXTERN void set_tnnn (int index,
1474 USHORT value);
1475 EXTERN void reset_tnnn (int index);
1476 EXTERN int is_tnnn (int index);
1477 EXTERN void tim_tabort (void);
1478 EXTERN void tstart_tabort (USHORT val);
1479 EXTERN void tim_reset_registration_timer(void);
1480 EXTERN void tim_plmn_search_expiry (void);
1481 EXTERN void tim_tnormal_cs (void);
1482 EXTERN void tim_tfast_cs (void);
1483
1484 /*
1485 * Prototypes Customer Specific Functions
1486 */
1487
1488 /*
1489 * Cell Selection
1490 */
1491 EXTERN void cs_init_process (void);
1492 EXTERN void cs_set_all (void);
1493 EXTERN void cs_start_scan (void);
1494 EXTERN void cs_start_sync (void);
1495 EXTERN void cs_del_list (T_LIST * list);
1496 EXTERN void cs_set_list (T_LIST * list);
1497 EXTERN UBYTE cs_def_list (UBYTE attribute);
1498 EXTERN BOOL cs_sync_next (void);
1499 EXTERN void cs_set_null (void);
1500 EXTERN void cs_set_attributes (UBYTE attribute,
1501 USHORT arfcn);
1502 EXTERN void cs_set_rxlev (UBYTE rxlev, USHORT arfcn);
1503 EXTERN void cs_clear_attributes (UBYTE attribute, USHORT arfcn);
1504 EXTERN void cs_mph_power_cnf (T_MPH_POWER_CNF * mph_power_cnf);
1505 EXTERN void cs_mph_bsic_cnf (T_MPH_BSIC_CNF * mph_bsic_cnf);
1506 EXTERN void cs_set_stop_active (void);
1507 EXTERN void cs_set_bcch_info (T_bcch_info * sim_bcch_info);
1508 EXTERN void cs_get_channel_from_found_list (void);
1509 EXTERN void cs_clear_channel_from_found_list (void);
1510 EXTERN UBYTE cs_get_freq_band (UBYTE pch_interrupt);
1511 EXTERN void cs_clear_white_list(U8 clr_bcch_info);
1512
1513 /* CSI-LLD section:4.1.1.5 */
1514 GLOBAL void cs_store_black_list(void);
1515 GLOBAL void cs_add_to_black_list(U8 region,U16 arfcn,U8 rxlev);
1516 GLOBAL void cs_del_from_black_list(U8 region,U16 arfcn);
1517 GLOBAL void cs_clear_black_list(U8 erase_type);
1518 GLOBAL void cs_remove_BA_MA_from_black_list(U8 region,T_LIST *source_list);
1519 GLOBAL void cs_update_black_list(void);
1520 EXTERN U8 cs_get_new_search_mode(void);
1521 EXTERN void cs_handle_search_mode_timer(U8 search_mode);
1522 GLOBAL void cs_rem_inactive_carriers_from_bl(T_MPH_POWER_CNF * mph_power_cnf);
1523 GLOBAL BOOL cs_check_region(U8 region);
1524 GLOBAL BOOL cs_check_arfcn_range(U16 arfcn);
1525 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1526 GLOBAL UBYTE cs_get_band_index(USHORT arfcn);
1527 #endif
1528
1529 /*
1530 * RR Attachment
1531 */
1532
1533 /*
1534 * attachment primitives
1535 */
1536 EXTERN void att_mph_error_ind (T_MPH_ERROR_IND * mph_error_ind);
1537 EXTERN void att_mph_measurement_ind (T_MPH_MEASUREMENT_IND * mph_measurement_ind);
1538 EXTERN void dat_mph_emo_meas_ind (T_MPH_EMO_MEAS_IND * mph_emo_meas_ind);
1539 EXTERN void att_rr_activate_req (T_RR_ACTIVATE_REQ * rr_activate_req);
1540 EXTERN void att_rr_deactivate_req (T_RR_DEACTIVATE_REQ * rr_deactivate_req);
1541 EXTERN void att_rr_sync_req (T_RR_SYNC_REQ * rr_sync_req);
1542 EXTERN void att_mph_sync_ind (T_MPH_SYNC_IND * mph_sync_ind);
1543 EXTERN void att_mph_meas_order_cnf (T_MPH_MEAS_ORDER_CNF * mph_meas_order_cnf);
1544 EXTERN void att_rr_sync_hplmn_req (T_RR_SYNC_HPLMN_REQ * rr_sync_hplmn_req);
1545 EXTERN void att_mph_stop_dedicated_cnf (T_MPH_STOP_DEDICATED_CNF * mph_stop_dedi_cnf);
1546 #ifdef GPRS
1547 EXTERN void att_mph_meas_rep_cnf (T_MPH_MEAS_REP_CNF * mph_meas_rep_cnf);
1548 EXTERN void att_mph_ext_meas_cnf (T_MPH_EXT_MEAS_CNF * mph_ext_meas_cnf);
1549 EXTERN void att_ext_meas_end (BOOL destory_rrgrr_ext_meas_cnf);
1550 EXTERN void att_ext_meas_next_bsic (void);
1551 #endif
1552 #if defined FF_EOTD
1553 EXTERN void att_mph_ncell_pos_ind (T_MPH_NCELL_POS_IND * mph_ncell_pos_ind);
1554 #endif /* FF_EOTD */
1555 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1556 EXTERN void att_mph_init_rr_ind (T_MPH_INIT_RR_IND * mph_init_rr_ind);
1557 #endif
1558
1559
1560 /*
1561 * attachment signalling
1562 */
1563 EXTERN void att_dat_dedicated (void);
1564 EXTERN void att_dat_con_est (void);
1565 EXTERN void att_for_sysinfo_type1 (USHORT arfcn,
1566 T_D_SYS_INFO_1 *sys_info_1,
1567 T_LIST *cell_chan_desc);
1568
1569
1570
1571 EXTERN void att_for_sysinfo_type2_2bis (USHORT arfcn,
1572 T_VOID_STRUCT *sys_info_2_2bis,
1573 T_LIST *new_2_2bis_list,
1574 UBYTE ncell_ext,
1575 T_SI_TYPE si_type);
1576
1577
1578 EXTERN void att_for_sysinfo_type2ter (USHORT arfcn,
1579 T_D_SYS_INFO_2TER *sys_info_2ter,
1580 T_LIST *new_2ter_list);
1581 EXTERN void att_for_sysinfo_type3 (USHORT arfcn,
1582 T_D_SYS_INFO_3 *sys_info_3);
1583 EXTERN void att_for_sysinfo_type4 (USHORT arfcn,
1584 T_D_SYS_INFO_4 *sys_info_4);
1585
1586
1587
1588 EXTERN void att_for_sysinfo_type5_5bis (USHORT arfcn,
1589 T_LIST *new_5_5bis_list,
1590 UBYTE old_index,
1591 UBYTE ncell_ext,
1592 T_SI_TYPE si_type);
1593
1594
1595
1596 EXTERN void att_for_sysinfo_type5ter (USHORT arfcn,
1597 T_LIST *new_5ter_list);
1598 EXTERN void att_for_sysinfo_type6 (USHORT arfcn,
1599 T_D_SYS_INFO_6 *sys_info_6);
1600 EXTERN void att_for_sysinfo_type7_8 (USHORT arfcn,
1601 T_D_SYS_INFO_8 *sys_info_8);
1602 EXTERN void att_bsic_ind (USHORT arfcn,
1603 UBYTE rxlev,
1604 UBYTE bsic);
1605 EXTERN void att_no_bsic_ind (void);
1606 /*
1607 * attachment procedures
1608 */
1609 EXTERN UBYTE att_get_index (USHORT arfcn);
1610
1611 enum forbidden_list_type_e
1612 {
1613 FORBIDDEN_LIST_NORMAL,
1614 FORBIDDEN_LIST_ROAMING
1615 };
1616 EXTERN void att_add_to_forb_list (int list_type,
1617 const T_plmn *plmn,
1618 USHORT lac);
1619 EXTERN void att_analyze_measure_report (T_MPH_MEASUREMENT_IND *report);
1620 EXTERN void att_bcch_status_to_decoded (UBYTE index);
1621 EXTERN void att_bits_to_byte (UBYTE *num,
1622 UBYTE size,
1623 UBYTE *bits);
1624 #ifdef REL99
1625 EXTERN void att_config_cbch (void);
1626 #else
1627 EXTERN void att_build_cbch (void);
1628 #endif
1629 EXTERN void att_build_classmark_req (void);
1630 EXTERN void att_build_idle_req (UBYTE index,
1631 UBYTE mode);
1632 EXTERN void att_calculate_c1 (UBYTE index);
1633
1634 GLOBAL BOOL att_cell_barred_status_cr_no_cr (UBYTE index);
1635
1636 EXTERN void att_check_bcch_carrier (void);
1637 EXTERN void att_check_bcch_carrier_si (void);
1638 EXTERN void att_check_neighbourcell (void);
1639 EXTERN void att_check_neighbourcell_si_reestab (void);
1640 EXTERN void att_check_fplmn_cell (void);
1641 EXTERN void att_check_reselect_decision (UBYTE start_now);
1642 EXTERN void att_check_barred_status_in_idle (void);
1643 EXTERN UBYTE att_check_network (T_loc_area_ident *lai);
1644 EXTERN void att_clear_registration_data (void);
1645 EXTERN void att_clear_reg_without_imsi (void);
1646 EXTERN void att_code_mph_ncell_req (UBYTE index);
1647 EXTERN void att_code_mph_ncell_req_dedicated (void);
1648
1649 EXTERN void att_code_rr_abort_ind_original (T_RR_DATA *rr_data, USHORT cause);
1650 EXTERN void att_code_net_lost (void);
1651 EXTERN void att_code_rr_act_cnf (void);
1652 EXTERN void att_code_rr_act_ind (void);
1653 EXTERN void att_continue_cell_reselect (void);
1654
1655 EXTERN void att_copy_sys_info_1_par (UBYTE index,
1656 T_D_SYS_INFO_1 *sys_info_1,
1657 T_LIST *cell_chan_desc);
1658 EXTERN void att_copy_sys_info_2_par (UBYTE index,
1659 T_D_SYS_INFO_2 *sys_info_2,
1660 T_LIST *new_2_list,
1661 UBYTE ncell_ext,
1662 UBYTE indicate_changes);
1663 EXTERN void att_copy_sys_info_2bis_par (UBYTE index,
1664 T_D_SYS_INFO_2BIS *sys_info_2bis,
1665 T_LIST *new_2bis_list,
1666 UBYTE ncell_ext,
1667 UBYTE indicate_changes);
1668 EXTERN void att_copy_sys_info_2ter_par (UBYTE index,
1669 T_D_SYS_INFO_2TER *sys_info_2ter,
1670 T_LIST *new_2ter_list,
1671 UBYTE indicate_changes);
1672 EXTERN void att_copy_sys_info_3_par (UBYTE index,
1673 T_D_SYS_INFO_3 *sys_info_3,
1674 UBYTE indicate_changes);
1675 EXTERN void att_copy_sys_info_4_par (UBYTE index,
1676 T_D_SYS_INFO_4 *sys_info_4,
1677 UBYTE indicate_changes);
1678 EXTERN void att_copy_sys_info_7_8_par (UBYTE index,
1679 T_D_SYS_INFO_8 *sys_info_8);
1680 EXTERN void att_copy_c2_parameter_si4 (UBYTE index,
1681 T_si4_rest_oct *rest_oct);
1682
1683
1684 EXTERN void att_handle_rr_act_req (UBYTE initial_act,
1685 T_RR_ACTIVATE_REQ *rr_activate_req);
1686 EXTERN void att_increase_power_on_time (USHORT inc);
1687 EXTERN void att_init_cell_selection (UBYTE selection,
1688 BOOL initiator);
1689 EXTERN void att_init_gsm_data (void);
1690 EXTERN void att_init_pl_status (void);
1691 EXTERN SHORT att_max (SHORT a,
1692 SHORT b);
1693 EXTERN T_FOUND_ELEMENT *att_plmn_in_found_list (UBYTE *mcc,
1694 UBYTE *mnc);
1695 EXTERN void att_save_found_plmn (T_FOUND_ELEMENT *element,
1696 UBYTE mcc[],
1697 UBYTE mnc[],
1698 USHORT arfcn,
1699 UBYTE rxlev,
1700 USHORT lac,
1701 UBYTE cell_ok);
1702
1703 EXTERN void att_remove_bad_ncell (T_MPH_MEASUREMENT_IND *report);
1704 EXTERN void att_reset_old_lai_rac();
1705 EXTERN void att_copy_old_lai_rac (U8 index);
1706 #if defined(_SIMULATION_FFS_)
1707 GLOBAL UBYTE rr_csf_mcc_present (UBYTE* mcc_value);
1708 #endif
1709 EXTERN void att_clean_buf (USHORT si_to_clean);
1710 EXTERN void att_remove_bad_rr_data_ncells(void);
1711 EXTERN void att_rem_lai_from_forb_list (const T_plmn *plmn,
1712 USHORT lac);
1713 EXTERN void att_set_pl_in_idle_mode (void);
1714 EXTERN void att_set_sys_info_read (USHORT mess_bit,
1715 UBYTE index);
1716 EXTERN void att_start_cell_reselection (UBYTE mode);
1717 EXTERN void att_start_cr_in_pl (UBYTE index);
1718 EXTERN void att_start_cell_selection (BOOL originator, BOOL parallel, U8 search_mode);
1719
1720
1721 EXTERN void att_remove_multiple_channels(void);
1722 EXTERN void att_mph_identity_req (void);
1723 EXTERN void att_start_registration_timer(void);
1724 EXTERN void att_set_func (UBYTE func);
1725
1726
1727 EXTERN void att_copy_cr_data (void);
1728 EXTERN void att_init_cr_data (void);
1729
1730
1731
1732
1733 EXTERN void att_check_reestablishment (void);
1734 EXTERN UBYTE att_get_power (void);
1735 EXTERN void att_return_to_idle (void);
1736 EXTERN void att_notify_stop_plmn_search (UBYTE deactivate_pl);
1737 EXTERN void att_leave_dat_imm_ass (void);
1738 EXTERN void att_leave_dedicated (void);
1739 EXTERN void att_stop_dedicated (void);
1740 EXTERN void att_copy_eplmn_list (T_eq_plmn_list *eq_plmn_list);
1741 EXTERN void att_store_plmn_in_found_list (T_loc_area_ident *lai);
1742 #if defined (REL99) && defined (TI_PS_FF_EMR)
1743 EXTERN void attf_send_enh_para_to_alr (UBYTE rep_type,T_enh_para_struct *p_src);
1744 #ifdef GPRS
1745 EXTERN void att_send_enh_para_to_grr(T_rr_enh_para *p_src);
1746 #endif
1747 #endif
1748
1749 #if !defined(NTRACE)
1750 /* Implements Measure#32: Row 52, 53, 124 & 125 */
1751 EXTERN void att_print_mcc_mnc (USHORT arfcn,
1752 UBYTE *mcc,
1753 UBYTE *mnc,
1754 T_S2I_STRING titel); /* a valid string is expected */
1755 #else
1756 #define att_print_mcc_mnc(arfcn,mcc,mnc,titel)
1757 #endif /* !NTRACE */
1758 EXTERN void att_check_dynamic_search_mode_config(void);
1759 EXTERN void att_full_service_found(void);
1760 EXTERN void att_set_rr_service_info(void);
1761 EXTERN void att_set_tim_advance_info (void);
1762 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1763 EXTERN void att_update_std_band_indicator (UBYTE band_indicator);
1764 #endif
1765
1766
1767 /*
1768 * Data-Transfer
1769 */
1770
1771 /*
1772 * data-transfer primitives
1773 */
1774 EXTERN void dat_init_rr_data (void);
1775 EXTERN void dat_dl_establish_cnf (T_DL_ESTABLISH_CNF *dl_establish_cnf);
1776 EXTERN void dat_dl_establish_ind (T_DL_ESTABLISH_IND *dl_establish_ind);
1777 EXTERN void dat_mph_random_access_cnf (T_MPH_RANDOM_ACCESS_CNF *mph_random_access_cnf);
1778 EXTERN void dat_dl_release_cnf (T_DL_RELEASE_CNF *dl_release_cnf);
1779 EXTERN void dat_dl_release_ind (T_DL_RELEASE_IND *dl_release_ind);
1780 EXTERN void dat_mph_dedicated_cnf (T_MPH_DEDICATED_CNF *mph_dedicated_cnf);
1781 EXTERN void dat_mph_dedicated_fail_cnf (T_MPH_DEDICATED_FAIL_CNF *mph_dedicated_fail_cnf);
1782 EXTERN void dat_rr_abort_req (T_RR_ABORT_REQ *rr_abort_req);
1783 EXTERN void dat_rr_data_req (T_RR_DATA_REQ *rr_data_req);
1784 EXTERN void dat_rr_establish_req (T_RR_ESTABLISH_REQ *rr_establish_req);
1785 EXTERN void dat_mph_paging_ind (T_MPH_PAGING_IND *mph_paging_ind);
1786 EXTERN void dat_begin_start_immediate_assign (UBYTE id_type, UBYTE chan_need);
1787 #if defined FF_EOTD
1788 EXTERN void dat_rrlc_meas_req (T_RRLC_MEAS_REQ *rrlc_meas_req);
1789 EXTERN void dat_rrrrlp_data_req (T_RRRRLP_DATA_REQ *rrrrlp_data_req);
1790 #endif /* FF_EOTD */
1791 #if defined (REL99) && defined (TI_PS_FF_EMR)
1792 EXTERN void dat_update_emr_rep_para (T_emp *p_em, T_enh_para_struct *p_enh);
1793 #endif
1794
1795 /*
1796 * data-transfer signalling
1797 */
1798 EXTERN void dat_att_cell_selected (void);
1799 EXTERN void dat_att_null (void);
1800 EXTERN void dat_for_assign_cmd (T_DL_DATA_IND *dl_data_ind,
1801 T_D_ASSIGN_CMD *assign_cmd,
1802 T_LIST *hop_list_after,
1803 T_LIST *hop_list_before,
1804 T_LIST *cell_chan_desc);
1805 EXTERN void dat_for_chan_mod (T_DL_DATA_IND *dl_data_ind,
1806 T_D_CHAN_MOD *chan_mod);
1807 EXTERN void dat_for_chan_rel (T_DL_DATA_IND *dl_data_ind,
1808 T_D_CHAN_REL *chan_rel);
1809 #ifdef REL99
1810 EXTERN void dat_for_class_enq (T_DL_DATA_IND *dl_data_ind,
1811 T_D_CLASS_ENQ *class_enq);
1812 #else
1813 EXTERN void dat_for_class_enq (T_DL_DATA_IND *dl_data_ind);
1814 #endif
1815 EXTERN void dat_for_close_loop_cmd (T_DL_DATA_IND *dl_data_ind,
1816 UBYTE subchannel);
1817 EXTERN void dat_for_ciph_cmd (T_DL_DATA_IND *dl_data_ind,
1818 T_D_CIPH_CMD *ciph_cmd);
1819 EXTERN void dat_for_freq_redef (T_DL_DATA_IND *dl_data_ind,
1820 T_D_FREQ_REDEF *freq_redef,
1821 T_LIST *cell_chan_desc);
1822 EXTERN void dat_for_handov_cmd (T_DL_DATA_IND *dl_data_ind,
1823 T_D_HANDOV_CMD *handov_cmd,
1824 T_LIST *cell_chan_desc,
1825 T_LIST *hop_list_after,
1826 T_LIST *hop_list_before);
1827 EXTERN void dat_for_l3_data_ind (T_DL_DATA_IND *dl_data_ind);
1828 EXTERN void dat_for_open_loop_cmd (T_DL_DATA_IND *dl_data_ind);
1829 EXTERN void dat_for_test_interface (T_DL_DATA_IND *dl_data_ind,
1830 UBYTE device);
1831 EXTERN void dat_for_imm_assign (T_MPH_UNITDATA_IND *mph_unitdata_ind,
1832 T_D_IMM_ASSIGN *imm_assign);
1833 EXTERN void dat_for_imm_assign_ext (T_MPH_UNITDATA_IND *mph_unitdata_ind,
1834 T_D_IMM_ASSIGN_EXT *imm_assign_ext);
1835 EXTERN void dat_for_imm_assign_rej (T_D_IMM_ASSIGN_REJ *imm_assign_rej);
1836
1837 EXTERN void dat_for_ext_meas_order (T_D_EXT_MEAS_ORDER *ext_meas_order);
1838 #if defined FF_EOTD
1839 EXTERN void rr_applic_rx_init (T_APPLIC_RX *applic_rx);
1840 EXTERN void dat_for_applic_info (T_B_APPLIC_INFO *b_applic_info);
1841 #endif /* FF_EOTD */
1842 GLOBAL void dat_class_chng_data_req (void);
1843 GLOBAL BOOL dat_hplmn (const UBYTE *mcc, const UBYTE *mnc);
1844 #if defined (REL99) && defined (TI_PS_FF_EMR)
1845 EXTERN BOOL dat_for_meas_inf (T_D_MEAS_INF *p_mi);
1846 #endif
1847
1848 /*
1849 * data-transfer procedures
1850 */
1851 EXTERN BOOL dat_access_allowed (USHORT estcs);
1852 EXTERN UBYTE dat_calc_downlink_timeout (UBYTE index);
1853 EXTERN UBYTE dat_calc_paging_group (UBYTE index);
1854 EXTERN UBYTE dat_calc_tn (UBYTE index);
1855 EXTERN BOOL dat_check_error_flag (BOOL send_rr_status);
1856 EXTERN void dat_code_channel_mode_to_mm (void);
1857 EXTERN void dat_code_reestablishment_fail (void);
1858 EXTERN void dat_code_ciphering_to_mm (UBYTE ciph_on);
1859 EXTERN void dat_code_measure_report (T_MPH_MEASUREMENT_IND *report);
1860 EXTERN void dat_code_ext_meas_report (T_MPH_EMO_MEAS_IND *mph_emo_meas_ind);
1861 EXTERN void dat_emo_stop (BOOL send_ncell_req);
1862
1863
1864 EXTERN void dat_code_mph_chan_mode_req (T_D_CHAN_MOD *chan_mod);
1865 EXTERN void dat_code_mph_ciphering_req (UBYTE ciph_on,
1866 UBYTE algo,
1867 UBYTE *kc);
1868 EXTERN void dat_code_mph_imm_assign_req (T_start *start,
1869 UBYTE power,
1870 UBYTE maio,
1871 T_LIST *hop_list_after,
1872 T_LIST *hop_list_bef);
1873 EXTERN void dat_code_sys_info_change (UBYTE dtx,
1874 UBYTE pwrc,
1875 UBYTE rlt);
1876 EXTERN void dat_code_mph_freq_redef_req (T_start *start,
1877 T_LIST *hop_list);
1878 EXTERN void dat_code_mph_old_chan_req (void);
1879 EXTERN void dat_code_prr_channel (UBYTE *ch_type,
1880 UBYTE *sapi,
1881 UBYTE chan_type);
1882 EXTERN void dat_code_prr_channel_sms (T_DL_DATA_REQ *dl_data_req,
1883 UBYTE chan_type);
1884 EXTERN void dat_code_prr_bcch_info (UBYTE v_ba_range,
1885 T_ba_range *ba_range);
1886 EXTERN BOOL dat_compare_request_ref (T_req_ref *req_ref,
1887 UBYTE *index);
1888 EXTERN void dat_disconnect_link (USHORT cause);
1889 EXTERN BOOL dat_forb_lai_check (UBYTE index);
1890 EXTERN BOOL dat_roam_forb_lai_check (UBYTE index);
1891
1892 EXTERN BOOL dat_plmn_equal_req (const UBYTE *bcch_mcc,
1893 const UBYTE *bcch_mnc,
1894 const UBYTE *sim_mcc,
1895 const UBYTE *sim_mnc);
1896
1897 EXTERN USHORT dat_random (USHORT n);
1898 EXTERN void dat_release_connection (void);
1899 EXTERN void dat_set_last_used_channel (T_chan_desc *chan_desc);
1900 EXTERN void dat_start_immediate_assign (USHORT cause);
1901 EXTERN void dat_start_sabm (void);
1902 EXTERN BOOL dat_test_sim_available (void);
1903 EXTERN BOOL dat_check_sim_available (void);
1904 EXTERN void dat_vsd_bit_set (T_L3_SDU *m_buf,
1905 UBYTE action);
1906 EXTERN void dat_send_bcchinfo_mm (U8 *p);
1907 EXTERN void dat_convert_white_list (void);
1908 EXTERN void dat_store_neigh_cell_desc (U8 si, U8 index, BUF_neigh_cell_desc *cd,
1909 T_LIST *new_neigh_list);
1910
1911 EXTERN void dat_begin_start_immediate_assign (UBYTE id_type, UBYTE chan_need);
1912 EXTERN void dat_rr_release_ind (USHORT relcs, UBYTE sapi);
1913 EXTERN void dat_send_release_ind (USHORT relcs);
1914 EXTERN void dat_send_assign_fail_msg (UBYTE cause);
1915 EXTERN void dat_send_rr_status_msg (UBYTE cause);
1916 EXTERN void dat_send_handov_fail_msg (UBYTE cause);
1917 #if defined (REL99) && defined (TI_PS_FF_EMR)
1918 EXTERN void dat_code_enh_measure_report (T_MPH_MEASUREMENT_IND *report);
1919 #endif
1920
1921 #if defined (TI_PS_FF_RTD) AND defined (REL99)
1922 EXTERN void dat_update_rtd_data (T_D_MEAS_INF *p_mi,T_rr_enh_para *p_temp);
1923 EXTERN void dat_update_common_rtd_struct (T_rtdd *rtdd_struct,T_rr_enh_para *p_temp);
1924 #endif /* #if defined (TI_PS_FF_RTD) AND defined (REL99) */
1925 /*
1926 * Formatter
1927 */
1928
1929 /*
1930 * formatter primitives
1931 */
1932 EXTERN void for_mph_unitdata_ind (T_MPH_UNITDATA_IND *mph_unitdata_ind);
1933 EXTERN void for_dl_data_ind (T_DL_DATA_IND *dl_data_ind);
1934 #if defined (REL99) && defined (TI_PS_FF_EMR)
1935 EXTERN void for_dl_short_unitdata_ind (T_DL_SHORT_UNITDATA_IND *dl_short_unitdata_ind);
1936 #endif
1937 EXTERN void for_rr_trace_message (UBYTE *payload,
1938 USHORT length,
1939 USHORT arfcn,
1940 ULONG fn,
1941 UBYTE direction);
1942 /*
1943 * formatter signalling
1944 */
1945 EXTERN void for_dat_data_req (T_DL_DATA_REQ *data_req);
1946 EXTERN void for_dat_est_req (T_DL_ESTABLISH_REQ *est_req);
1947 EXTERN void for_dat_est_req_not_coding (T_DL_ESTABLISH_REQ *est_req);
1948 EXTERN void for_dat_est_req_content (T_DL_ESTABLISH_REQ *est_req_content);
1949 EXTERN void for_dat_l3_data_req (T_DL_DATA_REQ *dl_data_req);
1950 EXTERN void for_dat_reconnect_req (T_DL_RECONNECT_REQ *reconnect_req);
1951 EXTERN void for_dat_resume_req (T_DL_RESUME_REQ *resume_req);
1952 EXTERN void for_dat_unitdata_req (T_DL_UNITDATA_REQ *unitdata_req);
1953 #if defined (REL99) && defined (TI_PS_FF_EMR)
1954 EXTERN void for_update_ba_ind (UBYTE index, UBYTE ba_ind);
1955 EXTERN void for_check_and_configure_si2quater (UBYTE index);
1956 EXTERN void for_att_update_ba2bsic_mapping (T_rr_enh_para *p_enh);
1957 EXTERN BOOL for_dat_process_common_emr_data (T_gprs_rep_prio *p_rep,
1958 T_gprs_bsic *p_bl,
1959 UBYTE msg_index,
1960 BOOL ba_available);
1961 EXTERN void for_dat_spd_unitdata_req (T_DL_SHORT_UNITDATA_REQ *p_msg);
1962 #endif
1963
1964 /*
1965 * formatter procedures
1966 */
1967 EXTERN void for_check_assign_cmd (T_DL_DATA_IND *dl_data_ind,
1968 T_D_ASSIGN_CMD *ass_cmd);
1969 EXTERN BOOL for_check_ba_range (T_ba_range *ba_range);
1970 EXTERN void for_check_cell_descr (T_cell_desc *cell_desc);
1971 EXTERN void for_check_channel_descr (T_chan_desc *chan_desc);
1972 EXTERN void for_check_channel_mode (UBYTE ch_mod);
1973 EXTERN void for_check_multirate_conf (T_multirate_conf * multirate_conf, UBYTE chan_type);
1974 EXTERN void for_check_cipher_mode_set (T_ciph_mode_set *ciph);
1975 EXTERN void for_check_handov_cmd (T_DL_DATA_IND *dl_data_ind,
1976 T_D_HANDOV_CMD *handov_cmd);
1977 EXTERN void for_create_channel_list (T_f_range *f_range,
1978 T_LIST *cha_list);
1979
1980 EXTERN void for_suspend_layer_2 (void);
1981 #if defined (REL99) && defined (TI_PS_FF_EMR)
1982 EXTERN BOOL for_process_si2quater(T_si_2qua_octets *p_si2q);
1983 EXTERN void for_update_emr_rep_para(T_si_2qua_octets *p_si2q,T_rr_enh_para *p_em);
1984 EXTERN void for_set_default_emr_data(T_rr_enh_para *p_em);
1985 EXTERN void for_send_enh_para(T_rr_enh_para *p_src);
1986 EXTERN BOOL for_update_enh_cell_list (USHORT *p_list);
1987 EXTERN BOOL for_process_common_emr_data (T_gprs_rep_prio *p_rep,
1988 T_gprs_bsic *p_bsic,
1989 UBYTE msg_index,
1990 BOOL ba_available);
1991 EXTERN void for_mon_si2quater_req(UBYTE action);
1992 #endif
1993
1994 #if defined (TI_PS_FF_RTD) AND defined (REL99)
1995 EXTERN void for_store_rtd_data (T_si_2qua_octets *p_si2q,T_rr_enh_para *p_temp);
1996 #endif /* #if defined (TI_PS_FF_RTD) AND defined (REL99) */
1997
1998
1999 /*
2000 * If all entities are linked into one module this definitions
2001 * prefixes all this functions with the enity name
2002 */
2003 #ifdef OPTION_MULTITHREAD
2004 #define for_set_content_error _ENTITY_PREFIXED(for_set_content_error)
2005 #endif
2006
2007 EXTERN UBYTE for_check_frequency (USHORT channel);
2008 EXTERN void for_set_content_error (UBYTE value);
2009
2010 EXTERN void rr_csf_read_imei (T_mob_ident *imei);
2011
2012 /*----------------------------------------------------------------------
2013 * functions called from other entities
2014 *---------------------------------------------------------------------*/
2015 /*lint -esym(759,rr_csf_get_radio_access_capability)*/
2016 /*lint -esym(759,rr_csf_get_classmark1)*/
2017 /*lint -esym(759,rr_csf_get_classmark2)*/
2018 /*lint -esym(759,rr_csf_get_rf_capability)*/
2019 #ifdef GPRS
2020 EXTERN UBYTE rr_csf_get_radio_access_capability
2021 (T_ra_cap *ra_cap);
2022 #endif
2023 EXTERN UBYTE rr_csf_get_classmark1 (T_mob_class_1 *mob_class_1);
2024 EXTERN UBYTE rr_csf_get_classmark2 (T_mob_class_2 *mob_class_2);
2025 EXTERN T_rf_cap* rr_csf_get_rf_capability (void);
2026
2027
2028 EXTERN UBYTE rr_csf_fit_capability (void);
2029 EXTERN void rr_csf_ms_cap (void);
2030 EXTERN void rr_csf_read_rfcap (void);
2031 EXTERN void rr_csf_check_rfcap (UBYTE init);
2032 EXTERN void rr_csf_get_freq_bands (UBYTE *pfreq_bands);
2033 GLOBAL void rr_csf_trace_power (void);
2034
2035 #ifdef REL99
2036 /*
2037 * Function added to get MSCR flag informaion that used in send sequence number
2038 */
2039 EXTERN void get_msc_release_version(UBYTE* mscr);
2040 #endif
2041
2042 #if defined(_SIMULATION_FFS_)
2043 GLOBAL void rr_csf_ffs_init (void);
2044 GLOBAL void cs_store_white_list (void);
2045 GLOBAL void rr_csf_write_black_list (T_LIST *black_list);
2046 GLOBAL void rr_csf_read_black_list (void);
2047 GLOBAL void rr_csf_write_white_list (T_CS_WHITE_LIST *white_list);
2048 GLOBAL void rr_csf_read_white_list (void);
2049 GLOBAL void rr_csf_write_rxlev_thr (UBYTE rxt, SHORT valno, char* val[MAX_NUM_BANDS]);
2050 GLOBAL void rr_csf_read_rxlev_thr (void);
2051 GLOBAL void rr_csf_write_mcc_shield_to_ffs (void);
2052 #endif /* _SIMULATION_FFS_ */
2053
2054 /*
2055 * timer
2056 */
2057 #define TIMERSTART(i,v) tim_start_timer (i, v)
2058 #define TIMERSTOP(i) tim_stop_timer (i)
2059 #if defined(TIMER_TRACE)
2060 #define IS_TIMER_ACTIVE(i) tim_check_timer(i)
2061 #else /* TIMER_TRACE */
2062 #define IS_TIMER_ACTIVE(i) (rr_data->t_running[i])
2063 #endif /* TIMER_TRACE */
2064 /*
2065 * RR services
2066 */
2067 /*
2068 * If all entities are linked into one module this definitions
2069 * prefixes all this functions with the enity name
2070 */
2071 #ifdef OPTION_MULTITHREAD
2072 #define srv_store_prim _ENTITY_PREFIXED(srv_store_prim)
2073 #define srv_use_stored_prim _ENTITY_PREFIXED(srv_use_stored_prim)
2074 #define srv_clear_stored_prim _ENTITY_PREFIXED(srv_clear_stored_prim)
2075 #define srv_check_stored_prim _ENTITY_PREFIXED(srv_check_stored_prim)
2076 /* obsolete
2077 #define srv_find_stored_prim _ENTITY_PREFIXED(srv_find_stored_prim)
2078 #define srv_flush_stored_prim _ENTITY_PREFIXED(srv_flush_stored_prim)
2079 */
2080 #endif
2081 EXTERN BOOL srv_store_prim (T_PRIM *prim);
2082 EXTERN void srv_use_stored_prim (void);
2083 EXTERN void srv_clear_stored_prim (ULONG opc);
2084 EXTERN UBYTE srv_check_stored_prim (ULONG opc);
2085 /* obsolete
2086 EXTERN UBYTE srv_find_stored_prim (ULONG opc);
2087 */
2088
2089 #if defined (REL99) && defined (TI_PS_FF_EMR)
2090 #define DEFAULT_SERV_BAND_REP 3 /*Number of cells to be reported in EMR for serving band*/
2091 #endif
2092
2093 EXTERN void srv_remove_frequencies_in_array (USHORT* arfcn_list);
2094 EXTERN UBYTE srv_remove_frequencies_in_array_gen (USHORT* arfcn_list, UBYTE c_arfcn_list);
2095
2096 EXTERN int srv_create_chan_mob_alloc (T_LIST *clist,
2097 T_LIST *list,
2098 UBYTE *mobile_alloc);
2099 EXTERN int srv_check_frequencies_in_list (T_LIST *clist);
2100 EXTERN void srv_trace_black_list (void);
2101 EXTERN void srv_trace_white_list (void);
2102
2103 /* Access function in RR to get cell alloc list. Called from GRR*/
2104 /*lint -esym(759,srv_get_cell_alloc_list)*/
2105 /*lint -esym(759,srv_get_cell_alloc_list)*/
2106 EXTERN void srv_get_cell_alloc_list (T_LIST *target_list);
2107
2108 EXTERN void rr_pei_primitive (T_PRIM *prim);
2109 /*
2110 * RX
2111 *
2112 */
2113
2114 #ifdef FF_PS_RSSI
2115 EXTERN void RX_SetValue (UBYTE new_value, UBYTE new_qual, UBYTE new_access);
2116 #else
2117 EXTERN void RX_SetValue (UBYTE new_value);
2118 #endif
2119
2120 /*
2121 * Radio resource primitives Engineering Mode
2122 * Bitmask for the event tracing
2123 */
2124 EXTERN T_RR_DATA rr_data_base;
2125 #define GET_INSTANCE_DATA register T_RR_DATA *rr_data= &rr_data_base
2126
2127 #define ENTITY_DATA rr_data
2128
2129 /*
2130 * These Functions are only temporary valid and should replaced as soon as possible
2131 */
2132 /*lint -esym(759,get_network_meas)*/
2133 /*lint -esym(759,get_bcch_chan_list)*/
2134 EXTERN UBYTE get_network_meas (UBYTE * chan_list);
2135 EXTERN UBYTE get_bcch_chan_list (stk_data_type * out_stk_data);
2136
2137 #if !defined (_SIMULATION_)
2138 EXTERN UBYTE * dl_get_sacch_buffer (void);
2139 #endif
2140
2141
2142 /*
2143 * If all entities are linked into one module this definitions
2144 * prefixes the global data with the enity name
2145 */
2146 #ifdef TI_PS_HCOMM_CHANGE
2147 EXTERN T_HANDLE rr_handle;
2148 #else /* for hCommHandles backward compatibility */
2149 #ifdef OPTION_MULTITHREAD
2150 #define hCommMM _ENTITY_PREFIXED(hCommMM)
2151 #if defined FF_EOTD
2152 #define hCommLC _ENTITY_PREFIXED(hCommLC)
2153 #define hCommRRLP _ENTITY_PREFIXED(hCommRRLP)
2154 #endif /* FF_EOTD */
2155 #define hCommDL _ENTITY_PREFIXED(hCommDL)
2156 #define hCommPL _ENTITY_PREFIXED(hCommPL)
2157 #define hCommMMI _ENTITY_PREFIXED(hCommMMI)
2158 #ifdef FF_WAP
2159 #define hCommWAP _ENTITY_PREFIXED(hCommWAP) /*FMM */
2160 #endif
2161 #endif
2162
2163 EXTERN T_HANDLE hCommMM; /* MM Communication */
2164 #if defined FF_EOTD
2165 EXTERN T_HANDLE hCommLC; /* LC Communication */
2166 EXTERN T_HANDLE hCommRRLP; /* RRLP Communication */
2167 #endif /* FF_EOTD */
2168 EXTERN T_HANDLE hCommDL; /* DL Communication */
2169 EXTERN T_HANDLE hCommPL; /* PL Communication */
2170 EXTERN T_HANDLE rr_handle;
2171 EXTERN T_HANDLE hCommMMI; /* EM Communication */
2172 #ifdef FF_WAP
2173 EXTERN T_HANDLE hCommWAP; /* FMM Communication */
2174 #endif
2175 #endif /* TI_PS_HCOMM_CHANGE */
2176
2177 /*
2178 * If all entities are linked into one module this definitions
2179 * prefixes the global data with the enity name
2180 */
2181 #ifdef OPTION_MULTITHREAD
2182 #define _decodedMsg _ENTITY_PREFIXED(_decodedMsg)
2183 #endif
2184
2185 #if defined (REL99) && defined (TI_PS_FF_EMR)
2186 #define MAX_MSTRUCT_CCD_RR MAXIMUM(MAX_MSTRUCT_LEN_RR_SHORT, MAX_MSTRUCT_LEN_RR)
2187 EXTERN UBYTE _decodedMsg [MAX_MSTRUCT_CCD_RR];
2188 #else
2189 EXTERN UBYTE _decodedMsg [MAX_MSTRUCT_LEN_RR];
2190 #endif
2191
2192 #ifdef OPTION_TIMER
2193 /*
2194 * If all entities are linked into one module this definitions
2195 * prefixes the global data with the entity name
2196 */
2197 #ifdef OPTION_MULTITHREAD
2198 #define partab _ENTITY_PREFIXED(partab)
2199 #endif
2200
2201 /* EXTERN const KW_DATA partab[];*/
2202 #endif
2203
2204 /*
2205 * backward compatibility for some channel modes
2206 */
2207 #if !defined CM_DATA_14_4
2208 #define CM_DATA_14_4 0x0F
2209 #define CM_EFR 0x21
2210 #endif
2211
2212 /*
2213 * Definitions for AMR
2214 */
2215 #define CM_AMR 0x41
2216 #define MAX_NO_ACS 0x04
2217 /*#define MAX_CODEC_MODES 0x03*/
2218
2219 #if !defined(_FILE10_)
2220 #define __FILE10__ (__FILE__+sizeof(__FILE__)-11)
2221 #endif /* !_FILE10_ */
2222
2223 #if defined(SYST_TRACE)
2224 #undef SYST_TRACE
2225 #undef SYST
2226 #undef SYST_TRACE_P
2227 #endif /* !SYST_TRACE */
2228 #if defined(NEW_FRAME)
2229 #define SYST_TRACE(a) vsi_o_ttrace((T_HANDLE)0, (ULONG)-1,a)
2230 #define SYST (T_HANDLE)0, (ULONG)-1
2231 #define SYST_TRACE_P(a) vsi_o_ttrace a
2232 #else
2233 #define SYST_TRACE(a) vsi_o_trace("", 0xFFFF,a)
2234 #define SYST "", 0xffff
2235 #define SYST_TRACE_P(a) vsi_o_trace a
2236 #endif /* NEW_FRAME */
2237 /*
2238 * use it as showed next line...
2239 * SYST_TRACE_P((SYST, "e.g. two parameter: %d %d", p1, p2));
2240 */
2241
2242 #if defined(DL_TRACE_ENABLED)
2243 EXTERN void dl_trace (UCHAR trace_type,
2244 UCHAR channel,
2245 UCHAR ch_type,
2246 UCHAR * data);
2247 #ifdef OPTION_MULTITHREAD
2248 #define dl_trace_buf _ENTITY_PREFIXED(dl_trace_buf)
2249 #endif
2250 #if defined(RR_PEI_C)
2251 GLOBAL char dl_trace_buf[100];
2252 #else /* RR_PEI_C */
2253 EXTERN char dl_trace_buf[100];
2254 #endif /* RR_PEI_C */
2255 #define TRACE_RR_EVENT 5
2256 #define DOES_NOT_MATTER 0
2257 #define DL_OFFLINE_TRACE(s) \
2258 dl_trace (TRACE_RR_EVENT, DOES_NOT_MATTER, DOES_NOT_MATTER, (UCHAR*)s)
2259 #endif /* DL_TRACE_ENABLED */
2260
2261 #if defined(ARRAY_TRACE)
2262 #ifdef OPTION_MULTITHREAD
2263 #define array_trace _ENTITY_PREFIXED(array_trace)
2264 #endif
2265 EXTERN void array_trace (UBYTE*array, int size, char *titel);
2266 #define TRACE_ARRAY(array, size, titel) array_trace(array, size, titel)
2267 #else /* ARRAY_TRACE */
2268 #define TRACE_ARRAY(array, size, titel)
2269 #endif /* ARRAY_TRACE */
2270
2271 #if defined(_SIMULATION_)
2272 #define TRACE_EVENT_WIN(s) TRACE_EVENT(s)
2273 #define TRACE_EVENT_WIN_P1(s,a1) TRACE_EVENT_P1(s,a1)
2274 #define TRACE_EVENT_WIN_P2(s,a1,a2) TRACE_EVENT_P2(s,a1,a2)
2275 #define TRACE_EVENT_WIN_P3(s,a1,a2,a3) TRACE_EVENT_P3(s,a1,a2,a3)
2276 #define TRACE_EVENT_WIN_P4(s,a1,a2,a3,a4) TRACE_EVENT_P4(s,a1,a2,a3,a4)
2277 #define TRACE_EVENT_WIN_P5(s,a1,a2,a3,a4,a5) TRACE_EVENT_P5(s,a1,a2,a3,a4,a5)
2278 #define TRACE_EVENT_WIN_P6(s,a1,a2,a3,a4,a5,a6) TRACE_EVENT_P6(s,a1,a2,a3,a4,a5,a6)
2279 #define TRACE_EVENT_WIN_P7(s,a1,a2,a3,a4,a5,a6,a7) TRACE_EVENT_P7(s,a1,a2,a3,a4,a5,a6,a7)
2280 /*#define TRACE_EVENT_WIN_P8(s,a1,a2,a3,a4,a5,a6,a7,a8) TRACE_EVENT_P8(s,a1,a2,a3,a4,a5,a6,a7,a8)
2281 #define TRACE_EVENT_WIN_P9(s,a1,a2,a3,a4,a5,a6,a7,a8,a9) TRACE_EVENT_P9(s,a1,a2,a3,a4,a5,a6,a7,a8,a9)*/
2282
2283 /* trace for call of att_code_rr_abort_ind() */
2284 /* Implements Measure#32: Row 18, 43, 90, 101, 111, 201, 211, and 324
2285 * Row 17, 41, 89, 100, 110, 200, 210, and 321 */
2286 #define att_code_rr_abort_ind_trace(c) \
2287 { TRACE_EVENT_WIN_P2 ("att_code_rr_abort_ind(%x=%s)", c, S2I_STRING(#c));\
2288 att_code_rr_abort_ind_original(rr_data, c);}
2289
2290
2291 #else /* _SIMULATION_ */
2292 #define TRACE_EVENT_WIN(s)
2293 #define TRACE_EVENT_WIN_P1(s,a1)
2294 #define TRACE_EVENT_WIN_P2(s,a1,a2)
2295 #define TRACE_EVENT_WIN_P3(s,a1,a2,a3)
2296 #define TRACE_EVENT_WIN_P4(s,a1,a2,a3,a4)
2297 #define TRACE_EVENT_WIN_P5(s,a1,a2,a3,a4,a5)
2298 #define TRACE_EVENT_WIN_P6(s,a1,a2,a3,a4,a5,a6)
2299 #define TRACE_EVENT_WIN_P7(s,a1,a2,a3,a4,a5,a6,a7)
2300 #define TRACE_EVENT_WIN_P8(s,a1,a2,a3,a4,a5,a6,a7,a8)
2301 #define TRACE_EVENT_WIN_P9(s,a1,a2,a3,a4,a5,a6,a7,a8,a9)
2302
2303 #define att_code_rr_abort_ind_trace(c) \
2304 { TRACE_EVENT_P4 ("att_code_rr_abort_ind(%x=%s) #%u %s", c, #c, __LINE__, __FILE10__);\
2305 att_code_rr_abort_ind_original(rr_data, c);}
2306
2307
2308 #endif /* _SIMULATION_ */
2309
2310 #define att_code_rr_abort_ind att_code_rr_abort_ind_trace
2311
2312 /*
2313 * Tracing of Layer 3 RR Messages.
2314 */
2315
2316 #define RR_BINDUMP(payload,length,arfcn,fn,dir) for_rr_trace_message(payload,length,arfcn,fn,dir)
2317
2318 #endif