FreeCalypso > hg > fc-tourmaline
comparison src/g23m-gsm/dl/dl_em.h @ 1:fa8dc04885d8
src/g23m-*: import from Magnetite
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 16 Oct 2020 06:25:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:4e78acac3d88 | 1:fa8dc04885d8 |
---|---|
1 | |
2 | |
3 /* | |
4 +----------------------------------------------------------------------------- | |
5 | Project : | |
6 | Modul : | |
7 +----------------------------------------------------------------------------- | |
8 | Copyright 2002 Texas Instruments Berlin, AG | |
9 | All rights reserved. | |
10 | | |
11 | This file is confidential and a trade secret of Texas | |
12 | Instruments Berlin, AG | |
13 | The receipt of or possession of this file does not convey | |
14 | any rights to reproduce or disclose its contents or to | |
15 | manufacture, use, or sell anything it may describe, in | |
16 | whole, or in part, without the specific written consent of | |
17 | Texas Instruments Berlin, AG. | |
18 +----------------------------------------------------------------------------- | |
19 | Purpose : Engineering Mode (EM) Declarations + Macros | |
20 | | |
21 +----------------------------------------------------------------------------- | |
22 */ | |
23 #ifndef DL_EM_H | |
24 #define DL_EM_H | |
25 | |
26 #ifdef FF_EM_MODE | |
27 | |
28 /* ------------ data declarations for EM ---------------- */ | |
29 #ifdef _SIMULATION_ | |
30 #pragma message("this build includes engineering mode (FF_EM_MODE)") | |
31 #endif | |
32 /* | |
33 * To optimize the buffersize, the data is packed in the buffer as follows: | |
34 * type, length, value | |
35 * Value is the combination of the additional parameters as defined in 8443.601, coded as UBYTE. | |
36 * Buffersize is maximal size of one event | |
37 */ | |
38 #define EM_DL_BUFFER_SIZE 7 | |
39 | |
40 | |
41 #define EM_DL_SEM_SIZE 30 /* Max. number off all data fall on to the event tracing */ | |
42 | |
43 /* | |
44 * EM_MAX_DL_EVENTS defines maximum number of event traces for the engineering mode. | |
45 * The number is increased by one to ensure that the event numbers defined in the | |
46 * corresponding document are the same as in the sources. | |
47 */ | |
48 #define EM_MAX_DL_EVENTS 6 | |
49 | |
50 /* | |
51 * The offset is used to indicate the source entity the event trace is from. | |
52 * L1/ALR = 0x00, DL = 0x2D, RR = 0x37, MM = 0x5F, CC = 0x78, SS = 0xAF, SMS = 0xBE, SIM = E1 | |
53 */ | |
54 #define DL_OFFSET 0x2D | |
55 | |
56 /* | |
57 * Type is combination of entity index(upper nibble) plus event number(lower nibble). | |
58 * Bit 8 7 6 5 4 3 2 1 | |
59 * | entity | event number | | |
60 */ | |
61 | |
62 #define DL_V_1 (1 + DL_OFFSET) | |
63 #define DL_V_2 (2 + DL_OFFSET) | |
64 #define DL_V_3 (3 + DL_OFFSET) | |
65 #define DL_V_4 (4 + DL_OFFSET) | |
66 #define DL_V_5 (5 + DL_OFFSET) | |
67 | |
68 /* Event tracing flags for EM */ | |
69 EXTERN BOOL dl_v[EM_MAX_DL_EVENTS]; | |
70 | |
71 /*---------Functions ---------*/ | |
72 | |
73 /* | |
74 * DL primitives Engineering Mode | |
75 * Bitmask for the event tracing | |
76 */ | |
77 EXTERN void dl_em_dl_event_req (T_EM_DL_EVENT_REQ *em_dl_event_req); | |
78 | |
79 /* | |
80 * If all entities are linked into one module this definitions | |
81 * prefixes all this functions with the enity name | |
82 */ | |
83 #ifdef OPTION_MULTITHREAD | |
84 #define em_write_buffer_4 _ENTITY_PREFIXED(em_write_buffer_4) | |
85 #define em_write_buffer_5a _ENTITY_PREFIXED(em_write_buffer_5a) | |
86 #if defined (TI_PS_HCOMM_CHANGE) | |
87 #else /* for hCommHandles backward compatibility */ | |
88 #define hCommMMI _ENTITY_PREFIXED(hCommMMI) | |
89 #endif | |
90 #endif | |
91 | |
92 #if defined (TI_PS_HCOMM_CHANGE) | |
93 #else /* for hCommHandles backward compatibility */ | |
94 #if defined (NEW_FRAME) | |
95 EXTERN T_HANDLE hCommMMI; /* EM Communication */ | |
96 #else | |
97 EXTERN T_VSI_CHANDLE hCommMMI; /* EM Communication */ | |
98 #endif | |
99 #endif | |
100 | |
101 EXTERN UBYTE em_write_buffer_4 (UBYTE event_no, UBYTE value1, UBYTE value2); | |
102 EXTERN UBYTE em_write_buffer_5a (UBYTE event_no, UBYTE value1, UBYTE value2, USHORT cs); | |
103 | |
104 /* | |
105 * Semaphor handling | |
106 */ | |
107 EXTERN void em_init_dl_event_trace (void); | |
108 EXTERN void em_dl_sem_init (void); | |
109 EXTERN void em_dl_sem_exit (void); | |
110 EXTERN void em_dl_sem_read (void); | |
111 EXTERN void em_dl_sem_reset (void); | |
112 | |
113 /*-----*/ | |
114 | |
115 /*-----------------------Event Macro Definition -----------*/ | |
116 | |
117 | |
118 #define DL_EM_CHANNEL_ESTABLISHMENT_PASSED\ | |
119 /* Channel establishment passed */\ | |
120 if (dl_v[1])\ | |
121 {\ | |
122 dl_v[1] = em_write_buffer_4 (DL_V_1, ch_type, sapi);\ | |
123 } /* dl_v[1] */ | |
124 | |
125 #define DL_EM_CHANNEL_ESTABLISHMENT_FAILED\ | |
126 /* Channel establishment failed */\ | |
127 if (dl_v[2])\ | |
128 {\ | |
129 dl_v[2] = em_write_buffer_5a (DL_V_2, channel, sapi, NOT_PRESENT_16BIT);\ | |
130 } /* dl_v[2] */ | |
131 | |
132 #define DL_EM_LINK_RELEASE\ | |
133 /* Link release */\ | |
134 if (dl_v[3])\ | |
135 {\ | |
136 dl_v[3] = em_write_buffer_4 (DL_V_3, ch_type, sapi);\ | |
137 } /* dl_v[3] */ | |
138 | |
139 #define DL_EM_LINK_SUSPENDED\ | |
140 /* Link suspend */\ | |
141 if (dl_v[4])\ | |
142 {\ | |
143 dl_v[4] = em_write_buffer_4 (DL_V_4, suspend_req->ch_type, suspend_req->sapi);\ | |
144 } /* dl_v[4] */ | |
145 | |
146 #define DL_EM_CHANNEL_FAILURE\ | |
147 /* Channel failure */\ | |
148 if (dl_v[5])\ | |
149 {\ | |
150 dl_v[5] = em_write_buffer_5a (DL_V_5, pcch->ch_type, pcch_i->sapi, CS_NR_SEQ_ERR);\ | |
151 } /* dl_v[5] */ | |
152 | |
153 #else | |
154 | |
155 #define DL_EM_CHANNEL_ESTABLISHMENT_PASSED /*Event 1*/ | |
156 #define DL_EM_CHANNEL_ESTABLISHMENT_FAILED /*Event 2*/ | |
157 #define DL_EM_LINK_RELEASE /*Event 3*/ | |
158 #define DL_EM_LINK_SUSPENDED /*Event 4*/ | |
159 #define DL_EM_CHANNEL_FAILURE /*Event 5*/ | |
160 | |
161 #endif /*FF_EM_MODE*/ | |
162 | |
163 #endif /* DL_EM_H */ |