FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/g23m-gsm/dl/dl_trace.c @ 1030:194967e11b2b
fc-shell: tch record and tch play reworked for libgsm-compatible file format
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 31 May 2016 18:39:06 +0000 |
parents | 576c006d4b90 |
children |
rev | line source |
---|---|
673
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 +----------------------------------------------------------------------------- |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 | Project : |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 | Modul : |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 +----------------------------------------------------------------------------- |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 | All rights reserved. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 | |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 | Instruments Berlin, AG |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 +----------------------------------------------------------------------------- |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 | Purpose : This Modul defines the offline trace functions |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 | for the component DL of the mobile station. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 +----------------------------------------------------------------------------- |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 #ifndef DL_TRACE_C |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 #define DL_TRACE_C |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 |
712
576c006d4b90
dl_trace.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
673
diff
changeset
|
25 #include "config.h" |
576c006d4b90
dl_trace.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
673
diff
changeset
|
26 #include "fixedconf.h" |
576c006d4b90
dl_trace.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
673
diff
changeset
|
27 #include "condat-features.h" |
576c006d4b90
dl_trace.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
673
diff
changeset
|
28 |
673
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 #define ENTITY_DL |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 /*==== INCLUDES ===================================================*/ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 #include "typedefs.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 #include <string.h> |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 #include "vsi.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 #include "pconst.cdg" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 #include "custom.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 #include "gsm.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 #include "mon_dl.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 #include "prim.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 #include "pei.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 #include "tok.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 #include "ccdapi.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 #include "dl.h" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 /*==== EXPORT =====================================================*/ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 /*==== PRIVAT =====================================================*/ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 #if defined(DL_TRACE_ENABLED) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 #ifdef OPTION_MULTITHREAD |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 #define TRACE_TYPE _ENTITY_PREFIXED(TRACE_TYPE) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 #define CHANNEL _ENTITY_PREFIXED(CHANNEL) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 #define STATES _ENTITY_PREFIXED(STATES) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 #endif /* OPTION_MULTITHREAD */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 LOCAL const char* const STATES[] = { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 "INVALID", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 "DISABLED", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 "IDLE_DL", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 "SUSPENDED", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 "AWAITING_ESTABLISHMENT", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 "MULTI_FRAME_ESTABLISHED", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 "TIMER_RECOVERY", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 "AWAITING_RELEASE" |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 }; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 LOCAL const char* const TRACE_TYPE[] = { "UL", "DL", "Ev", "St", "PL", "RR" }; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 LOCAL const char* const CH_TYPE[] = { " ", "SA", "SD", "FH", "FF", "CC", "BC", "PC", "PE", "CB", "BE" }; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 LOCAL const char SAPI_TYPE[] = { '0', '1', '2', '3', ' '}; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 LOCAL void array2hex (UBYTE *inarray, char *outarray, int size); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 #if !defined(DL_IMMEDIATE_TRACE) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 /*==== TEST TRACE ===================================================*/ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 #define TEST_ENTITY_DL |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 /*==== VARIABLES ==================================================*/ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 /*==== FUNCTIONS ==================================================*/ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 /* |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 * The Data Link Layer Trace is a cyclic buffer for |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 * debugging layer 2 problems. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 * |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 * The buffer will be initialized at startup and will |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 * be filled by the function dl_trace() until it is full. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 * The size of the buffer is IDLE_TRACE_SIZE. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 * |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 * The content is |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 * |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 * trace_type (uplink, downlink, event state, alr_event, rr_event) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 * Channel Type (SACCH, SDDCH, FACCH) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 * real system clock |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 * State (DL states) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 * pending disc request |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 * data (layer frame, eevnt strings, state) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 * |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 * During IDLE mode (triggered by RX_PERIODIC_IND in ALR/TIL_main.c) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 * an output is written to as SYST trace. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 * (IDLE_TRACE_MAX_READED traces each trigger) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 #define IDLE_TRACE_SIZE 512 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 #define IDLE_TRACE_MAX_READED 16 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 #if (((IDLE_TRACE_SIZE-1) & (~IDLE_TRACE_SIZE)) == (IDLE_TRACE_SIZE-1)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 #define POWER_OF_2 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 #pragma message("IDLE_TRACE_SIZE is power of 2") |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 #else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 #pragma message("IDLE_TRACE_SIZE is NOT power of 2") |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 #endif |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 typedef struct |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 UBYTE trace_type; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 UBYTE ch_type; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 UBYTE sapi; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 T_TIME sysClock; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 UBYTE disc_request; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 UBYTE state; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 UBYTE data [MAX_L2_FRAME_SIZE]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 } T_IDLE_TRACE_DATA; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 #ifdef OPTION_MULTITHREAD |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 #define IDLE_Trace_buffer _ENTITY_PREFIXED(IDLE_Trace_buffer) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 #define IDLE_Trace_write_index _ENTITY_PREFIXED(IDLE_Trace_write_index) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 #define IDLE_Trace_read_index _ENTITY_PREFIXED(IDLE_Trace_read_index) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 #endif /* OPTION_MULTITHREAD */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 GLOBAL T_IDLE_TRACE_DATA IDLE_Trace_buffer [IDLE_TRACE_SIZE]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 GLOBAL USHORT IDLE_Trace_write_index = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 GLOBAL USHORT IDLE_Trace_read_index = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 LOCAL T_HANDLE sem_DL_TRC; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 GLOBAL void dl_trace_init (void) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 sem_DL_TRC = vsi_s_open (VSI_CALLER "DL_IDLE_TRACE",1); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 if (sem_DL_TRC NEQ VSI_ERROR) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 dl_trace_clear (0); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 SYST_TRACE ("DL:can´t open semaphore \"DL_IDLE_TRACE\""); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 GLOBAL void dl_trace_exit (void) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 if (sem_DL_TRC NEQ VSI_ERROR) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 vsi_s_close (VSI_CALLER sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 GLOBAL void dl_trace_clear () |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 dl_trace_read_all (0); /* first, get all remaining traces (if exists) */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 ENTER_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 IDLE_Trace_write_index = IDLE_Trace_read_index = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 LEAVE_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 TRACE_EVENT ("offline trace reset"); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 DL_OFFLINE_TRACE (TRACE_DL_EVENT, TRACE_CH_UNKNOWN, 0, "offline trace reset"); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 /* |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 +--------------------------------------------------------------------+ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 | PROJECT : GSM-PS (6147) MODULE : DL_COM | |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 | STATE : code ROUTINE : dl_trace | |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 +--------------------------------------------------------------------+ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 PURPOSE : Fill in a trace. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 GLOBAL void dl_trace (UCHAR trace_type, UCHAR channel, UCHAR ch_type, UCHAR* data) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 T_IDLE_TRACE_DATA* trace_data; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 USHORT write_index1, write_index2;/* trace_size must not be greater than 2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 UBYTE trace_size; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 if (data) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 #if defined (DISABLE_MEASREPORT_TRACE) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 if ((ch_type EQ L2_CHANNEL_SACCH) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 (data[2] EQ 0x01) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 (data[3] EQ 0x03) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 (data[4] EQ 0x49)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 return; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 #endif /* DISABLE_MEASREPORT_TRACE */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 #if defined (DISABLE_EMPTY_UI) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 if ((trace_type EQ TRACE_DOWNLINK) OR (trace_type EQ TRACE_UPLINK)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 if ((ch_type EQ L2_CHANNEL_SACCH) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 (data[3] EQ 0x03) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 (data[4] EQ 0x01)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 return; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 else if ( |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 (data[1] EQ 0x03) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 (data[2] EQ 0x01)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 return; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 #endif /* DISABLE_EMPTY_UI */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 TEST_SEMAPHORE (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 ENTER_CRITICAL_SECTION(sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 trace_size = 1; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 if ((trace_type EQ TRACE_PL_EVENT) OR (trace_type EQ TRACE_RR_EVENT)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 if (data AND strlen ((char *)data) >= 23) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 trace_size = 2; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 #if defined(POWER_OF_2) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 write_index1 = (IDLE_Trace_write_index + 1) & (IDLE_TRACE_SIZE - 1); /* if IDLE_TRACE_SIZE power of 2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 write_index2 = (IDLE_Trace_write_index + trace_size) & (IDLE_TRACE_SIZE - 1); /* if IDLE_TRACE_SIZE power of 2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 #else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 write_index1 = (IDLE_Trace_write_index + 1) % IDLE_TRACE_SIZE; /* if IDLE_TRACE_SIZE not power of 2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 write_index2 = (IDLE_Trace_write_index + trace_size) % IDLE_TRACE_SIZE; /* if IDLE_TRACE_SIZE not power of 2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 #endif /* POWER_OF_2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
215 if ((write_index1 NEQ IDLE_Trace_read_index) AND (write_index2 NEQ IDLE_Trace_read_index)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
216 { /* buffer is not full */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
217 trace_data = &IDLE_Trace_buffer[IDLE_Trace_write_index]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
218 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
219 trace_data->trace_type = trace_type; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
220 if ((trace_type EQ TRACE_PL_EVENT) OR (trace_type EQ TRACE_RR_EVENT)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
221 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
222 trace_data->state = trace_size; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
223 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
224 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
225 { |
712
576c006d4b90
dl_trace.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
673
diff
changeset
|
226 GET_INSTANCE_DATA; |
673
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
227 trace_data->ch_type = ch_type; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
228 switch (channel) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
229 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
230 case C_SACCH0: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
231 case C_DCCH0: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
232 trace_data->disc_request = dl_data->dcch0_disc_request; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
233 trace_data->state = dl_data->state [C_DCCH0]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
234 trace_data->sapi = PS_SAPI_0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
235 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
236 case C_DCCH3: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
237 trace_data->disc_request = dl_data->dcch3_disc_request; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
238 trace_data->state = dl_data->state [C_DCCH3]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
239 trace_data->sapi = PS_SAPI_3; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
240 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
241 default: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
242 trace_data->disc_request = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
243 trace_data->state = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
244 trace_data->sapi = NOT_PRESENT_8BIT; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
245 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
246 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
247 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
248 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
249 vsi_t_time (VSI_CALLER &trace_data->sysClock); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
250 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
251 if (data) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
252 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
253 memcpy (trace_data->data, data, MAX_L2_FRAME_SIZE); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
254 if ((trace_type NEQ TRACE_UPLINK) AND (trace_type NEQ TRACE_DOWNLINK)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
255 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
256 trace_data->data[MAX_L2_FRAME_SIZE-1] = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
257 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
258 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
259 if (trace_size EQ 2) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
260 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
261 if (IDLE_Trace_write_index EQ (IDLE_TRACE_SIZE - 1))/* the last buffer index ? */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
262 trace_data = &IDLE_Trace_buffer[0];/* -> overflow to the first buffer index */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
263 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
264 trace_data++; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
265 memcpy (trace_data->data, data+MAX_L2_FRAME_SIZE-1, MAX_L2_FRAME_SIZE-1); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
266 trace_data->data[MAX_L2_FRAME_SIZE-1] = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
267 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
268 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
269 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
270 IDLE_Trace_write_index = write_index2; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
271 }/* endif buffer is not full */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
272 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
273 LEAVE_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
274 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
275 #if defined(_SIMULATION_) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
276 dl_trace_read (0); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
277 #endif /* _SIMULATION_ */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
278 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
279 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
280 /* |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
281 +--------------------------------------------------------------------+ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
282 | PROJECT : GSM-PS (6147) MODULE : DL_COM | |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
283 | STATE : code ROUTINE : dl_trace_read | |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
284 +--------------------------------------------------------------------+ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
285 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
286 PURPOSE : Fill in a trace. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
287 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
288 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
289 GLOBAL void dl_trace_read_all () |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
290 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
291 USHORT write_index, read_index; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
292 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
293 do |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
294 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
295 dl_trace_read (); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
296 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
297 ENTER_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
298 write_index = IDLE_Trace_write_index; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
299 read_index = IDLE_Trace_read_index; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
300 LEAVE_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
301 } while (read_index NEQ write_index); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
302 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
303 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
304 GLOBAL void dl_trace_read () |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
305 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
306 T_IDLE_TRACE_DATA* trace_data; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
307 USHORT write_index, read_index, left; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
308 UBYTE trace_size; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
309 static char buffer[80]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
310 UBYTE j, o, readed = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
311 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
312 TEST_SEMAPHORE (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
313 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
314 ENTER_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
315 write_index = IDLE_Trace_write_index; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
316 read_index = IDLE_Trace_read_index; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
317 LEAVE_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
318 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
319 if (read_index EQ write_index) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
320 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
321 #if defined (_TARGET_) AND !defined( GPRS ) AND defined(FF_GTI) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
322 sleep_mode (); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
323 #endif /* _TARGET_ AND !GPRS AND !FF_GTI */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
324 return; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
325 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
326 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
327 while (read_index NEQ write_index) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
328 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
329 ENTER_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
330 trace_data = &IDLE_Trace_buffer[read_index]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
331 LEAVE_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
332 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
333 #if defined(POWER_OF_2) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
334 left = (write_index - read_index - 1) & (IDLE_TRACE_SIZE-1); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
335 #else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
336 left = (IDLE_TRACE_SIZE + write_index - read_index - 1) % IDLE_TRACE_SIZE; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
337 #endif /* POWER_OF_2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
338 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
339 if (trace_data->ch_type > ELEMENTS(CH_TYPE)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
340 trace_data->ch_type = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
341 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
342 if (trace_data->sapi >= ELEMENTS (SAPI_TYPE)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
343 trace_data->sapi = ELEMENTS (SAPI_TYPE) - 1; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
344 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
345 trace_size = 1;/* default */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
346 switch (trace_data->trace_type) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
347 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
348 case TRACE_UPLINK: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
349 case TRACE_DOWNLINK: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
350 sprintf (buffer, "[%03d]:%07lu %c%d %s %s ", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
351 left, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
352 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
353 trace_data->disc_request?'D':' ', |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
354 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
355 TRACE_TYPE[trace_data->trace_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
356 CH_TYPE[trace_data->ch_type]); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
357 o = strlen (buffer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
358 array2hex (trace_data->data, buffer+o, 23); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
359 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
360 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
361 case TRACE_DL_EVENT: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
362 sprintf (buffer, "[%03d]:%07lu %c%d Ev %s%c %s", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
363 left, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
364 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
365 trace_data->disc_request?'D':' ', |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
366 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
367 CH_TYPE[trace_data->ch_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
368 SAPI_TYPE[trace_data->sapi], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
369 trace_data->data); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
370 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
371 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
372 case TRACE_PL_EVENT: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
373 case TRACE_RR_EVENT: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
374 trace_size = trace_data->state; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
375 if (trace_size EQ 2) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
376 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
377 T_IDLE_TRACE_DATA *trace_data2; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
378 if (read_index EQ (IDLE_TRACE_SIZE - 1))/* the last buffer index ? */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
379 trace_data2 = &IDLE_Trace_buffer[0];/* -> overflow to the first buffer index */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
380 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
381 trace_data2 = trace_data+1; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
382 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
383 sprintf (buffer, "[%03d]:%07lu %d Ev %s %s%s", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
384 left, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
385 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
386 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
387 TRACE_TYPE[trace_data->trace_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
388 trace_data->data, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
389 trace_data2->data); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
390 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
391 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
392 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
393 sprintf (buffer, "[%03d]:%07lu %d Ev %s %s", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
394 left, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
395 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
396 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
397 TRACE_TYPE[trace_data->trace_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
398 trace_data->data); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
399 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
400 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
401 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
402 case TRACE_CHSTATE: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
403 sprintf (buffer, "[%03d]:%07lu %c%d ST %s%c state=%s", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
404 left, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
405 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
406 trace_data->disc_request?'D':' ', |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
407 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
408 CH_TYPE[trace_data->ch_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
409 SAPI_TYPE[trace_data->sapi], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
410 STATES[trace_data->state]); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
411 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
412 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
413 default: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
414 buffer[0] = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
415 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
416 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
417 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
418 if (buffer[0]) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
419 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
420 SYST_TRACE (buffer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
421 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
422 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
423 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
424 SYST_TRACE ("dl_trace_read() failed"); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
425 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
426 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
427 ENTER_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
428 trace_data->sysClock = 0; /* readed */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
429 IDLE_Trace_read_index += trace_size; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
430 #if defined(POWER_OF_2) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
431 IDLE_Trace_read_index &= (IDLE_TRACE_SIZE-1);/* if power of 2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
432 #else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
433 IDLE_Trace_read_index %= IDLE_TRACE_SIZE; /* if not power of 2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
434 #endif /* POWER_OF_2 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
435 read_index = IDLE_Trace_read_index; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
436 write_index = IDLE_Trace_write_index; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
437 LEAVE_CRITICAL_SECTION (sem_DL_TRC); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
438 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
439 if (readed++ >= IDLE_TRACE_MAX_READED) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
440 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
441 }/* endwhile */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
442 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
443 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
444 #else /* DL_IMMEDIATE_TRACE */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
445 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
446 #define IMM_TRACE_SIZE 2 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
447 typedef struct |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
448 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
449 UBYTE sapi; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
450 T_TIME sysClock; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
451 UBYTE disc_request; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
452 UBYTE state; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
453 UBYTE data [IMM_TRACE_SIZE*MAX_L2_FRAME_SIZE]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
454 } T_TRACE_DATA; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
455 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
456 #ifdef OPTION_MULTITHREAD |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
457 #define print_buffer _ENTITY_PREFIXED(print_buffer) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
458 #define trace_buffer _ENTITY_PREFIXED(trace_buffer) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
459 #endif /* OPTION_MULTITHREAD */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
460 LOCAL char print_buffer[25+IMM_TRACE_SIZE*MAX_L2_FRAME_SIZE]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
461 LOCAL T_TRACE_DATA trace_buffer; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
462 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
463 /* |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
464 +--------------------------------------------------------------------+ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
465 | PROJECT : GSM-PS (6147) MODULE : DL_COM | |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
466 | STATE : code ROUTINE : dl_trace | |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
467 +--------------------------------------------------------------------+ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
468 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
469 PURPOSE : Fill in a trace. |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
470 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
471 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
472 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
473 GLOBAL void dl_fast_trace (UBYTE trace_type, UBYTE channel, UBYTE ch_type, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
474 T_TIME trace_time, ULONG trace_mask, UBYTE* data) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
475 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
476 T_TRACE_DATA* trace_data; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
477 UBYTE o; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
478 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
479 /* While TC_USER2 is set, measurements and empty frames will be traced always */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
480 if (data AND ((trace_mask & TC_USER2) EQ 0)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
481 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
482 if ((ch_type EQ L2_CHANNEL_SACCH) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
483 (data[2] EQ 0x01) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
484 (data[3] EQ 0x03) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
485 (data[4] EQ 0x49)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
486 return; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
487 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
488 if ((trace_type EQ TRACE_DOWNLINK) OR (trace_type EQ TRACE_UPLINK)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
489 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
490 if ((ch_type EQ L2_CHANNEL_SACCH) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
491 (data[3] EQ 0x03) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
492 (data[4] EQ 0x01)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
493 return; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
494 else if ( |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
495 (data[1] EQ 0x03) AND |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
496 (data[2] EQ 0x01)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
497 return; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
498 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
499 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
500 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
501 trace_data = &trace_buffer; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
502 trace_data->sysClock = trace_time; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
503 if (!((trace_type EQ TRACE_PL_EVENT) OR (trace_type EQ TRACE_RR_EVENT))) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
504 { |
712
576c006d4b90
dl_trace.c compiles
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
673
diff
changeset
|
505 GET_INSTANCE_DATA; |
673
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
506 switch (channel) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
507 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
508 case C_SACCH0: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
509 case C_DCCH0: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
510 trace_data->disc_request = dl_data->dcch0_disc_request; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
511 trace_data->state = dl_data->state [C_DCCH0]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
512 trace_data->sapi = PS_SAPI_0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
513 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
514 case C_DCCH3: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
515 trace_data->disc_request = dl_data->dcch3_disc_request; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
516 trace_data->state = dl_data->state [C_DCCH3]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
517 trace_data->sapi = PS_SAPI_3; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
518 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
519 default: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
520 trace_data->disc_request = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
521 trace_data->state = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
522 trace_data->sapi = NOT_PRESENT_8BIT; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
523 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
524 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
525 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
526 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
527 if (data) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
528 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
529 if ((trace_type EQ TRACE_UPLINK) OR (trace_type EQ TRACE_DOWNLINK)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
530 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
531 memcpy (trace_data->data, data, MAX_L2_FRAME_SIZE); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
532 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
533 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
534 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
535 strncpy ((char *)trace_data->data, (char *)data, IMM_TRACE_SIZE*MAX_L2_FRAME_SIZE-1); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
536 trace_data->data[IMM_TRACE_SIZE*MAX_L2_FRAME_SIZE-1] = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
537 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
538 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
539 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
540 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
541 trace_data->data[0] = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
542 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
543 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
544 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
545 if (ch_type > ELEMENTS(CH_TYPE)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
546 ch_type = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
547 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
548 if (trace_data->sapi >= ELEMENTS (SAPI_TYPE)) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
549 trace_data->sapi = ELEMENTS (SAPI_TYPE) - 1; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
550 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
551 switch (trace_type) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
552 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
553 case TRACE_UPLINK: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
554 case TRACE_DOWNLINK: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
555 sprintf (print_buffer, "DLTRC:%07lu %c%d %s %s%c ", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
556 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
557 trace_data->disc_request?'D':' ', |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
558 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
559 TRACE_TYPE[trace_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
560 CH_TYPE[ch_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
561 SAPI_TYPE[trace_data->sapi]); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
562 o = strlen (print_buffer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
563 array2hex (trace_data->data, print_buffer+o, 23); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
564 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
565 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
566 case TRACE_DL_EVENT: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
567 sprintf (print_buffer, "DLTRC:%07lu %c%d Ev %s%c %s", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
568 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
569 trace_data->disc_request?'D':' ', |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
570 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
571 CH_TYPE[ch_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
572 SAPI_TYPE[trace_data->sapi], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
573 trace_data->data); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
574 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
575 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
576 case TRACE_PL_EVENT: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
577 case TRACE_RR_EVENT: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
578 sprintf (print_buffer, "DLTRC:%07lu %d Ev %s %s", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
579 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
580 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
581 TRACE_TYPE[trace_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
582 trace_data->data); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
583 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
584 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
585 case TRACE_CHSTATE: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
586 sprintf (print_buffer, "DLTRC:%07lu %c%d ST %s%c state=%s", |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
587 trace_data->sysClock, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
588 trace_data->disc_request?'D':' ', |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
589 trace_data->state, |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
590 CH_TYPE[ch_type], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
591 SAPI_TYPE[trace_data->sapi], |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
592 STATES[trace_data->state]); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
593 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
594 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
595 default: |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
596 print_buffer[0] = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
597 break; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
598 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
599 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
600 TRACE_USER_CLASS (TC_USER1, print_buffer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
601 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
602 #if 0 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
603 if (print_buffer[0]) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
604 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
605 #if defined(_SIMULATION_) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
606 TRACE_EVENT_WIN (print_buffer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
607 #else /* _SIMULATION_ */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
608 SYST_TRACE_P ((DLTRC,print_buffer)); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
609 #endif /* _SIMULATION_ */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
610 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
611 #endif /* 0 */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
612 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
613 #endif /* DL_IMMEDIATE_TRACE */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
614 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
615 LOCAL void array2hex (UBYTE *inarray, char *outarray, int size) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
616 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
617 int col=0, n=0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
618 UBYTE b, nh, nl; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
619 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
620 while (n < size) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
621 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
622 b = inarray[n++]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
623 nh = b>>4; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
624 nl = b&0x0f; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
625 outarray[col++] = nh > 9 ? nh + 'A' - 10 : nh + '0'; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
626 outarray[col++] = nl > 9 ? nl + 'A' - 10 : nl + '0'; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
627 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
628 outarray[col] = 0; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
629 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
630 #endif /* DL_TRACE_ENABLED */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
631 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
632 #if defined (DL_TRACE_PFREE) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
633 GLOBAL void* my_pfree(void *pointer, int line, char *file) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
634 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
635 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
636 char buffer[23]; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
637 sprintf (buffer, "%s#%u:%p", file+2, line, pointer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
638 dl_trace (TRACE_DL_EVENT, TRACE_CH_UNKNOWN, buffer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
639 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
640 if (pointer) |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
641 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
642 PFREE (pointer); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
643 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
644 else |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
645 { |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
646 SYST_TRACE_P((SYST, "%s#%u: PFREE(NULL)", file, line)); |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
647 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
648 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
649 return NULL; |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
650 } |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
651 #endif /* DL_TRACE_PFREE */ |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
652 |
2f7df7a314f8
gsm-fw/g23m-gsm subtree: initial import from LoCosto source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
653 #endif /* DL_TRACE_C */ |