comparison g23m-gsm/alr/alr_csf.c @ 0:75a11d740a02

initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 09 Jun 2016 00:02:41 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:75a11d740a02
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : GSM-PS
4 | Modul : 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 #include "config.h"
25 #include "fixedconf.h"
26 #include "condat-features.h"
27
28 #define ENTITY_PL
29
30 /*==== INCLUDES ===================================================*/
31 #include <string.h>
32 #include <stdlib.h>
33 #include <ctype.h>
34 #include "typedefs.h"
35 #include "pconst.cdg"
36 #include "mconst.cdg"
37 #include "message.h"
38 #include "ccdapi.h"
39 #include "vsi.h"
40 #include "custom.h"
41 #include "gsm.h"
42 #include "prim.h"
43 #include "cnf_alr.h"
44 #include "mon_alr.h"
45 #include "pei.h"
46 #include "tok.h"
47
48 #include "pcm.h"
49 #ifdef GPRS
50 #include "alr_gprs.h"
51 #endif
52
53 /*
54 * FreeCalypso note: I left the crud below untouched because it produces
55 * no effect other than some trace output containing no useful info,
56 * and leaving the code alone results in this "functionality" being
57 * disabled because we don't define _TMS470.
58 */
59
60 #ifdef _TMS470
61 #include "inth/iq.h"
62 #include "armio/armio.h"
63 #endif /* _TMS470 */
64
65 #include "alr.h"
66
67
68 /*==== IMPORT =====================================================*/
69
70 /*==== EXPORT =====================================================*/
71
72 /*==== PRIVAT =====================================================*/
73
74 /*==== VARIABLES ==================================================*/
75
76 /*==== FUNCTIONS ==================================================*/
77
78 /*
79 +--------------------------------------------------------------------+
80 | PROJECT : GSM-PS (8403) MODULE : alr_CSF |
81 | STATE : code ROUTINE : csf_show_version |
82 +--------------------------------------------------------------------+
83
84 PURPOSE : Trace Layer 1 DSP version numbers
85
86 */
87
88 GLOBAL void csf_show_version (T_TST_TEST_HW_CON *ver)
89 {
90 #if defined (_TMS470)
91 USHORT build, hw, jtag, rev;
92
93 /*
94 * Retrieve hardware info and build from library
95 */
96 hw = 0;
97
98 build = IQ_GetBuild();
99 jtag = IQ_GetJtagId();
100 rev = IQ_GetRevision();
101
102 TRACE_EVENT_P4 ("Build=%04d HW ver=%04X, jtag=%04X, rev=%04X", build, hw, jtag, rev);
103
104 if (ver)
105 {
106 /*
107 * Retrieve Layer 1 info from primitive
108 */
109 TRACE_EVENT_P3 ("DSP version/patch=%04X, %04x, chksum=%04X",
110 ver->dsp_code_version,
111 ver->dsp_patch_version,
112 ver->dsp_checksum);
113 TRACE_EVENT_P3 ("MCU version ALR=%04X, GPRS=%04X, TM=%04X",
114 ver->mcu_alr_version,
115 ver->mcu_gprs_version,
116 ver->mcu_tm_version);
117 PFREE (ver);
118 }
119 #else /* _TMS470 */
120 if (ver)
121 {
122 PFREE (ver);
123 }
124 #endif /* _TMS470 */
125 }
126
127 #if !defined NTRACE
128
129 /*
130 * The following monitor capabilities are used by the Condat RT system.
131 * They are only included in the trace version of protocol stack.
132
133 +--------------------------------------------------------------------+
134 | PROJECT : GSM-PS (6147) MODULE : alr_CSF |
135 | STATE : code ROUTINE : trc_mon_counter_idle |
136 +--------------------------------------------------------------------+
137
138 PURPOSE : traces the downlink counter values in idle mode if a change
139 occur.
140
141 */
142
143 UBYTE v_mon_counter_idle = 0;
144
145 GLOBAL void trc_mon_counter_idle (UBYTE act_dlt, UBYTE max_dlt)
146 {
147 if (v_mon_counter_idle)
148 {
149 /*
150 * only if monitoring is enabled
151 */
152 PALLOC (mon_counter_idle, MON_COUNTER_IDLE_IND);
153
154 mon_counter_idle->act_dlt = act_dlt;
155 mon_counter_idle->max_dlt = max_dlt;
156
157 PSENDX(RR, mon_counter_idle);
158 }
159 }
160
161 /*
162 +--------------------------------------------------------------------+
163 | PROJECT : GSM-PS (6147) MODULE : alr_CSF |
164 | STATE : code ROUTINE : trc_mon_counter_dedi |
165 +--------------------------------------------------------------------+
166
167 PURPOSE : traces the radiolink counter values in dedicated mode
168 if a change occur.
169
170 */
171
172 UBYTE v_mon_counter_dedi = 0;
173
174 GLOBAL void trc_mon_counter_dedi (UBYTE act_rlt, UBYTE max_rlt)
175 {
176 if (v_mon_counter_dedi)
177 {
178 /*
179 * only if monitoring is enabled
180 */
181 PALLOC (mon_counter_dedi, MON_COUNTER_DEDI_IND);
182
183 mon_counter_dedi->act_rlt = act_rlt;
184 mon_counter_dedi->max_rlt = max_rlt;
185
186 PSENDX(RR, mon_counter_dedi);
187 }
188 }
189
190 #endif /* !NTRACE */
191
192 #endif