FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/include/l1_rtt_macro.h @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /************* Revision Controle System Header ************* | |
2 * GSM Layer 1 software | |
3 * L1_RTT_MACRO.H | |
4 * | |
5 * Filename %M% | |
6 * Copyright 2003 (C) Texas Instruments | |
7 * | |
8 ************* Revision Controle System Header *************/ | |
9 | |
10 #if (defined RVM_RTT_SWE || (OP_L1_STANDALONE == 1)) | |
11 | |
12 #include "rvt_gen.h" | |
13 #include "rtt_gen.h" | |
14 | |
15 extern T_TRACE_INFO_STRUCT trace_info; | |
16 | |
17 /***********************************************************************************************************/ | |
18 /* Macro for cell enabling checking */ | |
19 /***********************************************************************************************************/ | |
20 | |
21 #define SELECTED_BITMAP(enable_bit) \ | |
22 enable_bit < 32 ? (0x0001 << (enable_bit - 0)) & trace_info.current_config->rttl1_cell_enable[0] : \ | |
23 enable_bit < 64 ? (0x0001 << (enable_bit - 32)) & trace_info.current_config->rttl1_cell_enable[1] : \ | |
24 enable_bit < 96 ? (0x0001 << (enable_bit - 64)) & trace_info.current_config->rttl1_cell_enable[2] : \ | |
25 enable_bit < 128 ? (0x0001 << (enable_bit - 96)) & trace_info.current_config->rttl1_cell_enable[3] : \ | |
26 enable_bit < 160 ? (0x0001 << (enable_bit - 128)) & trace_info.current_config->rttl1_cell_enable[4] : \ | |
27 enable_bit < 192 ? (0x0001 << (enable_bit - 160)) & trace_info.current_config->rttl1_cell_enable[5] : \ | |
28 enable_bit < 224 ? (0x0001 << (enable_bit - 192)) & trace_info.current_config->rttl1_cell_enable[6] : \ | |
29 (0x0001 << (enable_bit - 224)) & trace_info.current_config->rttl1_cell_enable[7] | |
30 | |
31 /***********************************************************************************************************/ | |
32 /* Macros for buffer filling */ | |
33 /***********************************************************************************************************/ | |
34 | |
35 //----------------------------------------------------------------------------------------------------------- | |
36 // L1 RTT cell filling: FN | |
37 | |
38 #define RTTL1_FILL_FN(param1) \ | |
39 if(SELECTED_BITMAP(RTTL1_ENABLE_FN)) \ | |
40 { \ | |
41 T_RTT_PTR ptr; \ | |
42 \ | |
43 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_FN))) != NULL) \ | |
44 { \ | |
45 ((T_RTTL1_FN *)ptr)->fn = param1; \ | |
46 ((T_RTTL1_FN *)ptr)->cell_id = RTTL1_ENABLE_FN; \ | |
47 } \ | |
48 } | |
49 | |
50 //----------------------------------------------------------------------------------------------------------- | |
51 // L1 RTT cell filling: Downlink burst | |
52 | |
53 #define RTTL1_FILL_DL_BURST(param1,param2,param3,param4,param5,param6,param7) \ | |
54 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_BURST)) \ | |
55 { \ | |
56 T_RTT_PTR ptr; \ | |
57 \ | |
58 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_BURST))) != NULL) \ | |
59 { \ | |
60 ((T_RTTL1_DL_BURST *)ptr)->angle = param1; \ | |
61 ((T_RTTL1_DL_BURST *)ptr)->snr = param2; \ | |
62 ((T_RTTL1_DL_BURST *)ptr)->afc = param3; \ | |
63 ((T_RTTL1_DL_BURST *)ptr)->task = param4; \ | |
64 ((T_RTTL1_DL_BURST *)ptr)->pm = param5; \ | |
65 ((T_RTTL1_DL_BURST *)ptr)->toa = param6; \ | |
66 ((T_RTTL1_DL_BURST *)ptr)->input_level = param7; \ | |
67 ((T_RTTL1_DL_BURST *)ptr)->cell_id = RTTL1_ENABLE_DL_BURST; \ | |
68 } \ | |
69 } | |
70 | |
71 //----------------------------------------------------------------------------------------------------------- | |
72 // L1 RTT cell filling: Uplink Normal Burst | |
73 | |
74 #define RTTL1_FILL_UL_NB(param1, param2, param3) \ | |
75 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_NB)) \ | |
76 { \ | |
77 T_RTT_PTR ptr; \ | |
78 \ | |
79 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_NB))) != NULL) \ | |
80 { \ | |
81 ((T_RTTL1_UL_NB *)ptr)->task = param1; \ | |
82 ((T_RTTL1_UL_NB *)ptr)->ta = param2; \ | |
83 ((T_RTTL1_UL_NB *)ptr)->txpwr = param3; \ | |
84 ((T_RTTL1_UL_NB *)ptr)->cell_id = RTTL1_ENABLE_UL_NB; \ | |
85 } \ | |
86 } | |
87 | |
88 //----------------------------------------------------------------------------------------------------------- | |
89 // L1 RTT cell filling: Uplink Access Burst | |
90 | |
91 #define RTTL1_FILL_UL_AB(param1, param2) \ | |
92 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_AB)) \ | |
93 { \ | |
94 T_RTT_PTR ptr; \ | |
95 \ | |
96 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_AB))) != NULL) \ | |
97 { \ | |
98 ((T_RTTL1_UL_AB *)ptr)->task = param1; \ | |
99 ((T_RTTL1_UL_AB *)ptr)->txpwr = param2; \ | |
100 ((T_RTTL1_UL_AB *)ptr)->cell_id = RTTL1_ENABLE_UL_AB; \ | |
101 } \ | |
102 } | |
103 | |
104 //----------------------------------------------------------------------------------------------------------- | |
105 // L1 RTT cell filling: Full list measurement | |
106 | |
107 #define RTTL1_FILL_FULL_LIST_MEAS(param1, param2, param3, param4) \ | |
108 if(SELECTED_BITMAP(RTTL1_ENABLE_FULL_LIST_MEAS)) \ | |
109 { \ | |
110 T_RTT_PTR ptr; \ | |
111 \ | |
112 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_FULL_LIST_MEAS))) != NULL) \ | |
113 { \ | |
114 ((T_RTTL1_FULL_LIST_MEAS *)ptr)->pm = param1; \ | |
115 ((T_RTTL1_FULL_LIST_MEAS *)ptr)->input_level = param2; \ | |
116 ((T_RTTL1_FULL_LIST_MEAS *)ptr)->task = param3; \ | |
117 ((T_RTTL1_FULL_LIST_MEAS *)ptr)->radio_freq = param4; \ | |
118 ((T_RTTL1_FULL_LIST_MEAS *)ptr)->cell_id = RTTL1_ENABLE_FULL_LIST_MEAS; \ | |
119 } \ | |
120 } | |
121 | |
122 //----------------------------------------------------------------------------------------------------------- | |
123 // L1 RTT cell filling: Full list measurement | |
124 | |
125 #define RTTL1_FILL_MON_MEAS(param1, param2, param3, param4) \ | |
126 if(SELECTED_BITMAP(RTTL1_ENABLE_MON_MEAS)) \ | |
127 { \ | |
128 T_RTT_PTR ptr; \ | |
129 \ | |
130 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_MON_MEAS))) != NULL) \ | |
131 { \ | |
132 ((T_RTTL1_MON_MEAS *)ptr)->pm = param1; \ | |
133 ((T_RTTL1_MON_MEAS *)ptr)->input_level = param2; \ | |
134 ((T_RTTL1_MON_MEAS *)ptr)->task = param3; \ | |
135 ((T_RTTL1_MON_MEAS *)ptr)->radio_freq = param4; \ | |
136 ((T_RTTL1_MON_MEAS *)ptr)->cell_id = RTTL1_ENABLE_MON_MEAS; \ | |
137 } \ | |
138 } | |
139 | |
140 //----------------------------------------------------------------------------------------------------------- | |
141 // L1 RTT cell filling: Downlink DCCH block | |
142 | |
143 #define RTTL1_FILL_DL_DCCH(param1, param2) \ | |
144 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_DCCH)) \ | |
145 { \ | |
146 T_RTT_PTR ptr; \ | |
147 \ | |
148 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_DCCH))) != NULL) \ | |
149 { \ | |
150 ((T_RTTL1_DL_DCCH *)ptr)->valid_flag = param1; \ | |
151 ((T_RTTL1_DL_DCCH *)ptr)->physical_info = param2; \ | |
152 ((T_RTTL1_DL_DCCH *)ptr)->cell_id = RTTL1_ENABLE_DL_DCCH; \ | |
153 } \ | |
154 } | |
155 | |
156 //----------------------------------------------------------------------------------------------------------- | |
157 // L1 RTT cell filling: Downlink PTCCH block | |
158 | |
159 #define RTTL1_FILL_DL_PTCCH(param1, param2) \ | |
160 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_PTCCH)) \ | |
161 { \ | |
162 T_RTT_PTR ptr; \ | |
163 \ | |
164 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_PTCCH))) != NULL) \ | |
165 { \ | |
166 ((T_RTTL1_DL_PTCCH *)ptr)->crc = param1; \ | |
167 ((T_RTTL1_DL_PTCCH *)ptr)->ordered_ta = param2; \ | |
168 ((T_RTTL1_DL_PTCCH *)ptr)->cell_id = RTTL1_ENABLE_DL_PTCCH; \ | |
169 } \ | |
170 } | |
171 | |
172 //----------------------------------------------------------------------------------------------------------- | |
173 // L1 RTT cell filling: Uplink DCCH block | |
174 | |
175 #define RTTL1_FILL_UL_DCCH \ | |
176 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_DCCH)) \ | |
177 { \ | |
178 T_RTT_PTR ptr; \ | |
179 \ | |
180 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_DCCH))) != NULL) \ | |
181 { \ | |
182 ((T_RTTL1_UL_DCCH *)ptr)->cell_id = RTTL1_ENABLE_UL_DCCH; \ | |
183 } \ | |
184 } | |
185 | |
186 //----------------------------------------------------------------------------------------------------------- | |
187 // L1 RTT cell filling: Uplink SACCH block | |
188 | |
189 #define RTTL1_FILL_UL_SACCH(param1, param2, param3) \ | |
190 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_SACCH)) \ | |
191 { \ | |
192 T_RTT_PTR ptr; \ | |
193 \ | |
194 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_SACCH))) != NULL) \ | |
195 { \ | |
196 ((T_RTTL1_UL_SACCH *)ptr)->data_present = param1; \ | |
197 ((T_RTTL1_UL_SACCH *)ptr)->reported_ta = param2; \ | |
198 ((T_RTTL1_UL_SACCH *)ptr)->reported_txpwr = param3; \ | |
199 ((T_RTTL1_UL_SACCH *)ptr)->cell_id = RTTL1_ENABLE_UL_SACCH; \ | |
200 } \ | |
201 } | |
202 | |
203 //----------------------------------------------------------------------------------------------------------- | |
204 // L1 RTT cell filling: Downlink PDTCH block | |
205 | |
206 #define RTTL1_FILL_DL_PDTCH(param1, param2, param3, param4, param5) \ | |
207 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_PDTCH)) \ | |
208 { \ | |
209 T_RTT_PTR ptr; \ | |
210 \ | |
211 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_PDTCH))) != NULL) \ | |
212 { \ | |
213 ((T_RTTL1_DL_PDTCH *)ptr)->mac_header = param1; \ | |
214 ((T_RTTL1_DL_PDTCH *)ptr)->tfi_result = param2; \ | |
215 ((T_RTTL1_DL_PDTCH *)ptr)->crc = param3; \ | |
216 ((T_RTTL1_DL_PDTCH *)ptr)->cs_type = param4; \ | |
217 ((T_RTTL1_DL_PDTCH *)ptr)->timeslot = param5; \ | |
218 ((T_RTTL1_DL_PDTCH *)ptr)->cell_id = RTTL1_ENABLE_DL_PDTCH; \ | |
219 } \ | |
220 } | |
221 | |
222 //----------------------------------------------------------------------------------------------------------- | |
223 // L1 RTT cell filling: Uplink PDTCH block | |
224 | |
225 #define RTTL1_FILL_UL_PDTCH(param1, param2, param3) \ | |
226 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_PDTCH)) \ | |
227 { \ | |
228 T_RTT_PTR ptr; \ | |
229 \ | |
230 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_PDTCH))) != NULL) \ | |
231 { \ | |
232 ((T_RTTL1_UL_PDTCH *)ptr)->cs_type = param1; \ | |
233 ((T_RTTL1_UL_PDTCH *)ptr)->data_allowed = param2; \ | |
234 ((T_RTTL1_UL_PDTCH *)ptr)->timeslot = param3; \ | |
235 ((T_RTTL1_UL_PDTCH *)ptr)->cell_id = RTTL1_ENABLE_UL_PDTCH; \ | |
236 } \ | |
237 } | |
238 | |
239 //----------------------------------------------------------------------------------------------------------- | |
240 // L1 RTT cell filling: MAC-S error | |
241 | |
242 #define RTTL1_FILL_MACS_STATUS(param1, param2) \ | |
243 if(SELECTED_BITMAP(RTTL1_ENABLE_MACS_STATUS)) \ | |
244 { \ | |
245 T_RTT_PTR ptr; \ | |
246 \ | |
247 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_MACS_STATUS))) != NULL) \ | |
248 { \ | |
249 ((T_RTTL1_MACS_STATUS *)ptr)->status = param1; \ | |
250 ((T_RTTL1_MACS_STATUS *)ptr)->timeslot = param2; \ | |
251 ((T_RTTL1_MACS_STATUS *)ptr)->cell_id = RTTL1_ENABLE_MACS_STATUS; \ | |
252 } \ | |
253 } | |
254 | |
255 //----------------------------------------------------------------------------------------------------------- | |
256 // L1 RTT cell filling: L1S task enable | |
257 | |
258 #define RTTL1_FILL_L1S_TASK_ENABLE(param1, param2) \ | |
259 if(SELECTED_BITMAP(RTTL1_ENABLE_L1S_TASK_ENABLE)) \ | |
260 { \ | |
261 T_RTT_PTR ptr; \ | |
262 \ | |
263 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_L1S_TASK_ENABLE))) != NULL) \ | |
264 { \ | |
265 ((T_RTTL1_L1S_TASK_ENABLE *)ptr)->bitmap1 = param1; \ | |
266 ((T_RTTL1_L1S_TASK_ENABLE *)ptr)->bitmap2 = param2; \ | |
267 ((T_RTTL1_L1S_TASK_ENABLE *)ptr)->cell_id = RTTL1_ENABLE_L1S_TASK_ENABLE; \ | |
268 } \ | |
269 } | |
270 | |
271 //----------------------------------------------------------------------------------------------------------- | |
272 // L1 RTT cell filling: MFTAB trace | |
273 | |
274 #define RTTL1_FILL_MFTAB(param1) \ | |
275 if(SELECTED_BITMAP(RTTL1_ENABLE_MFTAB)) \ | |
276 { \ | |
277 T_RTT_PTR ptr; \ | |
278 \ | |
279 if ((ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_MFTAB))) != NULL) \ | |
280 { \ | |
281 ((T_RTTL1_MFTAB *)ptr)->func = param1; \ | |
282 ((T_RTTL1_MFTAB *)ptr)->cell_id = RTTL1_ENABLE_MFTAB; \ | |
283 } \ | |
284 } | |
285 | |
286 /***********************************************************************************************************/ | |
287 /* Macro for events */ | |
288 /***********************************************************************************************************/ | |
289 | |
290 #define RTTL1_EVENT(id,size) \ | |
291 if (trace_info.current_config->rttl1_event_enable & (0x1 << id)) \ | |
292 trace_info.l1s_rtt_func.rtt_dump_buffer(trace_info.l1s_trace_user_id, size); | |
293 #else // RVM_RTT_SWE || OP_L1_STANDALONE | |
294 | |
295 // No RTT: all macros are empty | |
296 #define SELECTED_BITMAP(enable_bit) (0) | |
297 #define RTTL1_FILL_FN(param1) | |
298 #define RTTL1_FILL_DL_BURST(param1,param2,param3,param4,param5,param6,param7) | |
299 #define RTTL1_FILL_UL_NB(param1, param2, param3) | |
300 #define RTTL1_FILL_UL_AB(param1, param2) | |
301 #define RTTL1_FILL_FULL_LIST_MEAS(param1, param2, param3, param4) | |
302 #define RTTL1_FILL_MON_MEAS(param1, param2, param3, param4) | |
303 #define RTTL1_FILL_DL_DCCH(param1, param2) | |
304 #define RTTL1_FILL_DL_PTCCH(param1, param2) | |
305 #define RTTL1_FILL_UL_DCCH | |
306 #define RTTL1_FILL_UL_SACCH(param1, param2, param3) | |
307 #define RTTL1_FILL_DL_PDTCH(param1, param2, param3, param4, param5) | |
308 #define RTTL1_FILL_UL_PDTCH(param1, param2, param3) | |
309 #define RTTL1_FILL_MACS_STATUS(param1, param2) | |
310 #define RTTL1_FILL_L1S_TASK_ENABLE(param1, param2) | |
311 #define RTTL1_FILL_MFTAB(param1) | |
312 #define RTTL1_EVENT(id,size) | |
313 | |
314 #endif // RVM_RTT_SWE || OP_L1_STANDALONE |