annotate src/g23m-gsm/alr2/alr_dedi.c @ 186:807fdc70cbd0

targets/gtm900mgc.h: sync with Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 15 Feb 2020 20:12:32 +0000
parents b4c81ea2d291
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project : GSM-PS
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul : alr_DEDI
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 | All rights reserved.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | Instruments Berlin, AG
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | Purpose : This Modul defines the SDL process Dedicated_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 +-----------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 #ifndef ALR_DEDI_C
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #define ALR_DEDI_C
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #define ENTITY_PL
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 /*==== INCLUDES ===================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #include <string.h>
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #include <stdlib.h>
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include <ctype.h>
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include "typedefs.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include "pconst.cdg"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "mconst.cdg"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #include "message.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #include "ccdapi.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #include "vsi.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #include "custom.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #include "gsm.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #include "prim.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #include "cnf_alr.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #include "mon_alr.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "pei.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "tok.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #include "pcm.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #ifdef GPRS
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 #include "alr_gprs.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #include "alr.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 #include "alr_em.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 /*=== Constrains =======================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #define TCH_F_INDEX 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 /*==== EXPORT =====================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 /*==== PRIVAT =====================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 LOCAL UBYTE dedi_channel_mode (UBYTE channel_mode, UBYTE channel_type);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 LOCAL void dedi_convert_chan_desc (T_channel_desc * channel_desc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 LOCAL void dedi_convert_frequency_list (T_frequency_list * frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 LOCAL UBYTE dedi_conversion_needed (void);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 LOCAL void dedi_chan_ass_fail (void);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 LOCAL void dedi_pdch_ass_fail (void);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 LOCAL void dedi_cco_fail (void);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 LOCAL void dedi_handover_fail (void);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 LOCAL void dedi_async_handover (T_MPH_DEDICATED_REQ *dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 LOCAL void dedi_chan_ass (T_MPH_DEDICATED_REQ *dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 LOCAL void dedi_fill_ma (USHORT *ma, T_frequency_list *rf);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 LOCAL void dedi_imm_ass (T_MPH_DEDICATED_REQ *dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 LOCAL void dedi_pdch_ass (T_MPH_DEDICATED_REQ *dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 LOCAL void dedi_pre_sync_handover (T_MPH_DEDICATED_REQ *dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 LOCAL void dedi_sync_handover (T_MPH_DEDICATED_REQ *dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 /*==== VARIABLES ==================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 LOCAL UBYTE actual_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 /*==== FUNCTIONS ==================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #if defined (WIN32)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 #define TRACING
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 #if defined (TRACING)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 #define ALR_TRACE_DEDI(a) ALR_TRACE(a)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 #else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 #define ALR_TRACE_DEDI(a)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 #if defined (TRACING)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 #define ALR_TRACE_DEDI_DTX(a1) TRACE_EVENT_P1 ("DTX = %d", a1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #define ALR_TRACE_DEDI_PARA(h, rf, _ch, sub, _tno, _tsc, _ta, _st, _dtx, _maio)\
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 {if (h){\
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 TRACE_EVENT_P9 ("immass:hop[%04x] ch/s=%u/%u tno=%u tsc=%u ta=%u st=%u dtx=%u maio=%u",\
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 rf, _ch, sub, _tno, _tsc, _ta, _st, _dtx, _maio);\
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 }else{\
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 TRACE_EVENT_P9 ("immass:[%u] ch/s=%u/%u tno=%u tsc=%u ta=%u st=%u dtx=%u maio=%u",\
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 rf, _ch, sub, _tno, _tsc, _ta, _st, _dtx, _maio);}}
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 #define ALR_TRACE_DEDI_HO_1(p1,p2,p3,p4,p5,p6) \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 TRACE_EVENT_P6 ("d rf=%d bsic=%d sti=%d ch2=%d ch=%d tsc=%d",\
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 p1, p2, p3, p4, p5, p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 #define ALR_TRACE_DEDI_HO_2(p1,p2,p3,p4,p5,p6) \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 TRACE_EVENT_P6 ("d tn=%d arf=%d pow=%d ref=%d acc=%d nci=%d", \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 p1, p2, p3, p4, p5, p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 #define ALR_TRACE_DEDI_HO_3(p1,p2,p3,p4,p5,p6) \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 TRACE_EVENT_P6 ("d mode=%d power=%d dtx=%d rlt=%d tav=%d pwrc=%d", \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 p1, p2, p3, p4, p5, p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 #define ALR_TRACE_DEDI_HO_4(p1,p2,p3) \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 TRACE_EVENT_P3 ("d mode=%d stat=%d algo=%d", p1, p2, p3);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 #define ALR_TRACE_DEDI_HO_5(p1,p2,p3,p4,p5,p6) \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 TRACE_EVENT_P6 ("a h=%d maio=0x%x hsn=%d chty=%d subch=%d tno=%d", \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 p1, p2, p3, p4, p5, p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 #define ALR_TRACE_DEDI_HO_6(p1,p2,p3,p4,p5,p6) \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 TRACE_EVENT_P6 ("a tsc=%d txpwr=%d ho_acc=%d sti_p=%d ncc=%d bcc=%d", \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 p1, p2, p3, p4, p5, p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115 #define ALR_TRACE_DEDI_HO_7(p1,p2,p3,p4) \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 TRACE_EVENT_P4 ("a rf=%d chmo1=%d ciphmo=%d a5=%d", \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 p1, p2, p3, p4)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 #define ALR_TRACE_DEDI_FREQ_LIST() TRACE_EVENT_P2 ("HOP = %d %d", \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 frequency_list->rf_chan_no.radio_freq[j], \
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 ARFCN_TO_L1 (frequency_list->rf_chan_no.radio_freq[j]))
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 #else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 #define ALR_TRACE_DEDI_DTX(d)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 #define ALR_TRACE_DEDI_PARA(hop,p1,p2,p3,p4,p5,p6,p7,p8,p9)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 #define ALR_TRACE_DEDI_HO_1(p1,p2,p3,p4,p5,p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 #define ALR_TRACE_DEDI_HO_2(p1,p2,p3,p4,p5,p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 #define ALR_TRACE_DEDI_HO_3(p1,p2,p3,p4,p5,p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 #define ALR_TRACE_DEDI_HO_4(p1,p2,p3)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 #define ALR_TRACE_DEDI_HO_5(p1,p2,p3,p4,p5,p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 #define ALR_TRACE_DEDI_HO_6(p1,p2,p3,p4,p5,p6)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 #define ALR_TRACE_DEDI_HO_7(p1,p2,p3,p4)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 #define ALR_TRACE_DEDI_FREQ_LIST()
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 | PROJECT : GSM-PS (8403) MODULE : ALR_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 | STATE : code ROUTINE : dedi_init |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 PURPOSE : Initialize Dedicated Control Process.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 GLOBAL void dedi_init (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 alr_data->state[STATE_DEDI] = DEDI_INACTIVE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 | PROJECT : GSM-PS (8403) MODULE : ALR_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 | STATE : code ROUTINE : dedi_req |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 PURPOSE : Process signal dedi_req from SDL process Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 RR configures a dedicated channel.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 * Conversion Channel Type Air Interface to TI definition
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 LOCAL const UBYTE CH_TYPE [16] =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 0, /* undefined */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 1, /* TCH fullrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 2, /* TCH halfrate (0) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 2, /* TCH halfrate (1) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 3, /* SDCCH/4 (0) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 3, /* SDCCH/4 (1) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 3, /* SDCCH/4 (2) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 3, /* SDCCH/4 (3) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 4, /* SDCCH/8 (0) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 4, /* SDCCH/8 (1) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 4, /* SDCCH/8 (2) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 4, /* SDCCH/8 (3) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 4, /* SDCCH/8 (4) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 4, /* SDCCH/8 (5) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 4, /* SDCCH/8 (6) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 4 /* SDCCH/8 (7) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 };
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 * Conversion Sub Channel Air Interface to TI definition
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 LOCAL const UBYTE SUB_TYPE [16] =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 0, /* undefined */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 0, /* TCH fullrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 0, /* TCH halfrate (0) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 1, /* TCH halfrate (1) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 0, /* SDCCH/4 (0) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 1, /* SDCCH/4 (1) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 2, /* SDCCH/4 (2) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 3, /* SDCCH/4 (3) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 0, /* SDCCH/8 (0) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 1, /* SDCCH/8 (1) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 2, /* SDCCH/8 (2) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 3, /* SDCCH/8 (3) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 4, /* SDCCH/8 (4) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 5, /* SDCCH/8 (5) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 6, /* SDCCH/8 (6) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 7 /* SDCCH/8 (7) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 };
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 GLOBAL void dedi_req (T_MPH_DEDICATED_REQ * dedicated_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 * RR signals which procedure is processed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 USHORT mode = dedicated_req->mod;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 switch (mode)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 case MODE_SYS_INFO_CHANGE:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 * Changed values for DTX, PWRC and Radio Link Timeout
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 ALR_TRACE_DEDI_DTX(dedicated_req->tr_para.dtx);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 nc_update_dedicated (dedicated_req->tr_para.dtx,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 dedicated_req->tr_para.pwrc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 alr_data->dedi_data.rlt = alr_data->dedi_data.act_rlt = (UBYTE)((dedicated_req->tr_para.rlt + 1) * 4);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 ALR_EM_SET_EM_ACT_RLT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 case MODE_IMM_ASSIGN:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 * Immediate Assignment Procedure
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 dedi_imm_ass (dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 case MODE_CHAN_ASSIGN:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 * Intracell Handover
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 dedi_chan_ass (dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 * reset radio link timeout counter
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 alr_data->dedi_data.act_rlt = alr_data->dedi_data.rlt;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 ALR_EM_SET_EM_ACT_RLT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 #ifdef GPRS
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 case MODE_PDCH_ASSIGN:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 * Packet Data CHannel Assignment
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 dedi_pdch_ass (dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 case MODE_ASYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 case MODE_SYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 case MODE_PRE_SYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 ULONG dummy1, dummy2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270 if( nc_get_fn_time(dedicated_req->arfcn, &dummy1, &dummy2) EQ FALSE)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 * Timing Information not present for the cell
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 ALR_TRACE_DEDI("Handover to a cell - whose SYNC is not done");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 ma_dedi_cnf(DEDI_RES_CELL_NOT_SYNC);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 nc_suspend_handover();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 switch(mode)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 case MODE_ASYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 * Asynchronous handover
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 dedi_async_handover (dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 case MODE_SYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 * Synchronous handover
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 dedi_sync_handover (dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 case MODE_PRE_SYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 * Pre-synchronous handover
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 dedi_pre_sync_handover (dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 default :
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 alr_data->dedi_data.act_rlt = alr_data->dedi_data.rlt;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 ALR_EM_SET_EM_ACT_RLT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 default:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 | PROJECT : GSM-PS (8403) MODULE : ALR_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 | STATE : code ROUTINE : dedi_fail_req |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 PURPOSE : Process signal dedi_fail_req from SDL process Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 RR signals that going back to the old channel after channel
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 assignment or handover is necessary.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 GLOBAL void dedi_fail_req (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 * RR signals which procedure is running
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 switch (alr_data->dedi_data.act_mode)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 case MODE_CHAN_ASSIGN:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 * channel assignment procedure
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 dedi_chan_ass_fail ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 case MODE_PDCH_ASSIGN:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 dedi_pdch_ass_fail();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 case MODE_CELL_CHANGE_ORDER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 dedi_cco_fail();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 case MODE_ASYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 case MODE_SYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 case MODE_PRE_SYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 case MODE_PSEUDO_SYNC_HANDOVER:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 * one of the handover procedures
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 dedi_handover_fail ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 default:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 | PROJECT : GSM-PS (8403) MODULE : ALR_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 | STATE : code ROUTINE : dedi_ta_fail_ind |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 PURPOSE : Process signal dedi_ta_fail_ind from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 Layer 1 signals that the timing advance is out of
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 range during handover. This will be forwarded to RR and
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 switching back to the old channel is initiated by RR.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 GLOBAL void dedi_ta_fail_ind (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 ma_dedi_cnf (DEDI_RES_TA_OUT_OF_RANGE);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 | PROJECT : GSM-PS (8403) MODULE : ALR_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 | STATE : code ROUTINE : dedi_ho_finished |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 PURPOSE : Process signal dedi_ho_finished from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 Layer 1 signals that the handover has finished successful.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 This is forwarded to RR which starts resumption of the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 link on the new channel.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 GLOBAL void dedi_ho_finished (UBYTE cause)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 ma_clean_dedi_sys_buffer ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 if (cause EQ 0)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 ALR_TRACE_DEDI ("ho ok");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 * handover successfull
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 ma_dedi_cnf (DEDI_RES_OK);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 ALR_TRACE_DEDI ("ho fail");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 * handover failed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 nc_update_list (alr_data->dedi_data.old_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 ma_dedi_cnf (DEDI_RES_TIMEOUT);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 | PROJECT : GSM-PS (8403) MODULE : ALR_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 | STATE : code ROUTINE : dedi_chan_ass_fail |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 PURPOSE : Process Channel Assignment Failure (back to old
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 dedicated channel).
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 In fact this is a new configuration of the layer 1. The
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 parameters of the old channel are stored in TI++.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 LOCAL void dedi_chan_ass_fail (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 PALLOC (chan_ass, MPHC_CHANNEL_ASSIGN_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 memset (chan_ass, 0, sizeof (T_MPHC_CHANNEL_ASSIGN_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 if (alr_data->dedi_data.redef_starting_time.start_time_present)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 * Special case: frequency redefinition values ares stored.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 memcpy (&chan_ass->channel_desc_1,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 &alr_data->dedi_data.redef_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 memcpy (&chan_ass->frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 &alr_data->dedi_data.redef_frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 memcpy (&chan_ass->channel_desc_1_bef_sti,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 &alr_data->dedi_data.old_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 memcpy (&chan_ass->frequency_list_bef_sti,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 &alr_data->dedi_data.old_frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 memcpy (&chan_ass->starting_time,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 &alr_data->dedi_data.redef_starting_time,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 sizeof (T_starting_time));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 dedi_convert_chan_desc ((T_channel_desc *)&chan_ass->channel_desc_1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 dedi_convert_frequency_list (&chan_ass->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 dedi_convert_chan_desc ((T_channel_desc *)&chan_ass->channel_desc_1_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 dedi_convert_frequency_list ((T_frequency_list *)&chan_ass->frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 * Normal case
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 memcpy (&chan_ass->channel_desc_1,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 &alr_data->dedi_data.old_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 memcpy (&chan_ass->frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 &alr_data->dedi_data.old_frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 dedi_convert_chan_desc ((T_channel_desc *)&chan_ass->channel_desc_1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 dedi_convert_frequency_list (&chan_ass->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 chan_ass->txpwr = alr_data->dedi_data.old_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 chan_ass->cipher_mode = alr_data->dedi_data.old_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 chan_ass->channel_mode_1 = alr_data->dedi_data.old_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 chan_ass->a5_algorithm = alr_data->dedi_data.old_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 chan_ass->cipher_key = alr_data->dedi_data.old_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 chan_ass->dtx_allowed = alr_data->dedi_data.old_dtx_allowed;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 chan_ass->amr_configuration = alr_data->dedi_data.old_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 * store actual channel for layer 2 channel decision
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 actual_channel = alr_data->dedi_data.old_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 * store actual channel parameter in ALR. In fact they are
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 * the old values.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 if (alr_data->dedi_data.redef_starting_time.start_time_present)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 * Special case: frequency redefinition values ares stored.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 memcpy (&alr_data->dedi_data.act_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 &alr_data->dedi_data.redef_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 memcpy (&alr_data->dedi_data.act_frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515 &alr_data->dedi_data.redef_frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 * Normal case
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 memcpy (&alr_data->dedi_data.act_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524 &alr_data->dedi_data.old_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 memcpy (&alr_data->dedi_data.act_frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 &alr_data->dedi_data.old_frequency_list,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 alr_data->dedi_data.act_power = alr_data->dedi_data.old_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 alr_data->dedi_data.act_cipher_mode = alr_data->dedi_data.old_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 alr_data->dedi_data.act_channel_mode = alr_data->dedi_data.old_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 alr_data->dedi_data.act_a5_algorithm = alr_data->dedi_data.old_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 alr_data->dedi_data.act_cipher_key = alr_data->dedi_data.old_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 alr_data->dedi_data.act_dtx_allowed = alr_data->dedi_data.old_dtx_allowed;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 alr_data->dedi_data.act_amr_configuration = alr_data->dedi_data.old_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 alr_data->dedi_data.act_mode = MODE_CHAN_ASS_FAIL;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 * send data to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 ma_dedi_chan_ass_req (chan_ass);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 | PROJECT : GSM-PS (8403) MODULE : alr_dedi |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 | STATE : code ROUTINE : dedi_pdch_ass_fail |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 PURPOSE : PDCH Assignment Failure (back to old
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 dedicated channel).
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 Use the channel configuration in alr_data->dedi_data.act* with
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 MPHC-IMMED-ASSIGN-REQ. With the subsequent MPHC-IMMED-ASSIGN-CON
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 alr_data->dedi_data.temp* is NOT assigned to alr_data->dedi_data.act*,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 refer to function dedi_imm_ass_cnf.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 The actual switch back to the original channel is performed via
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 a channel assignment procedure carried out by dedi_chan_ass_fail
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560 which is called in dedi_imm_ass_cnf.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 LOCAL void dedi_pdch_ass_fail (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 T_DEDI_DATA *d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 PALLOC (immed_assign_req, MPHC_IMMED_ASSIGN_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 memset ( immed_assign_req, 0 , sizeof *immed_assign_req );
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 immed_assign_req->channel_desc = d->old_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 immed_assign_req->timing_advance = (UBYTE)alr_data->nc_data.tav;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 immed_assign_req->frequency_list = d->old_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 immed_assign_req->starting_time = d->old_starting_time;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 immed_assign_req->frequency_list_bef_sti = d->old_frequency_list_bef_sti;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 immed_assign_req->maio_bef_sti = d->old_channel_desc.chan_sel.rf_channel.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 immed_assign_req->bcch_allocation = ... not used in current implementation
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 immed_assign_req->ba_id = ... not used in current implementation
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 immed_assign_req->dtx_allowed = d->old_dtx_allowed;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 immed_assign_req->pwrc = d->old_pwrc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 SET_STATE (STATE_DEDI, DEDI_IMM_ASS_RECONN);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 PSENDX (L1, immed_assign_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 | PROJECT : GSM-PS (8403) MODULE : alr_dedi |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 | STATE : code ROUTINE : dedi_cco_fail |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 PURPOSE : Cell Change Order Failure (back to old
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 dedicated channel).
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 LOCAL void dedi_cco_fail (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
599 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 dedi_pdch_ass_fail();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 | STATE : code ROUTINE : dedi_handover_fail |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
608
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
609 PURPOSE : Process Handover Failure (back to old
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 dedicated channel).
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611 For handover switching back is carried out
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612 autonomously by layer 1. Only the configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
613 data in ALR is updated to the parameters of the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
614 old channel.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
618 LOCAL void dedi_handover_fail (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
619 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
620
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
621 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
622 * store actual channel value for layer 2 channel selection
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
623 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
624 actual_channel = alr_data->dedi_data.old_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 * update actual channel parameters to the old values
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 alr_data->serving_cell = alr_data->dedi_data.act_bcch = alr_data->dedi_data.old_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
630 alr_data->dedi_data.act_channel_desc = alr_data->dedi_data.old_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
631 alr_data->dedi_data.act_frequency_list = alr_data->dedi_data.old_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 alr_data->dedi_data.act_cipher_mode = alr_data->dedi_data.old_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 alr_data->dedi_data.act_channel_mode = alr_data->dedi_data.old_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 alr_data->dedi_data.act_a5_algorithm = alr_data->dedi_data.old_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 alr_data->dedi_data.act_cipher_key = alr_data->dedi_data.old_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636 alr_data->dedi_data.act_amr_configuration = alr_data->dedi_data.old_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 alr_data->dedi_data.act_mode = MODE_HANDOVER_FAIL;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
639 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
640 * Inform layer 1 about handover failure
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642 nc_suspend_handover();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
643 ma_dedi_ho_fail_req ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
644 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
649 | STATE : code ROUTINE : dedi_imm_ass |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
650 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
651
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
652 PURPOSE : Converts MPH_DEDICATED_REQ to MPHC_IMMED_ASSIGN_REQ.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
653 This function is used during Immediate Assignment procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
654
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
655 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
656
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
657 LOCAL void dedi_imm_ass (T_MPH_DEDICATED_REQ *dedicated_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
658 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
659 T_DEDI_DATA *dd = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
660 PALLOC (imm_ass, MPHC_IMMED_ASSIGN_REQ); /* T_MPHC_IMMED_ASSIGN_REQ */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
661
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
662 ALR_EM_CONFIGURE_IMMIDIATE_ASSIGNMENT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
663
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
664 memset (imm_ass, 0, sizeof (T_MPHC_IMMED_ASSIGN_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
665 if (dedicated_req->ch_type.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
666 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
667 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
668 * with frequency hopping
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
669 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
670 imm_ass->channel_desc.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
671 imm_ass->channel_desc.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
672 dedicated_req->ch_type.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
673 imm_ass->channel_desc.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
674 dedicated_req->ch_type.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
675 dedi_fill_ma (dedicated_req->ch_type.ma, &imm_ass->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
676 dedi_fill_ma (dedicated_req->ch_type2.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
677 (T_frequency_list *)&imm_ass->frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
678 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
679 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
680 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
681 ALR_TRACE_DEDI ("no hopping");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
682 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
683 * Avoid the union, arfcn is mapped to maio and hsn
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
684 * in the non-hopping case.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
685 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
686 imm_ass->channel_desc.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
687 imm_ass->channel_desc.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
688 (UBYTE)(dedicated_req->ch_type.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
689 imm_ass->channel_desc.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
690 (UBYTE)((dedicated_req->ch_type.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
691 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
692
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
693 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
694 * set the actual channel for layer 2 channel selection
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
695 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
696 actual_channel = imm_ass->channel_desc.channel_type =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
697 CH_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
698 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
699 * set the rest of parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
700 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
701 imm_ass->channel_desc.sub_channel = SUB_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
702 imm_ass->channel_desc.timeslot_no = dedicated_req->ch_type.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
703 imm_ass->channel_desc.tsc = dedicated_req->ch_type.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
704 imm_ass->timing_advance = dedicated_req->tr_para.tav;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
705 nc_store_tav(dedicated_req->tr_para.tav);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
706 imm_ass->starting_time.start_time_present = dedicated_req->start.v_start;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
707 imm_ass->starting_time.start_time.t1 = dedicated_req->start.t1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
708 imm_ass->starting_time.start_time.t3 = dedicated_req->start.t3;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
709 imm_ass->starting_time.start_time.t2 = dedicated_req->start.t2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
710 imm_ass->maio_bef_sti = dedicated_req->ch_type2.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
711 imm_ass->dtx_allowed = dedicated_req->tr_para.dtx;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
712 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
713 * calculate radio link timeout value
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
714 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
715 dd->rlt = dd->act_rlt = (UBYTE)((dedicated_req->tr_para.rlt + 1) * 4);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
716
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
717 ALR_EM_SET_EM_ACT_RLT_2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
718
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
719 memset (&imm_ass->bcch_allocation, 0, sizeof (T_bcch_allocation));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
720 imm_ass->ba_id = ALR_BA_LOW;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
721 imm_ass->pwrc = dedicated_req->tr_para.pwrc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
722 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
723 * store new parameters as temporary channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
724 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
725 dd->temp_bcch = dedicated_req->arfcn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
726 dd->temp_channel_desc = imm_ass->channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
727 dd->temp_channel_mode = dedi_channel_mode (MODE_SIG_ONLY, 0);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
728 dd->temp_frequency_list = imm_ass->frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
729 dd->temp_starting_time = imm_ass->starting_time;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
730 dd->temp_frequency_list_bef_sti = imm_ass->frequency_list_bef_sti;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
731 dd->temp_channel_desc_bef_sti = imm_ass->channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
732 dd->temp_channel_desc_bef_sti.chan_sel.rf_channel.maio
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
733 = imm_ass->maio_bef_sti;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
734 dd->temp_pwrc = imm_ass->pwrc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
735 dd->temp_cipher_mode = CI_NO_CIPHERING;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
736 dd->temp_a5_algorithm = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
737 memset ( &dd->temp_cipher_key, 0, sizeof (T_cipher_key) );
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
738
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
739 SET_STATE (STATE_DEDI, DEDI_IMM_ASS);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
740
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
741 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
742 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
743 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
744 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
745 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
746 dedi_convert_chan_desc (&imm_ass->channel_desc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
747 dedi_convert_frequency_list (&imm_ass->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
748 dedi_convert_frequency_list ((T_frequency_list *)&imm_ass->frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
749 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
750
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
751 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
752 * send parameters to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
753 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
754 ALR_TRACE_DEDI_PARA(imm_ass->channel_desc.chan_sel.h,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
755 imm_ass->channel_desc.chan_sel.rf_channel.maio+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
756 (imm_ass->channel_desc.chan_sel.rf_channel.hsn<<8),
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
757 imm_ass->channel_desc.channel_type,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
758 imm_ass->channel_desc.sub_channel,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
759 imm_ass->channel_desc.timeslot_no,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
760 imm_ass->channel_desc.tsc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
761 imm_ass->timing_advance,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
762 imm_ass->starting_time.start_time_present,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
763 imm_ass->dtx_allowed,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
764 imm_ass->maio_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
765
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
766 ma_dedi_imm_ass_req (imm_ass);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
767 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
768
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
769 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
770 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
771 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
772 | STATE : code ROUTINE : dedi_chan_ass |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
773 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
774
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
775 PURPOSE : Converts MPH_DEDICATED_REQ to MPHC_CHANNEL_ASSIGN_REQ.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
776 This function is used during channel assignment procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
777
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
778 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
779
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
780 LOCAL void dedi_chan_ass (T_MPH_DEDICATED_REQ *dedicated_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
781 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
782 int i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
783 PALLOC (chan_ass, MPHC_CHANNEL_ASSIGN_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
784
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
785 ALR_EM_CONFIGURE_CHANNEL_ASSIGNMENT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
786
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
787 memset (chan_ass, 0, sizeof (T_MPHC_CHANNEL_ASSIGN_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
788
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
789 if (dedicated_req->ch_type.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
790 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
791 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
792 * with frequency hopping
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
793 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
794 chan_ass->channel_desc_1.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
795 chan_ass->channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
796 dedicated_req->ch_type.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
797 chan_ass->channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
798 dedicated_req->ch_type.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
799 dedi_fill_ma (dedicated_req->ch_type.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
800 &chan_ass->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
801 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
802 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
803 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
804 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
805 * Avoid the union in the non-hopping case and
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
806 * map arfcn to maio and hsn.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
807 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
808 chan_ass->channel_desc_1.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
809 chan_ass->channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
810 (UBYTE)(dedicated_req->ch_type.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
811 chan_ass->channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
812 (UBYTE)((dedicated_req->ch_type.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
813 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
814 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
815 * fill the layer 1 structure
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
816 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
817 alr_data->dedi_data.temp_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
818 chan_ass->channel_desc_1.channel_type =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
819 CH_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
820 chan_ass->channel_desc_1.sub_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
821 SUB_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
822 chan_ass->channel_desc_1.timeslot_no = dedicated_req->ch_type.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
823 chan_ass->channel_desc_1.tsc = dedicated_req->ch_type.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
824 chan_ass->txpwr = cut_power_value (dedicated_req->tr_para.power,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
825 dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
826 chan_ass->channel_mode_1 = dedi_channel_mode(dedicated_req->tr_para.mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
827 alr_data->dedi_data.temp_channel);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
828 chan_ass->amr_configuration.noise_suppression_control_bit = dedicated_req->amr_conf.nscb;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
829 chan_ass->amr_configuration.initial_codec_mode_indicator = dedicated_req->amr_conf.icmi;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
830 chan_ass->amr_configuration.initial_codec_mode = dedicated_req->amr_conf.st_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
831 chan_ass->amr_configuration.active_codec_set = dedicated_req->amr_conf.acs;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
832 /* Traces only needed for IOT session */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
833 TRACE_EVENT_P1("*AMR NSCB %d", chan_ass->amr_configuration.noise_suppression_control_bit);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
834 TRACE_EVENT_P1("*AMR ICMI %d", chan_ass->amr_configuration.initial_codec_mode_indicator);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
835 TRACE_EVENT_P1("*AMR ICM %d", chan_ass->amr_configuration.initial_codec_mode);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
836 TRACE_EVENT_P1("*AMR ACS %d", chan_ass->amr_configuration.active_codec_set);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
837 for (i=0; i<dedicated_req->amr_conf.c_cod_prop; i++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
838 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
839 memcpy(&chan_ass->amr_configuration.threshold[i], &dedicated_req->amr_conf.cod_prop[i].codec_thr, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
840 memcpy(&chan_ass->amr_configuration.hysteresis[i], &dedicated_req->amr_conf.cod_prop[i].codec_hyst, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
841 TRACE_EVENT_P2("*AMR threshold[%d] %d", i, chan_ass->amr_configuration.threshold[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
842 TRACE_EVENT_P2("*AMR hysteresis[%d] %d", i, chan_ass->amr_configuration.hysteresis[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
843 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
844 chan_ass->starting_time.start_time_present =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
845 dedicated_req->start.v_start;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
846 chan_ass->starting_time.start_time.t1 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
847 dedicated_req->start.t1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
848 chan_ass->starting_time.start_time.t3 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
849 dedicated_req->start.t3;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
850 chan_ass->starting_time.start_time.t2 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
851 dedicated_req->start.t2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
852
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
853 if (dedicated_req->ch_type2.ch NEQ NOT_PRESENT_8BIT)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
854 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
855
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
856 if (dedicated_req->ch_type2.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
857 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
858 chan_ass->channel_desc_1_bef_sti.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
859 chan_ass->channel_desc_1_bef_sti.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
860 dedicated_req->ch_type2.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
861 chan_ass->channel_desc_1_bef_sti.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
862 dedicated_req->ch_type2.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
863 dedi_fill_ma (dedicated_req->ch_type2.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
864 (T_frequency_list *)&chan_ass->frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
865 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
866 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
867 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
868 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
869 * Avoid the union !!!
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
870 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
871 chan_ass->channel_desc_1_bef_sti.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
872 chan_ass->channel_desc_1_bef_sti.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
873 (UBYTE)(dedicated_req->ch_type2.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
874 chan_ass->channel_desc_1_bef_sti.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
875 (UBYTE)((dedicated_req->ch_type2.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
876 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
877 chan_ass->channel_desc_1_bef_sti.channel_type =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
878 CH_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
879 chan_ass->channel_desc_1_bef_sti.sub_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
880 SUB_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
881 chan_ass->channel_desc_1_bef_sti.timeslot_no =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
882 dedicated_req->ch_type2.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
883 chan_ass->channel_desc_1_bef_sti.tsc =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
884 dedicated_req->ch_type2.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
885 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
886 chan_ass->cipher_mode = dedicated_req->ciph.stat;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
887 chan_ass->a5_algorithm = dedicated_req->ciph.algo;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
888 memcpy (&chan_ass->cipher_key, dedicated_req->ciph.kc, sizeof(T_cipher_key));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
889 chan_ass->dtx_allowed = dedicated_req->tr_para.dtx;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
890
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
891 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
892 * store the new configuration as temporary configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
893 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
894 alr_data->dedi_data.temp_bcch = dedicated_req->arfcn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
895 memcpy (&alr_data->dedi_data.temp_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
896 &chan_ass->channel_desc_1,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
897 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
898 alr_data->dedi_data.temp_channel_mode = chan_ass->channel_mode_1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
899 alr_data->dedi_data.temp_frequency_list = chan_ass->frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
900 alr_data->dedi_data.temp_cipher_mode = chan_ass->cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
901 alr_data->dedi_data.temp_a5_algorithm = chan_ass->a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
902 alr_data->dedi_data.temp_cipher_key = chan_ass->cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
903 alr_data->dedi_data.temp_power = chan_ass->txpwr;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
904 alr_data->dedi_data.temp_dtx_allowed = chan_ass->dtx_allowed;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
905 alr_data->dedi_data.act_mode = MODE_CHAN_ASSIGN;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
906 alr_data->dedi_data.temp_amr_configuration = chan_ass->amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
907
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
908 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
909 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
910 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
911 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
912 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
913 dedi_convert_chan_desc ((T_channel_desc *)&chan_ass->channel_desc_1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
914 dedi_convert_chan_desc ((T_channel_desc *)&chan_ass->channel_desc_1_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
915 dedi_convert_frequency_list (&chan_ass->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
916 dedi_convert_frequency_list ((T_frequency_list *)&chan_ass->frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
917 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
918
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
919 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
920 * inform layer 1 about the new channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
921 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
922 ma_dedi_chan_ass_req (chan_ass);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
923 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
924
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
925 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
926 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
927 | PROJECT : GSM-PS (8403) MODULE : alr_dedi |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
928 | STATE : code ROUTINE : dedi_pdch_ass |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
929 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
930
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
931 PURPOSE : "Deactivation of previously assigned channels (layer1)"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
932 according to GSM 04.18, clause 3.4.19 during a
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
933 PDCH Assignment procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
934
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
935 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
936
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
937 LOCAL void dedi_pdch_ass (T_MPH_DEDICATED_REQ *dedicated_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
938 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
939 T_DEDI_DATA *d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
940
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
941 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
942 * The PDCH Assignment Procedure is similar to the Channel Assignment
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
943 * Procedure. Both are perfomred in dedicated state in order to switch
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
944 * to a 'new' channel. "Normal operation" is suspend during the procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
945 * In case of failure the old channel is activated and the message
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
946 * ASSIGNMENT FAILURE is sent.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
947 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
948
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
949 ma_stop_active_procs ( STOP_PCH_READING );
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
950
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
951 /* Current state is now DEDI_INACTIVE.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
952 * In Layer 1 SDCCH or TCH is stopped. In order to re-activate the channel
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
953 * (failure to TBF establishment), the Current Channel Configuration must be
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
954 * stored. This configuration will then be used to re-establish the channel.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
955 * The Current Channel Configuration is provided in the last successful
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
956 * Immediate Assignment, Channel Assignment or Handover in the variables
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
957 * alr_data->dedi_data.act***. The re-activation can be done with the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
958 * Immediate Assignment Procedure followed by a Channel Assignment Procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
959 * However there is the prerequisite that L1 must be in Idle Mode to perform
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
960 * Immediate Assignment. This will be achieved by sending MPH-IDLE-REQ.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
961 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
962
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
963 d->old_channel = actual_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
964 d->old_bcch = d->act_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
965 d->old_channel_desc = d->act_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
966 d->old_channel_mode = d->act_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
967 d->old_frequency_list = d->act_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
968 d->old_starting_time = d->act_starting_time;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
969 d->old_frequency_list_bef_sti = d->act_frequency_list_bef_sti;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
970 d->old_channel_desc_bef_sti = d->act_channel_desc_bef_sti;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
971 d->old_pwrc = d->act_pwrc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
972 d->old_cipher_mode = d->act_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
973 d->old_a5_algorithm = d->act_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
974 d->old_cipher_key = d->act_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
975 d->old_power = d->act_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
976 d->old_dtx_allowed = d->act_dtx_allowed;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
977
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
978 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
979 * Save the activation mode for Resume / Reconnection
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
980 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
981 alr_data->dedi_data.act_mode = MODE_PDCH_ASSIGN;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
982 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
983
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
984 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
985 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
986 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
987 | STATE : code ROUTINE : dedi_async_handover |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
988 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
989
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
990 PURPOSE : Converts MPH_DEDICATED_REQ to MPHC_ASYNC_HO_REQ.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
991 This function is used during asynchronous handover.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
992
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
993 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
994
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
995 LOCAL void dedi_async_handover (T_MPH_DEDICATED_REQ * dedicated_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
996 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
997 int i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
998 PALLOC (async, MPHC_ASYNC_HO_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
999
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1000 ALR_EM_CONFIGURE_HANDOVER(EM_HANDOVER_ASYNC);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1001
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1002 memset (async, 0, sizeof (T_MPHC_ASYNC_HO_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1003 if (dedicated_req->ch_type.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1004 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1005 ALR_TRACE_DEDI ("hopping");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1006 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1007 * new channel with frequency hopping.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1008 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1009 async->handover_command.channel_desc_1.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1010 async->handover_command.channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1011 dedicated_req->ch_type.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1012 async->handover_command.channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1013 dedicated_req->ch_type.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1014 dedi_fill_ma (dedicated_req->ch_type.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1015 &async->handover_command.frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1016 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1017 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1018 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1019 ALR_TRACE_DEDI ("no hop");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1020 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1021 * Avoid the union in the non-hopping case. Mapping
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1022 * of arfcn to maio and hsn.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1023 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1024 async->handover_command.channel_desc_1.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1025 async->handover_command.channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1026 (UBYTE)(dedicated_req->ch_type.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1027 async->handover_command.channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1028 (UBYTE)((dedicated_req->ch_type.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1029 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1030
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1031 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1032 * convert the parameters to the layer 1 structure
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1033 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1034 alr_data->dedi_data.temp_channel = async->handover_command.channel_desc_1.channel_type = CH_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1035 async->handover_command.channel_desc_1.sub_channel = SUB_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1036 async->handover_command.channel_desc_1.timeslot_no = dedicated_req->ch_type.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1037 async->handover_command.channel_desc_1.tsc = dedicated_req->ch_type.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1038 async->handover_command.txpwr = cut_power_value (dedicated_req->ho_param.ho_pow, dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1039 async->handover_command.ho_acc = dedicated_req->ho_param.ho_ref;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1040 async->handover_command.starting_time.start_time_present = dedicated_req->start.v_start;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1041 if (dedicated_req->start.v_start)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1042 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1043 ALR_TRACE_DEDI ("start time");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1044
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1045 async->handover_command.starting_time.start_time.t1 = dedicated_req->start.t1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1046 async->handover_command.starting_time.start_time.t3 = dedicated_req->start.t3;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1047 async->handover_command.starting_time.start_time.t2 = dedicated_req->start.t2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1048 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1049 async->handover_command.cell_description.ncc = (UBYTE)(dedicated_req->bsic >> 3);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1050 async->handover_command.cell_description.bcc = (UBYTE)(dedicated_req->bsic & 7);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1051 async->handover_command.cell_description.bcch_carrier = ARFCN_TO_L1 (dedicated_req->arfcn);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1052 async->handover_command.channel_mode_1 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1053 dedi_channel_mode (dedicated_req->tr_para.mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1054 alr_data->dedi_data.temp_channel);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1055 async->amr_configuration.noise_suppression_control_bit = dedicated_req->amr_conf.nscb;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1056 async->amr_configuration.initial_codec_mode_indicator = dedicated_req->amr_conf.icmi;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1057 async->amr_configuration.initial_codec_mode = dedicated_req->amr_conf.st_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1058 async->amr_configuration.active_codec_set = dedicated_req->amr_conf.acs;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1059 /* Traces only needed for IOT session */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1060 TRACE_EVENT_P1("*AMR NSCB %d", async->amr_configuration.noise_suppression_control_bit);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1061 TRACE_EVENT_P1("*AMR ICMI %d", async->amr_configuration.initial_codec_mode_indicator);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1062 TRACE_EVENT_P1("*AMR ICM %d", async->amr_configuration.initial_codec_mode);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1063 TRACE_EVENT_P1("*AMR ACS %d", async->amr_configuration.active_codec_set);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1064 for (i=0; i<dedicated_req->amr_conf.c_cod_prop; i++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1065 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1066 memcpy(&async->amr_configuration.threshold[i], &dedicated_req->amr_conf.cod_prop[i].codec_thr, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1067 memcpy(&async->amr_configuration.hysteresis[i], &dedicated_req->amr_conf.cod_prop[i].codec_hyst, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1068 TRACE_EVENT_P2("*AMR threshold[%d] %d", i, async->amr_configuration.threshold[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1069 TRACE_EVENT_P2("*AMR hysteresis[%d] %d", i, async->amr_configuration.hysteresis[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1070 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1071
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1072
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1073 if (dedicated_req->start.v_start AND
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1074 dedicated_req->ch_type2.ch NEQ NOT_PRESENT_8BIT)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1075 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1076 ALR_TRACE_DEDI ("bef sti");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1077 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1078 * before starting time elements are available
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1079 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1080
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1081 if (dedicated_req->ch_type2.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1082 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1083 async->handover_command.channel_desc_1_bef_sti.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1084 async->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.maio = dedicated_req->ch_type2.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1085 async->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.hsn = dedicated_req->ch_type2.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1086 dedi_fill_ma (dedicated_req->ch_type2.ma, (T_frequency_list *) &async->handover_command.frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1087 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1088 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1089 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1090 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1091 * Avoid the union !!!
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1092 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1093 async->handover_command.channel_desc_1_bef_sti.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1094 async->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1095 (UBYTE)(dedicated_req->ch_type2.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1096 async->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1097 (UBYTE)((dedicated_req->ch_type2.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1098 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1099
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1100 async->handover_command.channel_desc_1_bef_sti.channel_type = CH_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1101 async->handover_command.channel_desc_1_bef_sti.sub_channel = SUB_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1102 async->handover_command.channel_desc_1_bef_sti.timeslot_no = dedicated_req->ch_type2.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1103 async->handover_command.channel_desc_1_bef_sti.tsc = dedicated_req->ch_type2.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1104 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1105 async->handover_command.cipher_mode = dedicated_req->ciph.stat;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1106 async->handover_command.a5_algorithm = dedicated_req->ciph.algo;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1107 memcpy (&async->cipher_key, dedicated_req->ciph.kc, sizeof(T_cipher_key));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1108
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1109 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1110 * store the new parameters as temporary configuration.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1111 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1112 alr_data->dedi_data.temp_bcch = dedicated_req->arfcn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1113 memcpy (&alr_data->dedi_data.temp_channel_desc, &async->handover_command.channel_desc_1, sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1114 alr_data->dedi_data.temp_channel_mode = async->handover_command.channel_mode_1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1115 alr_data->dedi_data.temp_frequency_list = async->handover_command.frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1116 alr_data->dedi_data.temp_cipher_mode = async->handover_command.cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1117 alr_data->dedi_data.temp_a5_algorithm = async->handover_command.a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1118 alr_data->dedi_data.temp_cipher_key = async->cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1119 alr_data->dedi_data.temp_power = async->handover_command.txpwr;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1120 alr_data->dedi_data.temp_bsic = dedicated_req->bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1121 alr_data->dedi_data.temp_amr_configuration = async->amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1122 alr_data->dedi_data.act_mode = MODE_ASYNC_HANDOVER;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1123
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1124 nc_get_fn_time (alr_data->dedi_data.temp_bcch, (ULONG *)&async->fn_offset, (ULONG *)&async->time_alignmnt);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1125
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1126 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1127 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1128 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1129 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1130 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1131 dedi_convert_chan_desc ((T_channel_desc *)&async->handover_command.channel_desc_1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1132 dedi_convert_chan_desc ((T_channel_desc *)&async->handover_command.channel_desc_1_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1133 dedi_convert_frequency_list (&async->handover_command.frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1134 dedi_convert_frequency_list ((T_frequency_list *)&async->handover_command.frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1135 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1136 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1137 * forward the parameters to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1138 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1139 ALR_TRACE_DEDI_HO_1 (dedicated_req->arfcn,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1140 dedicated_req->bsic,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1141 dedicated_req->start.v_start,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1142 dedicated_req->ch_type2.ch,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1143 dedicated_req->ch_type.ch,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1144 dedicated_req->ch_type.tsc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1145 ALR_TRACE_DEDI_HO_2 (dedicated_req->ch_type.tn,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1146 dedicated_req->ch_type.arfcn,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1147 dedicated_req->ho_param.ho_pow,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1148 dedicated_req->ho_param.ho_ref,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1149 dedicated_req->ho_param.ho_acc_type,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1150 dedicated_req->ho_param.ho_nci);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1151 ALR_TRACE_DEDI_HO_3 (dedicated_req->tr_para.mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1152 dedicated_req->tr_para.power,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1153 dedicated_req->tr_para.dtx,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1154 dedicated_req->tr_para.rlt,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1155 dedicated_req->tr_para.tav,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1156 dedicated_req->tr_para.pwrc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1157 ALR_TRACE_DEDI_HO_4 (dedicated_req->tr_para.mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1158 dedicated_req->ciph.stat,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1159 dedicated_req->ciph.algo);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1160 ALR_TRACE_DEDI_HO_5 (async->handover_command.channel_desc_1.chan_sel.h,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1161 async->handover_command.channel_desc_1.chan_sel.rf_channel.maio,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1162 async->handover_command.channel_desc_1.chan_sel.rf_channel.hsn,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1163 async->handover_command.channel_desc_1.channel_type,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1164 async->handover_command.channel_desc_1.sub_channel,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1165 async->handover_command.channel_desc_1.timeslot_no);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1166 ALR_TRACE_DEDI_HO_6 (async->handover_command.channel_desc_1.tsc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1167 async->handover_command.txpwr,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1168 async->handover_command.ho_acc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1169 async->handover_command.starting_time.start_time_present,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1170 async->handover_command.cell_description.ncc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1171 async->handover_command.cell_description.bcc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1172 ALR_TRACE_DEDI_HO_7 (async->handover_command.cell_description.bcch_carrier,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1173 async->handover_command.channel_mode_1,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1174 async->handover_command.cipher_mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1175 async->handover_command.a5_algorithm);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1176
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1177 ma_dedi_async_ho_req (async);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1178 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1179
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1180
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1181 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1182 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1183 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1184 | STATE : code ROUTINE : dedi_sync_handover |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1185 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1186
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1187 PURPOSE : Converts MPH_DEDICATED_REQ to MPHC_SYNC_HO_REQ.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1188 This function is used during synchronous handover.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1189
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1190 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1191
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1192 LOCAL void dedi_sync_handover (T_MPH_DEDICATED_REQ *dedicated_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1193 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1194 int i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1195 PALLOC (sync, MPHC_SYNC_HO_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1196
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1197 ALR_EM_CONFIGURE_HANDOVER(EM_HANDOVER_SYNC);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1198
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1199 memset (sync, 0, sizeof (T_MPHC_SYNC_HO_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1200 if (dedicated_req->ch_type.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1201 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1202 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1203 * new cell with frequency hopping
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1204 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1205 sync->handover_command.channel_desc_1.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1206 sync->handover_command.channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1207 dedicated_req->ch_type.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1208 sync->handover_command.channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1209 dedicated_req->ch_type.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1210 dedi_fill_ma (dedicated_req->ch_type.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1211 &sync->handover_command.frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1212 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1213 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1214 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1215 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1216 * Avoid the union in the non-hopping case, map arfcn to
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1217 * maio and hsn
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1218 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1219 sync->handover_command.channel_desc_1.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1220 sync->handover_command.channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1221 (UBYTE)(dedicated_req->ch_type.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1222 sync->handover_command.channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1223 (UBYTE)((dedicated_req->ch_type.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1224 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1225
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1226 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1227 * fill layer 1 structure with the new parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1228 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1229 alr_data->dedi_data.temp_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1230 sync->handover_command.channel_desc_1.channel_type =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1231 CH_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1232 sync->handover_command.channel_desc_1.sub_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1233 SUB_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1234 sync->handover_command.channel_desc_1.timeslot_no =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1235 dedicated_req->ch_type.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1236 sync->handover_command.channel_desc_1.tsc = dedicated_req->ch_type.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1237 sync->handover_command.txpwr =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1238 cut_power_value (dedicated_req->ho_param.ho_pow, dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1239 sync->handover_command.ho_acc = dedicated_req->ho_param.ho_ref;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1240 sync->handover_command.starting_time.start_time_present =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1241 dedicated_req->start.v_start;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1242 sync->handover_command.starting_time.start_time.t1 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1243 dedicated_req->start.t1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1244 sync->handover_command.starting_time.start_time.t3 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1245 dedicated_req->start.t3;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1246 sync->handover_command.starting_time.start_time.t2 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1247 dedicated_req->start.t2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1248
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1249 sync->nci = dedicated_req->ho_param.ho_nci;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1250 sync->handover_command.cell_description.ncc =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1251 (UBYTE)(dedicated_req->bsic >> 3);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1252 sync->handover_command.cell_description.bcc =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1253 (UBYTE)(dedicated_req->bsic & 7);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1254 sync->handover_command.cell_description.bcch_carrier =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1255 ARFCN_TO_L1(dedicated_req->arfcn);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1256 sync->handover_command.channel_mode_1 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1257 dedi_channel_mode (dedicated_req->tr_para.mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1258 alr_data->dedi_data.temp_channel);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1259 sync->amr_configuration.noise_suppression_control_bit = dedicated_req->amr_conf.nscb;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1260 sync->amr_configuration.initial_codec_mode_indicator = dedicated_req->amr_conf.icmi;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1261 sync->amr_configuration.initial_codec_mode = dedicated_req->amr_conf.st_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1262 sync->amr_configuration.active_codec_set = dedicated_req->amr_conf.acs;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1263 /* Traces only needed for IOT session */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1264 TRACE_EVENT_P1("*AMR NSCB %d", sync->amr_configuration.noise_suppression_control_bit);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1265 TRACE_EVENT_P1("*AMR ICMI %d", sync->amr_configuration.initial_codec_mode_indicator);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1266 TRACE_EVENT_P1("*AMR ICM %d", sync->amr_configuration.initial_codec_mode);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1267 TRACE_EVENT_P1("*AMR ACS %d", sync->amr_configuration.active_codec_set);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1268 for (i=0; i<dedicated_req->amr_conf.c_cod_prop; i++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1269 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1270 memcpy(&sync->amr_configuration.threshold[i], &dedicated_req->amr_conf.cod_prop[i].codec_thr, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1271 memcpy(&sync->amr_configuration.hysteresis[i], &dedicated_req->amr_conf.cod_prop[i].codec_hyst, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1272 TRACE_EVENT_P2("*AMR threshold[%d] %d", i, sync->amr_configuration.threshold[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1273 TRACE_EVENT_P2("*AMR hysteresis[%d] %d", i, sync->amr_configuration.hysteresis[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1274 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1275
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1276 if (dedicated_req->start.v_start AND
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1277 dedicated_req->ch_type2.ch NEQ NOT_PRESENT_8BIT)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1278 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1279
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1280 if (dedicated_req->ch_type2.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1281 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1282 sync->handover_command.channel_desc_1_bef_sti.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1283 sync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.maio = dedicated_req->ch_type2.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1284 sync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.hsn = dedicated_req->ch_type2.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1285 dedi_fill_ma (dedicated_req->ch_type2.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1286 (T_frequency_list *)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1287 &sync->handover_command.frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1288 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1289 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1290 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1291 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1292 * Avoid the union !!!
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1293 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1294 sync->handover_command.channel_desc_1_bef_sti.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1295 sync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1296 (UBYTE)(dedicated_req->ch_type2.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1297 sync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1298 (UBYTE)((dedicated_req->ch_type2.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1299 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1300 sync->handover_command.channel_desc_1_bef_sti.channel_type =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1301 CH_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1302 sync->handover_command.channel_desc_1_bef_sti.sub_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1303 SUB_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1304 sync->handover_command.channel_desc_1_bef_sti.timeslot_no =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1305 dedicated_req->ch_type2.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1306 sync->handover_command.channel_desc_1_bef_sti.tsc =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1307 dedicated_req->ch_type2.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1308 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1309 sync->handover_command.cipher_mode = dedicated_req->ciph.stat;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1310 sync->handover_command.a5_algorithm = dedicated_req->ciph.algo;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1311 memcpy (&sync->cipher_key, dedicated_req->ciph.kc, sizeof(T_cipher_key));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1312
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1313 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1314 * store the new values as temporary configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1315 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1316 alr_data->dedi_data.temp_bcch = dedicated_req->arfcn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1317 memcpy (&alr_data->dedi_data.temp_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1318 &sync->handover_command.channel_desc_1,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1319 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1320 alr_data->dedi_data.temp_channel_mode =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1321 sync->handover_command.channel_mode_1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1322 alr_data->dedi_data.temp_frequency_list =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1323 sync->handover_command.frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1324 alr_data->dedi_data.temp_cipher_mode =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1325 sync->handover_command.cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1326 alr_data->dedi_data.temp_a5_algorithm =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1327 sync->handover_command.a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1328 alr_data->dedi_data.temp_cipher_key =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1329 sync->cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1330 alr_data->dedi_data.temp_power = sync->handover_command.txpwr;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1331 alr_data->dedi_data.temp_bsic = dedicated_req->bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1332 alr_data->dedi_data.temp_amr_configuration = sync->amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1333 alr_data->dedi_data.act_mode = MODE_SYNC_HANDOVER;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1334
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1335 nc_get_fn_time (alr_data->dedi_data.temp_bcch,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1336 (ULONG *)&sync->fn_offset,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1337 (ULONG *)&sync->time_alignmnt);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1338
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1339 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1340 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1341 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1342 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1343 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1344 dedi_convert_chan_desc ((T_channel_desc *)&sync->handover_command.channel_desc_1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1345 dedi_convert_chan_desc ((T_channel_desc *)&sync->handover_command.channel_desc_1_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1346 dedi_convert_frequency_list (&sync->handover_command.frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1347 dedi_convert_frequency_list ((T_frequency_list *)&sync->handover_command.frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1348 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1349 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1350 * forward the new configuration to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1351 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1352 ma_dedi_sync_ho_req (sync);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1353 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1354
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1355 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1356 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1357 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1358 | STATE : code ROUTINE : dedi_pre_sync_handover |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1359 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1360
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1361 PURPOSE : Converts MPH_DEDICATED_REQ to MPHC_PRE_SYNC_HO_REQ.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1362 This function is used during pre-synchronous handover.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1363
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1364 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1365
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1366 LOCAL void dedi_pre_sync_handover (T_MPH_DEDICATED_REQ *dedicated_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1367 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1368 int i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1369 PALLOC (presync, MPHC_PRE_SYNC_HO_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1370
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1371 ALR_EM_CONFIGURE_HANDOVER(EM_HANDOVER_PRE_SYNC);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1372
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1373 memset (presync, 0, sizeof (T_MPHC_PRE_SYNC_HO_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1374 if (dedicated_req->ch_type.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1375 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1376 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1377 * new channel uses frequency hopping
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1378 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1379 presync->handover_command.channel_desc_1.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1380 presync->handover_command.channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1381 dedicated_req->ch_type.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1382 presync->handover_command.channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1383 dedicated_req->ch_type.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1384 dedi_fill_ma (dedicated_req->ch_type.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1385 &presync->handover_command.frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1386 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1387 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1388 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1389 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1390 * Avoid the union in the non-hopping case. Map arfcn to
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1391 * maio and hsn.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1392 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1393 presync->handover_command.channel_desc_1.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1394 presync->handover_command.channel_desc_1.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1395 (UBYTE)(dedicated_req->ch_type.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1396 presync->handover_command.channel_desc_1.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1397 (UBYTE)((dedicated_req->ch_type.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1398 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1399
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1400 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1401 * fill layer 1 structure with the new parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1402 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1403 alr_data->dedi_data.temp_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1404 presync->handover_command.channel_desc_1.channel_type =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1405 CH_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1406 presync->handover_command.channel_desc_1.sub_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1407 SUB_TYPE [dedicated_req->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1408 presync->handover_command.channel_desc_1.timeslot_no =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1409 dedicated_req->ch_type.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1410 presync->handover_command.channel_desc_1.tsc = dedicated_req->ch_type.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1411 presync->handover_command.txpwr =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1412 cut_power_value (dedicated_req->ho_param.ho_pow, dedicated_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1413 presync->handover_command.ho_acc = dedicated_req->ho_param.ho_ref;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1414 presync->handover_command.starting_time.start_time_present =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1415 dedicated_req->start.v_start;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1416 presync->handover_command.starting_time.start_time.t1 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1417 dedicated_req->start.t1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1418 presync->handover_command.starting_time.start_time.t3 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1419 dedicated_req->start.t3;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1420 presync->handover_command.starting_time.start_time.t2 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1421 dedicated_req->start.t2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1422 presync->handover_command.cell_description.ncc =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1423 (UBYTE)(dedicated_req->bsic >> 3);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1424 presync->handover_command.cell_description.bcc =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1425 (UBYTE)(dedicated_req->bsic & 7);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1426 presync->handover_command.cell_description.bcch_carrier =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1427 ARFCN_TO_L1(dedicated_req->arfcn);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1428 presync->nci = dedicated_req->ho_param.ho_nci;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1429 presync->handover_command.channel_mode_1 =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1430 dedi_channel_mode (dedicated_req->tr_para.mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1431 alr_data->dedi_data.temp_channel);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1432 presync->amr_configuration.noise_suppression_control_bit = dedicated_req->amr_conf.nscb;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1433 presync->amr_configuration.initial_codec_mode_indicator = dedicated_req->amr_conf.icmi;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1434 presync->amr_configuration.initial_codec_mode = dedicated_req->amr_conf.st_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1435 presync->amr_configuration.active_codec_set = dedicated_req->amr_conf.acs;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1436 /* Traces only needed for IOT session */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1437 TRACE_EVENT_P1("*AMR NSCB %d", presync->amr_configuration.noise_suppression_control_bit);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1438 TRACE_EVENT_P1("*AMR ICMI %d", presync->amr_configuration.initial_codec_mode_indicator);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1439 TRACE_EVENT_P1("*AMR ICM %d", presync->amr_configuration.initial_codec_mode);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1440 TRACE_EVENT_P1("*AMR ACS %d", presync->amr_configuration.active_codec_set);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1441 for (i=0; i<dedicated_req->amr_conf.c_cod_prop; i++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1442 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1443 memcpy(&presync->amr_configuration.threshold[i], &dedicated_req->amr_conf.cod_prop[i].codec_thr, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1444 memcpy(&presync->amr_configuration.hysteresis[i], &dedicated_req->amr_conf.cod_prop[i].codec_hyst, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1445 TRACE_EVENT_P2("*AMR threshold[%d] %d", i, presync->amr_configuration.threshold[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1446 TRACE_EVENT_P2("*AMR hysteresis[%d] %d", i, presync->amr_configuration.hysteresis[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1447 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1448
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1449 presync->timing_advance_valid = TRUE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1450 presync->timing_advance = dedicated_req->tr_para.tav;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1451
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1452 if (dedicated_req->start.v_start AND
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1453 dedicated_req->ch_type2.ch NEQ NOT_PRESENT_8BIT)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1454 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1455 if (dedicated_req->ch_type2.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1456 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1457 presync->handover_command.channel_desc_1_bef_sti.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1458 presync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.maio = dedicated_req->ch_type2.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1459 presync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.hsn = dedicated_req->ch_type2.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1460 dedi_fill_ma (dedicated_req->ch_type2.ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1461 (T_frequency_list *)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1462 &presync->handover_command.frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1463 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1464 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1465 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1466 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1467 * Avoid the union !!!
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1468 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1469 presync->handover_command.channel_desc_1_bef_sti.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1470 presync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1471 (UBYTE)(dedicated_req->ch_type2.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1472 presync->handover_command.channel_desc_1_bef_sti.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1473 (UBYTE)((dedicated_req->ch_type2.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1474 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1475 presync->handover_command.channel_desc_1_bef_sti.channel_type =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1476 CH_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1477 presync->handover_command.channel_desc_1_bef_sti.sub_channel =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1478 SUB_TYPE [dedicated_req->ch_type2.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1479 presync->handover_command.channel_desc_1_bef_sti.timeslot_no =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1480 dedicated_req->ch_type2.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1481 presync->handover_command.channel_desc_1_bef_sti.tsc =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1482 dedicated_req->ch_type2.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1483 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1484 presync->handover_command.cipher_mode = dedicated_req->ciph.stat;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1485 presync->handover_command.a5_algorithm = dedicated_req->ciph.algo;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1486 memcpy (&presync->cipher_key, dedicated_req->ciph.kc, sizeof(T_cipher_key));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1487
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1488 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1489 * store the new parameters as temporary configuration.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1490 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1491 alr_data->dedi_data.temp_bcch = dedicated_req->arfcn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1492 memcpy (&alr_data->dedi_data.temp_channel_desc,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1493 &presync->handover_command.channel_desc_1,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1494 sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1495 alr_data->dedi_data.temp_channel_mode =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1496 presync->handover_command.channel_mode_1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1497 alr_data->dedi_data.temp_frequency_list =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1498 presync->handover_command.frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1499 alr_data->dedi_data.temp_cipher_mode =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1500 presync->handover_command.cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1501 alr_data->dedi_data.temp_a5_algorithm =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1502 presync->handover_command.a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1503 alr_data->dedi_data.temp_cipher_key =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1504 presync->cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1505 alr_data->dedi_data.temp_power = presync->handover_command.txpwr;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1506 alr_data->dedi_data.temp_bsic = dedicated_req->bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1507 alr_data->dedi_data.temp_amr_configuration = presync->amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1508 alr_data->dedi_data.act_mode = MODE_PRE_SYNC_HANDOVER;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1509
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1510 nc_get_fn_time (alr_data->dedi_data.temp_bcch,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1511 (ULONG *)&presync->fn_offset,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1512 (ULONG *)&presync->time_alignmnt);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1513
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1514 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1515 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1516 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1517 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1518 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1519 dedi_convert_chan_desc ((T_channel_desc *)&presync->handover_command.channel_desc_1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1520 dedi_convert_chan_desc ((T_channel_desc *)&presync->handover_command.channel_desc_1_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1521 dedi_convert_frequency_list (&presync->handover_command.frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1522 dedi_convert_frequency_list ((T_frequency_list *)&presync->handover_command.frequency_list_bef_sti);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1523 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1524 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1525 * forward the parameters to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1526 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1527 ma_dedi_pre_sync_ho_req (presync);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1528 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1529
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1530 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1531 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1532 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1533 | STATE : code ROUTINE : dedi_freq_redef_req |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1534 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1535
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1536 PURPOSE : Process signal dedi_freq_redef_req from SDL Process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1537 alr_MAIN.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1538 This function is used during frequency redefinition.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1539
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1540 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1541
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1542 GLOBAL void dedi_freq_redef_req (T_MPH_FREQ_REDEF_REQ *freq)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1543 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1544 PALLOC (change, MPHC_CHANGE_FREQUENCY);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1545
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1546 ALR_EM_CONFIGURE_FREQUENCY_REDEFINITION;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1547
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1548 memset (change, 0, sizeof (T_MPHC_CHANGE_FREQUENCY));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1549 if (freq->ch_type.h EQ 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1550 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1551 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1552 * new channel uses frequency hopping
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1553 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1554 change->channel_desc.chan_sel.h = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1555 change->channel_desc.chan_sel.rf_channel.maio = freq->ch_type.maio;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1556 change->channel_desc.chan_sel.rf_channel.hsn = freq->ch_type.hsn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1557 dedi_fill_ma (freq->ch_type.ma, &change->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1558 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1559 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1560 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1561 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1562 * Avoid the union for the non-hopping case
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1563 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1564 change->channel_desc.chan_sel.h = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1565 change->channel_desc.chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1566 (UBYTE)(freq->ch_type.arfcn & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1567 change->channel_desc.chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1568 (UBYTE)((freq->ch_type.arfcn >> 8) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1569 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1570
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1571 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1572 * fill layer 1 structure with the parameters.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1573 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1574 change->channel_desc.channel_type = CH_TYPE [freq->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1575 change->channel_desc.sub_channel = SUB_TYPE [freq->ch_type.ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1576 change->channel_desc.timeslot_no = freq->ch_type.tn;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1577 change->channel_desc.tsc = freq->ch_type.tsc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1578 change->starting_time.start_time_present = freq->start.v_start;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1579 change->starting_time.start_time.t1 = freq->start.t1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1580 change->starting_time.start_time.t3 = freq->start.t3;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1581 change->starting_time.start_time.t2 = freq->start.t2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1582
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1583 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1584 * store new values as temporary configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1585 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1586 alr_data->dedi_data.redef_channel_desc = change->channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1587 alr_data->dedi_data.redef_frequency_list = change->frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1588 alr_data->dedi_data.redef_starting_time = change->starting_time;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1589
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1590 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1591 * convert channel numbers if needed
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1592 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1593 if (dedi_conversion_needed ())
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1594 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1595 dedi_convert_chan_desc (&change->channel_desc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1596 dedi_convert_frequency_list (&change->frequency_list);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1597 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1598 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1599 * forward parameters to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1600 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1601 ma_dedi_change_freq_req (change);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1602
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1603 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1604
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1605 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1606 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1607 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1608 | STATE : code ROUTINE : dedi_chan_mode_req |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1609 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1610
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1611 PURPOSE : Process signal dedi_chan_mode_req from SDL Process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1612 alr_MAIN.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1613 This function is used during channel mode modify procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1614
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1615 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1616
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1617 GLOBAL void dedi_chan_mode_req (T_MPH_CHANNEL_MODE_REQ *ch_mode)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1618 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1619 int i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1620 PALLOC (chm, MPHC_CHANNEL_MODE_MODIFY_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1621
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1622 ALR_EM_CONFIGURE_CHANNEL_MODE_MODIFY;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1623
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1624 memset (chm, 0, sizeof (T_MPHC_CHANNEL_MODE_MODIFY_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1625 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1626 * convert parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1627 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1628 chm->sub_channel = SUB_TYPE [ch_mode->ch];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1629 alr_data->dedi_data.act_channel_mode =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1630 chm->channel_mode = dedi_channel_mode (ch_mode->mode,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1631 actual_channel);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1632
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1633 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1634 * set multirate configuration parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1635 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1636 if(ch_mode->mode EQ CM_AMR)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1637 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1638 alr_data->dedi_data.act_amr_configuration.noise_suppression_control_bit =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1639 chm->amr_configuration.noise_suppression_control_bit = ch_mode->amr_conf.nscb;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1640 alr_data->dedi_data.act_amr_configuration.initial_codec_mode_indicator =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1641 chm->amr_configuration.initial_codec_mode_indicator = ch_mode->amr_conf.icmi;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1642 alr_data->dedi_data.act_amr_configuration.initial_codec_mode =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1643 chm->amr_configuration.initial_codec_mode = ch_mode->amr_conf.st_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1644 alr_data->dedi_data.act_amr_configuration.active_codec_set =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1645 chm->amr_configuration.active_codec_set = ch_mode->amr_conf.acs;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1646
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1647 /* Traces only needed for IOT session */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1648 TRACE_EVENT_P1("*AMR NSCB %d", chm->amr_configuration.noise_suppression_control_bit);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1649 TRACE_EVENT_P1("*AMR ICMI %d", chm->amr_configuration.initial_codec_mode_indicator);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1650 TRACE_EVENT_P1("*AMR ICM %d", chm->amr_configuration.initial_codec_mode);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1651 TRACE_EVENT_P1("*AMR ACS %d", chm->amr_configuration.active_codec_set);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1652 for (i=0; i<ch_mode->amr_conf.c_cod_prop; i++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1653 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1654 memcpy(&alr_data->dedi_data.act_amr_configuration.threshold[i], &ch_mode->amr_conf.cod_prop[i].codec_thr, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1655 memcpy(&alr_data->dedi_data.act_amr_configuration.hysteresis[i], &ch_mode->amr_conf.cod_prop[i].codec_hyst, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1656
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1657 memcpy(&chm->amr_configuration.threshold[i], &ch_mode->amr_conf.cod_prop[i].codec_thr, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1658 memcpy(&chm->amr_configuration.hysteresis[i], &ch_mode->amr_conf.cod_prop[i].codec_hyst, 1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1659 TRACE_EVENT_P2("*AMR threshold[%d] %d", i, chm->amr_configuration.threshold[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1660 TRACE_EVENT_P2("*AMR hysteresis[%d] %d", i, chm->amr_configuration.hysteresis[i]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1661 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1662 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1663
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1664 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1665 * forward new channel mode to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1666 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1667 ma_dedi_chan_mode_req (chm);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1668 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1669
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1670 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1671 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1672 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1673 | STATE : code ROUTINE : dedi_ciph_req |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1674 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1675
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1676 PURPOSE : Process signal dedi_ciph_req from SDL Process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1677 alr_MAIN.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1678 This function is used during cipher mode setting procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1679
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1680 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1681
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1682 GLOBAL void dedi_ciph_req (T_MPH_CIPHERING_REQ *ciph_req)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1683 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1684 PALLOC (set_ciph, MPHC_SET_CIPHERING_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1685
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1686 ALR_EM_CONFIGURE_CIPHER_MODE_SETTING;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1687
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1688 memset (set_ciph, 0, sizeof (T_MPHC_SET_CIPHERING_REQ));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1689 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1690 * convert the parameters to the layer 1 structure
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1691 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1692 set_ciph->cipher_mode = ciph_req->ciph.stat;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1693 set_ciph->a5_algorithm = ciph_req->ciph.algo;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1694 memcpy (set_ciph->new_ciph_param.A, ciph_req->ciph.kc, sizeof(T_cipher_key));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1695
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1696 alr_data->dedi_data.act_cipher_mode = set_ciph->cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1697 alr_data->dedi_data.act_a5_algorithm = set_ciph->a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1698 memcpy (&alr_data->dedi_data.act_cipher_key,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1699 &set_ciph->new_ciph_param, sizeof(T_cipher_key));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1700
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1701 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1702 * forward the parameters to layer 1
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1703 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1704 ma_dedi_ciph_req (set_ciph);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1705 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1706
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1707
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1708 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1709 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1710 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1711 | STATE : code ROUTINE : dedi_imm_ass_cnf |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1712 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1713
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1714 PURPOSE : Process signal dedi_imm_ass_cnf from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1715 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1716 Layer 1 confirms the configuration of a dedicated
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1717 channel during the immediate assignment procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1718
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1719 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1720
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1721 GLOBAL void dedi_imm_ass_cnf (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1722 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1723 T_DEDI_DATA * d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1724
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1725 if (GET_STATE (STATE_DEDI) EQ DEDI_IMM_ASS)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1726 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1727 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1728 * the response of layer 1 is expected
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1729 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1730 ma_clean_dedi_sys_buffer ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1731 SET_STATE (STATE_DEDI, DEDI_ACTIVE);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1732 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1733 * store temporary parameters as actual channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1734 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1735 d->act_bcch = d->temp_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1736 d->act_channel_desc = d->temp_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1737 d->act_channel_mode = d->temp_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1738 d->act_frequency_list = d->temp_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1739 d->act_starting_time = d->temp_starting_time;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1740 d->act_frequency_list_bef_sti = d->temp_frequency_list_bef_sti;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1741 d->act_channel_desc_bef_sti = d->temp_channel_desc_bef_sti;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1742 d->act_pwrc = d->temp_pwrc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1743 d->act_cipher_mode = d->temp_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1744 d->act_a5_algorithm = d->temp_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1745 d->act_cipher_key = d->temp_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1746 d->act_power = cut_power_value (alr_data->rach_data.max_tx_pwr_ccch, NULL);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1747 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1748 * Send a MPH_DEDICATED_CNF to RR to
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1749 * start the establishment of the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1750 * layer 2 connection.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1751 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1752 ma_dedi_cnf (DEDICATED_SUCCESS);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1753 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1754 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1755 if (GET_STATE (STATE_DEDI) EQ DEDI_IMM_ASS_RECONN)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1756 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1757 ma_clean_dedi_sys_buffer ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1758 dedi_chan_ass_fail(); /* act_mode will take on MODE_CHAN_ASS_FAIL */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1759 SET_STATE (STATE_DEDI, DEDI_ACTIVE);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1760 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1761 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1762
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1763 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1764 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1765 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1766 | STATE : code ROUTINE : dedi_change_freq_cnf |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1767 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1768
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1769 PURPOSE : Process signal dedi_change_freq_cnf from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1770 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1771 Layer 1 confirms setting of the new parameters during
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1772 a frequency redefinition procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1773 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1774
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1775 GLOBAL void dedi_change_freq_cnf (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1776 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1777 T_DEDI_DATA *d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1778
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1779 d->act_channel_desc = d->redef_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1780 d->act_frequency_list = d->redef_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1781 memset (&d->redef_channel_desc, 0, sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1782 memset (&d->redef_frequency_list, 0, sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1783 memset (&d->redef_starting_time, 0, sizeof (T_starting_time));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1784 ma_clean_dedi_sys_buffer ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1785 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1786
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1787 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1788 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1789 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1790 | STATE : code ROUTINE : dedi_chan_ass_cnf |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1791 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1792
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1793 PURPOSE : Process signal dedi_chan_ass_cnf from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1794 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1795 Layer 1 confirms setting of a new channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1796 during a channel assignment procedure.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1797
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1798 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1799
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1800 GLOBAL void dedi_chan_ass_cnf (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1801 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1802 if (GET_STATE (STATE_DEDI) EQ DEDI_ACTIVE)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1803 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1804 if (alr_data->dedi_data.act_mode EQ MODE_CHAN_ASSIGN)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1805 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1806 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1807 * the response of layer 1 was exspected in the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1808 * positive case of switching to a new channel.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1809 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1810 T_DEDI_DATA *d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1811
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1812 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1813 * store actual parameters as old parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1814 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1815 d->old_channel = actual_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1816 d->old_bcch = d->act_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1817 d->old_channel_desc = d->act_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1818 d->old_channel_mode = d->act_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1819 d->old_frequency_list = d->act_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1820 d->old_cipher_mode = d->act_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1821 d->old_a5_algorithm = d->act_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1822 d->old_cipher_key = d->act_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1823 d->old_power = d->act_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1824 d->old_dtx_allowed = d->act_dtx_allowed;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1825 d->old_amr_configuration = d->act_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1826
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1827 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1828 * store temporary parameters as actual channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1829 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1830 actual_channel = d->temp_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1831 d->act_bcch = d->temp_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1832 d->act_channel_desc = d->temp_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1833 d->act_channel_mode = d->temp_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1834 d->act_frequency_list = d->temp_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1835 d->act_cipher_mode = d->temp_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1836 d->act_a5_algorithm = d->temp_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1837 d->act_cipher_key = d->temp_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1838 d->act_power = d->temp_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1839 d->act_dtx_allowed = d->temp_dtx_allowed;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1840 d->act_amr_configuration = d->temp_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1841 ma_dedi_cnf (DEDICATED_SUCCESS);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1842 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1843 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1844 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1845 * the response of layer 1 was exspected in the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1846 * negative case of switching to the old channel.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1847 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1848 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1849 ma_dedi_fail_cnf ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1850 memset (&alr_data->dedi_data.redef_channel_desc, 0, sizeof (T_channel_desc));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1851 memset (&alr_data->dedi_data.redef_frequency_list, 0, sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1852 memset (&alr_data->dedi_data.redef_starting_time, 0, sizeof (T_starting_time));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1853 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1854 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1855 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1856
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1857 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1858 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1859 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1860 | STATE : code ROUTINE : dedi_ho_fail_cnf |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1861 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1862
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1863 PURPOSE : Process signal dedi_ho_fail_cnf from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1864 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1865 Layer 1 signals that the handover has failed.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1866
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1867 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1868
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1869 GLOBAL void dedi_ho_fail_cnf (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1870 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1871 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1872 * recalculate all timing advances to the old bcch.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1873 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1874 nc_update_list (alr_data->dedi_data.act_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1875 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1876 * signal dedicated failure to RR
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1877 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1878 nc_resume_dedicated();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1879 ma_dedi_fail_cnf ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1880 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1881
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1882 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1883 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1884 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1885 | STATE : code ROUTINE : dedi_async_ho_cnf |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1886 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1887
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1888 PURPOSE : Process signal dedi_async_ho_cnf from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1889 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1890 This function handles the positive end of an
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1891 asynchronous handover.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1892
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1893 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1894
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1895 GLOBAL void dedi_async_ho_cnf (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1896 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1897 T_DEDI_DATA *d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1898 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1899 * All timing advances are now calculated relative
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1900 * to the new dedicated channel
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1901 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1902 nc_update_list (alr_data->dedi_data.temp_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1903 ma_clean_dedi_sys_buffer ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1904 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1905 * store actual parameters as old parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1906 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1907 d->old_channel = actual_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1908 d->old_bcch = d->act_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1909 d->old_bsic = alr_data->bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1910 d->old_channel_desc = d->act_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1911 d->old_channel_mode = d->act_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1912 d->old_frequency_list = d->act_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1913 d->old_cipher_mode = d->act_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1914 d->old_a5_algorithm = d->act_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1915 d->old_cipher_key = d->act_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1916 d->old_power = d->act_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1917 d->old_amr_configuration = d->act_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1918 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1919 * store temporary parameters as actual channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1920 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1921 actual_channel = d->temp_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1922
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1923 alr_data->serving_cell = d->act_bcch = d->temp_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1924 alr_data->sc_band = get_band(d->act_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1925 alr_data->bsic = alr_data->dedi_data.temp_bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1926 d->act_channel_desc = d->temp_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1927 d->act_channel_mode = d->temp_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1928 d->act_frequency_list = d->temp_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1929 d->act_cipher_mode = d->temp_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1930 d->act_a5_algorithm = d->temp_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1931 d->act_cipher_key = d->temp_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1932 d->act_power = d->temp_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1933 d->old_amr_configuration = d->act_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1934
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1935 if (alr_data->nc_data.dtx)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1936 nc_update_dedicated (alr_data->nc_data.dtx,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1937 alr_data->nc_data.pwrc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1938 nc_resume_dedicated();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1939 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1940
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1941 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1942 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1943 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1944 | STATE : code ROUTINE : dedi_sync_ho_cnf |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1945 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1946
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1947 PURPOSE : Process signal dedi_sync_ho_cnf from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1948 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1949 This function handles the positive end of a
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1950 synchronous handover.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1951
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1952 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1953
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1954 GLOBAL void dedi_sync_ho_cnf (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1955 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1956 T_DEDI_DATA *d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1957
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1958 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1959 * All timing advances are now calculated relative
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1960 * to the new dedicated channel
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1961 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1962 nc_update_list (alr_data->dedi_data.temp_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1963 ma_clean_dedi_sys_buffer ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1964 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1965 * store actual parameters as old parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1966 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1967 d->old_channel = actual_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1968 d->old_bcch = d->act_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1969 d->old_bsic = alr_data->bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1970 d->old_channel_desc = d->act_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1971 d->old_channel_mode = d->act_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1972 d->old_frequency_list = d->act_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1973 d->old_cipher_mode = d->act_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1974 d->old_a5_algorithm = d->act_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1975 d->old_cipher_key = d->act_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1976 d->old_power = d->act_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1977 d->old_amr_configuration = d->act_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1978
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1979 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1980 * store temporary parameters as actual channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1981 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1982 actual_channel = d->temp_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1983
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1984 alr_data->serving_cell = d->act_bcch = d->temp_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1985 alr_data->sc_band = get_band(d->act_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1986 alr_data->bsic = alr_data->dedi_data.temp_bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1987 d->act_channel_desc = d->temp_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1988 d->act_channel_mode = d->temp_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1989 d->act_frequency_list = d->temp_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1990 d->act_cipher_mode = d->temp_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1991 d->act_a5_algorithm = d->temp_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1992 d->act_cipher_key = d->temp_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1993 d->act_power = d->temp_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1994 d->act_amr_configuration = d->temp_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1995
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1996 if (alr_data->nc_data.dtx)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1997 nc_update_dedicated (alr_data->nc_data.dtx,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1998 alr_data->nc_data.pwrc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1999
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2000 nc_resume_dedicated();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2001 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2002
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2003 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2004 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2005 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2006 | STATE : code ROUTINE : dedi_pre_sync_ho_cnf |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2007 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2008
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2009 PURPOSE : Process signal dedi_pre_sync_ho_cnf from SDL process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2010 Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2011 This function handles the positive end of a
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2012 pre-synchronous handover.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2013
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2014 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2015
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2016 GLOBAL void dedi_pre_sync_ho_cnf (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2017 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2018 T_DEDI_DATA *d = &alr_data->dedi_data;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2019 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2020 * All timing advances are now calculated relative
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2021 * to the new dedicated channel
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2022 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2023 nc_update_list (alr_data->dedi_data.temp_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2024 ma_clean_dedi_sys_buffer ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2025 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2026 * store actual parameters as old parameters
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2027 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2028 d->old_channel = actual_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2029 d->old_bcch = d->act_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2030 d->old_bsic = alr_data->bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2031 d->old_channel_desc = d->act_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2032 d->old_channel_mode = d->act_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2033 d->old_frequency_list = d->act_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2034 d->old_cipher_mode = d->act_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2035 d->old_a5_algorithm = d->act_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2036 d->old_cipher_key = d->act_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2037 d->old_power = d->act_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2038 d->old_amr_configuration = d->act_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2039
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2040 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2041 * store temporary parameters as actual channel configuration
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2042 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2043 actual_channel = d->temp_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2044 alr_data->serving_cell = d->act_bcch = d->temp_bcch;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2045 alr_data->sc_band = get_band(d->act_bcch);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2046 alr_data->bsic = alr_data->dedi_data.temp_bsic;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2047 d->act_channel_desc = d->temp_channel_desc;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2048 d->act_channel_mode = d->temp_channel_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2049 d->act_frequency_list = d->temp_frequency_list;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2050 d->act_cipher_mode = d->temp_cipher_mode;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2051 d->act_a5_algorithm = d->temp_a5_algorithm;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2052 d->act_cipher_key = d->temp_cipher_key;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2053 d->act_power = d->temp_power;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2054 d->old_amr_configuration = d->act_amr_configuration;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2055
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2056 if (alr_data->nc_data.dtx)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2057 nc_update_dedicated (alr_data->nc_data.dtx,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2058 alr_data->nc_data.pwrc);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2059
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2060 nc_resume_dedicated();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2061 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2062
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2063 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2064 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2065 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2066 | STATE : code ROUTINE : dedi_fill_ma |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2067 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2068
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2069 PURPOSE : Fills a frequency list for layer 1.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2070 Condat´s representation is a list of USHORT with
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2071 0xFFFF as delimiter.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2072 TI´s representation is different from this.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2073
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2074 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2075
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2076 LOCAL void dedi_fill_ma (USHORT * ma,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2077 T_frequency_list * rf)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2078 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2079 UBYTE i = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2080
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2081 memset (rf, 0, sizeof (T_frequency_list));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2082
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2083 while (ma[i] NEQ NOT_PRESENT_16BIT AND
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2084 i < MAX_MA_CARRIER)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2085 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2086 rf->rf_chan_no.radio_freq[i] = ma[i];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2087 i++;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2088 rf->rf_chan_cnt++;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2089 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2090 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2091
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2092 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2093 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2094 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2095 | STATE : code ROUTINE : dedi_tch_loop_req |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2096 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2097
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2098 PURPOSE : Process signal dedi_tch_loop_req from SDL Process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2099 alr_MAIN.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2100
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2101 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2102
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2103 GLOBAL void dedi_tch_loop_req (T_MPH_TCH_LOOP_REQ *tloop)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2104 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2105 if (tloop->tch_loop EQ NOT_PRESENT_8BIT)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2106 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2107 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2108 * Open TCH loop
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2109 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2110 ma_dedi_open_tch_loop_req ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2111
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2112 ALR_EM_CONFIGURE_TCH_LOOP(EM_TCH_OPEN);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2113
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2114 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2115 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2116 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2117 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2118 * Close TCH loop
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2119 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2120 PALLOC (loop, OML1_CLOSE_TCH_LOOP_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2121
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2122 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2123 * Format of tch_loop in according to 3GPP 04.14, 8.1 CLOSE_TCH_LOOP_CMD
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2124 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2125 loop->sub_channel = alr_data->dedi_data.act_channel_desc.sub_channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2126 loop->frame_erasure = tloop->tch_loop;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2127
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2128 ma_dedi_close_tch_loop_req (loop);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2129
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2130 ALR_EM_CONFIGURE_TCH_LOOP(EM_TCH_CLOSE);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2131 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2132 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2133
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2134
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2135 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2136 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2137 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2138 | STATE : code ROUTINE : dedi_dai_req |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2139 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2140
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2141 PURPOSE : Process signal dedi_dai_req from SDL Process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2142 alr_MAIN.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2143 RR requests configuration of the digital audio interface.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2144
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2145 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2146
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2147 GLOBAL void dedi_dai_req (T_MPH_DAI_REQ * dai)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2148 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2149
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2150 if (dai->device EQ DAI_NO_TEST)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2151 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2152 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2153 * Stop DAI test
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2154 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2155 ma_dedi_stop_dai_req ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2156
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2157 ALR_EM_CONFIGURE_DAI_TESTING(EM_DAI_STOP);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2158
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2159 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2160 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2161 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2162 PALLOC (dai_req, OML1_START_DAI_TEST_REQ);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2163
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2164 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2165 * Start DAI test
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2166 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2167 dai_req->tested_device = dai->device;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2168 ma_dedi_start_dai_req (dai_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2169
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2170 ALR_EM_CONFIGURE_DAI_TESTING(EM_DAI_START);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2171
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2172 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2173 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2174
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2175 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2176 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2177 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2178 | STATE : code ROUTINE : dedi_channel_mode |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2179 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2180
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2181 PURPOSE : The function converts the channel mode representation
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2182 from Condat´s notation (equal to GSM) to TI´s values.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2183
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2184 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2185
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2186 LOCAL UBYTE dedi_channel_mode (UBYTE channel_mode, UBYTE channel_type)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2187 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2188 switch (channel_mode)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2189 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2190 case MODE_SIG_ONLY: /* signalling only */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2191 return CM_SIGNALLING_ONLY;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2192
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2193 case MODE_SPEECH_VER1: /* Speech */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2194 if (channel_type EQ CH_TYPE[TCH_F_INDEX]) /* TCH fullrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2195 return CM_TCH_FS; /* TCH fullrate speech */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2196 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2197 return CM_TCH_HS; /* TCH halfrate speech */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2198
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2199 case MODE_DATA_12_0: /* Data 12 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2200 return CM_TCH_96;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2201
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2202 case MODE_DATA_6_0: /* Data 6 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2203 if (channel_type EQ CH_TYPE[TCH_F_INDEX]) /* TCH fullrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2204 return CM_TCH_F_48; /* TCH fullrate data 6 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2205 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2206 return CM_TCH_H_48; /* TCH halfrate data 6 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2207
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2208 case MODE_DATA_3_6: /* Data 3.6 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2209 if (channel_type EQ CH_TYPE[TCH_F_INDEX]) /* TCH fullrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2210 return CM_TCH_F_24; /* TCH fullrate data 3.6 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2211 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2212 return CM_TCH_H_24; /* TCH halfrate data 3.6 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2213
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2214 case MODE_DATA_14_5: /* Data 14.5 k */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2215 return CM_TCH_144; /* TCH fullrate data 14.5 k*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2216
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2217 case MODE_SPEECH_VER2: /* enhanced full rate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2218 return CM_TCH_EFR;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2219
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2220 case MODE_SPEECH_VER3: /* adaptiv multi-rate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2221 if (channel_type EQ CH_TYPE[TCH_F_INDEX]) /* TCH fullrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2222 return CM_TCH_AFS; /* TCH/AFS fullrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2223 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2224 return CM_TCH_AHS; /* TCH/AHS halfrate */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2225
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2226 default:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2227 return CM_SIGNALLING_ONLY; /* all other set to signalling only */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2228 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2229 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2230
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2231 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2232 +------------------------------ --------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2233 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2234 | STATE : code ROUTINE : dedi_increment_rlt |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2235 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2236
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2237 PURPOSE : A valid block has received on SACCH. The radio
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2238 link counter is incremented if possible.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2239
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2240 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2241
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2242 GLOBAL void dedi_increment_rlt (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2243 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2244 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2245 * increase radio link timeout counter if necessary
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2246 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2247 if (alr_data->dedi_data.act_rlt NEQ alr_data->dedi_data.rlt)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2248 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2249 alr_data->dedi_data.act_rlt += 2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2250
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2251 if (alr_data->dedi_data.act_rlt > alr_data->dedi_data.rlt)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2252 alr_data->dedi_data.act_rlt = alr_data->dedi_data.rlt;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2253 #if !defined NTRACE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2254 trc_mon_counter_dedi (alr_data->dedi_data.act_rlt,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2255 alr_data->dedi_data.rlt);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2256 #endif /* (!defined NTRACE) */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2257
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2258 ALR_EM_SET_EM_ACT_RLT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2259 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2260 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2261
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2262 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2263 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2264 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2265 | STATE : code ROUTINE : dedi_decrement_rlt |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2266 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2267
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2268 PURPOSE : An invalid block has received on SACCH. The radio
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2269 link counter is decremented. If the value is zero
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2270 an error indication is send to RR.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2271 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2272
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2273 GLOBAL void dedi_decrement_rlt (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2274 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2275
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2276 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2277 * invalid block received. Decrement radio link timeout counter.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2278 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2279 if (alr_data->dedi_data.act_rlt > 1)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2280 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2281 #if !defined NTRACE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2282 trc_mon_counter_dedi (alr_data->dedi_data.act_rlt,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2283 alr_data->dedi_data.rlt);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2284 #endif /* (!defined NTRACE */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2285 alr_data->dedi_data.act_rlt--;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2286
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2287 ALR_EM_SET_EM_ACT_RLT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2288
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2289 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2290 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2291 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2292 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2293 * radio link failure detected
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2294 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2295 ma_error_ind (CS_RADIO_LINK_FAIL, alr_data->serving_cell);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2296 alr_data->dedi_data.act_rlt = alr_data->dedi_data.rlt;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2297 #if !defined NTRACE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2298 trc_mon_counter_dedi (alr_data->dedi_data.act_rlt,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2299 alr_data->dedi_data.rlt);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2300 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2301
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2302 ALR_EM_SET_EM_ACT_RLT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2303
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2304 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2305 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2306
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2307 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2308 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2309 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2310 | STATE : code ROUTINE : dedi_convert_frequency_list|
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2311 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2312
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2313 PURPOSE : converts the channel numbers of a frequency list
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2314 in the non-hopping case for DCS 1800 channel numbers
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2315 in the dualband variants.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2316 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2317
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2318 LOCAL void dedi_convert_frequency_list (T_frequency_list * frequency_list)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2319 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2320 UBYTE i, j;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2321
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2322 i = (UBYTE)frequency_list->rf_chan_cnt;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2323
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2324 if (i >= 64)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2325 i = 63;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2326
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2327 ALR_TRACE_DEDI ("-----------");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2328
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2329 for (j = 0; j < i; j++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2330 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2331 ALR_TRACE_DEDI_FREQ_LIST ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2332
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2333 frequency_list->rf_chan_no.radio_freq[j] =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2334 ARFCN_TO_L1 (frequency_list->rf_chan_no.radio_freq[j]);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2335 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2336 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2337
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2338 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2339 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2340 | PROJECT : GSM-PS (8403) MODULE : ALR_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2341 | STATE : code ROUTINE : dedi_stop |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2342 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2343
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2344 PURPOSE : Process signal dedi_stop from SDL process Main_Control.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2345 This signal stops all dedicated activities of ALR.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2346
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2347 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2348
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2349 GLOBAL void dedi_stop (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2350 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2351 if (GET_STATE (STATE_DEDI) NEQ DEDI_INACTIVE)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2352 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2353 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2354 * if dedicated mode is active,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2355 * the process and layer 1 are set to idle.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2356 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2357 SET_STATE (STATE_DEDI, DEDI_INACTIVE);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2358 ma_dedi_stop_req ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2359 alr_data->dedi_data.act_mode = NOT_PRESENT_8BIT;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2360 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2361 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2362
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2363 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2364 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2365 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2366 | STATE : code ROUTINE : dedi_convert_chan_desc |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2367 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2368
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2369 PURPOSE : converts the channel number of a channel description
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2370 in the non-hopping case for DCS 1800 channel numbers
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2371 in the dualband variants.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2372 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2373
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2374 LOCAL void dedi_convert_chan_desc (T_channel_desc * channel_desc)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2375 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2376 USHORT channel;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2377
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2378 if (channel_desc->chan_sel.h EQ 0)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2379 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2380 channel = (USHORT)(channel_desc->chan_sel.rf_channel.maio +
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2381 (channel_desc->chan_sel.rf_channel.hsn << 8));
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2382 channel_desc->chan_sel.rf_channel.maio =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2383 (UBYTE)(ARFCN_TO_L1(channel) & 0xFF);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2384 channel_desc->chan_sel.rf_channel.hsn =
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2385 (UBYTE)(ARFCN_TO_L1(channel) >> 8);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2386 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2387 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2388
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2389 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2390 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2391 | PROJECT : GSM-PS (8403) MODULE : alr_DEDI |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2392 | STATE : code ROUTINE : dedi_conversion_needed |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2393 +--------------------------------------------------------------------+
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2394
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2395 PURPOSE : Checks whether conversion is needed or not.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2396
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2397 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2398
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2399 LOCAL UBYTE dedi_conversion_needed (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2400 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2401 if ((std EQ STD_EGSM) OR
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2402 (std EQ STD_DUAL) OR
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2403 (std EQ STD_DUAL_EGSM) OR
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2404 (std EQ STD_DUAL_US))
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2405 return TRUE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2406 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2407 return FALSE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2408 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2409 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2410
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2411