comparison g23m-gsm/rr/rr.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 :
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
988 * 'current_plmn_search_type' is to record the request for a parallel search
989 * (i.e. to action a network search whilst an existing search (for a
990 * limited/plmn) is already underway)
991 *
992 * The original request is stored in 'current_plmn_search_type' and the
993 * parallel net search request is stored in 'parallel_net_plmn_search_type'
994 *
995 * When the NET search is completed, 'parallel_net_plmn_search_type' is
996 * cleared and 'mm_req_service' is set the stored search value in
997 * 'current_plmn_search_type'
998 */
999 UBYTE parallel_net_plmn_search_type;
1000 UBYTE current_plmn_search_type;
1001
1002
1003 T_plmn plmn; /* requested network by MM */
1004 BOOL v_eq_plmn; /* EPLMN List is valid or not */
1005 T_plmn eq_plmn_list[RR_EPLMNLIST_SIZE]; /* eq PLMN list from MM */
1006 UBYTE cksn; /* cipher key sequence number */
1007 UBYTE kc [KC_STRING_SIZE]; /* authentication parameter Kc */
1008 UBYTE new_kc [KC_STRING_SIZE]; /* new auth parameter from SIM */
1009 USHORT access_classes; /* access classes from SIM */
1010 T_mob_ident imsi; /* IMSI from SIM card */
1011 UBYTE imsi_available; /* IMSI available flag */
1012 ULONG tmsi_binary; /* binary representation TMSI */
1013 UBYTE tmsi_available; /* TMSI available flag */
1014 T_loc_area_ident forb_lac_list[MAX_LAI];
1015 /* forbidden lai list */
1016 T_loc_area_ident roam_forb_lac_list[MAX_LAI];
1017 /* roaming forbidden lai list */
1018 UBYTE c2_tab [NCELL_SIZE]; /* ranked list for C2 */
1019 UBYTE access_counter; /* counts random bursts */
1020 UBYTE all_conf_received; /* flag all randoms confirmed */
1021 UBYTE channel_needed; /* for mobile terminated call */
1022 T_ERROR error; /* in incoming messages */
1023 USHORT establish_cause; /* for outgoing call */
1024 ULONG fn_offset; /* time between measurements */
1025 T_synch_ind ho_type; /* handover type information */
1026 USHORT index; /* for random number generation*/
1027 T_L3_SDU l3msg; /* layer 3 message for establ. */
1028 UBYTE last_used_channel; /* for building random ref */
1029 UBYTE max_attempt; /* number of random bursts */
1030 T_MPH_MEASUREMENT_IND measurement_report;/* last measurement report */
1031 T_TIME reg_time_gap; /* Time gap between Non parallel search in Lim Ser */
1032 UBYTE reg_counter; /* registration counter */
1033 UBYTE old_cell_tried; /* flag during cell reselection*/
1034 T_plmn ahplmn; /* Acting HPLMN ID */
1035 #if defined (REL99) AND defined (TI_PS_FF_EMR) AND (GPRS)
1036 BOOL enable_ps_emr;
1037 #endif
1038 } T_MS_DATA;
1039
1040 #if defined (REL99) && defined (TI_PS_FF_EMR)
1041 /* indicates from where the enhanced para are taken - SI2quater or MI*/
1042 #define ENH_PARA_IDLE 0
1043 #define ENH_PARA_DEDICATED 1
1044 #define ENH_PARA_INVALID_STATE 2
1045 #endif
1046
1047 #if defined (TI_PS_FF_RTD) AND defined (REL99)
1048 /* start of constants related to RTD */
1049 #define RTD_DEFAULT_INDEX 0
1050 #define RTD_NOT_AVAILABLE 0xFFFF
1051 #define RTD_12BIT 0x8000
1052 #define MAX_NR_OF_NCELL 0x20
1053 /* end of constants related to RTD */
1054 #endif /* #if defined (TI_PS_FF_RTD) AND defined (REL99) */
1055
1056
1057 /*
1058 * data area for cell selection / reselection
1059 */
1060 typedef struct
1061 {
1062 UBYTE v_cell_chan_desc; /* cell chan desc flag */
1063 T_LIST cell_chan_desc; /* cell channel description */
1064 T_chan_desc cbch_chan_desc; /* cbch channel description */
1065 UBYTE cbch_chan_desc_avail;/* cbch available flag */
1066 UBYTE cbch_mob_alloc [65]; /* cbch mobile allocation */
1067 UBYTE ncc_permitted; /* NCC permitted bitmap */
1068 T_cell_opt_sacch cell_options; /* cell options */
1069 UBYTE ncell_ext; /* neighbourcell extension flag*/
1070 UBYTE dtx; /* dtx flag */
1071 UBYTE dtx_half;
1072 UBYTE dtx_full;
1073 USHORT sys_info_read; /* bitmap of read sys infos */
1074 T_LIST ncell_list; /* neighbour cell list */
1075 #if defined (REL99) && defined (TI_PS_FF_EMR)
1076 UBYTE si2quater_status; /*Indicates the SI-2quater status on cell that can be used
1077 once the cell is selected */
1078 BOOL si2quater_pos; /* 0 - NBCCH, 1 - EBCCH*/
1079 #endif
1080 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1081 UBYTE band_indicator; /* 0 - 1800, 1 - 1900 */
1082 #endif
1083 } T_CELL_DATA;
1084
1085 typedef struct
1086 {
1087 T_plmn plmn; /* Idetification of Network */
1088 USHORT lac; /* Location Area Code */
1089 USHORT arfcn; /* Frequency Number */
1090 UBYTE rxlev; /* The received signal level */
1091 UBYTE cell_ok; /* cell allows network access */
1092 UBYTE region; /* Identification of region */
1093 } T_FOUND_ELEMENT;
1094
1095 typedef struct
1096 {
1097 T_FOUND_ELEMENT element [MAX_PLMN];
1098 } T_FOUND_LIST;
1099
1100 #if defined (REL99) && defined (TI_PS_FF_EMR)
1101 typedef struct {
1102 BOOL is_data_valid; /*Indicates whether the maintained Enhanced parameters
1103 is valid or not.*/
1104 UBYTE mp_change_mark; /*Current change mark value of the measurement parameters
1105 received in Air message*/
1106 UBYTE msg_count; /*Number of instances to be received*/
1107 UBYTE rep_type; /* 'Normal' or 'Enhanced': Report type to be used in dedicated mode*/
1108 UBYTE grr_rep_type; /* 'Normal' or 'Enhanced': Report type to be used in PIM/PTM*/
1109 T_enh_para_struct enh_para;/* Actual parameters */
1110 #ifdef GPRS
1111 T_nc_para_struct nc_para; /*Network control parameters*/
1112 #endif
1113 ULONG ba2bsic_map_pending;/*1 in a bit pos indicates BA-BSIC mapping is pending for that index
1114 may be due to incomplete BA (SI-5ter awaited)*/
1115 UBYTE scale_used_last;
1116 } T_rr_enh_para;
1117
1118 /*In a multi instance message where this BSIC info is received,
1119 not all instances carry BSIC list. The instance that carries
1120 this info will have is_valid set to TRUE*/
1121 typedef struct {
1122 BOOL is_valid;
1123 T_gprs_bsic bsic_info;
1124 } T_bsic_list;
1125 #endif
1126
1127 /*
1128 * serving cell data of RR
1129 */
1130 typedef struct
1131 {
1132 UBYTE ciph_on; /* ciphering status */
1133 UBYTE algo; /* cipher algorithm */
1134 UBYTE ciph_received; /* flag ciphering received */
1135 UBYTE selection_type; /* type of cell selection */
1136 BOOL mm_started; /* originated of cell selection*/
1137 UBYTE found_entries; /* number of found PLMNs */
1138 T_FOUND_ELEMENT found[MAX_PLMN]; /* list of found PLMNs */
1139 UBYTE first_attempt; /* high priority attempt */
1140
1141 T_chan_desc chan_desc; /* actual channel description */
1142 UBYTE new_ta; /* timing advance */
1143 UBYTE ch_mode; /* actual channel mode */
1144 UBYTE ba_index; /* band allocation index */
1145 ULONG observed_ta; /* observed timing advance */
1146 T_LIST five_ter_list; /* contains sys info 5ter list */
1147 T_LIST ncell_list_idle; /* neighbour cell list build in idle mode */
1148 /*
1149 * data area for cell selection / reselection
1150 */
1151 T_CELL_DATA cd; /* cell data */
1152 T_multirate_conf amr_conf; /* MultiRate configuration */
1153 #if defined(STORE_FN)
1154 ULONG fn; /* last indicated framenumber */
1155 #endif /* STORE_FN */
1156 #if defined (REL99) && defined (TI_PS_FF_EMR)
1157 /*
1158 * Data area for EMR
1159 */
1160 /*
1161 * Parameters that are permanent
1162 */
1163 UBYTE enh_para_status; /* Indicates Whether the existing enh_para are from SI-2quater or MI*/
1164 T_rr_enh_para emr_data_current; /*Parameters for EMR - for RR in dedicated
1165 mode and for GRR in PIM/PTM mode. Not required in Idle*/
1166 BOOL ba_list_ded; /*Indicates whether BA list is already received in dedicated mode*/
1167 BOOL ba_list_idle;/*Indicates whether BA list is already received in Idle mode*/
1168 /*
1169 * Parameters that are required only during message processing
1170 */
1171 T_rr_enh_para emr_data_temp; /* Temporary storage till we get all the instances of Air message*/
1172 UBYTE prev_highest_index; /*To keep track of highest index*/
1173 ULONG rep_bmp; /*temporary storage of report priority in bit map form*/
1174 USHORT instance_bmp; /*A bit set indicates that the instance is received. Bit 0- instance '0'
1175 bit 15 - instance '15'*/
1176 T_bsic_list bsic_list[MAX_MULTI_INST]; /* To store the received BSIC lists before performing
1177 BA-BSIC mapping*/
1178 UBYTE rep_count[MAX_NEIGHBOURCELLS]; /* this is used to get how many times a cell in
1179 enhanced neighbour cell list is reported. Will be of use when reporting low priority cells
1180 at reduced rate*/
1181 UBYTE emr_count; /*Keeps track (MOD4) of number of EMR messages sent*/
1182 UBYTE ba_index_idle; /*To store BA_INDEX used in Idle before going to Dedicated*/
1183 UBYTE new_ba_index;
1184 #endif
1185 } T_SC_DATA;
1186
1187 /*
1188 * cell reselection data of RR (during handover or hplmn search)
1189 */
1190 typedef struct
1191 {
1192 UBYTE ciph_on; /* ciphering status */
1193 UBYTE algo; /* cipher algorithm */
1194 UBYTE ch_mode; /* actual channel mode */
1195 T_chan_desc chan_desc; /* actual channel description */
1196 T_CR_WHITE_LIST cr_white_list; /* stores si2x temporarily during BCCH reading */
1197 T_CELL_DATA cd; /* cell data */
1198 T_multirate_conf amr_conf; /* MultiRate configuration */
1199 #if defined (REL99) && defined (TI_PS_FF_EMR)
1200 UBYTE ba_index; /* BA-IND received in BA(list) of SI-2*/
1201 #endif
1202
1203 } T_CR_DATA;
1204 #ifdef GPRS
1205 typedef enum
1206 {
1207 NORMAL_BCCH,
1208 EXTENDED_BCCH,
1209 SI13_NOT_PRESENT
1210 } T_SI13_LOC_IND;
1211 #endif
1212 /*
1213 * Neighbour cell data of RR
1214 */
1215
1216 /* DRAM Optimization: This structure is re-allign with 4 bytes
1217 * sothat will have minimum wastage */
1218 typedef struct
1219 {
1220 T_ctrl_chan_desc control_descr; /* Control Channel Description */
1221 T_cell_select select_para; /* Cell Selection Parameter */
1222 T_rach_ctrl rach; /* random control parameter */
1223 T_loc_area_ident lai; /* location area identification*/
1224
1225 ULONG avail_time; /* time ncell is available */
1226 ULONG c1_counter; /* measurement report counter */
1227 ULONG bcch_counter;
1228
1229 USHORT arfcn; /* channel number */
1230 SHORT c1; /* C1 Path Loss Criterion */
1231 SHORT c2; /* C2 Reselection Criterion */
1232 USHORT cell_id; /* cell identifier */
1233
1234 T_C2_PARAMETER c2_par; /* C2 Parameter for Calculation*/
1235 UBYTE rxlev; /* fieldstrength */
1236 UBYTE v_acs; /* read of sys info 7 & 8 */
1237 UBYTE c2_used; /* calculated c2 values */
1238
1239 UBYTE bcch_error; /* couter BCCH errors */
1240 UBYTE bcch_status; /* status of neighbour cell */
1241 UBYTE bsic; /* BSIC */
1242 UBYTE tnnn; /* 5 sec counter reselection */
1243
1244 SHORT c2_corr;
1245 #ifdef GPRS
1246 SHORT c31;
1247 SHORT c32;
1248 UBYTE c32_used;
1249 UBYTE v_cr_par;
1250 T_cr_par cr_par;
1251 #endif
1252
1253 #ifdef GPRS
1254 T_SI13_LOC_IND si13_loc_ind;
1255 #endif
1256
1257 #ifdef GPRS
1258 UBYTE rac; /* routing area color */
1259 #endif
1260
1261 #ifdef REL99
1262 UBYTE mscr_flag;
1263 #endif
1264
1265 } T_NC_DATA;
1266
1267 /*
1268 * Cell Selection Process Data
1269 */
1270 typedef struct
1271 {
1272 UBYTE max_arfcn; /* number of valid channels */
1273 UBYTE act_index; /* actual index */
1274 BOOL check_hplmn; /* check HPLMN */
1275 USHORT arfcn [MAX_CHANNELS]; /* channel number */
1276 UBYTE rxlev [MAX_CHANNELS]; /* fieldstrength */
1277 UBYTE attributes[MAX_CHANNELS]; /* attributes of channel */
1278 /* Bit 7 Bcch Info List Flag
1279 0 : not member of the BCCH info List
1280 1 : member of the BCCH info List
1281 Bit 6 Low Priority Flag
1282 0 : high priority flag
1283 1 : low priority flag
1284 Bit 5 Emergency Cell Flag
1285 0 : emergency services possible
1286 1 : emergency services not possible
1287 Bit 4 BCCH Detected Flag
1288 0 : BCCH not decoded
1289 1 : BCCH decoded
1290 Bit 3 BCCH Checked Flag
1291 0 : BCCH not checked
1292 1 : BCCH checked
1293 Bit 2 reserved
1294 Bit 1/0 Priority
1295 0 : low priority
1296 1 : middle priority
1297 2 : high priority
1298 */
1299 USHORT arfcn_sc;
1300 USHORT arfcn_cr;
1301 T_CS_BLACK_LIST black_list; /* Stores the black_list information */
1302 T_CS_WHITE_LIST white_list; /* Stores the white list information */
1303 U8 previous_search_mode; /* stores the previous search mode */
1304 U8 current_search_mode; /* stores the current search mode */
1305 U8 scan_mode; /* Identifies the scan mode */
1306 U8 initial_plmn_search; /* Identifies first FUNC_PLMN search */
1307 U8 black_list_search_pending;
1308 U8 region; /* This stores the region */
1309 BOOL all_freq_area; /* Identifies presence of both Euro and American coverage */
1310 T_plmn last_reg_plmn; /* Stores the last registered PLMN */
1311 } T_CS_DATA;
1312
1313 /* CSI-LLD Section 3.8
1314 * Dynamic configuration commands data
1315 */
1316 typedef struct
1317 {
1318 U32 tfast_cs_val; /* TFAST_CS timer value in minutes */
1319 U32 tnormal_cs_val; /* TNORMAL_CS timer value in minutes */
1320 U8 upper_rxlev_thr[MAX_NUM_BANDS]; /* Upper RxLev threshold */
1321 U8 medium_rxlev_thr[MAX_NUM_BANDS]; /* Medium RxLev threshold */
1322 U8 lower_rxlev_thr[MAX_NUM_BANDS]; /* Lower RxLev threshold */
1323 U8 bl_cs_en; /* Controls Black List search */
1324 U8 fcr; /* dynamic configuration, Fast Cell Recelection */
1325 U8 scr; /* dynamic configuration, Slow Cell Recelection */
1326 U8 fca; /* dynamic configuration, Failed Channel Assignment */
1327 U8 fho; /* dynamic configuration, Force Handover */
1328 U8 iho; /* dynamic configuration, lock the DUT to the cell it is already camping */
1329 U8 set_band; /* dynamic configuration, Frequency Band control */
1330 U8 no_sys_time; /* dynamic configuration, control time dependent random generation */
1331 S16 gsm_offset; /* dynamic configuration, offset to path loss criterium C1 */
1332 S16 dcs_offset; /* dynamic configuration, offset to path loss criterium C1 */
1333 U8 nkc; /* dynamic configuration, user specific, ciphering when no ciphering key available */
1334 T_TIME lim_ser_nps_delay;/* dynamic configuration, delay between Non parallel search in Lim ser in all freq area */
1335 #if defined(_SIMULATION_FFS_)
1336 T_shield_mcc mcc_shield; /* This structure contains the shielded MCC values*/
1337 #endif
1338 } T_DYNAMIC_CONFIG;
1339
1340 typedef struct
1341 {
1342 UBYTE state[MAX_STATE];
1343 T_MS_DATA ms_data;
1344 T_SC_DATA sc_data;
1345 T_CR_DATA cr_data;
1346 T_NC_DATA nc_data [NCELL_SIZE]; /* 0-5 = ncell, 6 = serving cell
1347 * 7 = cell reselection
1348 */
1349 T_CS_DATA cs_data;
1350 #ifdef GPRS
1351 T_GPRS_DATA gprs_data;
1352 T_LIST ba_ncell_list; /* Used to store Original BA list, when BA list is midified by PMO */
1353 #endif
1354 UBYTE lup_rxlev;
1355 UBYTE c1_offset;
1356 /*
1357 * primitive storing variables
1358 */
1359 T_PRIM *stored_prim [MAX_RR_STORED_PRIM];
1360 UBYTE stored_prim_in;
1361 UBYTE stored_prim_out;
1362 UBYTE stored_prim_read;
1363 UBYTE stored_prim_write;
1364 /*
1365 * must be checked ...
1366 */
1367 UBYTE old_serving_cell;
1368 USHORT old_cell_id;
1369 T_loc_area_ident old_lai;
1370 UBYTE page_identity_type;
1371 USHORT power_on_low;
1372 USHORT power_on_high;
1373 USHORT rel_cause;
1374 USHORT dcch_stop_cause;
1375 UBYTE reselect_index;
1376 UBYTE repeat_est;
1377 UBYTE t_running[NUM_OF_RR_TIMERS];
1378 void (*t_expire[NUM_OF_RR_TIMERS])(void);
1379 UBYTE treg_pending;
1380 UBYTE tch_loop_subch;
1381 UBYTE used_channel_ref[MAX_RACH_REQ];
1382 T_frame_no used_frame_no[MAX_RACH_REQ];
1383 UBYTE bcch_error;
1384
1385 UBYTE pag_rec;
1386 UBYTE imm_ass_rej_rec;
1387 EF_MSCAP mscap;
1388 USHORT act_ncell_list [MAX_NEIGHBOURCELLS];
1389 UBYTE ncell_mb;
1390 UBYTE start_cell_reselection;
1391 UBYTE first_meas_received;
1392 UBYTE mode_after_dedi; /* MODE_CELL_RESELECTION or MODE_CELL_SELECTION or MODE_CELL_CHANGE_ORDER*/
1393 BOOL net_lost; /* a RLF Radio Link Failure or DSF Downlink Signalling Failure has occured */
1394 USHORT found_channel; /* ARFCN of requested PLMN (obtained from 'previous' Cell Selection data) */
1395 UBYTE ba_id; /* BA identifier used with Neighbour Cell Measurement */
1396
1397 #if defined FF_EOTD
1398 USHORT eotd_req_id; /* indicate explicit position measurement requests */
1399 T_APPLIC_RX applic_rx; /* Application Information transfer */
1400 #endif /* FF_EOTD */
1401
1402 UBYTE emo_seq; /* EMO sequence number */
1403 UBYTE c_emo_arfcn; /* number of elements in emo_arfcn */
1404 USHORT *emo_arfcn; /* request list of EMO ARFCNs */
1405
1406 UBYTE resel_pending; /* cell reselection was deferred */
1407 UBYTE c_ncell_bcch; /* # of outstanding ncell BCCH info. Default=NOT_INITIALISED */
1408 UBYTE cell_test_operation; /* dynamic configuration, as defined in TS 11.11, section 10.3.18 EFAD (Administrative data) */
1409 T_DYNAMIC_CONFIG dyn_config; /* Holds dynamic configuration data */
1410 #ifdef GPRS
1411 U8 old_rac; /* Holds old Routing area code */
1412 #endif
1413 BOOL cr_treselect_exp; /* Flag to indicate whether cell reselection after TRESELECT
1414 * expiry waiting for SI2TER is suceesfull or not */
1415 BOOL use_stored_entries; /* Use stored entries after end of transition */
1416 } T_RR_DATA;
1417
1418 typedef struct
1419 {
1420 USHORT l_f;
1421 USHORT o_f;
1422 UBYTE b_f[32];
1423 } T_f_range;
1424
1425
1426 /*
1427 * Used for requesting location information from RR for proactive polling in sim
1428 */
1429 typedef struct
1430 {
1431 /*lint -esym(768,stk_class) : not referenced */
1432 /*lint -esym(768,stk_subclass) */
1433 /*lint -esym(768,stk_type) */
1434 UBYTE stk_class;
1435 UBYTE stk_subclass;
1436 UBYTE stk_type;
1437 UBYTE stk_length;
1438 UBYTE stk_parameter [MAX_STK_LENGTH];
1439 } stk_data_type;
1440
1441 /*==== EXPORT =====================================================*/
1442
1443 /*
1444 * Prototypes Timer
1445 */
1446 /*
1447 * If all entities are linked into one module this definitions
1448 * prefixes all this functions with the enity name
1449 */
1450
1451 #ifdef OPTION_MULTITHREAD
1452 #define tim_exec_timeout _ENTITY_PREFIXED(tim_exec_timeout)
1453 #define tim_start_timer _ENTITY_PREFIXED(tim_start_timer)
1454 #define tim_stop_timer _ENTITY_PREFIXED(tim_stop_timer)
1455 #if defined(TIMER_TRACE)
1456 #define tim_check_timer _ENTITY_PREFIXED(tim_check_timer)
1457 #endif /* TIMER_TRACE */
1458 #endif /* OPTION_MULTITHREAD*/
1459 EXTERN void tim_exec_timeout (USHORT index);
1460 EXTERN void tim_start_timer (USHORT index, T_TIME value);
1461 EXTERN void tim_stop_timer (USHORT index);
1462 #if defined(TIMER_TRACE)
1463 EXTERN BOOL tim_check_timer(USHORT index);
1464 #endif /* TIMER_TRACE */
1465
1466 EXTERN void tim_t3110 (void);
1467 EXTERN void tim_t3122 (void);
1468 EXTERN void tim_t3126 (void);
1469 EXTERN void tim_treselect (void);
1470 EXTERN void tim_treg (void);
1471 EXTERN void tim_ext_meas (void);
1472 #if defined FF_EOTD
1473 EXTERN void tim_apdu (void);
1474 #endif /* FF_EOTD */
1475 EXTERN void tim_tnnn (void);
1476 EXTERN void set_tnnn (int index,
1477 USHORT value);
1478 EXTERN void reset_tnnn (int index);
1479 EXTERN int is_tnnn (int index);
1480 EXTERN void tim_tabort (void);
1481 EXTERN void tstart_tabort (USHORT val);
1482 EXTERN void tim_reset_registration_timer(void);
1483 EXTERN void tim_plmn_search_expiry (void);
1484 EXTERN void tim_tnormal_cs (void);
1485 EXTERN void tim_tfast_cs (void);
1486
1487 /*
1488 * Prototypes Customer Specific Functions
1489 */
1490
1491 /*
1492 * Cell Selection
1493 */
1494 EXTERN void cs_init_process (void);
1495 EXTERN void cs_set_all (void);
1496 EXTERN void cs_start_scan (void);
1497 EXTERN void cs_start_sync (void);
1498 EXTERN void cs_del_list (T_LIST * list);
1499 EXTERN void cs_set_list (T_LIST * list);
1500 EXTERN UBYTE cs_def_list (UBYTE attribute);
1501 EXTERN BOOL cs_sync_next (void);
1502 EXTERN void cs_set_null (void);
1503 EXTERN void cs_set_attributes (UBYTE attribute,
1504 USHORT arfcn);
1505 EXTERN void cs_set_rxlev (UBYTE rxlev, USHORT arfcn);
1506 EXTERN void cs_clear_attributes (UBYTE attribute, USHORT arfcn);
1507 EXTERN void cs_mph_power_cnf (T_MPH_POWER_CNF * mph_power_cnf);
1508 EXTERN void cs_mph_bsic_cnf (T_MPH_BSIC_CNF * mph_bsic_cnf);
1509 EXTERN void cs_set_stop_active (void);
1510 EXTERN void cs_set_bcch_info (T_bcch_info * sim_bcch_info);
1511 EXTERN void cs_get_channel_from_found_list (void);
1512 EXTERN void cs_clear_channel_from_found_list (void);
1513 EXTERN UBYTE cs_get_freq_band (UBYTE pch_interrupt);
1514 EXTERN void cs_clear_white_list(U8 clr_bcch_info);
1515
1516 /* CSI-LLD section:4.1.1.5 */
1517 GLOBAL void cs_store_black_list(void);
1518 GLOBAL void cs_add_to_black_list(U8 region,U16 arfcn,U8 rxlev);
1519 GLOBAL void cs_del_from_black_list(U8 region,U16 arfcn);
1520 GLOBAL void cs_clear_black_list(U8 erase_type);
1521 GLOBAL void cs_remove_BA_MA_from_black_list(U8 region,T_LIST *source_list);
1522 GLOBAL void cs_update_black_list(void);
1523 EXTERN U8 cs_get_new_search_mode(void);
1524 EXTERN void cs_handle_search_mode_timer(U8 search_mode);
1525 GLOBAL void cs_rem_inactive_carriers_from_bl(T_MPH_POWER_CNF * mph_power_cnf);
1526 GLOBAL BOOL cs_check_region(U8 region);
1527 GLOBAL BOOL cs_check_arfcn_range(U16 arfcn);
1528 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1529 GLOBAL UBYTE cs_get_band_index(USHORT arfcn);
1530 #endif
1531
1532 /*
1533 * RR Attachment
1534 */
1535
1536 /*
1537 * attachment primitives
1538 */
1539 EXTERN void att_mph_error_ind (T_MPH_ERROR_IND * mph_error_ind);
1540 EXTERN void att_mph_measurement_ind (T_MPH_MEASUREMENT_IND * mph_measurement_ind);
1541 EXTERN void dat_mph_emo_meas_ind (T_MPH_EMO_MEAS_IND * mph_emo_meas_ind);
1542 EXTERN void att_rr_activate_req (T_RR_ACTIVATE_REQ * rr_activate_req);
1543 EXTERN void att_rr_deactivate_req (T_RR_DEACTIVATE_REQ * rr_deactivate_req);
1544 EXTERN void att_rr_sync_req (T_RR_SYNC_REQ * rr_sync_req);
1545 EXTERN void att_mph_sync_ind (T_MPH_SYNC_IND * mph_sync_ind);
1546 EXTERN void att_mph_meas_order_cnf (T_MPH_MEAS_ORDER_CNF * mph_meas_order_cnf);
1547 EXTERN void att_rr_sync_hplmn_req (T_RR_SYNC_HPLMN_REQ * rr_sync_hplmn_req);
1548 EXTERN void att_mph_stop_dedicated_cnf (T_MPH_STOP_DEDICATED_CNF * mph_stop_dedi_cnf);
1549 #ifdef GPRS
1550 EXTERN void att_mph_meas_rep_cnf (T_MPH_MEAS_REP_CNF * mph_meas_rep_cnf);
1551 EXTERN void att_mph_ext_meas_cnf (T_MPH_EXT_MEAS_CNF * mph_ext_meas_cnf);
1552 EXTERN void att_ext_meas_end (BOOL destory_rrgrr_ext_meas_cnf);
1553 EXTERN void att_ext_meas_next_bsic (void);
1554 #endif
1555 #if defined FF_EOTD
1556 EXTERN void att_mph_ncell_pos_ind (T_MPH_NCELL_POS_IND * mph_ncell_pos_ind);
1557 #endif /* FF_EOTD */
1558 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1559 EXTERN void att_mph_init_rr_ind (T_MPH_INIT_RR_IND * mph_init_rr_ind);
1560 #endif
1561
1562
1563 /*
1564 * attachment signalling
1565 */
1566 EXTERN void att_dat_dedicated (void);
1567 EXTERN void att_dat_con_est (void);
1568 EXTERN void att_for_sysinfo_type1 (USHORT arfcn,
1569 T_D_SYS_INFO_1 *sys_info_1,
1570 T_LIST *cell_chan_desc);
1571
1572 EXTERN void att_for_sysinfo_type2_2bis (USHORT arfcn,
1573 T_VOID_STRUCT *sys_info_2_2bis,
1574 T_LIST *new_2_2bis_list,
1575 UBYTE ncell_ext,
1576 T_SI_TYPE si_type);
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 EXTERN void att_for_sysinfo_type5_5bis (USHORT arfcn,
1587 T_LIST *new_5_5bis_list,
1588 UBYTE old_index,
1589 UBYTE ncell_ext,
1590 T_SI_TYPE si_type);
1591
1592 EXTERN void att_for_sysinfo_type5ter (USHORT arfcn,
1593 T_LIST *new_5ter_list);
1594 EXTERN void att_for_sysinfo_type6 (USHORT arfcn,
1595 T_D_SYS_INFO_6 *sys_info_6);
1596 EXTERN void att_for_sysinfo_type7_8 (USHORT arfcn,
1597 T_D_SYS_INFO_8 *sys_info_8);
1598 EXTERN void att_bsic_ind (USHORT arfcn,
1599 UBYTE rxlev,
1600 UBYTE bsic);
1601 EXTERN void att_no_bsic_ind (void);
1602 /*
1603 * attachment procedures
1604 */
1605 EXTERN UBYTE att_get_index (USHORT arfcn);
1606
1607 enum forbidden_list_type_e
1608 {
1609 FORBIDDEN_LIST_NORMAL,
1610 FORBIDDEN_LIST_ROAMING
1611 };
1612 EXTERN void att_add_to_forb_list (int list_type,
1613 const T_plmn *plmn,
1614 USHORT lac);
1615 EXTERN void att_analyze_measure_report (T_MPH_MEASUREMENT_IND *report);
1616 EXTERN void att_bcch_status_to_decoded (UBYTE index);
1617 EXTERN void att_bits_to_byte (UBYTE *num,
1618 UBYTE size,
1619 UBYTE *bits);
1620 #ifdef REL99
1621 EXTERN void att_config_cbch (void);
1622 #else
1623 EXTERN void att_build_cbch (void);
1624 #endif
1625 EXTERN void att_build_classmark_req (void);
1626 EXTERN void att_build_idle_req (UBYTE index,
1627 UBYTE mode);
1628 EXTERN void att_calculate_c1 (UBYTE index);
1629
1630 GLOBAL BOOL att_cell_barred_status_cr_no_cr (UBYTE index);
1631
1632 EXTERN void att_check_bcch_carrier (void);
1633 EXTERN void att_check_bcch_carrier_si (void);
1634 EXTERN void att_check_neighbourcell (void);
1635 EXTERN void att_check_neighbourcell_si_reestab (void);
1636 EXTERN void att_check_fplmn_cell (void);
1637 EXTERN void att_check_reselect_decision (UBYTE start_now);
1638 EXTERN void att_check_barred_status_in_idle (void);
1639 EXTERN UBYTE att_check_network (T_loc_area_ident *lai);
1640 EXTERN void att_clear_registration_data (void);
1641 EXTERN void att_clear_reg_without_imsi (void);
1642 EXTERN void att_code_mph_ncell_req (UBYTE index);
1643 EXTERN void att_code_mph_ncell_req_dedicated (void);
1644
1645 EXTERN void att_code_rr_abort_ind_original (T_RR_DATA *rr_data, USHORT cause);
1646 EXTERN void att_code_net_lost (void);
1647 EXTERN void att_code_rr_act_cnf (void);
1648 EXTERN void att_code_rr_act_ind (void);
1649 EXTERN void att_continue_cell_reselect (void);
1650
1651 EXTERN void att_copy_sys_info_1_par (UBYTE index,
1652 T_D_SYS_INFO_1 *sys_info_1,
1653 T_LIST *cell_chan_desc);
1654 EXTERN void att_copy_sys_info_2_par (UBYTE index,
1655 T_D_SYS_INFO_2 *sys_info_2,
1656 T_LIST *new_2_list,
1657 UBYTE ncell_ext,
1658 UBYTE indicate_changes);
1659 EXTERN void att_copy_sys_info_2bis_par (UBYTE index,
1660 T_D_SYS_INFO_2BIS *sys_info_2bis,
1661 T_LIST *new_2bis_list,
1662 UBYTE ncell_ext,
1663 UBYTE indicate_changes);
1664 EXTERN void att_copy_sys_info_2ter_par (UBYTE index,
1665 T_D_SYS_INFO_2TER *sys_info_2ter,
1666 T_LIST *new_2ter_list,
1667 UBYTE indicate_changes);
1668 EXTERN void att_copy_sys_info_3_par (UBYTE index,
1669 T_D_SYS_INFO_3 *sys_info_3,
1670 UBYTE indicate_changes);
1671 EXTERN void att_copy_sys_info_4_par (UBYTE index,
1672 T_D_SYS_INFO_4 *sys_info_4,
1673 UBYTE indicate_changes);
1674 EXTERN void att_copy_sys_info_7_8_par (UBYTE index,
1675 T_D_SYS_INFO_8 *sys_info_8);
1676 EXTERN void att_copy_c2_parameter_si4 (UBYTE index,
1677 T_si4_rest_oct *rest_oct);
1678
1679 EXTERN void att_handle_rr_act_req (UBYTE initial_act,
1680 T_RR_ACTIVATE_REQ *rr_activate_req);
1681 EXTERN void att_increase_power_on_time (USHORT inc);
1682 EXTERN void att_init_cell_selection (UBYTE selection,
1683 BOOL initiator);
1684 EXTERN void att_init_gsm_data (void);
1685 EXTERN void att_init_pl_status (void);
1686 EXTERN SHORT att_max (SHORT a,
1687 SHORT b);
1688 EXTERN T_FOUND_ELEMENT *att_plmn_in_found_list (UBYTE *mcc,
1689 UBYTE *mnc);
1690 EXTERN void att_save_found_plmn (T_FOUND_ELEMENT *element,
1691 UBYTE mcc[],
1692 UBYTE mnc[],
1693 USHORT arfcn,
1694 UBYTE rxlev,
1695 USHORT lac,
1696 UBYTE cell_ok);
1697
1698 EXTERN void att_remove_bad_ncell (T_MPH_MEASUREMENT_IND *report);
1699 EXTERN void att_reset_old_lai_rac();
1700 EXTERN void att_copy_old_lai_rac (U8 index);
1701 #if defined(_SIMULATION_FFS_)
1702 GLOBAL UBYTE rr_csf_mcc_present (UBYTE* mcc_value);
1703 #endif
1704 EXTERN void att_clean_buf (USHORT si_to_clean);
1705 EXTERN void att_remove_bad_rr_data_ncells(void);
1706 EXTERN void att_rem_lai_from_forb_list (const T_plmn *plmn,
1707 USHORT lac);
1708 EXTERN void att_set_pl_in_idle_mode (void);
1709 EXTERN void att_set_sys_info_read (USHORT mess_bit,
1710 UBYTE index);
1711 EXTERN void att_start_cell_reselection (UBYTE mode);
1712 EXTERN void att_start_cr_in_pl (UBYTE index);
1713 EXTERN void att_start_cell_selection (BOOL originator, BOOL parallel, U8 search_mode);
1714
1715 EXTERN void att_remove_multiple_channels(void);
1716 EXTERN void att_mph_identity_req (void);
1717 EXTERN void att_start_registration_timer(void);
1718 EXTERN void att_set_func (UBYTE func);
1719
1720 EXTERN void att_copy_cr_data (void);
1721 EXTERN void att_init_cr_data (void);
1722
1723 EXTERN void att_check_reestablishment (void);
1724 EXTERN UBYTE att_get_power (void);
1725 EXTERN void att_return_to_idle (void);
1726 EXTERN void att_notify_stop_plmn_search (UBYTE deactivate_pl);
1727 EXTERN void att_leave_dat_imm_ass (void);
1728 EXTERN void att_leave_dedicated (void);
1729 EXTERN void att_stop_dedicated (void);
1730 EXTERN void att_copy_eplmn_list (T_eq_plmn_list *eq_plmn_list);
1731 EXTERN void att_store_plmn_in_found_list (T_loc_area_ident *lai);
1732 #if defined (REL99) && defined (TI_PS_FF_EMR)
1733 EXTERN void attf_send_enh_para_to_alr (UBYTE rep_type,T_enh_para_struct *p_src);
1734 #ifdef GPRS
1735 EXTERN void att_send_enh_para_to_grr(T_rr_enh_para *p_src);
1736 #endif
1737 #endif
1738
1739 #if !defined(NTRACE)
1740 /* Implements Measure#32: Row 52, 53, 124 & 125 */
1741 EXTERN void att_print_mcc_mnc (USHORT arfcn,
1742 UBYTE *mcc,
1743 UBYTE *mnc,
1744 T_S2I_STRING titel); /* a valid string is expected */
1745 #else
1746 #define att_print_mcc_mnc(arfcn,mcc,mnc,titel)
1747 #endif /* !NTRACE */
1748 EXTERN void att_check_dynamic_search_mode_config(void);
1749 EXTERN void att_full_service_found(void);
1750 EXTERN void att_set_rr_service_info(void);
1751 EXTERN void att_set_tim_advance_info (void);
1752 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
1753 EXTERN void att_update_std_band_indicator (UBYTE band_indicator);
1754 #endif
1755
1756
1757 /*
1758 * Data-Transfer
1759 */
1760
1761 /*
1762 * data-transfer primitives
1763 */
1764 EXTERN void dat_init_rr_data (void);
1765 EXTERN void dat_dl_establish_cnf (T_DL_ESTABLISH_CNF *dl_establish_cnf);
1766 EXTERN void dat_dl_establish_ind (T_DL_ESTABLISH_IND *dl_establish_ind);
1767 EXTERN void dat_mph_random_access_cnf (T_MPH_RANDOM_ACCESS_CNF *mph_random_access_cnf);
1768 EXTERN void dat_dl_release_cnf (T_DL_RELEASE_CNF *dl_release_cnf);
1769 EXTERN void dat_dl_release_ind (T_DL_RELEASE_IND *dl_release_ind);
1770 EXTERN void dat_mph_dedicated_cnf (T_MPH_DEDICATED_CNF *mph_dedicated_cnf);
1771 EXTERN void dat_mph_dedicated_fail_cnf (T_MPH_DEDICATED_FAIL_CNF *mph_dedicated_fail_cnf);
1772 EXTERN void dat_rr_abort_req (T_RR_ABORT_REQ *rr_abort_req);
1773 EXTERN void dat_rr_data_req (T_RR_DATA_REQ *rr_data_req);
1774 EXTERN void dat_rr_establish_req (T_RR_ESTABLISH_REQ *rr_establish_req);
1775 EXTERN void dat_mph_paging_ind (T_MPH_PAGING_IND *mph_paging_ind);
1776 EXTERN void dat_begin_start_immediate_assign (UBYTE id_type, UBYTE chan_need);
1777 #if defined FF_EOTD
1778 EXTERN void dat_rrlc_meas_req (T_RRLC_MEAS_REQ *rrlc_meas_req);
1779 EXTERN void dat_rrrrlp_data_req (T_RRRRLP_DATA_REQ *rrrrlp_data_req);
1780 #endif /* FF_EOTD */
1781 #if defined (REL99) && defined (TI_PS_FF_EMR)
1782 EXTERN void dat_update_emr_rep_para (T_emp *p_em, T_enh_para_struct *p_enh);
1783 #endif
1784
1785 /*
1786 * data-transfer signalling
1787 */
1788 EXTERN void dat_att_cell_selected (void);
1789 EXTERN void dat_att_null (void);
1790 EXTERN void dat_for_assign_cmd (T_DL_DATA_IND *dl_data_ind,
1791 T_D_ASSIGN_CMD *assign_cmd,
1792 T_LIST *hop_list_after,
1793 T_LIST *hop_list_before,
1794 T_LIST *cell_chan_desc);
1795 EXTERN void dat_for_chan_mod (T_DL_DATA_IND *dl_data_ind,
1796 T_D_CHAN_MOD *chan_mod);
1797 EXTERN void dat_for_chan_rel (T_DL_DATA_IND *dl_data_ind,
1798 T_D_CHAN_REL *chan_rel);
1799 #ifdef REL99
1800 EXTERN void dat_for_class_enq (T_DL_DATA_IND *dl_data_ind,
1801 T_D_CLASS_ENQ *class_enq);
1802 #else
1803 EXTERN void dat_for_class_enq (T_DL_DATA_IND *dl_data_ind);
1804 #endif
1805 EXTERN void dat_for_close_loop_cmd (T_DL_DATA_IND *dl_data_ind,
1806 UBYTE subchannel);
1807 EXTERN void dat_for_ciph_cmd (T_DL_DATA_IND *dl_data_ind,
1808 T_D_CIPH_CMD *ciph_cmd);
1809 EXTERN void dat_for_freq_redef (T_DL_DATA_IND *dl_data_ind,
1810 T_D_FREQ_REDEF *freq_redef,
1811 T_LIST *cell_chan_desc);
1812 EXTERN void dat_for_handov_cmd (T_DL_DATA_IND *dl_data_ind,
1813 T_D_HANDOV_CMD *handov_cmd,
1814 T_LIST *cell_chan_desc,
1815 T_LIST *hop_list_after,
1816 T_LIST *hop_list_before);
1817 EXTERN void dat_for_l3_data_ind (T_DL_DATA_IND *dl_data_ind);
1818 EXTERN void dat_for_open_loop_cmd (T_DL_DATA_IND *dl_data_ind);
1819 EXTERN void dat_for_test_interface (T_DL_DATA_IND *dl_data_ind,
1820 UBYTE device);
1821 EXTERN void dat_for_imm_assign (T_MPH_UNITDATA_IND *mph_unitdata_ind,
1822 T_D_IMM_ASSIGN *imm_assign);
1823 EXTERN void dat_for_imm_assign_ext (T_MPH_UNITDATA_IND *mph_unitdata_ind,
1824 T_D_IMM_ASSIGN_EXT *imm_assign_ext);
1825 EXTERN void dat_for_imm_assign_rej (T_D_IMM_ASSIGN_REJ *imm_assign_rej);
1826
1827 EXTERN void dat_for_ext_meas_order (T_D_EXT_MEAS_ORDER *ext_meas_order);
1828 #if defined FF_EOTD
1829 EXTERN void rr_applic_rx_init (T_APPLIC_RX *applic_rx);
1830 EXTERN void dat_for_applic_info (T_B_APPLIC_INFO *b_applic_info);
1831 #endif /* FF_EOTD */
1832 GLOBAL void dat_class_chng_data_req (void);
1833 GLOBAL BOOL dat_hplmn (const UBYTE *mcc, const UBYTE *mnc);
1834 #if defined (REL99) && defined (TI_PS_FF_EMR)
1835 EXTERN BOOL dat_for_meas_inf (T_D_MEAS_INF *p_mi);
1836 #endif
1837
1838 /*
1839 * data-transfer procedures
1840 */
1841 EXTERN BOOL dat_access_allowed (USHORT estcs);
1842 EXTERN UBYTE dat_calc_downlink_timeout (UBYTE index);
1843 EXTERN UBYTE dat_calc_paging_group (UBYTE index);
1844 EXTERN UBYTE dat_calc_tn (UBYTE index);
1845 EXTERN BOOL dat_check_error_flag (BOOL send_rr_status);
1846 EXTERN void dat_code_channel_mode_to_mm (void);
1847 EXTERN void dat_code_reestablishment_fail (void);
1848 EXTERN void dat_code_ciphering_to_mm (UBYTE ciph_on);
1849 EXTERN void dat_code_measure_report (T_MPH_MEASUREMENT_IND *report);
1850 EXTERN void dat_code_ext_meas_report (T_MPH_EMO_MEAS_IND *mph_emo_meas_ind);
1851 EXTERN void dat_emo_stop (BOOL send_ncell_req);
1852
1853 EXTERN void dat_code_mph_chan_mode_req (T_D_CHAN_MOD *chan_mod);
1854 EXTERN void dat_code_mph_ciphering_req (UBYTE ciph_on,
1855 UBYTE algo,
1856 UBYTE *kc);
1857 EXTERN void dat_code_mph_imm_assign_req (T_start *start,
1858 UBYTE power,
1859 UBYTE maio,
1860 T_LIST *hop_list_after,
1861 T_LIST *hop_list_bef);
1862 EXTERN void dat_code_sys_info_change (UBYTE dtx,
1863 UBYTE pwrc,
1864 UBYTE rlt);
1865 EXTERN void dat_code_mph_freq_redef_req (T_start *start,
1866 T_LIST *hop_list);
1867 EXTERN void dat_code_mph_old_chan_req (void);
1868 EXTERN void dat_code_prr_channel (UBYTE *ch_type,
1869 UBYTE *sapi,
1870 UBYTE chan_type);
1871 EXTERN void dat_code_prr_channel_sms (T_DL_DATA_REQ *dl_data_req,
1872 UBYTE chan_type);
1873 EXTERN void dat_code_prr_bcch_info (UBYTE v_ba_range,
1874 T_ba_range *ba_range);
1875 EXTERN BOOL dat_compare_request_ref (T_req_ref *req_ref,
1876 UBYTE *index);
1877 EXTERN void dat_disconnect_link (USHORT cause);
1878 EXTERN BOOL dat_forb_lai_check (UBYTE index);
1879 EXTERN BOOL dat_roam_forb_lai_check (UBYTE index);
1880
1881 EXTERN BOOL dat_plmn_equal_req (const UBYTE *bcch_mcc,
1882 const UBYTE *bcch_mnc,
1883 const UBYTE *sim_mcc,
1884 const UBYTE *sim_mnc);
1885
1886 EXTERN USHORT dat_random (USHORT n);
1887 EXTERN void dat_release_connection (void);
1888 EXTERN void dat_set_last_used_channel (T_chan_desc *chan_desc);
1889 EXTERN void dat_start_immediate_assign (USHORT cause);
1890 EXTERN void dat_start_sabm (void);
1891 EXTERN BOOL dat_test_sim_available (void);
1892 EXTERN BOOL dat_check_sim_available (void);
1893 EXTERN void dat_vsd_bit_set (T_L3_SDU *m_buf,
1894 UBYTE action);
1895 EXTERN void dat_send_bcchinfo_mm (U8 *p);
1896 EXTERN void dat_convert_white_list (void);
1897 EXTERN void dat_store_neigh_cell_desc (U8 si, U8 index, BUF_neigh_cell_desc *cd,
1898 T_LIST *new_neigh_list);
1899
1900 EXTERN void dat_begin_start_immediate_assign (UBYTE id_type, UBYTE chan_need);
1901 EXTERN void dat_rr_release_ind (USHORT relcs, UBYTE sapi);
1902 EXTERN void dat_send_release_ind (USHORT relcs);
1903 EXTERN void dat_send_assign_fail_msg (UBYTE cause);
1904 EXTERN void dat_send_rr_status_msg (UBYTE cause);
1905 EXTERN void dat_send_handov_fail_msg (UBYTE cause);
1906 #if defined (REL99) && defined (TI_PS_FF_EMR)
1907 EXTERN void dat_code_enh_measure_report (T_MPH_MEASUREMENT_IND *report);
1908 #endif
1909
1910 #if defined (TI_PS_FF_RTD) AND defined (REL99)
1911 EXTERN void dat_update_rtd_data (T_D_MEAS_INF *p_mi,T_rr_enh_para *p_temp);
1912 EXTERN void dat_update_common_rtd_struct (T_rtdd *rtdd_struct,T_rr_enh_para *p_temp);
1913 #endif /* #if defined (TI_PS_FF_RTD) AND defined (REL99) */
1914 /*
1915 * Formatter
1916 */
1917
1918 /*
1919 * formatter primitives
1920 */
1921 EXTERN void for_mph_unitdata_ind (T_MPH_UNITDATA_IND *mph_unitdata_ind);
1922 EXTERN void for_dl_data_ind (T_DL_DATA_IND *dl_data_ind);
1923 #if defined (REL99) && defined (TI_PS_FF_EMR)
1924 EXTERN void for_dl_short_unitdata_ind (T_DL_SHORT_UNITDATA_IND *dl_short_unitdata_ind);
1925 #endif
1926 EXTERN void for_rr_trace_message (UBYTE *payload,
1927 USHORT length,
1928 USHORT arfcn,
1929 ULONG fn,
1930 UBYTE direction);
1931 /*
1932 * formatter signalling
1933 */
1934 EXTERN void for_dat_data_req (T_DL_DATA_REQ *data_req);
1935 EXTERN void for_dat_est_req (T_DL_ESTABLISH_REQ *est_req);
1936 EXTERN void for_dat_est_req_not_coding (T_DL_ESTABLISH_REQ *est_req);
1937 EXTERN void for_dat_est_req_content (T_DL_ESTABLISH_REQ *est_req_content);
1938 EXTERN void for_dat_l3_data_req (T_DL_DATA_REQ *dl_data_req);
1939 EXTERN void for_dat_reconnect_req (T_DL_RECONNECT_REQ *reconnect_req);
1940 EXTERN void for_dat_resume_req (T_DL_RESUME_REQ *resume_req);
1941 EXTERN void for_dat_unitdata_req (T_DL_UNITDATA_REQ *unitdata_req);
1942 #if defined (REL99) && defined (TI_PS_FF_EMR)
1943 EXTERN void for_update_ba_ind (UBYTE index, UBYTE ba_ind);
1944 EXTERN void for_check_and_configure_si2quater (UBYTE index);
1945 EXTERN void for_att_update_ba2bsic_mapping (T_rr_enh_para *p_enh);
1946 EXTERN BOOL for_dat_process_common_emr_data (T_gprs_rep_prio *p_rep,
1947 T_gprs_bsic *p_bl,
1948 UBYTE msg_index,
1949 BOOL ba_available);
1950 EXTERN void for_dat_spd_unitdata_req (T_DL_SHORT_UNITDATA_REQ *p_msg);
1951 #endif
1952
1953 /*
1954 * formatter procedures
1955 */
1956 EXTERN void for_check_assign_cmd (T_DL_DATA_IND *dl_data_ind,
1957 T_D_ASSIGN_CMD *ass_cmd);
1958 EXTERN BOOL for_check_ba_range (T_ba_range *ba_range);
1959 EXTERN void for_check_cell_descr (T_cell_desc *cell_desc);
1960 EXTERN void for_check_channel_descr (T_chan_desc *chan_desc);
1961 EXTERN void for_check_channel_mode (UBYTE ch_mod);
1962 EXTERN void for_check_multirate_conf (T_multirate_conf * multirate_conf, UBYTE chan_type);
1963 EXTERN void for_check_cipher_mode_set (T_ciph_mode_set *ciph);
1964 EXTERN void for_check_handov_cmd (T_DL_DATA_IND *dl_data_ind,
1965 T_D_HANDOV_CMD *handov_cmd);
1966 EXTERN void for_create_channel_list (T_f_range *f_range,
1967 T_LIST *cha_list);
1968
1969 EXTERN void for_suspend_layer_2 (void);
1970 #if defined (REL99) && defined (TI_PS_FF_EMR)
1971 EXTERN BOOL for_process_si2quater(T_si_2qua_octets *p_si2q);
1972 EXTERN void for_update_emr_rep_para(T_si_2qua_octets *p_si2q,T_rr_enh_para *p_em);
1973 EXTERN void for_set_default_emr_data(T_rr_enh_para *p_em);
1974 EXTERN void for_send_enh_para(T_rr_enh_para *p_src);
1975 EXTERN BOOL for_update_enh_cell_list (USHORT *p_list);
1976 EXTERN BOOL for_process_common_emr_data (T_gprs_rep_prio *p_rep,
1977 T_gprs_bsic *p_bsic,
1978 UBYTE msg_index,
1979 BOOL ba_available);
1980 EXTERN void for_mon_si2quater_req(UBYTE action);
1981 #endif
1982
1983 #if defined (TI_PS_FF_RTD) AND defined (REL99)
1984 EXTERN void for_store_rtd_data (T_si_2qua_octets *p_si2q,T_rr_enh_para *p_temp);
1985 #endif /* #if defined (TI_PS_FF_RTD) AND defined (REL99) */
1986
1987
1988 /*
1989 * If all entities are linked into one module this definitions
1990 * prefixes all this functions with the enity name
1991 */
1992 #ifdef OPTION_MULTITHREAD
1993 #define for_set_content_error _ENTITY_PREFIXED(for_set_content_error)
1994 #endif
1995
1996 EXTERN UBYTE for_check_frequency (USHORT channel);
1997 EXTERN void for_set_content_error (UBYTE value);
1998
1999 EXTERN void rr_csf_read_imei (T_mob_ident *imei);
2000
2001 /*----------------------------------------------------------------------
2002 * functions called from other entities
2003 *---------------------------------------------------------------------*/
2004 /*lint -esym(759,rr_csf_get_radio_access_capability)*/
2005 /*lint -esym(759,rr_csf_get_classmark1)*/
2006 /*lint -esym(759,rr_csf_get_classmark2)*/
2007 /*lint -esym(759,rr_csf_get_rf_capability)*/
2008 #ifdef GPRS
2009 EXTERN UBYTE rr_csf_get_radio_access_capability
2010 (T_ra_cap *ra_cap);
2011 #endif
2012 EXTERN UBYTE rr_csf_get_classmark1 (T_mob_class_1 *mob_class_1);
2013 EXTERN UBYTE rr_csf_get_classmark2 (T_mob_class_2 *mob_class_2);
2014 EXTERN T_rf_cap* rr_csf_get_rf_capability (void);
2015
2016
2017 EXTERN UBYTE rr_csf_fit_capability (void);
2018 EXTERN void rr_csf_ms_cap (void);
2019 EXTERN void rr_csf_read_rfcap (void);
2020 EXTERN void rr_csf_check_rfcap (UBYTE init);
2021 EXTERN void rr_csf_get_freq_bands (UBYTE *pfreq_bands);
2022 GLOBAL void rr_csf_trace_power (void);
2023
2024 #ifdef REL99
2025 /*
2026 * Function added to get MSCR flag informaion that used in send sequence number
2027 */
2028 EXTERN void get_msc_release_version(UBYTE* mscr);
2029 #endif
2030
2031 #if defined(_SIMULATION_FFS_)
2032 GLOBAL void rr_csf_ffs_init (void);
2033 GLOBAL void cs_store_white_list (void);
2034 GLOBAL void rr_csf_write_black_list (T_LIST *black_list);
2035 GLOBAL void rr_csf_read_black_list (void);
2036 GLOBAL void rr_csf_write_white_list (T_CS_WHITE_LIST *white_list);
2037 GLOBAL void rr_csf_read_white_list (void);
2038 GLOBAL void rr_csf_write_rxlev_thr (UBYTE rxt, SHORT valno, char* val[MAX_NUM_BANDS]);
2039 GLOBAL void rr_csf_read_rxlev_thr (void);
2040 GLOBAL void rr_csf_write_mcc_shield_to_ffs (void);
2041 #endif /* _SIMULATION_FFS_ */
2042
2043 /*
2044 * timer
2045 */
2046 #define TIMERSTART(i,v) tim_start_timer (i, v)
2047 #define TIMERSTOP(i) tim_stop_timer (i)
2048 #if defined(TIMER_TRACE)
2049 #define IS_TIMER_ACTIVE(i) tim_check_timer(i)
2050 #else /* TIMER_TRACE */
2051 #define IS_TIMER_ACTIVE(i) (rr_data->t_running[i])
2052 #endif /* TIMER_TRACE */
2053 /*
2054 * RR services
2055 */
2056 /*
2057 * If all entities are linked into one module this definitions
2058 * prefixes all this functions with the enity name
2059 */
2060 #ifdef OPTION_MULTITHREAD
2061 #define srv_store_prim _ENTITY_PREFIXED(srv_store_prim)
2062 #define srv_use_stored_prim _ENTITY_PREFIXED(srv_use_stored_prim)
2063 #define srv_clear_stored_prim _ENTITY_PREFIXED(srv_clear_stored_prim)
2064 #define srv_check_stored_prim _ENTITY_PREFIXED(srv_check_stored_prim)
2065 /* obsolete
2066 #define srv_find_stored_prim _ENTITY_PREFIXED(srv_find_stored_prim)
2067 #define srv_flush_stored_prim _ENTITY_PREFIXED(srv_flush_stored_prim)
2068 */
2069 #endif
2070 EXTERN BOOL srv_store_prim (T_PRIM *prim);
2071 EXTERN void srv_use_stored_prim (void);
2072 EXTERN void srv_clear_stored_prim (ULONG opc);
2073 EXTERN UBYTE srv_check_stored_prim (ULONG opc);
2074 /* obsolete
2075 EXTERN UBYTE srv_find_stored_prim (ULONG opc);
2076 */
2077
2078 #if defined (REL99) && defined (TI_PS_FF_EMR)
2079 #define DEFAULT_SERV_BAND_REP 3 /*Number of cells to be reported in EMR for serving band*/
2080 #endif
2081
2082 EXTERN void srv_remove_frequencies_in_array (USHORT* arfcn_list);
2083 EXTERN UBYTE srv_remove_frequencies_in_array_gen (USHORT* arfcn_list, UBYTE c_arfcn_list);
2084
2085 EXTERN int srv_create_chan_mob_alloc (T_LIST *clist,
2086 T_LIST *list,
2087 UBYTE *mobile_alloc);
2088 EXTERN int srv_check_frequencies_in_list (T_LIST *clist);
2089 EXTERN void srv_trace_black_list (void);
2090 EXTERN void srv_trace_white_list (void);
2091
2092 /* Access function in RR to get cell alloc list. Called from GRR*/
2093 /*lint -esym(759,srv_get_cell_alloc_list)*/
2094 /*lint -esym(759,srv_get_cell_alloc_list)*/
2095 EXTERN void srv_get_cell_alloc_list (T_LIST *target_list);
2096
2097 EXTERN void rr_pei_primitive (T_PRIM *prim);
2098 /*
2099 * RX
2100 *
2101 */
2102
2103 #ifdef FF_PS_RSSI
2104 EXTERN void RX_SetValue (UBYTE new_value, UBYTE new_qual, UBYTE new_access);
2105 #else
2106 EXTERN void RX_SetValue (UBYTE new_value);
2107 #endif
2108
2109 /*
2110 * Radio resource primitives Engineering Mode
2111 * Bitmask for the event tracing
2112 */
2113 EXTERN T_RR_DATA rr_data_base;
2114 #define GET_INSTANCE_DATA register T_RR_DATA *rr_data= &rr_data_base
2115
2116 #define ENTITY_DATA rr_data
2117
2118 /*
2119 * These Functions are only temporary valid and should replaced as soon as possible
2120 */
2121 /*lint -esym(759,get_network_meas)*/
2122 /*lint -esym(759,get_bcch_chan_list)*/
2123 EXTERN UBYTE get_network_meas (UBYTE * chan_list);
2124 EXTERN UBYTE get_bcch_chan_list (stk_data_type * out_stk_data);
2125
2126 #if !defined (_SIMULATION_)
2127 EXTERN UBYTE * dl_get_sacch_buffer (void);
2128 #endif
2129
2130
2131 /*
2132 * If all entities are linked into one module this definitions
2133 * prefixes the global data with the enity name
2134 */
2135 #ifdef TI_PS_HCOMM_CHANGE
2136 EXTERN T_HANDLE rr_handle;
2137 #else /* for hCommHandles backward compatibility */
2138 #ifdef OPTION_MULTITHREAD
2139 #define hCommMM _ENTITY_PREFIXED(hCommMM)
2140 #if defined FF_EOTD
2141 #define hCommLC _ENTITY_PREFIXED(hCommLC)
2142 #define hCommRRLP _ENTITY_PREFIXED(hCommRRLP)
2143 #endif /* FF_EOTD */
2144 #define hCommDL _ENTITY_PREFIXED(hCommDL)
2145 #define hCommPL _ENTITY_PREFIXED(hCommPL)
2146 #define hCommMMI _ENTITY_PREFIXED(hCommMMI)
2147 #ifdef FF_WAP
2148 #define hCommWAP _ENTITY_PREFIXED(hCommWAP) /*FMM */
2149 #endif
2150 #endif
2151
2152 EXTERN T_HANDLE hCommMM; /* MM Communication */
2153 #if defined FF_EOTD
2154 EXTERN T_HANDLE hCommLC; /* LC Communication */
2155 EXTERN T_HANDLE hCommRRLP; /* RRLP Communication */
2156 #endif /* FF_EOTD */
2157 EXTERN T_HANDLE hCommDL; /* DL Communication */
2158 EXTERN T_HANDLE hCommPL; /* PL Communication */
2159 EXTERN T_HANDLE rr_handle;
2160 EXTERN T_HANDLE hCommMMI; /* EM Communication */
2161 #ifdef FF_WAP
2162 EXTERN T_HANDLE hCommWAP; /* FMM Communication */
2163 #endif
2164 #endif /* TI_PS_HCOMM_CHANGE */
2165
2166 /*
2167 * If all entities are linked into one module this definitions
2168 * prefixes the global data with the enity name
2169 */
2170 #ifdef OPTION_MULTITHREAD
2171 #define _decodedMsg _ENTITY_PREFIXED(_decodedMsg)
2172 #endif
2173
2174 #if defined (REL99) && defined (TI_PS_FF_EMR)
2175 #define MAX_MSTRUCT_CCD_RR MAXIMUM(MAX_MSTRUCT_LEN_RR_SHORT, MAX_MSTRUCT_LEN_RR)
2176 EXTERN UBYTE _decodedMsg [MAX_MSTRUCT_CCD_RR];
2177 #else
2178 EXTERN UBYTE _decodedMsg [MAX_MSTRUCT_LEN_RR];
2179 #endif
2180
2181 #ifdef OPTION_TIMER
2182 /*
2183 * If all entities are linked into one module this definitions
2184 * prefixes the global data with the entity name
2185 */
2186 #ifdef OPTION_MULTITHREAD
2187 #define partab _ENTITY_PREFIXED(partab)
2188 #endif
2189
2190 /* EXTERN const KW_DATA partab[];*/
2191 #endif
2192
2193 /*
2194 * backward compatibility for some channel modes
2195 */
2196 #if !defined CM_DATA_14_4
2197 #define CM_DATA_14_4 0x0F
2198 #define CM_EFR 0x21
2199 #endif
2200
2201 /*
2202 * Definitions for AMR
2203 */
2204 #define CM_AMR 0x41
2205 #define MAX_NO_ACS 0x04
2206 /*#define MAX_CODEC_MODES 0x03*/
2207
2208 /* FreeCalypso change: same as in ../dl/dl.h */
2209 #if 0 && !defined(_FILE10_)
2210 #define __FILE10__ (__FILE__+sizeof(__FILE__)-11)
2211 #endif /* !_FILE10_ */
2212
2213 #if defined(SYST_TRACE)
2214 #undef SYST_TRACE
2215 #undef SYST
2216 #undef SYST_TRACE_P
2217 #endif /* !SYST_TRACE */
2218 #if defined(NEW_FRAME)
2219 #define SYST_TRACE(a) vsi_o_ttrace((T_HANDLE)0, (ULONG)-1,a)
2220 #define SYST (T_HANDLE)0, (ULONG)-1
2221 #define SYST_TRACE_P(a) vsi_o_ttrace a
2222 #else
2223 #define SYST_TRACE(a) vsi_o_trace("", 0xFFFF,a)
2224 #define SYST "", 0xffff
2225 #define SYST_TRACE_P(a) vsi_o_trace a
2226 #endif /* NEW_FRAME */
2227 /*
2228 * use it as showed next line...
2229 * SYST_TRACE_P((SYST, "e.g. two parameter: %d %d", p1, p2));
2230 */
2231
2232 #if defined(DL_TRACE_ENABLED)
2233 EXTERN void dl_trace (UCHAR trace_type,
2234 UCHAR channel,
2235 UCHAR ch_type,
2236 UCHAR * data);
2237 #ifdef OPTION_MULTITHREAD
2238 #define dl_trace_buf _ENTITY_PREFIXED(dl_trace_buf)
2239 #endif
2240 #if defined(RR_PEI_C)
2241 GLOBAL char dl_trace_buf[100];
2242 #else /* RR_PEI_C */
2243 EXTERN char dl_trace_buf[100];
2244 #endif /* RR_PEI_C */
2245 #define TRACE_RR_EVENT 5
2246 #define DOES_NOT_MATTER 0
2247 #define DL_OFFLINE_TRACE(s) \
2248 dl_trace (TRACE_RR_EVENT, DOES_NOT_MATTER, DOES_NOT_MATTER, (UCHAR*)s)
2249 #endif /* DL_TRACE_ENABLED */
2250
2251 #if defined(ARRAY_TRACE)
2252 #ifdef OPTION_MULTITHREAD
2253 #define array_trace _ENTITY_PREFIXED(array_trace)
2254 #endif
2255 EXTERN void array_trace (UBYTE*array, int size, char *titel);
2256 #define TRACE_ARRAY(array, size, titel) array_trace(array, size, titel)
2257 #else /* ARRAY_TRACE */
2258 #define TRACE_ARRAY(array, size, titel)
2259 #endif /* ARRAY_TRACE */
2260
2261 #if defined(_SIMULATION_)
2262 #define TRACE_EVENT_WIN(s) TRACE_EVENT(s)
2263 #define TRACE_EVENT_WIN_P1(s,a1) TRACE_EVENT_P1(s,a1)
2264 #define TRACE_EVENT_WIN_P2(s,a1,a2) TRACE_EVENT_P2(s,a1,a2)
2265 #define TRACE_EVENT_WIN_P3(s,a1,a2,a3) TRACE_EVENT_P3(s,a1,a2,a3)
2266 #define TRACE_EVENT_WIN_P4(s,a1,a2,a3,a4) TRACE_EVENT_P4(s,a1,a2,a3,a4)
2267 #define TRACE_EVENT_WIN_P5(s,a1,a2,a3,a4,a5) TRACE_EVENT_P5(s,a1,a2,a3,a4,a5)
2268 #define TRACE_EVENT_WIN_P6(s,a1,a2,a3,a4,a5,a6) TRACE_EVENT_P6(s,a1,a2,a3,a4,a5,a6)
2269 #define TRACE_EVENT_WIN_P7(s,a1,a2,a3,a4,a5,a6,a7) TRACE_EVENT_P7(s,a1,a2,a3,a4,a5,a6,a7)
2270 /*#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)
2271 #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)*/
2272
2273 /* trace for call of att_code_rr_abort_ind() */
2274 /* Implements Measure#32: Row 18, 43, 90, 101, 111, 201, 211, and 324
2275 * Row 17, 41, 89, 100, 110, 200, 210, and 321 */
2276 #define att_code_rr_abort_ind_trace(c) \
2277 { TRACE_EVENT_WIN_P2 ("att_code_rr_abort_ind(%x=%s)", c, S2I_STRING(#c));\
2278 att_code_rr_abort_ind_original(rr_data, c);}
2279
2280
2281 #else /* _SIMULATION_ */
2282 #define TRACE_EVENT_WIN(s)
2283 #define TRACE_EVENT_WIN_P1(s,a1)
2284 #define TRACE_EVENT_WIN_P2(s,a1,a2)
2285 #define TRACE_EVENT_WIN_P3(s,a1,a2,a3)
2286 #define TRACE_EVENT_WIN_P4(s,a1,a2,a3,a4)
2287 #define TRACE_EVENT_WIN_P5(s,a1,a2,a3,a4,a5)
2288 #define TRACE_EVENT_WIN_P6(s,a1,a2,a3,a4,a5,a6)
2289 #define TRACE_EVENT_WIN_P7(s,a1,a2,a3,a4,a5,a6,a7)
2290 #define TRACE_EVENT_WIN_P8(s,a1,a2,a3,a4,a5,a6,a7,a8)
2291 #define TRACE_EVENT_WIN_P9(s,a1,a2,a3,a4,a5,a6,a7,a8,a9)
2292
2293 #define att_code_rr_abort_ind_trace(c) \
2294 { TRACE_EVENT_P4 ("att_code_rr_abort_ind(%x=%s) #%u %s", c, #c, __LINE__, __FILE__);\
2295 att_code_rr_abort_ind_original(rr_data, c);}
2296
2297
2298 #endif /* _SIMULATION_ */
2299
2300 #define att_code_rr_abort_ind att_code_rr_abort_ind_trace
2301
2302 /*
2303 * Tracing of Layer 3 RR Messages.
2304 */
2305
2306 #define RR_BINDUMP(payload,length,arfcn,fn,dir) for_rr_trace_message(payload,length,arfcn,fn,dir)
2307
2308 #endif