comparison src/g23m-gprs/grr/grr_csp.c @ 1:d393cd9bb723

src/g23m-*: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
0:b6a5e36de839 1:d393cd9bb723
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 | CS of entity GRR.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef GRR_CSP_C
23 #define GRR_CSP_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 #include "grr_f.h"
43 #include "grr_csf.h"
44
45 /*==== CONST ================================================================*/
46
47 /*==== LOCAL VARS ===========================================================*/
48
49 /*==== PUBLIC FUNCTIONS =====================================================*/
50 /*
51 +------------------------------------------------------------------------------
52 | Function : cs_t3158
53 +------------------------------------------------------------------------------
54 | Description : Handles the timeout of timer T3158
55 |
56 | Parameters : void
57 |
58 +------------------------------------------------------------------------------
59 */
60 GLOBAL void cs_t3158 ( void )
61 {
62 #if defined (REL99) AND defined (TI_PS_FF_EMR)
63 BOOL is_enh_meas = cs_is_enh_meas_reporting();
64 #endif
65
66 TRACE_FUNCTION( "cs_t3158" );
67
68 TRACE_EVENT( "T3158 timeout" );
69
70 cs_store_rxlev_values( );
71 cs_reset_all_rxlev_results( );
72
73 switch( GET_STATE( CS ) )
74 {
75 case CS_IDLE:
76
77 switch( GET_STATE( CS_MEAS ) )
78 {
79 case CS_MEAS_NULL:
80 if( grr_is_pbcch_present( ) EQ FALSE )
81 {
82 cs_send_meas_rep_req( NC_REPORT_MEAS );
83
84 SET_STATE( CS_MEAS, CS_MEAS_REP_REQ );
85 }
86 else
87 {
88 SET_STATE( CS_MEAS, CS_MEAS_PMR_SENDING );
89
90
91 #if defined (REL99) AND defined (TI_PS_FF_EMR)
92 if( ((is_enh_meas EQ TRUE) AND (cs_send_enh_meas_rpt() EQ FALSE))
93 OR
94 ((is_enh_meas EQ FALSE) AND (cs_send_meas_rpt(TRUE) EQ FALSE)) )
95 #else
96 if( cs_send_meas_rpt( TRUE ) EQ FALSE )
97 #endif
98
99 {
100 /*
101 * The additional state check is necessary because signals might
102 * be send during the processing of the function cs_send_meas_rpt.
103 */
104 if( GET_STATE( CS_MEAS ) EQ CS_MEAS_PMR_SENDING )
105 {
106 SET_STATE( CS_MEAS, CS_MEAS_NULL );
107 }
108 }
109 }
110 break;
111
112 default:
113 break;
114 }
115
116 cs_process_t3158( );
117 break;
118
119 case CS_CR_NETWORK:
120 default:
121 /*
122 * RR performs an IA reject procedure resulting in a cell re-selection
123 * when timer T3158 expires. Timeout of T3158 resulted in a "T3158 timeout
124 * unexpected", this should be avoided.
125 */
126 cs_process_t3158( );
127 break;
128 }
129 } /* cs_t3158() */
130
131 /*
132 +------------------------------------------------------------------------------
133 | Function : cs_t_reselect
134 +------------------------------------------------------------------------------
135 | Description : Handles the timeout of timer T_RESELECT
136 |
137 | Parameters : void
138 |
139 +------------------------------------------------------------------------------
140 */
141 GLOBAL void cs_t_reselect ( void )
142 {
143 TRACE_FUNCTION( "cs_t_reselect" );
144
145 if( grr_t_status( T3174 ) > 0 )
146 {
147 TRACE_EVENT( "t_reslect expired when t3174 is running" );
148 return;
149 }
150 cs_cr_decision( CRDM_T_RESELECT );
151 } /* cs_t_reselect() */