FreeCalypso > hg > fc-selenite
annotate src/g23m-gsm/alr2/alr_gprs.c @ 181:e9674b5a00ed
targets/tangomdm.* added
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 04 Jan 2020 21:51:12 +0000 |
parents | b4c81ea2d291 |
children |
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_GPRS |
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 module implements the necessary funtionality |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18 | for switching to and from GPRS mode and also |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 | the handling if determining if GPRS is supported |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 | by the cell. |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21 +----------------------------------------------------------------------------- |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23 #ifndef ALR_GPRS_C |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 #define ALR_GPRS_C |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 #define ENTITY_PL |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
29 /*==== INCLUDES ===================================================*/ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
30 #include <string.h> |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 #include <stdlib.h> |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 #include <ctype.h> |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33 #include "typedefs.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 #include "pconst.cdg" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35 #include "mconst.cdg" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 #include "message.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 #include "ccdapi.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 #include "vsi.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 #include "custom.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40 #include "gsm.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 #include "prim.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 #include "cnf_alr.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43 #include "mon_alr.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 #include "pei.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45 #include "tok.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 #include "pcm.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 #include "alr_gprs.h" |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 #define TRACING |
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 #define TRACING |
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 #define TRACING |
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 #if defined (TRACING) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 #define ALR_TRACE_GPRS(a) ALR_TRACE(a) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 #else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57 #define ALR_TRACE_GPRS(a) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 #endif |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 LOCAL BOOL gprs_read_si13 (UBYTE si13_position); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61 LOCAL void gprs_alr_nc_enter_ptm (void); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 LOCAL void gprs_alr_tb_meas_ind (T_TB_MEAS_IND* report); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 LOCAL const T_FUNC tb_table[] = { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 MAK_FUNC_0( gprs_alr_tb_meas_ind, TB_MEAS_IND ) /* 0 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 }; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
68 #define ONLY_BCC 7 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
69 static UBYTE gprs_support = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
70 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 | STATE : code ROUTINE : gprs_alr_get_table | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
75 +--------------------------------------------------------------------+ |
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 PURPOSE : |
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 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 void gprs_alr_get_table(const T_FUNC **tab, USHORT *n) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82 *tab = tb_table; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 *n = TAB_SIZE (tb_table); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
85 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
86 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
87 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
88 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
89 | STATE : code ROUTINE : gprs_alr_mon_ctrl_req | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
90 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
91 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
92 PURPOSE : |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
93 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
94 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
95 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
96 * required for TESTMODE A/B |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
97 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
98 EXTERN UBYTE grlc_test_mode_active(void); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
99 void gprs_alr_mon_ctrl_req(T_MPH_MON_CTRL_REQ* ctrl_req) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
101 ALR_TRACE_GPRS("mon_ctrl_req"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
102 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 switch(GET_STATE(STATE_MA)) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 case MA_CELL_SELECTION: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 switch(ctrl_req->action) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 case START_MON_EBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109 if(ctrl_req->si_to_read EQ UPDATE_SI13) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 PALLOC(req, MPHC_SCELL_EBCCH_REQ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112 req->schedule_array_size = 1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 req->schedule_array[0].modulus = 8; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 req->schedule_array[0].relative_position = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116 ma_scell_ebcch_req(req); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
117 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
120 break; |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
123 case MA_CELL_RESELECTION: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
124 switch(ctrl_req->action) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
125 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
126 case START_MON_EBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
127 /*for SI13 reading control*/ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
128 if(ctrl_req->si_to_read EQ UPDATE_SI13) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
129 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
130 PALLOC(req, MPHC_SCELL_EBCCH_REQ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
131 req->schedule_array_size = 1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
132 req->schedule_array[0].modulus = 8; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
133 req->schedule_array[0].relative_position = 0; |
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 ma_scell_ebcch_req(req); |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
138 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
139 break; |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
142 case MA_IDLE: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
143 switch(ctrl_req->action) |
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 case START_MON_EBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
146 /*for SI13 reading control*/ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
147 if(ctrl_req->si_to_read EQ UPDATE_SI13) |
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 PALLOC(req, MPHC_SCELL_EBCCH_REQ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
150 req->schedule_array_size = 1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
151 req->schedule_array[0].modulus = 8; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
152 req->schedule_array[0].relative_position = 0; |
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 ma_scell_ebcch_req(req); |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
157 case START_MON_NBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
158 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
159 USHORT si_mask = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
160 UBYTE tc = 0; /* refer to GSM Spec 05.02, clause 6.3.1.3 Mapping of BCCH data */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
161 UBYTE i,k; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
162 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
163 switch(ctrl_req->si_to_read) |
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 case UPDATE_SI13: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
166 gprs_read_si13(SI13_ON_NBCCH); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
167 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
168 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
169 case UPDATE_SI13_GSM: |
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 PALLOC(scell_bcch_req, MPHC_SCELL_NBCCH_REQ); |
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 scell_bcch_req->schedule_array_size = 1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
174 scell_bcch_req->schedule_array[0].modulus = 8; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
175 scell_bcch_req->schedule_array[0].relative_position = 4; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
176 ma_scell_nbcch_req(scell_bcch_req); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
177 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
178 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
179 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
180 case UNSPECIFIED_SI: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
181 case COMPLETE_SI: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
182 ma_clean_sys_buffer (IND_ALL_IDLE_SI); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
183 ma_scell_full_nbcch(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
184 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
185 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
186 case UPDATE_SI1: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
187 si_mask = IND_SI_1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
188 tc = (1<<0); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
189 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
190 case UPDATE_SI2_SI2BIS_OR_SI2TER: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
191 si_mask = IND_SI_2 | IND_SI_2BIS | IND_SI_2TER; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
192 tc = (1<<1) | (1<<4) | (1<<5); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
193 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
194 case UPDATE_SI3_SI4_SI7_OR_SI8: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
195 si_mask = IND_SI_3 | IND_SI_4; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
196 tc = (1<<2) | (1<<3) | (1<<6) | (1<<7); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
197 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
198 case UPDATE_SI9: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
199 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
200 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
201 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
202 if ( si_mask ) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
203 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
204 PALLOC(scell_bcch_req, MPHC_SCELL_NBCCH_REQ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
205 k = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
206 scell_bcch_req->schedule_array_size = k; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
207 for ( i = 0; i < 8; i++ ) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
208 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
209 if ( (tc & (1 << i)) != 0 ) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
210 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
211 scell_bcch_req->schedule_array[k].modulus = 8; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
212 scell_bcch_req->schedule_array[k].relative_position = i; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
213 k++; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
214 scell_bcch_req->schedule_array_size = k; |
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 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
217 ma_clean_sys_buffer ( si_mask ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
218 ma_scell_nbcch_req ( scell_bcch_req ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
219 } |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
222 case STOP_MON_CCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
223 /* PBCCH is present, stop all activities */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
224 /*ma_stop_active_procs(STOP_PCH_READING | STOP_MEASUREMENTS);*/ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
225 pch_stop(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
226 /*alr_data->gprs_data.pbcch = 1;*/ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
227 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
228 case START_MON_CCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
229 if(alr_data->gprs_data.pbcch EQ TRUE) |
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 pch_configure (NULL, PGM_NORMAL); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
232 pch_save_pgm(PGM_NORMAL); /* reset saved pgm to REORG_CS */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
233 pch_start_ccch_req(); |
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 break; |
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 case LEAVING_PIM_PBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
238 /* we are about to enter PAM or PTM */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
239 if(alr_data->gprs_data.pbcch EQ TRUE) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
240 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
241 TRACE_EVENT("leave pim"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
242 alr_data->gprs_data.pim = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
243 pch_stop(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
244 cb_stop(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
245 nc_suspend(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
246 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
247 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
248 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
249 TRACE_EVENT("huch pim"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
250 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
251 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
252 case LEAVING_PAM_PBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
253 /* we are about to enter PTM or PIM */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
254 if(alr_data->gprs_data.pbcch EQ TRUE) |
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 /* do nothing, nothing should be active */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
257 alr_data->gprs_data.pim = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
258 TRACE_EVENT("leave pam"); |
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 else |
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 TRACE_EVENT("huch pam"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
263 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
264 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
265 case LEAVING_PTM_PBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
266 /* we are about to enter PIM */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
267 if(alr_data->gprs_data.pbcch EQ TRUE) |
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 TRACE_EVENT("leave ptm"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
270 alr_data->gprs_data.pim = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
271 pch_stop(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
272 nc_suspend(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
273 alr_data->gprs_data.ptm = FALSE; |
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 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
276 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
277 TRACE_EVENT("huch ptm"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
278 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
279 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
280 case ENTER_PTM_PBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
281 if(alr_data->gprs_data.pbcch EQ TRUE) |
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 alr_data->gprs_data.ptm = TRUE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
284 alr_data->gprs_data.pim = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
285 nc_start_pbcch(); |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
288 case ENTER_PIM_PBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
289 if(alr_data->gprs_data.pbcch EQ TRUE) |
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 alr_data->gprs_data.pim = TRUE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
292 alr_data->gprs_data.ptm = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
293 nc_start_pbcch(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
294 cb_start(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
295 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
296 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
297 case ENTER_PTM_BCCH: |
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 * convert counters and set NC process to IDLE |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
300 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
301 alr_data->gprs_data.pim = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
302 gprs_alr_nc_enter_ptm(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
303 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
304 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
305 break; |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
308 case MA_PTM: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
309 switch(ctrl_req->action) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
310 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
311 case START_MON_EBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
312 /*for SI13 reading control*/ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
313 if(ctrl_req->si_to_read EQ UPDATE_SI13) |
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 PALLOC(req, MPHC_SCELL_EBCCH_REQ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
316 req->schedule_array_size = 1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
317 req->schedule_array[0].modulus = 8; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
318 req->schedule_array[0].relative_position = 0; |
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 ma_scell_ebcch_req(req); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
321 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
322 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
323 case START_MON_NBCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
324 gprs_read_si13(SI13_ON_NBCCH); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
325 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
326 case START_MON_CCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
327 pch_configure (NULL, PGM_NORMAL); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
328 if(alr_data->gprs_data.pbcch EQ TRUE) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
329 pch_save_pgm(PGM_NORMAL); /* reset saved pgm to REORG_CS */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
330 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
331 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
332 pch_save_pgm(PGM_REORG_CS); /* reset saved pgm to REORG_CS */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
333 alr_data->pch_data.last_start_ccch_req.bs_pa_mfrms = NOT_PRESENT_8BIT; |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
336 pch_start_ccch_req(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
337 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
338 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
339 * This case is necessary to stop ccch monitoring in MA_PTM |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
340 * This is required for Testmode A/B |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
341 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
342 case STOP_MON_CCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
343 if(grlc_test_mode_active()) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
344 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
345 ma_stop_active_procs(STOP_PCH_READING | STOP_MEASUREMENTS); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
346 TRACE_EVENT("STOP_MON_CCCH: TESTMODE A/B is running !!!!"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
347 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
348 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
349 case ENTER_PTM_BCCH: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
350 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
351 * convert counters and set NC process to IDLE |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
352 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
353 gprs_alr_nc_enter_ptm(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
354 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
355 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
356 break; |
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 break; |
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 case MA_CON_EST: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
361 switch(ctrl_req->action) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
362 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
363 case ENTER_PTM_BCCH: |
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 * convert counters and set NC process to IDLE |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
366 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
367 gprs_alr_nc_enter_ptm(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
368 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
369 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
370 break; |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
373 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
374 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
375 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
376 PFREE (ctrl_req); |
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 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
381 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
382 | STATE : code ROUTINE : gprs_alr_check_packet_paging |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
385 PURPOSE : |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
386 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
387 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
388 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
389 #define P1_REST_OCTET_LEN 5 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
390 #define GSM408_SPARE_PADDING 0x2b |
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 /*lint -e749 (Info -- local enumeration constant not referenced) */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
393 enum t_p1_ie { NLN = 0, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
394 PRIO1, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
395 PRIO2, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
396 GRCI, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
397 PPI1, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
398 PPI2 |
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 /*lint +e749 (Info -- local enumeration constant not referenced) */ |
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 #define NEXT_BIT(bit_pos,byte_pos) if( (bit_pos >>=1) == 0 ) { bit_pos=0x80; byte_pos++;} |
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 LOCAL enum t_p1_ie p1_ie; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
405 LOCAL UBYTE element_size[PPI2+1] = { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
406 3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
407 3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
408 3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
409 0, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
410 1, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
411 1 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
412 }; |
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 BOOL gprs_alr_check_packet_paging(UBYTE* frame, UBYTE which) |
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 UBYTE byte_pos = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
419 UBYTE bit = 0x80; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
420 UBYTE *frame_ptr = frame; |
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 ALR_TRACE_GPRS("check packet paging"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
423 /* point after Mobile Identity 1 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
424 frame = frame + 4 + frame[4] + 1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
425 /* check if Mobile Identity 2 is present */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
426 if (frame[0] EQ 0x17) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
427 /* skip Mobile Identity 2 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
428 /* rest octets = start of mob 2 + len of mob 2 + TL */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
429 frame= frame + frame[1] + 2; |
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 if( frame - frame_ptr >= MAX_L2_FRAME_SIZE ) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
432 return FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
433 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
434 /* decode packet paging */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
435 for(p1_ie = NLN; p1_ie < PPI2+1;p1_ie++) |
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 if((frame[byte_pos] & bit) EQ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
438 (GSM408_SPARE_PADDING & bit)) |
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 /* L: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
441 * - element is not used |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
442 * - check next bit for next element |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
443 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
444 if(p1_ie NEQ (which+GRCI)) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
445 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
446 NEXT_BIT(bit,byte_pos);/*lint!e720 (Info -- Boolean test of assignment) */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
447 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
448 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
449 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
450 ALR_TRACE_GPRS("no packet"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
451 return FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
452 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
453 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
454 else |
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 /* H: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
457 * - element is used |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
458 * - skip the bits used by this element |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
459 * except PPIx |
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 ALR_TRACE_GPRS("element used"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
462 if(p1_ie NEQ (which+GRCI)) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
463 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
464 UBYTE i; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
465 for(i=element_size[p1_ie]+1; i > 0; i--) |
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 NEXT_BIT(bit,byte_pos);/*lint!e720 (Info -- Boolean test of assignment) */ |
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 else |
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 ALR_TRACE_GPRS("packet paging"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
473 return TRUE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
474 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
475 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
476 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
477 return FALSE; |
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 /* |
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 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
483 | STATE : code ROUTINE : gprs_alr_check_packet_paging_2 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
484 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
485 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
486 PURPOSE : |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
490 /*lint -e749 (Info -- local enumeration constant not referenced) */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
491 enum t_p2_ie { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
492 p2CN3 = 0, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
493 p2NLN, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
494 p2PRIO1, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
495 p2PRIO2, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
496 p2PRIO3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
497 p2PPI3 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
498 }; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
499 /*lint -e749 (Info -- local enumeration constant not referenced) */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
500 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
501 LOCAL enum t_p2_ie p2_ie; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
502 LOCAL UBYTE p2_element_size[p2PPI3+1] = { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
503 2, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
504 3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
505 3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
506 3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
507 3, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
508 1 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
509 }; |
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 BOOL gprs_alr_check_packet_paging_2(UBYTE* frame, UBYTE which) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
512 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
513 UBYTE byte_pos = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
514 UBYTE bit = 0x80; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
515 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
516 if(which NEQ 3) return FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
517 ALR_TRACE_GPRS("check packet paging 2"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
518 frame += frame[13]+14; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
519 /* decode packet paging */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
520 for(p2_ie = p2CN3; p2_ie < p2PPI3+1;p2_ie++) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
521 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
522 if((frame[byte_pos] & bit) EQ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
523 (GSM408_SPARE_PADDING & bit)) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
524 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
525 /* L: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
526 * - element is not used |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
527 * - check next bit for next element |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
528 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
529 if(p2_ie NEQ p2PPI3) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
530 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
531 NEXT_BIT(bit,byte_pos);/*lint!e720 (Info -- Boolean test of assignment) */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
532 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
533 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
534 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
535 ALR_TRACE_GPRS("no packet"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
536 return FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
537 } |
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 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
540 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
541 /* H: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
542 * - element is used |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
543 * - skip the bits used by this element |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
544 * except PPIx |
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 ALR_TRACE_GPRS("element used"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
547 if(p2_ie NEQ p2PPI3) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
548 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
549 UBYTE i; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
550 for(i=p2_element_size[p2_ie]+1; i > 0; i--) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
551 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
552 NEXT_BIT(bit,byte_pos);/*lint!e720 (Info -- Boolean test of assignment) */ |
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 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
555 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
556 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
557 ALR_TRACE_GPRS("packet paging"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
558 return TRUE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
559 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
560 } |
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 return FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
563 } |
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 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
566 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
567 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
568 | STATE : code ROUTINE : gprs_alr_store_ptmsi | |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
571 PURPOSE : |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
572 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
573 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
574 void gprs_alr_store_ptmsi(UBYTE indic, ULONG tmsi) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
575 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
576 alr_data->gprs_data.v_ptmsi = indic; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
577 alr_data->gprs_data.ptmsi = tmsi; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
578 TRACE_EVENT_P2("v: %d ptmsi: %x", indic, tmsi); |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
581 /* |
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 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
584 | STATE : code ROUTINE : gprs_alr_store_ptmsi | |
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 PURPOSE : Store the candidate PTMSI |
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 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
590 void gprs_alr_store_ptmsi2(UBYTE indic2, ULONG tmsi2) |
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 alr_data->gprs_data.v_ptmsi2 = indic2; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
593 alr_data->gprs_data.ptmsi2 = tmsi2; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
594 TRACE_EVENT_P2("v: %d ptmsi: %x", indic2, tmsi2); |
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 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
599 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
600 | STATE : code ROUTINE : gprs_alr_check_ptmsi | |
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 PURPOSE : |
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 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
606 BOOL gprs_alr_check_ptmsi(ULONG ptmsi_pag) |
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 if((alr_data->gprs_data.v_ptmsi AND |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
610 alr_data->gprs_data.ptmsi EQ ptmsi_pag) OR |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
611 (alr_data->gprs_data.v_ptmsi2 AND |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
612 alr_data->gprs_data.ptmsi2 EQ ptmsi_pag)) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
613 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
614 ALR_TRACE_GPRS("ptmsi match"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
615 ma_pch_paging_ind (ID_PTMSI, CN_PACKET); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
616 return TRUE; |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
619 return FALSE; |
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 /* |
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 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
625 | STATE : code ROUTINE : gprs_alr_check_downlink_assign |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
628 PURPOSE : |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
629 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
630 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
631 void gprs_alr_check_downlink_assign(T_MPHC_DATA_IND* data_ind) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
632 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
633 /* check dl bit */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
634 if(data_ind->l2_frame.content[3] & 0x20) { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
635 ma_send_unitdata (data_ind); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
636 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
637 } |
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 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
641 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
642 | STATE : code ROUTINE : gprs_read_si13 | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
643 +--------------------------------------------------------------------+ |
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 PURPOSE : |
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 BOOL gprs_check_read_si13_only(UBYTE si13_position) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
649 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
650 if(gprs_support AND |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
651 si13_position EQ SI13_ON_NBCCH) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
652 return FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
653 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
654 return TRUE; |
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 BOOL gprs_read_si13(UBYTE si13_position) |
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 ALR_TRACE_GPRS("read si13"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
660 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
661 if(gprs_support AND |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
662 si13_position EQ SI13_ON_NBCCH) |
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 PALLOC(scell_bcch_req, MPHC_SCELL_NBCCH_REQ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
665 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
666 * we want to read SI13 on TC=4 which has to be send at least |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
667 * on every 4th consecutive occurence of TC=4 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
668 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
669 scell_bcch_req->schedule_array_size = 1; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
670 scell_bcch_req->schedule_array[0].modulus = 8; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
671 scell_bcch_req->schedule_array[0].relative_position = 4; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
672 ma_scell_nbcch_req(scell_bcch_req); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
673 return FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
674 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
675 else return TRUE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
676 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
677 |
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 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
680 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
681 | STATE : code ROUTINE : gprs_stop | |
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 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
684 PURPOSE : |
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 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
687 void gprs_alr_init(void) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
688 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
689 ALR_TRACE_GPRS("gprs_alr_init"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
690 alr_data->gprs_data.ign_pgm = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
691 alr_data->gprs_data.pbcch = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
692 alr_data->gprs_data.ptm = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
693 alr_data->gprs_data.check_bsic = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
694 alr_data->gprs_data.sync_only = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
695 alr_data->gprs_data.pcco_active= FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
696 alr_data->nc_sync_with_grr = FALSE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
697 gprs_support = FALSE; |
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 |
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 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
702 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
703 | STATE : code ROUTINE : gprs_alr_tb_meas_ind | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
704 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
705 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
706 PURPOSE : |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
707 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
708 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
709 LOCAL void gprs_alr_tb_meas_ind (T_TB_MEAS_IND *report) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
710 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
711 ALR_TRACE_GPRS("tb_meas_ind"); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
712 switch(GET_STATE(STATE_MA)) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
713 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
714 case MA_PTM: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
715 /*Measurement Report in Packet Transfer Mode*/ |
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 USHORT temp; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
718 USHORT index; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
719 UBYTE diff; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
720 UBYTE i,lim; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
721 T_NC* pcell; |
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 if(report->tb_meas_result[0].arfcn EQ NOT_PRESENT_16BIT) |
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 lim = alr_data->nc_data.c_ba_arfcn; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
726 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
727 else |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
728 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
729 lim = TB_BA_LIST_SIZE; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
730 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
731 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
732 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
733 * reduce the time for next sync |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
734 * Decrement the 10sec timer counter variable by 2 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
735 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
736 alr_data->nc_data.c_ncsync_tim = alr_data->nc_data.c_ncsync_tim-2; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
737 if ((signed char)( alr_data->nc_data.c_ncsync_tim) < 0) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
738 alr_data->nc_data.c_ncsync_tim = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
739 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
740 if( alr_data->nc_data.c_ncsync_tim==0 ) |
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 /* 10 sec have elapsed. Perform all requisite tasks */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
743 nc_ncsync_tim_expiry(); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
744 } |
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 for (pcell=&alr_data->nc_data.cell[0], i = 0; i < lim; i++,pcell++) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
747 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
748 if(lim EQ alr_data->nc_data.c_ba_arfcn) |
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 index = i; |
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 else |
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 /* For all cells look if it is in BA(BCCH) */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
755 switch(index = nc_get_index(ARFCN_TO_G23(report->tb_meas_result[i].arfcn))) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
756 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
757 case LAST_BSIC_REQ: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
758 case NOT_PRESENT_16BIT: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
759 continue; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
760 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
761 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
762 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
763 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
764 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
765 * the ncell is in the list |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
766 * so store the rxlev values |
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 if (alr_data->nc_data.cell[index].c_rxlev EQ NOT_PRESENT_8BIT) |
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 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
772 * if it is a new cell, build an average from the first value |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
773 * to speed up fb sb read |
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 if ((signed short) (report->tb_meas_result[i].rxlev) < 0) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
776 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
777 report->tb_meas_result[i].rxlev = 0; |
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 alr_data->nc_data.cell[index].rxlev[0] = report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
781 alr_data->nc_data.cell[index].rxlev[1] = report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
782 alr_data->nc_data.cell[index].rxlev[2] = report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
783 alr_data->nc_data.cell[index].rxlev[3] = report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
784 alr_data->nc_data.cell[index].rxlev[4] = report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
785 alr_data->nc_data.cell[index].c_rxlev = 0; |
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 else |
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 ((signed short) (report->tb_meas_result[i].rxlev) < 0) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
790 report->tb_meas_result[i].rxlev = 0; |
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 alr_data->nc_data.cell[index].rxlev[alr_data->nc_data.cell[index].c_rxlev++] = |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
793 report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
794 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
795 if (alr_data->nc_data.cell[index].c_rxlev >= 5) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
796 alr_data->nc_data.cell[index].c_rxlev = 0; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
797 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
798 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
799 temp = (USHORT)(alr_data->nc_data.cell[index].rxlev[0] + |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
800 alr_data->nc_data.cell[index].rxlev[1] + |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
801 alr_data->nc_data.cell[index].rxlev[2] + |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
802 alr_data->nc_data.cell[index].rxlev[3] + |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
803 alr_data->nc_data.cell[index].rxlev[4]); |
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 alr_data->nc_data.cell[index].rxlev_average = (UBYTE)(temp / 5); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
806 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
807 * store the results seperately for averaging when NC=1 or NC=2 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
808 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
809 #ifdef GPRS |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
810 if(alr_data->nwctrl_meas_active) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
811 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
812 pcell->nc_rxlev += (report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
813 pcell->c_nc_rxlev++; |
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 #endif |
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 TRACE_EVENT_P3("%d %d rx: %d ",i, alr_data->nc_data.cell[i].ba_arfcn, |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
818 report->tb_meas_result[i].rxlev / report->tb_meas_result[i].num_meas); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
819 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
820 switch (alr_data->nc_data.cell[index].status) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
821 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
822 case INACTIVE: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
823 nc_set_status (index, IDLE); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
824 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
825 case EXCLUDED: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
826 diff = (UBYTE)(alr_data->nc_data.cell[index].rxlev_average - |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
827 alr_data->nc_data.cell[index].last_rxlev); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
828 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
829 if (diff < 128 AND diff >= 6) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
830 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
831 /* result is positive and more than 6 dBm */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
832 nc_set_status (index, IDLE); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
833 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
834 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
835 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
836 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
837 } |
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 } /* for all */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
840 PFREE(report); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
841 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
842 nc_check_activity(); |
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 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
845 default: |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
846 PFREE(report); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
847 break; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
848 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
849 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
850 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
851 |
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 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
854 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
855 | STATE : code ROUTINE : gprs_alr_nc_enter_ptm | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
856 +--------------------------------------------------------------------+ |
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 PURPOSE : After the Packet Access Phase we enter Packet Transfer |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
859 Mode and have to do Measurements and Cell Reselection like |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
860 in Idle Mode. |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
861 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
862 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
863 LOCAL void gprs_alr_nc_enter_ptm (void) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
864 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
865 nc_resume(); /* set NC_STATE to IDLE */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
866 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
867 alr_data->nc_data.c_reports = (alr_data->nc_data.c_reports*10)/alr_data->nc_data.max_reports; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
868 alr_data->nc_data.max_reports = 10; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
869 alr_data->nc_data.cell[LAST_BSIC_REQ].status = INACTIVE; |
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 TRACE_EVENT_P2("glob reps: %d max_report: %d", alr_data->nc_data.c_reports, alr_data->nc_data.max_reports); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
872 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
873 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
874 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
875 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
876 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
877 | STATE : code ROUTINE : gprs_check_page_mode | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
878 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
879 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
880 PURPOSE : Do not change the page mode configuration in L1 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
881 if ing_pgm is set. ie. we have to stay in REORG. |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
882 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
883 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
884 void gprs_check_page_mode(T_MPHC_DATA_IND* data_ind) |
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 if(alr_data->gprs_data.ign_pgm EQ TRUE) |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
887 { |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
888 pch_check_page_mode_cr(data_ind); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
889 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
890 else |
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 pch_check_page_mode(data_ind); |
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 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
895 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
896 /* |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
897 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
898 | PROJECT : GSM-PS (6103) MODULE : ALR_GPRS | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
899 | STATE : code ROUTINE : gprs_alr_is_supported | |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
900 +--------------------------------------------------------------------+ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
901 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
902 PURPOSE : This function returns whether GPRS is supported in |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
903 the cell. |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
904 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
905 */ |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
906 GLOBAL BOOL gprs_alr_is_supported( void ) |
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 return( gprs_support EQ TRUE ); |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
909 } |
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 void set_gprs_support( UBYTE support ) |
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 gprs_support = support; |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
914 } |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
915 |
b4c81ea2d291
src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
916 #endif /* ALR_GPRS_C */ |
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 |