comparison src/g23m-gprs/grr/grr_ctrls.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 | CTRL of entity GRR.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef GRR_CTRLS_C
23 #define GRR_CTRLS_C
24 #endif
25
26 #define ENTITY_GRR
27
28 /*==== INCLUDES =============================================================*/
29
30 #include "typedefs.h" /* to get Condat data types */
31
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
43 #include "grr_f.h" /* */
44
45 #include "grr_ctrlf.h" /* */
46 #include "grr_ctrls.h" /* */
47
48 #include "grr_psis.h" /* */
49 #include "grr_pgs.h" /* */
50 #include "grr_css.h" /* */
51 #include "grr_meass.h" /* to get the signals for interference measurements */
52 #include "grr_tcs.h" /* */
53
54 #include <string.h> /* for memcpy*/
55
56 /*==== CONST ================================================================*/
57
58 /*==== LOCAL VARS ===========================================================*/
59
60 /*==== PRIVATE FUNCTIONS ====================================================*/
61
62 /*==== PUBLIC FUNCTIONS =====================================================*/
63 /*
64 +------------------------------------------------------------------------------
65 | Function : sig_tc_ctrl_set_pckt_mode
66 +------------------------------------------------------------------------------
67 | Description : Handles the internal signal SIG_TC_CTRL_SET_PCKT_MODE
68 |
69 | Parameters :
70 |
71 +------------------------------------------------------------------------------
72 */
73 GLOBAL void sig_tc_ctrl_set_pckt_mode
74 ( T_GLBL_PCKT_MODE final_pckt_mode, UBYTE param )
75 {
76 TRACE_ISIG( "sig_tc_ctrl_set_pckt_mode" );
77
78 switch( GET_STATE( CTRL ) )
79 {
80 case CTRL_ACCESS_DISABLED:
81 case CTRL_READY_TO_PROGRESS:
82 case CTRL_IN_PROGRESS:
83 case CTRL_WAIT_RSP_4_RR_CR:
84 case CTRL_WAIT_FOR_CNF_OF_SUSPENSION:
85 case CTRL_CR:
86 case CTRL_CR_IN_SUSP:
87 case CTRL_GRR_NC_CCO:
88 case CTRL_READY:
89 ctrl_stop_rr_task_req( final_pckt_mode, param );
90 break;
91 default:
92 TRACE_ERROR( "sig_tc_ctrl_set_pckt_mode unexpected" );
93 break;
94 }
95 } /* sig_tc_ctrl_set_pckt_mode() */
96
97 /*
98 +------------------------------------------------------------------------------
99 | Function : sig_tc_ctrl_prepare_abnorm_rel_with_cr
100 +------------------------------------------------------------------------------
101 | Description : Handles the signal SIG_TC_CTRL_PREPARE_ABNORM_REL_WITH_CR
102 |
103 | Parameters : void
104 |
105 +------------------------------------------------------------------------------
106 */
107 GLOBAL void sig_tc_ctrl_prepare_abnorm_rel_with_cr ( void )
108 {
109 TRACE_ISIG( "sig_tc_ctrl_prepare_abnorm_rel_with_cr" );
110
111 switch( GET_STATE( CTRL ) )
112 {
113 case CTRL_IN_PROGRESS:
114 ctrl_send_access_disable_if_needed
115 ( TC_DC_CR_ABNORMAL, sig_tc_ctrl_abnorm_rel_with_cr );
116 break;
117
118 default:
119 TRACE_ERROR( "SIG_TC_CTRL_PREPARE_ABNORM_REL_WITH_CR unexpected" );
120 break;
121 }
122 } /* sig_tc_ctrl_prepare_abnorm_rel_with_cr() */
123
124 /*
125 +------------------------------------------------------------------------------
126 | Function : sig_tc_ctrl_abnorm_rel_with_cr
127 +------------------------------------------------------------------------------
128 | Description : Handles the internal signal SIG_TC_CTRL_ABNORM_REL_WITH_CR
129 |
130 | Parameters : void
131 |
132 +------------------------------------------------------------------------------
133 */
134 GLOBAL void sig_tc_ctrl_abnorm_rel_with_cr ( void )
135 {
136 TRACE_ISIG( "sig_tc_ctrl_abnorm_rel_with_cr" );
137
138 switch( GET_STATE( CTRL ) )
139 {
140 case CTRL_IN_PROGRESS:
141 sig_ctrl_cs_reselect( CS_RESELECT_CAUSE_CTRL_ABNORMAL );
142 break;
143
144 default:
145 TRACE_ERROR( "SIG_TC_CTRL_ABNORM_REL_WITH_CR unexpected" );
146 break;
147 }
148 } /* sig_tc_ctrl_abnorm_rel_with_cr() */
149
150 /*
151 +------------------------------------------------------------------------------
152 | Function : sig_tc_ctrl_channel_req
153 +------------------------------------------------------------------------------
154 | Description : Handles the internal signal SIG_TC_CTRL_CHANNEL_REQ
155 |
156 | SZML-CTRL/002
157 |
158 | Parameters : void
159 |
160 +------------------------------------------------------------------------------
161 */
162 GLOBAL void sig_tc_ctrl_channel_req ( UBYTE channel_req)
163 {
164 TRACE_ISIG( "sig_tc_ctrl_channel_req" );
165 switch( GET_STATE( CTRL ) )
166 {
167 case CTRL_IN_PROGRESS:
168 case CTRL_GRR_NC_CCO:
169 {
170 PALLOC(rrgrr_channel_req, RRGRR_CHANNEL_REQ);
171 rrgrr_channel_req->req_data = channel_req;
172 PSEND(hCommRR, rrgrr_channel_req);
173 }
174 break;
175 default:
176 TRACE_ERROR( "SIG_TC_CTRL_CHANNEL_REQ unexpected" );
177 break;
178 }
179 } /* sig_tc_ctrl_channel_req() */
180
181 /*
182 +------------------------------------------------------------------------------
183 | Function : sig_tc_ctrl_t3172_running
184 +------------------------------------------------------------------------------
185 | Description : Handles the internal signal SIG_TC_CTRL_T3172_RUNNING
186 |
187 | Parameters : void
188 |
189 +------------------------------------------------------------------------------
190 */
191 GLOBAL void sig_tc_ctrl_t3172_running ( void )
192 {
193 TRACE_ISIG( "sig_tc_ctrl_t3172_running" );
194 switch( GET_STATE( CTRL ) )
195 {
196 case CTRL_IN_PROGRESS:
197 case CTRL_GRR_NC_CCO:
198 sig_ctrl_pg_t3172_run();
199 break;
200 default:
201 TRACE_ERROR( "SIG_TC_CTRL_T3172_RUNNING unexpected" );
202 break;
203 }
204 } /* sig_tc_ctrl_t3172_running() */
205
206
207
208
209
210
211
212
213 /*
214 +------------------------------------------------------------------------------
215 | Function : sig_pg_ctrl_downlink_transfer
216 +------------------------------------------------------------------------------
217 | Description : Handles the internal signal SIG_PG_CTRL_DOWNLINK_TRANSFER
218 |
219 | Parameters : ULONG pg_tlli
220 |
221 +------------------------------------------------------------------------------
222 */
223 GLOBAL void sig_pg_ctrl_downlink_transfer ( UBYTE page_id)
224 {
225 TRACE_ISIG( "sig_pg_ctrl_downlink_transfer" );
226
227 switch( GET_STATE( CTRL ) )
228 {
229 case CTRL_IN_PROGRESS:
230 {
231 PALLOC(gmmrr_page_ind, GMMRR_PAGE_IND);
232 gmmrr_page_ind->page_id = page_id;
233 PSEND(hCommGMM,gmmrr_page_ind);
234 }
235 break;
236 default:
237 TRACE_ERROR( "SIG_PG_CTRL_DOWNLINK_TRANSFER unexpected" );
238 break;
239 }
240 } /* sig_pg_ctrl_downlink_transfer() */
241
242
243
244 /*
245 +------------------------------------------------------------------------------
246 | Function : sig_pg_ctrl_rr_est_req
247 +------------------------------------------------------------------------------
248 | Description : Handles the internal signal SIG_PG_CTRL_RR_EST_REQ
249 |
250 | Parameters : void
251 |
252 +------------------------------------------------------------------------------
253 */
254 GLOBAL void sig_pg_ctrl_rr_est_req ( PG_CHANNEL type)
255 {
256 UBYTE state = GET_STATE( CTRL );
257
258 TRACE_ISIG( "sig_pg_ctrl_rr_est_req" );
259
260 grr_data->ctrl.cs_page_channel = type;
261
262 switch( state )
263 {
264 case CTRL_READY:
265 case CTRL_IN_PROGRESS:
266 /*
267 * To pass CS page request to GMM
268 */
269 SET_STATE(CTRL, CTRL_WAIT_CS_PAGE_RES);
270
271 ctrl_handle_gmmrr_cs_page_ind( state );
272 break;
273 default:
274 TRACE_ERROR( "SIG_PG_CTRL_RR_EST_REQ unexpected" );
275 break;
276 }
277 } /* sig_pg_ctrl_rr_est_req() */
278
279 /*
280 +------------------------------------------------------------------------------
281 | Function : sig_psi_ctrl_si13_processed
282 +------------------------------------------------------------------------------
283 | Description : Handles the internal signal SIG_PSI_CTRL_SI13_PROCESSED
284 |
285 | Parameters : void
286 |
287 +------------------------------------------------------------------------------
288 */
289 GLOBAL void sig_psi_ctrl_si13_processed ( void )
290 {
291 UBYTE state = GET_STATE( CTRL );
292
293 TRACE_ISIG( "sig_psi_ctrl_si13_processed" );
294
295 switch( state )
296 {
297 case CTRL_READY:
298 case CTRL_READY_TO_PROGRESS:
299 case CTRL_ACCESS_DISABLED:
300 case CTRL_CR:
301 case CTRL_CR_IN_SUSP:
302 case CTRL_AUTO_RR_CR:
303 case CTRL_RR_CR_IN_SUSP:
304 case CTRL_RR_NC_CCO:
305 case CTRL_GRR_NC_CCO:
306 if( grr_is_pbcch_present( ) )
307 {
308 if( state EQ CTRL_READY )
309 {
310 SET_STATE( CTRL, CTRL_READY_TO_PROGRESS );
311 }
312 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE );
313 }
314 else
315 {
316 ctrl_send_cell_reselection_req( CR_COMPLETE );
317 if( state EQ CTRL_READY )
318 {
319 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE );
320
321 SET_STATE( CTRL, CTRL_IN_PROGRESS );
322 }
323 else if( state EQ CTRL_ACCESS_DISABLED OR
324 state EQ CTRL_READY_TO_PROGRESS )
325
326 {
327 SET_STATE( CTRL, CTRL_IN_PROGRESS );
328 }
329 }
330 break;
331
332 default:
333 TRACE_ERROR( "SIG_PSI_CTRL_SI13_PROCESSED unexpected" );
334 break;
335 }
336 } /* sig_psi_ctrl_si13_processed() */
337
338 /*
339 +------------------------------------------------------------------------------
340 | Function : sig_psi_ctrl_access_enabled
341 +------------------------------------------------------------------------------
342 | Description : Handles the internal signal SIG_PSI_CTRL_ACCESS_ENABLED
343 |
344 | Parameters :
345 |
346 +------------------------------------------------------------------------------
347 */
348 GLOBAL void sig_psi_ctrl_access_enabled ( void )
349 {
350 BOOL send_cr_complete = FALSE;
351 UBYTE final = FALSE;
352
353 TRACE_ISIG( "sig_psi_ctrl_access_enabled" );
354
355 switch( GET_STATE( CTRL ) )
356 {
357 case CTRL_RR_CR_IN_SUSP:
358 /*
359 * enable cell after resume
360 */
361 SET_STATE(CTRL, CTRL_ACC_ENABLED_SUSP);
362 if(grr_is_pbcch_present())
363 {
364 /*
365 * to stop CCCH after resume
366 */
367 grr_data->ctrl.rr_state.monitoring_stopped = FALSE;
368 }
369 ctrl_send_cell_reselection_req( CR_COMPLETE );
370
371 sig_ctrl_psi_suspend( );
372 break;
373 case CTRL_CR:
374 case CTRL_CR_IN_SUSP:
375 case CTRL_READY_TO_PROGRESS:
376 final = TRUE;
377
378 /*lint -fallthrough*/
379
380 case CTRL_RR_NC_CCO:
381 case CTRL_GRR_NC_CCO:
382 case CTRL_AUTO_RR_CR:
383 case CTRL_ACCESS_DISABLED:
384 send_cr_complete = TRUE;
385 if(( GET_STATE( CTRL ) NEQ CTRL_RR_NC_CCO ) AND (GET_STATE( CTRL ) NEQ CTRL_GRR_NC_CCO))
386 {
387 SET_STATE( CTRL, CTRL_IN_PROGRESS );
388 }
389
390 /*lint -fallthrough*/
391
392 case CTRL_IN_PROGRESS:
393 ctrl_enable_serving_cell( final );
394
395 if( send_cr_complete EQ TRUE )
396 {
397 ctrl_send_cell_reselection_req( CR_COMPLETE );
398 }
399 break;
400
401 default:
402 TRACE_ERROR( "SIG_PSI_CTRL_ACCESS_ENABLED unexpected" );
403 break;
404 }
405 } /* sig_psi_ctrl_access_enabled() */
406
407
408
409 /*
410 +------------------------------------------------------------------------------
411 | Function : sig_psi_ctrl_access_disabled
412 +------------------------------------------------------------------------------
413 | Description : Handles the internal signal SIG_PSI_CTRL_ACCESS_DISABLED
414 |
415 | Parameters : void
416 |
417 +------------------------------------------------------------------------------
418 */
419 GLOBAL void sig_psi_ctrl_access_disabled ( T_PSI_DISABLE_CAUSE dc )
420 {
421 UBYTE state = GET_STATE( CTRL );
422
423 TRACE_ISIG( "sig_psi_ctrl_access_disabled" );
424
425 switch( state )
426 {
427 case CTRL_IN_PROGRESS:
428 SET_STATE(CTRL, CTRL_ACCESS_DISABLED);
429
430 /*lint -fallthrough*/
431
432 case CTRL_RR_NC_CCO:
433 case CTRL_GRR_NC_CCO:
434
435 switch(dc)
436 {
437 case PSI_DC_PBCCH_RELEASED:
438 TRACE_EVENT( "PBCCH switched off" );
439
440 sig_ctrl_cs_reselect( CS_RESELECT_CAUSE_CTRL_SCELL );
441 break;
442 case PSI_DC_PBCCH_ESTABLISHED:
443 TRACE_EVENT( "PBCCH switched on" );
444
445 grr_data->ctrl.psi_tbf_rel_cause = CTRL_PTRC_PBCCH_ESTABLISHED;
446
447 ctrl_stop_all_activities( CTRL_DC_PSI_MANAGEMENT, NULL );
448 break;
449 case PSI_DC_READ_PSI:
450 grr_data->ctrl.psi_tbf_rel_cause = CTRL_PTRC_COMPLETE_PSI_READING;
451
452 ctrl_stop_all_activities( CTRL_DC_PSI_MANAGEMENT, NULL );
453 break;
454 case PSI_DC_OTHER:
455 grr_data->ctrl.psi_tbf_rel_cause = CTRL_PTRC_COMPLETE_SI_READING;
456
457 ctrl_stop_all_activities( CTRL_DC_PSI_MANAGEMENT, NULL );
458 break;
459 default:
460 break;
461 }
462 break;
463 case CTRL_AUTO_RR_CR:
464 case CTRL_RR_CR_IN_SUSP:
465 /*
466 * RR has to continue CR
467 */
468 ctrl_send_cell_reselection_req( CR_CONT );
469 break;
470 case CTRL_CR:
471 case CTRL_CR_IN_SUSP:
472 SET_STATE_FAILED_CR( state );
473 ctrl_cc_rejected( );
474 break;
475 default:
476 TRACE_ERROR( "SIG_PSI_CTRL_ACCESS_DISABLED unexpected" );
477 break;
478 }
479 } /* sig_psi_ctrl_access_disabled() */
480
481
482
483 /*
484 +------------------------------------------------------------------------------
485 | Function : sig_psi_ctrl_psi1or_psi13_receiption_failure
486 +------------------------------------------------------------------------------
487 | Description : Handles the internal signal
488 | SIG_PSI_CTRL_PSI1OR_PSI13_RECEIPTION_FAILURE
489 |
490 | Parameters : void
491 |
492 +------------------------------------------------------------------------------
493 */
494 GLOBAL void sig_psi_ctrl_psi1or_psi13_receiption_failure ( void )
495 {
496 TRACE_ISIG( "sig_psi_ctrl_psi1or_psi13_receiption_failure" );
497
498 ctrl_failure_processing( FAIL_SIG_PSI1OR_PSI13_RECEIPTION_FAILURE );
499 } /* sig_psi_ctrl_psi1or_psi13_receiption_failure() */
500
501
502 /*
503 +------------------------------------------------------------------------------
504 | Function : sig_psi_ctrl_read_si
505 +------------------------------------------------------------------------------
506 | Description : Handles the internal signal SIG_PSI_CTRL_READ_SI: it sends a
507 | request to RR to read some special SI message. This signal is used
508 | in case of acquisition
509 |
510 | Parameters : void
511 |
512 +------------------------------------------------------------------------------
513 */
514 GLOBAL void sig_psi_ctrl_read_si ( UBYTE si_to_read )
515 {
516 TRACE_ISIG( "sig_psi_ctrl_read_si" );
517 switch( GET_STATE( CTRL ) )
518 {
519 case CTRL_ACCESS_DISABLED:
520 case CTRL_READY_TO_PROGRESS:
521 case CTRL_IN_PROGRESS:
522 ctrl_start_monitoring_bcch( si_to_read );
523 break;
524 default:
525 TRACE_ERROR( "SIG_PSI_CTRL_READ_SI unexpected" );
526 break;
527 }
528 } /* sig_psi_ctrl_read_si() */
529
530
531
532
533
534 /*
535 +------------------------------------------------------------------------------
536 | Function : sig_meas_ctrl_meas_report
537 +------------------------------------------------------------------------------
538 | Description : Handles the internal signal SIG_MEAS_CTRL_MEAS_REPORT
539 |
540 | Parameters : T_U_MEAS_REPORT *meas_report
541 |
542 +------------------------------------------------------------------------------
543 */
544 GLOBAL void sig_meas_ctrl_meas_report ( T_U_MEAS_REPORT *meas_report)
545 {
546 TRACE_ISIG( "sig_meas_ctrl_meas_report" );
547
548 switch( GET_STATE( CTRL ) )
549 {
550 case CTRL_IN_PROGRESS:
551 ctrl_send_control_block( CGRLC_BLK_OWNER_MEAS, (void*)meas_report );
552 break;
553 default:
554 sig_ctrl_meas_pmr_reject( );
555
556 TRACE_ERROR( "SIG_MEAS_CTRL_MEAS_REPORT unexpected" );
557 break;
558 }
559 } /* sig_meas_ctrl_meas_report() */
560
561 /*
562 +------------------------------------------------------------------------------
563 | Function : sig_cs_ctrl_meas_report
564 +------------------------------------------------------------------------------
565 | Description : Handles the internal signal SIG_CS_CTRL_MEAS_REPORT
566 |
567 | Parameters : T_U_MEAS_REPORT *meas_report
568 |
569 +------------------------------------------------------------------------------
570 */
571 GLOBAL void sig_cs_ctrl_meas_report ( T_U_MEAS_REPORT *meas_report)
572 {
573 TRACE_ISIG( "sig_cs_ctrl_meas_report" );
574
575 switch( GET_STATE( CTRL ) )
576 {
577 case CTRL_IN_PROGRESS:
578 case CTRL_GRR_NC_CCO:
579 ctrl_send_control_block( CGRLC_BLK_OWNER_CS, (void*)meas_report );
580 break;
581 default:
582 sig_ctrl_cs_pmr_reject( );
583
584 TRACE_ERROR( "SIG_CS_CTRL_MEAS_REPORT unexpected" );
585 break;
586 }
587 } /* sig_cs_ctrl_meas_report() */
588
589 /*
590 +------------------------------------------------------------------------------
591 | Function : sig_cs_ctrl_cancel_meas_report
592 +------------------------------------------------------------------------------
593 | Description : Handles the internal signal SIG_CS_CTRL_CANCEL_MEAS_REPORT
594 |
595 | Parameters : void
596 |
597 +------------------------------------------------------------------------------
598 */
599 GLOBAL void sig_cs_ctrl_cancel_meas_report ( void )
600 {
601 TRACE_ISIG( "sig_cs_ctrl_cancel_meas_report" );
602
603 ctrl_cancel_control_block( CGRLC_BLK_OWNER_CS );
604
605 } /* sig_cs_ctrl_cancel_meas_report() */
606
607
608 /*
609 +------------------------------------------------------------------------------
610 | Function : sig_psi_ctrl_access_barred
611 +------------------------------------------------------------------------------
612 | Description : Handles the internal signal SIG_PSI_CTRL_ACCESS_BARRED
613 |
614 | Parameters : void
615 |
616 +------------------------------------------------------------------------------
617 */
618 GLOBAL void sig_psi_ctrl_access_barred ( void )
619 {
620 TRACE_ISIG( "sig_psi_ctrl_access_barred" );
621
622 ctrl_failure_processing( FAIL_SIG_CTRL_ACCESS_BARRED );
623 }/* sig_psi_ctrl_access_barred*/
624
625 /*
626 +------------------------------------------------------------------------------
627 | Function : sig_pg_ctrl_stop_mon_ccch
628 +------------------------------------------------------------------------------
629 | Description : Handles the internal signal SIG_PG_CTRL_STOP_MON_CCCH: it stops the
630 | CCCH monitoring process in RR
631 |
632 | Parameters : void
633 |
634 +------------------------------------------------------------------------------
635 */
636 GLOBAL void sig_pg_ctrl_stop_mon_ccch(void)
637 {
638 TRACE_ISIG( "sig_pg_ctrl_stop_mon_ccch" );
639 switch( GET_STATE( CTRL ) )
640 {
641 case CTRL_IN_PROGRESS:
642 case CTRL_GRR_NC_CCO:
643 ctrl_stop_monitoring_ccch();
644 break;
645 default:
646 TRACE_ERROR( "SIG_PG_CTRL_STOP_MON_CCCH unexpected" );
647 break;
648 }
649 }/* sig_pg_ctrl_stop_mon_ccch*/
650
651 /*
652 +------------------------------------------------------------------------------
653 | Function : sig_pg_ctrl_start_mon_ccch
654 +------------------------------------------------------------------------------
655 | Description : Handles the internal signal SIG_PG_CTRL_START_MON_CCCH: it starts the
656 | CCCH monitoring process in RR
657 |
658 | Parameters : void
659 |
660 +------------------------------------------------------------------------------
661 */
662 GLOBAL void sig_pg_ctrl_start_mon_ccch(UBYTE pg_type)
663 {
664 TRACE_ISIG( "sig_pg_ctrl_start_mon_ccch" );
665 switch( GET_STATE( CTRL ) )
666 {
667 case CTRL_IN_PROGRESS:
668 case CTRL_GRR_NC_CCO:
669 switch(pg_type)
670 {
671 case PAG_MODE_PTM_NP:
672 case PAG_MODE_PIM_NP:
673 /*
674 * use PTM_NP or PIM_NP
675 */
676 ctrl_start_monitoring_ccch(pg_type);
677 break;
678 default:
679 if(grr_is_non_drx_period())
680 {
681 /*
682 * RR continue with paging reorg
683 */
684 ctrl_start_monitoring_ccch(PAG_MODE_REORG);
685 }
686 else
687 {
688 /*
689 * RR continue with default paging
690 */
691 ctrl_start_monitoring_ccch(pg_type);
692 }
693 break;
694 }
695 break;
696 default:
697 TRACE_ERROR( "SIG_PG_CTRL_START_MON_CCCH unexpected" );
698 break;
699 }
700 }/* sig_pg_ctrl_start_mon_ccch*/
701
702
703 /*
704 +------------------------------------------------------------------------------
705 | Function : sig_tc_ctrl_suspend_cnf
706 +------------------------------------------------------------------------------
707 | Description : Handles the internal signal SIG_TC_CTRL_SUSPEND_CNF:
708 | GRR is suspended
709 | Parameters : void
710 |
711 +------------------------------------------------------------------------------
712 */
713 GLOBAL void sig_tc_ctrl_suspend_cnf(void)
714 {
715 TRACE_ISIG( "sig_tc_ctrl_suspend_cnf" );
716 switch( GET_STATE( CTRL ) )
717 {
718 case CTRL_WAIT_FOR_CNF_OF_SUSPENSION:
719 SET_STATE(CTRL, CTRL_SUSPENDED);
720 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_SUSP, TASK_STOP_DUMMY_VALUE );
721 psc_db->is_access_enabled = FALSE; /* at this point , we do not have any GPRS access*/
722 switch(grr_data->ctrl.after_suspension)
723 {
724 case ACTIVATE_RR:
725 {
726 /* activate RR. We have to check whether we have non-GPRS access parameters or not.
727 * Non-GPRS parameters are present in case of PCCCH presence
728 * GRR has to inform RR whether it should send GPRS Suspension request or not
729 */
730 PALLOC(rrgrr_activate_req, RRGRR_ACTIVATE_REQ);
731
732 /* Suspension needed*/
733 rrgrr_activate_req->susp_req = grr_data->ctrl.is_susp_needed;
734 if(grr_is_pbcch_present() AND (psc_db->v_non_gprs_opt EQ TRUE))
735 {
736 /* There is valid non-GPRS parameters present in the database, so we have to send
737 * it to RR to allow a fast access to the network
738 */
739 rrgrr_activate_req->non_gprs.v_non_gprs = TRUE;
740 ctrl_copy_non_gprs_opt(&rrgrr_activate_req->non_gprs);
741 }
742 else
743 rrgrr_activate_req->non_gprs.v_non_gprs = FALSE;
744 /*
745 * SZML-CTRL/004
746 */
747 rrgrr_activate_req->rac = psc_db->cell_info_for_gmm.cell_info.cell_env.rai.rac;
748
749 PSEND(hCommRR, rrgrr_activate_req);
750 }
751
752 ctrl_send_gmmrr_suspend_cnf( );
753 break;
754 case SEND_RR_EST_REQ:
755 /* */
756 ctrl_send_rr_est_req(grr_data->ctrl.is_susp_needed);
757 break;
758 case SEND_RR_EST_RSP:
759 ctrl_send_rr_est_rsp(grr_data->ctrl.is_susp_needed,
760 TRUE /* CS_PAGE was accepted*/);
761
762 break;
763 }
764 break;
765 default:
766 TRACE_ERROR( "SIG_TC_CTRL_SUSPEND_CNF unexpected" );
767 break;
768 }
769 }/* sig_tc_ctrl_suspend_cnf*/
770
771 /*
772 +------------------------------------------------------------------------------
773 | Function : sig_tc_ctrl_dcch_data_req
774 +------------------------------------------------------------------------------
775 | Description : Handles the internal signal SIG_TC_CTRL_DCCH_DATA_REQ
776 |
777 | Parameters : rrgrr_data_req-pointer to primitive which includes the data
778 |
779 +------------------------------------------------------------------------------
780 */
781 GLOBAL void sig_tc_ctrl_dcch_data_req(T_RRGRR_DATA_REQ * rrgrr_data_req_i )
782 {
783 TRACE_ISIG( "sig_tc_ctrl_dcch_data_req" );
784 switch( GET_STATE( CTRL ) )
785 {
786 case CTRL_IN_PROGRESS:
787 {
788 PSEND(hCommRR,rrgrr_data_req_i);
789 }
790 break;
791 default:
792 TRACE_ERROR( "sig_tc_ctrl_dcch_data_req unexpected" );
793 break;
794 }
795 }/* sig_tc_ctrl_dcch_data_req */
796
797
798
799
800 /*
801 +------------------------------------------------------------------------------
802 | Function : sig_ctrl_tc_gprs_data_req
803 +------------------------------------------------------------------------------
804 | Description : Handles the internal signal SIG_CTRL_TC_GPRS_DATA_REQ
805 |
806 | Parameters : rrgrr_gprs_data_req-pointer to primitive which includes the data
807 |
808 +------------------------------------------------------------------------------
809 */
810 GLOBAL void sig_tc_ctrl_gprs_data_req(T_RRGRR_GPRS_DATA_REQ *rrgrr_gprs_data_req_i)
811 {
812 TRACE_ISIG( "sig_tc_ctrl_gprs_data_req" );
813 switch( GET_STATE( CTRL ) )
814 {
815 case CTRL_IN_PROGRESS:
816 case CTRL_GRR_NC_CCO:
817 {
818 PSEND(hCommRR,rrgrr_gprs_data_req_i);
819 }
820 break;
821 default:
822 TRACE_ERROR( "sig_tc_ctrl_gprs_data_req unexpected" );
823 break;
824 }
825 }/* sig_tc_ctrl_gprs_data_req*/
826
827
828
829 /*
830 +------------------------------------------------------------------------------
831 | Function : sig_tc_ctrl_suspend_dedi_chan
832 +------------------------------------------------------------------------------
833 | Description : Handles the internal signal SIG_TC_CTRL_SUSPEND_DEDICATED_CHANNEL
834 |
835 | Parameters : void
836 |
837 +------------------------------------------------------------------------------
838 */
839 GLOBAL void sig_tc_ctrl_suspend_dedi_chan(void)
840 {
841 TRACE_ISIG( "sig_tc_ctrl_suspend_dedi_chan" );
842 switch( GET_STATE( CTRL ) )
843 {
844 case CTRL_IN_PROGRESS:
845 {
846 PALLOC(rrgrr_suspend_dcch_req, RRGRR_SUSPEND_DCCH_REQ);
847 PSEND(hCommRR, rrgrr_suspend_dcch_req);
848 }
849 break;
850 default:
851 TRACE_ERROR( "SIG_TC_CTRL_SUSPEND_DEDICATED_CHANNEL unexpected" );
852 break;
853 }
854 }/* sig_tc_ctrl_suspend_dedi_chan*/
855
856
857
858
859 /*
860 +------------------------------------------------------------------------------
861 | Function : sig_tc_ctrl_resume_dedi_chan
862 +------------------------------------------------------------------------------
863 | Description : Handles the internal signal SIG_TC_CTRL_RESUME_DEDICATED_CHANNEL
864 |
865 | Parameters : void
866 |
867 +------------------------------------------------------------------------------
868 */
869 GLOBAL void sig_tc_ctrl_resume_dedi_chan(void)
870 {
871 TRACE_ISIG( "sig_tc_ctrl_resume_dedi_chan" );
872 switch( GET_STATE( CTRL ) )
873 {
874 case CTRL_IN_PROGRESS:
875 ctrl_reinstall_old_scell_req( FALSE, RECONN_PROT_UNSPECIFIED );
876 break;
877 default:
878 TRACE_ERROR( "SIG_TC_CTRL_RESUME_DEDICATED_CHANNEL unexpected" );
879 break;
880 }
881 }/* sig_tc_ctrl_resume_dedi_chan*/
882
883
884 /*
885 +------------------------------------------------------------------------------
886 | Function : sig_tc_ctrl_contention_ok
887 +------------------------------------------------------------------------------
888 | Description : Cell change ok
889 |
890 | Parameters : void
891 |
892 +------------------------------------------------------------------------------
893 */
894 GLOBAL void sig_tc_ctrl_contention_ok(void)
895 {
896 TRACE_ISIG( "sig_tc_ctrl_contention_ok" );
897
898 switch( GET_STATE( CTRL ) )
899 {
900 case CTRL_GRR_NC_CCO:
901 case CTRL_IN_PROGRESS:
902 if( grr_data->cc_running )
903 {
904 vsi_t_stop( GRR_handle, T3134 );
905
906 grr_data->cc_running = FALSE;
907
908 ctrl_install_new_scell( );
909
910 {
911 PALLOC( rrgrr_resumed_tbf_req, RRGRR_RESUMED_TBF_REQ );
912 PSEND( hCommRR, rrgrr_resumed_tbf_req );
913 }
914 }
915
916 if( grr_t_status( T3174 ) > 0 )
917 {
918 SET_STATE( CTRL, CTRL_IN_PROGRESS );
919 ctrl_stop_T3174( );
920 ctrl_install_new_scell( );
921 #if defined (REL99) AND defined (TI_PS_FF_EMR)
922 grr_init_nc_list(&pcr_db->nc_cw.list );
923 grr_init_ba_bcch_nc_list(pcr_db);
924 #endif
925 }
926 break;
927 default:
928 TRACE_ERROR( "sig_tc_ctrl_contention_ok unexpected" );
929 break;
930 }
931 }/* sig_tc_ctrl_contention_ok()*/
932
933 /*
934 +------------------------------------------------------------------------------
935 | Function : sig_tc_ctrl_contention_failure
936 +------------------------------------------------------------------------------
937 | Description : Cell reselection has failled because of different
938 | of contention resolution sending by the MS in RLC and received uplink assigment
939 |
940 | Parameters : void
941 |
942 +------------------------------------------------------------------------------
943 */
944
945 GLOBAL void sig_tc_ctrl_contention_failure()
946 {
947 TRACE_ISIG( "sig_tc_ctrl_contention_failure" );
948 switch( GET_STATE( CTRL ) )
949 {
950 case CTRL_GRR_NC_CCO:
951 ctrl_stop_T3174();
952 TRACE_EVENT("ctrl_cell_change_order:No response on target cell");
953 grr_data->pcco_failure_cause = 1;
954 ctrl_pcco_failure();
955 break;
956 default:
957 TRACE_ERROR( "sig_tc_contention_failure unexpected" );
958 break;
959 }
960 } /*sig_tc_ctrl_contention_failure*/
961
962 /*
963 +------------------------------------------------------------------------------
964 | Function : sig_tc_ctrl_access_reject_on_new_cell
965 +------------------------------------------------------------------------------
966 | Description : Handles the internal signal ACCESS_REJECT_ON_NEW_CELL
967 |
968 | Parameters : void
969 |
970 +------------------------------------------------------------------------------
971 */
972
973 GLOBAL void sig_tc_ctrl_access_reject_on_new_cell(void)
974 {
975 TRACE_ISIG( "sig_tc_ctrl_access_reject_on_new_cell" );
976
977 ctrl_stop_T3174();
978 ctrl_pcco_failure();
979
980 } /*sig_tc_ctrl_access_reject_on_new_cell*/
981
982
983
984 /*
985 +------------------------------------------------------------------------------
986 | Function : sig_cs_ctrl_new_candidate
987 +------------------------------------------------------------------------------
988 | Description : Handles the internal signal SIG_CS_CTRL_NEW_CANDIDATE
989 | This signal indicates that the CS service has detected
990 | a new cell candidate for a cell reselection
991 |
992 | Parameters :
993 |
994 +------------------------------------------------------------------------------
995 */
996 GLOBAL void sig_cs_ctrl_new_candidate( T_CS_RESELECT_CAUSE reselect_cause )
997 {
998 TRACE_ISIG( "sig_cs_ctrl_new_candidate" );
999
1000 switch( GET_STATE( CTRL ) )
1001 {
1002 case CTRL_READY:
1003 case CTRL_ACCESS_DISABLED:
1004 case CTRL_READY_TO_PROGRESS:
1005 case CTRL_IN_PROGRESS:
1006 {
1007 SET_STATE( CTRL, CTRL_CR );
1008
1009 if( reselect_cause EQ CS_RESELECT_CAUSE_CTRL_ABNORMAL )
1010 {
1011 ctrl_stop_all_activities( CTRL_DC_CR_MS_GRR_ABNORMAL, NULL );
1012 }
1013 else
1014 {
1015 ctrl_stop_all_activities( CTRL_DC_CR_MS_GRR_NORMAL, NULL );
1016 }
1017 }
1018 break;
1019 case CTRL_CR_IN_SUSP:
1020 case CTRL_FAILED_CR_IN_SUSP:
1021 ctrl_stop_all_activities( CTRL_DC_OTHER, NULL );
1022
1023 /*lint -fallthrough*/
1024
1025 case CTRL_CR:
1026 case CTRL_FAILED_CR:
1027 case CTRL_GRR_NC_CCO:
1028 ctrl_handle_new_candidate( FALSE );
1029 break;
1030 default:
1031 TRACE_ERROR( "SIG_CS_CTRL_NEW_CANDIDATE unexpected" );
1032 break;
1033 }
1034 }/* sig_cs_ctrl_new_candidate*/
1035
1036 /*
1037 +------------------------------------------------------------------------------
1038 | Function : sig_psi_ctrl_ncell_param_valid
1039 +------------------------------------------------------------------------------
1040 | Description : Handles the internal signal SIG_PSI_CTRL_NCELL_PARAM_VALID
1041 |
1042 | Parameters :
1043 |
1044 +------------------------------------------------------------------------------
1045 */
1046 GLOBAL void sig_psi_ctrl_ncell_param_valid ( void )
1047 {
1048 TRACE_ISIG( "sig_psi_ctrl_ncell_param_valid" );
1049
1050 switch( GET_STATE( CTRL ) )
1051 {
1052 case CTRL_IN_PROGRESS:
1053 #if defined (REL99) AND defined (TI_PS_FF_EMR)
1054 psc_db->nc_ms.ncmeas.list.number=0;
1055 psc_db->nc_ms.rfreq.number = 0;
1056 /*This is called to reset the only Freq List from PMO as BA(GPRS) is changed.
1057 Spec 5.08 - sec 10.1.4.1
1058 The list is valid until an empty list is sent to the MS, there is a downlink
1059 signalling failure or the MS selects a new cell or the BA(GPRS) that is modified
1060 by the NC_FREQUENCY_LIST changes or the MS enters dedicated mode
1061
1062 The individual parameters are valid until the RESET command is sent to the MS or
1063 there is a downlink signalling failure or the MS goes to the Standby state or the
1064 MS enters dedicated mode*/
1065 /*NO BREAK */
1066 #endif
1067 /*lint -fallthrough*/
1068 case CTRL_GRR_NC_CCO:
1069 if( grr_data->is_pg_started )
1070
1071 {
1072 sig_ctrl_cs_start();
1073 }
1074 break;
1075 default:
1076 /* ignore */
1077 break;
1078 }
1079 } /* sig_psi_ctrl_ncell_param_valid() */
1080
1081 /*
1082 +------------------------------------------------------------------------------
1083 | Function : sig_psi_ctrl_ncell_param_invalid
1084 +------------------------------------------------------------------------------
1085 | Description : Handles the internal signal SIG_PSI_CTRL_NCELL_PARAM_INVALID
1086 |
1087 | Parameters :
1088 |
1089 +------------------------------------------------------------------------------
1090 */
1091 GLOBAL void sig_psi_ctrl_ncell_param_invalid ( void )
1092 {
1093 TRACE_ISIG( "sig_psi_ctrl_ncell_param_invalid" );
1094
1095 switch( GET_STATE( CTRL ) )
1096 {
1097 case CTRL_IN_PROGRESS:
1098 case CTRL_GRR_NC_CCO:
1099 sig_ctrl_cs_stop(CS_DC_OTHER);
1100 break;
1101 default:
1102 /*ignore*/
1103 break;
1104 }
1105 } /* sig_psi_ctrl_ncell_param_invalid() */
1106
1107 /*
1108 +------------------------------------------------------------------------------
1109 | Function : sig_psi_ctrl_access_changed
1110 +------------------------------------------------------------------------------
1111 | Description : Handles the internal signal SIG_PSI_CTRL_ACCESS_CHANGED
1112 |
1113 | Parameters :
1114 |
1115 +------------------------------------------------------------------------------
1116 */
1117 GLOBAL void sig_psi_ctrl_access_changed ( void )
1118 {
1119 TRACE_ISIG( "sig_psi_ctrl_access_changed" );
1120
1121 switch( GET_STATE( CTRL ) )
1122 {
1123 case CTRL_IN_PROGRESS:
1124 ctrl_send_cell_ind();
1125 break;
1126 default:
1127 TRACE_ERROR( "SIG_PSI_CTRL_ACCESS_CHANGED unexpected" );
1128 break;
1129 }
1130 } /* sig_psi_ctrl_access_changed() */
1131
1132 /*
1133 +------------------------------------------------------------------------------
1134 | Function : sig_psi_ctrl_ncell_psi_read
1135 +------------------------------------------------------------------------------
1136 | Description : Handles the internal signal SIG_PSI_CTRL_NCELL_PSI_READ
1137 |
1138 |
1139 | Parameters : BOOL read_successfully
1140 |
1141 +------------------------------------------------------------------------------
1142 */
1143 GLOBAL void sig_psi_ctrl_ncell_psi_read( BOOL read_successfully)
1144 {
1145 TRACE_ISIG( "sig_psi_ctrl_ncell_psi_read" );
1146 switch( GET_STATE( CTRL ) )
1147 {
1148 case CTRL_CR:
1149 case CTRL_CR_IN_SUSP:
1150 if(read_successfully)
1151 {
1152 /*
1153 * Inform RR and wait for positive indication of the cell reselection request
1154 */
1155 ctrl_send_cell_reselection_req( CR_COMPLETE );
1156 }
1157 else
1158 {
1159 ctrl_cc_rejected( );
1160 }
1161 break;
1162 default:
1163 TRACE_ERROR( "SIG_PSI_CTRL_NCELL_PSI_READ unexpected" );
1164 break;
1165 }
1166 }/* sig_psi_ctrl_ncell_psi_read*/
1167
1168 /*
1169 +------------------------------------------------------------------------------
1170 | Function : sig_psi_ctrl_int_list_invalid
1171 +------------------------------------------------------------------------------
1172 | Description : Handles the internal signal SIG_PSI_CTRL_INT_LIST_INVALID
1173 |
1174 |
1175 | Parameters : void
1176 |
1177 +------------------------------------------------------------------------------
1178 */
1179 GLOBAL void sig_psi_ctrl_int_list_invalid(void)
1180 {
1181 TRACE_ISIG( "sig_psi_ctrl_int_list_invalid" );
1182
1183 switch( GET_STATE( CTRL ) )
1184 {
1185 case CTRL_IN_PROGRESS:
1186 sig_ctrl_meas_int_list_invalid();
1187 break;
1188 default:
1189 /*ignore*/
1190 break;
1191 }
1192
1193 }/* sig_psi_ctrl_int_list_invalid*/
1194 /*
1195 +------------------------------------------------------------------------------
1196 | Function : sig_psi_ctrl_int_list_valid
1197 +------------------------------------------------------------------------------
1198 | Description : Handles the internal signal SIG_PSI_CTRL_INT_LIST_VALID
1199 |
1200 |
1201 | Parameters : void
1202 |
1203 +------------------------------------------------------------------------------
1204 */
1205 GLOBAL void sig_psi_ctrl_int_list_valid(void)
1206 {
1207 TRACE_ISIG( "sig_psi_ctrl_int_list_valid" );
1208 switch( GET_STATE( CTRL ) )
1209 {
1210 case CTRL_IN_PROGRESS:
1211 if(grr_data->is_pg_started)
1212 sig_ctrl_meas_int_list_valid();
1213 break;
1214 default:
1215 /*ignore*/
1216 break;
1217 }
1218 }/* sig_psi_ctrl_int_list_valid*/
1219
1220 /*
1221 +------------------------------------------------------------------------------
1222 | Function : sig_psi_ctrl_meas_param_invalid_psi5
1223 +------------------------------------------------------------------------------
1224 | Description : Handles the internal signal SIG_PSI_CTRL_MEAS_PARAM_INVALID_PSI5
1225 |
1226 |
1227 | Parameters : void
1228 |
1229 +------------------------------------------------------------------------------
1230 */
1231 GLOBAL void sig_psi_ctrl_meas_param_invalid_psi5(void)
1232 {
1233 TRACE_ISIG( "sig_psi_ctrl_meas_param_invalid_psi5" );
1234
1235 switch( GET_STATE( CTRL ) )
1236 {
1237 case CTRL_IN_PROGRESS:
1238 sig_ctrl_meas_ext_invalid_psi5();
1239 sig_ctrl_cs_nc_param_invalid();
1240 break;
1241 default:
1242 /*ignore*/
1243 break;
1244 }
1245
1246 }/* sig_psi_ctrl_meas_param_invalid_psi5*/
1247
1248 /*
1249 +------------------------------------------------------------------------------
1250 | Function : sig_psi_ctrl_meas_param_valid_psi5
1251 +------------------------------------------------------------------------------
1252 | Description : Handles the internal signal SIG_PSI_CTRL_MEAS_PARAM_VALID_PSI5
1253 |
1254 |
1255 | Parameters : void
1256 |
1257 +------------------------------------------------------------------------------
1258 */
1259 GLOBAL void sig_psi_ctrl_meas_param_valid_psi5(void)
1260 {
1261 TRACE_ISIG( "sig_psi_ctrl_meas_param_valid_psi5" );
1262
1263 switch( GET_STATE( CTRL ) )
1264 {
1265 case CTRL_IN_PROGRESS:
1266 if(grr_data->is_pg_started)
1267 {
1268 sig_ctrl_meas_ext_valid_psi5();
1269 sig_ctrl_cs_nc_param_valid();
1270 }
1271 break;
1272 default:
1273 /*ignore*/
1274 break;
1275 }
1276 }/* sig_psi_ctrl_meas_param_valid_psi5*/
1277
1278 /*
1279 +------------------------------------------------------------------------------
1280 | Function : sig_psi_ctrl_meas_param_invalid_si13
1281 +------------------------------------------------------------------------------
1282 | Description : Handles the internal signal SIG_PSI_CTRL_MEAS_PARAM_INVALID_SI13
1283 |
1284 | Parameters : void
1285 |
1286 +------------------------------------------------------------------------------
1287 */
1288 GLOBAL void sig_psi_ctrl_meas_param_invalid_si13( void )
1289 {
1290 TRACE_ISIG( "sig_psi_ctrl_meas_param_invalid_si13" );
1291
1292 switch( GET_STATE( CTRL ) )
1293 {
1294 case CTRL_IN_PROGRESS:
1295 sig_ctrl_cs_nc_param_invalid( );
1296 break;
1297
1298 default:
1299 /* do nothing */
1300 break;
1301 }
1302 }/* sig_psi_ctrl_meas_param_invalid_si13 */
1303
1304 /*
1305 +------------------------------------------------------------------------------
1306 | Function : sig_psi_ctrl_meas_param_valid_si13
1307 +------------------------------------------------------------------------------
1308 | Description : Handles the internal signal SIG_PSI_CTRL_MEAS_PARAM_VALID_SI13
1309 |
1310 | Parameters : void
1311 |
1312 +------------------------------------------------------------------------------
1313 */
1314 GLOBAL void sig_psi_ctrl_meas_param_valid_si13( BOOL ba_bcch_changed )
1315 {
1316 TRACE_ISIG( "sig_psi_ctrl_meas_param_valid_si13" );
1317
1318 switch( GET_STATE( CTRL ) )
1319 {
1320 case CTRL_IN_PROGRESS:
1321 sig_ctrl_cs_nc_param_valid( );
1322 sig_ctrl_tc_enable_grlc (CGRLC_QUEUE_MODE_DEFAULT, CGRLC_RA_DEFAULT );
1323
1324 if( ba_bcch_changed EQ TRUE )
1325 {
1326 sig_ctrl_meas_ba_changed( );
1327 sig_ctrl_cs_ba_changed( );
1328 }
1329 break;
1330
1331 default:
1332 /* do nothing */
1333 break;
1334 }
1335 }/* sig_psi_ctrl_meas_param_valid_si13 */
1336
1337 /*
1338 +------------------------------------------------------------------------------
1339 | Function : sig_psi_ctrl_new_pccch
1340 +------------------------------------------------------------------------------
1341 | Description : Handles the internal signal SIG_PSI_CTRL_NEW_PCCCH
1342 |
1343 |
1344 | Parameters : void
1345 |
1346 +------------------------------------------------------------------------------
1347 */
1348 GLOBAL void sig_psi_ctrl_new_pccch(void)
1349 {
1350 TRACE_ISIG( "sig_psi_ctrl_new_pccch" );
1351
1352 switch( GET_STATE( CTRL ) )
1353 {
1354 case CTRL_IN_PROGRESS:
1355 if(grr_data->is_pg_started)
1356 {
1357 TRACE_EVENT("Restart PCCCH: Config may have changed");
1358 sig_ctrl_pg_start();
1359 }
1360 break;
1361 default:
1362 TRACE_EVENT_P1( "NEW_PCCCH not handled in CTRL state: %d", grr_data->ctrl.state);
1363 break;
1364 }
1365 }/* sig_psi_ctrl_new_pccch*/
1366
1367 #ifdef REL99
1368 /*
1369 +------------------------------------------------------------------------------
1370 | Function : sig_psi_ctrl_cbch_info_ind
1371 +------------------------------------------------------------------------------
1372 | Description : This function gives the RRGRR_CBCH_INFO ind to RR.
1373 | This would be called on success cell selection/reselection
1374 | or when PSIs are completely acquired or when there is change
1375 | in PSI2,PSI13 or PSI8 messages.
1376 | This primitive is sent to RR only when the mobile is in R99
1377 | network.
1378 | The CBCH channel description present in this primitive is in
1379 | a form which could be used by MPH_* primitives in RR.
1380 | The frequency list is NOT in TI L1 form. When RR passes this
1381 | information to ALR, it is converted to TI L1 FORMAT.
1382 | Parameters : None.
1383 |
1384 +------------------------------------------------------------------------------
1385 */
1386 GLOBAL void sig_psi_ctrl_cbch_info_ind()
1387 {
1388 T_cbch *cbch_req = NULL;
1389 PALLOC(rrgrr_cbch_info_ind, RRGRR_CBCH_INFO_IND);
1390 TRACE_ISIG( "sig_psi_ctrl_cbch_info_ind" );
1391
1392 cbch_req = &(rrgrr_cbch_info_ind->cbch);
1393 memset (cbch_req, 0, sizeof (T_cbch));
1394
1395 /* fill in cbch info from psc_db */
1396 if(psc_db->v_cbch_chan_desc)
1397 {
1398 cbch_req->stat = STAT_ACT;
1399 cbch_req->ch = psc_db->cbch_chan_desc.chan_typ_tdma_offset;
1400 cbch_req->tn = psc_db->cbch_chan_desc.tn;
1401 cbch_req->tsc = psc_db->cbch_chan_desc.freq_par.tsc;
1402 /* If frequency encoding has indirect encoding/direct encoding 1
1403 * /direct encoding 2, then hopping is used. Otherwise channel
1404 * description describes a non-hopping channel.
1405 * When none of the above three coding methods are used, arfcn choice
1406 * should be set to true.Ref 3GPP 04.60 Section 12.8
1407 */
1408 cbch_req->h = (psc_db->cbch_chan_desc.freq_par.v_arfcn)?H_NO:H_FREQ;
1409 if(cbch_req->h)
1410 {
1411 /*
1412 * CBCH uses frequency hopping, then configure MAIO and HSN
1413 * and create a frequency hopping list from the cell allocation/
1414 * PSI13/direct encoding 2 scheme and the mobile allocation
1415 * stored in Frequency Parameters.
1416 */
1417 /* When hopping is allowed - hsn,maio and ma have to be filled. */
1418 ctrl_fill_cbch_hopping_params(cbch_req,&psc_db->cbch_chan_desc.freq_par);
1419 }
1420 else
1421 {
1422 /* non hopping channel */
1423 cbch_req->arfcn = psc_db->cbch_chan_desc.freq_par.arfcn;
1424 }
1425 }
1426 else
1427 {
1428 cbch_req->stat = STAT_INACT;
1429 }
1430 PSEND(hCommRR,rrgrr_cbch_info_ind);
1431 } /* sig_psi_ctrl_cbch_info_ind */
1432 #endif
1433
1434 /*
1435 +------------------------------------------------------------------------------
1436 | Function : sig_cs_ctrl_no_more_candidate
1437 +------------------------------------------------------------------------------
1438 | Description : Handles the internal signal SIG_CS_CTRL_NO_MORE_CANDIDATE
1439 | This signal indicates that the RR has to start a complete cell
1440 | selection procedure
1441 |
1442 | Parameters : void
1443 |
1444 +------------------------------------------------------------------------------
1445 */
1446 GLOBAL void sig_cs_ctrl_no_more_candidate( T_CS_RESELECT_CAUSE reselect_cause )
1447 {
1448 UBYTE state = GET_STATE( CTRL );
1449
1450 TRACE_ISIG( "sig_cs_ctrl_no_more_candidate" );
1451
1452 switch( state )
1453 {
1454 case CTRL_IN_PROGRESS:
1455 if( reselect_cause EQ CS_RESELECT_CAUSE_CTRL_ABNORMAL )
1456 {
1457 ctrl_tc_access_enable( sig_ctrl_tc_abnorm_rel_with_cr_failed );
1458 }
1459 else
1460 {
1461 SET_STATE( CTRL, CTRL_READY );
1462
1463 ctrl_stop_all_activities( CTRL_DC_CR_MS_GRR_NORMAL, NULL );
1464 }
1465 break;
1466
1467 case CTRL_CR:
1468 case CTRL_FAILED_CR:
1469 case CTRL_CR_IN_SUSP:
1470 case CTRL_FAILED_CR_IN_SUSP:
1471
1472 switch( reselect_cause )
1473 {
1474 case CS_RESELECT_CAUSE_CTRL_ABNORMAL:
1475 SET_STATE( CTRL, CTRL_IN_PROGRESS );
1476
1477 grr_set_db_ptr( DB_MODE_CC_REJ );
1478 ctrl_tc_access_enable( sig_ctrl_tc_abnorm_rel_with_cr_failed );
1479 sig_ctrl_psi_resumpt( );
1480 ctrl_enable_serving_cell( FALSE );
1481 break;
1482
1483 default:
1484 SET_STATE( CTRL, CTRL_READY );
1485
1486 ctrl_stop_all_activities( CTRL_DC_CR_MS_GRR_NORMAL, NULL );
1487 break;
1488 }
1489 break;
1490
1491 case CTRL_ACCESS_DISABLED:
1492 case CTRL_READY_TO_PROGRESS:
1493 {
1494 T_CTRL_CR_TYPE ctrl_cr_type;
1495
1496 ctrl_cr_type = ( reselect_cause EQ CS_RESELECT_CAUSE_CS_NORMAL ?
1497 CTRL_CR_TYPE_CS : CTRL_CR_TYPE_CONT );
1498
1499 ctrl_stop_all_activities( CTRL_DC_CR_MS_GRR_NORMAL, NULL );
1500 ctrl_handle_no_more_candidate( ctrl_cr_type, FALSE );
1501 }
1502 break;
1503
1504 case CTRL_READY:
1505 case CTRL_AUTO_RR_CR:
1506 case CTRL_RR_CR_IN_SUSP:
1507 ctrl_send_cell_reselection_req( CR_CONT );
1508 break;
1509
1510 default:
1511 TRACE_ERROR( "SIG_CS_CTRL_NO_MORE_CANDIDATE unexpected 2" );
1512 break;
1513 }
1514 }/* sig_cs_ctrl_no_more_candidate*/
1515
1516 /*
1517 +------------------------------------------------------------------------------
1518 | Function : sig_tc_ctrl_cr_started_rsp
1519 +------------------------------------------------------------------------------
1520 | Description : Handles the internal signal SIG_TC_CTRL_CR_STARTED_RSP
1521 | This signal indicates that the service TC is ready for
1522 | cell reselection, e.g. it stopped running procedures, controlled
1523 | the flow control etc.
1524 | Parameters : void
1525 |
1526 +------------------------------------------------------------------------------
1527 */
1528 GLOBAL void sig_tc_ctrl_cr_started_rsp( void )
1529 {
1530 T_NC_MVAL *nc_mval;
1531
1532 TRACE_ISIG( "sig_tc_ctrl_cr_started_rsp" );
1533
1534 switch( GET_STATE( CTRL ) )
1535 {
1536 case CTRL_WAIT_RSP_4_RR_CR:
1537 SET_STATE(CTRL, CTRL_AUTO_RR_CR);
1538 /*
1539 * Init PSI and psc_db parameters to be able to read/process new SI (PSI)
1540 */
1541 grr_prepare_db_for_new_cell();
1542 ctrl_send_cell_reselection_req( CR_COMPLETE );
1543 break;
1544 case CTRL_GRR_NC_CCO:
1545 if(grr_t_status( T3176 ) > 0 )
1546 {
1547 ctrl_start_cell_reselection( CTRL_CR_TYPE_NEW, TRUE );
1548 }
1549 else
1550 {
1551 TRACE_ASSERT( grr_data->db.cr_cell NEQ NULL );
1552
1553 nc_mval = &grr_data->db.nc_mval_list.nc_mval[grr_data->db.cr_cell->idx];
1554
1555 switch( nc_mval->sync_info.sync.status )
1556 {
1557 case( STAT_SYNC_OK ):
1558 ctrl_start_cell_reselection( CTRL_CR_TYPE_NEW, TRUE );
1559
1560 TRACE_EVENT( "sig_tc_ctrl_cr_started_rsp: cell already known(sync ok!)" );
1561 break;
1562
1563 case( STAT_SYNC_NONE ):
1564 ctrl_start_cell_reselection( CTRL_CR_TYPE_NEW_NOT_SYNCED, TRUE );
1565 break;
1566
1567 case( STAT_SYNC_FAILED ):
1568 default:
1569 /* stay in the serving cell */
1570 break;
1571 }
1572 }
1573 break;
1574 case CTRL_CR:
1575 case CTRL_CR_IN_SUSP:
1576 ctrl_handle_new_candidate( TRUE );
1577 break;
1578
1579 case CTRL_READY:
1580 ctrl_handle_no_more_candidate( CTRL_CR_TYPE_CS, TRUE );
1581 break;
1582
1583 case CTRL_RR_CR_IN_SUSP:
1584 ctrl_send_cell_reselection_req( CR_COMPLETE );
1585 break;
1586
1587 default:
1588 sig_tc_ctrl_tbf_release_cnf( );
1589 break;
1590 }
1591 }/* sig_tc_ctrl_cr_started_rsp*/
1592
1593
1594 /*
1595 +------------------------------------------------------------------------------
1596 | Function : sig_tc_ctrl_tbf_release_cnf
1597 +------------------------------------------------------------------------------
1598 | Description :
1599 |
1600 | Parameters :
1601 |
1602 +------------------------------------------------------------------------------
1603 */
1604 GLOBAL void sig_tc_ctrl_tbf_release_cnf ( void )
1605 {
1606 TRACE_ISIG( "sig_tc_ctrl_tbf_release_cnf" );
1607
1608 switch( GET_STATE( CTRL ) )
1609 {
1610 case CTRL_ACCESS_DISABLED:
1611 case CTRL_READY_TO_PROGRESS:
1612 switch( grr_data->ctrl.psi_tbf_rel_cause )
1613 {
1614 case CTRL_PTRC_PBCCH_ESTABLISHED:
1615 ctrl_start_monitoring_ccch( PAG_MODE_DEFAULT );
1616 ctrl_start_monitoring_bcch( UPDATE_SI13 );
1617 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_NULL, TASK_STOP_DUMMY_VALUE );
1618
1619 grr_data->ctrl.rr_state.cr_ind_return = CR_IND_RETURN_COMPLETE;
1620 break;
1621
1622 case CTRL_PTRC_COMPLETE_SI_READING:
1623 ctrl_start_monitoring_ccch( PAG_MODE_DEFAULT );
1624 ctrl_start_monitoring_bcch( COMPLETE_SI );
1625 sig_ctrl_psi_access_disabled( PSI_DC_OTHER );
1626 break;
1627
1628 case CTRL_PTRC_COMPLETE_PSI_READING:
1629 sig_ctrl_psi_access_disabled( PSI_DC_READ_PSI );
1630 break;
1631 }
1632
1633 grr_data->ctrl.psi_tbf_rel_cause = CTRL_PTRC_NONE;
1634 break;
1635
1636 default:
1637 TRACE_ERROR( "SIG_TC_CTRL_TBF_RELEASE_CNF unexpected" );
1638 break;
1639 }
1640 }/* sig_tc_ctrl_tbf_release_cnf */
1641
1642
1643
1644 /*
1645 +------------------------------------------------------------------------------
1646 | Function : sig_tc_ctrl_rel_state
1647 +------------------------------------------------------------------------------
1648 | Description : Handles the internal signal SIG_TC_CTRL_REL_STATE
1649 | This signal indicates that the service TC started or performed
1650 | tbf release
1651 | Parameters : T_RELEASE_STATE rel_state
1652 |
1653 +------------------------------------------------------------------------------
1654 */
1655 GLOBAL void sig_tc_ctrl_rel_state(T_RELEASE_STATE rel_state)
1656 {
1657 TRACE_ISIG( "sig_tc_ctrl_rel_state" );
1658
1659 sig_ctrl_psi_rel_state(rel_state);
1660
1661 }/* sig_tc_ctrl_rel_state*/
1662
1663 /*
1664 +------------------------------------------------------------------------------
1665 | Function : sig_tc_ctrl_control_block_result
1666 +------------------------------------------------------------------------------
1667 | Description :
1668 |
1669 | Parameters :
1670 |
1671 +------------------------------------------------------------------------------
1672 */
1673 GLOBAL void sig_tc_ctrl_control_block_result
1674 ( T_BLK_OWNER blk_owner, BOOL is_success )
1675 {
1676 TRACE_ISIG( "sig_tc_ctrl_control_block_result" );
1677
1678 ctrl_send_control_block_result( blk_owner, is_success );
1679
1680 }/* sig_tc_ctrl_control_block_result */
1681
1682 /*
1683 +------------------------------------------------------------------------------
1684 | Function : sig_tc_ctrl_send_stop_task_req
1685 +------------------------------------------------------------------------------
1686 | Description : Handles the internal signal SIG_TC_CTRL_STOP_TASK_REQ
1687 |
1688 | Parameters :
1689 |
1690 +------------------------------------------------------------------------------
1691 */
1692 GLOBAL void sig_tc_ctrl_send_stop_task_req( UBYTE v_stop_ccch )
1693 {
1694 TRACE_ISIG( "sig_tc_ctrl_send_stop_task_req" );
1695
1696 switch( GET_STATE( CTRL ) )
1697 {
1698 case CTRL_IN_PROGRESS:
1699 case CTRL_GRR_NC_CCO:
1700 ctrl_send_rrgrr_stop_task_req( CTRL_TASK_BCCH, v_stop_ccch );
1701 break;
1702 default:
1703 sig_ctrl_tc_stop_task_cnf_received( );
1704 TRACE_ERROR( "SIG_TC_CTRL_STOP_TASK_REQ unexpected" );
1705 break;
1706 }
1707 }/* sig_tc_ctrl_send_stop_task_req */
1708
1709
1710
1711 /*
1712 +------------------------------------------------------------------------------
1713 | Function : sig_gfp_ctrl_cc_order
1714 +------------------------------------------------------------------------------
1715 | Description : Handles the signal SIG_GFP_CTRL_CC_ORDER
1716 |
1717 | Parameters : -
1718 |
1719 +------------------------------------------------------------------------------
1720 */
1721 #ifdef REL99
1722 GLOBAL void sig_gfp_ctrl_cc_order(T_TIME time_to_poll )
1723 #else
1724 GLOBAL void sig_gfp_ctrl_cc_order( void )
1725 #endif
1726 {
1727 MCAST( d_cell_chan_order, D_CELL_CHAN_ORDER );
1728 TRACE_ISIG( "sig_gfp_ctrl_cc_order" );
1729
1730 switch( GET_STATE( CTRL ) )
1731 {
1732 case CTRL_IN_PROGRESS:
1733
1734 if (grr_data->nc2_on)
1735 {
1736 #ifdef REL99
1737 if(time_to_poll > 0)
1738 {
1739 vsi_t_start(GRR_handle, T_POLL_TIMER,time_to_poll);
1740 memcpy(&grr_data->ctrl.pcco, d_cell_chan_order, sizeof(T_D_CELL_CHAN_ORDER));
1741 grr_data->ctrl.poll_for_msg = GRR_PCCO_POLL;
1742 }
1743 else
1744 #endif
1745 {
1746 TRACE_EVENT( "PACKET CELL CHANGE ORDER RECEIVED" );
1747
1748 ctrl_cell_change_order
1749 ( CCO_TYPE_GRR, (void *)d_cell_chan_order );
1750 }
1751 }
1752 else
1753 {
1754 TRACE_EVENT( "PACKET CELL CHANGE ORDER RECEIVED,but NC2 is deactivated" );
1755 }
1756
1757 break;
1758
1759 default:
1760 TRACE_ERROR( "SIG_GFP_CTRL_CC_ORDER unexpected" );
1761 break;
1762 }
1763
1764 } /* sig_gfp_ctrl_cc_order() */
1765
1766 /*
1767 +------------------------------------------------------------------------------
1768 | Function : sig_gfp_ctrl_dsf_ind
1769 +------------------------------------------------------------------------------
1770 | Description : This signal indicates that a downlink signalling failure has
1771 | occured, we have to reselect a new cell
1772 | Parameters : payload to primitive
1773 |
1774 +------------------------------------------------------------------------------
1775 */
1776 GLOBAL void sig_gfp_ctrl_dsf_ind ( void )
1777 {
1778 TRACE_ISIG( "sig_gfp_ctrl_dsf_ind" );
1779
1780 /* A set of measurement reporting parameters (NETWORK_CONTROL_ORDER and
1781 * NC_REPORTING_PERIOD(s)) is broadcast on PBCCH. The parameters may also
1782 * be sent individually to an MS on PCCCH or PACCH, in which case it
1783 * overrides the broadcast parameters. The individual parameters are valid
1784 * until the RESET command is sent to the MS or there is a downlink
1785 * signalling failure or the MS goes to the Standby state or the MS enters
1786 * dedicated mode. */
1787 sig_ctrl_cs_reset_meas_rep_params ( );
1788
1789 ctrl_failure_processing( FAIL_SIG_DSF_IND );
1790
1791 }/* sig_gfp_ctrl_dsf_ind*/
1792
1793 #if defined (REL99) AND defined (TI_PS_FF_EMR)
1794 /*
1795 +------------------------------------------------------------------------------
1796 | Function : sig_cs_ctrl_enh_meas_report
1797 +------------------------------------------------------------------------------
1798 | Description : Handles the internal signal SIG_CS_CTRL_ENH_MEAS_REPORT
1799 |
1800 | Parameters : T_U_ENHNC_MEAS_REPORT *enh_meas_report
1801 |
1802 +------------------------------------------------------------------------------
1803 */
1804 GLOBAL void sig_cs_ctrl_enh_meas_report ( T_U_ENHNC_MEAS_REPORT *enh_meas_report)
1805 {
1806 TRACE_ISIG( "sig_cs_ctrl_enh_meas_report" );
1807
1808 switch( GET_STATE( CTRL ) )
1809 {
1810 case CTRL_IN_PROGRESS:
1811 case CTRL_GRR_NC_CCO:
1812 ctrl_send_control_block( CGRLC_BLK_OWNER_CS, (void*)enh_meas_report );
1813 break;
1814 default:
1815 TRACE_ERROR( "SIG_CS_CTRL_ENH_MEAS_REPORT unexpected" );
1816 break;
1817 }
1818 } /* sig_cs_ctrl_enh_meas_report() */
1819 #endif
1820
1821
1822
1823 /*
1824 +------------------------------------------------------------------------------
1825 | Function : sig_tc_ctrl_test_mode_ind
1826 +------------------------------------------------------------------------------
1827 | Description :
1828 |
1829 | Parameters :
1830 +------------------------------------------------------------------------------
1831 */
1832 GLOBAL void sig_tc_ctrl_test_mode_ind(void)
1833 {
1834 TRACE_EVENT("sig_tc_ctrl_test_mode_ind");
1835 if(grr_data->test_mode NEQ CGRLC_NO_TEST_MODE)
1836 {
1837 ctrl_stop_monitoring_ccch();
1838 }
1839
1840 }