FreeCalypso > hg > fc-selenite
comparison src/g23m-gprs/grr/grr_ctrlp.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 | CTRL of entity GRR. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #ifndef GRR_CTRLP_C | |
23 #define GRR_CTRLP_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_ctrlf.h" /* */ | |
44 #include "grr_ctrls.h" | |
45 #include "grr_psis.h" /* */ | |
46 #include "grr_pgs.h" /* */ | |
47 #include "grr_meass.h" /* */ | |
48 #include "grr_tcs.h" /* */ | |
49 #include "grr_css.h" /* */ | |
50 #include "grr_f.h" /* */ | |
51 #include "grr_tcf.h" | |
52 | |
53 #include <string.h> /* for memcpy */ | |
54 | |
55 /*==== CONST ================================================================*/ | |
56 | |
57 /*==== LOCAL VARS ===========================================================*/ | |
58 | |
59 /*==== PRIVATE FUNCTIONS ====================================================*/ | |
60 | |
61 /*==== PUBLIC FUNCTIONS =====================================================*/ | |
62 /* | |
63 +------------------------------------------------------------------------------ | |
64 | Function : ctrl_gmmrr_enable_req | |
65 +------------------------------------------------------------------------------ | |
66 | Description : Handles the primitive GMMRR_ENABLE_REQ | |
67 | | |
68 | Parameters : *gmmrr_enable_req - Ptr to primitive payload | |
69 | | |
70 +------------------------------------------------------------------------------ | |
71 */ | |
72 GLOBAL void ctrl_gmmrr_enable_req ( T_GMMRR_ENABLE_REQ *gmmrr_enable_req ) | |
73 { | |
74 TRACE_FUNCTION( "gmmrr_enable_req" ); | |
75 | |
76 | |
77 switch( GET_STATE( CTRL ) ) | |
78 { | |
79 case CTRL_NULL: | |
80 SET_STATE( CTRL,CTRL_READY ); | |
81 | |
82 /* get MS class: A, B, C*/ | |
83 grr_data->ms.class_of_mode = gmmrr_enable_req->mobile_class; | |
84 /* BEGIN GRR_NMO_III*/ | |
85 if(grr_data->ms.class_of_mode EQ GMMRR_CLASS_B) | |
86 { | |
87 TRACE_EVENT(" Non reverting MS in GMMRR_NET_MODE_III: MS Class B"); | |
88 TRACE_EVENT(" CCCH monitoring during TBF is allowed"); | |
89 grr_data->ms.reverts_NMO_III = FALSE; /* Non reverting MS in NMO_III: MS Class B*/ | |
90 grr_data->ms.tbf_mon_ccch = TRUE; /* CCCH monitoring during TBF is allowed*/ | |
91 } | |
92 /* END GRR_NMO_III*/ | |
93 /* get MS access control class*/ | |
94 grr_data->ms.access_ctrl_class = gmmrr_enable_req->acc_contr_class; | |
95 | |
96 /* split_paging cycle value! NOT the code*/ | |
97 grr_data->ms.split_pg_cycle = gmmrr_enable_req->split_pg_cycle; | |
98 | |
99 /* split paging cycle support on CCCH */ | |
100 psc_db->net_ctrl.spgc_ccch_supp.ms_supp = gmmrr_enable_req->spgc_ccch_supp; | |
101 | |
102 psc_db->non_drx_timer = gmmrr_enable_req->gmmrr_non_drx_timer; /* values between 0 and 7*/ | |
103 break; | |
104 default: | |
105 TRACE_ERROR( "GMMRR_ENABLE_REQ unexpected" ); | |
106 break; | |
107 } | |
108 PFREE(gmmrr_enable_req); | |
109 } /* ctrl_gmmrr_enable_req() */ | |
110 | |
111 | |
112 | |
113 /* | |
114 +------------------------------------------------------------------------------ | |
115 | Function : ctrl_gmmrr_assign_req | |
116 +------------------------------------------------------------------------------ | |
117 | Description : Handles the primitive GMMRR_ASSIGN_REQ | |
118 | | |
119 | Parameters : *gmmrr_assign_req - Ptr to primitive payload | |
120 | | |
121 +------------------------------------------------------------------------------ | |
122 */ | |
123 GLOBAL void ctrl_gmmrr_assign_req ( T_GMMRR_ASSIGN_REQ *gmmrr_assign_req ) | |
124 { | |
125 TRACE_FUNCTION( "gmmrr_assign_req" ); | |
126 | |
127 | |
128 /* | |
129 * PTMSI | |
130 */ | |
131 grr_data->db.ms_id.old_ptmsi = gmmrr_assign_req->old_ptmsi; | |
132 grr_data->db.ms_id.new_ptmsi = gmmrr_assign_req->new_ptmsi; | |
133 | |
134 /* | |
135 * TLLI | |
136 */ | |
137 grr_data->db.ms_id.old_tlli = gmmrr_assign_req->old_tlli; | |
138 grr_data->db.ms_id.new_tlli = gmmrr_assign_req->new_tlli; | |
139 | |
140 if(grr_data->db.ms_id.new_tlli EQ GMMRR_TLLI_INVALID) | |
141 { | |
142 TRACE_EVENT("GMM HAS UNASSIGNED GRR, DELETE DATA QUEUE"); | |
143 } | |
144 /* for received TLLI: if old is valid take old tlli for received TLLI*/ | |
145 grr_data->db.ms_id.received_tlli = (gmmrr_assign_req->old_tlli NEQ GMMRR_TLLI_INVALID) | |
146 ? | |
147 gmmrr_assign_req->old_tlli | |
148 : | |
149 gmmrr_assign_req->new_tlli | |
150 ; | |
151 /*send PTMSI to RR*/ | |
152 grr_data->db.ms_id.rai = gmmrr_assign_req->rai; | |
153 | |
154 { | |
155 PALLOC(rrgrr_gprs_data_req, RRGRR_GPRS_DATA_REQ); | |
156 rrgrr_gprs_data_req->old_ptmsi = grr_data->db.ms_id.old_ptmsi; | |
157 rrgrr_gprs_data_req->new_ptmsi =grr_data->db.ms_id.new_ptmsi; | |
158 rrgrr_gprs_data_req->tlli = gmmrr_assign_req->new_tlli; | |
159 rrgrr_gprs_data_req->rai = grr_data->db.ms_id.rai; | |
160 | |
161 memset(&rrgrr_gprs_data_req->p_chan_req_des,0,sizeof(T_p_chan_req_des)); | |
162 memset(&rrgrr_gprs_data_req->gprs_meas_results,0,sizeof(T_gprs_meas_results)); | |
163 rrgrr_gprs_data_req->mac_req = 0; | |
164 rrgrr_gprs_data_req->cs_req = 0; | |
165 | |
166 PSEND(hCommRR, rrgrr_gprs_data_req); | |
167 } | |
168 | |
169 grr_data->db.ms_id.imsi.number_of_digits = ctrl_get_number_of_digits(gmmrr_assign_req->imsi.id); | |
170 memcpy(grr_data->db.ms_id.imsi.digit, gmmrr_assign_req->imsi.id, MAX_IMSI_DIGITS); | |
171 sig_ctrl_tc_enable_grlc (CGRLC_QUEUE_MODE_DEFAULT, CGRLC_RA_DEFAULT ); | |
172 PFREE(gmmrr_assign_req); | |
173 | |
174 } /* ctrl_gmmrr_assign_req() */ | |
175 | |
176 | |
177 | |
178 /* | |
179 +------------------------------------------------------------------------------ | |
180 | Function : ctrl_gmmrr_disable_req | |
181 +------------------------------------------------------------------------------ | |
182 | Description : Handles the primitive GMMRR_DISABLE_REQ | |
183 | | |
184 | Parameters : *gmmrr_disable_req - Ptr to primitive payload | |
185 | |
186 +------------------------------------------------------------------------------ | |
187 */ | |
188 GLOBAL void ctrl_gmmrr_disable_req ( T_GMMRR_DISABLE_REQ *gmmrr_disable_req ) | |
189 { | |
190 TRACE_FUNCTION( "gmmrr_disable_req" ); | |
191 | |
192 | |
193 SET_STATE( CTRL,CTRL_NULL ); | |
194 | |
195 ctrl_stop_all_activities( CTRL_DC_OTHER, NULL ); | |
196 ctrl_start_monitoring_ccch( PAG_MODE_DEFAULT ); | |
197 | |
198 /* Disable GRLC , delete all primitives */ | |
199 tc_cgrlc_disable_req(CGRLC_PRIM_STATUS_ALL); | |
200 | |
201 /* Re-initialize GRR database */ | |
202 TRACE_EVENT("Reinit GRR db"); | |
203 grr_init(); | |
204 | |
205 PFREE(gmmrr_disable_req); | |
206 | |
207 } /* ctrl_gmmrr_disable_req() */ | |
208 | |
209 | |
210 /* | |
211 +------------------------------------------------------------------------------ | |
212 | Function : ctrl_rrgrr_gprs_si13_ind | |
213 +------------------------------------------------------------------------------ | |
214 | Description : Handles the primitive RRGRR_GPRS_SI13_IND | |
215 | | |
216 | Parameters : *rrgrr_gprs_si13_ind - Ptr to primitive payload | |
217 | | |
218 +------------------------------------------------------------------------------ | |
219 */ | |
220 GLOBAL void ctrl_rrgrr_gprs_si13_ind | |
221 ( T_RRGRR_GPRS_SI13_IND * rrgrr_gprs_si13_ind ) | |
222 { | |
223 UBYTE state = GET_STATE( CTRL ); | |
224 USHORT arfcn; | |
225 UBYTE bsic; | |
226 T_GPRS_SERVICE gprs_service = ctrl_get_gprs_service( ); | |
227 | |
228 TRACE_FUNCTION( "ctrl_rrgrr_gprs_si13_ind" ); | |
229 | |
230 TRACE_EVENT_P5( "RRGRR_GPRS_SI13_IND - CELL: %d %d, %d %d, STATE: %d", | |
231 rrgrr_gprs_si13_ind->serving_cell_info.bcch_arfcn, | |
232 rrgrr_gprs_si13_ind->serving_cell_info.bcch_bsic, | |
233 rrgrr_gprs_si13_ind->cause, | |
234 rrgrr_gprs_si13_ind->serving_cell_info.limited, | |
235 state ); | |
236 | |
237 switch( state ) | |
238 { | |
239 case CTRL_READY: | |
240 case CTRL_ACCESS_DISABLED: | |
241 case CTRL_READY_TO_PROGRESS: | |
242 case CTRL_IN_PROGRESS: | |
243 case CTRL_AUTO_RR_CR: | |
244 case CTRL_RR_CR_IN_SUSP: | |
245 switch( rrgrr_gprs_si13_ind->cause ) | |
246 { | |
247 case GPRS_NOT_SUPPORTED: | |
248 ctrl_si13_received( rrgrr_gprs_si13_ind ); | |
249 | |
250 if( ( state & CTRL_SUSPENSION_MASK ) EQ CTRL_SUSPENSION_YES ) | |
251 { | |
252 SET_STATE( CTRL, CTRL_NO_CELL_SUSP ); | |
253 | |
254 /* | |
255 * cell indication is sent after resume: | |
256 * ctrl_send_cell_ind( ); | |
257 */ | |
258 } | |
259 else | |
260 { | |
261 SET_STATE( CTRL, CTRL_READY ); | |
262 | |
263 ctrl_send_cell_ind( ); | |
264 } | |
265 | |
266 ctrl_stop_all_activities( CTRL_DC_OTHER, NULL ); | |
267 ctrl_send_cell_reselection_req( CR_COMPLETE ); | |
268 break; | |
269 | |
270 case GPRS_SUPPORTED: | |
271 if( grr_decode_rr | |
272 ( ( T_MSGBUF* )( &rrgrr_gprs_si13_ind->sdu ) ) EQ D_SYS_INFO_13 ) | |
273 { | |
274 ctrl_si13_received( rrgrr_gprs_si13_ind ); | |
275 | |
276 if( state EQ CTRL_IN_PROGRESS AND | |
277 gprs_service NEQ ctrl_get_gprs_service( ) ) | |
278 { | |
279 ctrl_send_cell_ind( ); | |
280 } | |
281 } | |
282 else | |
283 { | |
284 if( ( state & CTRL_CELL_RESEL_MASK ) EQ CTRL_CELL_RESEL_RR ) | |
285 { | |
286 ctrl_send_cell_reselection_req( CR_CONT ); | |
287 } | |
288 else | |
289 { | |
290 /* impl. missing, what happens if decoding failed? */ | |
291 } | |
292 } | |
293 break; | |
294 | |
295 case GPRS_CELL_NOT_SUITABLE: | |
296 default: | |
297 /* do nothing */ | |
298 break; | |
299 } | |
300 break; | |
301 | |
302 case CTRL_CR: | |
303 case CTRL_CR_IN_SUSP: | |
304 case CTRL_RR_NC_CCO: | |
305 case CTRL_GRR_NC_CCO: | |
306 if( grr_t_status(T3176) > 0 ) | |
307 { | |
308 if(grr_decode_rr((T_MSGBUF *)(&(rrgrr_gprs_si13_ind->sdu))) EQ D_SYS_INFO_13) | |
309 { | |
310 if( rrgrr_gprs_si13_ind->serving_cell_info.bcch_arfcn EQ | |
311 posc_db->pbcch.bcch.arfcn ) | |
312 { | |
313 /* impl. missing, what happend if service on old serving cell has changed? */ | |
314 | |
315 ctrl_reinstall_old_scell_cnf( TRUE ); | |
316 sig_ctrl_psi_resumpt_cc( ); | |
317 ctrl_si13_received( rrgrr_gprs_si13_ind ); | |
318 ctrl_enable_serving_cell( FALSE ); | |
319 ctrl_send_cell_reselection_req( CR_COMPLETE ); | |
320 sig_ctrl_tc_enable_grlc (CGRLC_QUEUE_MODE_LLC, CGRLC_RA_DEFAULT ); | |
321 arfcn = grr_data->ctrl.pcc_arfcn; | |
322 bsic = grr_data->ctrl.pcc_bsic; | |
323 | |
324 ctrl_build_pcco_failure_msg(arfcn, bsic); | |
325 } | |
326 } | |
327 } | |
328 else if( pcr_db NEQ NULL ) | |
329 { | |
330 if( rrgrr_gprs_si13_ind->cause EQ GPRS_CELL_NOT_SUITABLE ) | |
331 { | |
332 grr_set_db_ptr( DB_MODE_CC_REQ ); | |
333 | |
334 SET_STATE_FAILED_CR( state ); | |
335 | |
336 ctrl_cc_rejected( ); | |
337 } | |
338 else if( rrgrr_gprs_si13_ind->serving_cell_info.bcch_arfcn EQ | |
339 pcr_db->pbcch.bcch.arfcn AND | |
340 rrgrr_gprs_si13_ind->serving_cell_info.bcch_bsic EQ | |
341 pcr_db->pbcch.bcch.bsic ) | |
342 { | |
343 if( rrgrr_gprs_si13_ind->cause EQ GPRS_NOT_SUPPORTED ) | |
344 { | |
345 grr_set_db_ptr( DB_MODE_CC_REQ ); | |
346 | |
347 /* | |
348 * The neighbour cell does not support GPRS: No SI13 | |
349 * We have to check the GPRS re-selection parameters and | |
350 * decide whether we can camp on this cell or not | |
351 * Therefore compare GPRS re-selection parameters | |
352 */ | |
353 if( sig_ctrl_cs_check_c1_new_scell | |
354 ( state EQ CTRL_RR_NC_CCO OR state EQ CTRL_GRR_NC_CCO, | |
355 rrgrr_gprs_si13_ind->serving_cell_info.gprs_rxlev_access_min, | |
356 rrgrr_gprs_si13_ind->serving_cell_info.gprs_ms_txpwr_max_cch ) ) | |
357 { | |
358 ctrl_si13_received( rrgrr_gprs_si13_ind ); | |
359 | |
360 /* | |
361 * the selected cell is suitable | |
362 */ | |
363 if( ( state & CTRL_SUSPENSION_MASK ) EQ CTRL_SUSPENSION_YES ) | |
364 { | |
365 SET_STATE( CTRL, CTRL_NO_CELL_SUSP ); | |
366 | |
367 /* | |
368 * cell indication is sent after resume: | |
369 * ctrl_send_cell_ind( ); | |
370 */ | |
371 } | |
372 else | |
373 { | |
374 SET_STATE( CTRL, CTRL_READY ); | |
375 | |
376 ctrl_send_cell_ind( ); | |
377 } | |
378 | |
379 ctrl_install_new_scell ( ); | |
380 ctrl_send_cell_reselection_req( CR_COMPLETE ); | |
381 grr_set_db_ptr( DB_MODE_CC_ACC ); | |
382 } | |
383 else | |
384 { | |
385 /* | |
386 * the selected cell is not suitable | |
387 */ | |
388 | |
389 SET_STATE_FAILED_CR( state ); | |
390 | |
391 ctrl_cc_rejected( ); | |
392 } | |
393 } | |
394 else /* if( rrgrr_gprs_si13_ind->cause EQ GPRS_SUPPORTED ) */ | |
395 { | |
396 grr_set_db_ptr( DB_MODE_CC_REQ ); | |
397 | |
398 if(grr_decode_rr((T_MSGBUF *)(&(rrgrr_gprs_si13_ind->sdu))) EQ D_SYS_INFO_13) | |
399 { | |
400 /* | |
401 * Check whether the selected NCELL is OK or not | |
402 */ | |
403 if( sig_ctrl_cs_check_c1_new_scell | |
404 ( state EQ CTRL_RR_NC_CCO OR state EQ CTRL_GRR_NC_CCO, | |
405 rrgrr_gprs_si13_ind->serving_cell_info.gprs_rxlev_access_min, | |
406 rrgrr_gprs_si13_ind->serving_cell_info.gprs_ms_txpwr_max_cch ) ) | |
407 { | |
408 ctrl_si13_received( rrgrr_gprs_si13_ind ); | |
409 } | |
410 else | |
411 { | |
412 SET_STATE_FAILED_CR( state ); | |
413 | |
414 ctrl_cc_rejected( ); | |
415 } | |
416 } | |
417 else | |
418 { | |
419 SET_STATE_FAILED_CR( state ); | |
420 | |
421 ctrl_cc_rejected( ); | |
422 } | |
423 } | |
424 } | |
425 else | |
426 { | |
427 TRACE_EVENT_P2( "RRGRR_GPRS_SI13_IND - GPRS indication expected from CELL: %d %d", | |
428 pcr_db->pbcch.bcch.arfcn, pcr_db->pbcch.bcch.bsic ); | |
429 } | |
430 } | |
431 break; | |
432 | |
433 /* | |
434 * In the following states GRR does not expect a RRGRR_GPRS_SI13_IND | |
435 * due to several different reasons, please see details below. | |
436 */ | |
437 | |
438 /* | |
439 * CTRL is switched off, no processing will be performed at all. | |
440 */ | |
441 case CTRL_NULL: | |
442 | |
443 /* | |
444 * CTRL waits for a confirmation, all states are interim states. | |
445 * Shall GRR be ready for processing RRGRR_GPRS_SI13_IND anyway ??? | |
446 */ | |
447 case CTRL_WAIT_CS_PAGE_RES: | |
448 case CTRL_WAIT_FOR_CNF_OF_SUSPENSION: | |
449 case CTRL_WAIT_RSP_4_RR_CR: | |
450 | |
451 /* | |
452 * CTRL is in a temporary state, which shall be set and reset | |
453 * during one primitive processing cycle. | |
454 */ | |
455 case CTRL_FAILED_CR: | |
456 case CTRL_FAILED_CR_IN_SUSP: | |
457 | |
458 /* | |
459 * CTRL expects a RRGRR_GPRS_SI13_IND during suspension only when | |
460 * a RRGRR_CR_IND was sent before, the state changes to | |
461 * CTRL_RR_CR_IN_SUSP or CTRL_CR_IN_SUSP in that case. | |
462 */ | |
463 case CTRL_SUSPENDED: | |
464 case CTRL_ACC_ENABLED_SUSP: | |
465 | |
466 default: | |
467 /* do nothing */ | |
468 break; | |
469 } | |
470 | |
471 PFREE( rrgrr_gprs_si13_ind ); | |
472 | |
473 } /* ctrl_rrgrr_gprs_si13_ind() */ | |
474 | |
475 | |
476 | |
477 /* | |
478 +------------------------------------------------------------------------------ | |
479 | Function : ctrl_rrgrr_packet_paging_ind | |
480 +------------------------------------------------------------------------------ | |
481 | Description : Handles the primitive RRGRR_PACKET_PAGING_IND: this primitve indicates | |
482 | that the RR part has received a paging for packet data transfer | |
483 | CTRL informs the PG-Service and PG-Service has to decide how to | |
484 | react to this indication | |
485 | | |
486 | Parameters : *rrgrr_packet_paging_ind - Ptr to primitive payload | |
487 | | |
488 +------------------------------------------------------------------------------ | |
489 */ | |
490 GLOBAL void ctrl_rrgrr_packet_paging_ind ( T_RRGRR_PACKET_PAGING_IND *rrgrr_packet_paging_ind ) | |
491 { | |
492 TRACE_FUNCTION( "rrgrr_packet_paging_ind" ); | |
493 | |
494 switch( GET_STATE( CTRL ) ) | |
495 { | |
496 case CTRL_IN_PROGRESS: | |
497 sig_ctrl_pg_indication(rrgrr_packet_paging_ind->pg_type); | |
498 break; | |
499 default: | |
500 TRACE_ERROR( "RRGRR_PACKET_PAGING_IND unexpected" ); | |
501 break; | |
502 } | |
503 PFREE (rrgrr_packet_paging_ind); | |
504 } /* ctrl_rrgrr_packet_paging_ind() */ | |
505 | |
506 | |
507 | |
508 | |
509 | |
510 /* | |
511 +------------------------------------------------------------------------------ | |
512 | Function : ctrl_rrgrr_ia_ind | |
513 +------------------------------------------------------------------------------ | |
514 | Description : Handles the primitive RRGRR_IA_IND | |
515 | | |
516 | Parameters : *rrgrr_ia_ind - Ptr to primitive payload | |
517 | | |
518 +------------------------------------------------------------------------------ | |
519 */ | |
520 GLOBAL void ctrl_rrgrr_ia_ind ( T_RRGRR_IA_IND *rrgrr_ia_ind ) | |
521 { | |
522 TRACE_FUNCTION( "rrgrr_ia_ind" ); | |
523 | |
524 /* | |
525 | |
526 { | |
527 ULONG trace[5]; | |
528 | |
529 trace[0] = rrgrr_ia_ind->sdu.buf[0] << 24; | |
530 trace[0] |= rrgrr_ia_ind->sdu.buf[1] << 16; | |
531 trace[0] |= rrgrr_ia_ind->sdu.buf[2] << 8; | |
532 trace[0] |= rrgrr_ia_ind->sdu.buf[3] << 0; | |
533 | |
534 trace[1] = rrgrr_ia_ind->sdu.buf[4] << 24; | |
535 trace[1] |= rrgrr_ia_ind->sdu.buf[5] << 16; | |
536 trace[1] |= rrgrr_ia_ind->sdu.buf[6] << 8; | |
537 trace[1] |= rrgrr_ia_ind->sdu.buf[7] << 0; | |
538 | |
539 trace[2] = rrgrr_ia_ind->sdu.buf[8] << 24; | |
540 trace[2] |= rrgrr_ia_ind->sdu.buf[9] << 16; | |
541 trace[2] |= rrgrr_ia_ind->sdu.buf[10] << 8; | |
542 trace[2] |= rrgrr_ia_ind->sdu.buf[11] << 0; | |
543 | |
544 trace[3] = rrgrr_ia_ind->sdu.buf[12] << 24; | |
545 trace[3] |= rrgrr_ia_ind->sdu.buf[13] << 16; | |
546 trace[3] |= rrgrr_ia_ind->sdu.buf[14] << 8; | |
547 trace[3] |= rrgrr_ia_ind->sdu.buf[15] << 0; | |
548 | |
549 trace[4] = rrgrr_ia_ind->sdu.buf[16] << 24; | |
550 trace[4] |= rrgrr_ia_ind->sdu.buf[17] << 16; | |
551 trace[4] |= rrgrr_ia_ind->sdu.buf[18] << 8; | |
552 trace[4] |= rrgrr_ia_ind->sdu.buf[19] << 0; | |
553 | |
554 TRACE_EVENT_P8( "RRGRR_IA_IND: %08X%08X%08X%08X%08X%02X%02X%02X", | |
555 trace[0], trace[1], trace[2], trace[3], trace[4], | |
556 rrgrr_ia_ind->sdu.buf[20], rrgrr_ia_ind->sdu.buf[21], | |
557 rrgrr_ia_ind->sdu.buf[22] ); | |
558 } | |
559 | |
560 */ | |
561 | |
562 if(D_IMM_ASSIGN EQ grr_decode_rr((T_MSGBUF *)(&(rrgrr_ia_ind->sdu)))) | |
563 { | |
564 switch( GET_STATE( CTRL ) ) | |
565 { | |
566 case CTRL_IN_PROGRESS: | |
567 case CTRL_GRR_NC_CCO: | |
568 sig_ctrl_tc_ia_received (rrgrr_ia_ind); | |
569 break; | |
570 default: | |
571 TRACE_ERROR( "RRGRR_IA_IND unexpected" ); | |
572 break; | |
573 } | |
574 } | |
575 else | |
576 { | |
577 TRACE_ERROR( "RRGRR_IA_IND wrong message type" ); | |
578 } | |
579 | |
580 PFREE (rrgrr_ia_ind); | |
581 } /* ctrl_rrgrr_ia_ind() */ | |
582 | |
583 | |
584 | |
585 /* | |
586 +------------------------------------------------------------------------------ | |
587 | Function : ctrl_rrgrr_iaext_ind | |
588 +------------------------------------------------------------------------------ | |
589 | Description : Handles the primitive RRGRR_IAEXT_IND | |
590 | | |
591 | Parameters : *rrgrr_iaext_ind - Ptr to primitive payload | |
592 | | |
593 +------------------------------------------------------------------------------ | |
594 */ | |
595 GLOBAL void ctrl_rrgrr_iaext_ind ( T_RRGRR_IAEXT_IND *rrgrr_iaext_ind) | |
596 { | |
597 TRACE_FUNCTION( "rrgrr_iaext_ind" ); | |
598 if(D_IMM_ASSIGN_EXT == grr_decode_rr((T_MSGBUF *)(&(rrgrr_iaext_ind->sdu)))) | |
599 { | |
600 switch( GET_STATE( CTRL ) ) | |
601 { | |
602 case CTRL_IN_PROGRESS: | |
603 sig_ctrl_tc_iaext_received (rrgrr_iaext_ind); | |
604 break; | |
605 default: | |
606 TRACE_ERROR( "RRGRR_IAEXT_IND unexpected" ); | |
607 break; | |
608 } | |
609 } | |
610 else | |
611 { | |
612 TRACE_ERROR( "RRGRR_IAEXT_IND wrong message type" ); | |
613 } | |
614 PFREE (rrgrr_iaext_ind); | |
615 | |
616 } /* ctrl_rrgrr_iaext_ind() */ | |
617 | |
618 | |
619 | |
620 /* | |
621 +------------------------------------------------------------------------------ | |
622 | Function : ctrl_rrgrr_assignment_rej_ind | |
623 +------------------------------------------------------------------------------ | |
624 | Description : Handles the primitive RRGRR_ASSIGNMENT_REJ_IND | |
625 | | |
626 | Parameters : *rrgrr_assignment_rej_ind - Ptr to primitive payload | |
627 | | |
628 +------------------------------------------------------------------------------ | |
629 */ | |
630 GLOBAL void ctrl_rrgrr_assignment_rej_ind ( T_RRGRR_ASSIGNMENT_REJ_IND *rrgrr_assignment_rej_ind ) | |
631 { | |
632 TRACE_FUNCTION( "rrgrr_assignment_rej_ind" ); | |
633 | |
634 | |
635 switch( GET_STATE( CTRL ) ) | |
636 { | |
637 case CTRL_IN_PROGRESS: | |
638 sig_ctrl_tc_iarej_received (rrgrr_assignment_rej_ind); | |
639 break; | |
640 case CTRL_GRR_NC_CCO: | |
641 sig_ctrl_tc_iarej_received (rrgrr_assignment_rej_ind); | |
642 ctrl_stop_T3174(); | |
643 ctrl_pcco_failure(); | |
644 break; | |
645 default: | |
646 TRACE_ERROR( "RRGRR_ASSIGNMENT_REJ_IND unexpected" ); | |
647 break; | |
648 } | |
649 | |
650 PFREE (rrgrr_assignment_rej_ind); | |
651 | |
652 } /* ctrl_rrgrr_assignment_rej_ind() */ | |
653 | |
654 /* | |
655 +------------------------------------------------------------------------------ | |
656 | Function : ctrl_t3134 | |
657 +------------------------------------------------------------------------------ | |
658 | Description : Handles the time out of T3134 | |
659 | | |
660 | Parameters : No parameter | |
661 +------------------------------------------------------------------------------ | |
662 */ | |
663 GLOBAL void ctrl_t3134 ( void ) | |
664 { | |
665 TRACE_FUNCTION( "ctrl_t3134" ); | |
666 | |
667 switch( GET_STATE( CTRL ) ) | |
668 { | |
669 case CTRL_RR_NC_CCO: | |
670 sig_ctrl_tc_cr_timerout_cnf(); | |
671 ctrl_reinstall_old_scell_req( FALSE, RECONN_TIMER_EXPIRED ); | |
672 break; | |
673 default: | |
674 TRACE_ERROR( "time out of T3134 unexpected" ); | |
675 break; | |
676 } | |
677 | |
678 }/* ctrl_t3134() */ | |
679 | |
680 /* | |
681 +------------------------------------------------------------------------------ | |
682 | Function : ctrl_t3174 | |
683 +------------------------------------------------------------------------------ | |
684 | Description : Handles the time out of T3174 | |
685 | | |
686 | Parameters : No parameter | |
687 +------------------------------------------------------------------------------ | |
688 */ | |
689 GLOBAL void ctrl_t3174 ( void ) | |
690 { | |
691 TRACE_FUNCTION( "ctrl_t3174" ); | |
692 TRACE_EVENT("T3174 expired"); | |
693 | |
694 switch( GET_STATE( CTRL ) ) | |
695 { | |
696 case CTRL_GRR_NC_CCO: | |
697 case CTRL_IN_PROGRESS: | |
698 grr_data->pcco_failure_cause = 1; /*No_Resp_On_Target_Cell*/ | |
699 ctrl_pcco_failure( ); | |
700 break; | |
701 default: | |
702 TRACE_ERROR( "time out of T3174 unexpected" ); | |
703 break; | |
704 } | |
705 } /* ctrl_t3174() */ | |
706 | |
707 /* | |
708 +------------------------------------------------------------------------------ | |
709 | Function : ctrl_start_t3174 | |
710 +------------------------------------------------------------------------------ | |
711 | Description : Handles the time starting of T3174 | |
712 | | |
713 | Parameters : No parameter | |
714 +------------------------------------------------------------------------------ | |
715 */ | |
716 GLOBAL void ctrl_start_T3174 ( void ) | |
717 { | |
718 TRACE_FUNCTION( "tc_start_T3174" ); | |
719 | |
720 TRACE_EVENT( "T3174 for packet cell change started" ); | |
721 | |
722 vsi_t_start( GRR_handle,T3174, T3174_VALUE ); | |
723 | |
724 } /* tc_start_T3174 */ | |
725 | |
726 /* | |
727 +------------------------------------------------------------------------------ | |
728 | Function : ctrl_t3176 | |
729 +------------------------------------------------------------------------------ | |
730 | Description : Handles the timer T3176 | |
731 | | |
732 | Parameters : inctance_i - identifier of timer's inctance | |
733 | | |
734 +------------------------------------------------------------------------------ | |
735 */ | |
736 GLOBAL void ctrl_t3176 ( void ) | |
737 { | |
738 TRACE_FUNCTION( "ctrl_t3176" ); | |
739 TRACE_EVENT("T3176 expired"); | |
740 | |
741 switch( GET_STATE( CTRL ) ) | |
742 { | |
743 case CTRL_GRR_NC_CCO: | |
744 | |
745 SET_STATE( CTRL,CTRL_IN_PROGRESS ); | |
746 | |
747 /*lint -fallthrough*/ | |
748 | |
749 default: | |
750 ctrl_cancel_control_block( CGRLC_BLK_OWNER_CTRL ); | |
751 break; | |
752 } | |
753 | |
754 } /* ctrl_t3176() */ | |
755 | |
756 | |
757 | |
758 /* | |
759 +------------------------------------------------------------------------------ | |
760 | Function : ctrl_rrgrr_data_ind | |
761 +------------------------------------------------------------------------------ | |
762 | Description : Handles the primitive RRGRR_DATA_IN | |
763 | | |
764 | Parameters : *rrgrr_pdch_assignment_ind - Ptr to primitive payload | |
765 | | |
766 +------------------------------------------------------------------------------ | |
767 */ | |
768 GLOBAL void ctrl_rrgrr_data_ind ( T_RRGRR_DATA_IND *rrgrr_data_ind ) | |
769 { | |
770 TRACE_FUNCTION( "ctrl_rrgrr_data_ind" ); | |
771 switch( GET_STATE( CTRL ) ) | |
772 { | |
773 case CTRL_IN_PROGRESS: | |
774 switch( grr_decode_rr((T_MSGBUF *)(&(rrgrr_data_ind->sdu))) ) | |
775 { | |
776 case D_PDCH_ASS_CMD: | |
777 sig_ctrl_tc_pdch_assign_received (rrgrr_data_ind); | |
778 break; | |
779 case D_CHANGE_ORDER: | |
780 /* | |
781 * RR Network cell change order was received | |
782 */ | |
783 | |
784 { | |
785 MCAST(d_change_order,D_CHANGE_ORDER); | |
786 | |
787 ctrl_cell_change_order( CCO_TYPE_RR, (void *)d_change_order ); | |
788 } | |
789 break; | |
790 default: | |
791 TRACE_ERROR( "RRGRR_PDCH_ASSIGNMENT_IND grr_decode_rrgrr failed: message type NEQ PDCH_ASSIGN" ); | |
792 break; | |
793 | |
794 } | |
795 break; | |
796 default: | |
797 TRACE_ERROR( "RRGRR_PDCH_ASSIGNMENT_IND unexpected" ); | |
798 break; | |
799 } | |
800 | |
801 PFREE (rrgrr_data_ind); | |
802 } /* ctrl_rrgrr_data_ind() */ | |
803 | |
804 | |
805 /* | |
806 +------------------------------------------------------------------------------ | |
807 | Function : ctrl_rrgrr_ia_downlink_ind | |
808 +------------------------------------------------------------------------------ | |
809 | Description : Handles the primitive RRGRR_IA_DOWNLINK_IND | |
810 | | |
811 | Parameters : *rrgrr_ia_downlink_ind - Ptr to primitive payload | |
812 | | |
813 +------------------------------------------------------------------------------ | |
814 */ | |
815 GLOBAL void ctrl_rrgrr_ia_downlink_ind ( T_RRGRR_IA_DOWNLINK_IND *rrgrr_ia_downlink_ind ) | |
816 { | |
817 TRACE_FUNCTION( "rrgrr_ia_downlink_ind" ); | |
818 | |
819 if(D_IMM_ASSIGN == grr_decode_rr((T_MSGBUF *)(&(rrgrr_ia_downlink_ind->sdu)))) | |
820 { | |
821 switch( GET_STATE( CTRL ) ) | |
822 { | |
823 case CTRL_IN_PROGRESS: | |
824 if (grr_data->cell_res_status) | |
825 { | |
826 sig_ctrl_tc_ia_downlink_received (rrgrr_ia_downlink_ind); | |
827 } | |
828 else | |
829 { | |
830 TRACE_ERROR ("RRGRR_IA_DOWNLINK_IND received during GMMRR_CELL_IND procedure"); | |
831 } | |
832 break; | |
833 default: | |
834 ctrl_send_rrgrr_stop_task_req( CTRL_TASK_BCCH, INVALID_MSG ); | |
835 TRACE_ERROR( "RRGRR_IA_DOWNLINK_IND unexpected" ); | |
836 break; | |
837 } | |
838 } | |
839 else | |
840 { | |
841 ctrl_send_rrgrr_stop_task_req( CTRL_TASK_BCCH, INVALID_MSG ); | |
842 TRACE_ERROR( "RRGRR_IA_IND wrong message type" ); | |
843 } | |
844 PFREE (rrgrr_ia_downlink_ind); | |
845 } /* ctrl_rrgrr_ia_downlink_ind() */ | |
846 | |
847 /* | |
848 +------------------------------------------------------------------------------ | |
849 | Function : ctrl_rrgrr_stop_task_cnf | |
850 +------------------------------------------------------------------------------ | |
851 | Description : Handles the primitive RRGRR_STOP_TASK_CNF | |
852 | | |
853 | Parameters : *rrgrr_stop_task_cnf - Ptr to primitive payload | |
854 | | |
855 +------------------------------------------------------------------------------ | |
856 */ | |
857 GLOBAL void ctrl_rrgrr_stop_task_cnf | |
858 ( T_RRGRR_STOP_TASK_CNF *rrgrr_stop_task_cnf ) | |
859 { | |
860 TRACE_FUNCTION( "ctrl_rrgrr_stop_task_cnf" ); | |
861 | |
862 switch( GET_STATE( CTRL ) ) | |
863 { | |
864 case CTRL_ACCESS_DISABLED: | |
865 case CTRL_READY_TO_PROGRESS: | |
866 case CTRL_IN_PROGRESS: | |
867 case CTRL_WAIT_RSP_4_RR_CR: | |
868 case CTRL_WAIT_FOR_CNF_OF_SUSPENSION: | |
869 case CTRL_CR: | |
870 case CTRL_CR_IN_SUSP: | |
871 case CTRL_GRR_NC_CCO: | |
872 case CTRL_READY: | |
873 if( grr_data->ctrl_glbl.ctrl_task EQ CTRL_TASK_BCCH ) | |
874 { | |
875 sig_ctrl_tc_stop_task_cnf_received( ); | |
876 | |
877 grr_data->ctrl_glbl.ctrl_task = CTRL_TASK_NONE; | |
878 } | |
879 else | |
880 { | |
881 ctrl_stop_rr_task_cnf( TRUE ); | |
882 } | |
883 break; | |
884 default: | |
885 TRACE_ERROR( "RRGRR_STOP_TASK_CNF unexpected" ); | |
886 break; | |
887 } | |
888 | |
889 PFREE( rrgrr_stop_task_cnf ); | |
890 | |
891 } /* ctrl_rrgrr_stop_task_cnf() */ | |
892 | |
893 /* | |
894 +------------------------------------------------------------------------------ | |
895 | Function : gmmrr_ready_req | |
896 +------------------------------------------------------------------------------ | |
897 | Description : Handles the primitive GMMRR_READY_REQ | |
898 | | |
899 | Parameters : *gmmrr_ready_req - Ptr to primitive payload | |
900 | | |
901 +------------------------------------------------------------------------------ | |
902 */ | |
903 GLOBAL void ctrl_gmmrr_ready_req ( T_GMMRR_READY_REQ *gmmrr_ready_req ) | |
904 { | |
905 TRACE_FUNCTION( "gmmrr_ready_req" ); | |
906 | |
907 ctrl_enter_ready_state( ); | |
908 | |
909 PFREE( gmmrr_ready_req ); | |
910 | |
911 } /* ctrl_gmmrr_ready_req() */ | |
912 | |
913 /* | |
914 +------------------------------------------------------------------------------ | |
915 | Function : ctrl_cgrlc_ready_state_ind | |
916 +------------------------------------------------------------------------------ | |
917 | Description : Handles the primitive CGRLC_READY_STATE_IND | |
918 | | |
919 | Parameters : *cgrlc_ready_state_ind - Ptr to primitive payload | |
920 | | |
921 +------------------------------------------------------------------------------ | |
922 */ | |
923 GLOBAL void ctrl_cgrlc_ready_state_ind | |
924 ( T_CGRLC_READY_STATE_IND *cgrlc_ready_state_ind ) | |
925 { | |
926 TRACE_FUNCTION( "ctrl_cgrlc_ready_state_ind" ); | |
927 | |
928 ctrl_enter_ready_state( ); | |
929 | |
930 PFREE( cgrlc_ready_state_ind ); | |
931 | |
932 } /* ctrl_cgrlc_ready_state_ind() */ | |
933 | |
934 /* | |
935 +------------------------------------------------------------------------------ | |
936 | Function : ctrl_gmmrr_standby_req | |
937 +------------------------------------------------------------------------------ | |
938 | Description : Handles the primitive GMMRR_STANDBY_REQ | |
939 | | |
940 | Parameters : *gmmrr_standby_req - Ptr to primitive payload | |
941 | | |
942 +------------------------------------------------------------------------------ | |
943 */ | |
944 GLOBAL void ctrl_gmmrr_standby_req ( T_GMMRR_STANDBY_REQ *gmmrr_standby_req ) | |
945 { | |
946 TRACE_FUNCTION( "gmmrr_standby_req" ); | |
947 | |
948 ctrl_enter_standby_state( ); | |
949 | |
950 PFREE( gmmrr_standby_req ); | |
951 | |
952 } /* ctrl_gmmrr_standby_req() */ | |
953 | |
954 /* | |
955 +------------------------------------------------------------------------------ | |
956 | Function : ctrl_cgrlc_standby_state_ind | |
957 +------------------------------------------------------------------------------ | |
958 | Description : Handles the primitive CGRLC_STANDBY_STATE_IND | |
959 | | |
960 | Parameters : *cgrlc_standby_state_ind - Ptr to primitive payload | |
961 | | |
962 +------------------------------------------------------------------------------ | |
963 */ | |
964 GLOBAL void ctrl_cgrlc_standby_state_ind | |
965 ( T_CGRLC_STANDBY_STATE_IND *cgrlc_standby_state_ind ) | |
966 { | |
967 TRACE_FUNCTION( "ctrl_cgrlc_standby_state_ind" ); | |
968 | |
969 ctrl_enter_standby_state( ); | |
970 | |
971 PFREE( cgrlc_standby_state_ind ); | |
972 | |
973 } /* ctrl_cgrlc_standby_state_ind() */ | |
974 | |
975 /* | |
976 +------------------------------------------------------------------------------ | |
977 | Function : ctrl_gmmrr_cs_page_res | |
978 +------------------------------------------------------------------------------ | |
979 | Description : Handles the primitive GMMRR_CS_PAGE_RES | |
980 | | |
981 | Parameters : *ctrl_gmmrr_cs_page_res - Ptr to primitive payload | |
982 | | |
983 +------------------------------------------------------------------------------ | |
984 */ | |
985 GLOBAL void ctrl_gmmrr_cs_page_res ( T_GMMRR_CS_PAGE_RES *gmmrr_cs_page_res ) | |
986 { | |
987 TRACE_FUNCTION( "gmmrr_cs_page_res" ); | |
988 switch( GET_STATE( CTRL ) ) | |
989 { | |
990 case CTRL_WAIT_CS_PAGE_RES: | |
991 SET_STATE(CTRL, grr_data->ctrl.last_state); | |
992 switch(grr_data->ctrl.cs_page_channel) | |
993 { | |
994 case PG_ON_PCCCH: | |
995 if(gmmrr_cs_page_res->response NEQ GMMRR_CS_PAGE_REJ) | |
996 { | |
997 /* | |
998 * GMM accepted the CS_PAGE_IND | |
999 */ | |
1000 grr_data->ctrl.is_susp_needed =(gmmrr_cs_page_res->susp_gprs EQ GMMRR_SUSP_GPRS) | |
1001 ? SUSPENSION_REQ_NEEDED | |
1002 :SUSPENSION_REQ_NOT_NEEDED; | |
1003 if (grr_data->ms.class_of_mode NEQ GMMRR_CLASS_A) | |
1004 { | |
1005 /* | |
1006 * suspend services | |
1007 */ | |
1008 grr_data->ctrl.after_suspension = SEND_RR_EST_REQ; | |
1009 SET_STATE(CTRL, CTRL_WAIT_FOR_CNF_OF_SUSPENSION); | |
1010 ctrl_suspend_services(GMMRR_ABNORMAL_RELEASE); | |
1011 } | |
1012 else | |
1013 { | |
1014 /* Do not suspend services */ | |
1015 ctrl_send_rr_est_req(grr_data->ctrl.is_susp_needed); | |
1016 sig_ctrl_meas_suspend( ); | |
1017 } | |
1018 } | |
1019 break; | |
1020 case PG_ON_CCCH: | |
1021 if(gmmrr_cs_page_res->response NEQ GMMRR_CS_PAGE_REJ) | |
1022 { | |
1023 /* | |
1024 * GMM accepted the CS_PAGE_IND | |
1025 */ | |
1026 grr_data->ctrl.is_susp_needed =(gmmrr_cs_page_res->susp_gprs EQ GMMRR_SUSP_GPRS) | |
1027 ? SUSPENSION_REQ_NEEDED | |
1028 :SUSPENSION_REQ_NOT_NEEDED; | |
1029 if (grr_data->ms.class_of_mode NEQ GMMRR_CLASS_A) | |
1030 { | |
1031 /* | |
1032 * suspend services | |
1033 */ | |
1034 grr_data->ctrl.after_suspension = SEND_RR_EST_RSP; | |
1035 SET_STATE(CTRL, CTRL_WAIT_FOR_CNF_OF_SUSPENSION); | |
1036 ctrl_suspend_services(GMMRR_ABNORMAL_RELEASE); | |
1037 } | |
1038 else | |
1039 { | |
1040 /* Do not suspend services */ | |
1041 ctrl_send_rr_est_req(grr_data->ctrl.is_susp_needed); | |
1042 sig_ctrl_meas_suspend( ); | |
1043 } | |
1044 } | |
1045 else | |
1046 { | |
1047 /* GMM rejected the CS_PAGE_IND*/ | |
1048 ctrl_send_rr_est_rsp(SUSPENSION_REQ_NOT_NEEDED/*in this case it has no meaning*/, | |
1049 FALSE /* CS_PAGE was rejected*/); | |
1050 } | |
1051 break; | |
1052 } | |
1053 break; | |
1054 default: | |
1055 TRACE_ERROR( "GMMRR_CS_PAGE_RES unexpected" ); | |
1056 break; | |
1057 } | |
1058 PFREE(gmmrr_cs_page_res); | |
1059 | |
1060 } /* ctrl_gmmrr_cs_page_res() */ | |
1061 | |
1062 /* | |
1063 +------------------------------------------------------------------------------ | |
1064 | Function : ctrl_gmmrr_suspend_req | |
1065 +------------------------------------------------------------------------------ | |
1066 | Description : Handles the primitive GMMRR_CS_PAGE_RES | |
1067 | | |
1068 | Parameters : *gmmrr_suspend_req - Ptr to primitive payload | |
1069 | | |
1070 +------------------------------------------------------------------------------ | |
1071 */ | |
1072 GLOBAL void ctrl_gmmrr_suspend_req ( T_GMMRR_SUSPEND_REQ *gmmrr_suspend_req ) | |
1073 { | |
1074 TRACE_FUNCTION( "gmmrr_suspend_req" ); | |
1075 switch( GET_STATE( CTRL ) ) | |
1076 { | |
1077 case CTRL_READY: | |
1078 case CTRL_IN_PROGRESS: | |
1079 case CTRL_ACCESS_DISABLED: | |
1080 case CTRL_WAIT_CS_PAGE_RES: | |
1081 grr_data->ctrl.last_state = GET_STATE( CTRL ); | |
1082 grr_data->ctrl.after_suspension = ACTIVATE_RR; | |
1083 | |
1084 grr_data->ctrl.is_susp_needed =(gmmrr_suspend_req->susp_gprs EQ GMMRR_SUSP_GPRS) | |
1085 ? SUSPENSION_REQ_NEEDED | |
1086 :SUSPENSION_REQ_NOT_NEEDED; | |
1087 | |
1088 SET_STATE(CTRL, CTRL_WAIT_FOR_CNF_OF_SUSPENSION); | |
1089 ctrl_suspend_services( gmmrr_suspend_req->gmmrr_susp_cause ); | |
1090 break; | |
1091 default: | |
1092 TRACE_ERROR( "GMMRR_SUSPEND_REQ unexpected" ); | |
1093 break; | |
1094 } | |
1095 PFREE(gmmrr_suspend_req); | |
1096 | |
1097 } /* ctrl_gmmrr_suspend_req() */ | |
1098 | |
1099 /* | |
1100 +------------------------------------------------------------------------------ | |
1101 | Function : ctrl_gmmrr_resume_req | |
1102 +------------------------------------------------------------------------------ | |
1103 | Description : Handles the primitive GMMRR_RESUME_REQ | |
1104 | GRR leaves the SUSPENDED-State | |
1105 | Parameters : *gmmrr_suspend_req - Ptr to primitive payload | |
1106 | | |
1107 +------------------------------------------------------------------------------ | |
1108 */ | |
1109 GLOBAL void ctrl_gmmrr_resume_req ( T_GMMRR_RESUME_REQ *gmmrr_resume_req ) | |
1110 { | |
1111 TRACE_FUNCTION( "ctrl_gmmrr_resume_req" ); | |
1112 | |
1113 switch( GET_STATE( CTRL ) ) | |
1114 { | |
1115 case CTRL_NO_CELL_SUSP: | |
1116 SET_STATE(CTRL, CTRL_READY); | |
1117 TRACE_EVENT("No GPRS cell Inform GMM"); | |
1118 ctrl_send_cell_ind( ); | |
1119 break; | |
1120 case CTRL_RR_CR_IN_SUSP: | |
1121 TRACE_EVENT("CR not complete in SUSP mode"); | |
1122 SET_STATE(CTRL, CTRL_AUTO_RR_CR); | |
1123 break; | |
1124 case CTRL_CR_IN_SUSP: | |
1125 SET_STATE(CTRL, CTRL_CR); | |
1126 break; | |
1127 case CTRL_FAILED_CR_IN_SUSP: | |
1128 SET_STATE(CTRL, CTRL_FAILED_CR); | |
1129 break; | |
1130 | |
1131 case CTRL_ACC_ENABLED_SUSP: | |
1132 /* | |
1133 * resume PSI | |
1134 * enable cell | |
1135 */ | |
1136 SET_STATE(CTRL, CTRL_IN_PROGRESS); | |
1137 TRACE_EVENT("Cell changed within SUSP"); | |
1138 sig_ctrl_psi_resumpt(); | |
1139 ctrl_enable_serving_cell( FALSE ); | |
1140 break; | |
1141 case CTRL_WAIT_FOR_CNF_OF_SUSPENSION: | |
1142 /* | |
1143 * This is an exceptional case->GMM resumes without receiving suspend_cnf | |
1144 */ | |
1145 case CTRL_SUSPENDED: | |
1146 switch(grr_data->ctrl.last_state) | |
1147 { | |
1148 case CTRL_NULL: | |
1149 case CTRL_READY: | |
1150 case CTRL_ACCESS_DISABLED: | |
1151 /* | |
1152 * CTRL has to wait for receiving SI13 | |
1153 */ | |
1154 if (grr_data->ctrl.last_state EQ CTRL_ACCESS_DISABLED) | |
1155 { | |
1156 SET_STATE (CTRL, CTRL_ACCESS_DISABLED) | |
1157 } | |
1158 else | |
1159 { | |
1160 SET_STATE(CTRL, CTRL_READY); | |
1161 sig_ctrl_psi_stop(); | |
1162 grr_set_pbcch(FALSE); | |
1163 } | |
1164 psc_db->acq_type = COMPLETE; | |
1165 ctrl_start_monitoring_bcch(COMPLETE_SI); | |
1166 break; | |
1167 case CTRL_IN_PROGRESS: | |
1168 default: | |
1169 /* | |
1170 * CTRL assumes that the cell has not been changed | |
1171 */ | |
1172 SET_STATE(CTRL, CTRL_IN_PROGRESS); | |
1173 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE ); | |
1174 break; | |
1175 } | |
1176 break; | |
1177 default: | |
1178 TRACE_ERROR( "GMMRR_RESUME_REQ unexpected" ); | |
1179 break; | |
1180 } | |
1181 PFREE(gmmrr_resume_req); | |
1182 | |
1183 } /* ctrl_gmmrr_resume_req() */ | |
1184 | |
1185 | |
1186 | |
1187 | |
1188 /* | |
1189 +------------------------------------------------------------------------------ | |
1190 | Function : rrgrr_rr_est_ind | |
1191 +------------------------------------------------------------------------------ | |
1192 | Description : Handles the primitive T_RRGRR_RR_EST_IND: This primitive idicates | |
1193 | that the RR has received a RR connection establishment. This notification | |
1194 | should be passed to PG-Service | |
1195 | | |
1196 | Parameters : *rrgrr_rr_est_ind - Ptr to primitive payload | |
1197 | | |
1198 +------------------------------------------------------------------------------ | |
1199 */ | |
1200 GLOBAL void ctrl_rrgrr_rr_est_ind ( T_RRGRR_RR_EST_IND *rrgrr_rr_est_ind) | |
1201 { | |
1202 UBYTE state = GET_STATE( CTRL ); | |
1203 | |
1204 TRACE_FUNCTION( "ctrl_rrgrr_rr_est_ind" ); | |
1205 | |
1206 switch( state ) | |
1207 { | |
1208 case CTRL_NULL: /* to allow class CC mobile accepting CS call*/ | |
1209 /* | |
1210 * To pass CS page request to GMM | |
1211 */ | |
1212 grr_data->ctrl.cs_page_channel = PG_ON_CCCH; | |
1213 | |
1214 SET_STATE(CTRL, CTRL_WAIT_CS_PAGE_RES); | |
1215 ctrl_handle_gmmrr_cs_page_ind( state ); | |
1216 break; | |
1217 // case CTRL_READY: | |
1218 /* | |
1219 * To pass the connection est. request to PG and GMM | |
1220 */ | |
1221 case CTRL_IN_PROGRESS: | |
1222 sig_ctrl_pg_rr_est(); | |
1223 break; | |
1224 default: | |
1225 { | |
1226 TRACE_ERROR( "T_RRGRR_RR_EST_IND unexpected" ); | |
1227 ctrl_send_rr_est_rsp(FALSE,FALSE /* CS_PAGE was NOT accepted*/); | |
1228 } | |
1229 break; | |
1230 } | |
1231 | |
1232 PFREE(rrgrr_rr_est_ind); | |
1233 }/* rrgrr_rr_est_ind() */ | |
1234 | |
1235 | |
1236 | |
1237 /* | |
1238 +------------------------------------------------------------------------------ | |
1239 | Function : rrgrr_suspend_dcch_cnf | |
1240 +------------------------------------------------------------------------------ | |
1241 | Description : Handles the primitive RRGRR_SUSPEND_DCCH_CNF: This primitive | |
1242 | idicates that the RR has released the DCCH connection. | |
1243 | This notification should be passed to TC-Service | |
1244 | | |
1245 | Parameters : *rrgrr_suspend_dcch_cnf - Ptr to primitive payload | |
1246 | | |
1247 +------------------------------------------------------------------------------ | |
1248 */ | |
1249 GLOBAL void ctrl_rrgrr_suspend_dcch_cnf ( T_RRGRR_SUSPEND_DCCH_CNF *rrgrr_suspend_dcch_cnf) | |
1250 { | |
1251 TRACE_FUNCTION( "ctrl_rrgrr_suspend_dcch_cnf" ); | |
1252 | |
1253 switch( GET_STATE( CTRL ) ) | |
1254 { | |
1255 case CTRL_IN_PROGRESS: | |
1256 sig_ctrl_tc_suspend_dcch_cnf(); | |
1257 break; | |
1258 default: | |
1259 TRACE_ERROR( "RRGRR_SUSPEND_DCCH_CNF unexpected" ); | |
1260 break; | |
1261 } | |
1262 | |
1263 PFREE(rrgrr_suspend_dcch_cnf); | |
1264 }/* ctrl_rrgrr_suspend_dcch_cnf() */ | |
1265 | |
1266 | |
1267 /* | |
1268 +------------------------------------------------------------------------------ | |
1269 | Function : ctrl_rrgrr_reconnect_dcch_cnf | |
1270 +------------------------------------------------------------------------------ | |
1271 | Description : Handles the primitive RRGRR_RECONNECT_DCCH_CNF: This primitive | |
1272 | idicates that the RR has reestablished the DCCH connection. | |
1273 | This notification should be passed to TC-Service | |
1274 | | |
1275 | Parameters : *rrgrr_reconnect_dcch_cnf - Ptr to primitive payload | |
1276 | | |
1277 +------------------------------------------------------------------------------ | |
1278 */ | |
1279 GLOBAL void ctrl_rrgrr_reconnect_dcch_cnf | |
1280 ( T_RRGRR_RECONNECT_DCCH_CNF *rrgrr_reconnect_dcch_cnf ) | |
1281 { | |
1282 TRACE_FUNCTION( "ctrl_rrgrr_reconnect_dcch_cnf" ); | |
1283 | |
1284 switch( GET_STATE( CTRL ) ) | |
1285 { | |
1286 case CTRL_RR_NC_CCO: | |
1287 if(grr_data->cc_running) | |
1288 { | |
1289 BOOL is_success = ( rrgrr_reconnect_dcch_cnf->reconn_state EQ RECONN_OK ); | |
1290 | |
1291 if( is_success ) | |
1292 { | |
1293 SET_STATE( CTRL, CTRL_IN_PROGRESS ); | |
1294 ctrl_reinstall_old_scell_cnf( TRUE ); | |
1295 ctrl_enable_serving_cell( FALSE ); | |
1296 } | |
1297 else | |
1298 { | |
1299 SET_STATE( CTRL, CTRL_READY ); | |
1300 ctrl_reinstall_old_scell_cnf( FALSE ); | |
1301 ctrl_enable_serving_cell( FALSE ); | |
1302 | |
1303 } | |
1304 sig_ctrl_tc_reconnect_dcch_cnf( ); | |
1305 } | |
1306 grr_data->cc_running = FALSE; | |
1307 break; | |
1308 default: | |
1309 TRACE_ERROR( "RRGRR_RECONNECT_DCCH_CNF unexpected" ); | |
1310 break; | |
1311 } | |
1312 | |
1313 PFREE(rrgrr_reconnect_dcch_cnf); | |
1314 | |
1315 }/* ctrl_rrgrr_reconnect_dcch_cnf() */ | |
1316 | |
1317 /* | |
1318 +------------------------------------------------------------------------------ | |
1319 | Function : ctrl_rrgrr_stop_dcch_ind | |
1320 +------------------------------------------------------------------------------ | |
1321 | Description : | |
1322 | | |
1323 | | |
1324 | | |
1325 | | |
1326 | Parameters : *rrgrr_stop_dcch_ind - Ptr to primitive payload | |
1327 | | |
1328 +------------------------------------------------------------------------------ | |
1329 */ | |
1330 GLOBAL void ctrl_rrgrr_stop_dcch_ind(T_RRGRR_STOP_DCCH_IND* rrgrr_stop_dcch_ind) | |
1331 { | |
1332 TRACE_FUNCTION( "ctrl_rrgrr_stop_dcch_ind" ); | |
1333 switch( GET_STATE( CTRL ) ) | |
1334 { | |
1335 case CTRL_IN_PROGRESS: | |
1336 ; | |
1337 break; | |
1338 default: | |
1339 TRACE_ERROR( "RRGRR_STOP_DCCH_IND unexpected" ); | |
1340 break; | |
1341 } | |
1342 | |
1343 PFREE(rrgrr_stop_dcch_ind); | |
1344 }/* ctrl_ctrl_rrgrr_stop_dcch_ind() */ | |
1345 | |
1346 | |
1347 /* | |
1348 +------------------------------------------------------------------------------ | |
1349 | Function : ctrl_rrgrr_cr_ind | |
1350 +------------------------------------------------------------------------------ | |
1351 | Description : This function indicates that the cell reselection has been | |
1352 | startet by the RR entity | |
1353 | Parameters : *cr_ind - Ptr to primitive payload | |
1354 | | |
1355 +------------------------------------------------------------------------------ | |
1356 */ | |
1357 GLOBAL void ctrl_rrgrr_cr_ind( T_RRGRR_CR_IND *cr_ind ) | |
1358 { | |
1359 UBYTE state = GET_STATE( CTRL ); | |
1360 | |
1361 TRACE_FUNCTION( "ctrl_rrgrr_cr_ind" ); | |
1362 | |
1363 TRACE_ASSERT( cr_ind->cr_type EQ CR_NORMAL OR | |
1364 cr_ind->cr_type EQ CR_ABNORMAL OR | |
1365 cr_ind->cr_type EQ CR_REQ_CANDIDATE OR | |
1366 cr_ind->cr_type EQ CR_SUSPENDED_IDLE ); | |
1367 | |
1368 TRACE_EVENT_P2( "RRGRR_CR_IND: %d in state %d", cr_ind->cr_type, state ); | |
1369 | |
1370 switch( state ) | |
1371 { | |
1372 case CTRL_NULL: | |
1373 case CTRL_READY: | |
1374 switch( cr_ind->cr_type ) | |
1375 { | |
1376 case CR_NORMAL: | |
1377 case CR_ABNORMAL: | |
1378 ctrl_set_old_scell( FALSE ); | |
1379 ctrl_send_cell_reselection_req( CR_COMPLETE ); | |
1380 break; | |
1381 | |
1382 case CR_REQ_CANDIDATE: | |
1383 TRACE_ERROR( "RRGRR_CR_IND unexpected" ); | |
1384 break; | |
1385 | |
1386 case CR_SUSPENDED_IDLE: | |
1387 /* to be defined */ | |
1388 break; | |
1389 } | |
1390 break; | |
1391 | |
1392 case CTRL_ACC_ENABLED_SUSP: | |
1393 case CTRL_NO_CELL_SUSP: | |
1394 case CTRL_RR_CR_IN_SUSP: | |
1395 case CTRL_SUSPENDED: | |
1396 switch( cr_ind->cr_type ) | |
1397 { | |
1398 case CR_ABNORMAL: | |
1399 grr_init_ncmeas_extd_struct(&psc_db->nc_ms,FALSE); | |
1400 case CR_NORMAL: | |
1401 SET_STATE( CTRL, CTRL_RR_CR_IN_SUSP ); | |
1402 | |
1403 ctrl_set_old_scell( TRUE ); | |
1404 ctrl_stop_all_activities( CTRL_DC_CR_MS_RR_IMM_REL, NULL ); | |
1405 grr_prepare_db_for_new_cell( ); | |
1406 break; | |
1407 | |
1408 case CR_REQ_CANDIDATE: | |
1409 SET_STATE( CTRL, CTRL_CR_IN_SUSP ); | |
1410 | |
1411 sig_ctrl_cs_reselect( CS_RESELECT_CAUSE_CTRL_NORMAL ); | |
1412 break; | |
1413 | |
1414 case CR_SUSPENDED_IDLE: | |
1415 /* to be defined */ | |
1416 break; | |
1417 } | |
1418 break; | |
1419 | |
1420 case CTRL_IN_PROGRESS: | |
1421 case CTRL_ACCESS_DISABLED: | |
1422 switch( cr_ind->cr_type ) | |
1423 { | |
1424 case CR_NORMAL: | |
1425 case CR_ABNORMAL: | |
1426 SET_STATE( CTRL, CTRL_WAIT_RSP_4_RR_CR ); | |
1427 | |
1428 ctrl_set_old_scell( TRUE ); | |
1429 | |
1430 if( cr_ind->cr_type NEQ CR_NORMAL ) | |
1431 { | |
1432 ctrl_stop_all_activities( CTRL_DC_CR_MS_RR_IMM_REL, NULL ); | |
1433 } | |
1434 else | |
1435 { | |
1436 ctrl_stop_all_activities( CTRL_DC_CR_MS_RR_NORMAL, NULL ); | |
1437 } | |
1438 break; | |
1439 | |
1440 case CR_REQ_CANDIDATE: | |
1441 TRACE_ERROR( "RRGRR_CR_IND unexpected" ); | |
1442 break; | |
1443 | |
1444 case CR_SUSPENDED_IDLE: | |
1445 /* to be defined */ | |
1446 break; | |
1447 } | |
1448 break; | |
1449 | |
1450 case CTRL_CR: | |
1451 case CTRL_CR_IN_SUSP: | |
1452 switch( cr_ind->cr_type ) | |
1453 { | |
1454 case CR_NORMAL: | |
1455 case CR_ABNORMAL: | |
1456 grr_data->ctrl.parked_rrgrr_cr_ind = TRUE; | |
1457 | |
1458 ctrl_handle_parked_rrgrr_cr_ind( state ); | |
1459 break; | |
1460 | |
1461 case CR_REQ_CANDIDATE: | |
1462 TRACE_ERROR( "RRGRR_CR_IND unexpected" ); | |
1463 break; | |
1464 | |
1465 case CR_SUSPENDED_IDLE: | |
1466 /* to be defined */ | |
1467 break; | |
1468 } | |
1469 break; | |
1470 | |
1471 case CTRL_AUTO_RR_CR: | |
1472 switch( grr_data->ctrl.rr_state.cr_ind_return ) | |
1473 { | |
1474 case CR_IND_RETURN_COMPLETE: | |
1475 grr_data->ctrl.rr_state.cr_ind_return = CR_IND_RETURN_RESPONSE; | |
1476 | |
1477 ctrl_send_cell_reselection_req( CR_COMPLETE ); | |
1478 break; | |
1479 | |
1480 case CR_IND_RETURN_NONE: | |
1481 case CR_IND_RETURN_RESPONSE: | |
1482 default: | |
1483 TRACE_EVENT_P1( "RRGRR_CR_IND: cr_ind_return EQ %d", | |
1484 grr_data->ctrl.rr_state.cr_ind_return ); | |
1485 break; | |
1486 } | |
1487 break; | |
1488 | |
1489 /* | |
1490 * RR is not allowed to do a MS controlled cell re-selection since | |
1491 * a network controlled cell re-selection is in progress. | |
1492 */ | |
1493 case CTRL_RR_NC_CCO: | |
1494 case CTRL_GRR_NC_CCO: | |
1495 /* | |
1496 * break; | |
1497 */ | |
1498 | |
1499 /* | |
1500 * GRR is in a critical CTRL_WAIT_... state, just store the RRGRR_CR_IND | |
1501 * and process is after leaving the critical state. | |
1502 */ | |
1503 case CTRL_WAIT_CS_PAGE_RES: | |
1504 case CTRL_WAIT_FOR_CNF_OF_SUSPENSION: | |
1505 | |
1506 /* | |
1507 * RR has sent a RRGRR_GPRS_SI13_IND for a new serving cell and has to wait | |
1508 * for response of GRR ( RRGRR_CR_REQ with appropriate parameter set ) | |
1509 * before sending a new cell re-selection indication. | |
1510 */ | |
1511 case CTRL_READY_TO_PROGRESS: | |
1512 /* | |
1513 * It is possible to store the RRGRR_CR_IND, to wait until the above | |
1514 * states have been left and to post-process the RRGRR_CR_IND afterwards. | |
1515 * But implemenation effort is quite high and it is not clear whether | |
1516 * the situations can occur -> for further study. | |
1517 */ | |
1518 | |
1519 /* | |
1520 * break; | |
1521 */ | |
1522 | |
1523 /* | |
1524 * RR indicates a new cell re-selection but the previous one is not yet | |
1525 * responded by GRR, just wait for it. | |
1526 */ | |
1527 case CTRL_WAIT_RSP_4_RR_CR: | |
1528 | |
1529 /* | |
1530 * The following states should never be seen when RRGRR_CR_IND has been | |
1531 * received, they are just set and reset during one primitive processing | |
1532 * cycle. | |
1533 */ | |
1534 case CTRL_FAILED_CR: | |
1535 case CTRL_FAILED_CR_IN_SUSP: | |
1536 default: | |
1537 TRACE_ERROR( "RRGRR_CR_IND unexpected" ); | |
1538 break; | |
1539 } | |
1540 | |
1541 PFREE( cr_ind ); | |
1542 | |
1543 }/* ctrl_rrgrr_cr_ind() */ | |
1544 | |
1545 /* | |
1546 +------------------------------------------------------------------------------ | |
1547 | Function : ctrl_rrgrr_check_bsic_ind | |
1548 +------------------------------------------------------------------------------ | |
1549 | Description : | |
1550 | | |
1551 | Parameters : *rrgrr_check_bsic_ind - Ptr to primitive payload | |
1552 | | |
1553 +------------------------------------------------------------------------------ | |
1554 */ | |
1555 GLOBAL void ctrl_rrgrr_check_bsic_ind | |
1556 ( T_RRGRR_NCELL_SYNC_IND *rrgrr_check_bsic_ind ) | |
1557 { | |
1558 TRACE_FUNCTION( "ctrl_rrgrr_check_bsic_ind" ); | |
1559 | |
1560 switch( GET_STATE( CTRL ) ) | |
1561 { | |
1562 case CTRL_IN_PROGRESS: | |
1563 case CTRL_READY: | |
1564 case CTRL_CR: | |
1565 case CTRL_FAILED_CR: | |
1566 case CTRL_CR_IN_SUSP: | |
1567 case CTRL_FAILED_CR_IN_SUSP: | |
1568 case CTRL_GRR_NC_CCO: | |
1569 sig_ctrl_cs_check_bsic_ind( rrgrr_check_bsic_ind ); | |
1570 break; | |
1571 default: | |
1572 TRACE_ERROR( "RRGRR_CHECK_BSIC_IND unexpected" ); | |
1573 break; | |
1574 } | |
1575 | |
1576 PFREE( rrgrr_check_bsic_ind ); | |
1577 }/* ctrl_rrgrr_check_bsic_ind() */ | |
1578 | |
1579 /* | |
1580 +------------------------------------------------------------------------------ | |
1581 | Function : ctrl_rrgrr_sync_ind | |
1582 +------------------------------------------------------------------------------ | |
1583 | Description : This function handle the primitive rrgrr_sync_ind | |
1584 | and checks whether the synchronisation was successfully or not | |
1585 | | |
1586 | | |
1587 | | |
1588 | Parameters : payload to primitive | |
1589 | | |
1590 +------------------------------------------------------------------------------ | |
1591 */ | |
1592 GLOBAL void ctrl_rrgrr_sync_ind(T_RRGRR_SYNC_IND *rrgrr_sync_ind) | |
1593 { | |
1594 UBYTE state = GET_STATE( CTRL ); | |
1595 | |
1596 TRACE_FUNCTION( "ctrl_rrgrr_sync_ind" ); | |
1597 | |
1598 switch( state ) | |
1599 { | |
1600 case CTRL_RR_CR_IN_SUSP: | |
1601 case CTRL_AUTO_RR_CR: | |
1602 if(rrgrr_sync_ind->sync_res EQ SYNC_OK) | |
1603 { | |
1604 /* | |
1605 * Stop TBF etc., if running. We want to start | |
1606 * to read PSI messages in the new cell | |
1607 */ | |
1608 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE ); | |
1609 ctrl_send_access_disable_if_needed( TC_DC_OTHER, sig_tc_ctrl_tbf_release_cnf ); | |
1610 grr_set_db_ptr( DB_MODE_CC_REQ ); | |
1611 sig_ctrl_psi_sync_ok(); | |
1612 } | |
1613 else | |
1614 { | |
1615 SET_STATE(CTRL, CTRL_READY); | |
1616 TRACE_ERROR( "Synchronisation to new NCELL failed" ); | |
1617 } | |
1618 break; | |
1619 case CTRL_CR: | |
1620 case CTRL_CR_IN_SUSP: | |
1621 grr_set_db_ptr( DB_MODE_CC_REQ ); | |
1622 | |
1623 if(rrgrr_sync_ind->sync_res EQ SYNC_OK) | |
1624 { | |
1625 /* | |
1626 * There is no information about the service state available, | |
1627 * so we assume that full service is offered, | |
1628 * GPRS is supported anyway, because PBCCH is present | |
1629 */ | |
1630 ctrl_set_gprs_service( GPRS_SUPPORTED, FALSE ); | |
1631 | |
1632 /* | |
1633 * We want to start | |
1634 * to read PSI messages in the new cell | |
1635 */ | |
1636 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE ); | |
1637 sig_ctrl_psi_read_full_psi_in_new_cell(); | |
1638 } | |
1639 else | |
1640 { | |
1641 SET_STATE_FAILED_CR( state ); | |
1642 | |
1643 ctrl_cc_rejected( ); | |
1644 | |
1645 TRACE_ERROR( "Sync to new NCELL failed: new/no candidate" ); | |
1646 } | |
1647 break; | |
1648 case CTRL_RR_NC_CCO: | |
1649 case CTRL_GRR_NC_CCO: | |
1650 if( rrgrr_sync_ind->sync_res EQ SYNC_OK ) | |
1651 { | |
1652 /* Start reading psi information on the new cell */ | |
1653 /* sig_ctrl_psi_read_full_psi_in_new_cell( ); */ | |
1654 ctrl_stop_rr_task_req( GLBL_PCKT_MODE_IDLE, TASK_STOP_DUMMY_VALUE ); | |
1655 grr_set_db_ptr( DB_MODE_CC_REQ ); | |
1656 sig_ctrl_psi_sync_ok( ); | |
1657 } | |
1658 break; | |
1659 default: | |
1660 TRACE_ERROR( "RRGRR_SYNC_IND unexpected" ); | |
1661 break; | |
1662 } | |
1663 | |
1664 PFREE(rrgrr_sync_ind); | |
1665 }/* ctrl_rrgrr_sync_ind() */ | |
1666 | |
1667 /* | |
1668 +------------------------------------------------------------------------------ | |
1669 | Function : ctrl_rrgrr_meas_rep_cnf | |
1670 +------------------------------------------------------------------------------ | |
1671 | Description : ... | |
1672 | | |
1673 | Parameters : payload to primitive | |
1674 | | |
1675 +------------------------------------------------------------------------------ | |
1676 */ | |
1677 GLOBAL void ctrl_rrgrr_meas_rep_cnf( T_RRGRR_MEAS_REP_CNF *rrgrr_meas_rep_cnf ) | |
1678 { | |
1679 TRACE_FUNCTION( "ctrl_rrgrr_meas_rep_cnf" ); | |
1680 | |
1681 switch( GET_STATE( CTRL ) ) | |
1682 { | |
1683 case CTRL_IN_PROGRESS: | |
1684 sig_ctrl_cs_meas_rep_cnf( rrgrr_meas_rep_cnf ); | |
1685 break; | |
1686 default: | |
1687 TRACE_ERROR( "RRGRR_MEAS_REP_CNF unexpected" ); | |
1688 break; | |
1689 } | |
1690 | |
1691 PFREE( rrgrr_meas_rep_cnf ); | |
1692 }/* ctrl_rrgrr_meas_rep_cnf() */ | |
1693 | |
1694 /* | |
1695 +------------------------------------------------------------------------------ | |
1696 | Function : ctrl_rrgrr_ext_meas_cnf | |
1697 +------------------------------------------------------------------------------ | |
1698 | Description : ... | |
1699 | | |
1700 | Parameters : payload to primitive | |
1701 | | |
1702 +------------------------------------------------------------------------------ | |
1703 */ | |
1704 GLOBAL void ctrl_rrgrr_ext_meas_cnf ( T_RRGRR_EXT_MEAS_CNF *rrgrr_ext_meas_cnf ) | |
1705 { | |
1706 TRACE_FUNCTION( "ctrl_rrgrr_ext_meas_cnf" ); | |
1707 | |
1708 switch( GET_STATE( CTRL ) ) | |
1709 { | |
1710 case CTRL_IN_PROGRESS: | |
1711 sig_ctrl_meas_ext_meas_cnf( rrgrr_ext_meas_cnf ); | |
1712 break; | |
1713 default: | |
1714 TRACE_ERROR( "RRGRR_EXT_MEAS_CNF unexpected" ); | |
1715 break; | |
1716 } | |
1717 | |
1718 PFREE( rrgrr_ext_meas_cnf ); | |
1719 }/* ctrl_rrgrr_ext_meas_cnf() */ | |
1720 | |
1721 | |
1722 | |
1723 /* | |
1724 +------------------------------------------------------------------------------ | |
1725 | Function : ctrl_gmmrr_attach_started_req | |
1726 +------------------------------------------------------------------------------ | |
1727 | Description : Handles the primitive GMMRR_ATTACH_STARTED_REQ | |
1728 | | |
1729 | Parameters : *gmmrr_attach_started_req - Ptr to primitive payload | |
1730 | | |
1731 +------------------------------------------------------------------------------ | |
1732 */ | |
1733 GLOBAL void ctrl_gmmrr_attach_started_req | |
1734 ( T_GMMRR_ATTACH_STARTED_REQ *gmmrr_attach_started_req ) | |
1735 { | |
1736 TRACE_FUNCTION( "ctrl_gmmrr_attach_started_req" ); | |
1737 | |
1738 grr_handle_non_drx_period( GMM_NDRX, TRUE ); | |
1739 | |
1740 PFREE( gmmrr_attach_started_req ); | |
1741 | |
1742 } /* ctrl_gmmrr_attach_started_req() */ | |
1743 | |
1744 /* | |
1745 +------------------------------------------------------------------------------ | |
1746 | Function : ctrl_gmmrr_attach_finished_req | |
1747 +------------------------------------------------------------------------------ | |
1748 | Description : Handles the primitive GMMRR_ATTACH_FINISHED_REQ | |
1749 | | |
1750 | Parameters : *gmmrr_attach_finished_req - Ptr to primitive payload | |
1751 | | |
1752 +------------------------------------------------------------------------------ | |
1753 */ | |
1754 GLOBAL void ctrl_gmmrr_attach_finished_req | |
1755 ( T_GMMRR_ATTACH_FINISHED_REQ *gmmrr_attach_finished_req ) | |
1756 { | |
1757 TRACE_FUNCTION( "ctrl_gmmrr_attach_finished_req" ); | |
1758 | |
1759 grr_handle_non_drx_period( GMM_NDRX, FALSE ); | |
1760 | |
1761 PFREE( gmmrr_attach_finished_req ); | |
1762 | |
1763 } /* ctrl_gmmrr_attach_finished_req() */ | |
1764 | |
1765 /* | |
1766 +------------------------------------------------------------------------------ | |
1767 | Function : ctrl_rrgrr_ms_id_ind | |
1768 +------------------------------------------------------------------------------ | |
1769 | Description : Handles the primitive RRGRR_MS_ID_IND | |
1770 | | |
1771 | Parameters : *ms_id - Ptr to primitive payload | |
1772 | | |
1773 +------------------------------------------------------------------------------ | |
1774 */ | |
1775 GLOBAL void ctrl_rrgrr_ms_id_ind(T_RRGRR_MS_ID_IND *ms_id) | |
1776 { | |
1777 TRACE_FUNCTION( "ctrl_rrgrr_ms_id_ind" ); | |
1778 | |
1779 | |
1780 grr_data->db.ms_id.tmsi = ms_id->tmsi; | |
1781 | |
1782 TRACE_EVENT_P1("TMSI: %d", ms_id->tmsi); | |
1783 | |
1784 PFREE(ms_id); | |
1785 }/*ctrl_rrgrr_ms_id_ind*/ | |
1786 | |
1787 | |
1788 /* | |
1789 +------------------------------------------------------------------------------ | |
1790 | Function : ctrl_gmmrr_cell_res | |
1791 +------------------------------------------------------------------------------ | |
1792 | Description : Handles the primitive GMMRR_CELL_RES | |
1793 | | |
1794 | Parameters : *gmmrr_cell_res - Ptr to primitive payload | |
1795 | | |
1796 +------------------------------------------------------------------------------ | |
1797 */ | |
1798 GLOBAL void ctrl_gmmrr_cell_res ( T_GMMRR_CELL_RES *gmmrr_cell_res ) | |
1799 { | |
1800 TRACE_FUNCTION( "ctrl_gmmrr_cell_res" ); | |
1801 | |
1802 switch( GET_STATE( CTRL ) ) | |
1803 { | |
1804 case CTRL_READY: | |
1805 case CTRL_IN_PROGRESS: | |
1806 sig_ctrl_tc_enable_grlc(CGRLC_QUEUE_MODE_LLC,gmmrr_cell_res->cu_cause); | |
1807 grr_data->cell_res_status = TRUE; | |
1808 break; | |
1809 case CTRL_RR_NC_CCO: | |
1810 case CTRL_GRR_NC_CCO: | |
1811 | |
1812 TRACE_EVENT_P1("NCC ctrl_gmmrr_cell_res: cause is %d", gmmrr_cell_res->cu_cause); | |
1813 | |
1814 if( grr_t_status( T3174 ) > 0 ) | |
1815 { | |
1816 TRACE_EVENT("ctrl_gmmrr_cell_res: t3174 is running"); | |
1817 sig_ctrl_tc_enable_grlc(CGRLC_QUEUE_MODE_LLC,gmmrr_cell_res->cu_cause); | |
1818 } | |
1819 else | |
1820 { | |
1821 TRACE_EVENT("ctrl_gmmrr_cell_res: t3176 is running"); | |
1822 | |
1823 SET_STATE( CTRL,CTRL_IN_PROGRESS ); | |
1824 } | |
1825 grr_data->cell_res_status = TRUE; | |
1826 break; | |
1827 default: | |
1828 TRACE_ERROR( "GMMRR_CELL_RES unexpected" ); | |
1829 break; | |
1830 } | |
1831 PFREE(gmmrr_cell_res); | |
1832 | |
1833 } /* ctrl_gmmrr_cell_res() */ | |
1834 | |
1835 | |
1836 #ifdef REL99 | |
1837 /* | |
1838 +------------------------------------------------------------------------------ | |
1839 | Function : ctrl_t_poll_timer | |
1840 +------------------------------------------------------------------------------ | |
1841 | Description : This is the timer handler. It is started when PCCO/PCCC is received | |
1842 | with RRBP set | |
1843 | | |
1844 | | |
1845 | Parameters : | |
1846 | | |
1847 +------------------------------------------------------------------------------ | |
1848 */ | |
1849 GLOBAL void ctrl_t_poll_timer() | |
1850 { | |
1851 | |
1852 if(grr_data->ctrl.poll_for_msg EQ GRR_PCCO_POLL) | |
1853 { | |
1854 ctrl_cell_change_order ( CCO_TYPE_GRR, (void *)&grr_data->ctrl.pcco ); | |
1855 } | |
1856 | |
1857 grr_data->ctrl.poll_for_msg= 0; | |
1858 | |
1859 return; | |
1860 | |
1861 } | |
1862 #endif | |
1863 | |
1864 #if defined (REL99) AND defined (TI_PS_FF_EMR) | |
1865 /* | |
1866 +------------------------------------------------------------------------------ | |
1867 | Function : ctrl_rrgrr_si2quater_ind | |
1868 +------------------------------------------------------------------------------ | |
1869 | Description : ... | |
1870 | | |
1871 | Parameters : payload to primitive | |
1872 | | |
1873 +------------------------------------------------------------------------------ | |
1874 */ | |
1875 GLOBAL void ctrl_rrgrr_si2quater_ind( T_RRGRR_SI2QUATER_IND | |
1876 *rrgrr_si2quater_ind ) | |
1877 { | |
1878 TRACE_FUNCTION( "ctrl_rrgrr_si2quater_ind" ); | |
1879 | |
1880 switch( GET_STATE( CTRL ) ) | |
1881 { | |
1882 case CTRL_IN_PROGRESS: | |
1883 sig_ctrl_cs_si2quater_ind( rrgrr_si2quater_ind ); | |
1884 break; | |
1885 default: | |
1886 TRACE_ERROR( "RRGRR_SI2QUATER_IND unexpected" ); | |
1887 break; | |
1888 } | |
1889 | |
1890 PFREE( rrgrr_si2quater_ind ); | |
1891 }/* ctrl_rrgrr_si2quater_ind() */ | |
1892 #endif | |
1893 | |
1894 | |
1895 |