annotate src/g23m-gsm/alr2/alr_em.c @ 196:5f3544fc0308

AT@SPENH brought over from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 24 May 2020 19:46:18 +0000
parents b4c81ea2d291
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project :
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul :
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 defines the engineering mode (EM) device driver for the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | G23 protocol stack. This driver is used to control all engineering
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 | mode related functions.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 +-----------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 */
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_EM_C
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #define ALR_EM_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 #define ENTITY_PL
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 /*==== INCLUDES ===================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include <string.h>
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include <stdlib.h>
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #include <ctype.h>
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "typedefs.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #include "pconst.cdg"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #include "mconst.cdg"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #include "message.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #include "ccdapi.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #include "vsi.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #include "custom.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #include "gsm.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #include "prim.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #include "cnf_alr.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "mon_alr.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #include "pei.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #include "tok.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #include "pcm.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 #ifdef GPRS
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #include "alr_gprs.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #ifdef GPRS
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #ifdef _TARGET_
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #include "inth/iq.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 * obsolete (msb / 2002-04-25)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #include "armio/armio.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #endif
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #include "alr.h"
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #include "alr_em.h"
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
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 /*==== IMPORT =====================================================*/
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 /*==== EXPORT =====================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 /*==== PRIVAT =====================================================*/
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 /*==== VARIABLES ==================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #if defined (FF_EM_MODE) AND defined (ALR)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 /* Event tracing flags for EM */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 GLOBAL BOOL alr_v[EM_MAX_ALR_EVENTS];
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 LOCAL UBYTE em_alr_trace_occured = 0;
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 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 These variables are used between entities. Even this is not a clean solution it is a straigth forward
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 way to reduce the overhead to a minimum. A clean solution would be based on an only usage of primitives
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 which would stress the os with no aditional advantage!!
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 GLOBAL volatile UBYTE em_l1_sem_buffer [EM_L1_SEM_SIZE]; /*lint -esym(765,em_l1_sem_buffer) | external could be made static | used externally */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 GLOBAL volatile UBYTE em_l1_sem_index = 0; /*lint -esym(765,em_l1_sem_index) | external could be made static | used externally */
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 static T_HANDLE sem_EM_L1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 #define ENTER_CRITICAL_SECTION(sem) if (alr_em_enter_critical_section(sem))return FALSE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #define LEAVE_CRITICAL_SECTION(sem) if (alr_em_leave_critical_section(sem))return FALSE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 #endif /* FF_EM_MODE */
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 /*==== FUNCTIONS ==================================================*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 #if defined (FF_EM_MODE) AND defined (ALR)
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 LOCAL UBYTE em_l1_sem (UBYTE length, UBYTE * data);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 LOCAL int em_l1_sem_clear (void);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 LOCAL void alr_em_first_event_check (void); /*Check for ACI - Notification*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 static void alr_em_semaphore_err (void);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 #if !defined(SYST_TRACE)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 #define SYST_TRACE(a) vsi_o_ttrace(0, TC_SYSTEM, a);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 #endif /* !SYST_TRACE */
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 static int alr_em_enter_critical_section (T_HANDLE sem);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 static int alr_em_leave_critical_section (T_HANDLE sem);
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
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 | Function : em_init_l1_event_trace
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 | Description : Initialize the event tracing flags
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 | Parameters :
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 | Return :
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 GLOBAL void em_init_l1_event_trace(void)
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 UBYTE i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 TRACE_FUNCTION("em_init_l1_event_trace ()");
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 for(i=0; i<EM_MAX_ALR_EVENTS; i++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 alr_v[i] = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 | Function : l1_em_l1_event_req
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 | Description : Set the event tracing flags according the bitmask
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 | Parameters : Primitive - Bitmask
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 | Return :
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 GLOBAL const void l1_em_l1_event_req (T_EM_L1_EVENT_REQ *em_l1_event_req)
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 UBYTE i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 TRACE_FUNCTION("l1_em_l1_event_req ()");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 * The event tracing flags are set according the bitmask. alr_v[i] are
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 * the flags belonging to the event number described in 8443.601
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 for(i=1; i<33; i++) {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 alr_v[i] = ((em_l1_event_req->bitmask_l1_l & (0x01<<(i-1))) > 0) ? TRUE : FALSE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 for(i=33; i<(EM_MAX_ALR_EVENTS); i++) {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 alr_v[i] = ((em_l1_event_req->bitmask_l1_h & (0x01<<(i-1))) > 0) ? TRUE : FALSE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 * A new event trace is generated therefor the flag is set to zero.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 em_alr_trace_occured = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 PFREE(em_l1_event_req);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 }
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 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 | Function : em_write_buffer_2
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 | Description : Perform buffer check and store corresponding data in it.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 | Parameters : Event number
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 | Return : TRUE/FALSE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 GLOBAL UBYTE em_write_buffer_2 (UBYTE event_no)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 UBYTE em_l1_event_buffer[2];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 UBYTE em_l1_buffer_write = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 UBYTE length = 2;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 TRACE_FUNCTION("alr_em_write_buffer_2 ()");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 ACI is informed about the first event trace, used for later data processing.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 alr_em_first_event_check();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 memset(em_l1_event_buffer, 0, 2);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 em_l1_event_buffer[em_l1_buffer_write++] = event_no; /* Event number */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 em_l1_event_buffer[em_l1_buffer_write++] = length-2; /* Value length - 0 equals no data */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 return (em_l1_sem (length, em_l1_event_buffer)); /* Data is stored inside buffer, reset flag */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 | Function : em_write_buffer_3
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 | Description : Perform buffer check and store corresponding data in it.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 | Parameters : Event number, data value
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 | Return : TRUE/FALSE
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 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 GLOBAL UBYTE em_write_buffer_3 (UBYTE event_no, UBYTE value)
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 UBYTE em_l1_event_buffer[3];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 UBYTE em_l1_buffer_write = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 UBYTE length = 3;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 TRACE_FUNCTION("alr_em_write_buffer_3 ()");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 ACI is informed about the first event trace, used for later data processing.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 alr_em_first_event_check();
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 memset(em_l1_event_buffer, 0, 3);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 em_l1_event_buffer[em_l1_buffer_write++] = event_no; /* Event number */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 em_l1_event_buffer[em_l1_buffer_write++] = length-2; /* Value length - 0 equals no value */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 em_l1_event_buffer[em_l1_buffer_write++] = value; /* Data to be stored */
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 return (em_l1_sem (length, em_l1_event_buffer)); /* Data is stored inside buffer, reset flag */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 | Function : em_write_buffer_3a
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 | Description : Perform buffer check and store corresponding data in it.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 | Parameters : Event number, data value (USHORT)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 | Return : TRUE/FALSE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252 GLOBAL UBYTE em_write_buffer_3a (UBYTE event_no, USHORT value)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 UBYTE em_l1_event_buffer[4];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 UBYTE em_l1_buffer_write = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 UBYTE length = 4;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 TRACE_FUNCTION("alr_em_write_buffer_4 ()");
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 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 ACI is informed about the first event trace, used for later data processing.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 alr_em_first_event_check();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 memset(em_l1_event_buffer, 0, 4);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267 em_l1_event_buffer[em_l1_buffer_write++] = event_no; /* Event number */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 em_l1_event_buffer[em_l1_buffer_write++] = length-2; /* Value length - 0 equals no value */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 em_l1_event_buffer[em_l1_buffer_write++] = (UBYTE)(value >> 8); /* Data to be stored - MSB first */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270 em_l1_event_buffer[em_l1_buffer_write++] = (UBYTE)(value); /* LSB second */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 return (em_l1_sem (length, em_l1_event_buffer)); /* Data is stored inside buffer, reset flag */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 }
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 /*
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 | Function : em_write_buffer_4
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 | Description : Perform buffer check and store corresponding data in it.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 | Parameters : Event number, data value1 & value2
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 | Return : TRUE/FALSE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 +------------------------------------------------------------------------------
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 GLOBAL UBYTE em_write_buffer_4 (UBYTE event_no, UBYTE value1, UBYTE value2)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 UBYTE em_l1_event_buffer[4];
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 UBYTE em_l1_buffer_write = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 UBYTE length = 4;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 TRACE_FUNCTION("alr_em_write_buffer_4 ()");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294
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 ACI is informed about the first event trace, used for later data processing.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 alr_em_first_event_check();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 memset(em_l1_event_buffer, 0, 4);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 em_l1_event_buffer[em_l1_buffer_write++] = event_no; /* Event number */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 em_l1_event_buffer[em_l1_buffer_write++] = length-2; /* Value length - 0 equals no value */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 em_l1_event_buffer[em_l1_buffer_write++] = value1; /* Data to be stored */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 em_l1_event_buffer[em_l1_buffer_write++] = value2; /* Data to be stored */
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 return (em_l1_sem (length, em_l1_event_buffer)); /* Data is stored inside buffer, reset flag */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 | Function : em_l1_sem_init
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 | Description : Initialize the semaphor for alr event traces.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 | Parameters : void
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 | Return : void
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 +------------------------------------------------------------------------------
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 GLOBAL void em_l1_sem_init (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 sem_EM_L1 = vsi_s_open (VSI_CALLER "EM_L1_SEM",1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 if (sem_EM_L1 NEQ VSI_ERROR)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 em_l1_sem_clear ();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 SYST_TRACE ("D1:can´t open semaphore \"EM_D1_SEM\"");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 | Function : em_l1_sem_exit
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 | Description : Close the semaphor for alr event traces.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 | Parameters : void
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 | Return : void
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 GLOBAL void em_l1_sem_exit (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 if (sem_EM_L1 NEQ VSI_ERROR)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 vsi_s_close (VSI_CALLER sem_EM_L1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 | Function : em_l1_sem_clear
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 | Description : Reset the index of the semaphor.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 | Parameters : void
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 | Return : UBYTE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 LOCAL int em_l1_sem_clear (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 ENTER_CRITICAL_SECTION (sem_EM_L1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 em_l1_sem_index = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 LEAVE_CRITICAL_SECTION (sem_EM_L1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 SYST_TRACE ("L1:em_l1_sem_index cleared");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 return TRUE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 | Function : em_l1_sem_reset
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 | Description : Clears the content of the semaphor, must called after em_l1_sem_read.
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 | Parameters : void
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 | Return : UBYTE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 GLOBAL int em_l1_sem_reset (void) /*lint -esym(765,em_l1_sem_reset) | external could be made static | used externally */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 /* ENTER_CRITICAL_SECTION (sem_EM_L1); */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 em_l1_sem_index = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 LEAVE_CRITICAL_SECTION (sem_EM_L1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 SYST_TRACE ("L1:em_l1_sem_index reseted");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 return TRUE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 | Function : em_l1_sem_read
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 | Description : Reads the content of the semaphor.
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 | Parameters : void
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 | Return : UBYTE
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 GLOBAL int em_l1_sem_read (void) /*lint -esym(765,em_l1_sem_read) | external could be made static | used externally */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 USHORT semCount;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 TRACE_FUNCTION ("em_l1_sem_read()");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 if (vsi_s_status (VSI_CALLER sem_EM_L1, &semCount) NEQ VSI_OK)
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 alr_em_semaphore_err();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 return TRUE;
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 if (semCount EQ 0)
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 vsi_o_ttrace(VSI_CALLER TC_EVENT, "semCount = %d", semCount);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 SYST_TRACE ("semCount EQ 0");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 return TRUE;
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
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 ENTER_CRITICAL_SECTION (sem_EM_L1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 * The l1/alr semaphor will be read by the engineering mode via aci,
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 * therefore the functions em_l1_sem_read and em_l1_sem_reset are defined
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 * as global. To ensure that during reading only aci has access to the
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 * semaphor the macro LEAVE_CRITICAL_SECTION is called after the read process
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 * toke place - in the em_l1_sem_resest function.
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 return TRUE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 Return value TRUE/FALSE - TRUE keeps the event flag valid, FALSE indicates a successful flag handle
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 | Function : em_l1_sem
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 | Description : Writes the data inside the semaphor.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 | Parameters : void
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 | Return : UBYTE
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 |
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 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 LOCAL UBYTE em_l1_sem (UBYTE length, UBYTE *data)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 USHORT semCount;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 USHORT write_index;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 UBYTE i;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 TRACE_FUNCTION ("em_l1_sem()");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 if (vsi_s_status (VSI_CALLER sem_EM_L1, &semCount) NEQ VSI_OK)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 alr_em_semaphore_err();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 return TRUE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 if (semCount EQ 0)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 vsi_o_ttrace(VSI_CALLER TC_EVENT, "semCount = %d", semCount);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 SYST_TRACE ("semCount EQ 0");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 return TRUE;
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 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 * buffer overflow protection
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 if ( ((write_index = em_l1_sem_index) + length) > EM_L1_SEM_SIZE )
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 TRACE_FUNCTION ("alr buffer full");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476 return FALSE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 }
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 ENTER_CRITICAL_SECTION(sem_EM_L1);
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 for (i=0; i<length; i++)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482 em_l1_sem_buffer[em_l1_sem_index++] = *(data++);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485 LEAVE_CRITICAL_SECTION (sem_EM_L1);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 return FALSE; /* indicates that flag was handled */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 } /* endfunc em_l1_sem */
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 | Function : alr_em_semaphore_err
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 | Description : Semaphor error
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 | Parameters : void
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 | Return : void
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 static void alr_em_semaphore_err (void)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 static UCHAR out = 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 if (!out)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 out = 1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 vsi_o_ttrace(VSI_CALLER TC_EVENT, "semaphore error");
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
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 | Function : alr_em_enter_critical_section
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 | Description : Check on critical section entrance
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519 | Parameters : Handle
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 | Return : -1 semaphore error
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 | 0 Ok.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523 |
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 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 #if defined (NEW_FRAME)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 static int alr_em_enter_critical_section (T_HANDLE sem)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 #else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 static int alr_em_enter_critical_section (T_VSI_SHANDLE sem)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 #endif /* NEW_FRAME */
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 if (vsi_s_get (VSI_CALLER sem) NEQ VSI_OK)
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_em_semaphore_err();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 return -1;
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 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 return 0;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 }/* endfunc rr_enter_critical_section */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 | Function : alr_em_leave_critical_section
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 | Description : Check on critical section exit
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 | Parameters : Handle
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 | Return : -1 semaphore error
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 | 0 Ok.
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 #if defined (NEW_FRAME)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560 static int alr_em_leave_critical_section (T_HANDLE sem)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 #else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 static int alr_em_leave_critical_section (T_VSI_SHANDLE sem)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 #endif /* NEW_FRAME */
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 if (vsi_s_release (VSI_CALLER sem) NEQ VSI_OK)
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 alr_em_semaphore_err();
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 return -1;
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 else
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 return 0;
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 }/* endfunc rr_leave_critical_section */
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 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 | Function : alr_em_error_cause
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 | Description : Check the error cause and store it in the event buffer
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 | Parameters : Cause
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 | Return : None
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 |
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 GLOBAL void alr_em_error_cause (UBYTE cause, USHORT arfcn)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590
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 switch(cause)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 case CS_BCCH_READ_ERROR:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 { /* Power measurement request */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 ALR_EM_BCCH_READ_ERROR;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597 break;
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 case CS_DOWN_LINK_FAIL:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
600 { /* Downlink signalling failure */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
601 ALR_EM_DOWNLINK_FAILURE;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
602 break;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
603 }
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
604 case CS_NO_BCCH_AVAIL:
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
605 { /* neighbourcell BCCH not available */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
606 ALR_EM_NEIGHBOURCELL_BCCH(EM_NOT_AVAIL);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
607 break;
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 }/*switch*/
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
610 }/* alr_em_error_cause */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
611
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
612
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 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
615 | Function : alr_em_first_event_check()
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
616 +------------------------------------------------------------------------------
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
617 | Description : Checks if first EM-Event ocured
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 | Parameters : None
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 | Return : None
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 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
625
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
626 /*
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
627 ACI is informed about the first event trace, used for later data processing.
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
628 */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
629 LOCAL void alr_em_first_event_check (void)
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 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
632 TRACE_FUNCTION("alr_em_first_event_check()");
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
633 if(em_alr_trace_occured EQ 0)
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
634 {
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
635 PALLOC(em_notification, EM_DATA_IND);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
636 em_notification->entity = EM_L1;
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
637 PSENDX(MMI, em_notification);
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
638 em_alr_trace_occured++;
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 }/* alr_em_first_event_check */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
641
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
642
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 #endif /* FF_EM_MODE */
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
645
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
646
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
647
b4c81ea2d291 src/g23m-gsm/alr2: initial import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
648 #endif /* ALR_EM_C */