comparison src/g23m-gprs/llc/llc_llmes.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 :
4 | Modul :
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 modul is part of the entity LLC and implements all
18 | functions to handles the incoming process internal signals as
19 | described in the SDL-documentation (LLME-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef LLC_LLMES_C
24 #define LLC_LLMES_C
25 #endif
26
27 #define ENTITY_LLC
28
29 /*==== INCLUDES =============================================================*/
30
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 "cnf_llc.h" /* to get cnf-definitions */
37 #include "mon_llc.h" /* to get mon-definitions */
38 #include "prim.h" /* to get the definitions of used SAP and directions */
39
40 #include "llc.h" /* to get the global entity definitions */
41 #include "llc_uitxs.h" /* to get signal interface to UITX */
42 #include "llc_uirxs.h" /* to get signal interface to UIRX */
43 #include "llc_itxs.h" /* to get signal interface to ITX */
44 #include "llc_irxs.h" /* to get signal interface to IRX */
45 #include "llc_txs.h" /* to get signal interface to TX */
46 #include "llc_uf.h" /* to get signal interface to U */
47 #include "llc_us.h" /* to get signal interface to U */
48
49
50 /*==== CONST ================================================================*/
51
52 /*==== LOCAL VARS ===========================================================*/
53
54 /*==== PRIVATE FUNCTIONS ====================================================*/
55
56 /*==== PUBLIC FUNCTIONS =====================================================*/
57
58
59
60 /*
61 +------------------------------------------------------------------------------
62 | Function : sig_u_llme_reset_ind
63 +------------------------------------------------------------------------------
64 | Description : Handles the internal signal SIG_U_LLME_RESET_IND
65 |
66 | Parameters :
67 |
68 +------------------------------------------------------------------------------
69 */
70 GLOBAL void sig_u_llme_reset_ind (void)
71 {
72 T_SAPI sapi;
73
74 TRACE_ISIG( "sig_u_llme_reset_ind" );
75
76 switch( GET_STATE( LLME ) )
77 {
78 case LLME_TLLI_ASSIGNED:
79 /* No break. */
80 case LLME_TLLI_ASSIGNED_SUSPENDED:
81 /*
82 * ATTENTION:
83 * The following loop implies that all SAPIs are odd numbers beginning
84 * with 1!
85 */
86 for (sapi = LL_SAPI_1; sapi <= LL_SAPI_11; sapi += 2)
87 {
88 SWITCH_LLC (sapi);
89
90 sig_llme_uitx_reset_req();
91 sig_llme_uirx_reset_req();
92
93 if ((sapi NEQ LL_SAPI_1) AND (sapi NEQ LL_SAPI_7))
94 {
95 sig_llme_itx_reset_req();
96 sig_llme_irx_reset_req();
97 }
98
99 sig_llme_tx_reset_req();
100 }
101 break;
102 default:
103 TRACE_ERROR( "SIG_U_LLME_RESET_IND unexpected" );
104 break;
105 }
106 } /* sig_u_llme_reset_ind() */
107
108 /*
109 +------------------------------------------------------------------------------
110 | Function : sig_u_llme_ready_ind
111 +------------------------------------------------------------------------------
112 | Description : Handles the internal signal SIG_U_LLME_READY_IND
113 |
114 | Parameters :
115 |
116 +------------------------------------------------------------------------------
117 */
118 GLOBAL void sig_u_llme_ready_ind (void)
119 {
120 T_SAPI sapi;
121
122 TRACE_ISIG( "sig_u_llme_ready_ind" );
123
124 switch( GET_STATE( LLME ) )
125 {
126 case LLME_TLLI_ASSIGNED:
127 /* No break. */
128 case LLME_TLLI_ASSIGNED_SUSPENDED:
129 /*
130 * ATTENTION:
131 * The following loop implies that all SAPIs are odd numbers beginning
132 * with 1!
133 */
134 for (sapi = LL_SAPI_1; sapi <= LL_SAPI_11; sapi += 2)
135 {
136 SWITCH_LLC (sapi);
137
138 sig_llme_tx_ready_req();
139 }
140
141 break;
142 default:
143 TRACE_ERROR( "SIG_U_LLME_READY_IND unexpected" );
144 break;
145 }
146 } /* sig_u_llme_ready_ind() */
147
148
149
150 /*
151 +------------------------------------------------------------------------------
152 | Function : sig_itx_llme_reest_ind
153 +------------------------------------------------------------------------------
154 | Description : Handles the internal signal SIG_ITX_LLME_REEST_IND
155 |
156 | Parameters :
157 |
158 +------------------------------------------------------------------------------
159 */
160 #ifdef CC_CONCEPT
161 GLOBAL void sig_itx_llme_reest_ind (USHORT error_cause)
162 #else
163 GLOBAL void sig_itx_llme_reest_ind (UBYTE error_cause)
164 #endif
165 {
166 TRACE_ISIG( "sig_itx_llme_reest_ind" );
167
168 switch( GET_STATE( LLME ) )
169 {
170 case LLME_TLLI_ASSIGNED:
171 /* No break. */
172 case LLME_TLLI_ASSIGNED_SUSPENDED:
173 /*
174 * First stop ABM operation
175 */
176 sig_llme_irx_abmrel_req();
177 sig_llme_itx_abmrel_req();
178 sig_llme_tx_flush_req(SERVICE_ITX);
179
180 /*
181 * Then initiate connection re-establishment
182 */
183 {
184 PALLOC (llgmm_status_ind, LLGMM_STATUS_IND);/*T_LLGMM_STATUS_IND*/
185
186 #ifdef LL_2to1
187 llgmm_status_ind->ps_cause.ctrl_value = CAUSE_is_from_llc;
188 llgmm_status_ind->ps_cause.value.llc_cause = error_cause;
189 #else
190 llgmm_status_ind->error_cause = error_cause;
191 #endif
192
193 PSEND (hCommGMM, llgmm_status_ind);
194 }
195
196 TRACE_1_INFO("Init re-establishment s:%d", llc_data->current_sapi);
197 sig_llme_u_reest_req();
198 break;
199
200 default:
201 TRACE_ERROR( "SIG_ITX_LLME_REEST_IND unexpected" );
202 break;
203 }
204 } /* sig_itx_llme_reest_ind() */
205
206
207 /*
208 +------------------------------------------------------------------------------
209 | Function : sig_u_llme_abmest_ind
210 +------------------------------------------------------------------------------
211 | Description : Handles the internal signal SIG_U_LLME_ABMEST_IND
212 |
213 | Parameters :
214 |
215 +------------------------------------------------------------------------------
216 */
217 GLOBAL void sig_u_llme_abmest_ind (void)
218 {
219 TRACE_ISIG( "sig_u_llme_abmest_ind" );
220
221 switch( GET_STATE( LLME ) )
222 {
223 case LLME_TLLI_ASSIGNED:
224 /* No break. */
225 case LLME_TLLI_ASSIGNED_SUSPENDED:
226 sig_llme_tx_flush_req (SERVICE_ITX);
227 sig_llme_irx_abmest_req();
228 sig_llme_itx_abmest_req();
229 break;
230
231 default:
232 TRACE_ERROR( "SIG_U_LLME_ABMEST_IND unexpected" );
233 break;
234 }
235 } /* sig_u_llme_abmest_ind() */
236
237
238
239
240 /*
241 +------------------------------------------------------------------------------
242 | Function : sig_u_llme_abmrel_ind
243 +------------------------------------------------------------------------------
244 | Description : Handles the internal signal SIG_U_LLME_ABMREL_IND
245 |
246 | Parameters :
247 |
248 +------------------------------------------------------------------------------
249 */
250 GLOBAL void sig_u_llme_abmrel_ind (void)
251 {
252 TRACE_ISIG( "sig_u_llme_abmrel_ind" );
253
254 switch( GET_STATE( LLME ) )
255 {
256 case LLME_TLLI_ASSIGNED:
257 /* No break. */
258 case LLME_TLLI_ASSIGNED_SUSPENDED:
259 sig_llme_irx_abmrel_req();
260 sig_llme_itx_abmrel_req();
261 sig_llme_tx_flush_req(SERVICE_ITX);
262 break;
263
264 default:
265 TRACE_ERROR( "SIG_U_LLME_ABMREL_IND unexpected" );
266 break;
267 }
268 } /* sig_u_llme_abmrel_ind() */
269
270