FreeCalypso > hg > fc-magnetite
comparison src/g23m-gprs/grr/grr_meass.c @ 183:219afcfc6250
src/g23m-gprs: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 13 Oct 2016 04:24:13 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
182:f02d0a0e1849 | 183:219afcfc6250 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GPRS (8441) | |
4 | Modul : GRR | |
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 module implements signal handler functions for service | |
18 | MEAS of entity GRR. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef GRR_MEASS_C | |
23 #define GRR_MEASS_C | |
24 #endif | |
25 | |
26 #define ENTITY_GRR | |
27 | |
28 /*==== INCLUDES =============================================================*/ | |
29 | |
30 #include <string.h> | |
31 #include "typedefs.h" /* to get Condat data types */ | |
32 #include "vsi.h" /* to get a lot of macros */ | |
33 #include "macdef.h" | |
34 #include "gprs.h" | |
35 #include "gsm.h" /* to get a lot of macros */ | |
36 #include "ccdapi.h" /* to get CCD API */ | |
37 #include "cnf_grr.h" /* to get cnf-definitions */ | |
38 #include "mon_grr.h" /* to get mon-definitions */ | |
39 #include "prim.h" /* to get the definitions of used SAP and directions */ | |
40 #include "message.h" | |
41 #include "grr.h" /* to get the global entity definitions */ | |
42 #include "grr_f.h" | |
43 #include "grr_measf.h" /* to get the definitions for interference measurements */ | |
44 #include "grr_meass.h" /* to get the own definitions */ | |
45 #include "grr_measp.h" /* to get the own definitions */ | |
46 #include "cl_rlcmac.h" | |
47 #include "grr_tcs.h" | |
48 | |
49 /*==== CONST ================================================================*/ | |
50 | |
51 #define BS_PA_MFRMS_OFFSET 2 /* BS_PA_MRMS is coded within 3 bits and */ | |
52 /* ranges from 2 to 9 */ | |
53 #define DRX_DENOMINATOR_FOR_CCCH 4 | |
54 | |
55 /*==== LOCAL VARS ===========================================================*/ | |
56 | |
57 /*==== LOCAL TYPES===========================================================*/ | |
58 | |
59 #if !defined (NTRACE) | |
60 | |
61 LOCAL void meas_im_trace_i_level( T_MEAS_IM_FILTER *filter, | |
62 T_ilev *i_level ); | |
63 | |
64 #endif /* #if !defined (NTRACE) */ | |
65 | |
66 /*==== PUBLIC FUNCTIONS =====================================================*/ | |
67 /* | |
68 +------------------------------------------------------------------------------ | |
69 | Function : meas_im_get_permit | |
70 +------------------------------------------------------------------------------ | |
71 | Description : This function returns whether interference measurements in | |
72 | packet transfer mode shall be performed by Layer 1 | |
73 | autonomously. | |
74 | | |
75 | Parameters : void | |
76 | | |
77 +------------------------------------------------------------------------------ | |
78 */ | |
79 GLOBAL UBYTE meas_im_get_permit ( void ) | |
80 { | |
81 UBYTE permit = MPHP_IM_ENABLED; | |
82 | |
83 TRACE_FUNCTION( "meas_im_get_permit" ); | |
84 | |
85 if( grr_data->meas_im.mode NEQ IM_MODE_IDLE_TRANSFER AND | |
86 grr_data->meas_im.mode NEQ IM_MODE_TRANSFER ) | |
87 { | |
88 permit = MPHP_IM_DISABLED; | |
89 } | |
90 | |
91 return( permit ); | |
92 } /* meas_im_get_permit() */ | |
93 | |
94 /* | |
95 +------------------------------------------------------------------------------ | |
96 | Function : meas_init | |
97 +------------------------------------------------------------------------------ | |
98 | Description : This function initializes the measurement module. | |
99 | | |
100 | Parameters : im_mode - operation mode for interference measurements | |
101 | | |
102 +------------------------------------------------------------------------------ | |
103 */ | |
104 GLOBAL void meas_init ( T_MEAS_IM_MODE im_mode ) | |
105 { | |
106 TRACE_FUNCTION( "meas_init" ); | |
107 | |
108 /* general initialization */ | |
109 INIT_STATE( MEAS, MEAS_NULL ); | |
110 | |
111 /* initialization of interference measurements */ | |
112 meas_im_init( im_mode ); | |
113 | |
114 /* initialization of extended measurements */ | |
115 meas_em_init( ); | |
116 | |
117 /* initialization of C value derivation */ | |
118 meas_c_init( ); | |
119 | |
120 } /* meas_init() */ | |
121 | |
122 /* | |
123 +------------------------------------------------------------------------------ | |
124 | Function : meas_im_get_rel_i_level | |
125 +------------------------------------------------------------------------------ | |
126 | Description : This function returns the interference level values mapped to | |
127 | values relative to the C value. | |
128 | | |
129 | Parameters : *ma - Ptr to frequency information in MA format | |
130 | *i_level - Ptr to relative interference level values | |
131 | | |
132 +------------------------------------------------------------------------------ | |
133 */ | |
134 GLOBAL void meas_im_get_rel_i_level ( T_MEAS_IM_CARRIER *ma, | |
135 T_ilev *i_level ) | |
136 { | |
137 T_MEAS_IM_FILTER *filter; /* filter */ | |
138 | |
139 TRACE_FUNCTION( "meas_im_get_rel_i_level" ); | |
140 | |
141 filter = meas_im_get_filter( ma ); | |
142 | |
143 meas_im_fill_rel_iLevel( &i_level->v_ilev0, &i_level->ilev0, filter, 0 ); | |
144 meas_im_fill_rel_iLevel( &i_level->v_ilev1, &i_level->ilev1, filter, 1 ); | |
145 meas_im_fill_rel_iLevel( &i_level->v_ilev2, &i_level->ilev2, filter, 2 ); | |
146 meas_im_fill_rel_iLevel( &i_level->v_ilev3, &i_level->ilev3, filter, 3 ); | |
147 meas_im_fill_rel_iLevel( &i_level->v_ilev4, &i_level->ilev4, filter, 4 ); | |
148 meas_im_fill_rel_iLevel( &i_level->v_ilev5, &i_level->ilev5, filter, 5 ); | |
149 meas_im_fill_rel_iLevel( &i_level->v_ilev6, &i_level->ilev6, filter, 6 ); | |
150 meas_im_fill_rel_iLevel( &i_level->v_ilev7, &i_level->ilev7, filter, 7 ); | |
151 | |
152 #if !defined (NTRACE) | |
153 | |
154 meas_im_trace_i_level( filter, i_level ); | |
155 | |
156 #endif /* #if !defined (NTRACE) */ | |
157 | |
158 } /* meas_im_get_rel_i_level() */ | |
159 | |
160 /* | |
161 +------------------------------------------------------------------------------ | |
162 | Function : meas_im_get_drx_period_seconds | |
163 +------------------------------------------------------------------------------ | |
164 | Description : | |
165 | | |
166 | Parameters : void | |
167 | | |
168 +------------------------------------------------------------------------------ | |
169 */ | |
170 GLOBAL ULONG meas_im_get_drx_period_seconds ( void ) | |
171 { | |
172 ULONG t_drx; /* DRX period for the MS */ | |
173 | |
174 TRACE_FUNCTION( "meas_im_get_drx_period_seconds" ); | |
175 | |
176 if( grr_is_pbcch_present( ) EQ TRUE ) | |
177 { | |
178 if( grr_is_non_drx_mode( ) ) | |
179 { | |
180 t_drx = DRX_NORM_FACTOR / BLOCK_PER_MF; | |
181 } | |
182 else | |
183 { | |
184 t_drx = ( DRX_NORM_FACTOR * PAGING_CYCLE ) / grr_data->ms.split_pg_cycle; | |
185 } | |
186 | |
187 t_drx *= ( USEC_PER_MF / MEAS_ACRCY ); | |
188 } | |
189 else | |
190 { | |
191 if( meas_is_spgc_ccch_supported( ) ) | |
192 { | |
193 if( grr_is_non_drx_mode( ) ) | |
194 { | |
195 t_drx = DRX_NORM_FACTOR / DRX_DENOMINATOR_FOR_CCCH; | |
196 } | |
197 else | |
198 { | |
199 t_drx = ( DRX_NORM_FACTOR * PAGING_CYCLE ) / grr_data->ms.split_pg_cycle; | |
200 } | |
201 } | |
202 else | |
203 { | |
204 t_drx = DRX_NORM_FACTOR * | |
205 ( psc_db->net_ctrl.bs_pa_mfrms + BS_PA_MFRMS_OFFSET ); | |
206 } | |
207 | |
208 t_drx *= ( USEC_PER_CS_MF / MEAS_ACRCY ); | |
209 } | |
210 | |
211 return( t_drx ); | |
212 } /* meas_im_get_drx_period_seconds() */ | |
213 | |
214 /* | |
215 +------------------------------------------------------------------------------ | |
216 | Function : meas_im_get_drx_period_frames | |
217 +------------------------------------------------------------------------------ | |
218 | Description : | |
219 | | |
220 | Parameters : void | |
221 | | |
222 +------------------------------------------------------------------------------ | |
223 */ | |
224 GLOBAL USHORT meas_im_get_drx_period_frames ( void ) | |
225 { | |
226 ULONG frames; | |
227 | |
228 TRACE_FUNCTION( "meas_im_get_drx_period_frames" ); | |
229 | |
230 frames = meas_im_get_drx_period_seconds( ) * N_MSEC_PER_FRAME; | |
231 frames = M_ROUND_UP( frames, Z_MSEC_PER_FRAME * DRX_NORM_FACTOR ); | |
232 | |
233 return( ( USHORT )frames ); | |
234 } /* meas_im_get_drx_period_frames() */ | |
235 | |
236 /* | |
237 +------------------------------------------------------------------------------ | |
238 | Function : meas_im_get_abs_i_level | |
239 +------------------------------------------------------------------------------ | |
240 | Description : This function returns the interference level values mapped to | |
241 | values as defined for RXLEV. It returns the number of bits | |
242 | occupied within the measurement report. | |
243 | | |
244 | Parameters : *ma - Ptr to frequency information in MA format | |
245 | *i_level - Ptr to absolute interference level values | |
246 | | |
247 +------------------------------------------------------------------------------ | |
248 */ | |
249 GLOBAL UBYTE meas_im_get_abs_i_level ( T_MEAS_IM_CARRIER *ma, | |
250 T_ilev_abs *i_level ) | |
251 { | |
252 UBYTE used_bits; | |
253 | |
254 T_MEAS_IM_FILTER *filter; /* filter */ | |
255 | |
256 TRACE_FUNCTION( "meas_im_get_abs_i_level" ); | |
257 | |
258 filter = meas_im_get_filter( ma ); | |
259 | |
260 used_bits = | |
261 meas_im_fill_abs_iLevel( &i_level->v_ilevabs0, &i_level->ilevabs0, filter, 0 ); | |
262 used_bits += | |
263 meas_im_fill_abs_iLevel( &i_level->v_ilevabs1, &i_level->ilevabs1, filter, 1 ); | |
264 used_bits += | |
265 meas_im_fill_abs_iLevel( &i_level->v_ilevabs2, &i_level->ilevabs2, filter, 2 ); | |
266 used_bits += | |
267 meas_im_fill_abs_iLevel( &i_level->v_ilevabs3, &i_level->ilevabs3, filter, 3 ); | |
268 used_bits += | |
269 meas_im_fill_abs_iLevel( &i_level->v_ilevabs4, &i_level->ilevabs4, filter, 4 ); | |
270 used_bits += | |
271 meas_im_fill_abs_iLevel( &i_level->v_ilevabs5, &i_level->ilevabs5, filter, 5 ); | |
272 used_bits += | |
273 meas_im_fill_abs_iLevel( &i_level->v_ilevabs6, &i_level->ilevabs6, filter, 6 ); | |
274 used_bits += | |
275 meas_im_fill_abs_iLevel( &i_level->v_ilevabs7, &i_level->ilevabs7, filter, 7 ); | |
276 | |
277 #if !defined (NTRACE) | |
278 | |
279 meas_im_trace_i_level( filter, ( T_ilev* )i_level ); | |
280 | |
281 #endif /* #if !defined (NTRACE) */ | |
282 | |
283 return( used_bits ); | |
284 } /* meas_im_get_abs_i_level() */ | |
285 | |
286 /* | |
287 +------------------------------------------------------------------------------ | |
288 | Function : meas_im_set_carrier | |
289 +------------------------------------------------------------------------------ | |
290 | Description : | |
291 | | |
292 | Frequency Band config. ETSI GSM spec. coding used in L1 | |
293 | GSM 900 STD_900 1-124 1-124 | |
294 | E-GSM STD_EGSM 1-124, 1-124, | |
295 | 975-1023, 0 125-174 | |
296 | PCS 1900 STD_1900 512-810 512-810 | |
297 | DCS 1800 STD_1800 512-885 512-885 | |
298 | GSM 900/DCS 1800 STD_DUAL 1-124, 1-124, | |
299 | 512-885 125-498 | |
300 | E-GSM/DCS 1800 STD_DUAL_EGSM 1-124, 1-124, | |
301 | 975-1023,0 125-174, | |
302 | 512-885 175-548 | |
303 | GSM 850 STD_850 128-251 128-251 | |
304 | GSM 850/PCS 1900 STD_DUAL_US 128-251, 1-124, | |
305 | 512-810 125-424 | |
306 | | |
307 | Parameters : | |
308 | | |
309 +------------------------------------------------------------------------------ | |
310 */ | |
311 GLOBAL void meas_im_set_carrier ( T_MEAS_IM_CARRIER *carrier, | |
312 T_p_frequency_par *freq_par ) | |
313 { | |
314 TRACE_FUNCTION( "meas_im_set_carrier" ); | |
315 | |
316 if( freq_par->p_chan_sel.hopping ) | |
317 { | |
318 UBYTE i; | |
319 UBYTE bit_shift; | |
320 USHORT array_idx; | |
321 USHORT arfcn; | |
322 | |
323 carrier->hopping = TRUE; | |
324 carrier->alloc.hop_param.hsn = ( freq_par->p_chan_sel.p_rf_ch.arfcn >> 8 ); | |
325 carrier->alloc.hop_param.maio = ( freq_par->p_chan_sel.p_rf_ch.arfcn & 0x00FF ); | |
326 | |
327 memset( carrier->alloc.hop_param.arfcn_bit_field, | |
328 0, MAX_IM_HOP_ARFCN_BIT_FIELD_SIZE ); | |
329 | |
330 for( i = 0; i < freq_par->p_freq_list.p_rf_chan_cnt; i++ ) | |
331 { | |
332 arfcn = freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[i]; | |
333 | |
334 switch( std ) | |
335 { | |
336 case STD_1900: arfcn -= LOW_CHANNEL_1900; break; | |
337 case STD_1800: arfcn -= LOW_CHANNEL_1800; break; | |
338 default : break; | |
339 } | |
340 | |
341 array_idx = arfcn / 8; | |
342 bit_shift = ( UBYTE )( arfcn % 8 ); | |
343 | |
344 if( array_idx < MAX_IM_HOP_ARFCN_BIT_FIELD_SIZE ) | |
345 { | |
346 carrier->alloc.hop_param.arfcn_bit_field[array_idx] |= | |
347 ( 0x01 << bit_shift ); | |
348 } | |
349 else | |
350 { | |
351 TRACE_ERROR( "meas_im_set_carrier: array_idx >= MAX_IM_HOP_ARFCN_BIT_FIELD_SIZE" ); | |
352 } | |
353 } | |
354 } | |
355 else | |
356 { | |
357 carrier->hopping = FALSE; | |
358 carrier->alloc.arfcn = freq_par->p_chan_sel.p_rf_ch.arfcn; | |
359 } | |
360 | |
361 #if !defined (NTRACE) | |
362 | |
363 if( grr_data->meas_im.n_im_trace & M_IM_TRACE_FREQUENCY ) | |
364 { | |
365 if( carrier->hopping ) | |
366 { | |
367 ULONG arfcn[4]; | |
368 ULONG freq[4]; | |
369 | |
370 arfcn[0] = ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[0] << 0; | |
371 arfcn[0] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[1] << 8; | |
372 arfcn[0] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[2] << 16; | |
373 arfcn[0] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[3] << 24; | |
374 arfcn[1] = ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[4] << 0; | |
375 arfcn[1] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[5] << 8; | |
376 arfcn[1] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[6] << 16; | |
377 arfcn[1] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[7] << 24; | |
378 arfcn[2] = ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[8] << 0; | |
379 arfcn[2] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[9] << 8; | |
380 arfcn[2] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[10] << 16; | |
381 arfcn[2] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[11] << 24; | |
382 arfcn[3] = ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[12] << 0; | |
383 arfcn[3] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[13] << 8; | |
384 arfcn[3] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[14] << 16; | |
385 arfcn[3] |= ( ULONG )carrier->alloc.hop_param.arfcn_bit_field[15] << 24; | |
386 | |
387 freq[0] = ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[0] << 16; | |
388 freq[0] |= ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[1] << 0; | |
389 freq[1] = ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[2] << 16; | |
390 freq[1] |= ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[3] << 0; | |
391 freq[2] = ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[4] << 16; | |
392 freq[2] |= ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[5] << 0; | |
393 freq[3] = ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[6] << 16; | |
394 freq[3] |= ( ULONG )freq_par->p_freq_list.p_rf_chan_no.p_radio_freq[7] << 0; | |
395 | |
396 | |
397 TRACE_EVENT_P9( "meas_im_get_trns_freq: %08X%08X%08X%08X Num: %d Freq: %08X %08X %08X %08X", | |
398 arfcn[3], arfcn[2], arfcn[1], arfcn[0], | |
399 freq_par->p_freq_list.p_rf_chan_cnt, | |
400 freq[0], freq[1], freq[2], freq[3] ); | |
401 } | |
402 else | |
403 { | |
404 TRACE_EVENT_P1( "meas_im_get_trns_freq: %d", carrier->alloc.arfcn ); | |
405 } | |
406 } | |
407 | |
408 #endif /* #if !defined (NTRACE) */ | |
409 | |
410 } /* meas_im_set_carrier() */ | |
411 | |
412 /* | |
413 +------------------------------------------------------------------------------ | |
414 | Function : meas_prepare_and_start_idle | |
415 +------------------------------------------------------------------------------ | |
416 | Description : ... | |
417 | Parameters : void | |
418 | | |
419 +------------------------------------------------------------------------------ | |
420 */ | |
421 GLOBAL void meas_prepare_and_start_idle ( void ) | |
422 { | |
423 TRACE_FUNCTION( "meas_prepare_and_start_idle" ); | |
424 | |
425 meas_im_cgrlc_int_level_req( TRUE ); | |
426 | |
427 switch( GET_STATE( MEAS ) ) | |
428 { | |
429 case MEAS_IDLE: | |
430 if ( grr_data->meas_im.mode EQ IM_MODE_IDLE_TRANSFER OR | |
431 grr_data->meas_im.mode EQ IM_MODE_IDLE ) | |
432 { | |
433 meas_im_prepare_idle( ); | |
434 | |
435 switch( GET_STATE( MEAS_IM ) ) | |
436 { | |
437 case MEAS_IM_NULL: | |
438 { | |
439 if( meas_im_start_idle( ) ) | |
440 { | |
441 SET_STATE( MEAS_IM, MEAS_IM_START ); | |
442 } | |
443 } | |
444 break; | |
445 | |
446 default: | |
447 /* do nothing */ | |
448 break; | |
449 } | |
450 } | |
451 break; | |
452 | |
453 default: | |
454 /* do nothing */ | |
455 break; | |
456 } | |
457 } /* meas_prepare_and_start_idle() */ | |
458 | |
459 /* | |
460 +------------------------------------------------------------------------------ | |
461 | Function : meas_prepare_and_stop_idle | |
462 +------------------------------------------------------------------------------ | |
463 | Description : ... | |
464 | Parameters : void | |
465 | | |
466 +------------------------------------------------------------------------------ | |
467 */ | |
468 GLOBAL void meas_prepare_and_stop_idle ( void ) | |
469 { | |
470 TRACE_FUNCTION( "meas_prepare_and_stop_idle" ); | |
471 | |
472 switch( GET_STATE( MEAS ) ) | |
473 { | |
474 case MEAS_IDLE: | |
475 { | |
476 meas_im_prepare_idle( ); | |
477 } | |
478 break; | |
479 | |
480 default: | |
481 /* do nothing */ | |
482 break; | |
483 } | |
484 } /* meas_prepare_and_stop_idle() */ | |
485 | |
486 /*==== SIGNAL FUNCTIONS =====================================================*/ | |
487 | |
488 /* | |
489 +------------------------------------------------------------------------------ | |
490 | Function : sig_ctrl_meas_start | |
491 +------------------------------------------------------------------------------ | |
492 | Description : Handles the internal signal SIG_CTRL_MEAS_START | |
493 | | |
494 | Parameters : void | |
495 | | |
496 +------------------------------------------------------------------------------ | |
497 */ | |
498 GLOBAL void sig_ctrl_meas_start ( void ) | |
499 { | |
500 TRACE_ISIG( "sig_ctrl_meas_start" ); | |
501 | |
502 /* process the extended measurement service */ | |
503 if( psc_db->is_ext_psi5_valid EQ TRUE ) | |
504 { | |
505 sig_ctrl_meas_ext_valid_psi5( ); | |
506 } | |
507 | |
508 /* process the interference measurement service */ | |
509 sig_ctrl_meas_int_list_valid( ); | |
510 | |
511 } /* sig_ctrl_meas_start() */ | |
512 | |
513 | |
514 /* | |
515 +------------------------------------------------------------------------------ | |
516 | Function : sig_ctrl_meas_stop | |
517 +------------------------------------------------------------------------------ | |
518 | Description : Handles the internal signal SIG_CTRL_MEAS_STOP | |
519 | | |
520 | Parameters : void | |
521 | | |
522 +------------------------------------------------------------------------------ | |
523 */ | |
524 GLOBAL void sig_ctrl_meas_stop ( void ) | |
525 { | |
526 UBYTE state = GET_STATE( MEAS ); | |
527 | |
528 TRACE_ISIG( "sig_ctrl_meas_stop" ); | |
529 | |
530 /* process the interference measurement service */ | |
531 switch( state ) | |
532 { | |
533 case MEAS_ACCESS: | |
534 case MEAS_TRANSFER: | |
535 { | |
536 meas_im_stop_trns( ); | |
537 SET_STATE( MEAS_IM, MEAS_IM_NULL ); | |
538 } | |
539 break; | |
540 | |
541 case MEAS_IDLE: | |
542 { | |
543 switch( GET_STATE( MEAS_IM ) ) | |
544 { | |
545 case MEAS_IM_START: | |
546 { | |
547 meas_im_stop_idle( ); | |
548 | |
549 SET_STATE( MEAS_IM, MEAS_IM_STOP_REQ ); | |
550 } | |
551 break; | |
552 | |
553 case MEAS_IM_NULL: | |
554 SET_STATE( MEAS_IM, MEAS_IM_NULL ); | |
555 break; | |
556 | |
557 default: | |
558 TRACE_ERROR( "SIG_CTRL_MEAS_STOP unexpected INT MEAS 1" ); | |
559 break; | |
560 } | |
561 } | |
562 break; | |
563 | |
564 default: | |
565 /* do nothing */; | |
566 break; | |
567 } | |
568 | |
569 /* process the extended measurement service */ | |
570 switch( state ) | |
571 { | |
572 case MEAS_NULL: | |
573 case MEAS_IDLE: | |
574 case MEAS_ACCESS: | |
575 case MEAS_TRANSFER: | |
576 switch( GET_STATE( MEAS_EM ) ) | |
577 { | |
578 case MEAS_EM_REP_REQ: | |
579 meas_em_stop_req( ); | |
580 break; | |
581 | |
582 case MEAS_EM_PMR_SENDING: | |
583 case MEAS_EM_PENDING: | |
584 SET_STATE( MEAS_EM, MEAS_EM_NULL ); | |
585 break; | |
586 | |
587 default: | |
588 TRACE_ERROR( "SIG_CTRL_MEAS_STOP unexpected EXT MEAS 1" ); | |
589 break; | |
590 } | |
591 | |
592 if( grr_t_status( T3178) NEQ 0 ) | |
593 { | |
594 vsi_t_stop( GRR_handle, T3178); | |
595 TRACE_EVENT( "Timer T3178 stopped" ); | |
596 } | |
597 break; | |
598 | |
599 default: | |
600 TRACE_ERROR( "SIG_CTRL_MEAS_STOP unexpected EXT MEAS 2" ); | |
601 break; | |
602 } | |
603 | |
604 /* process the signal quality service */ | |
605 if( state EQ MEAS_TRANSFER ) | |
606 { | |
607 RX_SetRxQual( RX_QUAL_UNAVAILABLE ); | |
608 } | |
609 | |
610 SET_STATE( MEAS, MEAS_NULL ); | |
611 | |
612 } /* sig_ctrl_meas_stop() */ | |
613 | |
614 /* | |
615 +------------------------------------------------------------------------------ | |
616 | Function : sig_ctrl_meas_suspend | |
617 +------------------------------------------------------------------------------ | |
618 | Description : Handles the internal signal SIG_CTRL_MEAS_SUSPEND | |
619 | This signal suspends the measurement service | |
620 | Parameters : void | |
621 | | |
622 +------------------------------------------------------------------------------ | |
623 */ | |
624 GLOBAL void sig_ctrl_meas_suspend ( void ) | |
625 { | |
626 TRACE_ISIG( "sig_ctrl_meas_suspend" ); | |
627 | |
628 /* process the interference measurement service */ | |
629 switch( GET_STATE( MEAS ) ) | |
630 { | |
631 case MEAS_IDLE: | |
632 case MEAS_ACCESS: | |
633 case MEAS_TRANSFER: | |
634 { | |
635 switch( GET_STATE( MEAS_IM ) ) | |
636 { | |
637 case MEAS_IM_START: | |
638 { | |
639 meas_im_stop_idle( ); | |
640 | |
641 grr_data->meas_im.trig_signal = IM_TRIG_SIGNAL_PAUSE; | |
642 | |
643 SET_STATE( MEAS_IM, MEAS_IM_STOP_REQ ); | |
644 } | |
645 break; | |
646 | |
647 default: | |
648 /* do nothing */ | |
649 break; | |
650 } | |
651 } | |
652 break; | |
653 | |
654 default: | |
655 /* do nothing */ | |
656 break; | |
657 } | |
658 | |
659 /* process the extended measurement service */ | |
660 switch( GET_STATE( MEAS ) ) | |
661 { | |
662 case MEAS_IDLE: | |
663 case MEAS_ACCESS: | |
664 case MEAS_TRANSFER: | |
665 SET_STATE( MEAS_EM, MEAS_EM_SUSPEND ); | |
666 | |
667 meas_em_process_t3178( ); | |
668 break; | |
669 | |
670 default: | |
671 /* do nothing */ | |
672 break; | |
673 } | |
674 } /* sig_ctrl_meas_suspend() */ | |
675 | |
676 /* | |
677 +------------------------------------------------------------------------------ | |
678 | Function : sig_ctrl_meas_resume | |
679 +------------------------------------------------------------------------------ | |
680 | Description : Handles the internal signal SIG_CTRL_MEAS_RESUME | |
681 | This signal resumes the measurement service | |
682 | Parameters : void | |
683 | | |
684 +------------------------------------------------------------------------------ | |
685 */ | |
686 GLOBAL void sig_ctrl_meas_resume ( void ) | |
687 { | |
688 TRACE_ISIG( "sig_ctrl_meas_resume" ); | |
689 | |
690 /* process the interference measurement service */ | |
691 switch( GET_STATE( MEAS ) ) | |
692 { | |
693 case MEAS_IDLE: | |
694 case MEAS_ACCESS: | |
695 case MEAS_TRANSFER: | |
696 if ( grr_data->meas_im.mode EQ IM_MODE_IDLE_TRANSFER OR | |
697 grr_data->meas_im.mode EQ IM_MODE_IDLE ) | |
698 { | |
699 if( meas_im_start_idle( ) ) | |
700 { | |
701 SET_STATE( MEAS_IM, MEAS_IM_START ); | |
702 } | |
703 else | |
704 { | |
705 SET_STATE( MEAS_IM, MEAS_IM_NULL ); | |
706 } | |
707 break; | |
708 } | |
709 break; | |
710 | |
711 default: | |
712 /* do nothing */ | |
713 break; | |
714 } | |
715 | |
716 /* process the extended measurement service */ | |
717 switch( GET_STATE( MEAS ) ) | |
718 { | |
719 case MEAS_IDLE: | |
720 case MEAS_ACCESS: | |
721 case MEAS_TRANSFER: | |
722 SET_STATE( MEAS_EM, MEAS_EM_NULL ); | |
723 | |
724 meas_em_process_t3178( ); | |
725 break; | |
726 | |
727 default: | |
728 /* do nothing */ | |
729 break; | |
730 } | |
731 | |
732 } /* sig_ctrl_meas_resume() */ | |
733 | |
734 /* | |
735 +------------------------------------------------------------------------------ | |
736 | Function : sig_ctrl_meas_pim | |
737 +------------------------------------------------------------------------------ | |
738 | Description : Handles the internal signal SIG_CTRL_MEAS_PIM | |
739 | | |
740 | Parameters : dummy - description of parameter dummy | |
741 | | |
742 +------------------------------------------------------------------------------ | |
743 */ | |
744 GLOBAL void sig_ctrl_meas_pim ( void ) | |
745 { | |
746 UBYTE state = GET_STATE( MEAS ); | |
747 | |
748 TRACE_ISIG( "sig_ctrl_meas_pim" ); | |
749 | |
750 /* process the interference measurement service */ | |
751 switch( state ) | |
752 { | |
753 case MEAS_TRANSFER: | |
754 meas_im_state_changed( MEAS_IDLE ); | |
755 | |
756 /*lint -fallthrough*/ | |
757 | |
758 case MEAS_ACCESS: | |
759 meas_im_stop_trns( ); | |
760 SET_STATE( MEAS_IM, MEAS_IM_NULL ); | |
761 if ( grr_data->meas_im.mode EQ IM_MODE_IDLE_TRANSFER OR | |
762 grr_data->meas_im.mode EQ IM_MODE_IDLE ) | |
763 { | |
764 meas_im_prepare_idle( ); | |
765 | |
766 if( meas_im_start_idle( ) ) | |
767 { | |
768 SET_STATE( MEAS_IM, MEAS_IM_START ); | |
769 } | |
770 } | |
771 break; | |
772 | |
773 default: | |
774 /* do nothing */ | |
775 break; | |
776 } | |
777 | |
778 /* process the extended measurement service */ | |
779 switch( state ) | |
780 { | |
781 case MEAS_ACCESS: | |
782 case MEAS_TRANSFER: | |
783 { | |
784 if( GET_STATE( MEAS_EM ) EQ MEAS_EM_PENDING ) | |
785 { | |
786 meas_em_start( ); | |
787 SET_STATE( MEAS_EM, MEAS_EM_REP_REQ ); | |
788 } | |
789 } | |
790 break; | |
791 | |
792 default: | |
793 /* do nothing */ | |
794 break; | |
795 } | |
796 | |
797 /* process the signal quality service */ | |
798 if( state EQ MEAS_TRANSFER ) | |
799 { | |
800 RX_SetRxQual( RX_QUAL_UNAVAILABLE ); | |
801 } | |
802 | |
803 SET_STATE( MEAS, MEAS_IDLE ); | |
804 | |
805 } /* sig_ctrl_meas_pim() */ | |
806 | |
807 /* | |
808 +------------------------------------------------------------------------------ | |
809 | Function : sig_ctrl_meas_pam | |
810 +------------------------------------------------------------------------------ | |
811 | Description : Handles the internal signal SIG_CTRL_MEAS_PAM | |
812 | | |
813 | Parameters : dummy - description of parameter dummy | |
814 | | |
815 +------------------------------------------------------------------------------ | |
816 */ | |
817 GLOBAL void sig_ctrl_meas_pam ( void ) | |
818 { | |
819 UBYTE state = GET_STATE( MEAS ); | |
820 | |
821 TRACE_ISIG( "sig_ctrl_meas_pam" ); | |
822 | |
823 /* process the interference measurement service */ | |
824 switch( state ) | |
825 { | |
826 case MEAS_IDLE: | |
827 { | |
828 switch( GET_STATE( MEAS_IM ) ) | |
829 { | |
830 case MEAS_IM_START: | |
831 { | |
832 meas_im_stop_idle( ); | |
833 | |
834 grr_data->meas_im.trig_signal = IM_TRIG_SIGNAL_PAM; | |
835 | |
836 SET_STATE( MEAS_IM, MEAS_IM_STOP_REQ ); | |
837 } | |
838 break; | |
839 | |
840 case MEAS_IM_NULL: | |
841 { | |
842 if ( grr_data->meas_im.mode EQ IM_MODE_IDLE_TRANSFER OR | |
843 grr_data->meas_im.mode EQ IM_MODE_TRANSFER ) | |
844 { | |
845 meas_im_prepare_trns( ); | |
846 meas_im_start_trns( ); | |
847 | |
848 SET_STATE( MEAS_IM, MEAS_IM_START ); | |
849 } | |
850 } | |
851 break; | |
852 | |
853 default: | |
854 TRACE_ERROR( "SIG_CTRL_MEAS_PAM unexpected" ); | |
855 break; | |
856 } | |
857 } | |
858 break; | |
859 | |
860 case MEAS_TRANSFER: | |
861 meas_im_state_changed( MEAS_ACCESS ); | |
862 break; | |
863 | |
864 default: | |
865 /* do nothing */ | |
866 break; | |
867 } | |
868 | |
869 | |
870 /* process the extended measurement service */ | |
871 switch( state ) | |
872 { | |
873 case MEAS_IDLE: | |
874 { | |
875 switch( GET_STATE( MEAS_EM ) ) | |
876 { | |
877 case MEAS_EM_REP_REQ: | |
878 meas_em_stop_req( ); | |
879 SET_STATE( MEAS_EM, MEAS_EM_PENDING ); | |
880 break; | |
881 | |
882 default: | |
883 /* do nothing */ | |
884 break; | |
885 } | |
886 } | |
887 break; | |
888 | |
889 default: | |
890 TRACE_ERROR( "SIG_CTRL_MEAS_PAM unexpected, EXT MEAS 2" ); | |
891 break; | |
892 } | |
893 | |
894 /* process the signal quality service */ | |
895 if( state EQ MEAS_TRANSFER ) | |
896 { | |
897 RX_SetRxQual( RX_QUAL_UNAVAILABLE ); | |
898 } | |
899 | |
900 SET_STATE( MEAS, MEAS_ACCESS ); | |
901 | |
902 } /* sig_ctrl_meas_pam() */ | |
903 | |
904 /* | |
905 +------------------------------------------------------------------------------ | |
906 | Function : sig_ctrl_meas_ptm | |
907 +------------------------------------------------------------------------------ | |
908 | Description : Handles the internal signal SIG_CTRL_MEAS_PTM | |
909 | | |
910 | Parameters : void | |
911 | | |
912 +------------------------------------------------------------------------------ | |
913 */ | |
914 GLOBAL void sig_ctrl_meas_ptm ( void ) | |
915 { | |
916 TRACE_ISIG( "sig_ctrl_meas_ptm" ); | |
917 | |
918 switch( GET_STATE( MEAS ) ) | |
919 { | |
920 case MEAS_IDLE: | |
921 case MEAS_ACCESS: | |
922 meas_im_state_changed( MEAS_TRANSFER ); | |
923 break; | |
924 | |
925 default: | |
926 /* do nothing */ | |
927 break; | |
928 } | |
929 | |
930 SET_STATE( MEAS, MEAS_TRANSFER ); | |
931 | |
932 } /* sig_ctrl_meas_ptm() */ | |
933 | |
934 /* | |
935 +------------------------------------------------------------------------------ | |
936 | Function : sig_ctrl_meas_int_list_invalid | |
937 +------------------------------------------------------------------------------ | |
938 | Description : Handles the internal signal SIG_CTRL_MEAS_INT_LIST_INVALID | |
939 | If this signal is received then the list for interfrence | |
940 | measurements are invalid | |
941 | and interference measurements shall be stopped, if running | |
942 | Parameters : void | |
943 | | |
944 +------------------------------------------------------------------------------ | |
945 */ | |
946 GLOBAL void sig_ctrl_meas_int_list_invalid ( void ) | |
947 { | |
948 TRACE_ISIG( "sig_ctrl_meas_int_list_invalid" ); | |
949 | |
950 meas_prepare_and_stop_idle( ); | |
951 } /* sig_ctrl_meas_int_list_invalid() */ | |
952 | |
953 /* | |
954 +------------------------------------------------------------------------------ | |
955 | Function : sig_ctrl_meas_int_list_valid | |
956 +------------------------------------------------------------------------------ | |
957 | Description : Handles the internal signal SIG_CTRL_MEAS_INT_LIST_VALID | |
958 | If this signal is received then the list for interfrence | |
959 | measurements are valid | |
960 | and interference measurements could be started, refreshed etc. | |
961 | Parameters : void | |
962 | | |
963 +------------------------------------------------------------------------------ | |
964 */ | |
965 GLOBAL void sig_ctrl_meas_int_list_valid ( void ) | |
966 { | |
967 TRACE_ISIG( "sig_ctrl_meas_int_list_valid" ); | |
968 | |
969 meas_prepare_and_start_idle( ); | |
970 | |
971 } /* sig_ctrl_meas_int_list_valid() */ | |
972 | |
973 /* | |
974 +------------------------------------------------------------------------------ | |
975 | Function : sig_ctrl_meas_ext_invalid_psi5 | |
976 +------------------------------------------------------------------------------ | |
977 | Description : Handles the internal signal SIG_CTRL_MEAS_EXT_INVALID_PSI5 | |
978 | If this signal is received then the list for extended | |
979 | measurements are invalid | |
980 | and interference measurements could be stopped, if already running | |
981 | Parameters : void | |
982 | | |
983 +------------------------------------------------------------------------------ | |
984 */ | |
985 GLOBAL void sig_ctrl_meas_ext_invalid_psi5 ( void ) | |
986 { | |
987 TRACE_ISIG( "sig_ctrl_meas_ext_invalid_psi5" ); | |
988 | |
989 switch( GET_STATE( MEAS ) ) | |
990 { | |
991 case MEAS_NULL: | |
992 case MEAS_IDLE: | |
993 case MEAS_ACCESS: | |
994 case MEAS_TRANSFER: | |
995 if( !meas_em_is_valid_pmo_present( ) ) | |
996 { | |
997 meas_em_valid_psi5( ); | |
998 | |
999 switch( GET_STATE( MEAS_EM ) ) | |
1000 { | |
1001 case MEAS_EM_REP_REQ: | |
1002 meas_em_stop_req( ); | |
1003 break; | |
1004 | |
1005 default: | |
1006 SET_STATE( MEAS_EM, MEAS_NULL ); | |
1007 break; | |
1008 } | |
1009 } | |
1010 break; | |
1011 | |
1012 default: | |
1013 TRACE_ERROR( "SIG_CTRL_MEAS_EXT_INVALID_PSI5 unexpected" ); | |
1014 break; | |
1015 } | |
1016 } /* sig_ctrl_meas_ext_invalid_psi5() */ | |
1017 | |
1018 /* | |
1019 +------------------------------------------------------------------------------ | |
1020 | Function : sig_ctrl_meas_ext_valid_psi5 | |
1021 +------------------------------------------------------------------------------ | |
1022 | Description : Handles the internal signal SIG_CTRL_MEAS_EXT_VALID_PSI5 | |
1023 | If this signal is received then the list for extended | |
1024 | measurements are valid | |
1025 | and interference measurements could performed | |
1026 | Parameters : void | |
1027 | | |
1028 +------------------------------------------------------------------------------ | |
1029 */ | |
1030 GLOBAL void sig_ctrl_meas_ext_valid_psi5 ( void ) | |
1031 { | |
1032 TRACE_ISIG( "sig_ctrl_meas_ext_valid_psi5" ); | |
1033 | |
1034 | |
1035 switch( GET_STATE( MEAS ) ) | |
1036 { | |
1037 case MEAS_IDLE: | |
1038 if( !meas_em_is_valid_pmo_present( ) ) | |
1039 { | |
1040 switch( GET_STATE( MEAS_EM ) ) | |
1041 { | |
1042 case MEAS_EM_REP_REQ: | |
1043 meas_em_stop_req( ); | |
1044 | |
1045 /*lint -fallthrough*/ | |
1046 | |
1047 case MEAS_EM_NULL: | |
1048 meas_em_valid_psi5( ); | |
1049 meas_em_process_t3178( ); | |
1050 break; | |
1051 default: | |
1052 TRACE_ERROR( "SIG_CTRL_MEAS_EXT_VALID_PSI5 unexpected 1" ); | |
1053 break; | |
1054 } | |
1055 } | |
1056 break; | |
1057 | |
1058 case MEAS_NULL: | |
1059 case MEAS_ACCESS: | |
1060 case MEAS_TRANSFER: | |
1061 if( !meas_em_is_valid_pmo_present( ) ) | |
1062 { | |
1063 /* measurement report parameters of PSI5 shall only be taken into */ | |
1064 /* account in case there is no individually parameter set send to */ | |
1065 /* the MS using a Packet Measurement Order message */ | |
1066 meas_em_valid_psi5( ); | |
1067 meas_em_process_t3178( ); | |
1068 } | |
1069 break; | |
1070 | |
1071 default: | |
1072 TRACE_ERROR( "SIG_CTRL_MEAS_EXT_VALID_PSI5 unexpected 2" ); | |
1073 break; | |
1074 } | |
1075 | |
1076 } /* sig_ctrl_meas_ext_valid_psi5() */ | |
1077 | |
1078 /* | |
1079 +------------------------------------------------------------------------------ | |
1080 | Function : sig_cs_meas_start | |
1081 +------------------------------------------------------------------------------ | |
1082 | Description : Handles the internal signal SIG_CS_MEAS_START | |
1083 | Parameters : void | |
1084 | | |
1085 +------------------------------------------------------------------------------ | |
1086 */ | |
1087 GLOBAL void sig_cs_meas_start ( void ) | |
1088 { | |
1089 TRACE_ISIG( "sig_cs_meas_start" ); | |
1090 | |
1091 grr_data->meas_im.v_cs_meas_active = TRUE; | |
1092 | |
1093 meas_prepare_and_start_idle( ); | |
1094 | |
1095 } /* sig_cs_meas_start() */ | |
1096 | |
1097 /* | |
1098 +------------------------------------------------------------------------------ | |
1099 | Function : sig_cs_meas_stop | |
1100 +------------------------------------------------------------------------------ | |
1101 | Description : Handles the internal signal SIG_CS_MEAS_STOP | |
1102 | Parameters : void | |
1103 | | |
1104 +------------------------------------------------------------------------------ | |
1105 */ | |
1106 GLOBAL void sig_cs_meas_stop ( void ) | |
1107 { | |
1108 TRACE_ISIG( "sig_cs_meas_stop" ); | |
1109 | |
1110 grr_data->meas_im.v_cs_meas_active = FALSE; | |
1111 | |
1112 meas_prepare_and_stop_idle( ); | |
1113 | |
1114 } /* sig_cs_meas_stop() */ | |
1115 | |
1116 /* | |
1117 +------------------------------------------------------------------------------ | |
1118 | Function : sig_ctrl_meas_pmr_accept | |
1119 +------------------------------------------------------------------------------ | |
1120 | Description : Handles the internal signal SIG_CTRL_MEAS_PMR_ACCEPT | |
1121 | Parameters : void | |
1122 | | |
1123 +------------------------------------------------------------------------------ | |
1124 */ | |
1125 GLOBAL void sig_ctrl_meas_pmr_accept ( void ) | |
1126 { | |
1127 TRACE_ISIG( "sig_ctrl_meas_pmr_accept" ); | |
1128 | |
1129 switch( GET_STATE( MEAS_EM ) ) | |
1130 { | |
1131 case( MEAS_EM_PMR_SENDING ): | |
1132 if( meas_em_send_meas_rpt( FALSE ) EQ FALSE ) | |
1133 { | |
1134 SET_STATE( MEAS_EM, MEAS_EM_NULL ); | |
1135 | |
1136 meas_em_process_t3178( ); | |
1137 } | |
1138 break; | |
1139 | |
1140 default: | |
1141 TRACE_ERROR( "SIG_CTRL_MEAS_PMR_ACCEPT unexpected" ); | |
1142 break; | |
1143 } | |
1144 | |
1145 } /* sig_ctrl_meas_pmr_accept() */ | |
1146 | |
1147 /* | |
1148 +------------------------------------------------------------------------------ | |
1149 | Function : sig_ctrl_meas_pmr_reject | |
1150 +------------------------------------------------------------------------------ | |
1151 | Description : Handles the internal signal SIG_CTRL_MEAS_PMR_REJECT | |
1152 | Parameters : void | |
1153 | | |
1154 +------------------------------------------------------------------------------ | |
1155 */ | |
1156 GLOBAL void sig_ctrl_meas_pmr_reject ( void ) | |
1157 { | |
1158 TRACE_ISIG( "sig_ctrl_meas_pmr_reject" ); | |
1159 | |
1160 switch( GET_STATE( MEAS_EM ) ) | |
1161 { | |
1162 case( MEAS_EM_PMR_SENDING ): | |
1163 SET_STATE( MEAS_EM, MEAS_EM_NULL ); | |
1164 | |
1165 meas_em_process_t3178( ); | |
1166 break; | |
1167 | |
1168 default: | |
1169 TRACE_ERROR( "SIG_CTRL_MEAS_PMR_REJECT unexpected" ); | |
1170 break; | |
1171 } | |
1172 | |
1173 } /* sig_ctrl_meas_pmr_reject() */ | |
1174 | |
1175 /* | |
1176 +------------------------------------------------------------------------------ | |
1177 | Function : sig_ctrl_meas_ext_meas_cnf | |
1178 +------------------------------------------------------------------------------ | |
1179 | Description : ... | |
1180 | | |
1181 | Parameters : ... | |
1182 | | |
1183 +------------------------------------------------------------------------------ | |
1184 */ | |
1185 GLOBAL void sig_ctrl_meas_ext_meas_cnf | |
1186 ( T_RRGRR_EXT_MEAS_CNF *rrgrr_ext_meas_cnf ) | |
1187 { | |
1188 TRACE_ISIG( "sig_ctrl_meas_ext_meas_cnf" ); | |
1189 | |
1190 switch( GET_STATE( MEAS ) ) | |
1191 { | |
1192 case MEAS_IDLE: | |
1193 case MEAS_ACCESS: | |
1194 case MEAS_TRANSFER: | |
1195 switch( GET_STATE( MEAS_EM ) ) | |
1196 { | |
1197 case( MEAS_EM_REP_REQ ): | |
1198 if( meas_em_store_rslt( rrgrr_ext_meas_cnf ) EQ TRUE ) | |
1199 { | |
1200 SET_STATE( MEAS_EM, MEAS_EM_PMR_SENDING ); | |
1201 | |
1202 if( meas_em_send_meas_rpt( TRUE ) EQ FALSE ) | |
1203 { | |
1204 /* | |
1205 * The additional state check is necessary because signals | |
1206 * might be send during the processing of the function | |
1207 * meas_em_send_meas_rpt. | |
1208 */ | |
1209 if( GET_STATE( MEAS_EM ) EQ MEAS_EM_PMR_SENDING ) | |
1210 { | |
1211 SET_STATE( MEAS_EM, MEAS_NULL ); | |
1212 | |
1213 meas_em_process_t3178( ); | |
1214 } | |
1215 } | |
1216 } | |
1217 else | |
1218 { | |
1219 SET_STATE( MEAS_EM, MEAS_NULL ); | |
1220 | |
1221 meas_em_process_t3178( ); | |
1222 } | |
1223 break; | |
1224 | |
1225 default: | |
1226 TRACE_EVENT( "SIG_CTRL_MEAS_EXT_MEAS_CNF unexpected 1" ); | |
1227 break; | |
1228 } | |
1229 break; | |
1230 | |
1231 default: | |
1232 TRACE_EVENT( "SIG_CTRL_MEAS_EXT_MEAS_CNF unexpected 2" ); | |
1233 break; | |
1234 } | |
1235 } /* sig_ctrl_meas_ext_meas_cnf() */ | |
1236 | |
1237 | |
1238 | |
1239 /* | |
1240 +------------------------------------------------------------------------------ | |
1241 | Function : sig_gfp_meas_order | |
1242 +------------------------------------------------------------------------------ | |
1243 | Description : Handles the signal SIG_GFP_MEAS_ORDER | |
1244 | | |
1245 | Parameters : - | |
1246 | | |
1247 +------------------------------------------------------------------------------ | |
1248 */ | |
1249 GLOBAL void sig_gfp_meas_order ( void ) | |
1250 { | |
1251 MCAST( d_meas_order, D_MEAS_ORDER ); | |
1252 TRACE_ISIG( "sig_gfp_meas_order" ); | |
1253 | |
1254 if (grr_data->nc2_on) | |
1255 { | |
1256 meas_p_meas_order_ind(d_meas_order); | |
1257 } | |
1258 else | |
1259 { | |
1260 TRACE_EVENT( "PACKET MEASUREMENT ORDER RECEIVED,but NC2 is deactivated" ); | |
1261 } | |
1262 | |
1263 | |
1264 } /* sig_gfp_meas_order() */ | |
1265 | |
1266 | |
1267 | |
1268 /* | |
1269 +------------------------------------------------------------------------------ | |
1270 | Function : sig_gfp_meas_int_meas_stop_con | |
1271 +------------------------------------------------------------------------------ | |
1272 | Description : Handles the signal SIG_GFP_MEAS_INT_MEAS_STOP_CON | |
1273 | | |
1274 | Parameters : *dummy - Ptr to primitive payload | |
1275 | | |
1276 +------------------------------------------------------------------------------ | |
1277 */ | |
1278 GLOBAL void sig_gfp_meas_int_meas_stop_con ( T_MPHP_INT_MEAS_STOP_CON * dummy ) | |
1279 { | |
1280 TRACE_ISIG( "sig_gfp_meas_int_meas_stop_con" ); | |
1281 | |
1282 switch( GET_STATE( MEAS ) ) | |
1283 { | |
1284 case MEAS_NULL: | |
1285 case MEAS_IDLE: | |
1286 case MEAS_ACCESS: | |
1287 case MEAS_TRANSFER: | |
1288 { | |
1289 switch( GET_STATE( MEAS_IM ) ) | |
1290 { | |
1291 case MEAS_IM_STOP_REQ: | |
1292 { | |
1293 if( grr_data->meas_im.trig_signal EQ IM_TRIG_SIGNAL_PAM ) | |
1294 { | |
1295 meas_im_prepare_trns( ); | |
1296 } | |
1297 | |
1298 SET_STATE( MEAS_IM, MEAS_IM_NULL ); | |
1299 | |
1300 grr_data->meas_im.trig_signal = IM_TRIG_SIGNAL_NULL; | |
1301 } | |
1302 break; | |
1303 | |
1304 default: | |
1305 TRACE_ERROR( "SIG_GFP_MEAS_INT_MEAS_STOP_CON unexpected 1" ); | |
1306 break; | |
1307 } | |
1308 } | |
1309 break; | |
1310 | |
1311 default: | |
1312 TRACE_ERROR( "SIG_GFP_MEAS_INT_MEAS_STOP_CON unexpected 2" ); | |
1313 break; | |
1314 } | |
1315 | |
1316 } /* sig_gfp_meas_int_meas_stop_con() */ | |
1317 | |
1318 /* | |
1319 +------------------------------------------------------------------------------ | |
1320 | Function : sig_gfp_meas_int_meas_ind | |
1321 +------------------------------------------------------------------------------ | |
1322 | Description : Handles the signal sig_gfp_meas_int_meas_ind | |
1323 | | |
1324 | Parameters : *mphp_int_meas_ind - Ptr to primitive payload | |
1325 | | |
1326 +------------------------------------------------------------------------------ | |
1327 */ | |
1328 GLOBAL void sig_gfp_meas_int_meas_ind ( T_MPHP_INT_MEAS_IND *mphp_int_meas_ind ) | |
1329 { | |
1330 UBYTE state = GET_STATE( MEAS ); | |
1331 | |
1332 TRACE_ISIG( "sig_gfp_meas_int_meas_ind" ); | |
1333 | |
1334 switch( state ) | |
1335 { | |
1336 case MEAS_ACCESS: | |
1337 case MEAS_TRANSFER: | |
1338 meas_im_new_value( mphp_int_meas_ind, state ); | |
1339 break; | |
1340 | |
1341 case MEAS_IDLE: | |
1342 { | |
1343 switch( GET_STATE( MEAS_IM ) ) | |
1344 { | |
1345 case MEAS_IM_START: | |
1346 meas_im_new_value( mphp_int_meas_ind, state ); | |
1347 break; | |
1348 | |
1349 case MEAS_IM_STOP_REQ: | |
1350 /* do nothing */ | |
1351 break; | |
1352 | |
1353 default: | |
1354 TRACE_ERROR( "SIG_GFP_MEAS_INT_MEAS_IND unexpected 1" ); | |
1355 break; | |
1356 } | |
1357 } | |
1358 break; | |
1359 | |
1360 default: | |
1361 TRACE_ERROR( "SIG_GFP_MEAS_INT_MEAS_IND unexpected 2" ); | |
1362 break; | |
1363 } | |
1364 } /* sig_gfp_meas_int_meas_ind() */ | |
1365 | |
1366 #if !defined (NTRACE) | |
1367 | |
1368 /* | |
1369 +------------------------------------------------------------------------------ | |
1370 | Function : meas_im_trace_i_level | |
1371 +------------------------------------------------------------------------------ | |
1372 | Description : | |
1373 | | |
1374 | Parameters : | |
1375 | | |
1376 +------------------------------------------------------------------------------ | |
1377 */ | |
1378 LOCAL void meas_im_trace_i_level( T_MEAS_IM_FILTER *filter, | |
1379 T_ilev *i_level ) | |
1380 { | |
1381 TRACE_ISIG( "meas_im_trace_i_level" ); | |
1382 | |
1383 if( grr_data->meas_im.n_im_trace & M_IM_TRACE_OUTPUT_VALUE ) | |
1384 { | |
1385 if( filter NEQ NULL ) | |
1386 { | |
1387 TRACE_EVENT_P8( "meas_im_trace_i_level: %02X %02X %02X %02X %02X %02X %02X %02X", | |
1388 i_level->ilev0, i_level->ilev1, i_level->ilev2, | |
1389 i_level->ilev3, i_level->ilev4, i_level->ilev5, | |
1390 i_level->ilev6, i_level->ilev7 ); | |
1391 } | |
1392 else | |
1393 { | |
1394 TRACE_EVENT( "meas_im_trace_i_level: filter EQ NULL" ); | |
1395 } | |
1396 } | |
1397 } /* meas_im_trace_i_level() */ | |
1398 | |
1399 #endif /* #if !defined (NTRACE) */ | |
1400 | |
1401 /* | |
1402 +------------------------------------------------------------------------------ | |
1403 | Function : sig_ctrl_meas_ba_changed | |
1404 +------------------------------------------------------------------------------ | |
1405 | Description : Handles the signal SIG_CTRL_MEAS_BA_CHANGED | |
1406 | | |
1407 | Parameters : | |
1408 | | |
1409 +------------------------------------------------------------------------------ | |
1410 */ | |
1411 GLOBAL void sig_ctrl_meas_ba_changed ( void ) | |
1412 { | |
1413 TRACE_ISIG( "sig_ctrl_meas_ba_changed" ); | |
1414 | |
1415 switch( GET_STATE( MEAS ) ) | |
1416 { | |
1417 case MEAS_IDLE: | |
1418 case MEAS_ACCESS: | |
1419 case MEAS_TRANSFER: | |
1420 psc_db->nc_ms.ncmeas.list.number = 0; | |
1421 psc_db->nc_ms.rfreq.number = 0; | |
1422 | |
1423 psc_db->nc_ms.ncmeas.list.chng_mrk.curr++; | |
1424 break; | |
1425 | |
1426 default: | |
1427 TRACE_ERROR( "SIG_CTRL_MEAS_BA_CHANGED unexpected" ); | |
1428 break; | |
1429 } | |
1430 } /* sig_ctrl_meas_ba_changed() */ | |
1431 | |
1432 /* | |
1433 +------------------------------------------------------------------------------ | |
1434 | Function : sig_gfp_meas_rxlev_pccch_ind | |
1435 +------------------------------------------------------------------------------ | |
1436 | Description : Handles the signal SIG_GFP_MEAS_RXLEV_PCCCH_IND | |
1437 | | |
1438 | Parameters : pccch_lev - signal level received on pccch | |
1439 | | |
1440 +------------------------------------------------------------------------------ | |
1441 */ | |
1442 GLOBAL void sig_gfp_meas_rxlev_pccch_ind( UBYTE pccch_lev ) | |
1443 { | |
1444 TRACE_ISIG( "sig_gfp_meas_rxlev_pccch_ind" ); | |
1445 | |
1446 switch( GET_STATE( MEAS ) ) | |
1447 { | |
1448 case MEAS_IDLE: | |
1449 case MEAS_ACCESS: | |
1450 meas_c_val_update_pim( pccch_lev ); | |
1451 grr_cgrlc_pwr_ctrl_req( TRUE ); | |
1452 break; | |
1453 | |
1454 default: | |
1455 TRACE_ERROR( "SIG_GFP_MEAS_RXLEV_PCCCH_IND unexpected" ); | |
1456 break; | |
1457 } | |
1458 } /* sig_gfp_meas_rxlev_pccch_ind() */ | |
1459 | |
1460 /* | |
1461 +------------------------------------------------------------------------------ | |
1462 | Function : sig_gfp_meas_ctrl_pwr_ta_ptm | |
1463 +------------------------------------------------------------------------------ | |
1464 | Description : Handles the signal SIG_GFP_MEAS_CTRL_PWR_TA_PTM | |
1465 | | |
1466 | Parameters : - | |
1467 | | |
1468 +------------------------------------------------------------------------------ | |
1469 */ | |
1470 GLOBAL void sig_gfp_meas_ctrl_pwr_ta_ptm ( void ) | |
1471 { | |
1472 MCAST( d_ctrl_pwr_ta, D_CTRL_PWR_TA ); | |
1473 | |
1474 TRACE_ISIG( "sig_gfp_meas_ctrl_pwr_ta_ptm" ); | |
1475 | |
1476 switch( GET_STATE( MEAS ) ) | |
1477 { | |
1478 case MEAS_TRANSFER: | |
1479 if( d_ctrl_pwr_ta->v_gpta ) | |
1480 { | |
1481 sig_meas_tc_update_ta_req( ); | |
1482 } | |
1483 | |
1484 { | |
1485 UBYTE pb; | |
1486 | |
1487 pb = psc_db->g_pwr_par.pb; | |
1488 | |
1489 meas_handle_pwr_par( ); | |
1490 | |
1491 if( pb NEQ psc_db->g_pwr_par.pb ) | |
1492 { | |
1493 grr_update_pacch(); | |
1494 } | |
1495 } | |
1496 break; | |
1497 | |
1498 default: | |
1499 TRACE_ERROR( "SIG_GFP_MEAS_CTRL_PWR_TA_PTM unexpected" ); | |
1500 break; | |
1501 } | |
1502 } /* sig_gfp_meas_ctrl_pwr_ta_ptm() */ | |
1503 | |
1504 /* | |
1505 +------------------------------------------------------------------------------ | |
1506 | Function : sig_tc_meas_update_pch | |
1507 +------------------------------------------------------------------------------ | |
1508 | Description : ... | |
1509 | | |
1510 | Parameters : ... | |
1511 | | |
1512 +------------------------------------------------------------------------------ | |
1513 */ | |
1514 GLOBAL void sig_tc_meas_update_pch ( void ) | |
1515 { | |
1516 TRACE_ISIG( "sig_tc_meas_update_pch" ); | |
1517 | |
1518 grr_cgrlc_pwr_ctrl_req( FALSE ); | |
1519 | |
1520 } /* sig_tc_meas_update_pch() */ | |
1521 | |
1522 /* | |
1523 +------------------------------------------------------------------------------ | |
1524 | Function : meas_c_get_value | |
1525 +------------------------------------------------------------------------------ | |
1526 | Description : This function returns the current C value. | |
1527 | | |
1528 | Parameters : void | |
1529 | | |
1530 +------------------------------------------------------------------------------ | |
1531 */ | |
1532 GLOBAL UBYTE meas_c_get_value ( void ) | |
1533 { | |
1534 UBYTE c_value; | |
1535 | |
1536 TRACE_FUNCTION( "meas_c_get_value" ); | |
1537 | |
1538 if( grr_data->meas.c_filter.index > 0 ) | |
1539 { | |
1540 c_value = ( M_ROUND_UP( grr_data->meas.c_filter.value, MEAS_ACRCY ) ); | |
1541 } | |
1542 else | |
1543 { | |
1544 | |
1545 #ifdef _SIMULATION_ | |
1546 | |
1547 TRACE_ERROR( "meas_c_get_value: grr_data->meas.c_filter.index EQ 0" ); | |
1548 | |
1549 #endif /* #ifdef _SIMULATION_ */ | |
1550 | |
1551 c_value = C_VALUE_DEFAULT; | |
1552 } | |
1553 | |
1554 return( c_value ); | |
1555 | |
1556 } /* meas_c_get_value() */ | |
1557 | |
1558 /* | |
1559 +------------------------------------------------------------------------------ | |
1560 | Function : meas_c_get_c_value | |
1561 +------------------------------------------------------------------------------ | |
1562 | Description : | |
1563 | | |
1564 | Parameters : | |
1565 | | |
1566 +------------------------------------------------------------------------------ | |
1567 */ | |
1568 GLOBAL void meas_c_get_c_value ( T_CGRLC_c_value *c_value ) | |
1569 { | |
1570 TRACE_FUNCTION( "meas_c_get_c_value" ); | |
1571 | |
1572 c_value->c_acrcy = MEAS_ACRCY; | |
1573 c_value->c_lev = grr_data->meas.c_filter.value; | |
1574 c_value->c_idx = grr_data->meas.c_filter.index; | |
1575 | |
1576 } /* meas_c_get_c_value() */ | |
1577 | |
1578 /* | |
1579 +------------------------------------------------------------------------------ | |
1580 | Function : meas_c_set_c_value | |
1581 +------------------------------------------------------------------------------ | |
1582 | Description : | |
1583 | | |
1584 | Parameters : | |
1585 | | |
1586 +------------------------------------------------------------------------------ | |
1587 */ | |
1588 GLOBAL void meas_c_set_c_value ( T_CGRLC_c_value *c_value ) | |
1589 { | |
1590 TRACE_FUNCTION( "meas_c_set_c_value" ); | |
1591 | |
1592 grr_data->meas.c_filter.value = ( c_value->c_lev * MEAS_ACRCY ) / | |
1593 c_value->c_acrcy; | |
1594 | |
1595 grr_data->meas.c_filter.index = c_value->c_idx; | |
1596 | |
1597 } /* meas_c_set_c_value() */ |