comparison g23m-gsm/dl/dl_signal.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS
4 | Modul : dl_signal
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 : This Modul defines all functions which invoke signals or are
18 | called by signal.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef DL_SIGNAL_C
23 #define DL_SIGNAL_C
24
25 #include "config.h"
26 #include "fixedconf.h"
27 #include "condat-features.h"
28
29 #define ENTITY_DL
30
31 /*==== INCLUDES ===================================================*/
32
33 #include "typedefs.h"
34 #include <string.h>
35 #include "pconst.cdg"
36 #include "vsi.h"
37 #include "custom.h"
38 #include "gsm.h"
39 #include "mon_dl.h"
40 #include "prim.h"
41 #include "pei.h"
42 #include "tok.h"
43 #include "ccdapi.h"
44 #include "dl.h"
45 #include "dl_trc.h"
46
47 #if defined(INVOKE_SIGNAL)
48 /*==== EXPORT =====================================================*/
49
50 /*==== PRIVAT =====================================================*/
51
52 /*==== VARIABLES ==================================================*/
53
54 /*==== FUNCTIONS ==================================================*/
55 /*
56 +------------------------------------------------------------------------------
57 | Function : sig_get_signal_data
58 +------------------------------------------------------------------------------
59 | Description : Get the signal data back depend on parameter write
60 +------------------------------------------------------------------------------
61 */
62 GLOBAL void sig_init_signal_data (void)
63 {
64 GET_INSTANCE_DATA;
65 memset (&dl_data->signal_struct, 0, sizeof (T_DL_SIGNAL));
66 }
67
68 /*
69 +------------------------------------------------------------------------------
70 | Function : sig_get_signal_data
71 +------------------------------------------------------------------------------
72 | Description : Get the signal data back depend on parameter write
73 +------------------------------------------------------------------------------
74 */
75 LOCAL T_DL_SIGNAL_DATA * sig_get_signal_data (void)
76 {
77 GET_INSTANCE_DATA;
78 T_DL_SIGNAL *sig = &dl_data->signal_struct;
79 T_DL_SIGNAL_DATA *sd = &sig->sig_data[sig->sig_idx];
80
81 /*TRACE_EVENT_WIN_P2 ("sig_get_signal_data(): idx=%u %s", sig->sig_idx, sd->busy ? "BUSY": "use it");*/
82
83 /* first approach without semaphore */
84 if (sd->busy EQ FALSE)
85 {
86 sd->busy = TRUE;
87 #if defined(_SIMULATION_)
88 sd->idx = sig->sig_idx;
89 #endif /* _SIMULATION_ */
90 if (++sig->sig_idx EQ DL_SIGNAL_DATA_ELEMENTS)
91 sig->sig_idx = 0;/* index of ring buffer */
92 }
93 else
94 {
95 TRACE_ERROR ("dl_signal_data BUSY !!!");
96 TRACE_ASSERT (!sd->busy);
97 }
98 return sd;
99 }
100
101 #if 0 /* only for debug purposes */
102 GLOBAL int sig_get_busy_signals_counter (T_DL_DATA_STORE * dl_data)
103 {
104 T_DL_SIGNAL *sig = &dl_data->signal_struct;
105 T_DL_SIGNAL_DATA *sd = &sig->sig_data[0];
106 int n, busy;
107
108 for (n=busy=0; n < DL_SIGNAL_DATA_ELEMENTS; n++, sd++)
109 {
110 if (sd->busy EQ TRUE)
111 busy++;
112 }
113 return busy;
114 }
115 #endif /* 0|1 */
116
117 /*
118 +------------------------------------------------------------------------------
119 | Function : sig_invoke_drr_dl_establish_ind
120 +------------------------------------------------------------------------------
121 | Description : Invokes the signal DL_SIGNAL_ESTABLISH_IND
122 +------------------------------------------------------------------------------
123 */
124 GLOBAL void sig_invoke_drr_dl_establish_ind (UBYTE ch_type,
125 UBYTE sapi, UBYTE indication)
126 {
127 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
128 TRACE_EVENT_WIN ("sig_invoke_drr_dl_establish_ind()");
129 signal->u.establish_ind.ch_type = ch_type;
130 signal->u.establish_ind.sapi = sapi;
131 signal->u.establish_ind.indication = indication;
132 #ifdef TI_PS_HCOMM_CHANGE
133 PSIGNAL(_hCommDL, DL_SIGNAL_ESTABLISH_IND, signal);
134 #else
135 PSIGNAL(hCommDL, DL_SIGNAL_ESTABLISH_IND, signal);
136 #endif
137 }
138
139 /*
140 +------------------------------------------------------------------------------
141 | Function : sig_handle_drr_dl_establish_ind
142 +------------------------------------------------------------------------------
143 | Description : Handles the signal DL_SIGNAL_ESTABLISH_IND
144 +------------------------------------------------------------------------------
145 */
146 GLOBAL void sig_handle_drr_dl_establish_ind (T_DL_SIGNAL_DATA * signal)
147 {
148 TRACE_EVENT_WIN ("sig_handle_drr_dl_establish_ind()");
149 drr_dl_establish_ind (signal->u.establish_ind.ch_type,
150 signal->u.establish_ind.sapi, signal->u.establish_ind.indication);
151 }
152
153 /*
154 +------------------------------------------------------------------------------
155 | Function : sig_invoke_drr_dl_establish_cnf
156 +------------------------------------------------------------------------------
157 | Description : Invokes the signal DL_SIGNAL_ESTABLISH_CNF
158 +------------------------------------------------------------------------------
159 */
160 GLOBAL void sig_invoke_drr_dl_establish_cnf (UBYTE ch_type, UBYTE sapi)
161 {
162 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
163 TRACE_EVENT_WIN ("sig_invoke_drr_dl_establish_cnf()");
164 signal->u.establish_cnf.ch_type = ch_type;
165 signal->u.establish_cnf.sapi = sapi;
166 #ifdef TI_PS_HCOMM_CHANGE
167 PSIGNAL(_hCommDL, DL_SIGNAL_ESTABLISH_CNF, signal);
168 #else
169 PSIGNAL(hCommDL, DL_SIGNAL_ESTABLISH_CNF, signal);
170 #endif
171 }
172
173 /*
174 +------------------------------------------------------------------------------
175 | Function : sig_handle_drr_dl_establish_cnf
176 +------------------------------------------------------------------------------
177 | Description : Handles the signal DL_SIGNAL_ESTABLISH_CNF
178 +------------------------------------------------------------------------------
179 */
180 GLOBAL void sig_handle_drr_dl_establish_cnf (T_DL_SIGNAL_DATA * signal)
181 {
182 TRACE_EVENT_WIN ("sig_handle_drr_dl_establish_cnf()");
183 drr_dl_establish_cnf (signal->u.establish_cnf.ch_type,
184 signal->u.establish_cnf.sapi);
185 }
186
187 /*
188 +------------------------------------------------------------------------------
189 | Function : sig_invoke_drr_dl_data_cnf
190 +------------------------------------------------------------------------------
191 | Description : Invokes the signal DL_SIGNAL_DATA_CNF
192 +------------------------------------------------------------------------------
193 */
194 GLOBAL void sig_invoke_drr_dl_data_cnf (UBYTE sapi)
195 {
196 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
197 TRACE_EVENT_WIN ("sig_invoke_drr_dl_data_cnf()");
198 signal->u.data_cnf.sapi = sapi;
199 #ifdef TI_PS_HCOMM_CHANGE
200 PSIGNAL(_hCommDL, DL_SIGNAL_DATA_CNF, signal);
201 #else
202 PSIGNAL(hCommDL, DL_SIGNAL_DATA_CNF, signal);
203 #endif
204 }
205
206 /*
207 +------------------------------------------------------------------------------
208 | Function : sig_handle_drr_dl_data_cnf
209 +------------------------------------------------------------------------------
210 | Description : Handles the signal DL_SIGNAL_DATA_CNF
211 +------------------------------------------------------------------------------
212 */
213 GLOBAL void sig_handle_drr_dl_data_cnf (T_DL_SIGNAL_DATA * signal)
214 {
215 TRACE_EVENT_WIN ("sig_handle_drr_dl_data_cnf()");
216 drr_dl_data_cnf (signal->u.data_cnf.sapi);
217 }
218
219 #if 0 /* happens in primitive context only */
220 /*
221 +------------------------------------------------------------------------------
222 | Function : sig_invoke_drr_dl_unitdata_ind
223 +------------------------------------------------------------------------------
224 | Description : Invokes the signal DL_SIGNAL_UNITDATA_IND
225 +------------------------------------------------------------------------------
226 */
227 GLOBAL void sig_invoke_drr_dl_unitdata_ind (UBYTE error_flag, UBYTE * layer1head,
228 UBYTE * layer3msg,UBYTE length,
229 ULONG fn)
230 {
231 GET_INSTANCE_DATA;
232 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
233 TRACE_EVENT_WIN ("sig_invoke_drr_dl_unitdata_ind()");
234 signal->u.unitdata_ind.error_flag = error_flag;
235 #ifdef TI_PS_16BIT_CPY
236 api_memcpy(signal->u.unitdata_ind.layer1head, layer1head,
237 sizeof(signal->u.unitdata_ind.layer1head));
238 api_memcpy(signal->u.unitdata_ind.layer3msg, layer3msg, length);
239 #else
240 memcpy(signal->u.unitdata_ind.layer1head, layer1head,
241 sizeof(signal->u.unitdata_ind.layer1head));
242 memcpy(signal->u.unitdata_ind.layer3msg, layer3msg, length);
243 #endif
244 signal->u.unitdata_ind.length = length;
245 signal->u.unitdata_ind.fn = fn;
246 PSIGNAL(hCommDL, DL_SIGNAL_UNITDATA_IND, signal);
247 }
248
249 /*
250 +------------------------------------------------------------------------------
251 | Function : sig_handle_drr_dl_unitdata_ind
252 +------------------------------------------------------------------------------
253 | Description : Handles the signal DL_SIGNAL_UNITDATA_IND
254 +------------------------------------------------------------------------------
255 */
256 GLOBAL void sig_handle_drr_dl_unitdata_ind (T_DL_DATA_STORE *dl_data,
257 T_DL_SIGNAL_DATA * signal)
258 {
259 TRACE_EVENT_WIN ("sig_handle_drr_dl_unitdata_ind()");
260 drr_dl_unitdata_ind (dl_data,
261 signal->u.unitdata_ind.error_flag,
262 signal->u.unitdata_ind.layer1head,
263 signal->u.unitdata_ind.layer3msg,
264 signal->u.unitdata_ind.length,
265 signal->u.unitdata_ind.fn);
266 }
267 #endif /* 0 */
268
269 /*
270 +------------------------------------------------------------------------------
271 | Function : sig_invoke_drr_dl_short_unitdata_ind
272 +------------------------------------------------------------------------------
273 | Description : Invokes the signal DL_SIGNAL_SHORT_UNITDATA_IND
274 +------------------------------------------------------------------------------
275 */
276 GLOBAL void sig_invoke_drr_dl_short_unitdata_ind (UBYTE ch_type,
277 UBYTE error_flag, UBYTE * layer1head,
278 UBYTE * layer3msg, UBYTE length, ULONG fn)
279 {
280 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
281 TRACE_EVENT_WIN ("sig_invoke_drr_dl_short_unitdata_ind()");
282 signal->u.short_unitdata_ind.ch_type = ch_type;
283 signal->u.short_unitdata_ind.error_flag = error_flag;
284 #ifdef TI_PS_16BIT_CPY
285 api_memcpy(signal->u.short_unitdata_ind.layer1head, layer1head,
286 sizeof(signal->u.short_unitdata_ind.layer1head));
287 api_memcpy(signal->u.short_unitdata_ind.layer3msg, layer3msg, length);
288 #else
289 memcpy(signal->u.short_unitdata_ind.layer1head, layer1head,
290 sizeof(signal->u.short_unitdata_ind.layer1head));
291 memcpy(signal->u.short_unitdata_ind.layer3msg, layer3msg, length);
292 #endif
293 signal->u.short_unitdata_ind.length = length;
294 signal->u.short_unitdata_ind.fn = fn;
295 #ifdef TI_PS_HCOMM_CHANGE
296 PSIGNAL(_hCommDL, DL_SIGNAL_SHORT_UNITDATA_IND, signal);
297 #else
298 PSIGNAL(hCommDL, DL_SIGNAL_SHORT_UNITDATA_IND, signal);
299 #endif
300 }
301
302 /*
303 +------------------------------------------------------------------------------
304 | Function : sig_handle_drr_dl_short_unitdata_ind
305 +------------------------------------------------------------------------------
306 | Description : Handles the signal DL_SIGNAL_SHORT_UNITDATA_IND
307 +------------------------------------------------------------------------------
308 */
309 GLOBAL void sig_handle_drr_dl_short_unitdata_ind (
310 T_DL_SIGNAL_DATA * signal)
311 {
312 TRACE_EVENT_WIN ("sig_handle_drr_dl_short_unitdata_ind()");
313 drr_dl_short_unitdata_ind (
314 signal->u.short_unitdata_ind.ch_type,
315 signal->u.short_unitdata_ind.error_flag,
316 signal->u.short_unitdata_ind.layer1head,
317 signal->u.short_unitdata_ind.layer3msg,
318 signal->u.short_unitdata_ind.length,
319 signal->u.short_unitdata_ind.fn);
320 }
321
322 /*
323 +------------------------------------------------------------------------------
324 | Function : sig_invoke_drr_dl_release_ind
325 +------------------------------------------------------------------------------
326 | Description : Invokes the signal DL_SIGNAL_RELEASE_IND
327 +------------------------------------------------------------------------------
328 */
329 GLOBAL void sig_invoke_drr_dl_release_ind (UBYTE ch_type, UBYTE sapi,
330 UBYTE cs, BOOL init)
331 {
332 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
333 TRACE_EVENT_WIN ("sig_invoke_drr_dl_release_ind()");
334 signal->u.release_ind.ch_type = ch_type;
335 signal->u.release_ind.sapi = sapi;
336 signal->u.release_ind.cs = cs;
337 signal->u.release_ind.init = init;
338 #ifdef TI_PS_HCOMM_CHANGE
339 PSIGNAL(_hCommDL, DL_SIGNAL_RELEASE_IND, signal);
340 #else
341 PSIGNAL(hCommDL, DL_SIGNAL_RELEASE_IND, signal);
342 #endif
343 }
344
345 /*
346 +------------------------------------------------------------------------------
347 | Function : sig_handle_drr_dl_release_ind
348 +------------------------------------------------------------------------------
349 | Description : Handles the signal DL_SIGNAL_RELEASE_IND
350 +------------------------------------------------------------------------------
351 */
352 GLOBAL void sig_handle_drr_dl_release_ind (T_DL_SIGNAL_DATA * signal)
353 {
354 TRACE_EVENT_WIN ("sig_handle_drr_dl_release_ind()");
355 drr_dl_release_ind (signal->u.release_ind.ch_type,
356 signal->u.release_ind.sapi, signal->u.release_ind.cs,
357 signal->u.release_ind.init);
358
359 }
360
361 /*
362 +------------------------------------------------------------------------------
363 | Function : sig_invoke_drr_dl_release_cnf
364 +------------------------------------------------------------------------------
365 | Description : Invokes the signal DL_SIGNAL_RELEASE_CNF
366 +------------------------------------------------------------------------------
367 */
368 GLOBAL void sig_invoke_drr_dl_release_cnf (UBYTE ch_type,
369 UBYTE sapi, BOOL init)
370 {
371 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
372 TRACE_EVENT_WIN ("sig_invoke_drr_dl_release_cnf()");
373 signal->u.release_cnf.ch_type = ch_type;
374 signal->u.release_cnf.sapi = sapi;
375 signal->u.release_cnf.init = init;
376 #ifdef TI_PS_HCOMM_CHANGE
377 PSIGNAL(_hCommDL, DL_SIGNAL_RELEASE_CNF, signal);
378 #else
379 PSIGNAL(hCommDL, DL_SIGNAL_RELEASE_CNF, signal);
380 #endif
381 }
382
383 /*
384 +------------------------------------------------------------------------------
385 | Function : sig_handle_drr_dl_release_cnf
386 +------------------------------------------------------------------------------
387 | Description : Handles the signal DL_SIGNAL_RELEASE_CNF
388 +------------------------------------------------------------------------------
389 */
390 GLOBAL void sig_handle_drr_dl_release_cnf ( T_DL_SIGNAL_DATA * signal)
391 {
392 TRACE_EVENT_WIN ("sig_handle_drr_dl_release_cnf()");
393 drr_dl_release_cnf (signal->u.release_cnf.ch_type,
394 signal->u.release_cnf.sapi, signal->u.release_cnf.init);
395 }
396
397 /*
398 +------------------------------------------------------------------------------
399 | Function : sig_invoke_drr_error_ind
400 +------------------------------------------------------------------------------
401 | Description : Invokes the signal DL_SIGNAL_ERROR_IND
402 +------------------------------------------------------------------------------
403 */
404 GLOBAL void sig_invoke_drr_error_ind (UBYTE ch_type, UBYTE sapi)
405 {
406 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
407 TRACE_EVENT_WIN ("sig_invoke_drr_error_ind()");
408 signal->u.error_ind.ch_type = ch_type;
409 signal->u.error_ind.sapi = sapi;
410 #ifdef TI_PS_HCOMM_CHANGE
411 PSIGNAL(_hCommDL, DL_SIGNAL_ERROR_IND, signal);
412 #else
413 PSIGNAL(hCommDL, DL_SIGNAL_ERROR_IND, signal);
414 #endif
415 }
416
417 /*
418 +------------------------------------------------------------------------------
419 | Function : sig_handle_drr_error_ind
420 +------------------------------------------------------------------------------
421 | Description : Handles the signal DL_SIGNAL_ERROR_IND
422 +------------------------------------------------------------------------------
423 */
424 GLOBAL void sig_handle_drr_error_ind (T_DL_SIGNAL_DATA * signal)
425 {
426 TRACE_EVENT_WIN ("sig_handle_drr_error_ind()");
427 drr_error_ind (signal->u.error_ind.ch_type,
428 signal->u.error_ind.sapi);
429 }
430
431 #if defined(FF_EM_MODE)
432 /*
433 +------------------------------------------------------------------------------
434 | Function : sig_invoke_dl_em_write
435 +------------------------------------------------------------------------------
436 | Description : Invokes the signal DL_SIGNAL_EM_WRITE
437 +------------------------------------------------------------------------------
438 */
439 GLOBAL void sig_invoke_dl_em_write (UBYTE length, UBYTE * data)
440 {
441 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
442 TRACE_EVENT_WIN ("sig_invoke_dl_em_write()");
443 signal->u.em_write.length = length;
444 #ifdef TI_PS_16BIT_CPY
445 api_memcpy(signal->u.em_write.data, data, length);
446 #else
447 memcpy(signal->u.em_write.data, data, length);
448 #endif
449 PSIGNAL(hCommDL, DL_SIGNAL_EM_WRITE, signal);
450 }
451
452 /*
453 +------------------------------------------------------------------------------
454 | Function : sig_handle_dl_em_write
455 +------------------------------------------------------------------------------
456 | Description : Handles the signal DL_SIGNAL_EM_WRITE
457 +------------------------------------------------------------------------------
458 */
459 GLOBAL void sig_handle_dl_em_write (T_DL_DATA_STORE *dl_data,
460 T_DL_SIGNAL_DATA * signal)
461 {
462 TRACE_EVENT_WIN ("sig_handle_dl_em_write()");
463 em_dl_write (signal->u.em_write.length, signal->u.em_write.data);
464 }
465
466 /*
467 +------------------------------------------------------------------------------
468 | Function : sig_invoke_dl_em_first_event_check
469 +------------------------------------------------------------------------------
470 | Description : Invokes the signal DL_SIGNAL_EM_IND
471 +------------------------------------------------------------------------------
472 */
473 GLOBAL void sig_invoke_dl_em_first_event_check (void)
474 {
475 TRACE_EVENT_WIN ("sig_invoke_dl_em_first_event_check()");
476 PSIGNAL(hCommDL, DL_SIGNAL_EM_IND, NULL);
477 }
478
479 /*
480 +------------------------------------------------------------------------------
481 | Function : sig_handle_dl_em_first_event_check
482 +------------------------------------------------------------------------------
483 | Description : Handles the signal DL_SIGNAL_EM_IND
484 +------------------------------------------------------------------------------
485 */
486 GLOBAL void sig_handle_dl_em_first_event_check ()
487 {
488 TRACE_EVENT_WIN ("sig_handle_dl_em_first_event_check()");
489 dl_em_first_event_check();
490 }
491 #endif /* FF_EM_MODE */
492
493 /*
494 +------------------------------------------------------------------------------
495 | Function : sig_invoke_com_concatenate
496 +------------------------------------------------------------------------------
497 | Description : Invokes the signal DL_SIGNAL_DATA_IND
498 +------------------------------------------------------------------------------
499 */
500 GLOBAL void sig_invoke_com_concatenate ( T_DL_DATA_IND ** in_msg,
501 UBYTE * new_data_in)
502 {
503 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
504 TRACE_EVENT_WIN ("sig_invoke_com_concatenate()");
505 signal->u.concatenate.in_msg = in_msg;
506 #ifdef TI_PS_16BIT_CPY
507 api_memcpy (signal->u.concatenate.new_data_in, new_data_in, MAX_L2_FRAME_SIZE);
508 #else
509 memcpy (signal->u.concatenate.new_data_in, new_data_in, MAX_L2_FRAME_SIZE);
510 #endif
511 #ifdef TI_PS_HCOMM_CHANGE
512 PSIGNAL(_hCommDL, DL_SIGNAL_CONCATENATE, signal);
513 #else
514 PSIGNAL(hCommDL, DL_SIGNAL_CONCATENATE, signal);
515 #endif
516 }
517
518 /*
519 +------------------------------------------------------------------------------
520 | Function : sig_handle_com_concatenate
521 +------------------------------------------------------------------------------
522 | Description : Handles the signal DL_SIGNAL_CONCATENATE
523 +------------------------------------------------------------------------------
524 */
525 GLOBAL void sig_handle_com_concatenate (T_DL_SIGNAL_DATA * signal)
526 {
527 TRACE_EVENT_WIN ("sig_handle_com_concatenate()");
528 com_concatenate (signal->u.concatenate.in_msg,
529 signal->u.concatenate.new_data_in);
530 }
531
532 /*
533 +------------------------------------------------------------------------------
534 | Function : sig_invoke_com_free_pointer
535 +------------------------------------------------------------------------------
536 | Description : Invokes the signal DL_SIGNAL_FREE_POINTER
537 +------------------------------------------------------------------------------
538 */
539 GLOBAL void sig_invoke_com_free_pointer (void *pointer)
540 {
541 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
542 TRACE_EVENT_WIN ("sig_invoke_com_free_pointer()");
543 signal->u.free_pointer.pointer = pointer;
544 #ifdef TI_PS_HCOMM_CHANGE
545 PSIGNAL(_hCommDL, DL_SIGNAL_FREE_POINTER, signal);
546 #else
547 PSIGNAL(hCommDL, DL_SIGNAL_FREE_POINTER, signal);
548 #endif
549 }
550
551 /*
552 +------------------------------------------------------------------------------
553 | Function : sig_handle_drr_error_ind
554 +------------------------------------------------------------------------------
555 | Description : Handles the signal DL_SIGNAL_ERROR_IND
556 +------------------------------------------------------------------------------
557 */
558 GLOBAL void sig_handle_com_free_pointer(T_DL_SIGNAL_DATA * signal)
559 {
560 TRACE_EVENT_WIN ("sig_handle_com_free_pointer()");
561 COM_FREE_POINTER (signal->u.free_pointer.pointer);
562 signal->u.free_pointer.pointer = NULL;
563 }
564
565 /*
566 +------------------------------------------------------------------------------
567 | Function : sig_invoke_com_data_ind
568 +------------------------------------------------------------------------------
569 | Description : Invokes the signal DL_SIGNAL_CONCATENATE
570 +------------------------------------------------------------------------------
571 */
572 GLOBAL void sig_invoke_com_data_ind (UBYTE ch_type,
573 UBYTE sapi, ULONG fn)
574 {
575 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
576 TRACE_EVENT_WIN ("sig_invoke_com_data_ind()");
577 signal->u.data_ind.ch_type = ch_type;
578 signal->u.data_ind.sapi = sapi;
579 signal->u.data_ind.fn = fn;
580 #ifdef TI_PS_HCOMM_CHANGE
581 PSIGNAL(_hCommDL, DL_SIGNAL_DATA_IND, signal);
582 #else
583 PSIGNAL(hCommDL, DL_SIGNAL_DATA_IND, signal);
584 #endif
585 }
586
587 /*
588 +------------------------------------------------------------------------------
589 | Function : sig_handle_com_data_ind
590 +------------------------------------------------------------------------------
591 | Description : Handles the signal DL_SIGNAL_DATA_IND
592 +------------------------------------------------------------------------------
593 */
594 GLOBAL void sig_handle_com_data_ind (T_DL_SIGNAL_DATA * signal)
595 {
596 TRACE_EVENT_WIN ("sig_handle_com_data_ind()");
597 com_data_ind(signal->u.data_ind.ch_type, signal->u.data_ind.sapi,
598 signal->u.data_ind.fn);
599 }
600
601 /*
602 +------------------------------------------------------------------------------
603 | Function : sig_invoke_com_l3trace
604 +------------------------------------------------------------------------------
605 | Description : Invokes the signal DL_SIGNAL_L3TRACE
606 +------------------------------------------------------------------------------
607 */
608 GLOBAL void sig_invoke_com_l3trace (UBYTE type, UBYTE ch_type, UBYTE *frame)
609 {
610 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
611 TRACE_EVENT_WIN ("sig_invoke_com_l3_trace()");
612 signal->u.l3trace.type = type;
613 signal->u.l3trace.ch_type = ch_type;
614 /*
615 * Attention: The down- or uplinked message will not copy. The pointer
616 * of the frame is stored only. Please be aware that the frame have to trace
617 * before it will free.
618 */
619 signal->u.l3trace.frame = frame;
620 #ifdef TI_PS_HCOMM_CHANGE
621 PSIGNAL(_hCommDL, DL_SIGNAL_L3TRACE, signal);
622 #else
623 PSIGNAL(hCommDL, DL_SIGNAL_L3TRACE, signal);
624 #endif
625 }
626
627 /*
628 +------------------------------------------------------------------------------
629 | Function : sig_handle_com_l3trace
630 +------------------------------------------------------------------------------
631 | Description : Handles the signal DL_SIGNAL_L3TRACE
632 +------------------------------------------------------------------------------
633 */
634 GLOBAL void sig_handle_com_l3trace( T_DL_SIGNAL_DATA * signal)
635 {
636 TRACE_EVENT_WIN ("sig_handle_com_l3trace()");
637 com_l3trace (signal->u.l3trace.type, signal->u.l3trace.ch_type, signal->u.l3trace.frame);
638 }
639
640 #if defined(DL_TRACE_ENABLED) && defined(DL_IMMEDIATE_TRACE)
641 /*
642 +------------------------------------------------------------------------------
643 | Function : sig_invoke_com_l2trace
644 +------------------------------------------------------------------------------
645 | Description : Invokes the signal DL_SIGNAL_L2TRACE
646 +------------------------------------------------------------------------------
647 */
648 GLOBAL void sig_invoke_com_l2trace (UBYTE trace_type,
649 UBYTE channel, UBYTE ch_type, T_TIME trace_time,
650 UBYTE* data)
651 {
652 T_DL_SIGNAL_DATA * signal = sig_get_signal_data ();
653 TRACE_EVENT_WIN ("sig_invoke_com_l2trace()");
654 signal->u.l2trace.trace_type = trace_type;
655 signal->u.l2trace.channel = channel;
656 signal->u.l2trace.ch_type = ch_type;
657 signal->u.l2trace.trace_time = trace_time;
658 if (data)
659 {
660 signal->u.l2trace.data_len = MAX_L2_FRAME_SIZE;
661 /*
662 * lint Warning 420: Apparent access beyond array ...
663 * The argument 2 (data) may be smaller than MAX_L2_FRAME_SIZE,
664 * but it makes no sense to detect the kind and length of the data first
665 * (frame of SACCH or DCCH, string -> strlen) to avoid a read beyond array.
666 */
667 memcpy (signal->u.l2trace.data, data, MAX_L2_FRAME_SIZE);
668 }
669 else
670 signal->u.l2trace.data_len = 0;
671 #ifdef TI_PS_HCOMM_CHANGE
672 PSIGNAL(_hCommDL, DL_SIGNAL_L2TRACE, signal);
673 #else
674 PSIGNAL(hCommDL, DL_SIGNAL_L2TRACE, signal);
675 #endif
676 }
677
678 /*
679 +------------------------------------------------------------------------------
680 | Function : sig_handle_com_l2trace
681 +------------------------------------------------------------------------------
682 | Description : Handles the signal DL_SIGNAL_L2TRACE
683 +------------------------------------------------------------------------------
684 */
685 GLOBAL void sig_handle_com_l2trace(T_DL_SIGNAL_DATA * signal)
686 {
687 TRACE_EVENT_WIN ("sig_handle_com_l2trace()");
688 com_l2trace (signal->u.l2trace.trace_type, signal->u.l2trace.channel,
689 signal->u.l2trace.ch_type,
690 signal->u.l2trace.trace_time,
691 signal->u.l2trace.data_len ? signal->u.l2trace.data : NULL);
692 }
693 #endif /* DL_TRACE_ENABLED && DL_IMMEDIATE_TRACE */
694
695 #endif /* INVOKE_SIGNAL */
696 #endif /* DL_SIGNAL_C */