comparison g23m-aci/aci/psa_sims.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_SIMS
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 signalling functions of the
18 | protocol stack adapter for the subscriber identity
19 | module.
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef PSA_SIMS_C
24 #define PSA_SIMS_C
25 #endif
26
27 #include "config.h"
28 #include "fixedconf.h"
29 #include "condat-features.h"
30 #include "aci_conf.h"
31
32 #include "aci_all.h"
33
34 /*==== INCLUDES ===================================================*/
35 #include "aci_cmh.h"
36 #include "ati_cmd.h"
37 #include "aci_cmd.h"
38 #include "aci.h"
39 #include "psa.h"
40 #include "psa_sim.h"
41
42 #include "aci_mem.h"
43 #ifdef SIM_TOOLKIT
44 #include "psa_cc.h"
45 #include "psa_sat.h"
46 #include "ati_src_sat.h"
47 #include "psa_tcpip.h"
48 #endif/* SIM_TOOLKIT */
49
50 #ifdef DTI
51 #include "dti.h"
52 #include "dti_conn_mng.h"
53 #include "dti_cntrl_mng.h"
54 #endif
55
56 #if defined GPRS AND defined (DTI)
57 #include "gprs.h"
58 #include "gaci.h"
59 #include "gaci_cmh.h"
60 #include "gaci_srcc.h"
61 #include "psa_sm.h"
62
63 #ifdef FAX_AND_DATA
64 #include "aci_fd.h"
65 #endif /* FAX_AND_DATA */
66
67 #endif /* GPRS */
68
69 #include "cmh.h"
70
71 #if defined (GPRS) AND defined (DTI)
72 #include "cmh_sm.h"
73 #endif /* GPRS */
74
75 #include "cmh_sim.h"
76 #include "cmh_sat.h"
77
78 #include "psa_util.h"
79
80 #ifndef _SIMULATION_
81
82 /* temporary solution to get ffs.h included without GPRS to be set ! */
83 #ifdef GPRS
84 #include "../../services/ffs/ffs.h"
85 #else
86 #include "../../services/ffs/ffs.h"
87 #undef GPRS
88 #endif /* GPRS */
89 #include "ffs_coat.h"
90
91 #endif /* !_SIMULATION_ */
92
93
94 /*==== CONSTANTS ==================================================*/
95
96
97 /*==== TYPES ======================================================*/
98
99
100 /*==== EXPORT =====================================================*/
101
102
103 /*==== VARIABLES ==================================================*/
104 #ifdef TI_PS_FF_AT_P_CMD_CUST
105 LOCAL BOOL Cust_Mode_Set = FALSE;
106
107 /*==== FUNCTIONS ==================================================*/
108
109 GLOBAL BOOL psaSIM_hasCustModeBeenSet(void)
110 {
111 return Cust_Mode_Set;
112 }
113 #endif /* TI_PS_FF_AT_P_CMD_CUST */
114 /*
115 +-------------------------------------------------------------------+
116 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
117 | ROUTINE : psaSIM_AccessSIMData |
118 +-------------------------------------------------------------------+
119
120 PURPOSE : access SIM data
121
122 */
123
124 GLOBAL SHORT psaSIM_AccessSIMData ( void )
125 {
126 SHORT aId; /* holds access id */
127
128 TRACE_FUNCTION ("psaSIM_AccessSIMData()");
129
130 /*
131 *-------------------------------------------------------------------
132 * determine access type
133 *-------------------------------------------------------------------
134 */
135 aId = simShrdPrm.aId;
136
137 switch( simShrdPrm.atb[aId].accType )
138 {
139 /*
140 *---------------------------------------------------------------
141 * read datafield
142 *---------------------------------------------------------------
143 */
144 case( ACT_RD_DAT ):
145 {
146 PALLOC (sim_read_req, SIM_READ_REQ);
147
148 /* fill in primitive parameter: read data request */
149 sim_read_req -> source = SRC_MMI;
150 sim_read_req -> req_id = (UBYTE)aId;
151 sim_read_req -> v_path_info = simShrdPrm.atb[aId].v_path_info;
152 if(sim_read_req -> v_path_info)
153 {
154 sim_read_req -> path_info = simShrdPrm.atb[aId].path_info;
155 }
156 sim_read_req -> datafield = simShrdPrm.atb[aId].reqDataFld;
157 sim_read_req -> offset = simShrdPrm.atb[aId].dataOff;
158 sim_read_req -> length = simShrdPrm.atb[aId].dataLen;
159 sim_read_req -> max_length = simShrdPrm.atb[aId].recMax;
160 PSENDX (SIM, sim_read_req);
161 }
162 break;
163
164 /*
165 *---------------------------------------------------------------
166 * write datafield
167 *---------------------------------------------------------------
168 */
169 case( ACT_WR_DAT ):
170 {
171 PALLOC (sim_update_req, SIM_UPDATE_REQ);
172
173 /* fill in primitive parameter: update data request */
174 sim_update_req -> source = SRC_MMI;
175 sim_update_req -> req_id = (UBYTE)aId;
176 sim_update_req -> v_path_info = simShrdPrm.atb[aId].v_path_info;
177 if(sim_update_req -> v_path_info)
178 {
179 sim_update_req -> path_info = simShrdPrm.atb[aId].path_info;
180 }
181 sim_update_req -> datafield = simShrdPrm.atb[aId].reqDataFld;
182 sim_update_req -> offset = simShrdPrm.atb[aId].dataOff;
183 sim_update_req -> length = simShrdPrm.atb[aId].dataLen;
184 memcpy (sim_update_req -> trans_data, simShrdPrm.atb[aId].exchData,
185 simShrdPrm.atb[aId].dataLen);
186
187 PSENDX (SIM, sim_update_req);
188 }
189 break;
190
191 /*
192 *---------------------------------------------------------------
193 * read record
194 *---------------------------------------------------------------
195 */
196 case( ACT_RD_REC ):
197 {
198 PALLOC (sim_read_record_req, SIM_READ_RECORD_REQ);
199
200 /* fill in primitive parameter: read absolute record request */
201 sim_read_record_req -> source = SRC_MMI;
202 sim_read_record_req -> req_id = (UBYTE)aId;
203 sim_read_record_req -> v_path_info = simShrdPrm.atb[aId].v_path_info;
204 if(sim_read_record_req -> v_path_info)
205 {
206 sim_read_record_req -> path_info = simShrdPrm.atb[aId].path_info;
207 }
208 sim_read_record_req -> datafield = simShrdPrm.atb[aId].reqDataFld;
209 sim_read_record_req -> record = simShrdPrm.atb[aId].recNr;
210 if(simShrdPrm.atb[aId].check_dataLen)
211 {
212 sim_read_record_req -> length = NOT_PRESENT_8BIT;
213 }
214 else
215 {
216 sim_read_record_req -> length = simShrdPrm.atb[aId].dataLen;
217 }
218 PSENDX (SIM, sim_read_record_req);
219 }
220 break;
221
222 /*
223 *---------------------------------------------------------------
224 * write record
225 *---------------------------------------------------------------
226 */
227 case( ACT_WR_REC ):
228 {
229 PALLOC (sim_update_record_req, SIM_UPDATE_RECORD_REQ);
230
231 /* fill in primitive parameter: update absolute record request */
232 sim_update_record_req -> source = SRC_MMI;
233 sim_update_record_req -> req_id = (U8)aId;
234 sim_update_record_req -> v_path_info = simShrdPrm.atb[aId].v_path_info;
235 if(sim_update_record_req -> v_path_info)
236 {
237 sim_update_record_req -> path_info = simShrdPrm.atb[aId].path_info;
238 }
239 sim_update_record_req -> datafield = simShrdPrm.atb[aId].reqDataFld;
240 sim_update_record_req -> record = simShrdPrm.atb[aId].recNr;
241 sim_update_record_req -> length = simShrdPrm.atb[aId].dataLen;
242 memcpy (sim_update_record_req -> linear_data,
243 simShrdPrm.atb[aId].exchData, sim_update_record_req->length);
244
245 PSENDX (SIM, sim_update_record_req);
246 }
247 break;
248
249 /*
250 *---------------------------------------------------------------
251 * increment datafield
252 *---------------------------------------------------------------
253 */
254 case( ACT_INC_DAT ):
255 {
256 PALLOC (sim_increment_req, SIM_INCREMENT_REQ);
257
258 /* fill in primitive parameter: increment data request */
259 sim_increment_req -> source = SRC_MMI;
260 sim_increment_req -> req_id = (U8)aId;
261 sim_increment_req -> v_path_info = simShrdPrm.atb[aId].v_path_info;
262 if(sim_increment_req -> v_path_info)
263 {
264 sim_increment_req -> path_info = simShrdPrm.atb[aId].path_info;
265 }
266 sim_increment_req -> datafield = simShrdPrm.atb[aId].reqDataFld;
267 sim_increment_req -> length = simShrdPrm.atb[aId].dataLen;
268 memcpy (sim_increment_req -> linear_data, simShrdPrm.atb[aId].exchData,
269 sim_increment_req->length);
270
271 PSENDX (SIM, sim_increment_req);
272 }
273 break;
274
275 /*
276 *---------------------------------------------------------------
277 * illegal access type
278 *---------------------------------------------------------------
279 */
280 default:
281
282 TRACE_EVENT("UNEXP ACCESS TYPE IN ATB");
283 return( -1 );
284 }
285 /*
286 *-------------------------------------------------------------------
287 * create and send primitive
288 *-------------------------------------------------------------------
289 */
290
291 return 0;
292 }
293
294 /*
295 +-------------------------------------------------------------------+
296 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
297 | ROUTINE : psaSIM_VerifyPIN |
298 +-------------------------------------------------------------------+
299
300 PURPOSE : verify a PIN
301
302 */
303
304 GLOBAL SHORT psaSIM_VerifyPIN ( void )
305 {
306 T_SIM_SET_PRM * pPrmSet; /* points to used parameter set */
307
308 TRACE_FUNCTION ("psaSIM_VerifyPIN()");
309
310 /*
311 *-------------------------------------------------------------------
312 * check owner id
313 *-------------------------------------------------------------------
314 */
315 if(!psa_IsVldOwnId(simShrdPrm.owner))
316
317 return( -1 );
318
319 pPrmSet = &simShrdPrm.setPrm[simShrdPrm.owner];
320
321 /*
322 *-------------------------------------------------------------------
323 * create and send primitive
324 *-------------------------------------------------------------------
325 */
326 {
327 PALLOC (sim_verify_pin_req, SIM_VERIFY_PIN_REQ);
328
329 /* fill in primitive parameter: verify PIN request */
330 sim_verify_pin_req -> source = SRC_MMI;
331 sim_verify_pin_req -> pin_id = pPrmSet -> PINType;
332 memcpy( sim_verify_pin_req -> pin, pPrmSet -> curPIN, PIN_LEN );
333
334 PSENDX (SIM, sim_verify_pin_req);
335 }
336
337 return 0;
338 }
339
340 /*
341 +-------------------------------------------------------------------+
342 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
343 | ROUTINE : psaSIM_ChangePIN |
344 +-------------------------------------------------------------------+
345
346 PURPOSE : change a PIN
347
348 */
349
350 GLOBAL SHORT psaSIM_ChangePIN ( void )
351 {
352 T_SIM_SET_PRM * pPrmSet; /* points to used parameter set */
353
354 TRACE_FUNCTION ("psaSIM_ChangePIN()");
355
356 /*
357 *-------------------------------------------------------------------
358 * check owner id
359 *-------------------------------------------------------------------
360 */
361 if(!psa_IsVldOwnId(simShrdPrm.owner))
362
363 return( -1 );
364
365 pPrmSet = &simShrdPrm.setPrm[simShrdPrm.owner];
366
367 /*
368 *-------------------------------------------------------------------
369 * create and send primitive
370 *-------------------------------------------------------------------
371 */
372 {
373 PALLOC (sim_change_pin_req, SIM_CHANGE_PIN_REQ);
374
375 /* fill in primitive parameter: change PIN request */
376 sim_change_pin_req -> source = SRC_MMI;
377 sim_change_pin_req -> pin_id = pPrmSet -> PINType;
378 memcpy( sim_change_pin_req -> old_pin, pPrmSet -> curPIN, PIN_LEN );
379 memcpy( sim_change_pin_req -> new_pin, pPrmSet -> newPIN, PIN_LEN );
380
381 PSENDX (SIM, sim_change_pin_req);
382 }
383
384 return 0;
385 }
386
387
388 /*
389 +-------------------------------------------------------------------+
390 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
391 | ROUTINE : psaSIM_DisablePIN |
392 +-------------------------------------------------------------------+
393
394 PURPOSE : disable a PIN
395
396 */
397
398 GLOBAL SHORT psaSIM_DisablePIN ( void )
399 {
400 T_SIM_SET_PRM * pPrmSet; /* points to used parameter set */
401
402 TRACE_FUNCTION ("psaSIM_DisablePIN()");
403
404 /*
405 *-------------------------------------------------------------------
406 * check owner id
407 *-------------------------------------------------------------------
408 */
409 if(!psa_IsVldOwnId(simShrdPrm.owner))
410
411 return( -1 );
412
413 pPrmSet = &simShrdPrm.setPrm[simShrdPrm.owner];
414
415 /*
416 *-------------------------------------------------------------------
417 * create and send primitive
418 *-------------------------------------------------------------------
419 */
420 {
421 PALLOC (sim_disable_pin_req, SIM_DISABLE_PIN_REQ);
422
423 /* fill in primitive parameter: disable PIN request */
424 sim_disable_pin_req -> source = SRC_MMI;
425 memcpy( sim_disable_pin_req -> pin, pPrmSet -> curPIN, PIN_LEN );
426
427 PSENDX (SIM, sim_disable_pin_req);
428 }
429
430 return 0;
431 }
432
433 /*
434 +-------------------------------------------------------------------+
435 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
436 | ROUTINE : psaSIM_EnablePIN |
437 +-------------------------------------------------------------------+
438
439 PURPOSE : enable a PIN
440
441 */
442
443 GLOBAL SHORT psaSIM_EnablePIN ( void )
444 {
445 T_SIM_SET_PRM * pPrmSet; /* points to used parameter set */
446
447 TRACE_FUNCTION ("psaSIM_EnablePIN()");
448
449 /*
450 *-------------------------------------------------------------------
451 * check owner id
452 *-------------------------------------------------------------------
453 */
454 if(!psa_IsVldOwnId(simShrdPrm.owner))
455
456 return( -1 );
457
458 pPrmSet = &simShrdPrm.setPrm[simShrdPrm.owner];
459
460 /*
461 *-------------------------------------------------------------------
462 * create and send primitive
463 *-------------------------------------------------------------------
464 */
465 {
466 PALLOC (sim_enable_pin_req, SIM_ENABLE_PIN_REQ);
467
468 /* fill in primitive parameter: enable PIN request */
469 sim_enable_pin_req -> source = SRC_MMI;
470 memcpy( sim_enable_pin_req -> pin, pPrmSet -> curPIN, PIN_LEN );
471
472 PSENDX (SIM, sim_enable_pin_req);
473 }
474
475 return 0;
476 }
477
478 /*
479 +-------------------------------------------------------------------+
480 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
481 | ROUTINE : psaSIM_UnblockCard |
482 +-------------------------------------------------------------------+
483
484 PURPOSE : unblock the card
485
486 */
487
488 GLOBAL SHORT psaSIM_UnblockCard ( void )
489 {
490 T_SIM_SET_PRM * pPrmSet; /* points to used parameter set */
491
492 TRACE_FUNCTION ("psaSIM_UnblockCard()");
493
494 /*
495 *-------------------------------------------------------------------
496 * check owner id
497 *-------------------------------------------------------------------
498 */
499 if(!psa_IsVldOwnId(simShrdPrm.owner))
500
501 return( -1 );
502
503 pPrmSet = &simShrdPrm.setPrm[simShrdPrm.owner];
504
505 /*
506 *-------------------------------------------------------------------
507 * create and send primitive
508 *-------------------------------------------------------------------
509 */
510 {
511 PALLOC (sim_unblock_req, SIM_UNBLOCK_REQ);
512
513 /* fill in primitive parameter: unblock card request */
514 sim_unblock_req -> source = SRC_MMI;
515 sim_unblock_req -> pin_id = pPrmSet -> PINType;
516 memcpy( sim_unblock_req -> pin, pPrmSet -> curPIN, PIN_LEN );
517 memcpy( sim_unblock_req -> unblock_key, pPrmSet -> unblkKey, PUK_LEN );
518
519 PSENDX (SIM, sim_unblock_req);
520 }
521
522 return 0;
523 }
524
525 /*
526 +-------------------------------------------------------------------+
527 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
528 | ROUTINE : psaSIM_SyncSIM |
529 +-------------------------------------------------------------------+
530
531 PURPOSE : synchronize SIM data
532
533 */
534
535 GLOBAL void psaSIM_SyncSIM ( void )
536 {
537 TRACE_FUNCTION ("psaSIM_SyncSIM()");
538
539 /* create and send primitive */
540 {
541 PALLOC (sim_sync_req, SIM_SYNC_REQ);
542
543 /* fill in primitive parameter: synchronize request */
544
545 sim_sync_req -> synccs = simShrdPrm.synCs;
546
547 PSENDX (SIM, sim_sync_req);
548 }
549 }
550
551 /*
552 +-------------------------------------------------------------------+
553 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
554 | ROUTINE : psaSIM_ActivateSIM |
555 +-------------------------------------------------------------------+
556
557 PURPOSE : synchronize SIM data
558
559 */
560
561 GLOBAL SHORT psaSIM_ActivateSIM ( void )
562 {
563 T_SIM_SET_PRM * pPrmSet; /* points to used parameter set */
564
565 TRACE_FUNCTION ("psaSIM_ActivateSIM()");
566
567 /*
568 *-------------------------------------------------------------------
569 * check owner id
570 *-------------------------------------------------------------------
571 */
572 if(!psa_IsVldOwnId(simShrdPrm.owner))
573 {
574 TRACE_EVENT("not a valid owner !!");
575 return( -1 );
576 }
577
578 pPrmSet = &simShrdPrm.setPrm[simShrdPrm.owner];
579
580 /*
581 *-------------------------------------------------------------------
582 * create and send primitive
583 *-------------------------------------------------------------------
584 */
585 {
586 PALLOC (sim_activate_req, SIM_ACTIVATE_REQ);
587
588 /* fill in primitive parameter: activate request */
589 sim_activate_req->proc = pPrmSet -> actProc;
590
591 /* sim toolkit profile */
592 memcpy( sim_activate_req->stk_pro_file, pPrmSet -> STKprof,
593 MAX_STK_PRF );
594 sim_activate_req->mmi_pro_file = 0xE0; /*enable all*/
595
596 #ifdef TI_PS_FF_AT_P_CMD_CUST
597 if (pPrmSet -> actProc EQ SIM_INITIALISATION)
598 {
599 if (psaSIM_hasCustModeBeenSet() == FALSE)
600 {
601 /*
602 ** Customisation Mode is to be global, applying to ALL ACI channels
603 */
604 simShrdPrm.overall_cust_mode = pPrmSet->cust_mode;
605 Cust_Mode_Set = TRUE;
606 }
607
608 sim_activate_req->cust_mode = simShrdPrm.overall_cust_mode;
609 }
610 else
611 {
612 /*
613 ** If this isn't SIM_INITIALISATION then the cust_mode will have no relevance, but it should
614 ** still not be left uninitialised.
615 */
616 sim_activate_req->cust_mode = (psaSIM_hasCustModeBeenSet() == FALSE) ?
617 (UBYTE)CUST_NORMAL_BEHAVIOUR: simShrdPrm.overall_cust_mode;
618 }
619 #else
620 sim_activate_req->cust_mode = (UBYTE)CUST_NORMAL_BEHAVIOUR;
621 #endif /* TI_PS_FF_AT_P_CMD_CUST */
622
623 if(sim_activate_req->proc EQ SIM_INITIALISATION)
624 {
625 sim_activate_req->v_trmst_file = 0x01;
626 TRACE_EVENT("Read Terminal Support table from FFS");
627 #ifndef _SIMULATION_
628 if(FFS_fread("/gsm/osf/ftrsprt", &sim_activate_req->trmst_file, MAX_TRMST) NEQ MAX_TRMST)
629 #endif /* _SIMULATION_ */
630 {
631 memset(&sim_activate_req->trmst_file, 0, MAX_TRMST);
632 }
633 }
634
635 PSENDX (SIM, sim_activate_req);
636 }
637
638 return 0;
639 }
640
641 /*
642 +-------------------------------------------------------------------+
643 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
644 | ROUTINE : psaSIM_TrnsSIMAccess |
645 +-------------------------------------------------------------------+
646
647 PURPOSE : transparent access to SIM data
648
649 */
650
651 GLOBAL SHORT psaSIM_TrnsSIMAccess ( T_SIM_TRNS_ACC_PRM * prm )
652 {
653
654 TRACE_FUNCTION ("psaSIM_TrnsSIMAccess()");
655
656 /*
657 *-------------------------------------------------------------------
658 * create and send primitive
659 *-------------------------------------------------------------------
660 */
661 {
662 PALLOC (sim_access_req, SIM_ACCESS_REQ);
663
664 /* fill in primitive parameter: SIM access request */
665 sim_access_req -> source = SRC_MMI;
666 sim_access_req -> sim_command = prm -> cmd;
667
668 if (prm->cmd NEQ SIM_TRANSP_CMD)
669 {
670 sim_access_req -> datafield = prm -> reqDataFld;
671 sim_access_req -> p1 = prm -> p1;
672 sim_access_req -> p2 = prm -> p2;
673 sim_access_req -> p3 = prm -> p3;
674 }
675
676 sim_access_req->c_trans_data = prm -> dataLen;
677 memcpy( sim_access_req -> trans_data, prm -> transData,
678 prm -> dataLen );
679
680 PSENDX (SIM, sim_access_req);
681 }
682
683 return 0;
684 }
685
686 /*
687 +-------------------------------------------------------------------+
688 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
689 | ROUTINE : psaSIM_Bpi_Req |
690 +-------------------------------------------------------------------+
691
692 PURPOSE : resume/suspend/connect/disconnect SAT BIP connection.
693 */
694 #if defined (FF_SAT_E) AND defined (DTI)
695 GLOBAL void psaSIM_Bip_Req ( void )
696 {
697 T_SAT_CSD_PRM * csd_prm_ptr;
698
699 TRACE_EVENT("psaSIM_Bip_Req()");
700
701 if (simShrdPrm.sim_dti_chPrm EQ NULL)
702 {
703 TRACE_ERROR ("ERROR: simShrdPrm.sim_dti_chPrm uninitalized, aborting!");
704 }
705 else
706 {
707 PALLOC(sim_bip_req,SIM_BIP_REQ);
708 memset(sim_bip_req,0,sizeof(sim_bip_req));
709
710 /* copy connection qualifier */
711 sim_bip_req->bip_conn = simShrdPrm.sim_dti_chPrm->sat_chn_prm.bipConn;
712 /* copy channel id */
713 sim_bip_req->bip_ch_id = simShrdPrm.sim_dti_chPrm->sat_chn_prm.chnId;
714 /* copy general result */
715 sim_bip_req->general_result = simShrdPrm.sim_dti_chPrm->sat_chn_prm.genRes;
716 /* copy additional result info */
717 sim_bip_req->add_info_result = simShrdPrm.sim_dti_chPrm->sat_chn_prm.addRes;
718
719 /* copy release timer to primitive, if CSD and if duration defined */
720 /* SAT_E_PATCH: Should be ported to SIM_BIP_CONFIG_REQ? */
721 if(satShrdPrm.opchType EQ B_CSD)
722 {
723 csd_prm_ptr = (T_SAT_CSD_PRM *)(satShrdPrm.opchPrm);
724 if(csd_prm_ptr NEQ NULL)
725 {
726 if(csd_prm_ptr->v_dur2)
727 {
728 switch(csd_prm_ptr->dur2.time_unit)
729 {
730 case TU_100_MSEC:
731 sim_bip_req->release_time = (U32)csd_prm_ptr->dur2.time_ivl;
732 break;
733 case TU_MIN:
734 sim_bip_req->release_time = (U32)(csd_prm_ptr->dur2.time_ivl * 600);
735 break;
736 case TU_SEC:
737 sim_bip_req->release_time = (U32)(csd_prm_ptr->dur2.time_ivl * 10);
738 break;
739 } /* end switch */
740 } /* end if */
741 } /* end if csd_prm_ptr NEQ NULL */
742 } /* end if */
743
744 /* SEND SIM_BIP_REQ */
745 PSENDX(SIM,sim_bip_req);
746 } /* end else*/
747
748 }
749
750 /*
751 +-------------------------------------------------------------------+
752 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
753 | ROUTINE : psaSIM_Bip_Config_Req |
754 +-------------------------------------------------------------------+
755
756 PURPOSE : sends the BIP channel parameters to SIM. The type of
757 parameters depends on the transport unit.
758 */
759
760 GLOBAL void psaSIM_Bip_Config_Req ( )
761 {
762 T_SAT_CSD_PRM * csd_prm_ptr; /* holds pointer to CSD open channel prms */
763 T_SAT_GPRS_PRM * gprs_prm_ptr; /* holds pointer to GPRS open channel prms */
764
765 /* allocate SIM_BIP_CONFIG_REQ primitive */
766 PALLOC(sim_bip_config_req,SIM_BIP_CONFIG_REQ);
767
768 TRACE_EVENT("psaSIM_Bip_Config_Req()");
769
770 /* reset values of primitive */
771 memset(sim_bip_config_req,0,sizeof(sim_bip_config_req));
772 /* check kind of bearer */
773 if(satShrdPrm.opchType EQ B_CSD)
774 {
775 /* BEARER: CSD */
776
777 /* get connection type */
778 switch(simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiUnit)
779 {
780 case DTI_ENTITY_UDP:
781 sim_bip_config_req->con_type = SIM_CON_TYPE_UDP;
782 break;
783 #ifdef UART
784 case DTI_ENTITY_TRA:
785 sim_bip_config_req->con_type = SIM_CON_TYPE_SERIAL;
786 break;
787 case DTI_ENTITY_L2R:
788 sim_bip_config_req->con_type = SIM_CON_TYPE_SERIAL;
789 break;
790 #endif
791 }
792
793 /* get addresses */
794 /* local_ip,destination_ip, destination port are only valid for UDP */
795 if(simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiUnit EQ DTI_ENTITY_UDP)
796 {
797 csd_prm_ptr = (T_SAT_CSD_PRM *)(satShrdPrm.opchPrm);
798 if(csd_prm_ptr->v_other_addr)
799 {
800 if(csd_prm_ptr->other_addr.oth_addr_type EQ IPv4)
801 {
802 if(csd_prm_ptr->other_addr.v_ipv4_addr)/* local IP address */
803 {
804 memcpy(&sim_bip_config_req->local_ip,
805 &csd_prm_ptr->other_addr.ipv4_addr,
806 sizeof(csd_prm_ptr->other_addr.ipv4_addr));
807 }
808 else /* not valid */
809 {
810 sim_bip_config_req->local_ip = SIM_IP_LOCAL_DYNAMIC;
811 }
812 }
813 else /* not supported IPv6*/
814 {
815 sim_bip_config_req->local_ip = SIM_IP_LOCAL_DYNAMIC;
816 }
817 }
818 else
819 {
820 sim_bip_config_req->local_ip = SIM_IP_LOCAL_DYNAMIC;
821 }
822
823 /* data destination address */
824 if(csd_prm_ptr->v_dda)
825 {
826 if(csd_prm_ptr->dda.oth_addr_type EQ IPv4)
827 {
828 if(csd_prm_ptr->dda.v_ipv4_addr)/* local IP address */
829 {
830 memcpy(&sim_bip_config_req->destination_ip,
831 &csd_prm_ptr->dda.ipv4_addr,
832 sizeof(csd_prm_ptr->dda.ipv4_addr));
833 }
834 }
835
836 /* SIM/ME interface transport level:destination port number for UDP */
837 if(csd_prm_ptr->v_itl)
838 {
839 sim_bip_config_req->destination_port = csd_prm_ptr->itl.port_number;
840 }
841 }
842 }
843 }
844 else if (satShrdPrm.opchType EQ B_GPRS)
845 {
846 /* BEARER: GPRS */
847 #ifdef GPRS
848 /* get connecton type */
849 switch(simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiUnit)
850 {
851 case DTI_ENTITY_UDP:
852 sim_bip_config_req->con_type = SIM_CON_TYPE_UDP;
853 break;
854 case DTI_ENTITY_SNDCP:
855 sim_bip_config_req->con_type = SIM_CON_TYPE_IP;
856 break;
857 }
858
859 /* get port and addresses */
860 gprs_prm_ptr = (T_SAT_GPRS_PRM *)(satShrdPrm.opchPrm);
861 if(gprs_prm_ptr NEQ NULL)
862 {
863 /* local_ip,destination_ip, destination port are only valid for UDP */
864 if(simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiUnit EQ DTI_ENTITY_UDP)
865 {
866 /* get local ip address */
867 if(gprs_prm_ptr->v_other_addr)
868 {
869 if(gprs_prm_ptr->other_addr.oth_addr_type EQ IPv4)
870 {
871 if(gprs_prm_ptr->other_addr.v_ipv4_addr)/* local IP address */
872 {
873 memcpy(&sim_bip_config_req->local_ip,
874 &gprs_prm_ptr->other_addr.ipv4_addr,
875 sizeof(gprs_prm_ptr->other_addr.ipv4_addr));
876 }
877 else /* not valid */
878 {
879 sim_bip_config_req->local_ip = SIM_IP_LOCAL_DYNAMIC;
880 }
881 }
882 else /* not supported IPv6*/
883 {
884 sim_bip_config_req->local_ip = SIM_IP_LOCAL_DYNAMIC;
885 }
886 }
887 else /* not valid flag for other address */
888 {
889 /*
890 * local IP4 address has been provided by Session Management; it was not provided by the OPEN CHANNEL command
891 */
892 if(tcpipShrdPrm.ipaddr)
893 {
894 sim_bip_config_req->local_ip = psaTCPIP_bytes2ipv4addr(tcpipShrdPrm.ipaddr);
895 }
896 else
897 {
898 sim_bip_config_req->local_ip = SIM_IP_LOCAL_DYNAMIC;
899 }
900 }
901
902 /* get data destination address */
903 if(gprs_prm_ptr->v_dda)
904 {
905 if(gprs_prm_ptr->dda.oth_addr_type EQ IPv4)
906 {
907 if(gprs_prm_ptr->dda.v_ipv4_addr)/* local IP address */
908 {
909 memcpy(&sim_bip_config_req->destination_ip,
910 &gprs_prm_ptr->dda.ipv4_addr,
911 sizeof(gprs_prm_ptr->dda.ipv4_addr));
912 }
913 }
914 }
915
916 /* get SIM/ME interface transport level:destination port number for UDP */
917 if(gprs_prm_ptr->v_itl)
918 {
919 sim_bip_config_req->destination_port = gprs_prm_ptr->itl.port_number;
920 }
921 }
922 }
923
924 #else /* GPRS */
925 PFREE(sim_bip_config_req);
926 TRACE_ERROR("psaSIM_Bip_Config_Req(): ERROR stack does not support GPRS");
927 #endif /* GPRS */
928 }
929 else /* BEARER: unknown */
930 {
931 TRACE_ERROR("psaSIM_Bip_Config_Req(): ERROR unkown bearer");
932 }
933 /* send primitive to SIM */
934 PSENDX(SIM,sim_bip_config_req);
935 }
936
937 /*
938 +-------------------------------------------------------------------+
939 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
940 | ROUTINE : psaSIM_Dti_Req |
941 +-------------------------------------------------------------------+
942
943 PURPOSE : connection SIM with UDP,TRA or L2R in context CSD
944 connection SIM with UDP or SNDCP in context GPRS
945 request by proactive SIM CARD, set feature SAT CLASS e
946 sent parameter depends on kind of connection (dtiConn)
947
948 This function sends the primitive SIM_DTI_REQ which is
949 only responsible for the establishment of the SIM DTI
950 channel!
951 */
952 GLOBAL void psaSIM_Dti_Req ( ULONG link_id )
953 {
954 #ifdef DTI
955 CHAR *p_ent_name=NULL; /* hold peer name */
956
957 TRACE_EVENT("psaSIM_Dti_Req");
958
959 if (simShrdPrm.sim_dti_chPrm EQ NULL)
960 {
961 /* when disconnecting if previos state connecting;
962 * will otherwise crash the stack in ACISAT473H */
963 TRACE_ERROR ("simShrdPrm.sim_dti_chPrm uninitalized, aborting!");
964 }
965 else
966 {
967 /* alloc primitive */
968 PALLOC(sim_dti_req,SIM_DTI_REQ);
969 /* reset values */
970 memset(sim_dti_req,0,sizeof(sim_dti_req));
971 /* copy dti connection qualifier */
972 sim_dti_req->dti_conn = simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiConn;
973 /* set dti direction */
974 sim_dti_req->dti_direction = SIM_DTI_INVERTED;
975
976 if( simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiConn EQ SIM_DTI_CONNECT )
977 {
978 /* CASE: CONNECT IMMEDIATELY */
979 /* copy link id */
980 sim_dti_req->link_id = link_id;
981
982 if(satShrdPrm.opchType EQ B_CSD)
983 {
984 /* BEARER: CSD */
985 /* copy entity_name
986 * handle different transport protocols: L2R, RA and UDP */
987 switch(simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiUnit)
988 {
989 case DTI_ENTITY_UDP:
990 p_ent_name = &UDP_NAME[0];
991 break;
992 case DTI_ENTITY_TRA:
993 p_ent_name = &TRA_NAME[0];
994 break;
995 case DTI_ENTITY_L2R:
996 p_ent_name = &L2R_NAME[0];
997 break;
998 }
999 sim_dti_req->entity_name = (ULONG)p_ent_name;
1000 }
1001 #ifdef GPRS
1002 else if(satShrdPrm.opchType EQ B_GPRS)
1003 {
1004 /* BEARER: GPRS */
1005 /* copy entity_name
1006 * handle different transport protocols: L2R, RA and UDP */
1007 switch(simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiUnit)
1008 {
1009 case DTI_ENTITY_UDP:
1010 p_ent_name = &UDP_NAME[0];
1011 break;
1012 case DTI_ENTITY_SNDCP:
1013 p_ent_name = &SNDCP_NAME[0];
1014 break;
1015 }
1016 sim_dti_req->entity_name = (ULONG)p_ent_name;
1017 }
1018 #endif /* GPRS */
1019 else
1020 {
1021 TRACE_EVENT("psaSIM_Dti_Req:error");
1022 }
1023
1024 PSENDX(SIM,sim_dti_req);
1025 } /* end DTI open channel */
1026
1027 else if ( simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiConn EQ SIM_DTI_DISCONNECT )
1028 {
1029 /* CASE: CLOSE DTI CHANNEL */
1030 /* copy link id */
1031 sim_dti_req->link_id = link_id;
1032
1033 PSENDX(SIM,sim_dti_req);
1034 }
1035
1036 else if ( simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiConn EQ SIM_DTI_UNKNOWN)
1037 {
1038 /* no primitive has to be send, free mem */
1039 PFREE(sim_dti_req);
1040
1041 /* check whether a BIP channel has to be closed */
1042 if( simShrdPrm.sim_dti_chPrm->sat_chn_prm.bipConn
1043 EQ SIM_BIP_CLOSE_CHANNEL )
1044 {
1045 /* No action has to be performed, DTI channel already disconnected by
1046 * SIM */
1047 TRACE_EVENT("psaSIM_Dti_Req: SIM-DTI channel already disconnected");
1048
1049 /* inform dti manager about successfull disconnection */
1050
1051 TRACE_EVENT("psaSIM_Dti_Req: close open BIP channel");
1052 /* send SIM_BIP_REQ to close BIP channel */
1053 psaSIM_Bip_Req();
1054 }
1055 else
1056 {
1057 TRACE_ERROR("psaSIM_Dti_Req: ERROR: Unkown parameter combination");
1058 }
1059 }
1060 else
1061 {
1062 /* no primitive has to be send, free mem */
1063 PFREE(sim_dti_req);
1064
1065 TRACE_ERROR("psaSIM_Dti_Req: ERROR: Unkown parameter");
1066 }
1067 }
1068 #endif
1069 }
1070
1071 /*
1072 +-------------------------------------------------------------------+
1073 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
1074 | ROUTINE : psaSIM_SATBIPChn |
1075 +-------------------------------------------------------------------+
1076
1077 PURPOSE : connect/disconnect/suspend/resume of BIP
1078 (Bearer Independent Protocol) connection for SAT
1079 (new for SAT_E_PATCH)
1080 */
1081
1082 GLOBAL void psaSIM_SATBIPChn ( T_SIM_SAT_CHN chnInf,
1083 void (*cb)(UBYTE bipConn, UBYTE chnId))
1084 {
1085 TRACE_EVENT("psaSIM_SATBIPChn()");
1086
1087 #ifdef UART
1088
1089 /* ALLOC shared paramenters for BIP if not yet done */
1090 if(!simShrdPrm.sim_dti_chPrm)
1091 {
1092 ACI_MALLOC(simShrdPrm.sim_dti_chPrm,sizeof(T_SIM_DTI_CH_PRM));
1093 /* reset parameters */
1094 memset(simShrdPrm.sim_dti_chPrm,0,sizeof(T_SIM_DTI_CH_PRM));
1095 TRACE_EVENT("ALLOC sim_dti_chPrm");
1096 }
1097
1098 /* copy bip related parameters */
1099 simShrdPrm.sim_dti_chPrm->sat_chn_prm.bipConn = chnInf.bipConn;
1100 simShrdPrm.sim_dti_chPrm->sat_chn_prm.dtiConn = chnInf.dtiConn;
1101 simShrdPrm.sim_dti_chPrm->sat_chn_prm.chnId = chnInf.chnId;
1102 simShrdPrm.sim_dti_chPrm->sat_chn_prm.genRes = chnInf.genRes;
1103 simShrdPrm.sim_dti_chPrm->sat_chn_prm.addRes = chnInf.addRes;
1104 /* callback to process after of BIP connection request */
1105 simShrdPrm.sim_dti_chPrm->bip_cb = cb;
1106
1107 switch( chnInf.bipConn )
1108 {
1109 case SIM_BIP_CLOSE_CHANNEL:
1110
1111 if(chnInf.dtiConn EQ SIM_DTI_DISCONNECT)
1112 {
1113 cmhSAT_OpChnClose( chnInf.bipConn, 1 );
1114 }
1115 else
1116 {
1117 if (dti_cntrl_is_dti_channel_connected (DTI_ENTITY_SIM, simShrdPrm.sat_class_e_dti_id) EQ TRUE)
1118 {
1119 /* SIM entity has disconnected the dti connection via SIM_DTI_BIP_IND */
1120 if (dti_cntrl_is_dti_channel_connected (DTI_ENTITY_UDP, simShrdPrm.sat_class_e_dti_id) EQ TRUE)
1121 cmhSAT_OpChnClose( chnInf.bipConn, 1 );
1122 else
1123 dti_cntrl_close_dpath_from_dti_id(simShrdPrm.sat_class_e_dti_id);
1124 }
1125 else
1126 {
1127 /* up to now there was not a dti connection with SIM entity */
1128 psaSIM_Bip_Req();
1129 }
1130 }
1131 break;
1132 case SIM_BIP_OPEN_CHANNEL:
1133 case SIM_BIP_CHANNEL_SUSPENDED:
1134 case SIM_BIP_CHANNEL_RESUMED:
1135 psaSIM_Bip_Req();
1136 break;
1137 default:
1138 TRACE_ERROR("ERROR: psaSIM_SATBIPChn() unknown BIP status");
1139 } /* end of switch */
1140
1141 /* old behavior: test */
1142 #endif /* UART */
1143 }
1144
1145 /*
1146 +-------------------------------------------------------------------+
1147 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
1148 | ROUTINE : psaSIM_SATChn |
1149 +-------------------------------------------------------------------+
1150
1151 PURPOSE : start of DTI connection SIM - UDP,L2R,SNDCP,TRA for CSD
1152 /GPRS
1153
1154 SAT E Design: Now only used for SIM DTI connections to SNDCP, L2R and TRA
1155
1156 */
1157 #ifdef DTI
1158 GLOBAL void psaSIM_SATChn ( T_SIM_SAT_CHN chnInf,
1159 void (*cb)(UBYTE dtiConn, UBYTE chnId))
1160 {
1161 #ifdef GPRS
1162 U8 cid_array[2] = { 0,PDP_CONTEXT_CID_INVALID };
1163 cid_array[0] = satShrdPrm.chnTb.chnRefId;
1164 #endif
1165
1166 TRACE_EVENT("psaSIM_SATChn");
1167
1168 if(!simShrdPrm.sim_dti_chPrm)
1169 {
1170 ACI_MALLOC(simShrdPrm.sim_dti_chPrm,sizeof(T_SIM_DTI_CH_PRM));
1171 TRACE_EVENT("ALLOC sim_dti_chPrm");
1172 }
1173 memcpy(&simShrdPrm.sim_dti_chPrm->sat_chn_prm,&chnInf,sizeof(T_SIM_SAT_CHN));
1174 simShrdPrm.sim_dti_chPrm->dti_cb = cb;/* callback for results of DTI connection -> SatSource */
1175
1176 if( chnInf.dtiConn EQ SIM_DTI_CONNECT )
1177 {
1178 if(psa_search_SATSrcId() >= 0)
1179 {
1180 T_DTI_ENTITY_ID entity_list[2];
1181 entity_list[0]= DTI_ENTITY_SIM;
1182 entity_list[1]= (T_DTI_ENTITY_ID)chnInf.dtiUnit;
1183
1184 if(satShrdPrm.opchType EQ B_CSD)
1185 {/* case immediately connection of SIM entity with L2R or TRA */
1186 /* case on demand connection of SIM entity with L2R or TRA */
1187
1188 /* create a SAT class E DTI ID if not present */
1189 if ( simShrdPrm.sat_class_e_dti_id EQ DTI_DTI_ID_NOTPRESENT )
1190 {
1191 simShrdPrm.sat_class_e_dti_id = dti_cntrl_new_dti(DTI_DTI_ID_NOTPRESENT);
1192 TRACE_EVENT_P1("sat_class_e_dti_id = %d", simShrdPrm.sat_class_e_dti_id);
1193 }
1194
1195 /* establish SIM-L2R or SIM-TRA DTI connection */
1196 dti_cntrl_est_dpath( simShrdPrm.sat_class_e_dti_id,
1197 entity_list,
1198 2,
1199 APPEND,
1200 SIM_ENT_CSDconnect_dti_cb);
1201 }
1202 #ifdef GPRS
1203 else if(satShrdPrm.opchType EQ B_GPRS)
1204 {/* case immediately: open and connect bip channel with help of DTI connection between SIM entity and UDP or SNDCP */
1205 /* case on demand: connect bip channel with help of DTI connection between SIM entity and UDP or SNDCP */
1206
1207 /* create a SAT class E DTI ID if not present */
1208 if ( simShrdPrm.sat_class_e_dti_id EQ DTI_DTI_ID_NOTPRESENT )
1209 {
1210 simShrdPrm.sat_class_e_dti_id = dti_cntrl_new_dti(DTI_DTI_ID_NOTPRESENT);
1211 TRACE_EVENT_P1("sat_class_e_dti_id = %d", simShrdPrm.sat_class_e_dti_id);
1212 }
1213
1214 if(chnInf.dtiUnit NEQ DTI_ENTITY_SNDCP)
1215 {
1216 dti_cntrl_est_dpath( simShrdPrm.sat_class_e_dti_id,
1217 entity_list,
1218 2,
1219 APPEND,
1220 SIM_ENT_GPRSconnect_dti_cb);
1221 }
1222 else
1223 {
1224 if(!srcc_reserve_sources( SRCC_SIM_SNDCP_LINK, satShrdPrm.chnTb.chnRefId) OR
1225 !cmhSM_make_active_cid_list((T_ACI_CMD_SRC)satShrdPrm.opchAcptSrc, cid_array) )
1226 {
1227 TRACE_FUNCTION("psaSIM_SATChn: Error cid list ");
1228 }
1229 else
1230 {
1231 set_conn_param_on_working_cid( (UBYTE)smEntStat.entOwn, DTI_ENTITY_SIM );
1232 cmhSM_connect_working_cid();
1233 }
1234 }
1235 }
1236 #endif
1237 }
1238 else
1239 {
1240 TRACE_ERROR("psaSIM_SATChn: fatal ERROR: SAT source id invalid!");
1241 }
1242 }
1243 }
1244 #endif /* DTI */
1245
1246 /*
1247 +-------------------------------------------------------------------+
1248 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
1249 | ROUTINE : psaSIM_EvDatAvail |
1250 +-------------------------------------------------------------------+
1251
1252 PURPOSE : processes the SIM_EVENTLIST_REQ primitive to SIM.
1253 MMI informs about a change of the status of the
1254 Data available event (because it is part of the SAT event list)
1255 */
1256
1257 GLOBAL void psaSIM_EvDatAvail ( BOOL evStat )
1258 {
1259 TRACE_EVENT("psaSIM_EvDatAvail");
1260 {
1261 PALLOC(sim_eventlist_req,SIM_EVENTLIST_REQ);
1262 switch(evStat)
1263 {
1264 case SIM_EVENT_DISABLE:
1265 case SIM_EVENT_ENABLE:
1266 sim_eventlist_req->event_data_avail = evStat;
1267 break;
1268 default:
1269 TRACE_EVENT("psaSIM_EvDatAvail:not valid evStat");
1270 break;
1271 }
1272 PSENDX(SIM,sim_eventlist_req);
1273 }
1274 }
1275
1276 #endif /* #ifdef FF_SAT_E */
1277
1278 #ifdef FF_DUAL_SIM
1279 /*
1280 +-------------------------------------------------------------------+
1281 | PROJECT : GSM-PS (6147) MODULE : PSA_SIMS |
1282 | ROUTINE : psaSIM_SelectSIM |
1283 +-------------------------------------------------------------------+
1284
1285 PURPOSE : processes the SIM_ACTIVATE_REQ primitive to SIM to Select the required SIM
1286 */
1287 GLOBAL SHORT psaSIM_SelectSIM ( void )
1288 {
1289 T_SIM_SET_PRM * pPrmSet; /* points to used parameter set */
1290
1291 TRACE_FUNCTION ("psaSIM_SelectSIM()");
1292
1293 /*
1294 *-------------------------------------------------------------------
1295 * check owner id
1296 *-------------------------------------------------------------------
1297 */
1298 if(!psa_IsVldOwnId(simShrdPrm.owner))
1299 {
1300 TRACE_EVENT("not a valid owner !!");
1301 return( -1 );
1302 }
1303
1304 pPrmSet = &simShrdPrm.setPrm[simShrdPrm.owner];
1305 simShrdPrm.SIM_Selection = TRUE;
1306
1307 /*
1308 *-------------------------------------------------------------------
1309 * create and send primitive
1310 *-------------------------------------------------------------------
1311 */
1312 {
1313 PALLOC (sim_activate_req, SIM_ACTIVATE_REQ);
1314
1315 sim_activate_req->proc = SIM_SELECT;
1316 sim_activate_req->sim_num = pPrmSet->SIM_Selected;
1317
1318 PSENDX (SIM, sim_activate_req);
1319 }
1320 return 0;
1321 }
1322 #endif /*FF_DUAL_SIM*/
1323
1324
1325 /*==== EOF ========================================================*/
1326