FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/cmh_gmmr.c @ 775:eedbf248bac0
gsm-fw/g23m-aci subtree: initial import from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 12 Oct 2014 01:45:14 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
774:40a721fd9854 | 775:eedbf248bac0 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : | |
4 | Modul : | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : This module defines the functions which are responsible | |
18 | for the responses of the protocol stack adapter for | |
19 | GPRS mobility management ( GMM ). | |
20 +----------------------------------------------------------------------------- | |
21 */ | |
22 | |
23 #if defined (GPRS) && defined (DTI) | |
24 | |
25 #ifndef CMH_GMMR_C | |
26 #define CMH_GMMR_C | |
27 #endif | |
28 | |
29 #include "aci_all.h" | |
30 /*==== INCLUDES ===================================================*/ | |
31 #include "dti.h" /* functionality of the dti library */ | |
32 #include "aci_cmh.h" | |
33 #include "ati_cmd.h" | |
34 #include "aci_cmd.h" | |
35 | |
36 #include "dti_conn_mng.h" | |
37 | |
38 #include "aci.h" | |
39 #include "gaci.h" | |
40 #include "gaci_cmh.h" | |
41 #include "psa.h" | |
42 #include "psa_mm.h" | |
43 #include "psa_gmm.h" | |
44 #include "psa_sim.h" | |
45 | |
46 #include "cmh.h" | |
47 #include "cmh_mm.h" | |
48 #include "cmh_gmm.h" | |
49 #include "cmh_sim.h" | |
50 | |
51 #if defined (FF_WAP) OR defined (FF_SAT_E) | |
52 #include "wap_aci.h" | |
53 #include "psa_sm.h" | |
54 #endif /* WAP */ | |
55 | |
56 #if defined (SIM_TOOLKIT) AND defined (FF_SAT_E) | |
57 #include "psa_cc.h" | |
58 #include "psa_sat.h" | |
59 #include "cmh_sat.h" | |
60 #endif /* SIM_TOOLKIT AND FF_SAT_E */ | |
61 | |
62 #ifdef FF_GPF_TCPIP | |
63 #include "dcm_utils.h" | |
64 #include "dcm_state.h" | |
65 #include "dcm_env.h" | |
66 #endif | |
67 | |
68 #include "dcm_f.h" | |
69 #include "cmh_sm.h" | |
70 /*==== CONSTANTS ==================================================*/ | |
71 | |
72 | |
73 /*==== TYPES ======================================================*/ | |
74 | |
75 | |
76 /*==== EXPORT =====================================================*/ | |
77 | |
78 /*==== VARIABLES ==================================================*/ | |
79 | |
80 | |
81 /*==== FUNCTIONS ==================================================*/ | |
82 | |
83 /* | |
84 +-------------------------------------------------------------------+ | |
85 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
86 | ROUTINE : cmhGMM_Attached | | |
87 +-------------------------------------------------------------------+ | |
88 | |
89 PURPOSE : ME is attached | |
90 | |
91 */ | |
92 GLOBAL void cmhGMM_Attached ( UBYTE attach_type, T_plmn *plmn, UBYTE search_running ) | |
93 { | |
94 T_CGEREP_EVENT_REP_PARAM event; | |
95 SHORT i; | |
96 | |
97 TRACE_FUNCTION ("cmhGMM_Attached()"); | |
98 | |
99 /* | |
100 * set GPRS attach state | |
101 */ | |
102 gmmShrdPrm.current_attach_type = attach_type; | |
103 | |
104 switch ( attach_type ) | |
105 { | |
106 case GMMREG_AT_GPRS: | |
107 case GMMREG_AT_COMB: | |
108 cmhGMM_Set_state(AS_ATTACHED); | |
109 break; | |
110 case GMMREG_AT_IMSI: | |
111 cmhGMM_Set_state(AS_DETACHED); | |
112 break; | |
113 } | |
114 | |
115 if (search_running EQ GMMREG_SEARCH_NOT_RUNNING) | |
116 { | |
117 gmmShrdPrm.mobile_class = gmmShrdPrm.requested_mobile_class; | |
118 gaciMobileClass.current = gaciMobileClass.requested; | |
119 | |
120 if(AT_CMD_CGCLASS EQ gmmEntStat.curCmd) | |
121 { | |
122 /* | |
123 * brz: 22.10.02 | |
124 * special behaviour for NMO III | |
125 * | |
126 * In the case of NMO III a COMB reject can not be succesful. | |
127 * | |
128 * case BG requested: attach type GPRS is also OK | |
129 * case BC requested: attach type IMSI is also OK | |
130 */ | |
131 if( GMMREG_CLASS_BG EQ gmmShrdPrm.mobile_class AND GMMREG_AT_GPRS EQ attach_type OR | |
132 GMMREG_CLASS_BC EQ gmmShrdPrm.mobile_class AND GMMREG_AT_IMSI EQ attach_type ) | |
133 { | |
134 /* | |
135 * GPRS event reporting> | |
136 */ | |
137 event.mobile_class = (T_CGCLASS_CLASS)gmmShrdPrm.mobile_class; | |
138 for( i = 0 ; i < CMD_SRC_MAX; i++ ) | |
139 { | |
140 R_AT( RAT_CGEREP, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_CLASS, &event ); | |
141 R_AT( RAT_P_CGEV, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_CLASS, &event ); | |
142 } | |
143 R_AT( RAT_OK, gmmEntStat.entOwn ) ( gmmEntStat.curCmd ); | |
144 | |
145 /* log result */ | |
146 cmh_logRslt ( gmmEntStat.entOwn, RAT_OK, gmmEntStat.curCmd, | |
147 -1, BS_SPEED_NotPresent,CME_ERR_NotPresent ); | |
148 | |
149 gmmEntStat.curCmd = AT_CMD_NONE; | |
150 return; | |
151 } | |
152 } | |
153 } | |
154 | |
155 if ( attach_type EQ GMMREG_AT_IMSI AND | |
156 gmmShrdPrm.requested_mobile_class NEQ GMMREG_CLASS_CC) | |
157 { | |
158 /* | |
159 * brz: 03.05.02 | |
160 * patch for wrong behaviour of GMM: sending attach_cnf->IMSI instead of attach_rej->GPRS | |
161 */ | |
162 if (search_running EQ GMMREG_SEARCH_NOT_RUNNING) | |
163 { | |
164 cmhGMM_NoAttach(GMMREG_DT_GPRS ,GMMCS_NO_SERVICE , GMMREG_SEARCH_NOT_RUNNING); | |
165 } | |
166 | |
167 return; | |
168 } | |
169 else /* end of +CGATT or +CGCLASS */ | |
170 { | |
171 /* | |
172 * Inform CMH SM about new attach state. | |
173 */ | |
174 | |
175 cmhSM_GprsAttached( GPRS_ATTACH ); | |
176 | |
177 | |
178 switch ( gmmEntStat.curCmd ) | |
179 { | |
180 case AT_CMD_CGCLASS: | |
181 /* | |
182 * GPRS event reporting | |
183 */ | |
184 event.mobile_class = (T_CGCLASS_CLASS)gmmShrdPrm.requested_mobile_class; | |
185 for( i = 0 ; i < CMD_SRC_MAX; i++ ) | |
186 { | |
187 R_AT( RAT_CGEREP, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_CLASS, &event ); | |
188 R_AT( RAT_P_CGEV, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_CLASS, &event ); | |
189 } | |
190 /*lint -fallthrough */ | |
191 case AT_CMD_CGATT: | |
192 R_AT( RAT_OK, gmmEntStat.entOwn ) ( gmmEntStat.curCmd ); | |
193 | |
194 /* log result */ | |
195 cmh_logRslt ( gmmEntStat.entOwn, RAT_OK, gmmEntStat.curCmd, -1, | |
196 BS_SPEED_NotPresent,CME_ERR_NotPresent ); | |
197 | |
198 #ifdef FF_GPF_TCPIP | |
199 if(is_gpf_tcpip_call()) | |
200 { | |
201 T_DCM_STATUS_IND_MSG msg; | |
202 msg.hdr.msg_id = DCM_NEXT_CMD_READY_MSG; | |
203 dcm_send_message(msg, DCM_SUB_WAIT_CGATT_CNF); | |
204 } | |
205 #endif /* FF_GPF_TCPIP */ | |
206 break; | |
207 } | |
208 | |
209 gmmEntStat.curCmd = AT_CMD_NONE; | |
210 } | |
211 } | |
212 | |
213 | |
214 /* | |
215 +-------------------------------------------------------------------+ | |
216 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
217 | ROUTINE : cmhGMM_NoAttach | | |
218 +-------------------------------------------------------------------+ | |
219 | |
220 PURPOSE : the attach fail | |
221 | |
222 */ | |
223 GLOBAL void cmhGMM_NoAttach ( UBYTE detach_type, USHORT cause, UBYTE search_running ) | |
224 { | |
225 T_ACI_CME_ERR cme_err; /* error number */ | |
226 | |
227 TRACE_FUNCTION ("cmhGMM_NoAttach()"); | |
228 | |
229 /* | |
230 * map error cause | |
231 */ | |
232 switch(cause) | |
233 { | |
234 case GMMCS_ILLEGAL_MS: | |
235 case MMCS_ILLEGAL_MS: | |
236 cme_err = CME_ERR_GPRSBadMs; | |
237 break; | |
238 case GMMCS_ILLEGAL_ME: | |
239 case MMCS_ILLEGAL_ME: | |
240 cme_err = CME_ERR_GPRSBadMe; | |
241 break; | |
242 case GMMCS_GPRS_NOT_ALLOWED: | |
243 /* No corrosponding MM cause */ | |
244 cme_err = CME_ERR_GPRSNoService; | |
245 break; | |
246 case GMMCS_PLMN_NOT_ALLOWED: | |
247 case MMCS_PLMN_NOT_ALLOWED: | |
248 cme_err = CME_ERR_GPRSBadPlmn; | |
249 break; | |
250 case GMMCS_LA_NOT_ALLOWED: | |
251 case MMCS_LA_NOT_ALLOWED: | |
252 cme_err = CME_ERR_GPRSBadLoc; | |
253 break; | |
254 case GMMCS_ROAMING_NOT_ALLOWED: | |
255 case MMCS_ROAMING_NOT_ALLOWED: | |
256 cme_err = CME_ERR_GPRSNoRoam; | |
257 break; | |
258 case GMMCS_IMPLICIT_DETACHED: | |
259 /* No corrosponding MM cause */ | |
260 cme_err = CME_ERR_GPRSUnspec; | |
261 break; | |
262 case GMMCS_IMSI_UNKNOWN: | |
263 case MMCS_IMSI_IN_HLR: | |
264 case MMCS_IMEI_NOT_ACCEPTED: | |
265 /* No corrosponding GMM cause */ | |
266 case GMMCS_NO_MS_ID: | |
267 /* No corrosponding MM cause */ | |
268 cme_err = CME_ERR_SimFail; | |
269 break; | |
270 case GMMCS_GSM_GPRS_NOT_ALLOWED: | |
271 /* No corrosponding MM cause */ | |
272 case GMMCS_NET_FAIL: | |
273 case MMCS_NETWORK_FAILURE: | |
274 case GMMCS_MSC_TEMP_NOT_REACHABLE: | |
275 /* No corrosponding MM cause */ | |
276 case GMMCS_CONGESTION: | |
277 case MMCS_CONGESTION: | |
278 cme_err = CME_ERR_NoServ; | |
279 break; | |
280 /* case GMMCS_CELL_SELECTION_FAILED: */ | |
281 /* No corrosponding MM cause */ | |
282 /* case GMMCS_NO_SERVICE: */ | |
283 /* No corrosponding MM cause */ | |
284 /* case GMMCS_LIMITED_SERVICE: */ | |
285 /* No corrosponding MM cause */ | |
286 /* case GMMCS_SEMANTIC_INCORRECT: | |
287 case MMCS_INCORRECT_MESSAGE: | |
288 case GMMCS_INVALID_M_INFO: | |
289 case MMCS_INVALID_MAND_MESSAGE: | |
290 case GMMCS_TYPE_INVALID: | |
291 case MMCS_MESSAGE_TYPE_NOT_IMPLEM: | |
292 case GMMCS_TYPE_INCOMPATIBLE: | |
293 case MMCS_MESSAGE_TYPE_INCOMPAT: | |
294 case GMMCS_IE_INVALID: | |
295 case MMCS_IE_NOT_IMPLEM: | |
296 case GMMCS_COND_IE_ERROR: | |
297 case MMCS_CONDITIONAL_IE: | |
298 case GMMCS_MESSAGE_INVALID: | |
299 case MMCS_MESSAGE_INCOMPAT: | |
300 case GMMCS_INT_PROTOCOL_ERROR: */ | |
301 /* No corrosponding MM cause */ | |
302 default: | |
303 cme_err = CME_ERR_Unknown; | |
304 } | |
305 | |
306 if ( search_running EQ GMMREG_SEARCH_NOT_RUNNING ) | |
307 { | |
308 /* | |
309 * Inform CMH SM about new attach state | |
310 */ | |
311 cmhSM_GprsAttached( GPRS_DETACH ); | |
312 | |
313 switch ( gmmEntStat.curCmd ) | |
314 { | |
315 case AT_CMD_CGCLASS: | |
316 case AT_CMD_CGATT: | |
317 R_AT( RAT_CME, gmmEntStat.entOwn ) ( gmmEntStat.curCmd, cme_err ); | |
318 | |
319 /* log result */ | |
320 cmh_logRslt ( gmmEntStat.entOwn, RAT_CME, gmmEntStat.curCmd, -1, | |
321 BS_SPEED_NotPresent, cme_err ); | |
322 break; | |
323 } | |
324 | |
325 gmmEntStat.curCmd = AT_CMD_NONE; | |
326 } | |
327 | |
328 /* | |
329 * set GPRS attach state | |
330 */ | |
331 switch ( detach_type ) | |
332 { | |
333 case GMMREG_DT_LIMITED_SERVICE: | |
334 case GMMREG_DT_SIM_REMOVED: | |
335 cmhGMM_Set_state(AS_DETACHED); | |
336 break; | |
337 case GMMREG_DT_DISABLE_GPRS: | |
338 cmhGMM_Set_state(AS_SUSPENTED); | |
339 break; | |
340 case GMMREG_DT_POWER_OFF: | |
341 break; | |
342 case GMMREG_DT_GPRS: | |
343 case GMMREG_DT_COMB: | |
344 cmhGMM_Set_state(AS_DETACHED); | |
345 break; | |
346 case GMMREG_DT_IMSI: | |
347 break; | |
348 } | |
349 | |
350 switch ( detach_type ) | |
351 { | |
352 case GMMREG_DT_GPRS: | |
353 gmmShrdPrm.current_attach_type = GMMREG_AT_IMSI; | |
354 break; | |
355 case GMMREG_DT_IMSI: | |
356 gmmShrdPrm.current_attach_type = GMMREG_AT_GPRS; | |
357 break; | |
358 case GMMREG_DT_COMB: | |
359 case GMMREG_DT_POWER_OFF: | |
360 case GMMREG_DT_LIMITED_SERVICE: | |
361 case GMMREG_DT_SIM_REMOVED: | |
362 gmmShrdPrm.current_attach_type = ATTACH_TYPE_DETACHED; | |
363 break; | |
364 } | |
365 } | |
366 | |
367 /* | |
368 +-------------------------------------------------------------------+ | |
369 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
370 | ROUTINE : cmhGMM_Detached | | |
371 +-------------------------------------------------------------------+ | |
372 | |
373 PURPOSE : ME is detached | |
374 | |
375 */ | |
376 GLOBAL void cmhGMM_Detached ( UBYTE detach_type ) | |
377 { | |
378 SHORT i; | |
379 | |
380 TRACE_FUNCTION ("cmhGMM_Detached()"); | |
381 | |
382 /* | |
383 *------------------------------------------------------------------- | |
384 * check for command context | |
385 *------------------------------------------------------------------- | |
386 */ | |
387 switch ( detach_type ) | |
388 { | |
389 case GMMREG_DT_GPRS: | |
390 case GMMREG_DT_COMB: | |
391 for( i = 0 ; i < CMD_SRC_MAX; i++ ) | |
392 { | |
393 R_AT( RAT_CGEREP, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_DETACH, NULL ); | |
394 R_AT( RAT_P_CGEV, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_DETACH, NULL ); | |
395 } | |
396 | |
397 cmhGMM_Set_state(AS_DETACHED); | |
398 break; | |
399 case GMMREG_DT_POWER_OFF: | |
400 for( i = 0 ; i < CMD_SRC_MAX; i++ ) | |
401 { | |
402 R_AT( RAT_CGEREP, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_DETACH, NULL ); | |
403 R_AT( RAT_P_CGEV, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_ME_DETACH, NULL ); | |
404 } | |
405 | |
406 cmhGMM_Set_state(AS_MOBILE_OFF); | |
407 break; | |
408 case GMMREG_DT_LIMITED_SERVICE: | |
409 cmhGMM_Set_state(AS_DETACHED); | |
410 break; | |
411 case GMMREG_DT_SIM_REMOVED: | |
412 cmhGMM_Set_state(AS_DETACHED); | |
413 break; | |
414 case GMMREG_DT_IMSI: | |
415 cmhGMM_Set_state(AS_ATTACHED); | |
416 break; | |
417 case GMMREG_DT_DISABLE_GPRS: | |
418 cmhGMM_Set_state(AS_SUSPENTED); | |
419 break; | |
420 default: | |
421 break; | |
422 } | |
423 | |
424 switch ( detach_type ) | |
425 { | |
426 case GMMREG_DT_IMSI: | |
427 gmmShrdPrm.current_attach_type = GMMREG_AT_GPRS; | |
428 break; | |
429 case GMMREG_DT_GPRS: | |
430 gmmShrdPrm.current_attach_type = GMMREG_AT_IMSI; | |
431 break; | |
432 case GMMREG_DT_COMB: | |
433 case GMMREG_DT_LIMITED_SERVICE: | |
434 case GMMREG_DT_SIM_REMOVED: | |
435 case GMMREG_DT_POWER_OFF: | |
436 gmmShrdPrm.current_attach_type = ATTACH_TYPE_DETACHED; | |
437 break; | |
438 } | |
439 | |
440 /* | |
441 * Inform CMH SM about new attach state | |
442 */ | |
443 cmhSM_GprsAttached( GPRS_DETACH ); | |
444 | |
445 | |
446 switch( gmmEntStat.curCmd ) | |
447 { | |
448 case( AT_CMD_CGCLASS ): | |
449 case( AT_CMD_CGATT ): | |
450 | |
451 R_AT( RAT_OK, gmmEntStat.entOwn ) ( gmmEntStat.curCmd ); | |
452 | |
453 /* log result */ | |
454 cmh_logRslt ( gmmEntStat.entOwn, RAT_OK, gmmEntStat.curCmd, | |
455 -1, BS_SPEED_NotPresent,CME_ERR_NotPresent ); | |
456 break; | |
457 } | |
458 gmmEntStat.curCmd = AT_CMD_NONE; | |
459 | |
460 } | |
461 | |
462 /* | |
463 +-------------------------------------------------------------------+ | |
464 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
465 | ROUTINE : cmhGMM_NetDetach | | |
466 +-------------------------------------------------------------------+ | |
467 | |
468 PURPOSE : ME is detached by the network | |
469 | |
470 */ | |
471 GLOBAL void cmhGMM_NetDetach ( UBYTE detach_type, USHORT cause, UBYTE search_running ) | |
472 { | |
473 UBYTE cme_err; /* error number */ | |
474 SHORT i; | |
475 | |
476 | |
477 TRACE_FUNCTION ("cmhGMM_NetDetach()"); | |
478 | |
479 switch (detach_type) | |
480 { | |
481 case GMMREG_DT_GPRS: | |
482 case GMMREG_DT_COMB: | |
483 for( i = 0 ; i < CMD_SRC_MAX; i++ ) | |
484 { | |
485 R_AT( RAT_CGEREP, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_NW_DETACH, NULL ); | |
486 R_AT( RAT_P_CGEV, (T_ACI_CMD_SRC)i ) ( CGEREP_EVENT_NW_DETACH, NULL ); | |
487 } | |
488 /*lint -fallthrough */ | |
489 case GMMREG_DT_SIM_REMOVED: | |
490 case GMMREG_DT_LIMITED_SERVICE: | |
491 cmhGMM_Set_state(AS_DETACHED); | |
492 break; | |
493 case GMMREG_DT_IMSI: | |
494 cmhGMM_Set_state(AS_ATTACHED); | |
495 break; | |
496 case GMMREG_DT_DISABLE_GPRS: | |
497 cmhGMM_Set_state(AS_SUSPENTED); | |
498 break; | |
499 case GMMREG_DT_POWER_OFF: | |
500 default: | |
501 break; | |
502 } | |
503 | |
504 switch (detach_type) | |
505 { | |
506 case GMMREG_DT_GPRS: | |
507 gmmShrdPrm.current_attach_type = GMMREG_AT_IMSI; | |
508 break; | |
509 case GMMREG_DT_IMSI: | |
510 gmmShrdPrm.current_attach_type = GMMREG_AT_GPRS; | |
511 break; | |
512 case GMMREG_DT_COMB: | |
513 case GMMREG_DT_SIM_REMOVED: | |
514 case GMMREG_DT_LIMITED_SERVICE: | |
515 case GMMREG_DT_POWER_OFF: | |
516 gmmShrdPrm.current_attach_type = ATTACH_TYPE_DETACHED; | |
517 break; | |
518 } | |
519 | |
520 if( search_running EQ GMMREG_SEARCH_NOT_RUNNING) | |
521 { | |
522 if (work_cids[cid_pointer] NEQ PDP_CONTEXT_CID_INVALID) | |
523 { | |
524 /* | |
525 * Inform CMH SM about the new attach state. | |
526 */ | |
527 cmhSM_GprsAttached( GPRS_DETACH ); | |
528 } | |
529 else | |
530 { | |
531 /* | |
532 * map error cause | |
533 */ | |
534 switch(cause) | |
535 { | |
536 case GMMCS_ILLEGAL_MS: | |
537 case MMCS_ILLEGAL_MS: | |
538 cme_err = CME_ERR_GPRSBadMs; | |
539 break; | |
540 case GMMCS_ILLEGAL_ME: | |
541 case MMCS_ILLEGAL_ME: | |
542 cme_err = CME_ERR_GPRSBadMe; | |
543 break; | |
544 case GMMCS_GPRS_NOT_ALLOWED: | |
545 /* No corrosponding MM cause */ | |
546 cme_err = CME_ERR_GPRSNoService; | |
547 break; | |
548 case GMMCS_PLMN_NOT_ALLOWED: | |
549 case MMCS_PLMN_NOT_ALLOWED: | |
550 cme_err = CME_ERR_GPRSBadPlmn; | |
551 break; | |
552 case GMMCS_LA_NOT_ALLOWED: | |
553 case MMCS_LA_NOT_ALLOWED: | |
554 cme_err = CME_ERR_GPRSBadLoc; | |
555 break; | |
556 case GMMCS_ROAMING_NOT_ALLOWED: | |
557 case MMCS_ROAMING_NOT_ALLOWED: | |
558 cme_err = CME_ERR_GPRSNoRoam; | |
559 break; | |
560 case GMMCS_IMPLICIT_DETACHED: | |
561 /* No corrosponding MM cause */ | |
562 cme_err = CME_ERR_GPRSUnspec; | |
563 break; | |
564 case GMMCS_IMSI_UNKNOWN: | |
565 case MMCS_IMSI_IN_HLR: | |
566 case MMCS_IMEI_NOT_ACCEPTED: | |
567 /* No corrosponding GMM cause */ | |
568 case GMMCS_NO_MS_ID: | |
569 /* No corrosponding MM cause */ | |
570 cme_err = CME_ERR_SimFail; | |
571 break; | |
572 case GMMCS_GSM_GPRS_NOT_ALLOWED: | |
573 /* No corrosponding MM cause */ | |
574 case GMMCS_NET_FAIL: | |
575 case MMCS_NETWORK_FAILURE: | |
576 case GMMCS_MSC_TEMP_NOT_REACHABLE: | |
577 /* No corrosponding MM cause */ | |
578 case GMMCS_CONGESTION: | |
579 case MMCS_CONGESTION: | |
580 cme_err = CME_ERR_NoServ; | |
581 break; | |
582 default: | |
583 cme_err = CME_ERR_Unknown; | |
584 } | |
585 | |
586 /* If we get detach indication with search_running as false, then we should | |
587 send error response to user. This is in the normal attach / cgclass case | |
588 */ | |
589 | |
590 switch ( gmmEntStat.curCmd ) | |
591 { | |
592 case AT_CMD_CGCLASS: | |
593 case AT_CMD_CGATT: | |
594 R_AT( RAT_CME, gmmEntStat.entOwn ) ( gmmEntStat.curCmd, cme_err ); | |
595 | |
596 /* log result */ | |
597 cmh_logRslt (gmmEntStat.entOwn, RAT_CME, gmmEntStat.curCmd,(SHORT)-1, (T_ACI_BS_SPEED)-1, (T_ACI_CME_ERR)cme_err ); | |
598 break; | |
599 } | |
600 gmmEntStat.curCmd = AT_CMD_NONE; | |
601 } | |
602 } | |
603 | |
604 } | |
605 /* | |
606 +-------------------------------------------------------------------+ | |
607 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
608 | ROUTINE : cmhGMM_Plmn | | |
609 +-------------------------------------------------------------------+ | |
610 | |
611 PURPOSE : reseive a PLMN list | |
612 | |
613 */ | |
614 GLOBAL SHORT cmhGMM_Plmn ( void ) | |
615 { | |
616 TRACE_FUNCTION ("cmhGMM_Plmn()"); | |
617 | |
618 | |
619 return GMMH_CMD_OK; | |
620 } | |
621 | |
622 /* | |
623 +-------------------------------------------------------------------+ | |
624 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
625 | ROUTINE : cmhGMM_Suspend | | |
626 +-------------------------------------------------------------------+ | |
627 | |
628 PURPOSE : full service or limited service is available | |
629 | |
630 */ | |
631 GLOBAL SHORT cmhGMM_Suspend ( UBYTE cell_state ) | |
632 { | |
633 | |
634 TRACE_FUNCTION ("cmhGMM_Suspend()"); | |
635 | |
636 cmhGMM_Set_state( AS_SUSPENTED ); | |
637 | |
638 #if defined (SIM_TOOLKIT) AND defined (FF_SAT_E) | |
639 | |
640 cmhSAT_OpChnGPRSStat(SAT_GPRS_SUSPEND, SAT_GPRS_INV_CAUSE); | |
641 | |
642 #endif /* SIM_TOOLKIT AND FF_SAT_E */ | |
643 | |
644 return GMMH_CMD_OK; | |
645 } | |
646 | |
647 /* | |
648 +-------------------------------------------------------------------+ | |
649 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
650 | ROUTINE : cmhGMM_Resume | | |
651 +-------------------------------------------------------------------+ | |
652 | |
653 PURPOSE : GPRS full service is now available | |
654 | |
655 */ | |
656 GLOBAL SHORT cmhGMM_Resume ( void ) | |
657 { | |
658 | |
659 TRACE_FUNCTION ("cmhGMM_Resume()"); | |
660 | |
661 cmhGMM_Set_state( AS_ATTACHED ); | |
662 | |
663 #if defined (SIM_TOOLKIT) AND defined (FF_SAT_E) | |
664 | |
665 cmhSAT_OpChnGPRSStat(SAT_GPRS_RESUME, SAT_GPRS_INV_CAUSE); | |
666 | |
667 #endif /* SIM_TOOLKIT AND FF_SAT_E */ | |
668 | |
669 return GMMH_CMD_OK; | |
670 } | |
671 | |
672 /* | |
673 +-------------------------------------------------------------------+ | |
674 | PROJECT : GPRS (8441) MODULE : CMH_GMMR | | |
675 | ROUTINE : cmhGMM_Info | | |
676 +-------------------------------------------------------------------+ | |
677 | |
678 PURPOSE : reseive the information provided by the GMM INFORMATION message. | |
679 | |
680 */ | |
681 GLOBAL SHORT cmhGMM_Info ( void ) | |
682 { | |
683 TRACE_FUNCTION ("cmhGMM_Info()"); | |
684 | |
685 | |
686 return GMMH_CMD_OK; | |
687 } | |
688 | |
689 | |
690 | |
691 /* | |
692 +-------------------------------------------------------------------+ | |
693 | PROJECT : GSM-PS (6147) MODULE : CMH_GMMR | | |
694 | ROUTINE : cmhGMM_CipheringInd | | |
695 +-------------------------------------------------------------------+ | |
696 | |
697 PURPOSE : ciphering indication received | |
698 | |
699 */ | |
700 | |
701 GLOBAL SHORT cmhGMM_CipheringInd ( UBYTE gsm_ciph, UBYTE gprs_ciph ) | |
702 { | |
703 SHORT idx; /* holds index counter */ | |
704 | |
705 TRACE_FUNCTION ("cmhGMM_CipheringInd()"); | |
706 | |
707 if (simShrdPrm.ciSIMEnabled NEQ TRUE) | |
708 { | |
709 return 1; | |
710 } | |
711 | |
712 for (idx = 0; idx < CMD_SRC_MAX; idx++) | |
713 { | |
714 /* | |
715 *----------------------------------------------------------------- | |
716 * new message indication | |
717 *----------------------------------------------------------------- | |
718 */ | |
719 R_AT(RAT_P_CPRI,(T_ACI_CMD_SRC)idx)(gsm_ciph, gprs_ciph); | |
720 } | |
721 return 0; | |
722 } | |
723 | |
724 | |
725 #endif /* GPRS */ | |
726 /*==== EOF ========================================================*/ | |
727 |