FreeCalypso > hg > freecalypso-citrine
comparison g23m-aci/aci/psa_satp.c @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 09 Jun 2016 00:02:41 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:75a11d740a02 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : PSA_SATP | |
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 processing functions for the | |
18 | primitives send to the protocol stack adapter by the | |
19 | SIM application toolkit. | |
20 +----------------------------------------------------------------------------- | |
21 */ | |
22 | |
23 #include "config.h" | |
24 #include "fixedconf.h" | |
25 #include "condat-features.h" | |
26 #include "aci_conf.h" | |
27 | |
28 #ifdef SIM_TOOLKIT | |
29 | |
30 #ifndef PSA_SATP_C | |
31 #define PSA_SATP_C | |
32 #endif | |
33 | |
34 #include "aci_all.h" | |
35 | |
36 /*==== INCLUDES ===================================================*/ | |
37 #include "aci_cmh.h" | |
38 #include "aci_mem.h" | |
39 | |
40 #ifdef FAX_AND_DATA | |
41 #include "aci_fd.h" | |
42 #endif /* of #ifdef FAX_AND_DATA */ | |
43 | |
44 #include "aci.h" | |
45 #include "psa.h" | |
46 #include "psa_cc.h" | |
47 #include "psa_sim.h" /* for simShrdPrm declaration */ | |
48 #include "psa_sat.h" | |
49 #include "psa_sms.h" | |
50 #include "cmh.h" | |
51 #include "cmh_sat.h" | |
52 | |
53 /*==== CONSTANTS ==================================================*/ | |
54 | |
55 | |
56 /*==== TYPES ======================================================*/ | |
57 | |
58 | |
59 /*==== EXPORT =====================================================*/ | |
60 UBYTE temp ; | |
61 | |
62 /*==== VARIABLES ==================================================*/ | |
63 | |
64 /*==== FUNCTIONS ==================================================*/ | |
65 | |
66 /* | |
67 +-------------------------------------------------------------------+ | |
68 | PROJECT : GSM-PS (6147) MODULE : PSA_SATP | | |
69 | ROUTINE : psa_sim_toolkit_ind | | |
70 +-------------------------------------------------------------------+ | |
71 | |
72 PURPOSE : processes the SIM_TOOLKIT_IND primitive send by SIM. | |
73 this is an indication that a STK command was received. | |
74 | |
75 */ | |
76 | |
77 GLOBAL void psa_sim_toolkit_ind | |
78 ( T_SIM_TOOLKIT_IND *sim_toolkit_ind ) | |
79 { | |
80 T_ACI_SAT_TERM_RESP resp_data; | |
81 | |
82 TRACE_FUNCTION ("psa_sim_toolkit_ind()"); | |
83 | |
84 /* | |
85 *------------------------------------------------------------------- | |
86 * update shared parameter | |
87 *------------------------------------------------------------------- | |
88 */ | |
89 | |
90 satShrdPrm.stkCmdLen = sim_toolkit_ind -> stk_cmd.l_cmd; | |
91 satShrdPrm.stkCmd = sim_toolkit_ind -> stk_cmd.cmd; | |
92 | |
93 TRACE_EVENT_P1("%x", satShrdPrm.stkCmd[44] ); | |
94 | |
95 psaSAT_DumpCmd ( &sim_toolkit_ind -> stk_cmd ); | |
96 | |
97 /* | |
98 *------------------------------------------------------------------- | |
99 * decode SIM toolkit command | |
100 *------------------------------------------------------------------- | |
101 */ | |
102 CCD_START; | |
103 { | |
104 UBYTE ccdRet; | |
105 | |
106 MCAST( cmd, STK_CMD ); | |
107 memset( cmd, 0, sizeof( T_STK_CMD )); | |
108 | |
109 ccdRet = ccd_decodeMsg (CCDENT_SAT, | |
110 DOWNLINK, | |
111 (T_MSGBUF *) &sim_toolkit_ind -> stk_cmd, | |
112 (UBYTE *) _decodedMsg, | |
113 STK_CMD); | |
114 | |
115 if( ccdRet NEQ ccdOK OR !cmd->v_pas_cmd) | |
116 { | |
117 cmhSAT_STKCmdInd(); | |
118 } | |
119 else if( cmd->pas_cmd.v_cmd_details AND cmd->pas_cmd.v_dev_ids ) | |
120 { | |
121 /* store command details */ | |
122 satShrdPrm.cmdDet.cmdNr = cmd->pas_cmd.cmd_details.cmd_nr; | |
123 satShrdPrm.cmdDet.cmdType = cmd->pas_cmd.cmd_details.cmd_typ; | |
124 satShrdPrm.cmdDet.cmdQlf = cmd->pas_cmd.cmd_details.cmd_qlf; | |
125 | |
126 #ifdef TI_PS_FF_AT_P_CMD_CUST | |
127 if (simShrdPrm.overall_cust_mode EQ (UBYTE)CUST_MODE_BEHAVIOUR_1) | |
128 { | |
129 /* | |
130 ** Customised behaviour for the Cust1 MMI | |
131 */ | |
132 switch (cmd->pas_cmd.cmd_details.cmd_typ) | |
133 { | |
134 case SAT_CMD_SETUP_CALL: | |
135 case SAT_CMD_SEND_SMS: | |
136 case SAT_CMD_SEND_SS: | |
137 case SAT_CMD_SEND_USSD: | |
138 if (satShrdPrm.cust1StkCmd != (void *)0) | |
139 { | |
140 /* | |
141 ** The previous command has not been deleted. | |
142 */ | |
143 ACI_MFREE(satShrdPrm.cust1StkCmd); | |
144 | |
145 satShrdPrm.cust1StkCmd = (void *)0; | |
146 satShrdPrm.cust1StkCmdLen = 0; | |
147 } | |
148 | |
149 /* | |
150 ** Allocate memory to store the command | |
151 */ | |
152 ACI_MALLOC(satShrdPrm.cust1StkCmd, MAX_STK_CMD); | |
153 if (satShrdPrm.cust1StkCmd EQ (void *)0) | |
154 { | |
155 /* | |
156 ** Memory allocation has failed, return ME Unable to Process Cmd | |
157 */ | |
158 TRACE_EVENT("Memory Allocation Failure"); | |
159 psaSAT_InitTrmResp( &resp_data ); | |
160 psaSAT_SendTrmResp( RSLT_ME_UNAB_PROC, &resp_data ); | |
161 break; | |
162 } | |
163 | |
164 /* | |
165 ** Save the received data before proceeding | |
166 */ | |
167 memset(satShrdPrm.cust1StkCmd, 0, MAX_STK_CMD); | |
168 /* | |
169 ** stkCmdLen is the BIT length of the received data, so shift right 3 (divide by 8) | |
170 ** in order to get the BYTE length | |
171 */ | |
172 memcpy(satShrdPrm.cust1StkCmd, satShrdPrm.stkCmd, satShrdPrm.stkCmdLen >> 3); | |
173 satShrdPrm.cust1StkCmdLen = satShrdPrm.stkCmdLen; | |
174 | |
175 /* | |
176 ** Continue the processing as for normal behaviour, | |
177 ** special processing will be applied later | |
178 ** | |
179 ** No Break! | |
180 */ | |
181 /*lint -fallthrough */ | |
182 case SAT_CMD_EVENT_LIST: | |
183 /* | |
184 ** This command is processed normally | |
185 */ | |
186 if( !cmd->pas_cmd.v_cmd_prms OR !cmd->pas_cmd.cmd_prms.l_cmd_prms ) | |
187 { | |
188 TRACE_EVENT("no parameters in envelope"); | |
189 psaSAT_dasmMECmd( NULL ); | |
190 } | |
191 else | |
192 psaSAT_dasmMECmd( &cmd->pas_cmd.cmd_prms ); | |
193 break; | |
194 | |
195 case SAT_CMD_REFRESH: | |
196 /* | |
197 ** This command is to be forwarded to the MMI, for the user to be given the | |
198 ** chance to accept or reject the Refresh action. The user response will be | |
199 ** contained in a SATR Response indication, and we must be prepared to | |
200 ** process that indication in a different manner. | |
201 */ | |
202 satShrdPrm.cust1SimRefreshRespRqd = TRUE; | |
203 | |
204 /* | |
205 ** Forward the command to the MMI | |
206 */ | |
207 cmhSAT_STKCmdInd(); | |
208 break; | |
209 | |
210 default: | |
211 /* | |
212 ** If the command is handled by the MMI pass it up in a %SATI indication | |
213 */ | |
214 if (cmhSAT_IsStkCmdForMmi(cmd->pas_cmd.cmd_details.cmd_typ, | |
215 cmd->pas_cmd.cmd_details.cmd_qlf) EQ FALSE) | |
216 { | |
217 /* | |
218 ** Otherwise Determine whether the command is handled in the Modem Part | |
219 */ | |
220 switch (cmd->pas_cmd.cmd_details.cmd_typ) | |
221 { | |
222 case( SAT_CMD_SEND_DTMF ): | |
223 case( SAT_CMD_RUN_AT ): | |
224 case( SAT_CMD_LAUNCH_BROWSER ): | |
225 case (SAT_CMD_PROV_LOC_INFO): | |
226 #ifdef FF_SAT_E | |
227 case( SAT_CMD_OPEN_CHANNEL ): | |
228 #endif /* FF_SAT_E */ | |
229 if( !cmd->pas_cmd.v_cmd_prms OR !cmd->pas_cmd.cmd_prms.l_cmd_prms ) | |
230 { | |
231 TRACE_EVENT("no parameters in envelope"); | |
232 psaSAT_dasmMECmd( NULL ); | |
233 } | |
234 else | |
235 psaSAT_dasmMECmd( &cmd->pas_cmd.cmd_prms ); | |
236 break; | |
237 #ifdef FF_SAT_E | |
238 /* special handling for CLOSE CHANNEL, no further decoding required. | |
239 all that is needed can be found in device identities */ | |
240 case( SAT_CMD_CLOSE_CHANNEL ): | |
241 | |
242 cmhSAT_CloseChannel(); | |
243 | |
244 break; | |
245 | |
246 /* special handling for SEND DATA, no further decoding required. | |
247 all that is needed can be found in command details */ | |
248 case( SAT_CMD_SEND_DATA ): | |
249 cmhSAT_SendData(); | |
250 break; | |
251 | |
252 /* special handling for GET CHANNEL STATUS, no further decoding required */ | |
253 case( SAT_CMD_GET_CHANNEL_STATUS ): | |
254 cmhSAT_GetChannelStatus(); | |
255 break; | |
256 | |
257 /* special handling for RECEIVE DATA, no further decoding required */ | |
258 case( SAT_CMD_RECEIVE_DATA ): | |
259 cmhSAT_STKUsrNtfy(); | |
260 break; | |
261 #endif /* FF_SAT_E */ | |
262 | |
263 /* | |
264 ** If the command is not handled by the Modem Part, return a "Beyond ME | |
265 ** Capabilities" response to the SIM Entity. | |
266 */ | |
267 default: | |
268 TRACE_EVENT("Unable to handle command"); | |
269 psaSAT_InitTrmResp( &resp_data ); | |
270 psaSAT_SendTrmResp( RSLT_ME_CAP, &resp_data ); | |
271 } | |
272 } | |
273 } | |
274 } | |
275 else | |
276 #endif /* TI_PS_FF_AT_P_CMD_CUST */ | |
277 { | |
278 /* if command is addressed to ACI */ | |
279 switch( cmd->pas_cmd.cmd_details.cmd_typ ) | |
280 { | |
281 case( SAT_CMD_SETUP_CALL ): | |
282 case( SAT_CMD_SEND_SS ): | |
283 case( SAT_CMD_SEND_SMS ): | |
284 case( SAT_CMD_SEND_USSD ): | |
285 case( SAT_CMD_SEND_DTMF ): | |
286 case( SAT_CMD_EVENT_LIST ): | |
287 case( SAT_CMD_RUN_AT ): | |
288 case( SAT_CMD_LAUNCH_BROWSER ): | |
289 case (SAT_CMD_PROV_LOC_INFO): | |
290 #ifdef FF_SAT_E | |
291 case( SAT_CMD_OPEN_CHANNEL ): | |
292 #endif /* FF_SAT_E */ | |
293 if( !cmd->pas_cmd.v_cmd_prms OR !cmd->pas_cmd.cmd_prms.l_cmd_prms ) | |
294 { | |
295 TRACE_EVENT("no parameters in envelope"); | |
296 psaSAT_dasmMECmd( NULL ); | |
297 } | |
298 else | |
299 psaSAT_dasmMECmd( &cmd->pas_cmd.cmd_prms ); | |
300 break; | |
301 #ifdef FF_SAT_E | |
302 /* special handling for CLOSE CHANNEL, no further decoding required. | |
303 all that is needed can be found in device identities */ | |
304 case( SAT_CMD_CLOSE_CHANNEL ): | |
305 /* Channel Id invalid */ | |
306 temp = (UBYTE) cmd->pas_cmd.dev_ids.dest_dev; | |
307 if ( (CHANNEL_ID_1 NEQ (UBYTE)(temp & 0x0f)) OR ( satShrdPrm.chnTb.lnkStat EQ SIM_NO_LINK ) ) | |
308 { | |
309 /* Close Channel with an invalid channel identifier */ | |
310 psaSAT_InitTrmResp( &resp_data ); | |
311 resp_data.chnStat = FALSE; | |
312 resp_data.add_content = ADD_BIP_CHANID_NT_VLD; | |
313 psaSAT_SendTrmResp( RSLT_BEARIND_PERR, &resp_data ); | |
314 } | |
315 else | |
316 { | |
317 cmhSAT_CloseChannel(); | |
318 } | |
319 break; | |
320 | |
321 /* special handling for SEND DATA, no further decoding required. | |
322 all that is needed can be found in command details */ | |
323 case( SAT_CMD_SEND_DATA ): | |
324 | |
325 /* Channel Id invalid */ | |
326 temp = (UBYTE) cmd->pas_cmd.dev_ids.dest_dev; | |
327 if ( (CHANNEL_ID_1 NEQ (UBYTE)(temp & 0x0f)) OR ( satShrdPrm.chnTb.lnkStat EQ SIM_NO_LINK ) ) | |
328 { | |
329 /* Close Channel with an invalid channel identifier */ | |
330 psaSAT_InitTrmResp( &resp_data ); | |
331 resp_data.chnStat = FALSE; | |
332 resp_data.add_content = ADD_BIP_CHANID_NT_VLD; | |
333 psaSAT_SendTrmResp( RSLT_BEARIND_PERR, &resp_data ); | |
334 } | |
335 else | |
336 { | |
337 | |
338 cmhSAT_SendData(); | |
339 } | |
340 break; | |
341 | |
342 /* special handling for GET CHANNEL STATUS, no further decoding required */ | |
343 case( SAT_CMD_GET_CHANNEL_STATUS ): | |
344 | |
345 cmhSAT_GetChannelStatus(); | |
346 break; | |
347 | |
348 /* special handling for RECEIVE DATA, no further decoding required */ | |
349 case( SAT_CMD_RECEIVE_DATA ): | |
350 | |
351 cmhSAT_STKUsrNtfy(); | |
352 break; | |
353 #endif /* FF_SAT_E */ | |
354 /* otherwise pass command to user */ | |
355 default: | |
356 cmhSAT_STKCmdInd(); | |
357 } | |
358 } | |
359 } | |
360 else | |
361 { | |
362 /* respond with "error, required values are missing" */ | |
363 TRACE_EVENT("parameters are missing"); | |
364 psaSAT_InitTrmResp( &resp_data ); | |
365 psaSAT_SendTrmResp( RSLT_ERR_REQ_VAL, &resp_data ); | |
366 } | |
367 } | |
368 CCD_END; | |
369 | |
370 /* | |
371 *------------------------------------------------------------------- | |
372 * free the primitive buffer | |
373 *------------------------------------------------------------------- | |
374 */ | |
375 PFREE (sim_toolkit_ind); | |
376 | |
377 } | |
378 | |
379 /* | |
380 +-------------------------------------------------------------------+ | |
381 | PROJECT : GSM-PS (6147) MODULE : PSA_SATP | | |
382 | ROUTINE : psa_sim_toolkit_cnf | | |
383 +-------------------------------------------------------------------+ | |
384 | |
385 PURPOSE : processes the SIM_TOOLKIT_CNF primitive send by SIM. | |
386 this is a confirmation to a previous STK command. | |
387 | |
388 */ | |
389 | |
390 GLOBAL void psa_sim_toolkit_cnf( T_SIM_TOOLKIT_CNF *sim_toolkit_cnf ) | |
391 { | |
392 void *p = NULL; | |
393 BOOL SIM_error = FALSE; | |
394 BOOL not_allw = FALSE; | |
395 BOOL allw = FALSE; | |
396 void *p_allw = NULL; | |
397 UBYTE *p_v_allw = NULL; | |
398 void *p_not_allw = NULL; | |
399 UBYTE *p_v_not_allw = NULL; | |
400 void *p_allw_mdfy = NULL; | |
401 UBYTE *p_v_allw_mdfy = NULL; | |
402 SHORT StructSize = 0; | |
403 UBYTE DynEnv = '\0'; | |
404 | |
405 TRACE_FUNCTION ("psa_sim_toolkit_cnf()"); | |
406 /* | |
407 *------------------------------------------------------------------- | |
408 * update shared parameter | |
409 *------------------------------------------------------------------- | |
410 */ | |
411 satShrdPrm.stkCmdLen = sim_toolkit_cnf -> stk_cmd.l_cmd; | |
412 satShrdPrm.stkCmd = sim_toolkit_cnf -> stk_cmd.cmd; | |
413 satShrdPrm.stkError = sim_toolkit_cnf -> cause; | |
414 | |
415 psaSAT_DumpCmd ( &sim_toolkit_cnf -> stk_cmd ); | |
416 | |
417 /* | |
418 *------------------------------------------------------------------- | |
419 * if request was invoked by MMI pass reply to MMI | |
420 *------------------------------------------------------------------- | |
421 */ | |
422 if( sim_toolkit_cnf -> req_id EQ SRQ_MMI ) | |
423 { | |
424 cmhSAT_STKCmdCnf(); | |
425 } | |
426 | |
427 /* | |
428 *------------------------------------------------------------------- | |
429 * if request was invoked by ACI decode envelope command result | |
430 *------------------------------------------------------------------- | |
431 */ | |
432 else if( sim_toolkit_cnf -> req_id EQ SRQ_ACI ) | |
433 { | |
434 if( sim_toolkit_cnf -> stk_cmd.l_cmd EQ 0 OR | |
435 sim_toolkit_cnf -> cause EQ SIM_CAUSE_SAT_BUSY) | |
436 { | |
437 SIM_error = TRUE; | |
438 | |
439 switch ( sim_toolkit_cnf -> cause ) | |
440 { | |
441 case SIM_CAUSE_OTHER_ERROR: | |
442 case SIM_CAUSE_SAT_BUSY: | |
443 case SIM_CAUSE_CARD_REMOVED: | |
444 case SIM_CAUSE_PIN1_EXPECT: | |
445 case SIM_CAUSE_PIN1_BLOCKED: | |
446 case SIM_CAUSE_PUK1_EXPECT: | |
447 case SIM_CAUSE_PUK1_BLOCKED: | |
448 case SIM_CAUSE_PIN2_EXPECT: | |
449 case SIM_CAUSE_PIN2_BLOCKED: | |
450 case SIM_CAUSE_PUK2_EXPECT: | |
451 case SIM_CAUSE_PUK2_BLOCKED: | |
452 /* in case of certain errors, assume not allowed */ | |
453 not_allw = TRUE; | |
454 sim_toolkit_cnf -> stk_cmd.cmd[0] = CCR_NOT_ALLW; | |
455 break; | |
456 | |
457 default: | |
458 /* in case of a positive result without further info, | |
459 assume allowed not modified */ | |
460 allw = TRUE; | |
461 sim_toolkit_cnf -> stk_cmd.cmd[0] = CCR_ALLW_NO_MDFY; | |
462 break; | |
463 } | |
464 sim_toolkit_cnf -> stk_cmd.cmd[1] = 0; /* no extra TLVs */ | |
465 satShrdPrm.stkCmdLen = 2<<3; /* 2 bytes result */ | |
466 } | |
467 | |
468 else | |
469 { | |
470 SIM_error = FALSE; | |
471 } | |
472 | |
473 | |
474 { | |
475 CCD_START; | |
476 { | |
477 UBYTE ccdRet; | |
478 MCAST( env, ENV_RES ); | |
479 MCAST( smc_env, ENV_RES_SMC ); | |
480 | |
481 switch( satShrdPrm.SIMCCParm.ccAct ) | |
482 { | |
483 case( CC_ACT_CAL ): | |
484 case( CC_ACT_SS ): | |
485 case( CC_ACT_USSD ): | |
486 memset( env, 0, sizeof( T_ENV_RES )); | |
487 p_v_not_allw = &env->v_ccr_not_allw; | |
488 p_v_allw = &env->v_ccr_allw; | |
489 p_v_allw_mdfy = &env->v_ccr_allw_mdfy; | |
490 p_not_allw = &env->ccr_not_allw; | |
491 p_allw = &env->ccr_allw; | |
492 p_allw_mdfy = &env->ccr_allw_mdfy; | |
493 DynEnv = ENV_RES; | |
494 break; | |
495 case( SMC_ACT_MO ): | |
496 memset( smc_env, 0, sizeof( T_ENV_RES_SMC )); | |
497 p_v_not_allw = &smc_env->v_smcr_not_allw; | |
498 p_v_allw = &smc_env->v_smcr_allw; | |
499 p_v_allw_mdfy = &smc_env->v_smcr_allw_mdfy; | |
500 p_not_allw = &smc_env->smcr_not_allw; | |
501 p_allw = &smc_env->smcr_allw; | |
502 p_allw_mdfy = &smc_env->smcr_allw_mdfy; | |
503 DynEnv = ENV_RES_SMC; | |
504 break; | |
505 } | |
506 | |
507 if (SIM_error) | |
508 { | |
509 if(p_v_not_allw AND p_v_allw) /* To avoid the NULL poiner usage, 613 lint warning */ | |
510 { | |
511 *p_v_not_allw = not_allw; | |
512 *p_v_allw = allw; | |
513 } | |
514 } | |
515 /* otherwise decode message */ | |
516 else | |
517 { | |
518 ccdRet = ccd_decodeMsg (CCDENT_SAT, | |
519 DOWNLINK, | |
520 (T_MSGBUF *) &sim_toolkit_cnf -> stk_cmd, | |
521 (UBYTE *) _decodedMsg, | |
522 DynEnv ); | |
523 | |
524 if( ccdRet NEQ ccdOK ) | |
525 { | |
526 /* in case of a result failure, pretend allowed not modified */ | |
527 if(p_v_not_allw AND p_v_allw AND p_v_allw_mdfy) /* To avoid the NULL poiner usage, 613 lint warning */ | |
528 | |
529 { | |
530 if( psaSAT_ccdErrChk() NEQ 0 AND | |
531 (!(*p_v_allw) AND !(*p_v_not_allw) AND !(*p_v_allw_mdfy))) | |
532 { | |
533 memset( env, 0, StructSize ); | |
534 *p_v_allw = TRUE; | |
535 sim_toolkit_cnf -> stk_cmd.cmd[0] = CCR_ALLW_NO_MDFY; | |
536 sim_toolkit_cnf -> stk_cmd.cmd[1] = 0; | |
537 satShrdPrm.stkCmdLen = 2<<3; /* 2 bytes result */ | |
538 } | |
539 } | |
540 } | |
541 } | |
542 | |
543 /* process result */ | |
544 if(p_v_not_allw AND p_v_allw AND p_v_allw_mdfy) /* To avoid the NULL poiner usage, 613 lint warning */ | |
545 | |
546 { | |
547 if ( *p_v_allw ) p = p_allw; | |
548 else if( *p_v_not_allw ) p = p_not_allw; | |
549 else if( *p_v_allw_mdfy ) p = p_allw_mdfy; | |
550 | |
551 | |
552 satShrdPrm.ntfy = USR_NTF_CC_SIM; | |
553 cmhSAT_STKUsrNtfy(); | |
554 | |
555 switch( satShrdPrm.SIMCCParm.ccAct ) | |
556 { | |
557 case( CC_ACT_CAL ): | |
558 | |
559 if( cmhSAT_ResCalCntrlBySIM( sim_toolkit_cnf -> stk_cmd.cmd, p )) | |
560 { | |
561 /* keep primitive for terminal response */ | |
562 satShrdPrm.stkCnfPrim = sim_toolkit_cnf; | |
563 CCD_END; | |
564 return; | |
565 } | |
566 break; | |
567 | |
568 case( CC_ACT_SS ): | |
569 | |
570 if( cmhSAT_ResSSCntrlBySIM( sim_toolkit_cnf -> stk_cmd.cmd, p )) | |
571 { | |
572 /* keep primitive for terminal response */ | |
573 satShrdPrm.stkCnfPrim = sim_toolkit_cnf; | |
574 CCD_END; | |
575 return; | |
576 } | |
577 break; | |
578 | |
579 case( CC_ACT_USSD ): | |
580 | |
581 if( cmhSAT_ResUSSDCntrlBySIM( sim_toolkit_cnf -> stk_cmd.cmd, p )) | |
582 { | |
583 /* keep primitive for terminal response */ | |
584 /*satShrdPrm.stkCnfPrim = sim_toolkit_cnf;*/ | |
585 CCD_END; | |
586 return; | |
587 } | |
588 break; | |
589 | |
590 case( SMC_ACT_MO ): | |
591 if( cmhSAT_ResSMCntrlBySIM( sim_toolkit_cnf -> stk_cmd.cmd, p )) | |
592 { | |
593 /* keep primitive for terminal response */ | |
594 /*satShrdPrm.stkCnfPrim = sim_toolkit_cnf;*/ | |
595 CCD_END; | |
596 return; | |
597 } | |
598 break; | |
599 | |
600 default: | |
601 TRACE_EVENT("UNEXP CC ACTION IN SAT PARMS"); | |
602 break; | |
603 } | |
604 } | |
605 } | |
606 satShrdPrm.SIMCCParm.ccAct = NO_CC_ACT; | |
607 CCD_END; | |
608 } | |
609 } | |
610 | |
611 /* | |
612 *------------------------------------------------------------------- | |
613 * free the primitive buffer | |
614 *------------------------------------------------------------------- | |
615 */ | |
616 PFREE (sim_toolkit_cnf); | |
617 | |
618 } | |
619 | |
620 /* | |
621 +-------------------------------------------------------------------+ | |
622 | PROJECT : GSM-PS (6147) MODULE : PSA_SATP | | |
623 | ROUTINE : psa_sim_file_update_ind | | |
624 +-------------------------------------------------------------------+ | |
625 | |
626 PURPOSE : processes the FILE_UPDATE_IND primitive send by SIM. | |
627 It provides a list of updated EFs. | |
628 | |
629 */ | |
630 | |
631 GLOBAL void psa_sim_file_update_ind | |
632 ( T_SIM_FILE_UPDATE_IND *sim_file_update_ind ) | |
633 { | |
634 SHORT i; | |
635 BOOL send_confirm_now=TRUE; | |
636 | |
637 TRACE_FUNCTION ("psa_sim_file_update_ind()"); | |
638 | |
639 /* | |
640 *------------------------------------------------------------------- | |
641 * store the primitive and start processing | |
642 *------------------------------------------------------------------- | |
643 */ | |
644 satShrdPrm.fu_ind = sim_file_update_ind; | |
645 | |
646 /* | |
647 * Broadcast %SIMEF unsolicited event to all interested parties. | |
648 */ | |
649 for(i=CMD_SRC_LCL;i<CMD_SRC_MAX;i++) | |
650 { | |
651 if (simShrdPrm.SIMEFMode[i] EQ SIMEF_MODE_ON) | |
652 { | |
653 /* | |
654 * As we have reported the EF update, it is not now the | |
655 * responsibility of this function to send the response | |
656 * immediately. | |
657 */ | |
658 send_confirm_now=FALSE; | |
659 | |
660 R_AT(RAT_P_SIMEF,(T_ACI_CMD_SRC)i)(sim_file_update_ind); | |
661 | |
662 } | |
663 } | |
664 | |
665 /* | |
666 * If we didn't report the EF update to anyone we must send | |
667 * the response now. | |
668 */ | |
669 if (send_confirm_now NEQ FALSE) | |
670 psaSAT_FUConfirm (-1, NOT_PRESENT_16BIT); | |
671 } | |
672 | |
673 #endif /* #ifdef SIM_TOOLKIT */ | |
674 | |
675 /*==== EOF =========================================================*/ |