comparison src/g23m-gsm/alr/alr_csf.c @ 104:27a4235405c6

src/g23m-gsm: import from LoCosto source
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 04 Oct 2016 18:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
103:76d139c7a25e 104:27a4235405c6
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS
4 | Modul : alr_CSF
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This Modul defines the customer specific functions.
18 +-----------------------------------------------------------------------------
19 */
20
21 #ifndef ALR_CSF_C
22 #define ALR_CSF_C
23
24 #define ENTITY_PL
25
26 /*==== INCLUDES ===================================================*/
27 #include <string.h>
28 #include <stdlib.h>
29 #include <ctype.h>
30 #include "typedefs.h"
31 #include "pconst.cdg"
32 #include "mconst.cdg"
33 #include "message.h"
34 #include "ccdapi.h"
35 #include "vsi.h"
36 #include "custom.h"
37 #include "gsm.h"
38 #include "prim.h"
39 #include "cnf_alr.h"
40 #include "mon_alr.h"
41 #include "pei.h"
42 #include "tok.h"
43
44 #include "pcm.h"
45 #ifdef GPRS
46 #include "alr_gprs.h"
47 #endif
48
49 #ifdef _TMS470
50 #include "inth/iq.h"
51 #include "armio/armio.h"
52 #endif /* _TMS470 */
53
54 #include "alr.h"
55
56
57 /*==== IMPORT =====================================================*/
58
59 /*==== EXPORT =====================================================*/
60
61 /*==== PRIVAT =====================================================*/
62
63 /*==== VARIABLES ==================================================*/
64
65 /*==== FUNCTIONS ==================================================*/
66
67 /*
68 +--------------------------------------------------------------------+
69 | PROJECT : GSM-PS (8403) MODULE : alr_CSF |
70 | STATE : code ROUTINE : csf_show_version |
71 +--------------------------------------------------------------------+
72
73 PURPOSE : Trace Layer 1 DSP version numbers
74
75 */
76
77 GLOBAL void csf_show_version (T_TST_TEST_HW_CON *ver)
78 {
79 #if defined (_TMS470)
80 USHORT build, hw, jtag, rev;
81
82 /*
83 * Retrieve hardware info and build from library
84 */
85 hw = 0;
86
87 build = IQ_GetBuild();
88 jtag = IQ_GetJtagId();
89 rev = IQ_GetRevision();
90
91 TRACE_EVENT_P4 ("Build=%04d HW ver=%04X, jtag=%04X, rev=%04X", build, hw, jtag, rev);
92
93 if (ver)
94 {
95 /*
96 * Retrieve Layer 1 info from primitive
97 */
98 TRACE_EVENT_P3 ("DSP version/patch=%04X, %04x, chksum=%04X",
99 ver->dsp_code_version,
100 ver->dsp_patch_version,
101 ver->dsp_checksum);
102 TRACE_EVENT_P3 ("MCU version ALR=%04X, GPRS=%04X, TM=%04X",
103 ver->mcu_alr_version,
104 ver->mcu_gprs_version,
105 ver->mcu_tm_version);
106 PFREE (ver);
107 }
108 #else /* _TMS470 */
109 if (ver)
110 {
111 PFREE (ver);
112 }
113 #endif /* _TMS470 */
114 }
115
116 #if !defined NTRACE
117
118 /*
119 * The following monitor capabilities are used by the Condat RT system.
120 * They are only included in the trace version of protocol stack.
121
122 +--------------------------------------------------------------------+
123 | PROJECT : GSM-PS (6147) MODULE : alr_CSF |
124 | STATE : code ROUTINE : trc_mon_counter_idle |
125 +--------------------------------------------------------------------+
126
127 PURPOSE : traces the downlink counter values in idle mode if a change
128 occur.
129
130 */
131
132 UBYTE v_mon_counter_idle = 0;
133
134 GLOBAL void trc_mon_counter_idle (UBYTE act_dlt, UBYTE max_dlt)
135 {
136 if (v_mon_counter_idle)
137 {
138 /*
139 * only if monitoring is enabled
140 */
141 PALLOC (mon_counter_idle, MON_COUNTER_IDLE_IND);
142
143 mon_counter_idle->act_dlt = act_dlt;
144 mon_counter_idle->max_dlt = max_dlt;
145
146 PSENDX(RR, mon_counter_idle);
147 }
148 }
149
150 /*
151 +--------------------------------------------------------------------+
152 | PROJECT : GSM-PS (6147) MODULE : alr_CSF |
153 | STATE : code ROUTINE : trc_mon_counter_dedi |
154 +--------------------------------------------------------------------+
155
156 PURPOSE : traces the radiolink counter values in dedicated mode
157 if a change occur.
158
159 */
160
161 UBYTE v_mon_counter_dedi = 0;
162
163 GLOBAL void trc_mon_counter_dedi (UBYTE act_rlt, UBYTE max_rlt)
164 {
165 if (v_mon_counter_dedi)
166 {
167 /*
168 * only if monitoring is enabled
169 */
170 PALLOC (mon_counter_dedi, MON_COUNTER_DEDI_IND);
171
172 mon_counter_dedi->act_rlt = act_rlt;
173 mon_counter_dedi->max_rlt = max_rlt;
174
175 PSENDX(RR, mon_counter_dedi);
176 }
177 }
178
179 #endif /* !NTRACE */
180
181 #endif