comparison src/g23m-gsm/ss/ss_em.h @ 104:27a4235405c6

src/g23m-gsm: import from LoCosto source
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 04 Oct 2016 18:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
103:76d139c7a25e 104:27a4235405c6
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Engineering Mode (EM) Declarations + Macros
18 |
19 +-----------------------------------------------------------------------------
20 */
21 #ifndef SS_EM_H
22 #define SS_EM_H
23
24 #ifdef FF_EM_MODE
25
26
27 /*
28 * Ring buffer is by one bigger than max. number of prims, because it
29 * needs always one termination entry.
30 * To optimize the buffersize, the data is packed in the buffer as follows:
31 * type, length, value
32 * Value is the combination of the additional parameters as defined in 8443.601, coded as UBYTE.
33 */
34 #define EM_SS_BUFFER_SIZE 31
35
36 /*
37 * EM_MAX_SS_EVENTS defines maximum number of event traces for the engineering mode.
38 * The number is increased by one to ensure that the event numbers defined in the
39 * corresponding document are the same as in the sources.
40 */
41 #define EM_MAX_SS_EVENTS 11
42
43 /*
44 * The offset is used to indicate the source entity the event trace is from.
45 * L1/ALR = 0x00, DL = 0x2D, RR = 0x37, MM = 0x5F, CC = 0x78, SS = 0xAF, SMS = 0xBE, SIM = E1
46 */
47 #define SS_OFFSET 0xAF
48
49 /*
50 * Type is combination of entity index(upper nibble) plus event number(lower nibble).
51 * Bit 8 7 6 5 4 3 2 1
52 * | entity | event number |
53 */
54 #define SS_V_1 (1 + SS_OFFSET)
55 #define SS_V_2 (2 + SS_OFFSET)
56 #define SS_V_3 (3 + SS_OFFSET)
57 #define SS_V_4 (4 + SS_OFFSET)
58 #define SS_V_5 (5 + SS_OFFSET)
59 #define SS_V_6 (6 + SS_OFFSET)
60 #define SS_V_7 (7 + SS_OFFSET)
61 #define SS_V_8 (8 + SS_OFFSET)
62 #define SS_V_9 (9 + SS_OFFSET)
63 #define SS_V_10 (10+ SS_OFFSET)
64
65 /* Event tracing flags for EM */
66 EXTERN BOOL ss_v[EM_MAX_SS_EVENTS];
67
68
69 /* -- Functions ----*/
70 /*
71 * suppl. services primitives Engineering Mode
72 * Bitmask for the event tracing
73 */
74
75 EXTERN void ss_em_ss_event_req (T_EM_SS_EVENT_REQ *em_ss_event_req);
76 GLOBAL void em_init_ss_event_trace (void);
77
78 /*
79 * If all entities are linked into one module this definitions
80 * prefixes all this functions with the enity name
81 */
82 #ifdef OPTION_MULTITHREAD
83 #define em_write_buffer_3 _ENTITY_PREFIXED(em_write_buffer_3)
84 #define check_write_index _ENTITY_PREFIXED(check_write_index)
85 #endif
86
87 EXTERN UBYTE em_write_buffer_3 (UBYTE event_no, UBYTE value);
88 EXTERN UBYTE check_write_index (UBYTE n);
89
90 /*---------------Event Macros ----------*/
91
92 #define MM_EM_MM_CONNECTION_STARTED\
93 /* MM connection started */\
94 if (ss_v[1])\
95 {\
96 ss_v[1] = em_write_buffer_3 (SS_V_1 , ss_data->ti);\
97 } /* ss_v[1] */
98
99 #define MM_EM_MM_CONNECTION_ESTABLISHED\
100 /* MM connection established */\
101 if (ss_v[2])\
102 {\
103 ss_v[2] = em_write_buffer_3 (SS_V_2 , ss_data->ti);\
104 } /* ss_v[2] */
105
106 #define MM_EM_MM_CONNECTION_FAILED\
107 /* MM connection failed */\
108 if (ss_v[3])\
109 {\
110 ss_v[3] = em_write_buffer_3 (SS_V_3 , ss_data->ti);\
111 } /* ss_v[3] */
112
113 #define MM_EM_MM_CONNECTION_ABORTED\
114 /* MM connection aborted */\
115 if (ss_v[4])\
116 {\
117 ss_v[4] = em_write_buffer_3 (SS_V_4 , ss_data->ti);\
118 } /* ss_v[4] */
119
120 #define MM_EM_MM_CONNECTION_RELEASED\
121 /* MM connection released */\
122 if (ss_v[5])\
123 {\
124 ss_v[5] = em_write_buffer_3 (SS_V_5 , ss_data->ti);\
125 } /* ss_v[5] */
126
127 #define MM_EM_REGISTER_MESSAGE_RECEIVED\
128 /* Register message received */\
129 if (ss_v[6])\
130 {\
131 ss_v[6] = em_write_buffer_3 (SS_V_6 , ss_data->ti);\
132 } /* ss_v[6] */
133
134
135 #define MM_EM_FACILITY_MESSAGE_SENT\
136 /* Facility message send */\
137 if (ss_v[7])\
138 {\
139 ss_v[7] = em_write_buffer_3 (SS_V_7 , ss_data->ti);\
140 } /* ss_v[7] */
141
142 #define MM_EM_FACILITY_MESSAGE_RECEIVED\
143 /* Facility message received */\
144 if (ss_v[8])\
145 {\
146 ss_v[8] = em_write_buffer_3 (SS_V_8 , ss_data->ti);\
147 } /* ss_v[8] */
148
149 #define MM_EM_MM_RELEASE_COMPLETE_SENT\
150 /* Release complete sent */\
151 if (ss_v[9])\
152 {\
153 ss_v[9] = em_write_buffer_3 (SS_V_9 , ss_data->ti);\
154 } /* ss_v[9] */
155
156 #define MM_EM_MM_RELEASE_COMPLETE_RECEIVED\
157 /* Release complete received */\
158 if (ss_v[10])\
159 {\
160 ss_v[10] = em_write_buffer_3 (SS_V_10, ss_data->ti);\
161 } /* ss_v[10] */
162
163 #else /*FF_EM_MODE not defined*/
164
165 #define MM_EM_MM_CONNECTION_STARTED /*Event 1*/
166 #define MM_EM_MM_CONNECTION_ESTABLISHED /*Event 2*/
167 #define MM_EM_MM_CONNECTION_FAILED /*Event 3*/
168 #define MM_EM_MM_CONNECTION_ABORTED /*Event 4*/
169 #define MM_EM_MM_CONNECTION_RELEASED /*Event 5*/
170 #define MM_EM_REGISTER_MESSAGE_RECEIVED /*Event 6*/
171 #define MM_EM_FACILITY_MESSAGE_SENT /*Event 7*/
172 #define MM_EM_FACILITY_MESSAGE_RECEIVED /*Event 8*/
173 #define MM_EM_MM_RELEASE_COMPLETE_SENT /*Event 9*/
174 #define MM_EM_MM_RELEASE_COMPLETE_RECEIVED /*Event 10*/
175
176
177 #endif /*FF_EM_MODE*/
178 #endif /* SS_EM_H */