comparison src/g23m-gsm/alr/alr_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 ALR_EM_H
22 #define ALR_EM_H
23
24 #if defined (FF_EM_MODE) AND defined (ALR)
25
26
27 /* -------------------data declarations for EM / Variables------------------------------*/
28
29 /*
30 * The offset is used to indicate the source entity the event trace is from.
31 * L1/ALR = 0x00, DL = 0x2D, RR = 0x37, MM = 0x5F, CC = 0x78, SS = 0xAF, SMS = 0xBE, SIM = E1
32 */
33 #define L1_OFFSET 0x00
34
35 /*
36 * EM_MAX_ALR_EVENTS defines maximum number of event traces for the engineering mode.
37 * The number is increased by one to ensure that the event numbers defined in the
38 * corresponding document are the same as in the sources.
39 */
40 #define EM_MAX_ALR_EVENTS 40
41
42 #define EM_L1_SEM_SIZE 120 /* Max. number off all data fall on to the event tracing */
43
44 /*
45 * Definitions for the additional parameters used for the event tracing.
46 */
47 #define EM_AVAIL 1
48 #define EM_NOT_AVAIL 0
49 #define EM_HANDOVER_ASYNC 0
50 #define EM_HANDOVER_SYNC 1
51 #define EM_HANDOVER_PRE_SYNC 2
52 #define EM_TCH_CLOSE 0
53 #define EM_TCH_OPEN 1
54 #define EM_DAI_STOP 0
55 #define EM_DAI_START 1
56
57 /*
58 * Type is combination of entity index(upper nibble) plus event number(lower nibble).
59 * Bit 8 7 6 5 4 3 2 1
60 * | entity | event number |
61 */
62
63 #define ALR_V_1 (1 + L1_OFFSET)
64 #define ALR_V_2 (2 + L1_OFFSET)
65 #define ALR_V_3 (3 + L1_OFFSET)
66 #define ALR_V_4 (4 + L1_OFFSET)
67 #define ALR_V_5 (5 + L1_OFFSET)
68 #define ALR_V_6 (6 + L1_OFFSET)
69 #define ALR_V_7 (7 + L1_OFFSET)
70 #define ALR_V_8 (8 + L1_OFFSET)
71 #define ALR_V_9 (9 + L1_OFFSET)
72 #define ALR_V_10 (10+ L1_OFFSET)
73 #define ALR_V_11 (11+ L1_OFFSET)
74 #define ALR_V_12 (12+ L1_OFFSET)
75 #define ALR_V_13 (13+ L1_OFFSET)
76 #define ALR_V_14 (14+ L1_OFFSET)
77 #define ALR_V_15 (15+ L1_OFFSET)
78 #define ALR_V_16 (16+ L1_OFFSET)
79 #define ALR_V_17 (17+ L1_OFFSET)
80 #define ALR_V_18 (18+ L1_OFFSET)
81 #define ALR_V_19 (19+ L1_OFFSET)
82 #define ALR_V_20 (20+ L1_OFFSET)
83 #define ALR_V_21 (21+ L1_OFFSET)
84 #define ALR_V_22 (22+ L1_OFFSET)
85 #define ALR_V_23 (23+ L1_OFFSET)
86 #define ALR_V_24 (24+ L1_OFFSET)
87 #define ALR_V_25 (25+ L1_OFFSET)
88 #define ALR_V_26 (26+ L1_OFFSET)
89 #define ALR_V_27 (27+ L1_OFFSET)
90 #define ALR_V_28 (28+ L1_OFFSET)
91 #define ALR_V_29 (29+ L1_OFFSET)
92 #define ALR_V_30 (30+ L1_OFFSET)
93 #define ALR_V_31 (31+ L1_OFFSET)
94 #define ALR_V_32 (32+ L1_OFFSET)
95 #define ALR_V_33 (33+ L1_OFFSET)
96 #define ALR_V_34 (34+ L1_OFFSET)
97 #define ALR_V_35 (35+ L1_OFFSET)
98 #define ALR_V_36 (36+ L1_OFFSET)
99 #define ALR_V_37 (37+ L1_OFFSET)
100 #define ALR_V_38 (38+ L1_OFFSET)
101 #define ALR_V_39 (39+ L1_OFFSET)
102
103
104 /* Event tracing flags for EM */
105 EXTERN BOOL alr_v[EM_MAX_ALR_EVENTS];
106
107 EXTERN UBYTE em_act_rlt; /*lint -esym(526,em_act_rlt) : not defined here */
108 EXTERN UBYTE em_act_dlt; /*lint -esym(526,em_act_dlt) : not defined here */
109
110
111 #endif /* FF_EM_MODE */
112
113 /*----------------Functions--------*/
114
115 /*
116 * Layer1/ALR primitives Engineering Mode
117 * Bitmask for the event tracing
118 */
119 #if defined (FF_EM_MODE) AND defined (ALR)
120 EXTERN void l1_em_l1_event_req (T_EM_L1_EVENT_REQ *em_l1_event_req);
121
122 /*
123 * If all entities are linked into one module this definitions
124 * prefixes all this functions with the enity name
125 */
126 #ifdef OPTION_MULTITHREAD
127 #define em_write_buffer_2 _ENTITY_PREFIXED(em_write_buffer_2)
128 #define em_write_buffer_3 _ENTITY_PREFIXED(em_write_buffer_3)
129 #define em_write_buffer_3a _ENTITY_PREFIXED(em_write_buffer_3a)
130 #define em_write_buffer_4 _ENTITY_PREFIXED(em_write_buffer_4)
131 // #define check_write_index _ENTITY_PREFIXED(check_write_index)
132 #endif
133
134 EXTERN UBYTE em_write_buffer_2 (UBYTE event_no);
135 EXTERN UBYTE em_write_buffer_3 (UBYTE event_no, UBYTE value);
136 EXTERN UBYTE em_write_buffer_3a (UBYTE event_no, USHORT value);
137 EXTERN UBYTE em_write_buffer_4 (UBYTE event_no, UBYTE value1, UBYTE value2);
138 EXTERN void em_init_l1_event_trace(void);
139 EXTERN void alr_em_error_cause(UBYTE cause, USHORT arfcn);
140
141 /*
142 * Semaphor handling
143 */
144 EXTERN void em_l1_sem_init (void);
145 EXTERN void em_l1_sem_exit (void);
146 #endif /* FF_EM_MODE */
147
148 /*-----------------------Macro Definition -----------*/
149
150 #if defined (FF_EM_MODE) AND defined (ALR)
151
152 /* Macros with NAME {...;} because of LINT */
153 #define ALR_EM_SET_EM_ACT_RLT (em_act_rlt=alr_data->dedi_data.act_rlt)
154 #define ALR_EM_SET_EM_ACT_RLT_2 (em_act_rlt=dd->act_rlt)
155 #define ALR_EM_SET_EM_ACT_DLT (em_act_dlt = alr_data->pch_data.act_dlt)
156 #define ALR_EM_ERROR_IND(cause, arfcn) alr_em_error_cause(cause, arfcn)
157
158
159 #define ALR_EM_POWER_MEASSUREMENT_REQUEST\
160 /* Power measurement request */\
161 if (alr_v[1])\
162 {\
163 alr_v[1] = em_write_buffer_3 (ALR_V_1 , mph_power_req->pch_interrupt);\
164 } /* alr_v[1] */
165
166 #define ALR_EM_POWER_MEASUREMENT_CONFIRM\
167 /* Power measurement confirm */\
168 if (alr_v[2])\
169 {\
170 alr_v[2] = em_write_buffer_2 (ALR_V_2 );\
171 } /* alr_v[2] */
172
173 #define ALR_EM_FIELDSTRENGTH_MEASUREMENT_REQUEST\
174 /* Fieldstrength measurement request */\
175 if (alr_v[3])\
176 {\
177 alr_v[3] = em_write_buffer_2 (ALR_V_3 );\
178 } /* alr_v[3] */
179
180 #define ALR_EM_FIELDSTRENGTH_MEASUREMENT_CONFIRM\
181 /* Fieldstrength measurement confirm */\
182 if (alr_v[4])\
183 {\
184 alr_v[4] = em_write_buffer_2 (ALR_V_4 );\
185 } /* alr_v[4] */
186
187 #define ALR_EM_BSIC_REQUEST\
188 /* BSIC request */\
189 if (alr_v[5])\
190 {\
191 alr_v[5] = em_write_buffer_3a (ALR_V_5 , (USHORT)(mph_bsic_req->arfcn&ARFCN_MASK));\
192 } /* alr_v[5] */
193
194 #define ALR_EM_BSIC_CONFIRM(x)\
195 /* BSIC confirm */\
196 if (alr_v[6])\
197 {\
198 alr_v[6] = em_write_buffer_3 (ALR_V_6, x);\
199 } /* alr_v[6] */
200
201 #define ALR_EM_BCCH_READ_ERROR\
202 /* CS_BCCH_READ_ERROR */\
203 if (alr_v[7])\
204 {\
205 alr_v[7] = em_write_buffer_3a (ALR_V_7 , arfcn);\
206 } /* alr_v[7] */\
207
208
209
210 #define ALR_EM_CONFIGURE_CLASSMARK\
211 /* Configure classmark */\
212 if (alr_v[8])\
213 {\
214 alr_v[8] = em_write_buffer_4 (ALR_V_8 , classmark->classmark.pclass,\
215 classmark->classmark.pclass2);\
216 } /* alr_v[8] */
217
218 #define ALR_EM_CONFIGURE_IDLE_MODE\
219 /* Configure idle mode */\
220 if (alr_v[9])\
221 {\
222 alr_v[9] = em_write_buffer_3a (ALR_V_9 , idle->arfcn);\
223 } /* alr_v[9] */
224
225 #define ALR_EM_CONFIGURE_CBCH_CHANNEL\
226 /* Configure CBCH channel */\
227 if (alr_v[10])\
228 {\
229 alr_v[10] = em_write_buffer_3 (ALR_V_10 , cbch->stat);\
230 } /* alr_v[10] */
231
232 #define ALR_EM_CONFIGURE_NEIGHBOUERCELL_LIST\
233 /* Configure neighbourcell list */\
234 if (alr_v[11])\
235 {\
236 alr_v[11] = em_write_buffer_3 (ALR_V_11, alr_data->nc_data.c_ba_arfcn);\
237 } /* alr_v[11] */
238
239 #define ALR_EM_PAGE_MODE_CHANGE\
240 /* Page mode change */\
241 if (alr_v[12])\
242 {\
243 alr_v[12] = em_write_buffer_3 (ALR_V_12, alr_data->pch_data.pl_idle.page_mode);\
244 } /* alr_v[12] */
245
246 #define ALR_EM_IDLE_MODE_BCCH_PARAMETER_CHANGED\
247 /* Idle mode BCCH parameter change */\
248 if (alr_v[13])\
249 {\
250 alr_v[13] = em_write_buffer_3a (ALR_V_13, data_ind->radio_freq);\
251 } /* alr_v[13] */
252
253 #define ALR_EM_DOWNLINK_FAILURE\
254 /* CS_DOWN_LINK_FAIL */\
255 if (alr_v[14])\
256 {\
257 alr_v[14] = em_write_buffer_2 (ALR_V_14);\
258 } /* alr_v[14] */
259
260 #define ALR_EM_PAGING_DETECTED\
261 /* Paging detected */\
262 if (alr_v[15])\
263 {\
264 alr_v[15] = em_write_buffer_3 (ALR_V_15, id_type);\
265 } /* alr_v[15] */
266
267 #define ALR_EM_NEIGHBOURCELL_BSIC_REQUEST\
268 /* NC BSIC request */\
269 if (alr_v[16])\
270 {\
271 alr_v[16] = em_write_buffer_3a (ALR_V_16, mph_bsic_req->arfcn);\
272 } /* alr_v[16] */
273
274 #define ALR_EM_NEIGHBOURCELL_BSIC_CONFIRM(x)\
275 /* NC BSIC confirm */\
276 if (alr_v[17])\
277 {\
278 alr_v[17] = em_write_buffer_3 (ALR_V_17, x);\
279 } /* alr_v[17] */
280
281 #define ALR_EM_READ_NEIGHBOURCELL_SB\
282 /* Read NC SB idle */\
283 if (alr_v[18])\
284 {\
285 alr_v[18] = em_write_buffer_3a (ALR_V_18 , p_ncell->ba_arfcn);\
286 } /* alr_v[18] */
287
288 #define ALR_EM_NEIGHBOURCELL_SB(x)\
289 /* NC SB */\
290 if (alr_v[19])\
291 {\
292 alr_v[19] = em_write_buffer_3 (ALR_V_19, x);\
293 } /* alr_v[19] */
294
295 #define ALR_EM_READ_NEIGHBOURCELL_BCCH\
296 /* Read NC BCCH */\
297 if (alr_v[20])\
298 {\
299 alr_v[20] = em_write_buffer_3a (ALR_V_20 , bcch_req->radio_freq);\
300 } /* alr_v[20] */
301
302 #define ALR_EM_NEIGHBOURCELL_BCCH(x)\
303 /* neighbourcell BCCH not available */\
304 if (alr_v[21])\
305 {\
306 alr_v[21] = em_write_buffer_3 (ALR_V_21, x);\
307 } /* alr_v[21] */
308
309 #define ALR_EM_CONFIGURE_CELL_RESELECTION\
310 /* Configure cell reselection */\
311 if (alr_v[22])\
312 {\
313 alr_v[22] = em_write_buffer_3a (ALR_V_22 , arfcn);\
314 } /* alr_v[22] */
315
316 #define ALR_EM_START_CONNECTION_ESTABLISHMENT\
317 /* Start connection establishment */\
318 if (alr_v[23])\
319 {\
320 alr_v[23] = em_write_buffer_2(ALR_V_23);\
321 } /* alr_v[23] */
322
323 #define ALR_EM_CONFIGURE_IMMIDIATE_ASSIGNMENT\
324 /* Configure immediate assignment */\
325 if (alr_v[24])\
326 {\
327 alr_v[24] = em_write_buffer_2(ALR_V_24);\
328 } /* alr_v[24] */
329
330 #define ALR_EM_STOP_CONNECTION_ESTABLISHMENT\
331 /* Stop connection establishment */\
332 if (alr_v[25])\
333 {\
334 alr_v[25] = em_write_buffer_2(ALR_V_25);\
335 } /* alr_v[25] */
336
337 #define ALR_EM_CONFIGURE_CHANNEL_ASSIGNMENT\
338 /* Configure channel assignment */\
339 if (alr_v[26])\
340 {\
341 alr_v[26] = em_write_buffer_2(ALR_V_26);\
342 } /* alr_v[26] */
343
344 #define ALR_EM_CONFIGURE_HANDOVER(x)\
345 /* Configure asynchronous, presynchr. or synchronized handover */\
346 if (alr_v[27])\
347 {\
348 alr_v[27] = em_write_buffer_3(ALR_V_27, x);\
349 } /* alr_v[27] */
350
351 #define ALR_EM_CONFIGURE_FREQUENCY_REDEFINITION\
352 /* Configure frequency redefinition */\
353 if (alr_v[28])\
354 {\
355 alr_v[28] = em_write_buffer_2(ALR_V_28);\
356 } /* alr_v[28] */
357
358 #define ALR_EM_CONFIGURE_CHANNEL_MODE_MODIFY\
359 /* Configure channel mode modify */\
360 if (alr_v[29])\
361 {\
362 alr_v[29] = em_write_buffer_2(ALR_V_29);\
363 } /* alr_v[29] */
364
365 #define ALR_EM_CONFIGURE_CIPHER_MODE_SETTING\
366 /* Configure cipher mode setting */\
367 if (alr_v[30])\
368 {\
369 alr_v[30] = em_write_buffer_2(ALR_V_30);\
370 } /* alr_v[30] */
371
372 #define ALR_EM_START_CBCH_READING\
373 /* Start CBCH reading */\
374 if (alr_v[31])\
375 {\
376 alr_v[31] = em_write_buffer_3(ALR_V_31,(flags & CBCH_SCHED));\
377 } /* alr_v[31] */
378
379 #define ALR_EM_RECEIVE_CBCH_MESSAGE\
380 /* Receive CBCH message */\
381 if (alr_v[32])\
382 {\
383 alr_v[32] = em_write_buffer_3(ALR_V_32, block_no);\
384 } /* alr_v[32] */
385
386 #define ALR_EM_CBCH_MESSAGE_COMPLETE\
387 /* CBCH message complete */\
388 if (alr_v[33])\
389 {\
390 alr_v[33] = em_write_buffer_2(ALR_V_33);\
391 } /* alr_v[33] */
392
393 #define ALR_EM_STOP_CBCH_READING\
394 /* Stop CBCH reading */\
395 if (alr_v[34])\
396 {\
397 alr_v[34] = em_write_buffer_2(ALR_V_34);\
398 } /* alr_v[34] */
399
400 #define ALR_EM_RECEIVE_NULL_MESSAGE\
401 /* Receive NULL message */\
402 if (alr_v[35])\
403 {\
404 alr_v[35] = em_write_buffer_2(ALR_V_35);\
405 } /* alr_v[35] */
406
407 #define ALR_EM_RECEIVE_SCHEDULE_MESSAGE\
408 /* Receive scheduled message */\
409 if (alr_v[36])\
410 {\
411 alr_v[36] = em_write_buffer_2(ALR_V_36);\
412 } /* alr_v[36] */
413
414 #define ALR_EM_CONFIGURE_TCH_LOOP(x)\
415 /* Configure TCH Loop */\
416 if (alr_v[37])\
417 {\
418 alr_v[37] = em_write_buffer_3(ALR_V_37, x);\
419 } /* alr_v[37] */
420
421 #define ALR_EM_CONFIGURE_DAI_TESTING(x)\
422 /* Configure DAI testing */\
423 if (alr_v[38])\
424 {\
425 alr_v[38] = em_write_buffer_3(ALR_V_38, x);\
426 } /* alr_v[38] */
427
428 #define ALR_EM_DEACTIVATE_L1\
429 /* Deactivate Layer 1 */\
430 if (alr_v[39])\
431 {\
432 alr_v[39] = em_write_buffer_2(ALR_V_39);\
433 } /* alr_v[39] */
434
435
436 #else
437
438 #define EM_TCH_CLOSE 0/*necessary to compile*/
439 #define EM_TCH_OPEN 1
440
441 #define ALR_EM_SET_EM_ACT_RLT
442 #define ALR_EM_SET_EM_ACT_RLT_2
443 #define ALR_EM_SET_EM_ACT_DLT
444 #define ALR_EM_ERROR_IND(cause, arfcn)
445 #define ALR_EM_POWER_MEASSUREMENT_REQUEST /*Event 1*/
446 #define ALR_EM_POWER_MEASUREMENT_CONFIRM /*Event 2*/
447 #define ALR_EM_FIELDSTRENGTH_MEASUREMENT_REQUEST /*Event 3*/
448 #define ALR_EM_FIELDSTRENGTH_MEASUREMENT_CONFIRM /*Event 4*/
449 #define ALR_EM_BSIC_REQUEST /*Event 5*/
450 #define ALR_EM_BSIC_CONFIRM(x) /*Event 6*/
451 #define ALR_EM_BCCH_READ_ERROR /*Event 7*/
452 #define ALR_EM_CONFIGURE_CLASSMARK /*Event 8*/
453 #define ALR_EM_CONFIGURE_IDLE_MODE /*Event 9*/
454 #define ALR_EM_CONFIGURE_CBCH_CHANNEL /*Event 10*/
455 #define ALR_EM_CONFIGURE_NEIGHBOUERCELL_LIST /*Event 11*/
456 #define ALR_EM_PAGE_MODE_CHANGE /*Event 12*/
457 #define ALR_EM_IDLE_MODE_BCCH_PARAMETER_CHANGED /*Event 13*/
458 #define ALR_EM_DOWNLINK_FAILURE /*Event 14*/
459 #define ALR_EM_PAGING_DETECTED /*Event 15*/
460 #define ALR_EM_NEIGHBOURCELL_BSIC_REQUEST /*Event 16*/
461 #define ALR_EM_NEIGHBOURCELL_BSIC_CONFIRM(x) /*Event 17*/
462 #define ALR_EM_READ_NEIGHBOURCELL_SB /*Event 18*/
463 #define ALR_EM_NEIGHBOURCELL_SB(x) /*Event 19*/
464 #define ALR_EM_READ_NEIGHBOURCELL_BCCH /*Event 20*/
465 #define ALR_EM_NEIGHBOURCELL_BCCH(x) /*Event 21*/
466 #define ALR_EM_CONFIGURE_CELL_RESELECTION /*Event 22*/
467 #define ALR_EM_START_CONNECTION_ESTABLISHMENT /*Event 23*/
468 #define ALR_EM_CONFIGURE_IMMIDIATE_ASSIGNMENT /*Event 24*/
469 #define ALR_EM_STOP_CONNECTION_ESTABLISHMENT /*Event 25*/
470 #define ALR_EM_CONFIGURE_CHANNEL_ASSIGNMENT /*Event 26*/
471 #define ALR_EM_CONFIGURE_HANDOVER(x) /*Event 27*/
472 #define ALR_EM_CONFIGURE_FREQUENCY_REDEFINITION /*Event 28*/
473 #define ALR_EM_CONFIGURE_CHANNEL_MODE_MODIFY /*Event 29*/
474 #define ALR_EM_CONFIGURE_CIPHER_MODE_SETTING /*Event 30*/
475 #define ALR_EM_START_CBCH_READING /*Event 31*/
476 #define ALR_EM_RECEIVE_CBCH_MESSAGE /*Event 32*/
477 #define ALR_EM_CBCH_MESSAGE_COMPLETE /*Event 33*/
478 #define ALR_EM_STOP_CBCH_READING /*Event 34*/
479 #define ALR_EM_RECEIVE_NULL_MESSAGE /*Event 35*/
480 #define ALR_EM_RECEIVE_SCHEDULE_MESSAGE /*Event 36*/
481 #define ALR_EM_CONFIGURE_TCH_LOOP /*Event 37*/
482 #define ALR_EM_CONFIGURE_DAI_TESTING(x) /*Event 38*/
483 #define ALR_EM_DEACTIVATE_L1 /*Event 39*/
484
485 #endif /*FF_EM_MODE*/
486 #endif /* ALR_EM_H */