comparison src/g23m-gprs/gmm/gmm_kerns.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 : gmm_kerns.c
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 GMM and implements all
18 | functions to handles the incoming process internal signals as
19 | described in the SDL-documentation (KERN-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef GMM_KERNS_C
24 #define GMM_KERNS_C
25 #endif
26
27 #define ENTITY_GMM
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 "ccdapi.h" /* to get CCD API */
37 #include "cnf_gmm.h" /* to get cnf-definitions */
38 #include "mon_gmm.h" /* to get mon-definitions */
39 #include "prim.h" /* to get the definitions of used SAP and directions */
40 #include "gmm.h" /* to get the global entity definitions */
41 #include "gmm_em.h"
42
43 #include "gmm_txs.h" /* to get signal functions */
44 #include "gmm_f.h" /* to get global functions */
45 #include "gmm_rdys.h" /* to get signal functions */
46 #include "gmm_rxs.h" /* to get signal functions */
47 #include "gmm_syncf.h" /* to get signal functions */
48 #include "gmm_kernl.h" /* to get local functions declared as label */
49 #include "gmm_kernf.h" /* to get local functions */
50 #ifdef REL99
51 #include "gmm_rdyf.h"
52 #endif
53
54 #include <string.h> /* to get memset */
55 /*==== CONST ================================================================*/
56
57 /*==== LOCAL VARS ===========================================================*/
58
59 /*==== PRIVATE FUNCTIONS ====================================================*/
60
61 /*
62 +------------------------------------------------------------------------------
63 | Function : kern_indicate_service_loss
64 +------------------------------------------------------------------------------
65 | Description : The function indicates loss of service to the MMI
66 |
67 | Parameters : detach_type: The type of lost service
68 | service : The service we still have (no or limited)
69 | searching : Another PLMN to try available
70 |
71 +------------------------------------------------------------------------------
72 */
73 LOCAL void kern_indicate_service_loss (UBYTE detach_type,
74 USHORT service,
75 UBYTE searching,
76 USHORT cause)
77 {
78 GMM_TRACE_FUNCTION ("kern_indicate_service_loss");
79
80 switch (service)
81 {
82 case NREG_NO_SERVICE:
83 kern_gmmreg_detach (detach_type,
84 GMMCS_NO_SERVICE, /* TCS 2.1 */
85 searching,
86 cause);
87 break;
88
89 case NREG_LIMITED_SERVICE:
90 kern_gmmreg_detach (detach_type,
91 GMMCS_LIMITED_SERVICE, /* TCS 2.1 */
92 searching,
93 cause);
94 break;
95
96 default: /* Shall not happen as all defined values caught */
97 kern_gmmreg_detach (detach_type,
98 GMMCS_INT_PROTOCOL_ERROR, /* TCS 2.1 */
99 searching,
100 cause);
101 break;
102 }
103 GMM_RETURN;
104 }
105
106 /*
107 +------------------------------------------------------------------------------
108 | Function :kern_cell_update_or_attach_reset
109 +------------------------------------------------------------------------------
110 | Description : The function starts cell update or not.
111 |
112 | Parameters : void
113 |
114 +------------------------------------------------------------------------------
115 */
116 LOCAL void kern_cell_update_or_attach_reset (void )
117 {
118 BOOL call_attach_reset;
119 GMM_TRACE_FUNCTION ("kern_cell_update_or_attach_reset");
120
121 if (GU_UPDATE_NEEDED EQ GET_STATE(GU))
122 {
123 call_attach_reset=TRUE;
124 }
125 else
126 {
127 switch( GET_STATE( KERN ) )
128 {
129 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
130 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
131 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
132 case KERN_GMM_REG_INITIATED:
133 case KERN_GMM_RAU_INITIATED:
134 call_attach_reset=kern_ra_crossed();
135 break;
136 default:
137 call_attach_reset=kern_rai_changed();
138 break;
139 }
140 }
141
142 if ( call_attach_reset)
143 {
144 TRACE_2_INFO("Info: changed to: lac %x rac %x",
145 gmm_data->kern.sig_cell_info.env.rai.lac,
146 gmm_data->kern.sig_cell_info.env.rai.rac);
147 /*
148 * <R.GMM.AGABNORM.M.010>
149 */
150 /*
151 * NO kern_attach_reset();
152 * to do not stop t3310 or T3311 here
153 */
154 gmm_data->kern.ct3310 = 0;
155 gmm_data->kern.aac = 0;
156 }
157 else
158 {
159 /*
160 * In state GMM_REG_UPDATE_NEEDED, GMM will start RAU and no cell update
161 * is necessary
162 */
163 switch (gmm_data->kern.detach_cap.error_cause)
164 {
165 default:
166 break;
167 case GMMCS_MSC_TEMP_NOT_REACHABLE: /* TCS 2.1 */
168 case GMMCS_NET_FAIL: /* TCS 2.1 */
169 case GMMCS_CONGESTION: /* TCS 2.1 */
170 /* 04.08 ch. 4.7..2.3 The MM sublayer shall act as in network operation mode II as long as the
171 combined GMM procedures are not successful and no new RA is entered. The new
172 MM state is MM IDLE. */
173 gmm_data->kern.sig_cell_info.net_mode= GMMRR_NET_MODE_II;
174 TRACE_0_INFO ("changed to NMOII");
175
176 break;
177 }
178
179 if (GMMRR_SERVICE_FULL EQ gmm_data->kern.sig_cell_info.gmm_status)
180 {
181 switch( GET_STATE( KERN ) )
182 {
183 case KERN_GMM_NULL_NO_IMSI:
184 case KERN_GMM_NULL_NO_IMSI_LIMITED_SERVICE_REQ:
185 case KERN_GMM_NULL_IMSI_LIMITED_SERVICE_REQ:
186 case KERN_GMM_NULL_IMSI:
187 case KERN_GMM_NULL_PLMN_SEARCH:
188
189 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
190 case KERN_GMM_DEREG_LIMITED_SERVICE:
191 case KERN_GMM_DEREG_NO_IMSI:
192 case KERN_GMM_DEREG_PLMN_SEARCH:
193 case KERN_GMM_DEREG_SUSPENDING:
194 case KERN_GMM_DEREG_SUSPENDED:
195 break;
196
197 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
198 case KERN_GMM_REG_INITIATED:
199
200 case KERN_GMM_REG_NO_CELL_AVAILABLE:
201 case KERN_GMM_REG_LIMITED_SERVICE:
202 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
203 case KERN_GMM_REG_RESUMING:
204 case KERN_GMM_REG_NORMAL_SERVICE:
205 case KERN_GMM_REG_IMSI_DETACH_INITIATED:
206
207 case KERN_GMM_DEREG_INITIATED:
208 if (kern_cell_changed())
209 {
210 sig_kern_rdy_cu_req();
211 }
212 /*
213 * sig_kern_rdy_cu_req has to be called allways before
214 * kern_gmmrr_stop_waiting_for_transmission(), because rdy may sent
215 * back the sig_rdy_kern_cu_ind to get the parameter cu_cause for
216 * gmmrr_cell_res
217 */
218 kern_gmmrr_stop_waiting_for_transmission();
219 break;
220
221 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
222 case KERN_GMM_RAU_INITIATED:
223 case KERN_GMM_RAU_WAIT_FOR_NPDU_LIST:
224 if (kern_cell_changed())
225 {
226 sig_kern_rdy_cu_req();
227
228 switch(GET_STATE(CU))
229 {
230 case CU_REQUESTED_CELL_RES_SENT:
231 SET_STATE (CU, CU_CELL_RES_SENT);
232 kern_send_llgmm_trigger_req();
233 break;
234 case CU_REQUESTED:
235 SET_STATE (CU, CU_NOT_REQUESTED);
236 kern_send_llgmm_trigger_req();
237 break;
238 default:
239 case CU_NOT_REQUESTED:
240 case CU_CELL_RES_SENT:
241 break;
242 }
243 }
244 break;
245
246 case KERN_GMM_REG_SUSPENDING:
247 case KERN_GMM_REG_SUSPENDED:
248 case KERN_GMM_REG_TEST_MODE:
249 case KERN_GMM_REG_TEST_MODE_NO_IMSI:
250 break;
251
252 default:
253 break;
254 }
255
256 }
257 }
258 GMM_RETURN;
259 }
260
261
262
263
264 /*
265 +------------------------------------------------------------------------------
266 | Function : kern_gmmreg_ciphering_ind
267 +------------------------------------------------------------------------------
268 | Description : forwards the ciphering indicator of GPRS to MMI. This function is
269 | added for resolution of issue 3765
270 |
271 | Parameters : gmm_cipher - GPRS ciphering indicator
272 |
273 +------------------------------------------------------------------------------
274 */
275 LOCAL void kern_gmmreg_ciphering_ind ( U8 gmm_cipher )
276 {
277 GMM_TRACE_FUNCTION( "kern_gmmreg_ciphering_ind" );
278 {
279 PALLOC (gmmreg_ciphering_ind, GMMREG_CIPHERING_IND);
280 /*
281 * do not include the ciphering status of gsm purposely to have the
282 * behaviour for GSM and for GPRS (do not remember the status of the other!)
283 */
284 gmmreg_ciphering_ind->gsm_ciph = CIPH_NA;
285 gmmreg_ciphering_ind->gprs_ciph = gmm_cipher;
286 PSEND ( hCommMMI, gmmreg_ciphering_ind );
287 }
288 GMM_RETURN;
289 } /* kern_gmmreg_ciphering_ind() */
290
291
292
293 /*==== PUBLIC FUNCTIONS =====================================================*/
294
295 /*
296 +------------------------------------------------------------------------------
297 | Function : sig_sync_kern_cell_ind
298 +------------------------------------------------------------------------------
299 | Description : Handles the internal signal SIG_SYNC_KERN_CELL_IND
300 |
301 | Parameters : void
302 |
303 +------------------------------------------------------------------------------
304 */
305 GLOBAL void sig_sync_kern_cell_ind ( T_SIG_CELL_INFO * sig_cell_info )
306 {
307 GMM_TRACE_FUNCTION( "sig_sync_kern_cell_ind" );
308 TRACE_EVENT ("--- IN:GMMRR_SIG_CELL_IND");
309
310 #ifdef REL99
311 switch (sig_cell_info->sgsnr_flag)/*!gmm_data->release99 =>old code*/ /* TCS 4.0 */
312 {
313 default:
314 case PS_SGSN_UNKNOWN:
315 case PS_SGSN_98_OLDER:
316 gmm_data->kern.t3302_val = sig_cell_info->t3212_val;
317 break;
318 case PS_SGSN_99_ONWARDS:
319 break;
320 }
321 #endif
322
323 /*
324 * Cel ID
325 */
326 gmm_data->kern.cell_id.lac = sig_cell_info->env.rai.lac;
327 gmm_data->kern.cell_id.rac = sig_cell_info->env.rai.rac;
328
329 GMM_TRACE_GMM_DATA(GMM_DEBUG_PRINT_MASK_CID);
330
331 if (0xff NEQ gmm_data->config.nmo)
332 {
333 sig_cell_info->net_mode=gmm_data->config.nmo;
334 TRACE_EVENT("NMO changed");
335 }
336 #ifdef GMM_TCS4
337 TRACE_11_PARA("%s, %x%x%x, %x%x%x, NMO: %d, lac %x, rac %x, cid %x", /* TCS 4.0 */
338 (RT_GPRS==sig_cell_info->rt?"GPRS":"EDGE"), /* TCS 4.0 */
339 sig_cell_info->env.rai.plmn.mcc[0],
340 sig_cell_info->env.rai.plmn.mcc[1],
341 sig_cell_info->env.rai.plmn.mcc[2],
342 sig_cell_info->env.rai.plmn.mnc[0],
343 sig_cell_info->env.rai.plmn.mnc[1],
344 sig_cell_info->env.rai.plmn.mnc[2],
345 sig_cell_info->net_mode+1,
346 gmm_data->kern.cell_id.lac,
347 gmm_data->kern.cell_id.rac,
348 sig_cell_info->env.cid);
349
350 #else
351 TRACE_10_PARA("%x%x%x, %x%x%x, NMO: %d, lac %x, rac %x, cid %x",
352 sig_cell_info->env.rai.plmn.mcc[0],
353 sig_cell_info->env.rai.plmn.mcc[1],
354 sig_cell_info->env.rai.plmn.mcc[2],
355 sig_cell_info->env.rai.plmn.mnc[0],
356 sig_cell_info->env.rai.plmn.mnc[1],
357 sig_cell_info->env.rai.plmn.mnc[2],
358 sig_cell_info->net_mode+1,
359 sig_cell_info->env.rai.lac,
360 sig_cell_info->env.rai.rac,
361 sig_cell_info->env.cid);
362 #endif
363
364 #ifndef NTRACE
365 switch ( sig_cell_info->gmm_status)
366 {
367 case GMMRR_SERVICE_LIMITED:
368 TRACE_0_PARA("GPRS limited");
369 break;
370 case GMMRR_SERVICE_NONE:
371 TRACE_0_PARA("no GPRS");
372 break;
373 case GMMRR_SERVICE_FULL:
374 TRACE_0_PARA("GPRS available");
375 break;
376 default:
377 TRACE_ERROR ("unexpexted gmm_status");
378 }
379 switch (sig_cell_info->mm_status)
380 {
381 case MMGMM_LIMITED_SERVICE:
382
383 TRACE_0_PARA("MM limited service");
384 break;
385 case MMGMM_FULL_SERVICE:
386 TRACE_0_PARA("MM full service");
387 break;
388 case MMGMM_CELL_SELECTED:
389 TRACE_0_PARA("MM cell changed");
390 break;
391 case MMGMM_WAIT_FOR_UPDATE:
392 TRACE_0_PARA("MM LUP REQ");
393 break;
394 default:
395 TRACE_ERROR("unknown MM status");
396 }
397
398 #endif
399
400 gmm_data->kern.old_sig_cell_info = gmm_data->kern.sig_cell_info;
401 gmm_data->kern.sig_cell_info = *sig_cell_info;
402
403 if (gmm_data->kern.attach_cap.mobile_class_changed
404 && sig_cell_info->gmmrr_cell_ind_received)
405 {
406 gmm_data->kern.attach_cap.mobile_class_changed=FALSE;
407 kern_gmmrr_enable();
408 }
409
410 /*
411 * E/// if we left a cell where NO GPRS has been supported and enter a cell where GPRS is
412 * there we have to make RAU. "E/// TC 3.2.5 RAU re-entering into GPRS coverage"
413 */
414 if (GMMRR_SERVICE_NONE EQ gmm_data->kern.old_sig_cell_info.gmm_status
415 && MMGMM_FULL_SERVICE EQ gmm_data->kern.old_sig_cell_info.mm_status
416 && GMMRR_SERVICE_FULL EQ gmm_data->kern.sig_cell_info.gmm_status
417 )
418 {
419 SET_STATE(GU,GU_UPDATE_NEEDED);
420 }
421
422 if ( GMMRR_SERVICE_FULL EQ gmm_data->kern.sig_cell_info.gmm_status
423 && kern_is_cell_forbidden() )
424 {
425 gmm_data->kern.sig_cell_info.gmm_status = GMMRR_SERVICE_LIMITED;
426 }
427
428
429 if (GMMREG_CLASS_B EQ gmm_data->kern.attach_cap.mobile_class
430 && GMMRR_NET_MODE_III EQ gmm_data->kern.sig_cell_info.net_mode )
431 /*
432 * MS class B mobile reacts in NMO III as in NMO II
433 * notice that it is not possible to change mobile classes from one to
434 * another for B, BG or BC. MS change are allowed only between A, (one of B|BC|BG), CG
435 * or CC
436 */
437 {
438 TRACE_0_INFO("mobile reacts as in NMO II, because of MS class B");
439 gmm_data->kern.sig_cell_info.net_mode = GMMRR_NET_MODE_II;
440 }
441
442 /*
443 * Inform MMI that cell has changed or that we GSM is in full service again
444 */
445 kern_send_gmmreg_cell_ind();
446
447 if (sig_cell_info->gmmrr_cell_ind_received )
448 {
449 gmm_data->kern.attach_cap.grr_state = GMM_GRR_STATE_ON;
450 SET_STATE(CU, CU_NOT_REQUESTED);
451 gmm_data->kern.gmmrr_resume_sent = FALSE;
452 }
453
454 kern_cell_update_or_attach_reset ();
455
456
457 switch( GET_STATE( KERN ) )
458 {
459 /*************************************************************************
460 * state GMM-DEREG
461 *************************************************************************/
462 case KERN_GMM_REG_SUSPENDING:
463 case KERN_GMM_DEREG_SUSPENDING:
464 /* if GRR reselects the cell in this state GRR has to be suspended again
465 *TC 44.2.2.2.2
466 */
467 if (sig_cell_info->gmmrr_cell_ind_received)
468 {
469 TRACE_ERROR ("unexpected GMMRR_CELL_IND received in state SUSPENDING");
470 TRACE_ERROR("-waiting for GMMRR_SUSPEND_CNF");
471 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_UNKNOWN);
472 }
473 break;
474
475 case KERN_GMM_DEREG_SUSPENDED:
476
477 if (!sig_cell_info->gmmrr_cell_ind_received
478 && MMGMM_WAIT_FOR_UPDATE==sig_cell_info->mm_status)
479 /*
480 * TACTIVATE has expied so we are in a deadlock situaton and MM waits for
481 * location update request
482 */
483 {
484 TRACE_ERROR("MMGMM_ACTIVATE_IND received in DEREG_SUSPENDED");
485
486 switch (gmm_data->kern.sig_cell_info.net_mode)
487 {
488 case GMMRR_NET_MODE_II:
489 kern_resume_grr_der();
490 break;
491 case GMMRR_NET_MODE_III:
492 switch (gmm_data->kern.attach_cap.mobile_class)
493 {
494 case GMMREG_CLASS_BC:
495 case GMMREG_CLASS_B:
496 kern_resume_grr_der();
497 break;
498 default:
499 break;
500 }
501 break;
502 default:
503 break;
504 }
505 }
506 else
507 {
508 TRACE_0_INFO("cell_ind ignored");
509 }
510 break;
511 case KERN_GMM_DEREG_RESUMING:
512 if ( gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau )
513 {
514 gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau = FALSE;
515 SET_STATE (KERN, KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH);
516 #ifdef FF_EM_MODE
517 EM_GMM_SET_STATE(KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH);
518 #endif
519 }
520 else if ( gmm_data->kern.detach_cap.gmmreg ) /* Process Detach if pending */
521 {
522 TRACE_0_INFO("Stored Detach Request from KERN_GMM_DEREG_RESUMING");
523 /* Already LLC is in suspended state when we are in KERN_GMM_DEREG_RESUMING
524 * give cell_res so that GRR can transmit */
525 kern_gmmrr_stop_waiting_for_transmission();
526 TRACE_0_INFO("Detach Request again");
527 switch ( gmm_data->kern.detach_cap.detach_type )
528 {
529 case GMMREG_DT_IMSI:
530 case GMMREG_DT_COMB:
531 case GMMREG_DT_SIM_REMOVED:
532 switch (gmm_data->kern.sig_cell_info.net_mode)
533 {
534 case GMMRR_NET_MODE_I:
535 kern_detach( );
536 break;
537 case GMMRR_NET_MODE_II:
538 /*
539 * if deatch procedure collision and GSM is already detached we
540 * are finished
541 */
542 if (GMM_MM_DEREG NEQ GET_STATE(MM))
543 {
544 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING);
545 kern_llgmm_suspend(LLGMM_CALL);
546 kern_gmmrr_suspend(GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
547 }
548 else
549 {
550 kern_detach( );
551 }
552 break;
553 case GMMRR_NET_MODE_III:
554 kern_detach( );
555 break;
556 default:
557 TRACE_ERROR ("unknown net mode");
558 break;
559 }
560 break;
561 case GMMREG_DT_DISABLE_GPRS:
562 kern_local_detach( GMMCS_INT_NOT_PRESENT, FALSE, GMM_LOCAL_DETACH_PROC_ENTER_DEREG); /* TCS 2.1 */
563 break;
564 case GMMREG_DT_GPRS:
565 case GMMREG_DT_POWER_OFF:
566 case GMMREG_DT_SOFT_OFF:
567 kern_detach( );
568 break;
569 default:
570 TRACE_ERROR ("Unexpected detach type in primitive GMMREG_DETACH_REQ");
571 break;
572 }
573 GMM_RETURN;
574 }
575 /* unusual change of states */
576 /* NO break; */
577
578 case KERN_GMM_DEREG_NO_IMSI:
579 /* TC 44.2.6.2.1 #7 problem */
580 /*
581 * While suspension GMM is able to receive mobile class changes.
582 * This changes will be handled, when GMM is resumed, i. e. here!
583 */
584 switch ( gmm_data->kern.attach_cap.mobile_class )
585 {
586 case GMMREG_CLASS_CC:
587 /*
588 * GMM enters state DEGEG_SUSPENDED if it was in DEREG_NO_IMSI
589 * So I have to tae careto enter NO_IMSI again.
590 */
591
592 /*
593 * GRR is switched off
594 */
595 kern_gmmrr_disable();
596 kern_mm_activate_mm ();
597
598 if (gmm_data->sim_gprs_invalid)
599 {
600 SET_STATE (KERN, KERN_GMM_NULL_NO_IMSI);
601 #ifdef FF_EM_MODE
602 EM_GMM_SET_STATE(KERN_GMM_NULL_NO_IMSI);
603 #endif
604 }
605 else
606 {
607 SET_STATE (KERN, KERN_GMM_NULL_IMSI );
608 #ifdef FF_EM_MODE
609 EM_GMM_SET_STATE(KERN_GMM_NULL_IMSI );
610 #endif
611 /*
612 * MM is switch on as GSM only
613 */
614
615 if ( GMM_MM_REG_NORMAL_SERVICE EQ GET_STATE(MM) )
616 {
617 kern_gmmreg_attach_cnf(GMMREG_AT_IMSI);
618 }
619 }
620
621 GMM_RETURN;
622 case GMMREG_CLASS_CG:
623 if (GMM_MM_DEREG NEQ GET_STATE(MM))
624 {
625 /*
626 * You are entering dangersome area
627 */
628 TRACE_ERROR("signal cell ind, DEREG_NO_IMSI, class CG not covered!"); /* code_cover_not_relevant */
629
630 if (kern_lai_changed() ) /* code_cover_not_relevant */
631 {
632 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING ); /* code_cover_not_relevant */
633 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU); /* code_cover_not_relevant */
634 }
635 else /* code_cover_not_relevant */
636 {
637 kern_imsi_detach_der_susp(); /* code_cover_not_relevant */
638 }
639 GMM_RETURN; /* code_cover_not_relevant */
640 }
641 break;
642 /* NO break;
643 * goto LABEL cell_der
644 */
645 default:
646 /* NO return
647 * goto LABEL cell_der
648 */
649 break;
650 }
651 /* gmmrr_cell_res */
652 /* NO break;*/
653 /*
654 * LABEL CELL_DER
655 */
656
657 case KERN_GMM_DEREG_PLMN_SEARCH:
658 case KERN_GMM_DEREG_LIMITED_SERVICE:
659 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
660 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
661
662 if (MODE_MAN EQ gmm_data->kern.attach_cap.network_selection_mode
663 /* START PATCH UBUOB ISSUE 8784 */
664 && gmm_data->kern.attach_cap.gmmreg
665 /* END PATCH UBUOB ISSUE 8784 */
666 && GMMRR_SERVICE_LIMITED == gmm_data->kern.sig_cell_info.gmm_status )
667 {
668 TRACE_0_INFO ("forbidden ignored in manual mode");
669 gmm_data->kern.sig_cell_info.gmm_status = GMMRR_SERVICE_FULL;
670 }
671
672 switch (gmm_data->kern.sig_cell_info.net_mode)
673 {
674 case GMMRR_NET_MODE_II:
675 if (kern_lau_needed())
676 {
677 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING );
678 #ifdef FF_EM_MODE
679 EM_GMM_SET_STATE(KERN_GMM_DEREG_SUSPENDING );
680 #endif
681 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
682 GMM_RETURN;
683
684 }
685 break;
686 case GMMRR_NET_MODE_III:
687 switch (gmm_data->kern.attach_cap.mobile_class)
688 {
689 case GMMREG_CLASS_BG:
690 if (GMM_MM_DEREG NEQ GET_STATE(MM))
691 {
692 if (kern_lau_needed())
693 {
694 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING );
695 #ifdef FF_EM_MODE
696 EM_GMM_SET_STATE(KERN_GMM_DEREG_SUSPENDING );
697 #endif
698 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
699 }
700 else
701 {
702 kern_imsi_detach_der_susp();
703 }
704 GMM_RETURN;
705 }
706 break;
707 default:
708 break;
709 }
710 break;
711 default:
712 break;
713 }
714 switch (GET_STATE(KERN))
715 {
716 case KERN_GMM_DEREG_NO_IMSI:
717 /*
718 * NO attach if NO IMSI
719 * 44.2.1.2.4
720 */
721 if (gmm_data->sim_gprs_invalid)
722 {
723 SET_STATE (KERN, KERN_GMM_NULL_NO_IMSI);
724 #ifdef FF_EM_MODE
725 EM_GMM_SET_STATE(KERN_GMM_NULL_NO_IMSI);
726 #endif
727 kern_mm_imsi_detach_ind ( GMMCS_SIM_REMOVED, MMGMM_PERFORM_DETACH,
728 gmm_data->kern.detach_cap.detach_type); /* TCS 2.1 */
729 }
730 GMM_RETURN;
731 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
732 if (
733 (GMMCS_RETRY_IN_NEW_CELL NEQ gmm_data->kern.detach_cap.error_cause /* TCS 2.1 */
734 && !kern_ra_crossed())
735 || !kern_cell_changed()
736 )
737 /*
738 * with cause 'Retry upon entry into a new cell', GPRS attach shall be
739 * performed when a new cell is entered.
740 */
741 {
742 /*
743 * wait untill timer expires
744 * 44.2.1.2.8
745 */
746 T_TIME t3311_value=0;
747 T_TIME t3302_value=0;
748 if (
749 (VSI_OK EQ vsi_t_status ( GMM_handle , kern_T3311, &t3311_value )
750 && t3311_value>0)
751 ||
752 (VSI_OK EQ vsi_t_status ( GMM_handle , kern_T3302, &t3302_value )
753 && t3302_value>0)
754 )
755 {
756 GMM_RETURN;
757 }
758 else
759 /*
760 * if RAU has crossed or rau has changed timer are stopped. attach is needed
761 */
762 {
763 /* both timers stopped, so restart T3311 to make sure we will exit this state */
764 TRACE_EVENT ( "Info: START: T3311 not again" );
765 SET_STATE(GU,GU_UPDATE_NEEDED);
766 //vsi_t_start ( GMM_handle , kern_T3311, gmm_data->kern.t3311_val );
767 break;
768 }
769 }
770 break;
771 default:
772 break;
773 }
774
775 /*
776 * GMM enters state DEGEG_SUSPENDED if it was in DEREG_NO_IMSI
777 * So I have to take care to enter NO_IMSI again.
778 */
779
780 if (gmm_data->sim_gprs_invalid)
781 {
782 if (kern_lau_needed() )
783 {
784 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING );
785 #ifdef FF_EM_MODE
786 EM_GMM_SET_STATE(KERN_GMM_DEREG_SUSPENDING );
787 #endif
788 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
789 }
790 else
791 {
792 SET_STATE (KERN, KERN_GMM_NULL_NO_IMSI);
793 #ifdef FF_EM_MODE
794 EM_GMM_SET_STATE(KERN_GMM_NULL_NO_IMSI);
795 #endif
796 kern_mm_imsi_detach_ind ( GMMCS_SIM_REMOVED, MMGMM_PERFORM_DETACH,
797 gmm_data->kern.detach_cap.detach_type ); /* TCS 2.1 */
798 }
799 GMM_RETURN;
800 }
801
802 /*
803 * ATTACH required
804 */
805 switch ( gmm_data->kern.sig_cell_info.gmm_status )
806 {
807 case GMMRR_SERVICE_NONE:
808 kern_gmmreg_detach (GMMREG_DT_GPRS,
809 GMMCS_NO_SERVICE, /* TCS 2.1 */
810 GMMREG_SEARCH_NOT_RUNNING,
811 GMMCS_NO_SERVICE);
812 SET_STATE(KERN,KERN_GMM_DEREG_NO_CELL_AVAILABLE);
813 #ifdef FF_EM_MODE
814 EM_GMM_SET_STATE(KERN_GMM_DEREG_NO_CELL_AVAILABLE);
815 #endif
816 break;
817 case GMMRR_SERVICE_FULL:
818 if (gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau)
819 /*
820 * R&S vtest case 44.2.3.2.7 wants GMM to wait with RAU untill timer
821 * is timed out afe5 5th attempt
822 */
823 {
824 gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau=FALSE;
825 SET_STATE(KERN,KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH);
826 #ifdef FF_EM_MODE
827 EM_GMM_SET_STATE(KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH);
828 #endif
829 GMM_RETURN;
830 }
831
832 /*
833 * MSC: 3.7.2.2.2.1.2 Access allowed
834 * MSC: 3.7.2.2.2.1.2.2 Network operates in Mode II or III
835 *
836 * call ATTACH procedure
837 */
838 kern_attach_reset();
839 kern_attach ();
840
841 break;
842 default:
843 case GMMRR_SERVICE_LIMITED:
844 kern_gmmreg_detach (GMMREG_DT_GPRS,
845 GMMCS_LIMITED_SERVICE, /* TCS 2.1 */
846 GMMREG_SEARCH_NOT_RUNNING,
847 GMMCS_LIMITED_SERVICE);
848 SET_STATE ( KERN, KERN_GMM_DEREG_LIMITED_SERVICE );
849 #ifdef FF_EM_MODE
850 EM_GMM_SET_STATE(KERN_GMM_DEREG_LIMITED_SERVICE );
851 #endif
852 break;
853 }
854 break;
855 case KERN_GMM_DEREG_INITIATED:
856 /************************************************************************
857 * MSC: 3.9 GPRS detach procedure
858 *
859 * MCS: 3.9.3 Abnormal cases
860 * MSC: 3.9.3.5 e) Change of cell into a new RA
861 * (before a DETACH ACCEPT message has been received)
862 ************************************************************************/
863 switch ( gmm_data->kern.sig_cell_info.gmm_status )
864 {
865 case GMMRR_SERVICE_LIMITED:
866 case GMMRR_SERVICE_NONE:
867 default:
868 /*
869 * Local detach, because normal detach does not work
870 */
871 if (GMMREG_DT_POWER_OFF EQ gmm_data->kern.detach_cap.detach_type)
872 {
873 kern_local_detach( GMMCS_INT_PROTOCOL_ERROR, FALSE, GMM_LOCAL_DETACH_PROC_POWER_OFF); /* TCS 2.1 */
874 }
875 else
876 {
877 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_GPRS;
878 kern_local_detach( GMMCS_INT_PROTOCOL_ERROR, FALSE, GMM_LOCAL_DETACH_PROC_DISABLE); /* TCS 2.1 */
879 }
880 break;
881 case GMMRR_SERVICE_FULL:
882 if (kern_rai_changed()
883 || GU_UPDATE_NEEDED == GET_STATE(GU))
884 {
885 gmm_data->kern.whilst_detach.rau = TRUE;
886 vsi_t_stop ( GMM_handle , kern_T3321);
887 kern_rau ();
888 }
889 break;
890 }
891 break;
892
893 case KERN_GMM_REG_IMSI_DETACH_INITIATED:
894 /************************************************************************
895 * MSC: 3.9 GPRS detach procedure
896 *
897 * MCS: 3.9.3 Abnormal cases
898 * MSC: 3.9.3.5 e) Change of cell into a new RA
899 * (before a DETACH ACCEPT message has been received)
900 ************************************************************************/
901 switch ( gmm_data->kern.sig_cell_info.gmm_status )
902 {
903 case GMMRR_SERVICE_NONE:
904 /*
905 * Local detach, because normal detach does not work
906 */
907 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_IMSI;
908 kern_local_detach( GMMCS_INT_PROTOCOL_ERROR, FALSE, /* TCS 2.1 */
909 GMM_LOCAL_DETACH_PROC_NOTHING);
910 SET_STATE (KERN, KERN_GMM_REG_NO_CELL_AVAILABLE);
911
912 break;
913 default:
914 case GMMRR_SERVICE_LIMITED:
915 /*
916 * Local detach, because normal detach does not work
917 */
918 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_IMSI;
919 kern_local_detach( GMMCS_INT_PROTOCOL_ERROR, FALSE, /* TCS 2.1 */
920 GMM_LOCAL_DETACH_PROC_NOTHING);
921 SET_STATE (KERN, KERN_GMM_REG_LIMITED_SERVICE);
922 break;
923 case GMMRR_SERVICE_FULL:
924 if ( kern_rai_changed()
925 || GU_UPDATE_NEEDED EQ GET_STATE(GU))
926 {
927 gmm_data->kern.whilst_detach.rau = TRUE;
928 kern_rau ();
929 }
930 break;
931 }
932 break;
933
934 case KERN_GMM_REG_INITIATED:
935 if (MODE_MAN EQ gmm_data->kern.attach_cap.network_selection_mode
936 /* START PATCH UBUOB ISSUE 8784 */
937 && gmm_data->kern.attach_cap.gmmreg
938 /* END PATCH UBUOB 8784 */
939 && GMMRR_SERVICE_LIMITED == gmm_data->kern.sig_cell_info.gmm_status)
940 {
941 TRACE_0_INFO ("forbidden ignored in manual mode");
942 gmm_data->kern.sig_cell_info.gmm_status = GMMRR_SERVICE_FULL;
943 }
944
945 switch (gmm_data->kern.sig_cell_info.net_mode)
946 {
947 case GMMRR_NET_MODE_II:
948 if (kern_lau_needed())
949 {
950 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING );
951 #ifdef FF_EM_MODE
952 EM_GMM_SET_STATE(KERN_GMM_DEREG_SUSPENDING );
953 #endif
954 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
955 GMM_RETURN;
956
957 }
958 break;
959 case GMMRR_NET_MODE_III:
960 switch (gmm_data->kern.attach_cap.mobile_class)
961 {
962 case GMMREG_CLASS_BG:
963 if (GMM_MM_DEREG NEQ GET_STATE(MM))
964 {
965 if (kern_lau_needed() )
966 {
967 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING );
968 #ifdef FF_EM_MODE
969 EM_GMM_SET_STATE(KERN_GMM_DEREG_SUSPENDING );
970 #endif
971 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
972 }
973 else
974 {
975 kern_imsi_detach_der_susp();
976 }
977 GMM_RETURN;
978 }
979 break;
980 default:
981 break;
982 }
983 break;
984 default:
985 break;
986 }
987
988
989 /*
990 * ATTACH required
991 */
992 switch ( gmm_data->kern.sig_cell_info.gmm_status )
993 {
994 case GMMRR_SERVICE_FULL:
995 if ( kern_ra_crossed() )
996 /*
997 * ra changed
998 */
999 {
1000 /*
1001 * MSC: 3.8.1.4.6. f) Change of cell into a new RA
1002 * (i.e. ATTACH ACCEPT or ATTACH REJECT not yet received)
1003 *
1004 * The GPRS attach procedure is aborted and re-initiated immediately.
1005 *
1006 * <R.GMM.AGABNORM.M.010>
1007 */
1008 kern_attach_reset();
1009 kern_attach ();
1010 }
1011 else
1012 /*
1013 * ra not changed
1014 */
1015 /* MSC: 3.8.1.4.5 e) Change of cell within the same RA
1016 *
1017 * The GPRS attach procedure is continued.
1018 * <R.GMM.AGABNORM.M.029>
1019 */
1020 {
1021 if (gmm_data->kern.attach_cap.t3310_value>0)
1022 /*
1023 * t3310 has been stopped due to GMMRR_CR_IND
1024 */
1025 {
1026 TRACE_EVENT ( "Info: START: continue T3310 again" );
1027 /* START PATCH UBUOB ISSUE 8742 */
1028 sig_kern_rdy_start_timer_req ( kern_T3310, gmm_data->kern.t3310_val );
1029 /*vsi_t_start ( GMM_handle , kern_T3310, gmm_data->kern.t3310_val );*/
1030 /* END PATCH UBUOB 8742 */
1031 }
1032 }
1033 break;
1034 case GMMRR_SERVICE_NONE:
1035 SET_STATE(KERN,KERN_GMM_DEREG_NO_CELL_AVAILABLE);
1036 #ifdef FF_EM_MODE
1037 EM_GMM_SET_STATE(KERN_GMM_DEREG_NO_CELL_AVAILABLE);
1038 #endif
1039 break;
1040
1041 default:
1042 case GMMRR_SERVICE_LIMITED:
1043 SET_STATE ( KERN, KERN_GMM_DEREG_LIMITED_SERVICE );
1044 #ifdef FF_EM_MODE
1045 EM_GMM_SET_STATE(KERN_GMM_DEREG_LIMITED_SERVICE );
1046 #endif
1047 break;
1048 }
1049 gmm_data->kern.attach_cap.t3310_value=0;
1050 break;
1051 case KERN_GMM_REG_NO_CELL_AVAILABLE:
1052 switch (gmm_data->kern.sig_cell_info.net_mode)
1053 {
1054 case GMMRR_NET_MODE_II:
1055 if (kern_lau_needed() )
1056 {
1057 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1058 #ifdef FF_EM_MODE
1059 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1060 #endif
1061 kern_llgmm_suspend(LLGMM_CALL);
1062 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1063 GMM_RETURN;
1064
1065 }
1066 break;
1067 case GMMRR_NET_MODE_III:
1068 switch (gmm_data->kern.attach_cap.mobile_class)
1069 {
1070 case GMMREG_CLASS_BG:
1071 if (GMM_MM_DEREG NEQ GET_STATE(MM))
1072 {
1073 if (kern_lau_needed())
1074 {
1075 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1076 #ifdef FF_EM_MODE
1077 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1078 #endif
1079 kern_llgmm_suspend(LLGMM_CALL);
1080 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1081 }
1082 else
1083 {
1084 kern_imsi_detach_reg_susp();
1085 }
1086 GMM_RETURN;
1087 }
1088 break;
1089 default:
1090 break;
1091 }
1092 break;
1093 default:
1094 break;
1095 }
1096
1097 switch ( gmm_data->kern.sig_cell_info.gmm_status )
1098 {
1099 case GMMRR_SERVICE_FULL:
1100 if ( kern_rai_changed()
1101 || GU_UPDATE_NEEDED EQ GET_STATE(GU) )
1102 {
1103 kern_rau ();
1104 }
1105 else
1106 {
1107 kern_enter_reg_normal_upon_gmmrr_cell_ind();
1108 }
1109 break;
1110 case GMMRR_SERVICE_NONE:
1111 if (kern_lau_needed() )
1112 {
1113 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1114 #ifdef FF_EM_MODE
1115 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1116 #endif
1117 kern_llgmm_suspend(LLGMM_CALL);
1118 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1119 GMM_RETURN;
1120
1121 }
1122 SET_STATE(KERN,KERN_GMM_REG_NO_CELL_AVAILABLE);
1123 #ifdef FF_EM_MODE
1124 EM_GMM_SET_STATE(KERN_GMM_REG_NO_CELL_AVAILABLE);
1125 #endif
1126 break;
1127 default:
1128 case GMMRR_SERVICE_LIMITED:
1129 SET_STATE ( KERN, KERN_GMM_REG_LIMITED_SERVICE );
1130 #ifdef FF_EM_MODE
1131 EM_GMM_SET_STATE(KERN_GMM_REG_LIMITED_SERVICE );
1132 #endif
1133 kern_llgmm_suspend ( LLGMM_LIMITED );
1134 break;
1135 }
1136 break;
1137
1138 case KERN_GMM_REG_LIMITED_SERVICE:
1139
1140 switch (gmm_data->kern.sig_cell_info.net_mode)
1141 {
1142 case GMMRR_NET_MODE_II:
1143 if (kern_lau_needed() )
1144 {
1145 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1146 #ifdef FF_EM_MODE
1147 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1148 #endif
1149 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1150 GMM_RETURN;
1151
1152 }
1153 break;
1154 case GMMRR_NET_MODE_III:
1155 switch (gmm_data->kern.attach_cap.mobile_class)
1156 {
1157 case GMMREG_CLASS_BG:
1158 if (GMM_MM_DEREG NEQ GET_STATE(MM))
1159 {
1160 if (kern_lau_needed() )
1161 {
1162 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1163 #ifdef FF_EM_MODE
1164 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1165 #endif
1166 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1167 }
1168 else
1169 {
1170 kern_imsi_detach_reg_susp();
1171 }
1172 GMM_RETURN;
1173 }
1174 break;
1175 default:
1176 break;
1177 }
1178 break;
1179 default:
1180 break;
1181 }
1182
1183 switch ( gmm_data->kern.sig_cell_info.gmm_status )
1184 {
1185 case GMMRR_SERVICE_FULL:
1186 if ( kern_rai_changed()
1187 || GU_UPDATE_NEEDED EQ GET_STATE(GU) )
1188 {
1189 kern_rau ();
1190 }
1191 else
1192 {
1193 kern_enter_reg_normal_upon_gmmrr_cell_ind();
1194 }
1195 break;
1196 case GMMRR_SERVICE_NONE:
1197 SET_STATE(KERN,KERN_GMM_REG_NO_CELL_AVAILABLE);
1198 #ifdef FF_EM_MODE
1199 EM_GMM_SET_STATE(KERN_GMM_REG_NO_CELL_AVAILABLE);
1200 #endif
1201 break;
1202 default:
1203 case GMMRR_SERVICE_LIMITED:
1204 /*
1205 * stay in limited service
1206 */
1207 break;
1208 }
1209 break;
1210 case KERN_GMM_REG_SUSPENDED:
1211 /* Patch HM 02-Aug-01 >>>
1212
1213 * MMGMM_CELL_SELECTED is used by MM if there was a cell selection
1214 * during a location updating procedure and the location area did
1215 * not change. The remote controlled updating continues in this case,
1216 * as there cannot be any change of network mode if the location
1217 * area identification is not changed.
1218 * If MMGMM_WAIT_FOR_UPDATE is used, MM waits for the update decision
1219 * of GMM. This is the case in this GMM state if the location area has
1220 * changed, maybe the network mode has changed also to I and GMM decides
1221 * to continue the procedure with an combinded attach.
1222 * Although this patch has still to be checked carefully, the unpatched
1223 * code leaded to the situation that GRR was resumed and
1224 * the GSM updating procedure continued, which will cause a phone crash.
1225 */
1226 if ((!sig_cell_info->gmmrr_cell_ind_received
1227 && MMGMM_WAIT_FOR_UPDATE EQ sig_cell_info->mm_status)
1228 || (GMM_MM_REG_UPDATE_NEEDED EQ GET_STATE(MM))
1229 )
1230 /*
1231 * TACTIVATE has expied so we are in a deadlock situaton and MM waits for
1232 * location update request
1233 */
1234 {
1235 switch (gmm_data->kern.sig_cell_info.net_mode)
1236 {
1237 case GMMRR_NET_MODE_II:
1238 kern_resume_grr_reg();
1239 break;
1240 case GMMRR_NET_MODE_III:
1241 switch (gmm_data->kern.attach_cap.mobile_class)
1242 {
1243 case GMMREG_CLASS_BC:
1244 case GMMREG_CLASS_B:
1245 kern_resume_grr_reg();
1246 break;
1247 default:
1248 break;
1249 }
1250 break;
1251 default:
1252 break;
1253 }
1254 }
1255 else
1256 {
1257 TRACE_0_INFO("cell_ind ignored");
1258 }
1259 break;
1260
1261 case KERN_GMM_REG_RESUMING:
1262 if (GMM_RAU EQ gmm_data->kern.attach_cap.rau_initiated
1263 && !(kern_ra_crossed() || kern_rai_changed())
1264 && !gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau)
1265 {
1266 /* RAU is aborted */
1267 TRACE_0_INFO("RAU aborted");
1268 /* GMM2410 */
1269 gmm_data->kern.attach_cap.rau_initiated = GMM_NO_RAU;
1270 kern_local_attach ( LOCAL_TLLI, OLD_TLLI );
1271 }
1272
1273
1274 switch (gmm_data->kern.sig_cell_info.net_mode)
1275 {
1276 case GMMRR_NET_MODE_I:
1277 /*
1278 * kern_enter_reg_normal_upon_gmmrr_cell_ind();
1279 * GMM1080
1280 */
1281 break;
1282 case GMMRR_NET_MODE_II:
1283 switch (gmm_data->kern.attach_cap.attach_type)
1284 {
1285 case GMMREG_AT_IMSI:
1286 case GMMREG_AT_COMB:
1287 if (kern_lau_needed())
1288 {
1289 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1290 #ifdef FF_EM_MODE
1291 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1292 #endif
1293 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1294 GMM_RETURN;
1295
1296 }
1297 break;
1298 case GMMREG_AT_NOT_KNOWN:
1299 switch (gmm_data->kern.detach_cap.detach_type)
1300 {
1301 case GMMREG_DT_IMSI:
1302 break;
1303 case GMMREG_DT_COMB:
1304 case GMMREG_DT_SIM_REMOVED:
1305 if (!kern_is_cell_forbidden())
1306 {
1307 if (kern_lau_needed() )
1308 {
1309 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1310 #ifdef FF_EM_MODE
1311 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1312 #endif
1313 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1314 GMM_RETURN;
1315
1316 }
1317 if ( kern_rai_changed()
1318 || gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau )
1319 {
1320 break;
1321 }
1322 else
1323 {
1324 kern_llgmm_resume ();
1325 kern_detach();
1326 }
1327 }
1328 else
1329 {
1330 kern_local_detach(GMMCS_INT_NOT_PRESENT, /* TCS 2.1 */
1331 FALSE, GMM_LOCAL_DETACH_PROC_ENTER_DEREG);
1332 }
1333 GMM_RETURN;
1334 default:
1335 break;
1336 }
1337 break;
1338 default:
1339 break;
1340 }
1341 break;
1342 case GMMRR_NET_MODE_III:
1343 switch (gmm_data->kern.attach_cap.mobile_class)
1344 {
1345 case GMMREG_CLASS_BG:
1346 if (GMM_MM_DEREG NEQ GET_STATE(MM))
1347 {
1348 if (kern_lau_needed())
1349 {
1350 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1351 #ifdef FF_EM_MODE
1352 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1353 #endif
1354 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1355 }
1356 else
1357 {
1358
1359 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1360 #ifdef FF_EM_MODE
1361 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1362 #endif
1363
1364
1365 /*
1366 * LLC is already suspended
1367 */
1368 kern_gmmrr_suspend (GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_IMSI_DETACH);
1369
1370 }
1371 GMM_RETURN;
1372 }
1373 break;
1374 default:
1375 break;
1376 }
1377 break;
1378 default:
1379 break;
1380 }
1381
1382 if ( gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau )
1383 {
1384 gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau = FALSE;
1385 SET_STATE (KERN, KERN_GMM_REG_ATTEMPTING_TO_UPDATE);
1386 #ifdef FF_EM_MODE
1387 EM_GMM_SET_STATE(KERN_GMM_REG_ATTEMPTING_TO_UPDATE);
1388 #endif
1389 GMM_RETURN;
1390 }
1391
1392 /*
1393 * Added for the Nortel TC 1.4.2.2.2.1 - RAU Procedure while - MSC
1394 * Not Reachable. After the 5th failed attempt, GMM would have set the mode
1395 * to NMOII. If cell_ind indicates the same cell again for resumption,
1396 * preserve the network mode by overwriting the given NMO.
1397 */
1398 if (GMM_NO_RAU EQ gmm_data->kern.attach_cap.rau_initiated
1399 AND !(kern_ra_crossed() OR kern_rai_changed())
1400 AND (gmm_data->kern.sig_cell_info.net_mode EQ GMMRR_NET_MODE_I)
1401 AND (gmm_data->kern.old_sig_cell_info.net_mode EQ GMMRR_NET_MODE_II))
1402 {
1403 TRACE_EVENT("NMO : II");
1404 gmm_data->kern.sig_cell_info.net_mode = GMMRR_NET_MODE_II;
1405 }
1406
1407 switch ( gmm_data->kern.sig_cell_info.gmm_status )
1408 {
1409 case GMMRR_SERVICE_FULL:
1410
1411 if ( kern_rai_changed()
1412 || GU_UPDATE_NEEDED == GET_STATE(GU) )
1413 {
1414 if (gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau)
1415 /*
1416 * R&S vtest case 44.2.3.2.7 wants GMM to wait with RAU untill timer
1417 * is timed out afe5 5th attempt
1418 */
1419 {
1420 gmm_data->kern.attach_cap.enter_attempting_to_update_after_lau=FALSE;
1421 SET_STATE(KERN,KERN_GMM_REG_ATTEMPTING_TO_UPDATE);
1422 #ifdef FF_EM_MODE
1423 EM_GMM_SET_STATE(KERN_GMM_REG_ATTEMPTING_TO_UPDATE);
1424 #endif
1425 GMM_RETURN;
1426 }
1427 else
1428 {
1429 kern_rau_susp ();
1430 }
1431 }
1432 else if ( gmm_data->kern.detach_cap.gmmreg )
1433 /*
1434 * MO DETACH was requested
1435 */
1436 {
1437 TRACE_0_INFO("Detach Request again from GMM_KERN_DEREG_RESUMING");
1438 TRACE_EVENT_P2("Netmode %d MM State %d", gmm_data->kern.sig_cell_info.net_mode, GET_STATE(MM));
1439 /* Already LLC is in suspended state when we are in KERN_GMM_DEREG_RESUMING
1440 * give cell_res so that GRR can transmit */
1441 kern_gmmrr_stop_waiting_for_transmission();
1442 switch ( gmm_data->kern.detach_cap.detach_type )
1443 {
1444 case GMMREG_DT_IMSI:
1445 case GMMREG_DT_COMB:
1446 case GMMREG_DT_SIM_REMOVED:
1447 switch (gmm_data->kern.sig_cell_info.net_mode)
1448 {
1449 case GMMRR_NET_MODE_I:
1450 kern_detach( );
1451 break;
1452 case GMMRR_NET_MODE_II:
1453 /*
1454 * if deatch procedure collision and GSM is already detached we
1455 * are finished
1456 */
1457 if (GMM_MM_DEREG NEQ GET_STATE(MM))
1458 {
1459 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING);
1460 kern_llgmm_suspend(LLGMM_CALL);
1461 kern_gmmrr_suspend(GMMRR_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1462 }
1463 else
1464 {
1465 kern_detach( );
1466 }
1467 break;
1468 case GMMRR_NET_MODE_III:
1469 kern_detach( );
1470 break;
1471 default:
1472 TRACE_ERROR ("unknown net mode");
1473 break;
1474 }
1475 break;
1476 case GMMREG_DT_DISABLE_GPRS:
1477 kern_local_detach( GMMCS_INT_NOT_PRESENT, FALSE, GMM_LOCAL_DETACH_PROC_ENTER_DEREG); /* TCS 2.1 */
1478 break;
1479 case GMMREG_DT_GPRS:
1480 case GMMREG_DT_POWER_OFF:
1481 case GMMREG_DT_SOFT_OFF:
1482 kern_detach( );
1483 break;
1484 default:
1485 TRACE_ERROR ("Unexpected detach type in primitive GMMREG_DETACH_REQ");
1486 break;
1487 }
1488 }
1489 else
1490 {
1491 kern_enter_reg_normal_susp();
1492 }
1493 break;
1494 case GMMRR_SERVICE_NONE:
1495 SET_STATE(KERN,KERN_GMM_REG_NO_CELL_AVAILABLE);
1496 #ifdef FF_EM_MODE
1497 EM_GMM_SET_STATE(KERN_GMM_REG_NO_CELL_AVAILABLE);
1498 #endif
1499 break;
1500 default:
1501 case GMMRR_SERVICE_LIMITED:
1502 kern_enter_reg_limited_susp();
1503 break;
1504 }
1505 break;
1506
1507
1508 case KERN_GMM_RAU_INITIATED:
1509 /*
1510 * <R.GMM.RNABNORM.M.032>
1511 */
1512 if (kern_ra_crossed())
1513 {
1514 gmm_data->gu = GU2_NOT_UPDATED;
1515 kern_sim_gmm_update();
1516 }
1517 switch (gmm_data->kern.sig_cell_info.net_mode)
1518 {
1519 case GMMRR_NET_MODE_II:
1520 if (kern_lau_needed())
1521 {
1522 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1523 #ifdef FF_EM_MODE
1524 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1525 #endif
1526 kern_llgmm_suspend(LLGMM_CALL);
1527 kern_gmmrr_suspend ((UBYTE)
1528 (GMMRR_SERVICE_NONE==gmm_data->kern.sig_cell_info.gmm_status?
1529 GMMRR_NOT_SUSP_GPRS:GMMRR_SUSP_GPRS),
1530 GMMRR_NORMAL_RELEASE,
1531 GMM_SUSP_LAU);
1532 GMM_RETURN;
1533
1534 }
1535 break;
1536 case GMMRR_NET_MODE_III:
1537 switch (gmm_data->kern.attach_cap.mobile_class)
1538 {
1539 case GMMREG_CLASS_BG:
1540 if (GMM_MM_DEREG NEQ GET_STATE(MM))
1541 {
1542 if (kern_lau_needed() )
1543 {
1544 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1545 #ifdef FF_EM_MODE
1546 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1547 #endif
1548 kern_llgmm_suspend(LLGMM_CALL);
1549 kern_gmmrr_suspend ((UBYTE)
1550 (GMMRR_SERVICE_NONE==gmm_data->kern.sig_cell_info.gmm_status?
1551 GMMRR_NOT_SUSP_GPRS:GMMRR_SUSP_GPRS),
1552 GMMRR_NORMAL_RELEASE,
1553 GMM_SUSP_LAU);
1554 }
1555 else
1556 {
1557 kern_imsi_detach_reg_susp();
1558 }
1559 GMM_RETURN;
1560 }
1561
1562 break;
1563 default:
1564 break;
1565 }
1566 break;
1567 default:
1568 break;
1569 }
1570
1571 switch ( gmm_data->kern.sig_cell_info.gmm_status )
1572 {
1573 case GMMRR_SERVICE_FULL:
1574 if ( kern_ra_crossed())
1575 {
1576 if (GMM_PERIODIC_RAU EQ gmm_data->kern.attach_cap.rau_initiated)
1577 {
1578 kern_rau();
1579 }
1580 else
1581 {
1582 kern_rau_limited ();
1583 }
1584 }
1585 else
1586 {
1587 /*
1588 * timer will trigger rau agan
1589 */
1590 if (gmm_data->kern.attach_cap.t3310_value>0)
1591 /*
1592 * t3310 has been stopped due to GMMRR_CR_IND
1593 */
1594 {
1595 TRACE_EVENT ( "Info: START: continue T3310 again" );
1596 /* START PATCH UBUOB ISSUE 8742 */
1597 sig_kern_rdy_start_timer_req ( kern_T3310, gmm_data->kern.t3310_val );
1598 /*vsi_t_start ( GMM_handle , kern_T3310, gmm_data->kern.t3310_val );*/
1599 /* END PATCH UBUOB 8742 */
1600 }
1601 }
1602 break;
1603 case GMMRR_SERVICE_NONE:
1604 SET_STATE(GU,GU_UPDATE_NEEDED);
1605 if (kern_lau_needed() )
1606 {
1607 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1608 #ifdef FF_EM_MODE
1609 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1610 #endif
1611 kern_llgmm_suspend(LLGMM_CALL);
1612 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1613 GMM_RETURN;
1614 }
1615 kern_enter_reg_no_cell_limited();
1616 break;
1617 default:
1618 case GMMRR_SERVICE_LIMITED:
1619 SET_STATE(GU,GU_UPDATE_NEEDED);
1620 kern_enter_reg_limited();
1621 break;
1622 }
1623 gmm_data->kern.attach_cap.t3310_value=0;
1624 break;
1625
1626 case KERN_GMM_REG_NORMAL_SERVICE:
1627 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
1628 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
1629 switch (gmm_data->kern.sig_cell_info.net_mode)
1630 {
1631 case GMMRR_NET_MODE_II:
1632 if (kern_lau_needed() )
1633 {
1634 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1635 #ifdef FF_EM_MODE
1636 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1637 #endif
1638 kern_llgmm_suspend(LLGMM_CALL);
1639 kern_gmmrr_suspend ((UBYTE)
1640 (GMMRR_SERVICE_NONE==gmm_data->kern.sig_cell_info.gmm_status?
1641 GMMRR_NOT_SUSP_GPRS:GMMRR_SUSP_GPRS),
1642 GMMRR_NORMAL_RELEASE,
1643 GMM_SUSP_LAU);
1644 GMM_RETURN;
1645
1646 }
1647 break;
1648 case GMMRR_NET_MODE_III:
1649 switch (gmm_data->kern.attach_cap.mobile_class)
1650 {
1651 case GMMREG_CLASS_BG:
1652 if (GMM_MM_DEREG NEQ GET_STATE(MM))
1653 {
1654 if (kern_lau_needed())
1655 {
1656 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1657 #ifdef FF_EM_MODE
1658 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1659 #endif
1660 kern_llgmm_suspend(LLGMM_CALL);
1661 kern_gmmrr_suspend ((UBYTE)
1662 (GMMRR_SERVICE_NONE==gmm_data->kern.sig_cell_info.gmm_status?
1663 GMMRR_NOT_SUSP_GPRS:GMMRR_SUSP_GPRS),
1664 GMMRR_NORMAL_RELEASE,
1665 GMM_SUSP_LAU);
1666 }
1667 else
1668 {
1669 kern_imsi_detach_reg_susp();
1670 }
1671 GMM_RETURN;
1672 }
1673 break;
1674 default:
1675 break;
1676 }
1677 break;
1678 default:
1679 break;
1680 }
1681
1682 switch ( gmm_data->kern.sig_cell_info.gmm_status )
1683 {
1684 case GMMRR_SERVICE_FULL:
1685 if (kern_rai_changed()
1686 || GU_UPDATE_NEEDED EQ GET_STATE (GU)
1687 )
1688 {
1689 if (kern_cell_changed())
1690 {
1691 kern_rau ();
1692 }
1693 else
1694 {
1695 if (KERN_GMM_REG_ATTEMPTING_TO_UPDATE!=GET_STATE(KERN))
1696 {
1697 kern_gmmrr_stop_waiting_for_transmission();
1698 }
1699 TRACE_0_INFO("cell ind ignored");
1700 }
1701 }
1702 else
1703 {
1704 if (KERN_GMM_REG_ATTEMPTING_TO_UPDATE!=GET_STATE(KERN))
1705 {
1706 kern_gmmrr_stop_waiting_for_transmission();
1707 }
1708 }
1709 break;
1710 case GMMRR_SERVICE_NONE:
1711 if (kern_lau_needed() )
1712 {
1713 SET_STATE ( KERN, KERN_GMM_REG_SUSPENDING );
1714 #ifdef FF_EM_MODE
1715 EM_GMM_SET_STATE(KERN_GMM_REG_SUSPENDING );
1716 #endif
1717 kern_llgmm_suspend(LLGMM_CALL);
1718 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1719 GMM_RETURN;
1720 }
1721 kern_enter_reg_no_cell_limited();
1722 break;
1723 default:
1724 case GMMRR_SERVICE_LIMITED:
1725 kern_enter_reg_limited();
1726 break;
1727 }
1728
1729 break;
1730 case KERN_GMM_RAU_WAIT_FOR_NPDU_LIST:
1731 TRACE_ERROR("unexpected state");
1732 break;
1733 case KERN_GMM_REG_TEST_MODE:
1734 case KERN_GMM_REG_TEST_MODE_NO_IMSI:
1735 TRACE_ERROR("cell change forbidden");
1736 break;
1737
1738 case KERN_GMM_NULL_NO_IMSI:
1739 case KERN_GMM_NULL_NO_IMSI_LIMITED_SERVICE_REQ:
1740 break;
1741
1742 case KERN_GMM_NULL_IMSI:
1743 case KERN_GMM_NULL_IMSI_LIMITED_SERVICE_REQ:
1744 case KERN_GMM_NULL_PLMN_SEARCH:
1745 break;
1746 default:
1747 switch (gmm_data->kern.sig_cell_info.net_mode)
1748 {
1749 case GMMRR_NET_MODE_II:
1750 if (kern_lau_needed())
1751 {
1752 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING );
1753 #ifdef FF_EM_MODE
1754 EM_GMM_SET_STATE(KERN_GMM_DEREG_SUSPENDING );
1755 #endif
1756 kern_llgmm_suspend(LLGMM_CALL);
1757 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1758 GMM_RETURN;
1759
1760 }
1761
1762 break;
1763 case GMMRR_NET_MODE_III:
1764 switch (gmm_data->kern.attach_cap.mobile_class)
1765 {
1766 case GMMREG_CLASS_BG:
1767 if (GMM_MM_DEREG NEQ GET_STATE(MM))
1768 {
1769 if (kern_lau_needed() )
1770 {
1771 SET_STATE ( KERN, KERN_GMM_DEREG_SUSPENDING );
1772 #ifdef FF_EM_MODE
1773 EM_GMM_SET_STATE(KERN_GMM_DEREG_SUSPENDING );
1774 #endif
1775 kern_llgmm_suspend(LLGMM_CALL);
1776 kern_gmmrr_suspend (GMMRR_NOT_SUSP_GPRS, GMMRR_NORMAL_RELEASE, GMM_SUSP_LAU);
1777 }
1778 else
1779 {
1780 kern_imsi_detach_der_susp();
1781 }
1782 GMM_RETURN;
1783 }
1784 break;
1785 default:
1786 break;
1787 }
1788 break;
1789 default:
1790 break;
1791 }
1792
1793 TRACE_ERROR( "sig_cell_info unexpected" );
1794 break;
1795 }
1796 GMM_RETURN;
1797 }/*sig_sync_kern_cell_ind*/
1798
1799 /*
1800 +------------------------------------------------------------------------------
1801 | Function : sig_rx_kern_att_acc_ind
1802 +------------------------------------------------------------------------------
1803 | Description : Handles the internal signal SIG_RX_KERN_ATT_ACC_IND
1804 |
1805 | MSC : 3.8 Attach
1806 |
1807 | MSC : 3.8.1 Normal Attach
1808 | MSC : 3.8.1.2 GPRS attach accepted by the network
1809 | MSC : 3.8.1.2.1 MMI-initiated attach accepted
1810 | MSC : 3.8.1.2.1.1 MMI-initiated attach accepted with implicit P-TMSI reallocation
1811 |
1812 | Parameters : void
1813 |
1814 +------------------------------------------------------------------------------
1815 */
1816 GLOBAL void sig_rx_kern_att_acc_ind ( void )
1817 {
1818 TRACE_ISIG( "sig_rx_kern_att_acc_ind" );
1819
1820 /*
1821 * multiple outstanding SIM_AUTHENTICATION_REQ messages
1822 * for safety reset the counter
1823 */
1824 gmm_data->kern.auth_cap.last_auth_req_id = NOT_PRESENT_8BIT;
1825 switch( GET_STATE( KERN ) )
1826 {
1827 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
1828 /* START PATCH UBUOB ISSUE 8384 */
1829 vsi_t_stop (GMM_handle, kern_T3311);
1830 vsi_t_stop (GMM_handle, kern_T3302);
1831 /* END PATCH UBUOB ISSUE 8384 */
1832 case KERN_GMM_REG_NORMAL_SERVICE:
1833 case KERN_GMM_REG_INITIATED:
1834 {
1835 USHORT cause;
1836 MCAST ( attach_accept, ATTACH_ACCEPT ); /* T_ATTACH_ACCEPT */
1837
1838 if (attach_accept->routing_area_identification.c_mnc EQ 2)
1839 {
1840 /* Internally we always work with 3-digit MNC */
1841 attach_accept->routing_area_identification.c_mnc = SIZE_MNC;
1842 attach_accept->routing_area_identification.mnc[2] = 0xf;
1843 }
1844
1845 cause = kern_make_cause (attach_accept->v_gmm_cause,
1846 attach_accept->gmm_cause.cause_value);
1847
1848 #ifndef _TARGET_
1849 if (memcmp (gmm_data->kern.sig_cell_info.env.rai.plmn.mcc,
1850 attach_accept->routing_area_identification.mcc,
1851 SIZE_MCC) != 0
1852 || memcmp (gmm_data->kern.sig_cell_info.env.rai.plmn.mnc,
1853 attach_accept->routing_area_identification.mnc,
1854 SIZE_MNC) != 0
1855 || gmm_data->kern.sig_cell_info.env.rai.lac!=attach_accept->routing_area_identification.lac
1856 || gmm_data->kern.sig_cell_info.env.rai.rac!=attach_accept->routing_area_identification.rac)
1857 {
1858 TRACE_ERROR ("RAI mismatch");
1859 vsi_o_ttrace(VSI_CALLER TC_ERROR,"error cell: MCC: %x%x%x, MNC: %x%x, lac %x, rac %x",
1860 gmm_data->kern.sig_cell_info.env.rai.plmn.mcc[0],
1861 gmm_data->kern.sig_cell_info.env.rai.plmn.mcc[1],
1862 gmm_data->kern.sig_cell_info.env.rai.plmn.mcc[2],
1863 gmm_data->kern.sig_cell_info.env.rai.plmn.mnc[0],
1864 gmm_data->kern.sig_cell_info.env.rai.plmn.mnc[1],
1865 gmm_data->kern.sig_cell_info.env.rai.lac,
1866 gmm_data->kern.sig_cell_info.env.rai.rac);
1867 vsi_o_ttrace(VSI_CALLER TC_ERROR,"error ACC: MCC: %x%x%x, MNC: %x%x, lac %x, rac %x",
1868 attach_accept->routing_area_identification.mcc[0],
1869 attach_accept->routing_area_identification.mcc[1],
1870 attach_accept->routing_area_identification.mcc[2],
1871 attach_accept->routing_area_identification.mnc[0],
1872 attach_accept->routing_area_identification.mnc[1],
1873 attach_accept->routing_area_identification.lac,
1874 attach_accept->routing_area_identification.rac);
1875 }
1876 #endif /* _TARGET_ */
1877
1878 kern_gmmrr_attach_finished();
1879
1880
1881 gmm_data->kern.attach_cap.sms_radio_priority_level
1882 = attach_accept->radio_priority.radio_priority_level_value;
1883 kern_attach_accept (
1884 &attach_accept->result_gmm,
1885 &attach_accept->force_to_standby,
1886 &attach_accept->rau_timer,
1887 &attach_accept->routing_area_identification,
1888 attach_accept->v_p_tmsi_signature,
1889 &attach_accept->p_tmsi_signature,
1890 attach_accept->v_ready_timer,
1891 &attach_accept->ready_timer,
1892 attach_accept->v_gmobile_identity,
1893 &attach_accept->gmobile_identity,
1894 attach_accept->v_mobile_identity,
1895 &attach_accept->mobile_identity,
1896 FALSE,
1897 NULL,
1898 cause,
1899 attach_accept->v_eqv_plmn_list, /* TCS 2.1 */
1900 &attach_accept->eqv_plmn_list, /* TCS 2.1 */
1901 attach_accept->v_t3302,
1902 &attach_accept->t3302,
1903 attach_accept->v_cell_notification
1904 );
1905 break;
1906 }
1907 default:
1908 sig_kern_rx_gmm_status ( ERRCS_TYPE_INCOMPATIBLE);
1909 TRACE_ERROR( "SIG_RX_KERN_ATT_ACC_IND unexpected" );
1910 break;
1911 }
1912 } /* sig_rx_kern_att_acc_ind() */
1913
1914
1915
1916 /*
1917 +------------------------------------------------------------------------------
1918 | Function : sig_rx_kern_att_rej_ind
1919 +------------------------------------------------------------------------------
1920 | Description : Handles the internal signal SIG_RX_KERN_ATT_REJ_IND
1921 |
1922 | <R.GMM.PATTREJ.M.001>, <R.GMM.PATTREJ.M.002>
1923 |
1924 | Parameters : void
1925 |
1926 +------------------------------------------------------------------------------
1927 */
1928 GLOBAL void sig_rx_kern_att_rej_ind ( void )
1929 {
1930 TRACE_ISIG( "sig_rx_kern_att_rej_ind" );
1931
1932 /*
1933 * multiple outstanding SIM_AUTHENTICATION_REQ messages
1934 * for safety reset the counter
1935 */
1936 gmm_data->kern.auth_cap.last_auth_req_id = NOT_PRESENT_8BIT;
1937
1938 switch( GET_STATE( KERN ) )
1939 {
1940 case KERN_GMM_REG_INITIATED:
1941 {
1942 USHORT cause;
1943 MCAST (attach_reject, ATTACH_REJECT); /* T_ATTACH_REJECT */
1944
1945 /* In ATTACH REJECT, the cause is a mandatory IE */
1946 cause = kern_make_cause (TRUE, attach_reject->gmm_cause.cause_value);
1947
1948 gmm_data->kern.detach_cap.error_cause = cause;
1949
1950 #ifdef REL99
1951 if (attach_reject->v_t3302) /* TCS 4.0 */
1952 { /* TCS 4.0 */
1953 gmm_data->kern.t3302_val = rdy_get_timer( (T_rau_timer *)&attach_reject->t3302 ); /* TCS 4.0 */
1954 } /* TCS 4.0 */
1955 #endif
1956
1957 /*
1958 * <R.GMM.PATTREJ.M.001>, <R.GMM.PATTREJ.M.002>
1959 */
1960 vsi_t_stop ( GMM_handle, kern_T3310);
1961
1962 switch ( cause )
1963 {
1964 case GMMCS_ILLEGAL_ME: /* TCS 2.1 */
1965 case GMMCS_ILLEGAL_MS: /* TCS 2.1 */
1966 case GMMCS_GPRS_NOT_ALLOWED: /* TCS 2.1 */
1967 case GMMCS_PLMN_NOT_ALLOWED: /* TCS 2.1 */
1968 case GMMCS_LA_NOT_ALLOWED: /* TCS 2.1 */
1969 case GMMCS_ROAMING_NOT_ALLOWED: /* TCS 2.1 */
1970 case GMMCS_GSM_GPRS_NOT_ALLOWED: /* TCS 2.1 */
1971 case GMMCS_GPRS_NOT_ALLOWED_IN_PLMN: /* TCS 2.1 */
1972
1973 #ifdef REL99
1974 case GMMCS_NO_SUITABLE_CELL_IN_LA: /*Cause #15*/ /* TCS 4.0 */
1975 #endif
1976
1977 kern_gmmrr_attach_finished();
1978
1979 kern_err_cause ( cause, FALSE );
1980 break;
1981
1982 default:
1983 /*
1984 * <R.GMM.AGREJECT.M026>
1985 * MSC: 3.8.1.4.4. d) ATTACH REJECT, other causes than
1986 * #3, #6, #7, #8, #11, #12, or #13
1987 */
1988 kern_aac(cause);
1989 break;
1990 }
1991 break;
1992 }
1993 default:
1994 sig_kern_rx_gmm_status ( ERRCS_TYPE_INCOMPATIBLE);
1995 TRACE_ERROR( "SIG_RX_KERN_ATT_REJ_IND unexpected" );
1996 break;
1997 }
1998 } /* sig_rx_kern_att_rej_ind() */
1999
2000 /*
2001 +------------------------------------------------------------------------------
2002 | Function : kern_d_detach_default
2003 +------------------------------------------------------------------------------
2004 | Description : The function kern_d_detach_default()
2005 |
2006 | This procedure is used for default branch in
2007 | D_DETACH_REQUEST procedure
2008 |
2009 | Parameters : detach_type from d_detach_request - AIR message
2010 | cause GMM cause derived from d_detach_request
2011 |
2012 +------------------------------------------------------------------------------
2013 */
2014 LOCAL void kern_local_d_detach_default (UBYTE detach_type, USHORT cause)
2015 {
2016 GMM_TRACE_FUNCTION( "kern_local_d_detach_default" );
2017 switch ( detach_type )
2018 {
2019 case DT_RE_ATTACH:
2020 /*
2021 * If the MS is attached for GPRS and non-GPRS services and the network
2022 * operates in network operation mode I, then if in the MS the timer T3212 is
2023 * not already running, the timer T3212 shall be set to its initial value and
2024 * restarted. (Version 6.7.0)
2025 *
2026 * <R.GMM.DNACM.M.039>
2027 */
2028 if(GMM_MM_DEREG NEQ GET_STATE(MM)
2029 && GMMRR_NET_MODE_I EQ gmm_data->kern.sig_cell_info.net_mode)
2030 {
2031 kern_mm_start_t3212();
2032 }
2033 /*
2034 * <R.DNACM.M.035>
2035 */
2036 gmm_data->kern.detach_cap.detach_type = GMM_DT_RE_ATTACH;
2037 kern_local_detach (cause, TRUE, GMM_LOCAL_DETACH_PROC_RE_ATTACH);
2038
2039
2040 break;
2041 case DT_IMSI_DETACH:
2042 /*
2043 * If the detach type IE indicates 'IMSI detach' or 'reattach required',
2044 * then the MS shall ignore the cause code if received (GSM04.08v6f0 4.7.4.2.2)
2045 */
2046 /*
2047 * reattach for IMSI in NMO I
2048 */
2049 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_IMSI;
2050 if (GMMRR_NET_MODE_I EQ gmm_data->kern.sig_cell_info.net_mode
2051 && GMMREG_AT_COMB EQ gmm_data->kern.attach_cap.attach_type)
2052 {
2053 kern_local_detach( GMMCS_INT_NOT_PRESENT, FALSE, GMM_LOCAL_DETACH_PROC_RAU); /* TCS 2.1 */
2054 }
2055 else
2056 {
2057 kern_local_detach( GMMCS_INT_NOT_PRESENT, FALSE, GMM_LOCAL_DETACH_PROC_ENTER_REG_NORMAL); /* TCS 2.1 */
2058 }
2059 break;
2060
2061 default:
2062 TRACE_ERROR ("unaxpected detach type in AIR message");
2063 /* NO break;*/
2064 case DT_NO_RE_ATTACH:
2065 /*
2066 * LABEL DT_NO_REATTACH
2067 *
2068 * If the MS is attached for GPRS and non-GPRS services and the network
2069 * operates in network operation mode I, then if in the MS the timer T3212 is
2070 * not already running, the timer T3212 shall be set to its initial value and
2071 * restarted. (Version 6.7.0)
2072 *
2073 * <R.GMM.DNACM.M.039>
2074 */
2075 if(GMM_MM_DEREG NEQ GET_STATE(MM)
2076 && GMMRR_NET_MODE_I EQ gmm_data->kern.sig_cell_info.net_mode)
2077 {
2078 kern_mm_start_t3212();
2079 }
2080
2081 vsi_t_stop ( GMM_handle, kern_T3310);
2082 vsi_t_stop ( GMM_handle, kern_T3311);
2083
2084 if (gmm_data->kern.detach_cap.gmmreg)
2085 {
2086 if (GMMREG_DT_IMSI EQ gmm_data->kern.detach_cap.detach_type)
2087 {
2088 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_COMB;
2089 }
2090 else
2091 {
2092 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_GPRS;
2093 }
2094 }
2095 else
2096 {
2097 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_GPRS;
2098 }
2099 kern_local_detach (cause, TRUE, GMM_LOCAL_DETACH_PROC_ENTER_DEREG);
2100 /*
2101 * entering state der is not possible here, because detach accept has to
2102 * be sent first.
2103 * kern_enter_der();
2104 *//* GMM9000C */
2105 break;
2106 }
2107
2108 GMM_RETURN;
2109 } /* kern_local_d_detach_default() */
2110
2111
2112
2113 /*
2114 +------------------------------------------------------------------------------
2115 | Function : sig_rx_kern_det_req_ind
2116 +------------------------------------------------------------------------------
2117 | Description : Handles the internal signal SIG_RX_KERN_DET_REQ_IND
2118 |
2119 | Not yet implemented
2120 |
2121 | Parameters : void
2122 |
2123 +------------------------------------------------------------------------------
2124 */
2125 GLOBAL void sig_rx_kern_det_req_ind ( void )
2126 {
2127 TRACE_ISIG( "sig_rx_kern_det_req_ind" );
2128 {
2129 UBYTE detach_type;
2130 USHORT cause;
2131 MCAST ( d_detach_request, D_DETACH_REQUEST );
2132
2133 detach_type = d_detach_request->d_detach_type.d_type_of_detach;
2134 cause = kern_make_cause (d_detach_request->v_gmm_cause,
2135 d_detach_request->gmm_cause.cause_value);
2136
2137 switch( GET_STATE( KERN ) )
2138 {
2139 case KERN_GMM_RAU_INITIATED:
2140
2141 if ( DT_IMSI_DETACH EQ detach_type )
2142 /*
2143 * RAU continued
2144 */
2145 {
2146 /*
2147 * <R.GMM.RNABNORM.M.015>, <R.GMM.RNABNORM.M.016>
2148 */
2149 return;
2150 }
2151 break;
2152 case KERN_GMM_REG_INITIATED:
2153
2154 if ( DT_RE_ATTACH EQ detach_type )
2155 /*
2156 * reattach
2157 */
2158 {
2159 /*
2160 * MSC: 3.8 Attach
2161 *
2162 * MSC: 3.8.1 Normal Attach
2163 * MSC: 3.8.1.4 Abnormal cases
2164 * MSC: 3.81.4.8 h) Procedure collision
2165 * MSC: 3.81.4.8.1 Re-attach requested
2166
2167 * <R.GMM.AGABNORM.M.016>, <R.GMM.AGABNORM.M.017>
2168 */
2169 TRACE_0_INFO ("reattach (reset) requested by the network.");
2170 return;
2171 }
2172 else
2173 {
2174 kern_gmmrr_attach_finished();
2175 }
2176 break;
2177
2178 case KERN_GMM_DEREG_SUSPENDING:
2179 if ( DT_RE_ATTACH EQ detach_type )
2180 /*
2181 * reattach
2182 */
2183 {
2184 TRACE_0_INFO ("it seems that reattach (reset) has been requested by the network TWICE.");
2185 TRACE_0_INFO ("DETACH message will be inored.");
2186 return;
2187 }
2188 break;
2189 default:
2190 break;
2191 }
2192 /*
2193 * LABEL DET_REQ_IND
2194 */
2195 /* MSC: 3.8 Attach
2196 *
2197 * MSC: 3.8.1 Normal Attach
2198 * MSC: 3.8.1.4 Abnormal cases
2199 * MSC: 3.81.4.8 h) Procedure collision
2200 * MSC: 3.81.4.8.2 Re-attach not requested
2201 *
2202 * <R.GMM.AGABNORM.M.018>, <R.GMM.AGABNORM.M.019>
2203 */
2204
2205 sig_kern_tx_data_req ( CURRENT_TLLI, U_DETACH_ACCEPT );
2206
2207
2208 sig_kern_rdy_force_ie_req (
2209 d_detach_request->force_to_standby.force_to_standby_value,FALSE);
2210
2211 switch (detach_type)
2212 {
2213 case DT_IMSI_DETACH:
2214 kern_local_d_detach_default(detach_type, cause);
2215
2216 /*
2217 * If the detach type IE indicates 'IMSI detach' or 'reattach required',
2218 * then the MS shall ignore the cause code if received (GSM04.08v6f0 4.7.4.2.2)
2219 */
2220 return;
2221 case DT_RE_ATTACH :
2222 kern_local_d_detach_default(detach_type, cause);
2223 /*
2224 * If the detach type IE indicates 'IMSI detach' or 'reattach required',
2225 * then the MS shall ignore the cause code if received (GSM04.08v6f0 4.7.4.2.2)
2226 */
2227 return;
2228 default:
2229 break;
2230 }
2231
2232 switch ( cause )
2233 {
2234 case GMMCS_IMSI_UNKNOWN: /* TCS 2.1 */
2235 case GMMCS_ILLEGAL_ME: /* TCS 2.1 */
2236 case GMMCS_ILLEGAL_MS: /* TCS 2.1 */
2237 case GMMCS_GPRS_NOT_ALLOWED: /* TCS 2.1 */
2238 case GMMCS_PLMN_NOT_ALLOWED: /* TCS 2.1 */
2239 case GMMCS_LA_NOT_ALLOWED: /* TCS 2.1 */
2240 case GMMCS_ROAMING_NOT_ALLOWED: /* TCS 2.1 */
2241 case GMMCS_GSM_GPRS_NOT_ALLOWED: /* TCS 2.1 */
2242 case GMMCS_GPRS_NOT_ALLOWED_IN_PLMN: /* TCS 2.1 */
2243
2244 #ifdef REL99
2245 case GMMCS_NO_SUITABLE_CELL_IN_LA: /*Cause #15*/ /* TCS 4.0 */
2246 #endif
2247
2248 kern_err_cause (cause, TRUE); /* TCS 2.1 */
2249 break;
2250 default:
2251 kern_local_d_detach_default(detach_type, cause);
2252 break;
2253 }
2254 }
2255 } /* sig_rx_kern_det_req_ind() */
2256
2257
2258
2259 /*
2260 +------------------------------------------------------------------------------
2261 | Function : sig_rx_kern_det_acc_ind
2262 +------------------------------------------------------------------------------
2263 | Description : Handles the internal signal SIG_RX_KERN_DET_ACC_IND
2264 |
2265 | MSC: 3.9 GPRS detach procedure
2266 |
2267 | MSC: 3.9.1 MS initiated GPRS detach procedure completion
2268 | (without switching off)
2269 |
2270 | Parameters : void
2271 |
2272 +------------------------------------------------------------------------------
2273 */
2274 GLOBAL void sig_rx_kern_det_acc_ind ()
2275 {
2276 TRACE_ISIG( "sig_rx_kern_det_acc_ind" );
2277 /*
2278 * detach type has to be normal detach
2279 */
2280 /*
2281 * multiple outstanding SIM_AUTHENTICATION_REQ messages
2282 * for safety reset the counter
2283 */
2284 gmm_data->kern.auth_cap.last_auth_req_id = NOT_PRESENT_8BIT;
2285
2286 switch( GET_STATE( KERN ) )
2287 {
2288 case KERN_GMM_DEREG_INITIATED:
2289 /*
2290 * timer has to be stopped here becausekern_local_detach will not be called
2291 */
2292 vsi_t_stop ( GMM_handle , kern_T3321);
2293
2294 {
2295 MCAST ( d_detach_accept, D_DETACH_ACCEPT);
2296
2297 sig_kern_rdy_force_ie_req (
2298 d_detach_accept->force_to_standby.force_to_standby_value, FALSE);
2299 }
2300 if ( gmm_data->kern.detach_cap.gmmreg
2301 || (gmm_data->kern.attach_cap.gmmreg
2302 && GMMREG_CLASS_CC EQ gmm_data->kern.attach_cap.mobile_class)
2303 )
2304 {
2305 kern_local_detach ( GMMCS_INT_NOT_PRESENT, FALSE, GMM_LOCAL_DETACH_PROC_DISABLE); /* TCS 2.1 */
2306 }
2307 else
2308 {
2309 /*
2310 * if the mobile is a class BC mobile and it has to detach for GPRS
2311 * because of NMO III than it should be able to look for a good GPRS cell.
2312 * So GRR must be switched on.
2313 */
2314 kern_local_detach ( GMMCS_INT_NOT_PRESENT, FALSE, GMM_LOCAL_DETACH_PROC_UNASSIGN); /* TCS 2.1 */
2315 }
2316
2317 break;
2318 case KERN_GMM_REG_IMSI_DETACH_INITIATED:
2319 kern_local_detach ( GMMCS_INT_NOT_PRESENT, FALSE, GMM_LOCAL_DETACH_PROC_ENTER_REG_NORMAL); /* TCS 2.1 */
2320 {
2321 MCAST ( d_detach_accept, D_DETACH_ACCEPT);
2322
2323 sig_kern_rdy_force_ie_req (
2324 d_detach_accept->force_to_standby.force_to_standby_value, FALSE);
2325 }
2326 break;
2327 default:
2328 sig_kern_rx_gmm_status ( ERRCS_TYPE_INCOMPATIBLE);
2329 break;
2330 }
2331 } /* sig_rx_kern_det_acc_ind() */
2332
2333
2334
2335 /*
2336 +------------------------------------------------------------------------------
2337 | Function : sig_rx_kern_rau_acc_ind
2338 +------------------------------------------------------------------------------
2339 | Description : Handles the internal signal SIG_RX_KERN_RAU_ACC_IND
2340 |
2341 | MSC: 3.10 RAU
2342 |
2343 | MSC: 3.10.1 Normal and periodic RAU initiation
2344 | MSC: 3.10.1.2 Normal and periodic RAU accepted by the network
2345 |
2346 | Parameters : void
2347 |
2348 +------------------------------------------------------------------------------
2349 */
2350 GLOBAL void sig_rx_kern_rau_acc_ind ( )
2351 {
2352 TRACE_ISIG( "sig_rx_kern_rau_acc_ind" );
2353
2354 if (GMM_NO_RAU EQ gmm_data->kern.attach_cap.rau_initiated)
2355 {
2356 gmm_data->kern.attach_cap.rau_initiated = GMM_RAU;
2357 TRACE_0_INFO ("RAU ACCEPT receied twice");
2358 }
2359 /*
2360 * multiple outstanding SIM_AUTHENTICATION_REQ messages
2361 * for safety reset the counter
2362 */
2363 gmm_data->kern.auth_cap.last_auth_req_id = NOT_PRESENT_8BIT;
2364
2365 switch( GET_STATE( KERN ) )
2366 {
2367
2368 /* START PATCH UBUOB ISSUE 8384 */
2369 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
2370 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
2371 vsi_t_stop (GMM_handle, kern_T3311);
2372 vsi_t_stop (GMM_handle, kern_T3302);
2373 /* NO break; */
2374 case KERN_GMM_RAU_INITIATED:
2375 /* END PATCH UBUOB ISSUE 8384 */
2376 kern_gmmrr_attach_finished();
2377
2378 /* NO break; */
2379 case KERN_GMM_REG_NORMAL_SERVICE:
2380 {
2381 USHORT cause;
2382 MCAST (routing_area_update_accept, ROUTING_AREA_UPDATE_ACCEPT);
2383
2384 if (routing_area_update_accept->routing_area_identification.c_mnc EQ 2)
2385 {
2386 /* Internally we always work with 3-digit MNC */
2387 routing_area_update_accept->routing_area_identification.c_mnc = SIZE_MNC;
2388 routing_area_update_accept->routing_area_identification.mnc[2] = 0xf;
2389 }
2390
2391 cause = kern_make_cause (routing_area_update_accept->v_gmm_cause,
2392 routing_area_update_accept->gmm_cause.cause_value);
2393
2394 #ifndef _TARGET_
2395 /*
2396 * Check whether the ROUTING AREA UPDATE ACCEPT is for the network
2397 * MM sent via MMGMM_ACTIVATE_IND, otherwise we want to see this to
2398 * make it possible to revise the simulation testcase.
2399 */
2400
2401 if (memcmp (gmm_data->kern.sig_cell_info.env.rai.plmn.mcc,
2402 routing_area_update_accept->routing_area_identification.mcc,
2403 SIZE_MCC) != 0
2404 || memcmp (gmm_data->kern.sig_cell_info.env.rai.plmn.mnc,
2405 routing_area_update_accept->routing_area_identification.mnc,
2406 SIZE_MNC) != 0
2407 || gmm_data->kern.sig_cell_info.env.rai.lac!=routing_area_update_accept->routing_area_identification.lac
2408 || gmm_data->kern.sig_cell_info.env.rai.rac!=routing_area_update_accept->routing_area_identification.rac)
2409 {
2410 TRACE_ERROR ("RAI mismatch");
2411 vsi_o_ttrace(VSI_CALLER TC_ERROR,"error cell: MCC: %x%x%x, MNC: %x%x, lac %x, rac %x",
2412 gmm_data->kern.sig_cell_info.env.rai.plmn.mcc[0],
2413 gmm_data->kern.sig_cell_info.env.rai.plmn.mcc[1],
2414 gmm_data->kern.sig_cell_info.env.rai.plmn.mcc[2],
2415 gmm_data->kern.sig_cell_info.env.rai.plmn.mnc[0],
2416 gmm_data->kern.sig_cell_info.env.rai.plmn.mnc[1],
2417 gmm_data->kern.sig_cell_info.env.rai.lac,
2418 gmm_data->kern.sig_cell_info.env.rai.rac);
2419 vsi_o_ttrace(VSI_CALLER TC_ERROR,"error ACC: MCC: %x%x%x, MNC: %x%x, lac %x, rac %x",
2420 routing_area_update_accept->routing_area_identification.mcc[0],
2421 routing_area_update_accept->routing_area_identification.mcc[1],
2422 routing_area_update_accept->routing_area_identification.mcc[2],
2423 routing_area_update_accept->routing_area_identification.mnc[0],
2424 routing_area_update_accept->routing_area_identification.mnc[1],
2425 routing_area_update_accept->routing_area_identification.lac,
2426 routing_area_update_accept->routing_area_identification.rac);
2427 }
2428
2429 //assert (plmn_ok); /* Stop stack in simulation to force a "failed". */
2430 #endif /* WIN32 */
2431
2432 kern_attach_accept (
2433 &routing_area_update_accept->result_gmm,
2434 &routing_area_update_accept->force_to_standby,
2435 &routing_area_update_accept->rau_timer,
2436 &routing_area_update_accept->routing_area_identification,
2437 routing_area_update_accept->v_p_tmsi_signature,
2438 &routing_area_update_accept->p_tmsi_signature,
2439 routing_area_update_accept->v_ready_timer,
2440 &routing_area_update_accept->ready_timer,
2441 routing_area_update_accept->v_gmobile_identity,
2442 &routing_area_update_accept->gmobile_identity,
2443 routing_area_update_accept->v_mobile_identity,
2444 &routing_area_update_accept->mobile_identity,
2445 routing_area_update_accept->v_receive_n_pdu_number_list,
2446 &routing_area_update_accept->receive_n_pdu_number_list,
2447 cause,
2448 routing_area_update_accept->v_eqv_plmn_list, /* TCS 2.1 */
2449 &routing_area_update_accept->eqv_plmn_list, /* TCS 2.1 */
2450 routing_area_update_accept->v_t3302,
2451 &routing_area_update_accept->t3302,
2452 routing_area_update_accept->v_cell_notification
2453 );
2454 break;
2455 }
2456 default:
2457 sig_kern_rx_gmm_status ( ERRCS_TYPE_INCOMPATIBLE);
2458 TRACE_ERROR( "SIG_RX_KERN_RAU_ACC_IND unexpected" );
2459 break;
2460 }
2461 } /* sig_rx_kern_rau_acc_ind() */
2462
2463
2464
2465 /*
2466 +------------------------------------------------------------------------------
2467 | Function : sig_rx_kern_rau_rej_ind
2468 +------------------------------------------------------------------------------
2469 | Description : Handles the internal signal SIG_RX_KERN_RAU_REJ_IND
2470 |
2471 | MSC: 3.10 RAU
2472 |
2473 | MSC: 3.10.1 Normal Attach
2474 | MSC: 3.10.1.3 RAU not accepted by the network
2475 |
2476 | <R.GMM.PATTREJ.M.001>, <R.GMM.PATTREJ.M.002>
2477 |
2478 | Parameters : void
2479 |
2480 +------------------------------------------------------------------------------
2481 */
2482 GLOBAL void sig_rx_kern_rau_rej_ind ( )
2483 {
2484 TRACE_ISIG( "sig_rx_kern_rau_rej_ind" );
2485
2486 /*
2487 * multiple outstanding SIM_AUTHENTICATION_REQ messages
2488 * for safety reset the counter
2489 */
2490 gmm_data->kern.auth_cap.last_auth_req_id = NOT_PRESENT_8BIT;
2491
2492 switch( GET_STATE( KERN ) )
2493 {
2494 case KERN_GMM_RAU_INITIATED:
2495 {
2496 USHORT cause;
2497 MCAST (routing_area_update_reject, ROUTING_AREA_UPDATE_REJECT);
2498
2499 SET_STATE(GU,GU_UPDATE_NEEDED);
2500
2501 // The primitive is also sent in kern_aac(), so for the
2502 // default case it is sent twice.
2503 kern_gmmrr_attach_finished();
2504
2505 /* In ROUTING AREA UPDATE REJECT, the cause is a mandatory IE */
2506 cause = kern_make_cause (TRUE,
2507 routing_area_update_reject->gmm_cause.cause_value);
2508 #ifdef REL99
2509 if (routing_area_update_reject->v_t3302) /* TCS 4.0 */
2510 { /* TCS 4.0 */
2511 gmm_data->kern.t3302_val = rdy_get_timer ( (T_rau_timer *)&routing_area_update_reject->t3302 ); /* TCS 4.0 */
2512 } /* TCS 4.0 */
2513 #endif
2514
2515 /*
2516 * <R.GMM.PATTREJ.M.001>, <R.GMM.PATTREJ.M.002>
2517 */
2518 /*
2519 * I used T3310 insted of T3330
2520 */
2521 vsi_t_stop ( GMM_handle, kern_T3310);
2522
2523 /*
2524 * force to standb does only in RAU_REJ exist
2525 */
2526 sig_kern_rdy_force_ie_req (
2527 routing_area_update_reject->force_to_standby.force_to_standby_value,FALSE);
2528
2529
2530 switch ( cause )
2531 {
2532 case GMMCS_ILLEGAL_MS: /* TCS 2.1 */
2533 case GMMCS_ILLEGAL_ME: /* TCS 2.1 */
2534 case GMMCS_GPRS_NOT_ALLOWED: /* TCS 2.1 */
2535 case GMMCS_NO_MS_ID: /* TCS 2.1 */
2536 case GMMCS_IMPLICIT_DETACHED: /* TCS 2.1 */
2537 case GMMCS_PLMN_NOT_ALLOWED: /* TCS 2.1 */
2538 case GMMCS_LA_NOT_ALLOWED: /* TCS 2.1 */
2539
2540 #ifndef REL99
2541 case GMMCS_ROAMING_NOT_ALLOWED: /* TCS 2.1 */
2542 #endif
2543
2544 case GMMCS_GPRS_NOT_ALLOWED_IN_PLMN: /* TCS 2.1 */
2545 case GMMCS_GSM_GPRS_NOT_ALLOWED: /* TCS 2.1 */
2546 /*case GMMCS_MSC_TEMP_NOT_REACHABLE:*/ /* TCS 2.1 */
2547 kern_err_cause ( cause, FALSE );
2548 break;
2549
2550 #ifdef REL99
2551 /* Cause #13 and #15 - Set the GPRS update status to
2552 * GU3 ROAMING NOT ALLOWED. Reset the rau attempt counter.
2553 * Change state to GMM_REGISTERED.LIMITED_SERVICE
2554 * kern_err_cause() is not called for this cause
2555 * because it conflicts with the handling of attach
2556 * reject and NW initiated detach request.
2557 */
2558 case GMMCS_ROAMING_NOT_ALLOWED: /* TCS 4.0 */
2559 case GMMCS_NO_SUITABLE_CELL_IN_LA: /* TCS 4.0 */
2560 gmm_data->gu = GU3_ROAMING_NOT_ALLOWED; /* TCS 4.0 */
2561 kern_sim_gmm_update(); /*Update SIM*/ /* TCS 4.0 */
2562 kern_attach_reset(); /* TCS 4.0 */
2563 SET_STATE(KERN, KERN_GMM_REG_LIMITED_SERVICE); /* TCS 4.0 */
2564 #ifdef FF_EM_MODE
2565 EM_GMM_SET_STATE(KERN_GMM_REG_LIMITED_SERVICE); /* TCS 4.0 */
2566 #endif
2567 /* MM has different handling for Cause 13/15 sent in case of
2568 * ATTACH REJ and RAU REJ. In case of ATTACH REJ the original
2569 * cause value is passed. In case of RAU REJ a new internal
2570 * cause value is used.
2571 */
2572 if (GMMCS_ROAMING_NOT_ALLOWED EQ cause) /* TCS 4.0 */
2573 { /* TCS 4.0 */
2574 kern_mm_attach_rej(GMMCS_ROAMING_NOT_ALLOWED_WITH_RAU_REJ); /* TCS 4.0 */
2575 } /* TCS 4.0 */
2576 else if (GMMCS_NO_SUITABLE_CELL_IN_LA EQ cause) /* TCS 4.0 */
2577 { /* TCS 4.0 */
2578 kern_mm_attach_rej(GMMCS_NO_SUITABLE_CELL_IN_LA_WITH_RAU_REJ); /* TCS 4.0 */
2579 } /* TCS 4.0 */
2580 else /* TCS 4.0 */
2581 { /* TCS 4.0 */
2582 TRACE_ERROR("Error in cause value !"); /* TCS 4.0 */
2583 } /* TCS 4.0 */
2584 break; /* TCS 4.0 */
2585 #endif
2586
2587 default:
2588 /*
2589 * other causes than #3, #6, #7, #9, #10, #11, #12, #13 (and #15 for TCS4)
2590 */
2591 kern_aac(cause);
2592 break;
2593 }
2594 }
2595 break;
2596
2597 default:
2598 sig_kern_rx_gmm_status ( ERRCS_TYPE_INCOMPATIBLE);
2599 TRACE_ERROR( "SIG_RX_KERN_RAU_REJ_IND unexpected" );
2600 break;
2601 }
2602 } /* sig_rx_kern_rau_rej_ind() */
2603
2604 /*
2605 +------------------------------------------------------------------------------
2606 | Function : sig_rx_kern_realloc_cmd_ind
2607 +------------------------------------------------------------------------------
2608 | Description : Handles the internal signal SIG_RX_PTMS_REALLOC_CMD_IND
2609 |
2610 |
2611 | - store RAI, P-TMSI
2612 | - calculate global TLLI based on new P-TMSI
2613 | - (store P-TMSI signature, if available)
2614 | - check force to standby IE
2615 | - send SIM_GMM_UPDATE_REQ to SIM
2616 |
2617 | Parameters : void
2618 |
2619 +------------------------------------------------------------------------------
2620 */
2621 GLOBAL void sig_rx_kern_realloc_cmd_ind ( void )
2622 {
2623 TRACE_ISIG( "sig_rx_kern_realloc_cmd_ind" );
2624
2625 switch( GET_STATE( KERN ) )
2626 {
2627 case KERN_GMM_DEREG_INITIATED:
2628 /*************************************************************************************
2629 * MSC: 3.9 GPRS detach procedure
2630 *
2631 * MSC: 3.9.3 Abnormal cases
2632 * MSC: 3.9.3.4 d) Detach and common procedure collision
2633 * MSC: 3.9.3.4.3 Receipt of remaining common procedures
2634 *************************************************************************************/
2635 break;
2636 case KERN_GMM_RAU_INITIATED:
2637 /*************************************************************************************
2638 * MSC: 3.10.1 Normal and periodic RAU initiation
2639 * MSC: 3.10.1.4 Abnormal cases
2640 * MSC: 3.10.1.4.8 h) RAU and P-TMSI procedure collision
2641 *************************************************************************************/
2642 /*
2643 * <R.GMM.RNABNORM.M.017>, <R.GMM.RNABNORM.M.018>
2644 */
2645 break;
2646 default:
2647 {
2648 MCAST ( p_tmsi_reallocation_command, P_TMSI_REALLOCATION_COMMAND );
2649
2650 /* Internally we work always with 3-digit-MNC */
2651 if (p_tmsi_reallocation_command->routing_area_identification.c_mnc EQ 2)
2652 {
2653 p_tmsi_reallocation_command->routing_area_identification.c_mnc = SIZE_MNC;
2654 p_tmsi_reallocation_command->routing_area_identification.mnc[2] = 0xf;
2655 }
2656
2657 /*<R.GMM.REACMPLM.M.001>*/
2658 kern_set_rai ( &p_tmsi_reallocation_command->routing_area_identification );
2659
2660 sig_kern_rdy_force_ie_req (
2661 p_tmsi_reallocation_command->force_to_standby.force_to_standby_value,FALSE );
2662 /*
2663 * <R.GMM.REACMPLM.M.003>, <R.GMM.REACMPLM.M.004>,
2664 * <R.GMM.REACMPLM.M.005>
2665 *
2666 * this procedure transmittes the SIM_GMM_UPDATE_REQ message
2667 */
2668 kern_tmsi_negotiated (
2669 FALSE, /* tmsi is never required */
2670 NULL,
2671 TRUE, /* ptmsi is always required */
2672 &p_tmsi_reallocation_command->gmobile_identity,
2673 p_tmsi_reallocation_command->v_p_tmsi_signature,
2674 &p_tmsi_reallocation_command->p_tmsi_signature);
2675
2676 {
2677 /*
2678 * <R.GMM.REACMPLM.M.002>
2679 */
2680 sig_kern_tx_data_req ( CURRENT_TLLI, P_TMSI_REALLOCATION_COMPLETE );
2681 }
2682 break;
2683 }
2684 }
2685 } /* sig_rx_kern_realloc_cmd_ind() */
2686
2687
2688
2689 /*
2690 +------------------------------------------------------------------------------
2691 | Function : sig_rx_kern_auth_req_ind
2692 +------------------------------------------------------------------------------
2693 | Description : Handles the internal signal SIG_RX_KERN_AUTH_REQ_IND
2694 |
2695 | Parameters : void
2696 |
2697 +------------------------------------------------------------------------------
2698 */
2699 GLOBAL void sig_rx_kern_auth_req_ind ( )
2700 {
2701 TRACE_ISIG( "sig_rx_kern_auth_req_ind" );
2702
2703 switch( GET_STATE( KERN ) )
2704 {
2705 case KERN_GMM_DEREG_LIMITED_SERVICE:
2706 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
2707 case KERN_GMM_DEREG_PLMN_SEARCH:
2708 /*
2709 * L. wants to authentiate while attaching
2710 *
2711 * case KERN_GMM_REG_INITIATED:
2712 */
2713 break;
2714
2715 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
2716 case KERN_GMM_REG_INITIATED:
2717 /*
2718 * <R.GMM.AGCOMMON.I.001>
2719 * The network may initiate GMM common procedures, e.g. the GMM identification
2720 * and GMM authentication and ciphering procedure, depending on the received
2721 * information such as IMSI, CKSN, old RAI, P-TMSI and P-TMSI signature.
2722 */
2723 case KERN_GMM_REG_NORMAL_SERVICE:
2724 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
2725 case KERN_GMM_REG_NO_CELL_AVAILABLE:
2726 case KERN_GMM_REG_LIMITED_SERVICE:
2727 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
2728 case KERN_GMM_DEREG_INITIATED:
2729 /*************************************************************************
2730 * MSC: 3.9 GPRS detach procedure
2731 *
2732 * MSC: 3.9.3 Abnormal cases
2733 * MSC: 3.9.3.4 d) Detach and common procedure collision
2734 * MSC: 3.9.3.4.3 Receipt of remaining common procedures
2735 *************************************************************************/
2736
2737 case KERN_GMM_RAU_INITIATED:
2738 case KERN_GMM_REG_IMSI_DETACH_INITIATED:
2739 {
2740 MCAST (authentication_and_ciphering_request,
2741 AUTHENTICATION_AND_CIPHERING_REQUEST);
2742
2743 MCAST (authentication_and_ciphering_response,
2744 AUTHENTICATION_AND_CIPHERING_RESPONSE);
2745
2746 gmm_data->kern.auth_cap.imeisv_requested = authentication_and_ciphering_request->imeisv_request.imeisv_request_value;
2747 gmm_data->kern.auth_cap.a_c_reference_number = authentication_and_ciphering_request->a_c_reference_number.a_c_reference_number_value;
2748 gmm_data->kern.auth_cap.ciphering_algorithm = authentication_and_ciphering_request->ciphering_algorithm.type_of_algorithm;
2749
2750 /*start SIM_AUTHENTICATION_REQ if "RAND" and "cksn" are delivered with A&C_req*/
2751 if (authentication_and_ciphering_request->v_authentication_parameter_rand EQ TRUE)
2752 {
2753 #ifdef GMM_TCS4
2754 if(gmm_data->kern.auth_cap.last_auth_req_id NEQ NOT_PRESENT_8BIT)
2755 {
2756 /*
2757 * problem occurred!!!!
2758 */
2759 TRACE_1_INFO("Authentication problem occurred %d. time.",
2760 gmm_data->kern.auth_cap.last_auth_req_id);
2761 gmm_data->kern.auth_cap.last_auth_req_id++;
2762 }
2763 else
2764 {
2765 gmm_data->kern.auth_cap.last_auth_req_id = 0;
2766 }
2767 #endif
2768 kern_sim_authentication_req ( authentication_and_ciphering_request
2769 ->authentication_parameter_rand.rand_value,
2770 authentication_and_ciphering_request
2771 ->ciphering_key_sequence_number.key_sequence);
2772 gmm_data->kern.auth_cap.cksn = authentication_and_ciphering_request->ciphering_key_sequence_number.key_sequence;
2773 #ifndef GMM_TCS4
2774 gmm_data->kern.auth_cap.outstanding_count++;
2775 if (gmm_data->kern.auth_cap.outstanding_count NEQ 1)
2776 {
2777 /* problem occurred!!!! */
2778 TRACE_1_INFO("Authentication problem occurred %d. time.",gmm_data->kern.auth_cap.outstanding_count);
2779 }
2780 #endif
2781
2782 }
2783 else
2784 {
2785 PALLOC ( llgmm_assign_req, LLGMM_ASSIGN_REQ );
2786 llgmm_assign_req->old_tlli = LLGMM_TLLI_INVALID;
2787 llgmm_assign_req->new_tlli = gmm_data->tlli.current;
2788 if (NO_KEY EQ gmm_data->kern.auth_cap.cksn)
2789 {
2790 memset (llgmm_assign_req->llgmm_kc.key, 0x0, MAX_KC);
2791 }
2792 else
2793 {
2794 memcpy ( llgmm_assign_req->llgmm_kc.key, gmm_data->kern.auth_cap.kc, MAX_KC );
2795 }
2796 llgmm_assign_req->ciphering_algorithm = authentication_and_ciphering_request->ciphering_algorithm.type_of_algorithm;
2797
2798 PSEND ( hCommLLC, llgmm_assign_req );
2799
2800 authentication_and_ciphering_response->a_c_reference_number.a_c_reference_number_value = authentication_and_ciphering_request->a_c_reference_number.a_c_reference_number_value;
2801 authentication_and_ciphering_response->v_authentication_parameter_sres = FALSE;
2802 if (IMEISV_REQUESTED EQ authentication_and_ciphering_request->imeisv_request.imeisv_request_value)
2803 {
2804 authentication_and_ciphering_response->v_gmobile_identity = TRUE;
2805 kern_get_imeisv (&authentication_and_ciphering_response->gmobile_identity);
2806 }
2807 else
2808 {
2809 authentication_and_ciphering_response->v_gmobile_identity = FALSE;
2810 }
2811 sig_kern_tx_data_req (CURRENT_TLLI,AUTHENTICATION_AND_CIPHERING_RESPONSE);
2812 }
2813
2814 if ( NO_CIPHERING EQ gmm_data->kern.auth_cap.ciphering_algorithm
2815 || gmm_data->config.cipher_on EQ FALSE )
2816 {
2817 TRACE_EVENT ("ciphering OFF");
2818 gmm_data->cipher = FALSE;
2819 kern_gmmreg_ciphering_ind (CIPH_OFF);
2820 }
2821 else
2822 {
2823 TRACE_EVENT ("ciphering ON");
2824 gmm_data->cipher = TRUE;
2825 kern_gmmreg_ciphering_ind (CIPH_ON);
2826 }
2827 sig_kern_rdy_force_ie_req (authentication_and_ciphering_request
2828 ->force_to_standby.force_to_standby_value, FALSE);
2829 break;
2830 }
2831 default:
2832 TRACE_ERROR("Unexpected A&C");
2833 TRACE_1_INFO ("state: %x", GET_STATE( KERN ));
2834 break;
2835 }
2836 } /* sig_rx_kern_auth_req_ind () */
2837
2838 /*
2839 +------------------------------------------------------------------------------
2840 | Function : sig_rx_kern_auth_rej_ind
2841 +------------------------------------------------------------------------------
2842 | Description : Handles the internal signal SIG_RX_KERN_CIPH_REQ_IND
2843 |
2844 | Parameters : void
2845 |
2846 +------------------------------------------------------------------------------
2847 */
2848 GLOBAL void sig_rx_kern_auth_rej_ind ( )
2849 {
2850 TRACE_ISIG( "sig_rx_kern_auth_rej_ind" );
2851
2852
2853 gmm_data->sim_gprs_invalid = TRUE;
2854 kern_sim_del_locigprs ();
2855 gmm_data->gu = GU3_ROAMING_NOT_ALLOWED;
2856 /*
2857 * <R.GMM.AUTHREJECT.M.005>
2858 */
2859 kern_sim_gmm_update ();
2860 kern_mm_auth_rej ();
2861
2862 gmm_data->kern.detach_cap.detach_type = GMMREG_DT_SIM_REMOVED;
2863 kern_local_detach ( GMMCS_AUTHENTICATION_REJECTED, /* TCS 2.1 */
2864 FALSE, GMM_LOCAL_DETACH_PROC_AUTH_FAILED);
2865
2866 } /* sig_rx_kern_auth_rej_ind () */
2867
2868 /*
2869 +------------------------------------------------------------------------------
2870 | Function : sig_rx_kern_id_req_ind
2871 +------------------------------------------------------------------------------
2872 | Description : Handles the internal signal SIG_RX_KERN_ID_REQ_IND
2873 |
2874 | Parameters : void
2875 |
2876 +------------------------------------------------------------------------------
2877 */
2878 GLOBAL void sig_rx_kern_id_req_ind ( )
2879 {
2880 TRACE_ISIG( "sig_rx_kern_id_req_ind" );
2881
2882 switch( GET_STATE( KERN ) )
2883 {
2884 case KERN_GMM_DEREG_LIMITED_SERVICE:
2885 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
2886 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
2887 case KERN_GMM_DEREG_PLMN_SEARCH:
2888 break;
2889
2890 case KERN_GMM_REG_INITIATED:
2891 /*
2892 * <R.GMM.AGCOMMON.I.001>
2893 * The network may initiate GMM common procedures, e.g. the GMM identification
2894 * and GMM authentication and ciphering procedure, depending on the received
2895 * information such as IMSI, CKSN, old RAI, P-TMSI and P-TMSI signature.
2896 */
2897
2898 case KERN_GMM_DEREG_INITIATED:
2899 /*************************************************************************
2900 * MSC: 3.9 GPRS detach procedure
2901 *
2902 * MSC: 3.9.3 Abnormal cases
2903 * MSC: 3.9.3.4 d) Detach and common procedure collision
2904 * MSC: 3.9.3.4.3 Receipt of remaining common procedures
2905 *************************************************************************/
2906 case KERN_GMM_REG_NORMAL_SERVICE:
2907 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
2908 case KERN_GMM_REG_NO_CELL_AVAILABLE:
2909 case KERN_GMM_REG_LIMITED_SERVICE:
2910 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
2911 case KERN_GMM_RAU_INITIATED:
2912 {
2913 MCAST (identity_request, IDENTITY_REQUEST);
2914 T_gmobile_identity mobile_identity;
2915 sig_kern_rdy_force_ie_req (
2916 identity_request->force_to_standby.force_to_standby_value,FALSE);
2917
2918 kern_get_mobile_identity (
2919 identity_request->identity_type_2.type_of_identity_2,&mobile_identity);
2920 {
2921 MCAST (identity_response, IDENTITY_RESPONSE);
2922 identity_response->gmobile_identity = mobile_identity;
2923 sig_kern_tx_data_req (CURRENT_TLLI,IDENTITY_RESPONSE);
2924 }
2925 break;
2926 }
2927 default:
2928 break;
2929 }
2930 } /* sig_rx_kern_id_req_ind () */
2931
2932 /*
2933 +------------------------------------------------------------------------------
2934 | Function : sig_rx_kern_status_ind
2935 +------------------------------------------------------------------------------
2936 | Description : Handles the internal signal SIG_RX_KERN_STATUS_IND
2937 |
2938 | Parameters : void
2939 |
2940 +------------------------------------------------------------------------------
2941 */
2942 GLOBAL void sig_rx_kern_status_ind ( )
2943 {
2944 TRACE_ISIG( "sig_rx_kern_status_ind" );
2945
2946 switch( GET_STATE( KERN ) )
2947 {
2948 case KERN_GMM_DEREG_INITIATED:
2949 /*************************************************************************************
2950 * MSC: 3.9 GPRS detach procedure
2951 *
2952 * MSC: 3.9.3 Abnormal cases
2953 * MSC: 3.9.3.4 d) Detach and common procedure collision
2954 * MSC: 3.9.3.4.3 Receipt of remaining common procedures
2955 *************************************************************************************/
2956 break;
2957 default:
2958 break;
2959 }
2960 } /* sig_rx_kern_status_ind () */
2961
2962 /*
2963 +------------------------------------------------------------------------------
2964 | Function : sig_rx_kern_info_ind
2965 +------------------------------------------------------------------------------
2966 | Description : Handles the internal signal SIG_RX_KERN_INFO_IND
2967 |
2968 | Parameters : void
2969 |
2970 +------------------------------------------------------------------------------
2971 */
2972 GLOBAL void sig_rx_kern_info_ind ( )
2973 {
2974 TRACE_ISIG( "sig_rx_kern_info_ind" );
2975
2976 switch( GET_STATE( KERN ) )
2977 {
2978 case KERN_GMM_DEREG_INITIATED:
2979 /*************************************************************************
2980 * MSC: 3.9 GPRS detach procedure
2981 *
2982 * MSC: 3.9.3 Abnormal cases
2983 * MSC: 3.9.3.4 d) Detach and common procedure collision
2984 * MSC: 3.9.3.4.3 Receipt of remaining common procedures
2985 *************************************************************************/
2986 break;
2987 case KERN_GMM_DEREG_LIMITED_SERVICE:
2988 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
2989 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
2990 case KERN_GMM_DEREG_PLMN_SEARCH:
2991 case KERN_GMM_REG_INITIATED:
2992 break;
2993 case KERN_GMM_REG_NORMAL_SERVICE:
2994 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
2995 case KERN_GMM_REG_NO_CELL_AVAILABLE:
2996 case KERN_GMM_REG_LIMITED_SERVICE:
2997 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
2998 case KERN_GMM_RAU_INITIATED:
2999 {
3000 kern_gmmreg_info_ind ();
3001 break;
3002 }
3003 default:
3004 break;
3005 }
3006 } /* sig_rx_kern_info_ind () */
3007
3008 /*
3009 +------------------------------------------------------------------------------
3010 | Function : sig_rx_kern_tst_cmd_ind
3011 +------------------------------------------------------------------------------
3012 | Description : Handles the internal signal SIG_RX_KERN_TST_CMD_IND
3013 |
3014 | Parameters : void
3015 |
3016 +------------------------------------------------------------------------------
3017 */
3018 GLOBAL void sig_rx_kern_tst_cmd_ind ( )
3019 {
3020 TRACE_ISIG( "sig_rx_kern_tst_cmd_ind" );
3021
3022 switch( GET_STATE( KERN ) )
3023 {
3024 case KERN_GMM_REG_NORMAL_SERVICE:
3025 if (OP_NORMAL_SIM NEQ gmm_data->kern.sim_op_mode)
3026 /* Do not try to test if it is OP_NORMAL_SIM, wich has the value 1
3027 * SIM supports only comparism for test sims in that way: >=0x80
3028 */
3029 {
3030 MCAST(gprs_test_mode_cmd, GPRS_TEST_MODE_CMD);
3031
3032 PALLOC (cgrlc_test_mode_req, CGRLC_TEST_MODE_REQ); /* TCS 2.1 */
3033 #ifdef GMM_TCS4
3034 /* cgrlc_test_mode_req->v_no_of_pdus = TRUE;*/
3035 #endif
3036 cgrlc_test_mode_req->no_of_pdus /* TCS 2.1 */
3037 = gprs_test_mode_cmd->pdu_description_ie.pdu_description.no_of_pdus;
3038 cgrlc_test_mode_req->dl_timeslot_offset /* TCS 2.1 */
3039 = gprs_test_mode_cmd->mode_flag.dl_timeslot_offset;
3040 cgrlc_test_mode_req->test_mode_flag /* TCS 2.1 */
3041 = gprs_test_mode_cmd->mode_flag.mode_flag_val;
3042 #ifdef GMM_TCS4
3043 #ifdef FF_EGPRS
3044 cgrlc_test_mode_req->v_ul_gmsk_modulation = FALSE;
3045 #endif /*FF_EGPRS*/
3046 #endif /*GMM_TCS4*/
3047 PSEND (hCommGRLC, cgrlc_test_mode_req); /* TCS 2.1 */
3048 SET_STATE (KERN, KERN_GMM_REG_TEST_MODE);
3049 #ifdef FF_EM_MODE
3050 EM_GMM_SET_STATE(KERN_GMM_REG_TEST_MODE);
3051 #endif
3052 }
3053 else
3054 {
3055 TRACE_ERROR ("GPRS TEST MODE CMD receives, but no TEST SIM is inserted");
3056 }
3057 break;
3058 default:
3059 sig_kern_rx_gmm_status ( ERRCS_TYPE_INCOMPATIBLE);
3060 TRACE_ERROR ("GPRS TEST MODE CMD receives in wrong GMM state");
3061 break;
3062 }
3063 } /* sig_rx_kern_status_ind () */
3064
3065 #ifdef GMM_TCS4
3066 #ifdef FF_EGPRS
3067 /*
3068 +------------------------------------------------------------------------------
3069 | Function : sig_rx_kern_egprs_loopb_cmd_ind
3070 +------------------------------------------------------------------------------
3071 | Description : Handles the internal signal SIG_RX_KERN_EGPRS_LOOPB_CMD_IND
3072 |
3073 | Parameters : void
3074 |
3075 +------------------------------------------------------------------------------
3076 */
3077 GLOBAL void sig_rx_kern_egprs_loopb_cmd_ind ( )
3078 {
3079 TRACE_ISIG( "sig_rx_kern_egprs_loopb_cmd_ind" );
3080
3081 switch( GET_STATE( KERN ) )
3082 {
3083 case KERN_GMM_REG_NORMAL_SERVICE:
3084 if (OP_NORMAL_SIM NEQ gmm_data->kern.sim_op_mode)
3085 /* Do not try to test if it is OP_NORMAL_SIM, wich has the value 1
3086 * SIM supports only comparism for test sims in that way: >=0x80
3087 */
3088 {
3089 MCAST(egprs_start_radio_block_loopback_cmd, EGPRS_START_RADIO_BLOCK_LOOPBACK_CMD);
3090
3091 PALLOC (cgrlc_test_mode_req, CGRLC_TEST_MODE_REQ);
3092 cgrlc_test_mode_req->dl_timeslot_offset
3093 = egprs_start_radio_block_loopback_cmd->mode_flag.dl_timeslot_offset;
3094 cgrlc_test_mode_req->v_no_of_pdus = FALSE;
3095 cgrlc_test_mode_req->test_mode_flag = CGRLC_EGPRS_RADIO_LOOP;
3096 cgrlc_test_mode_req->v_ul_gmsk_modulation = TRUE;
3097 cgrlc_test_mode_req->ul_gmsk_modulation
3098 = egprs_start_radio_block_loopback_cmd->mode_flag.mode_flag_val;
3099 PSEND (hCommGRLC, cgrlc_test_mode_req);
3100 SET_STATE (KERN, KERN_GMM_REG_TEST_MODE);
3101 #ifdef FF_EM_MODE
3102 EM_GMM_SET_STATE(KERN_GMM_REG_TEST_MODE);
3103 #endif
3104 }
3105 else
3106 {
3107 TRACE_ERROR ("EGPRS START RADIO BLOCK LOOPBACK CMD received, but no TEST SIM inserted");
3108 }
3109 break;
3110 default:
3111 sig_kern_rx_gmm_status ( ERRCS_TYPE_INCOMPATIBLE);
3112 TRACE_ERROR ("EGPRS START RADIO BLOCK LOOPBACK CMD received in wrong GMM state");
3113 break;
3114 }
3115 } /* sig_rx_kern_egprs_loopb_cmd_ind () */\
3116
3117 #endif /*FF_EGPRS*/
3118 #endif /*GMM_TCS4*/
3119
3120 /*
3121 +------------------------------------------------------------------------------
3122 | Function : sig_sync_kern_mmgmm_nreg_ind
3123 +------------------------------------------------------------------------------
3124 | Description : Handles the primitive MMGMM_NREG_IND
3125 |
3126 | MSC: 3.20.3 IMSI attach/detach
3127 |
3128 | Parameters : *mmgmm_nreg_ind - Ptr to primitive payload
3129 |
3130 +------------------------------------------------------------------------------
3131 */
3132 GLOBAL void sig_sync_kern_mmgmm_nreg_ind ( T_MMGMM_NREG_IND *mmgmm_nreg_ind )
3133 {
3134 GMM_TRACE_FUNCTION( "kern_mmgmm_nreg_ind" );
3135 /*
3136 * Cel ID
3137 */
3138 gmm_data->kern.cell_id.lac = GMMREG_LA_INVALID;
3139
3140 switch (mmgmm_nreg_ind->service) /* TCS 2.1 */
3141 {
3142 case NREG_NO_SERVICE:
3143 TRACE_EVENT ("Para: NO_SERVICE or CELL_SELECTION_FAILED");
3144 break;
3145 case NREG_LIMITED_SERVICE:
3146 TRACE_EVENT ("Para: LIMITED_SERVICE");
3147 break;
3148 default:
3149 break;
3150 }
3151
3152 switch ( GET_STATE (KERN) )
3153 {
3154 case KERN_GMM_NULL_PLMN_SEARCH:
3155 SET_STATE (KERN,KERN_GMM_NULL_IMSI);
3156 #ifdef FF_EM_MODE
3157 EM_GMM_SET_STATE(KERN_GMM_NULL_IMSI);
3158 #endif
3159 if (!(gmm_data->sim_gprs_invalid && mmgmm_nreg_ind->cause EQ MMCS_SIM_REMOVED))
3160 {
3161 kern_indicate_service_loss (GMMREG_DT_COMB,
3162 mmgmm_nreg_ind->service, /* TCS 2.1 */
3163 mmgmm_nreg_ind->search_running,
3164 mmgmm_nreg_ind->cause);
3165 }
3166 break;
3167 case KERN_GMM_DEREG_SUSPENDED:
3168 TRACE_ERROR("unexpected MMGMM_NREG_IND");
3169 if (!(gmm_data->sim_gprs_invalid && mmgmm_nreg_ind->cause EQ MMCS_SIM_REMOVED))
3170 {
3171 kern_indicate_service_loss (GMMREG_DT_COMB,
3172 mmgmm_nreg_ind->service, /* TCS 2.1 */
3173 mmgmm_nreg_ind->search_running,
3174 mmgmm_nreg_ind->cause);
3175 }
3176 kern_call_undone_mm_proc_der();
3177 break;
3178
3179
3180 case KERN_GMM_DEREG_SUSPENDING:
3181 case KERN_GMM_DEREG_RESUMING:
3182
3183 case KERN_GMM_NULL_IMSI_LIMITED_SERVICE_REQ:
3184 case KERN_GMM_NULL_NO_IMSI_LIMITED_SERVICE_REQ:
3185
3186 case KERN_GMM_NULL_IMSI:
3187 case KERN_GMM_NULL_NO_IMSI:
3188 case KERN_GMM_DEREG_NO_IMSI:
3189 case KERN_GMM_DEREG_LIMITED_SERVICE:
3190 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
3191 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
3192 case KERN_GMM_DEREG_PLMN_SEARCH:
3193 case KERN_GMM_REG_INITIATED:
3194 if (!(gmm_data->sim_gprs_invalid && mmgmm_nreg_ind->cause EQ MMCS_SIM_REMOVED))
3195 {
3196 kern_indicate_service_loss (GMMREG_DT_COMB,
3197 mmgmm_nreg_ind->service, /* TCS 2.1 */
3198 mmgmm_nreg_ind->search_running,
3199 mmgmm_nreg_ind->cause);
3200 }
3201 break;
3202 case KERN_GMM_REG_SUSPENDED:
3203 TRACE_ERROR("unexpected MMGMM_NREG_IND");
3204 if (!(gmm_data->sim_gprs_invalid && mmgmm_nreg_ind->cause EQ MMCS_SIM_REMOVED))
3205 {
3206 kern_indicate_service_loss (GMMREG_DT_COMB,
3207 mmgmm_nreg_ind->service, /* TCS 2.1 */
3208 mmgmm_nreg_ind->search_running,
3209 mmgmm_nreg_ind->cause);
3210 }
3211 kern_call_undone_mm_proc_der();
3212 break;
3213 case KERN_GMM_REG_SUSPENDING:
3214 case KERN_GMM_REG_RESUMING:
3215 case KERN_GMM_REG_NORMAL_SERVICE:
3216 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
3217 case KERN_GMM_REG_NO_CELL_AVAILABLE:
3218 case KERN_GMM_REG_LIMITED_SERVICE:
3219 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
3220 case KERN_GMM_DEREG_INITIATED:
3221 case KERN_GMM_RAU_INITIATED:
3222 if (!(gmm_data->sim_gprs_invalid && mmgmm_nreg_ind->cause EQ MMCS_SIM_REMOVED))
3223 {
3224 kern_indicate_service_loss (GMMREG_DT_IMSI,
3225 mmgmm_nreg_ind->service, /* TCS 2.1 */
3226 mmgmm_nreg_ind->search_running,
3227 mmgmm_nreg_ind->cause);
3228 }
3229 break;
3230 default:
3231 TRACE_ERROR( "MMGMM_NREG_IND unexpected" );
3232 break;
3233 }
3234 PFREE ( mmgmm_nreg_ind );
3235
3236 GMM_RETURN;
3237 } /* sig_sync_mmgmm_nreg_ind() */
3238
3239 /*
3240 +------------------------------------------------------------------------------
3241 | Function : sig_sync_mmgmm_reg_rej
3242 +------------------------------------------------------------------------------
3243 | Description : Handles the primitive MMGMM_REG_REJ
3244 |
3245 | MSC: 3.20.3 IMSI attach/detach
3246 |
3247 | Parameters : *mmgmm_reg_rej - Ptr to primitive payload
3248 |
3249 +------------------------------------------------------------------------------
3250 */
3251 GLOBAL void sig_sync_kern_mmgmm_reg_rej ( T_MMGMM_REG_REJ *mmgmm_reg_rej )
3252 {
3253 GMM_TRACE_FUNCTION( "sig_sync_mmgmm_reg_rej" );
3254
3255 if(mmgmm_reg_rej->cause EQ MMCS_PLMN_NOT_ALLOWED)
3256 {
3257 memcpy (gmm_data->kern.attach_cap.list_of_forbidden_plmns_for_gprs_service[0].mcc,
3258 mmgmm_reg_rej->new_forb_plmn.mcc, SIZE_MCC);
3259 memcpy (gmm_data->kern.attach_cap.list_of_forbidden_plmns_for_gprs_service[0].mnc,
3260 mmgmm_reg_rej->new_forb_plmn.mnc, SIZE_MNC);
3261 }
3262
3263 switch (mmgmm_reg_rej->service) /* TCS 2.1 */
3264 {
3265 case NREG_NO_SERVICE:
3266 TRACE_EVENT ("Para: NO_SERVICE or CELL_SELECTION_FAILED");
3267 /* todo state missing */
3268 gmm_data->kern.sig_cell_info.mm_status = MMGMM_LIMITED_SERVICE;
3269 break;
3270 case NREG_LIMITED_SERVICE:
3271 /*
3272 * TC 44.2.1.1.4.3.1
3273 * to remember that LA is changed if mmgmm_acivate_in comes after cell_ind
3274 * other way arround mmgmm_acivate_ind containspaameter update_needed
3275 */
3276 gmm_data->kern.sig_cell_info.mm_status = MMGMM_LIMITED_SERVICE;
3277 TRACE_EVENT ("Para: LIMITED_SERVICE");
3278 break;
3279 default:
3280 break;
3281 }
3282
3283
3284 switch ( GET_STATE (KERN) )
3285 {
3286 case KERN_GMM_DEREG_NO_IMSI:
3287
3288 SET_STATE (KERN, KERN_GMM_NULL_NO_IMSI);
3289 #ifdef FF_EM_MODE
3290 EM_GMM_SET_STATE(KERN_GMM_NULL_NO_IMSI);
3291 #endif
3292 kern_indicate_service_loss (GMMREG_DT_COMB,
3293 mmgmm_reg_rej->service, /* TCS 2.1 */
3294 mmgmm_reg_rej->search_running,
3295 mmgmm_reg_rej->cause);
3296 kern_mm_activate_mm();
3297 break;
3298
3299 case KERN_GMM_NULL_PLMN_SEARCH:
3300 SET_STATE (KERN,KERN_GMM_NULL_IMSI);
3301 #ifdef FF_EM_MODE
3302 EM_GMM_SET_STATE(KERN_GMM_NULL_IMSI);
3303 #endif
3304 kern_indicate_service_loss (GMMREG_DT_COMB,
3305 mmgmm_reg_rej->service, /* TCS 2.1 */
3306 mmgmm_reg_rej->search_running,
3307 mmgmm_reg_rej->cause);
3308
3309 break;
3310
3311 case KERN_GMM_DEREG_SUSPENDED:
3312 kern_indicate_service_loss (GMMREG_DT_COMB,
3313 mmgmm_reg_rej->service, /* TCS 2.1 */
3314 mmgmm_reg_rej->search_running,
3315 mmgmm_reg_rej->cause);
3316 kern_call_undone_mm_proc_der ();
3317 break;
3318 case KERN_GMM_DEREG_SUSPENDING:
3319
3320 case KERN_GMM_NULL_IMSI_LIMITED_SERVICE_REQ:
3321 case KERN_GMM_NULL_NO_IMSI_LIMITED_SERVICE_REQ:
3322
3323 case KERN_GMM_NULL_IMSI:
3324 case KERN_GMM_NULL_NO_IMSI:
3325 case KERN_GMM_DEREG_LIMITED_SERVICE:
3326 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
3327 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
3328 case KERN_GMM_DEREG_PLMN_SEARCH:
3329 case KERN_GMM_REG_INITIATED:
3330 kern_indicate_service_loss (GMMREG_DT_COMB,
3331 mmgmm_reg_rej->service, /* TCS 2.1 */
3332 mmgmm_reg_rej->search_running,
3333 mmgmm_reg_rej->cause);
3334 break;
3335
3336 case KERN_GMM_REG_SUSPENDED:
3337 /* Label RESUME_GRR_REG */
3338 if (MMGMM_RESUMPTION_OK NEQ mmgmm_reg_rej->resumption)
3339 {
3340 TRACE_EVENT("Para: resumption failure: RAU needed");
3341 SET_STATE(GU,GU_UPDATE_NEEDED);
3342 }
3343 else
3344 {
3345 TRACE_EVENT("OPar: resumption OK.");
3346 }
3347
3348 kern_indicate_service_loss (GMMREG_DT_IMSI,
3349 mmgmm_reg_rej->service, /* TCS 2.1 */
3350 mmgmm_reg_rej->search_running,
3351 mmgmm_reg_rej->cause);
3352 kern_call_undone_mm_proc_reg ();
3353 break;
3354
3355 case KERN_GMM_REG_SUSPENDING:
3356
3357 case KERN_GMM_REG_NORMAL_SERVICE:
3358 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
3359 case KERN_GMM_REG_NO_CELL_AVAILABLE:
3360 case KERN_GMM_REG_LIMITED_SERVICE:
3361 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
3362 case KERN_GMM_DEREG_INITIATED:
3363 case KERN_GMM_RAU_INITIATED:
3364 kern_indicate_service_loss (GMMREG_DT_IMSI,
3365 mmgmm_reg_rej->service, /* TCS 2.1 */
3366 mmgmm_reg_rej->search_running,
3367 mmgmm_reg_rej->cause);
3368 break;
3369 default:
3370 TRACE_ERROR( "MMGMM_REG_REJ unexpected" );
3371 break;
3372 }
3373 PFREE ( mmgmm_reg_rej );
3374
3375 GMM_RETURN;
3376 }/*sig_sync_kern_mmgmm_reg_rej */
3377
3378
3379 /*
3380 +------------------------------------------------------------------------------
3381 | Function : sig_sync_kern_mmgmm_reg_cnf
3382 +------------------------------------------------------------------------------
3383 | Description : Handles the primitive MMGMM_REG_CNF
3384 |
3385 | MSC: 3.20.3 IMSI attach/detach
3386 |
3387 | Parameters : *mmgmm_reg_cnf - Ptr to primitive payload
3388 |
3389 +------------------------------------------------------------------------------
3390 */
3391 GLOBAL void sig_sync_kern_mmgmm_reg_cnf ( T_MMGMM_REG_CNF *mmgmm_reg_cnf )
3392 {
3393 GMM_TRACE_FUNCTION( "sig_sync_kern_mmgmm_reg_cnf" );
3394
3395 /*
3396 * Cel ID should be removed
3397 */
3398 gmm_data->kern.cell_id.plmn = mmgmm_reg_cnf->plmn;
3399 gmm_data->kern.cell_id.lac = mmgmm_reg_cnf->lac;
3400 gmm_data->kern.cell_id.cid = mmgmm_reg_cnf->cid;
3401 switch (mmgmm_reg_cnf->gprs_indicator)
3402 {
3403 case MMGMM_GPRS_SUPP_NO:
3404 gmm_data->kern.sig_cell_info.gmm_status = GMMRR_SERVICE_NONE;
3405 break;
3406 default:
3407 if (GMMRR_SERVICE_LIMITED NEQ gmm_data->kern.sig_cell_info.gmm_status)
3408 {
3409 gmm_data->kern.sig_cell_info.gmm_status = GMMRR_SERVICE_FULL;
3410 }
3411 break;
3412 }
3413
3414 if ( gmm_data->kern.attach_cap.mobile_class EQ GMMREG_CLASS_CG )
3415 {
3416 PFREE ( mmgmm_reg_cnf );
3417 TRACE_EVENT ( "reg_cnf ignored because of MS Class CG");
3418 GMM_RETURN;
3419 }
3420
3421 SET_STATE( MM, GMM_MM_REG_NORMAL_SERVICE );
3422
3423 /*
3424 * GMM TC_1710 rau attemept counter less then 5 in periodic lau.
3425 * this situation should not occur
3426 */
3427
3428 if (GU_UPDATE_NEEDED EQ GET_STATE(GU)
3429 && GMMCS_IMSI_UNKNOWN==gmm_data->kern.detach_cap.error_cause)
3430 {
3431 SET_STATE(GU, GU_UPDATE_NOT_NEEDED);
3432 }
3433
3434 switch( GET_STATE( KERN ) )
3435 {
3436 case KERN_GMM_DEREG_SUSPENDED:
3437 /*
3438 * GMM received the mmgmm_reg_cnf primitve because off requesting LAU
3439 * before Normal RAU or ATTACH
3440 */
3441 if (gmm_data->sim_gprs_invalid
3442 ||
3443 (GMMRR_NET_MODE_III==gmm_data->kern.sig_cell_info.net_mode
3444 && GMMREG_CLASS_BC== gmm_data->kern.attach_cap.mobile_class
3445 )
3446 )
3447 {
3448 kern_mmgmmreg_attach_cnf (GMMREG_AT_IMSI,
3449 SEARCH_NOT_RUNNING,mmgmm_reg_cnf);
3450 }
3451 else
3452 {
3453 kern_mmgmmreg_attach_cnf (GMMREG_AT_IMSI,
3454 SEARCH_RUNNING,mmgmm_reg_cnf);
3455 }
3456
3457 kern_call_undone_mm_proc_der ();
3458 break;
3459 case KERN_GMM_REG_SUSPENDED:
3460 /*
3461 * LLC is resumed by assigning the last given TLLI. Unassigning LLC is
3462 * necessary, because LLC is able to transmit signaling data in
3463 * suspended mode, but in GMM_suspended mode its not allowed, or
3464 * possible, to transmit any data!
3465 */
3466 kern_mmgmmreg_attach_cnf (GMMREG_AT_COMB, SEARCH_NOT_RUNNING, mmgmm_reg_cnf);
3467 if (MMGMM_RESUMPTION_OK NEQ mmgmm_reg_cnf->resumption)
3468 {
3469 TRACE_EVENT("Para: resumption failure: RAU needed");
3470 SET_STATE(GU,GU_UPDATE_NEEDED);
3471 }
3472 else
3473 {
3474 TRACE_EVENT("OPar: resumption OK.");
3475 }
3476 kern_call_undone_mm_proc_reg ();
3477 break;
3478 case KERN_GMM_NULL_PLMN_SEARCH:
3479 SET_STATE (KERN,KERN_GMM_NULL_IMSI);
3480 #ifdef FF_EM_MODE
3481 EM_GMM_SET_STATE(KERN_GMM_NULL_IMSI);
3482 #endif
3483 /* NO break */
3484 case KERN_GMM_NULL_IMSI_LIMITED_SERVICE_REQ:
3485 case KERN_GMM_NULL_NO_IMSI_LIMITED_SERVICE_REQ:
3486 case KERN_GMM_NULL_NO_IMSI:
3487
3488 case KERN_GMM_NULL_IMSI:
3489 kern_mmgmmreg_attach_cnf (GMMREG_AT_IMSI, SEARCH_NOT_RUNNING, mmgmm_reg_cnf);
3490 break;
3491 case KERN_GMM_DEREG_NO_IMSI:
3492 SET_STATE (KERN, KERN_GMM_NULL_NO_IMSI);
3493 #ifdef FF_EM_MODE
3494 EM_GMM_SET_STATE(KERN_GMM_NULL_NO_IMSI);
3495 #endif
3496 //kern_mm_activate_mm();
3497
3498 kern_mmgmmreg_attach_cnf (GMMREG_AT_IMSI, SEARCH_NOT_RUNNING, mmgmm_reg_cnf);
3499
3500 break;
3501 case KERN_GMM_DEREG_LIMITED_SERVICE:
3502 case KERN_GMM_DEREG_ATTEMPTING_TO_ATTACH:
3503 case KERN_GMM_DEREG_NO_CELL_AVAILABLE:
3504 case KERN_GMM_DEREG_PLMN_SEARCH:
3505 case KERN_GMM_REG_INITIATED:
3506 kern_mmgmmreg_attach_cnf (GMMREG_AT_IMSI, SEARCH_RUNNING, mmgmm_reg_cnf);
3507 break;
3508 case KERN_GMM_REG_NORMAL_SERVICE:
3509 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE:
3510 case KERN_GMM_REG_NO_CELL_AVAILABLE:
3511 case KERN_GMM_REG_LIMITED_SERVICE:
3512 case KERN_GMM_REG_ATTEMPTING_TO_UPDATE_MM:
3513 case KERN_GMM_DEREG_INITIATED:
3514 case KERN_GMM_RAU_INITIATED:
3515 kern_mmgmmreg_attach_cnf (GMMREG_AT_COMB, SEARCH_NOT_RUNNING, mmgmm_reg_cnf);
3516 break;
3517 default:
3518 TRACE_ERROR ("Unexpexcted state");
3519 break;
3520 }
3521 PFREE ( mmgmm_reg_cnf );
3522 GMM_RETURN;
3523 } /* sig_sync_kern_mmgmm_reg_cnf() */
3524
3525 /*
3526 +------------------------------------------------------------------------------
3527 | Function : sig_rdy_kern_cu_ind
3528 +------------------------------------------------------------------------------
3529 | Description : Handles the signal sig_rdy_kern_cu_ind
3530 |
3531 | Parameters : void
3532 |
3533 +------------------------------------------------------------------------------
3534 */
3535 GLOBAL void sig_rdy_kern_cu_ind ( void )
3536 {
3537 GMM_TRACE_FUNCTION( "sig_rdy_kern_cu_ind" );
3538
3539 switch (GET_STATE(CU))
3540 {
3541 case CU_NOT_REQUESTED:
3542 SET_STATE(CU,CU_REQUESTED);
3543 break;
3544 case CU_CELL_RES_SENT:
3545 SET_STATE(CU,CU_REQUESTED_CELL_RES_SENT);
3546 break;
3547 default:
3548 break;
3549 }
3550 GMM_RETURN;
3551 } /* sig_rdy_kern_cu_ind() */
3552
3553