FreeCalypso > hg > freecalypso-citrine
comparison L1/include/l1_rtt_macro.h @ 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 | f93dab57b032 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
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 T_RTTL1_FN *ptr2; \ | |
43 \ | |
44 ptr = (T_RTT_PTR *) &ptr2; \ | |
45 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_FN))) != NULL) \ | |
46 { \ | |
47 ptr2->fn = param1; \ | |
48 ptr2->cell_id = RTTL1_ENABLE_FN; \ | |
49 } \ | |
50 } | |
51 | |
52 //----------------------------------------------------------------------------------------------------------- | |
53 // L1 RTT cell filling: Downlink burst | |
54 | |
55 #define RTTL1_FILL_DL_BURST(param1,param2,param3,param4,param5,param6,param7) \ | |
56 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_BURST)) \ | |
57 { \ | |
58 T_RTT_PTR *ptr; \ | |
59 T_RTTL1_DL_BURST *ptr2; \ | |
60 \ | |
61 ptr = (T_RTT_PTR *) &ptr2; \ | |
62 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_BURST))) != NULL) \ | |
63 { \ | |
64 ptr2->angle = param1; \ | |
65 ptr2->snr = param2; \ | |
66 ptr2->afc = param3; \ | |
67 ptr2->task = param4; \ | |
68 ptr2->pm = param5; \ | |
69 ptr2->toa = param6; \ | |
70 ptr2->input_level = param7; \ | |
71 ptr2->cell_id = RTTL1_ENABLE_DL_BURST; \ | |
72 } \ | |
73 } | |
74 | |
75 //----------------------------------------------------------------------------------------------------------- | |
76 // L1 RTT cell filling: Uplink Normal Burst | |
77 | |
78 #define RTTL1_FILL_UL_NB(param1, param2, param3) \ | |
79 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_NB)) \ | |
80 { \ | |
81 T_RTT_PTR *ptr; \ | |
82 T_RTTL1_UL_NB *ptr2; \ | |
83 \ | |
84 ptr = (T_RTT_PTR *) &ptr2; \ | |
85 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_NB))) != NULL) \ | |
86 { \ | |
87 ptr2->task = param1; \ | |
88 ptr2->ta = param2; \ | |
89 ptr2->txpwr = param3; \ | |
90 ptr2->cell_id = RTTL1_ENABLE_UL_NB; \ | |
91 } \ | |
92 } | |
93 | |
94 //----------------------------------------------------------------------------------------------------------- | |
95 // L1 RTT cell filling: Uplink Access Burst | |
96 | |
97 #define RTTL1_FILL_UL_AB(param1, param2) \ | |
98 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_AB)) \ | |
99 { \ | |
100 T_RTT_PTR *ptr; \ | |
101 T_RTTL1_UL_AB *ptr2; \ | |
102 \ | |
103 ptr = (T_RTT_PTR *) &ptr2; \ | |
104 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_AB))) != NULL) \ | |
105 { \ | |
106 ptr2->task = param1; \ | |
107 ptr2->txpwr = param2; \ | |
108 ptr2->cell_id = RTTL1_ENABLE_UL_AB; \ | |
109 } \ | |
110 } | |
111 | |
112 //----------------------------------------------------------------------------------------------------------- | |
113 // L1 RTT cell filling: Full list measurement | |
114 | |
115 #define RTTL1_FILL_FULL_LIST_MEAS(param1, param2, param3, param4) \ | |
116 if(SELECTED_BITMAP(RTTL1_ENABLE_FULL_LIST_MEAS)) \ | |
117 { \ | |
118 T_RTT_PTR *ptr; \ | |
119 T_RTTL1_FULL_LIST_MEAS *ptr2; \ | |
120 \ | |
121 ptr = (T_RTT_PTR *) &ptr2; \ | |
122 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_FULL_LIST_MEAS))) != NULL) \ | |
123 { \ | |
124 ptr2->pm = param1; \ | |
125 ptr2->input_level = param2; \ | |
126 ptr2->task = param3; \ | |
127 ptr2->radio_freq = param4; \ | |
128 ptr2->cell_id = RTTL1_ENABLE_FULL_LIST_MEAS; \ | |
129 } \ | |
130 } | |
131 | |
132 //----------------------------------------------------------------------------------------------------------- | |
133 // L1 RTT cell filling: Full list measurement | |
134 | |
135 #define RTTL1_FILL_MON_MEAS(param1, param2, param3, param4) \ | |
136 if(SELECTED_BITMAP(RTTL1_ENABLE_MON_MEAS)) \ | |
137 { \ | |
138 T_RTT_PTR *ptr; \ | |
139 T_RTTL1_MON_MEAS *ptr2; \ | |
140 \ | |
141 ptr = (T_RTT_PTR *) &ptr2; \ | |
142 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_MON_MEAS))) != NULL) \ | |
143 { \ | |
144 ptr2->pm = param1; \ | |
145 ptr2->input_level = param2; \ | |
146 ptr2->task = param3; \ | |
147 ptr2->radio_freq = param4; \ | |
148 ptr2->cell_id = RTTL1_ENABLE_MON_MEAS; \ | |
149 } \ | |
150 } | |
151 | |
152 //----------------------------------------------------------------------------------------------------------- | |
153 // L1 RTT cell filling: Downlink DCCH block | |
154 | |
155 #define RTTL1_FILL_DL_DCCH(param1, param2) \ | |
156 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_DCCH)) \ | |
157 { \ | |
158 T_RTT_PTR *ptr; \ | |
159 T_RTTL1_DL_DCCH *ptr2; \ | |
160 \ | |
161 ptr = (T_RTT_PTR *) &ptr2; \ | |
162 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_DCCH))) != NULL) \ | |
163 { \ | |
164 ptr2->valid_flag = param1; \ | |
165 ptr2->physical_info = param2; \ | |
166 ptr2->cell_id = RTTL1_ENABLE_DL_DCCH; \ | |
167 } \ | |
168 } | |
169 | |
170 //----------------------------------------------------------------------------------------------------------- | |
171 // L1 RTT cell filling: Downlink PTCCH block | |
172 | |
173 #define RTTL1_FILL_DL_PTCCH(param1, param2) \ | |
174 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_PTCCH)) \ | |
175 { \ | |
176 T_RTT_PTR *ptr; \ | |
177 T_RTTL1_DL_PTCCH *ptr2; \ | |
178 \ | |
179 ptr = (T_RTT_PTR *) &ptr2; \ | |
180 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_PTCCH))) != NULL) \ | |
181 { \ | |
182 ptr2->crc = param1; \ | |
183 ptr2->ordered_ta = param2; \ | |
184 ptr2->cell_id = RTTL1_ENABLE_DL_PTCCH; \ | |
185 } \ | |
186 } | |
187 | |
188 //----------------------------------------------------------------------------------------------------------- | |
189 // L1 RTT cell filling: Uplink DCCH block | |
190 | |
191 #define RTTL1_FILL_UL_DCCH \ | |
192 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_DCCH)) \ | |
193 { \ | |
194 T_RTT_PTR *ptr; \ | |
195 T_RTTL1_UL_DCCH *ptr2; \ | |
196 \ | |
197 ptr = (T_RTT_PTR *) &ptr2; \ | |
198 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_DCCH))) != NULL) \ | |
199 { \ | |
200 ptr2->cell_id = RTTL1_ENABLE_UL_DCCH; \ | |
201 } \ | |
202 } | |
203 | |
204 //----------------------------------------------------------------------------------------------------------- | |
205 // L1 RTT cell filling: Uplink SACCH block | |
206 | |
207 #define RTTL1_FILL_UL_SACCH(param1, param2, param3) \ | |
208 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_SACCH)) \ | |
209 { \ | |
210 T_RTT_PTR *ptr; \ | |
211 T_RTTL1_UL_SACCH *ptr2; \ | |
212 \ | |
213 ptr = (T_RTT_PTR *) &ptr2; \ | |
214 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_SACCH))) != NULL) \ | |
215 { \ | |
216 ptr2->data_present = param1; \ | |
217 ptr2->reported_ta = param2; \ | |
218 ptr2->reported_txpwr = param3; \ | |
219 ptr2->cell_id = RTTL1_ENABLE_UL_SACCH; \ | |
220 } \ | |
221 } | |
222 | |
223 //----------------------------------------------------------------------------------------------------------- | |
224 // L1 RTT cell filling: Downlink PDTCH block | |
225 | |
226 #define RTTL1_FILL_DL_PDTCH(param1, param2, param3, param4, param5) \ | |
227 if(SELECTED_BITMAP(RTTL1_ENABLE_DL_PDTCH)) \ | |
228 { \ | |
229 T_RTT_PTR *ptr; \ | |
230 T_RTTL1_DL_PDTCH *ptr2; \ | |
231 \ | |
232 ptr = (T_RTT_PTR *) &ptr2; \ | |
233 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_DL_PDTCH))) != NULL) \ | |
234 { \ | |
235 ptr2->mac_header = param1; \ | |
236 ptr2->tfi_result = param2; \ | |
237 ptr2->crc = param3; \ | |
238 ptr2->cs_type = param4; \ | |
239 ptr2->timeslot = param5; \ | |
240 ptr2->cell_id = RTTL1_ENABLE_DL_PDTCH; \ | |
241 } \ | |
242 } | |
243 | |
244 //----------------------------------------------------------------------------------------------------------- | |
245 // L1 RTT cell filling: Uplink PDTCH block | |
246 | |
247 #define RTTL1_FILL_UL_PDTCH(param1, param2, param3) \ | |
248 if(SELECTED_BITMAP(RTTL1_ENABLE_UL_PDTCH)) \ | |
249 { \ | |
250 T_RTT_PTR *ptr; \ | |
251 T_RTTL1_UL_PDTCH *ptr2; \ | |
252 \ | |
253 ptr = (T_RTT_PTR *) &ptr2; \ | |
254 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_UL_PDTCH))) != NULL) \ | |
255 { \ | |
256 ptr2->cs_type = param1; \ | |
257 ptr2->data_allowed = param2; \ | |
258 ptr2->timeslot = param3; \ | |
259 ptr2->cell_id = RTTL1_ENABLE_UL_PDTCH; \ | |
260 } \ | |
261 } | |
262 | |
263 //----------------------------------------------------------------------------------------------------------- | |
264 // L1 RTT cell filling: MAC-S error | |
265 | |
266 #define RTTL1_FILL_MACS_STATUS(param1, param2) \ | |
267 if(SELECTED_BITMAP(RTTL1_ENABLE_MACS_STATUS)) \ | |
268 { \ | |
269 T_RTT_PTR *ptr; \ | |
270 T_RTTL1_MACS_STATUS *ptr2; \ | |
271 \ | |
272 ptr = (T_RTT_PTR *) &ptr2; \ | |
273 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_MACS_STATUS))) != NULL) \ | |
274 { \ | |
275 ptr2->status = param1; \ | |
276 ptr2->timeslot = param2; \ | |
277 ptr2->cell_id = RTTL1_ENABLE_MACS_STATUS; \ | |
278 } \ | |
279 } | |
280 | |
281 //----------------------------------------------------------------------------------------------------------- | |
282 // L1 RTT cell filling: L1S task enable | |
283 | |
284 #define RTTL1_FILL_L1S_TASK_ENABLE(param1, param2) \ | |
285 if(SELECTED_BITMAP(RTTL1_ENABLE_L1S_TASK_ENABLE)) \ | |
286 { \ | |
287 T_RTT_PTR *ptr; \ | |
288 T_RTTL1_L1S_TASK_ENABLE *ptr2; \ | |
289 \ | |
290 ptr = (T_RTT_PTR *) &ptr2; \ | |
291 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_L1S_TASK_ENABLE))) != NULL) \ | |
292 { \ | |
293 ptr2->bitmap1 = param1; \ | |
294 ptr2->bitmap2 = param2; \ | |
295 ptr2->cell_id = RTTL1_ENABLE_L1S_TASK_ENABLE; \ | |
296 } \ | |
297 } | |
298 | |
299 //----------------------------------------------------------------------------------------------------------- | |
300 // L1 RTT cell filling: MFTAB trace | |
301 | |
302 #define RTTL1_FILL_MFTAB(param1) \ | |
303 if(SELECTED_BITMAP(RTTL1_ENABLE_MFTAB)) \ | |
304 { \ | |
305 T_RTT_PTR *ptr; \ | |
306 T_RTTL1_MFTAB *ptr2; \ | |
307 \ | |
308 ptr = (T_RTT_PTR *) &ptr2; \ | |
309 if ((*ptr = trace_info.l1s_rtt_func.rtt_get_fill_ptr(trace_info.l1s_trace_user_id, sizeof(T_RTTL1_MFTAB))) != NULL) \ | |
310 { \ | |
311 ptr2->func = param1; \ | |
312 ptr2->cell_id = RTTL1_ENABLE_MFTAB; \ | |
313 } \ | |
314 } | |
315 | |
316 /***********************************************************************************************************/ | |
317 /* Macro for events */ | |
318 /***********************************************************************************************************/ | |
319 | |
320 #define RTTL1_EVENT(id,size) \ | |
321 if (trace_info.current_config->rttl1_event_enable & (0x1 << id)) \ | |
322 trace_info.l1s_rtt_func.rtt_dump_buffer(trace_info.l1s_trace_user_id, size); | |
323 #else // RVM_RTT_SWE || OP_L1_STANDALONE | |
324 | |
325 // No RTT: all macros are empty | |
326 #define SELECTED_BITMAP(enable_bit) (0) | |
327 #define RTTL1_FILL_FN(param1) | |
328 #define RTTL1_FILL_DL_BURST(param1,param2,param3,param4,param5,param6,param7) | |
329 #define RTTL1_FILL_UL_NB(param1, param2, param3) | |
330 #define RTTL1_FILL_UL_AB(param1, param2) | |
331 #define RTTL1_FILL_FULL_LIST_MEAS(param1, param2, param3, param4) | |
332 #define RTTL1_FILL_MON_MEAS(param1, param2, param3, param4) | |
333 #define RTTL1_FILL_DL_DCCH(param1, param2) | |
334 #define RTTL1_FILL_DL_PTCCH(param1, param2) | |
335 #define RTTL1_FILL_UL_DCCH | |
336 #define RTTL1_FILL_UL_SACCH(param1, param2, param3) | |
337 #define RTTL1_FILL_DL_PDTCH(param1, param2, param3, param4, param5) | |
338 #define RTTL1_FILL_UL_PDTCH(param1, param2, param3) | |
339 #define RTTL1_FILL_MACS_STATUS(param1, param2) | |
340 #define RTTL1_FILL_L1S_TASK_ENABLE(param1, param2) | |
341 #define RTTL1_FILL_MFTAB(param1) | |
342 #define RTTL1_EVENT(id,size) | |
343 | |
344 #endif // RVM_RTT_SWE || OP_L1_STANDALONE |