comparison src/g23m-gprs/grr/grr_tcp.c @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
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 primitive handler functions for service
18 | TC of entity GRR.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef GRR_TCP_C
23 #define GRR_TCP_C
24 #endif
25
26 #define ENTITY_GRR
27
28 /*==== INCLUDES =============================================================*/
29
30 #include "typedefs.h" /* to get Condat data types */
31 #include "vsi.h" /* to get a lot of macros */
32 #include <string.h>
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" /* to get air message definitions */
41 #include "grr.h" /* to get the global entity definitions */
42 #include "grr_f.h" /* to get the grr global function definitions */
43 #include "grr_tcf.h" /* to get the service TC functions definitions */
44 #include "grr_tcs.h" /* to get the service TC functions definitions */
45 #include "grr_ctrls.h" /* to get the service CTRL signal definitions */
46 #include "grr_cpaps.h" /* to get the service CPAP signal definitions */
47 #include "grr_meass.h"
48
49 /*==== CONST ================================================================*/
50
51 /*==== DIAGNOSTICS ==========================================================*/
52
53 /*==== LOCAL VARS ===========================================================*/
54
55 /*==== LOCAL TYPES ==========================================================*/
56
57 /*==== PRIVATE FUNCTIONS ====================================================*/
58
59 /*==== PUBLIC FUNCTIONS =====================================================*/
60
61
62 /*
63 +------------------------------------------------------------------------------
64 | Function : tc_t3162
65 +------------------------------------------------------------------------------
66 | Description : Handles the primitive T3162
67 |
68 | Parameters : void
69 |
70 +------------------------------------------------------------------------------
71 */
72 GLOBAL void tc_t3162 ( void )
73 {
74 TRACE_FUNCTION( "tc_t3162" );
75
76 switch( GET_STATE( TC ) )
77 {
78 case TC_WAIT_ASSIGN:
79 case TC_POLLING:
80 SET_STATE(TC,TC_PIM);
81 tc_cgrlc_ul_tbf_res(CGRLC_TBF_MODE_ACCESS_FAILED,CGRLC_PRIM_STATUS_ONE);
82 break;
83 default:
84 TRACE_ERROR( "T3162 unexpected" );
85 break;
86 }
87
88 } /* tc_t3162() */
89
90
91
92 /*
93 +------------------------------------------------------------------------------
94 | Function : tc_t3168
95 +------------------------------------------------------------------------------
96 | Description : Handles the primitive T3168
97 | This timer is involved in 3 Procedures
98 | 1) Two Phase Access Procedure
99 | 2) Uplink TBF Setup on existing Downlink TBF
100 | 3) Uplink Realloaction Procedure on existing Uplink TBF
101 |
102 | Parameters : void
103 |
104 +------------------------------------------------------------------------------
105 */
106 GLOBAL void tc_t3168 ( void )
107 {
108 TRACE_FUNCTION( "tc_t3168" );
109 /*
110 * The expiry of this timer may occure in 1 case:
111 *
112 * b) two phase access procedure
113 *
114 */
115
116 switch( GET_STATE( TC ) )
117 {
118 case TC_WAIT_2P_ASSIGN:
119 /*
120 * case b) stop for waiting assignment
121 */
122 tc_stop_normal_burst_req( );
123 if( grr_t_status( T3174 ) > 0 )
124 {
125 TRACE_ERROR( " Contention Failure on the network commanded cell: 3168 expired" );
126 grr_data->pcco_failure_cause = 1;
127 sig_tc_ctrl_access_reject_on_new_cell();
128 }
129 break;
130
131 default:
132 TRACE_ERROR( "T3168 unexpected" );
133 break;
134 }
135
136 } /* tc_t3168() */
137
138
139
140 /*
141 +------------------------------------------------------------------------------
142 | Function : tc_t3170
143 +------------------------------------------------------------------------------
144 | Description : Handles the primitive T3170
145 |
146 | Parameters : void
147 |
148 +------------------------------------------------------------------------------
149 */
150 GLOBAL void tc_t3170 ( void )
151 {
152
153 TRACE_FUNCTION( "tc_t3170" );
154
155 if(grr_t_status( T3176 ) > 0 )/*in case pcco running, t3170 should be ignored.*/
156 {
157 TRACE_EVENT("t3170 expired when t3176 is running: ignore");
158 return;
159 }
160
161 switch( GET_STATE( TC ) )
162 {
163 case TC_SINGLE_BLOCK:
164 /*
165 * MPHP_STOP_SINGLE_BLOCK_REQ was sent at receiving the packet access reject.
166 */
167 SET_STATE(TC,TC_PIM);
168 TRACE_EVENT("T3170 expired in TC_SINGLE_BLOCK");
169 tc_cgrlc_ul_tbf_res(CGRLC_TBF_MODE_ACCESS_FAILED,CGRLC_PRIM_STATUS_ONE);
170 tc_set_stop_ctrl_blk( FALSE, CGRLC_BLK_OWNER_NONE, 0 );
171 break;
172 case TC_WAIT_2P_ASSIGN:
173
174 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH
175 if(grr_data->tc.tbf_est_pacch)
176 {
177 TRACE_EVENT_P1("T3170 expired in TC_WAIT_2P_ASSIGN tbf_est_pacch = %d",grr_data->tc.tbf_est_pacch);
178 tc_handle_error_ra();
179 }
180 else
181 #endif
182 {
183 /*
184 * GMMRR_STATUS_IND will send in tc_handle_error_ra after MPHP_STOP_SINGLE_BLOCK_CON
185 */
186 TRACE_EVENT("T3170 expired in TC_WAIT_2P_ASSIGN/");
187 tc_stop_normal_burst_req( );
188 }
189 break;
190 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH
191 case TC_TBF_ACTIVE :
192 if(grr_data->tc.tbf_est_pacch)
193 {
194 TRACE_EVENT("T3170 expired in TC_TBF_ACTIVE tbf_est_pacch active");
195 tc_handle_error_ra();
196 }
197 else
198 {
199 TRACE_ERROR("T3170 expired when TC:TC_TBF_ACTIVE");
200 }
201 break;
202 #endif
203 case TC_WAIT_ASSIGN:
204 case TC_POLLING:
205 SET_STATE(TC,TC_PIM);
206 TRACE_EVENT("T3170 expired in TC_WAIT_ASSIGN//TC_POLLING");
207 tc_cgrlc_ul_tbf_res(CGRLC_TBF_MODE_ACCESS_FAILED,CGRLC_PRIM_STATUS_ONE);
208 tc_set_stop_ctrl_blk( FALSE, CGRLC_BLK_OWNER_NONE, 0 );
209 sig_tc_ctrl_set_pckt_mode( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE );
210 break;
211 default:
212 TRACE_ERROR( "T3170 unexpected" );
213 break;
214 }
215 } /* tc_t3170() */
216
217
218
219 /*
220 +------------------------------------------------------------------------------
221 | Function : tc_t3172
222 +------------------------------------------------------------------------------
223 | Description : Handles the primitive T3172
224 |
225 | Parameters : inctance_i - identifier of timer's inctance
226 |
227 +------------------------------------------------------------------------------
228 */
229 GLOBAL void tc_t3172 ( UBYTE inctance_i )
230 {
231 TRACE_EVENT( "T3172 expired" );
232
233 switch( GET_STATE( TC ) )
234 {
235 case TC_PIM:
236 tc_cgrlc_access_status_req();
237 break;
238 case TC_CPAP:
239 /*
240 * set the CPAP state to CPAP_IDLE
241 */
242 sig_tc_cpap_t3142();
243 tc_cgrlc_ul_tbf_res(CGRLC_TBF_MODE_ACCESS_FAILED,CGRLC_PRIM_STATUS_ALL);
244
245 /*
246 * Do we need to set the TC state to SET_STATE(TC, TC_PIM);??
247 */
248 SET_STATE(TC, TC_PIM);
249 break;
250 case TC_WAIT_ASSIGN:
251 case TC_POLLING:
252 SET_STATE(TC,TC_PIM);
253 vsi_t_stop(GRR_handle,T3170);
254 /*
255 * to set the states in services
256 */
257 tc_cgrlc_ul_tbf_res(CGRLC_TBF_MODE_ACCESS_FAILED,CGRLC_PRIM_STATUS_ALL);
258 sig_tc_ctrl_set_pckt_mode( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE );
259 break;
260 case TC_WAIT_2P_ASSIGN:
261 /* Donot send stop single block req as it would have got
262 * sent on 3170 expiry */
263 if(grr_t_status(T3170) > 0)
264 {
265 vsi_t_stop(GRR_handle,T3170);
266 tc_stop_normal_burst_req();
267 }
268 tc_cgrlc_ul_tbf_res(CGRLC_TBF_MODE_ACCESS_FAILED,CGRLC_PRIM_STATUS_ALL);
269 sig_tc_ctrl_set_pckt_mode( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE );
270 SET_STATE(TC,TC_PIM);
271 break;
272 case TC_CONTENTION_RESOLUTION:
273 case TC_ACCESS_DISABLED:
274 case TC_TBF_ACTIVE:
275 break;
276 default:
277 TRACE_ERROR( "T3172 unexpected" );
278 break;
279 }
280
281 } /* tc_t3172() */
282
283
284
285 /*
286 +------------------------------------------------------------------------------
287 | Function : tc_t3186
288 +------------------------------------------------------------------------------
289 | Description : Handles the primitive T3186
290 |
291 | Parameters : void
292 |
293 +------------------------------------------------------------------------------
294 */
295 GLOBAL void tc_t3186 ( void )
296 {
297 TRACE_FUNCTION( "tc_t3186" );
298 TRACE_EVENT("T3186 expired");
299
300
301 switch( GET_STATE( TC ) )
302 {
303 case TC_WAIT_ASSIGN:
304 SET_STATE(TC, TC_PIM);
305 /*
306 * stop sending packet access request
307 */
308 tc_send_ra_stop_req();
309 tc_cgrlc_ul_tbf_res(CGRLC_TBF_MODE_ACCESS_FAILED,CGRLC_PRIM_STATUS_ONE);
310 break;
311 default:
312 TRACE_ERROR( "T3186 unexpected" );
313 break;
314 }
315
316 } /* tc_t3186() */
317
318 /*
319 +------------------------------------------------------------------------------
320 | Function : tc_cgrlc_tbf_rel_ind
321 +------------------------------------------------------------------------------
322 | Description : Handles the primitive cgrlc_tbf_rel_ind
323 |
324 | Parameters : cgrlc_tbf_rel_ind - Ptr to primitive payload
325 |
326 +------------------------------------------------------------------------------
327 */
328 GLOBAL void tc_cgrlc_tbf_rel_ind ( T_CGRLC_TBF_REL_IND * cgrlc_tbf_rel_ind )
329 {
330 TRACE_FUNCTION( "tc_cgrlc_tbf_rel_ind" );
331
332
333 switch( GET_STATE( TC ) )
334 {
335 case TC_CONTENTION_RESOLUTION:
336 if(( !grr_is_pbcch_present()) AND
337 ( grr_data->tc.dcch_present) AND
338 cgrlc_tbf_rel_ind->tbf_rel_cause EQ CGRLC_TBF_REL_CR_FAILED AND
339 cgrlc_tbf_rel_ind->tbf_mode EQ CGRLC_TBF_MODE_UL )
340 {
341 SET_STATE(TC,TC_CPAP);
342 sig_tc_cpap_con_res_fail();
343 break;
344 }
345
346 /*lint -fallthrough*/
347
348 case TC_TBF_ACTIVE:
349 if( grr_data->cc_running OR grr_t_status( T3174 ) > 0 AND
350 cgrlc_tbf_rel_ind->tbf_rel_cause EQ CGRLC_TBF_REL_CR_FAILED AND
351 cgrlc_tbf_rel_ind->tbf_mode EQ CGRLC_TBF_MODE_UL)
352 {
353 TRACE_ERROR( " Contention Resolution failure on new cell" );
354 sig_tc_ctrl_contention_failure();
355 }
356 else if( cgrlc_tbf_rel_ind->tbf_rel_cause EQ CGRLC_TBF_REL_WITH_CELL_RESELECT AND
357 ( cgrlc_tbf_rel_ind->tbf_mode EQ CGRLC_TBF_MODE_UL OR
358 cgrlc_tbf_rel_ind->tbf_mode EQ CGRLC_TBF_MODE_DL_UL ) )
359 {
360 sig_tc_ctrl_prepare_abnorm_rel_with_cr( );
361 }
362 else
363 {
364 if( (grr_data->tbf_type EQ CGRLC_TBF_MODE_DL_UL OR
365 grr_data->tbf_type EQ cgrlc_tbf_rel_ind->tbf_mode) AND
366 cgrlc_tbf_rel_ind->tbf_mode NEQ CGRLC_TBF_MODE_NULL)
367 {
368 if( (grr_data->downlink_tbf.trans_id NEQ cgrlc_tbf_rel_ind->dl_trans_id) AND
369 cgrlc_tbf_rel_ind->tbf_mode EQ CGRLC_TBF_MODE_DL)
370 {
371 /* Dont perform REL_R as just configured L1 with TBF_R*/
372 TRACE_EVENT_P2("GRR and GRLC DL Transaction Id Diff grr=%d grlc=%d",
373 grr_data->downlink_tbf.trans_id,cgrlc_tbf_rel_ind->dl_trans_id);
374 }
375 else
376 {
377 tc_send_tbf_rel (cgrlc_tbf_rel_ind->tbf_mode);
378 tc_deactivate_tbf(cgrlc_tbf_rel_ind->tbf_mode);
379 }
380 }
381 else
382 {
383 TRACE_EVENT_P2("cgrlc_tbf_rel_ind grr_data->tbf_type=%d,cgrlc_tbf_rel_ind->tbf_mode=%d"
384 ,grr_data->tbf_type
385 ,cgrlc_tbf_rel_ind->tbf_mode);
386 }
387 }
388
389 if( cgrlc_tbf_rel_ind->v_c_value EQ TRUE )
390 {
391 meas_c_set_c_value( &cgrlc_tbf_rel_ind->c_value );
392 }
393 break;
394 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH
395 case TC_WAIT_2P_ASSIGN :
396 /* T3168 timer expires in GRLC */
397 if((grr_data->tc.tbf_est_pacch) AND
398 (cgrlc_tbf_rel_ind->tbf_mode EQ CGRLC_TBF_MODE_2PA))
399 {
400 tc_send_tbf_rel (cgrlc_tbf_rel_ind->tbf_mode);
401 tc_deactivate_tbf(cgrlc_tbf_rel_ind->tbf_mode);
402 }
403 break;
404 #endif
405 default:
406 TRACE_ERROR( "cgrlc_tbf_rel_ind unexpected" );
407 break;
408 }
409
410 PFREE(cgrlc_tbf_rel_ind);
411
412 } /* tc_cgrlc_tbf_rel_ind() */
413
414
415
416 /*
417 +------------------------------------------------------------------------------
418 | Function : tc_cgrlc_ul_tbf_ind
419 +------------------------------------------------------------------------------
420 | Description : Handles the primitive cgrlc_ul_tbf_ind
421 |
422 | Parameters : cgrlc_ul_tbf_ind - Ptr to primitive payload
423 |
424 +------------------------------------------------------------------------------
425 */
426 GLOBAL void tc_cgrlc_ul_tbf_ind ( T_CGRLC_UL_TBF_IND * cgrlc_ul_tbf_ind )
427 {
428 TRACE_FUNCTION( "tc_cgrlc_ul_tbf_ind" );
429
430
431 switch( GET_STATE( TC ) )
432 {
433 case TC_PIM:
434 grr_data->r_bit = 0;
435 grr_data->tc.sending_req = FALSE;
436 grr_data->tc.n_acc_req = 0;
437 grr_data->tc.ra_once_sent= 0;
438
439 if(cgrlc_ul_tbf_ind->access_type EQ CGRLC_AT_NULL )
440 {
441 /*
442 * check if single block access is required
443 */
444 if(tc_get_num_ctrl_blck( ) NEQ 0)
445 {
446 grr_data->tc.v_sb_without_tbf = TRUE;
447 grr_data->uplink_tbf.nr_blocks = 1;
448 grr_data->uplink_tbf.prio = RADIO_PRIO_4;
449 grr_data->uplink_tbf.access_type = CGRLC_AT_SINGLE_BLOCK;
450 grr_data->uplink_tbf.ti = 0; /* contention resolution NOT required */
451 tc_check_access_is_needed( CAC_OTHER );
452 }
453 else
454 {
455 sig_tc_ctrl_set_pckt_mode( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE );
456 }
457 }
458 else
459 {
460 grr_data->uplink_tbf.access_type = cgrlc_ul_tbf_ind->access_type;
461 grr_data->uplink_tbf.prio = cgrlc_ul_tbf_ind->ra_prio;
462 grr_data->uplink_tbf.nr_blocks = cgrlc_ul_tbf_ind->nr_blocks;
463 grr_data->uplink_tbf.prim_type = cgrlc_ul_tbf_ind->llc_prim_type;
464 grr_data->uplink_tbf.peak = cgrlc_ul_tbf_ind->peak;
465 grr_data->uplink_tbf.rlc_oct_cnt = cgrlc_ul_tbf_ind->rlc_oct_cnt;
466
467 if(grr_data->uplink_tbf.access_type EQ CGRLC_AT_TWO_PHASE)
468 grr_data->uplink_tbf.ti = 0; /* contention resolution NOT required */
469 else
470 grr_data->uplink_tbf.ti = 1; /* contention resolution required */
471
472
473 TRACE_EVENT_P1("tc_cgrlc_ul_tbf_ind: nr_block: %d", grr_data->uplink_tbf.nr_blocks);
474
475 tc_check_access_is_needed( CAC_OTHER );
476 /*
477 * forward control messages to GRLC
478 */
479 if(tc_get_num_ctrl_blck( ) NEQ 0)
480 {
481 tc_send_control_msg_to_grlc();
482 }
483
484 }
485 break;
486 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH
487 case TC_CONTENTION_RESOLUTION:
488 case TC_TBF_ACTIVE:
489 /* TBF establishment on PACCH is initiated by GRLC */
490 if(cgrlc_ul_tbf_ind->tbf_est_pacch)
491 {
492 /* Set TBF establishment on PACCH flag */
493 grr_data->tc.tbf_est_pacch = TRUE;
494
495 /* Contention resolution is not required */
496 grr_data->uplink_tbf.ti = 0;
497 }
498 break;
499 #endif
500 default:
501 TRACE_ERROR( "cgrlc_ul_tbf_ind unexpected" );
502 break;
503 }
504
505 PFREE(cgrlc_ul_tbf_ind);
506
507 } /* tc_cgrlc_ul_tbf_ind() */
508
509
510 /*
511 +------------------------------------------------------------------------------
512 | Function : tc_cgrlc_ctrl_msg_sent_ind
513 +------------------------------------------------------------------------------
514 | Description : Handles the primitive cgrlc_ctrl_msg_sent_ind
515 |
516 | Parameters : cgrlc_ctrl_msg_sent_ind - Ptr to primitive payload
517 |
518 +------------------------------------------------------------------------------
519 */
520 GLOBAL void tc_cgrlc_ctrl_msg_sent_ind ( T_CGRLC_CTRL_MSG_SENT_IND * cgrlc_ctrl_msg_sent_ind )
521 {
522 TRACE_FUNCTION( "tc_cgrlc_ctrl_msg_sent_ind" );
523
524
525 switch( GET_STATE( TC ) )
526 {
527 case TC_CONTENTION_RESOLUTION:
528 case TC_TBF_ACTIVE:
529 /*
530 * todo : delete the first ctrl msg. Only type of cntrl msgs will be stored
531 */
532
533 break;
534 default:
535 TRACE_ERROR( "cgrlc_ctrl_msg_sent_ind unexpected" );
536 break;
537 }
538
539 PFREE(cgrlc_ctrl_msg_sent_ind);
540
541 } /* tc_cgrlc_ctrl_msg_sent_ind() */
542
543 /*
544 +------------------------------------------------------------------------------
545 | Function : tc_cgrlc_starting_time_ind
546 +------------------------------------------------------------------------------
547 | Description : Handles the primitive cgrlc_starting_time_ind
548 |
549 | Parameters : cgrlc_starting_time_ind - Ptr to primitive payload
550 |
551 +------------------------------------------------------------------------------
552 */
553 GLOBAL void tc_cgrlc_starting_time_ind ( T_CGRLC_STARTING_TIME_IND * cgrlc_starting_time_ind )
554 {
555 TRACE_FUNCTION( "tc_cgrlc_starting_time_ind" );
556
557
558 switch( GET_STATE( TC ) )
559 {
560 case TC_CONTENTION_RESOLUTION:
561 case TC_TBF_ACTIVE:
562 /*
563 * store the tfi
564 */
565 if(cgrlc_starting_time_ind->tbf_mode EQ CGRLC_TBF_MODE_UL)
566 {
567 grr_data->uplink_tbf.tfi = cgrlc_starting_time_ind->tfi;
568 grr_data->uplink_tbf.st_tfi = 0xFF;
569 grr_data->uplink_tbf.tbf_start_fn = CGRLC_STARTING_TIME_NOT_PRESENT;
570 grr_data->uplink_tbf.polling_bit = 0xFF;
571 grr_data->uplink_tbf.rlc_db_granted = 0;
572 if(grr_data->uplink_tbf.ts_usage)
573 {
574 grr_data->uplink_tbf.ts_mask = grr_data->uplink_tbf.ts_usage;
575 }
576 else
577 {
578 TRACE_EVENT("tc_cgrlc_starting_time_ind: uplink ts_usage is 0");
579 }
580 grr_data->uplink_tbf.ts_usage = 0;
581
582 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH
583 grr_data->tc.tbf_est_pacch = FALSE;
584 #endif
585 }
586 else
587 {
588 grr_data->downlink_tbf.tfi = cgrlc_starting_time_ind->tfi;
589 grr_data->downlink_tbf.st_tfi = 0xFF;
590 grr_data->downlink_tbf.tbf_start_fn = CGRLC_STARTING_TIME_NOT_PRESENT;
591 grr_data->downlink_tbf.polling_bit = 0xFF;
592 if(grr_data->downlink_tbf.ts_usage)
593 {
594 grr_data->downlink_tbf.ts_mask = grr_data->downlink_tbf.ts_usage;
595 }
596 else
597 {
598 TRACE_EVENT("tc_cgrlc_starting_time_ind: downlink ts_usage is 0");
599 }
600 grr_data->downlink_tbf.ts_usage = 0;
601 }
602
603 break;
604 default:
605 TRACE_ERROR( "cgrlc_starting_time_ind unexpected" );
606 break;
607 }
608
609 PFREE(cgrlc_starting_time_ind);
610
611 } /* tc_cgrlc_starting_time_ind() */
612
613 /*
614 +------------------------------------------------------------------------------
615 | Function : tc_cgrlc_t3192_started_ind
616 +------------------------------------------------------------------------------
617 | Description : Handles the primitive cgrlc_t3192_started_ind
618 |
619 | Parameters : cgrlc_t3192_started_ind - Ptr to primitive payload
620 |
621 +------------------------------------------------------------------------------
622 */
623 GLOBAL void tc_cgrlc_t3192_started_ind ( T_CGRLC_T3192_STARTED_IND * cgrlc_t3192_started_ind )
624 {
625 TRACE_FUNCTION( "tc_cgrlc_t3192_started_ind" );
626
627
628 switch( GET_STATE( TC ) )
629 {
630 case TC_CONTENTION_RESOLUTION:
631 case TC_TBF_ACTIVE:
632 grr_data->downlink_tbf.t3192 = TRUE;
633 break;
634 default:
635 TRACE_ERROR( "cgrlc_t3192_started_ind unexpected" );
636 break;
637 }
638
639 PFREE(cgrlc_t3192_started_ind);
640
641 } /* tc_cgrlc_t3192_started_ind() */
642
643 /*
644 +------------------------------------------------------------------------------
645 | Function : tc_cgrlc_cont_res_done_ind
646 +------------------------------------------------------------------------------
647 | Description : Handles the primitive cgrlc_cont_res_done_ind
648 |
649 | Parameters : cgrlc_cont_res_done_ind - Ptr to primitive payload
650 |
651 +------------------------------------------------------------------------------
652 */
653 GLOBAL void tc_cgrlc_cont_res_done_ind ( T_CGRLC_CONT_RES_DONE_IND * cgrlc_cont_res_done_ind )
654 {
655 TRACE_FUNCTION( "tc_cgrlc_cont_res_done_ind" );
656
657
658 switch( GET_STATE( TC ) )
659 {
660 case TC_CONTENTION_RESOLUTION:
661 SET_STATE(TC,TC_TBF_ACTIVE);
662 grr_data->uplink_tbf.ti = 0;
663 /*TRACE_EVENT_P1("CONT_RES:nacc set from %d to zero",grr_data->tc.n_acc_req_procedures);*/
664 if(grr_data->cc_running OR grr_t_status( T3174 ) > 0)
665 {
666 sig_tc_ctrl_contention_ok();
667 }
668 break;
669 default:
670 TRACE_ERROR( "cgrlc_cont_res_done_ind unexpected" );
671 break;
672 }
673
674 PFREE(cgrlc_cont_res_done_ind);
675
676 } /* tc_cgrlc_cont_res_done_ind() */
677
678 /*
679 +------------------------------------------------------------------------------
680 | Function : tc_cgrlc_ta_value_ind
681 +------------------------------------------------------------------------------
682 | Description : Handles the primitive cgrlc_ta_value_ind
683 |
684 | Parameters : cgrlc_ta_value_ind - Ptr to primitive payload
685 |
686 +------------------------------------------------------------------------------
687 */
688 GLOBAL void tc_cgrlc_ta_value_ind ( T_CGRLC_TA_VALUE_IND * cgrlc_ta_value_ind )
689 {
690 TRACE_FUNCTION( "tc_cgrlc_ta_value_ind" );
691
692
693 switch( GET_STATE( TC ) )
694 {
695 case TC_CONTENTION_RESOLUTION:
696 case TC_TBF_ACTIVE:
697 #if defined REL99 AND defined TI_PS_FF_TBF_EST_PACCH
698 case TC_WAIT_2P_ASSIGN:
699 #endif
700 grr_data->ta_params.ta_valid = TRUE;
701 grr_data->ta_params.ta_value = cgrlc_ta_value_ind->ta_value;
702 /*
703
704 {
705 ULONG trace[2];
706
707 trace[0] = grr_data->ta_params.ul_ta_tn << 0;
708 trace[0] |= grr_data->ta_params.ul_ta_i << 8;
709 trace[0] |= grr_data->ta_params.ta_value << 16;
710 trace[0] |= grr_data->ta_params.ta_valid << 24;
711
712 trace[1] = grr_data->ta_params.l1_ta_i << 0;
713 trace[1] |= grr_data->ta_params.l1_ta_value << 8;
714 trace[1] |= grr_data->ta_params.dl_ta_tn << 16;
715 trace[1] |= grr_data->ta_params.dl_ta_i << 24;
716
717 TRACE_EVENT_P4( "TA_PARAM_2: %08X%08X%02X %02X",
718 trace[0], trace[1], grr_data->ta_params.l1_ta_tn,
719 grr_data->ta_params.ta_value );
720 }
721
722 */
723
724 break;
725 default:
726 TRACE_ERROR( "cgrlc_ta_value_ind unexpected" );
727 break;
728 }
729
730 PFREE(cgrlc_ta_value_ind);
731
732 } /* tc_cgrlc_ta_value_ind() */
733
734
735 /*
736 +------------------------------------------------------------------------------
737 | Function : tc_cgrlc_test_mode_ind
738 +------------------------------------------------------------------------------
739 | Description : Handles the primitive cgrlc_test_mode_ind, GRLC is indicating
740 | that test mode is runnig
741 |
742 | Parameters : cgrlc_test_mode_ind - Ptr to primitive payload
743 |
744 +------------------------------------------------------------------------------
745 */
746 GLOBAL void tc_cgrlc_test_mode_ind ( T_CGRLC_TEST_MODE_IND * cgrlc_test_mode_ind )
747 {
748 TRACE_FUNCTION( "tc_cgrlc_test_mode_ind" );
749
750
751 switch( GET_STATE( TC ) )
752 {
753 case TC_CONTENTION_RESOLUTION:
754 case TC_TBF_ACTIVE:
755 case TC_PIM:/*testmode ended*/
756
757 grr_data->test_mode = cgrlc_test_mode_ind->test_mode_flag;
758 sig_tc_ctrl_test_mode_ind();
759
760 break;
761 default:
762 TRACE_ERROR( "cgrlc_test_mode_ind unexpected" );
763 break;
764 }
765
766 PFREE(cgrlc_test_mode_ind);
767
768 } /* tc_cgrlc_test_mode_ind() */