comparison src/ui/mfw/mfw_cphs.c @ 188:92abb46dc1ba

src/ui/mfw/*.[ch]: rm trailing white space
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 19 Jan 2021 06:10:27 +0000
parents 67bfe9f274f6
children
comparison
equal deleted inserted replaced
187:a33dd8a5dcc9 188:92abb46dc1ba
8 8
9 MODULE : MFW_CPHS 9 MODULE : MFW_CPHS
10 10
11 PURPOSE : This modul contains CPHS management functions. 11 PURPOSE : This modul contains CPHS management functions.
12 12
13 13
14 $History:: mfw_cphs.c $ 14 $History:: mfw_cphs.c $
15 15
16 June 27,2007 OMAPS00134788 x0066814(Geetha) 16 June 27,2007 OMAPS00134788 x0066814(Geetha)
17 Description: EXT1 record not appende to CHPHS Voice Mail Number (6F17) though referenced 17 Description: EXT1 record not appende to CHPHS Voice Mail Number (6F17) though referenced
18 Solution: Added a function to read the EXT1 records for mailbox number. 18 Solution: Added a function to read the EXT1 records for mailbox number.
19 Added a condition in cphs_read_mbn() to check whether EXT1 is present. 19 Added a condition in cphs_read_mbn() to check whether EXT1 is present.
20 20
21 Nov 27, 2006 OMAPS00098359 a0393213(R.Prabakar) 21 Nov 27, 2006 OMAPS00098359 a0393213(R.Prabakar)
22 Description: CPHS 4.2 : Call Divert doesn't work properly for Line 2 22 Description: CPHS 4.2 : Call Divert doesn't work properly for Line 2
23 23
24 Oct 30 2006, OMAPS00098881 x0039928(sumanth) 24 Oct 30 2006, OMAPS00098881 x0039928(sumanth)
25 Removal of power variant 25 Removal of power variant
26 26
27 May 30, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar) 27 May 30, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar)
28 Description : CPHS Call Forwarding feature implementation 28 Description : CPHS Call Forwarding feature implementation
29 29
30 May 30, 2006 DR: OMAPS00070657 x0pleela 30 May 30, 2006 DR: OMAPS00070657 x0pleela
31 Description: CPHS feature on Locosto-Lite 31 Description: CPHS feature on Locosto-Lite
32 Solution: For ALS feature, 32 Solution: For ALS feature,
33 a) Added the definition for the new function "mfw_cphs_get_als_info()" 33 a) Added the definition for the new function "mfw_cphs_get_als_info()"
34 34
35 May 18, 2006 DR: OMAPS00070657 x0pleela 35 May 18, 2006 DR: OMAPS00070657 x0pleela
36 Description: CPHS feature on Locosto-Lite 36 Description: CPHS feature on Locosto-Lite
37 Solution: For VMWI feature, 37 Solution: For VMWI feature,
38 a) A new function "sendCPWIEvt" is defined to set the voice mail indication 38 a) A new function "sendCPWIEvt" is defined to set the voice mail indication
39 if there are any voice mails 39 if there are any voice mails
40 40
41 Jan 12, 2006 OMAPS00062632 x0018858 41 Jan 12, 2006 OMAPS00062632 x0018858
42 Description: The differnace in the type of the data passed to the function cphs_read_information() 42 Description: The differnace in the type of the data passed to the function cphs_read_information()
43 is causing an incorrect value being received as the output. 43 is causing an incorrect value being received as the output.
44 Solution: The errcode being passed to the function has been modified to USHORT 44 Solution: The errcode being passed to the function has been modified to USHORT
45 45
46 Mar 30, 2005 REF: CRR 29986 xpradipg 46 Mar 30, 2005 REF: CRR 29986 xpradipg
47 Description: Optimisation 1: Removal of unused variables and dynamically 47 Description: Optimisation 1: Removal of unused variables and dynamically
48 allocate/ deallocate mbndata 48 allocate/ deallocate mbndata
49 Solution: Static allocation of mbnData is replaced with dynamic allocation 49 Solution: Static allocation of mbnData is replaced with dynamic allocation
50 and deallocation 50 and deallocation
51 51
52 Aug 16, 2004 REF: CRR 24323 Deepa M.D 52 Aug 16, 2004 REF: CRR 24323 Deepa M.D
53 Bug:Clenup of sprintf used for tracing 53 Bug:Clenup of sprintf used for tracing
54 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX 54 Fix:Replace the char buf[]; sprintf (buf, "...", ...); TRACE_EVENT (buf); statements by TRACE_EVENT_PX
55 55
56 */ 56 */
134 #ifdef FF_CPHS_REL4 134 #ifdef FF_CPHS_REL4
135 static T_MFW_CPHS_MSP_INFO mspinfo; 135 static T_MFW_CPHS_MSP_INFO mspinfo;
136 T_MFW_CPHS_REL4_MWIS mwis_stat[4]; 136 T_MFW_CPHS_REL4_MWIS mwis_stat[4];
137 #endif 137 #endif
138 // Mar 30, 2005 REF: CRR 29986 xpradipg 138 // Mar 30, 2005 REF: CRR 29986 xpradipg
139 // the optimisation is placed under a flag, a pointer variable is defined 139 // the optimisation is placed under a flag, a pointer variable is defined
140 // instead of the static array, which is allocated and deallocated 140 // instead of the static array, which is allocated and deallocated
141 #ifdef FF_MMI_OPTIM 141 #ifdef FF_MMI_OPTIM
142 //x0pleela 14 June, 2006 DR: OMAPS00080549 142 //x0pleela 14 June, 2006 DR: OMAPS00080549
143 //changed the size of the Mail box number to avoid SIM write operation to overwrite other memory locations 143 //changed the size of the Mail box number to avoid SIM write operation to overwrite other memory locations
144 #ifdef FF_CPHS 144 #ifdef FF_CPHS
145 #if defined ( TI_PS_FFS_PHB) || defined(PHONEBOOK_EXTENSION) 145 #if defined ( TI_PS_FFS_PHB) || defined(PHONEBOOK_EXTENSION)
146 #define MAX_MAIL_BOX_NUMBER 120 146 #define MAX_MAIL_BOX_NUMBER 120
147 #else//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION 147 #else//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION
148 #define MAX_MAIL_BOX_NUMBER 120 148 #define MAX_MAIL_BOX_NUMBER 120
149 #endif//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION 149 #endif//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION
150 #else //FF_CPHS 150 #else //FF_CPHS
151 #define MAX_MAIL_BOX_NUMBER 120 151 #define MAX_MAIL_BOX_NUMBER 120
152 #endif //FF_CPHS 152 #endif //FF_CPHS
153 UBYTE *mbnData; 153 UBYTE *mbnData;
154 #else //FF_MMI_OPTIM 154 #else //FF_MMI_OPTIM
155 //x0pleela 14 June, 2006 DR: OMAPS00080549 155 //x0pleela 14 June, 2006 DR: OMAPS00080549
156 #ifdef FF_CPHS 156 #ifdef FF_CPHS
157 #if defined ( TI_PS_FFS_PHB) || defined(PHONEBOOK_EXTENSION) 157 #if defined ( TI_PS_FFS_PHB) || defined(PHONEBOOK_EXTENSION)
158 static UBYTE mbnData[120]; // it should be allocated dynamically. 158 static UBYTE mbnData[120]; // it should be allocated dynamically.
159 #else//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION 159 #else//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION
160 static UBYTE mbnData[120]; // it should be allocated dynamically. 160 static UBYTE mbnData[120]; // it should be allocated dynamically.
161 #endif//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION 161 #endif//TI_PS_FFS_PHB OR PHONEBOOK_EXTENSION
212 #define TRACE_EVENT_P2 FFS_log_message 212 #define TRACE_EVENT_P2 FFS_log_message
213 #define TRACE_EVENT_P3 FFS_log_message 213 #define TRACE_EVENT_P3 FFS_log_message
214 #define TRACE_EVENT_P4 FFS_log_message 214 #define TRACE_EVENT_P4 FFS_log_message
215 215
216 void FFS_log_message(char *LogMsg,...) 216 void FFS_log_message(char *LogMsg,...)
217 { 217 {
218 fd_t fd= -1; 218 fd_t fd= -1;
219 char log_ffs_buf[256]; 219 char log_ffs_buf[256];
220 va_list varpars; 220 va_list varpars;
221 va_start (varpars, LogMsg); 221 va_start (varpars, LogMsg);
222 vsprintf(log_ffs_buf,LogMsg,varpars); 222 vsprintf(log_ffs_buf,LogMsg,varpars);
223 va_end (varpars); 223 va_end (varpars);
224 fd = ffs_open((const char*)"/ffslog", FFS_O_APPEND | FFS_O_WRONLY ); 224 fd = ffs_open((const char*)"/ffslog", FFS_O_APPEND | FFS_O_WRONLY );
225 if(fd < 0) 225 if(fd < 0)
226 fd=ffs_open((const char*)"/ffslog", FFS_O_CREATE |FFS_O_WRONLY ); 226 fd=ffs_open((const char*)"/ffslog", FFS_O_CREATE |FFS_O_WRONLY );
227 if(fd > 0) 227 if(fd > 0)
228 { 228 {
229 strcat(log_ffs_buf, "\n"); 229 strcat(log_ffs_buf, "\n");
230 ffs_write(fd, log_ffs_buf, strlen(log_ffs_buf)); 230 ffs_write(fd, log_ffs_buf, strlen(log_ffs_buf));
231 ffs_close(fd); 231 ffs_close(fd);
232 } 232 }
233 } 233 }
234 234
235 #endif 235 #endif
236 236
237 237
238 /* 238 /*
239 +--------------------------------------------------------------------+ 239 +--------------------------------------------------------------------+
240 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | 240 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS |
241 | STATE : code ROUTINE: cphs_init | 241 | STATE : code ROUTINE: cphs_init |
296 cphs_para = (T_MFW_CPHS *) mfwAlloc(sizeof(T_MFW_CPHS)); 296 cphs_para = (T_MFW_CPHS *) mfwAlloc(sizeof(T_MFW_CPHS));
297 297
298 if (!hdr || !cphs_para) 298 if (!hdr || !cphs_para)
299 { 299 {
300 TRACE_ERROR("ERROR: cphs_create() Mem Alloc Failed."); 300 TRACE_ERROR("ERROR: cphs_create() Mem Alloc Failed.");
301 301
302 if(hdr) 302 if(hdr)
303 mfwFree((U8*)hdr,sizeof(MfwHdr)); 303 mfwFree((U8*)hdr,sizeof(MfwHdr));
304 304
305 if(cphs_para) 305 if(cphs_para)
306 mfwFree((U8*)cphs_para,sizeof(T_MFW_CPHS)); 306 mfwFree((U8*)cphs_para,sizeof(T_MFW_CPHS));
307 307
308 return FALSE; 308 return FALSE;
309 } 309 }
310 310
311 cphs_para->emask = event; 311 cphs_para->emask = event;
312 cphs_para->handler = cbfunc; 312 cphs_para->handler = cbfunc;
375 375
376 cphs_data = (T_MFW_CPHS *) cur_elem->data; 376 cphs_data = (T_MFW_CPHS *) cur_elem->data;
377 if (cphs_data->emask & event) 377 if (cphs_data->emask & event)
378 { 378 {
379 cphs_data->event = event; 379 cphs_data->event = event;
380 TRACE_EVENT_P1("cphs_sign_exec():event=%d",event); 380 TRACE_EVENT_P1("cphs_sign_exec():event=%d",event);
381 switch (event) 381 switch (event)
382 { 382 {
383 case E_CPHS_IND: 383 case E_CPHS_IND:
384 memcpy(&cphs_data->para.stat, para, sizeof(T_MFW_CPHS_STATUS)); 384 memcpy(&cphs_data->para.stat, para, sizeof(T_MFW_CPHS_STATUS));
385 break; 385 break;
386 case E_CPHS_OP_NAME: 386 case E_CPHS_OP_NAME:
387 memcpy(&cphs_data->para.oper_name, para, sizeof(T_MFW_CPHS_OP_NAME)); 387 memcpy(&cphs_data->para.oper_name, para, sizeof(T_MFW_CPHS_OP_NAME));
388 break; 388 break;
389 case E_CPHS_GET_VC_NUM: 389 case E_CPHS_GET_VC_NUM:
390 memcpy(&cphs_data->para.vc_entry, para, sizeof(T_MFW_CPHS_VC_NUM)); 390 memcpy(&cphs_data->para.vc_entry, para, sizeof(T_MFW_CPHS_VC_NUM));
391 break; 391 break;
392 case E_CPHS_SET_VC_NUM: 392 case E_CPHS_SET_VC_NUM:
393 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); 393 memcpy(&cphs_data->para.result, para, sizeof(UBYTE));
394 break; 394 break;
395 case E_CPHS_GET_VC_STAT: 395 case E_CPHS_GET_VC_STAT:
396 memcpy(&cphs_data->para.vc_status, para, sizeof(T_MFW_CPHS_VC_STAT)); 396 memcpy(&cphs_data->para.vc_status, para, sizeof(T_MFW_CPHS_VC_STAT));
397 break; 397 break;
398 case E_CPHS_SET_VC_STAT: 398 case E_CPHS_SET_VC_STAT:
399 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); 399 memcpy(&cphs_data->para.result, para, sizeof(UBYTE));
400 break; 400 break;
401 case E_CPHS_GET_DV_STAT: 401 case E_CPHS_GET_DV_STAT:
402 memcpy(&cphs_data->para.dv_status, para, sizeof(T_MFW_CPHS_DV_STAT)); 402 memcpy(&cphs_data->para.dv_status, para, sizeof(T_MFW_CPHS_DV_STAT));
403 break; 403 break;
404 case E_CPHS_SET_DV_STAT: 404 case E_CPHS_SET_DV_STAT:
405 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); 405 memcpy(&cphs_data->para.result, para, sizeof(UBYTE));
406 break; 406 break;
407 case E_CPHS_GET_ALS_STATUS: 407 case E_CPHS_GET_ALS_STATUS:
408 memcpy(&cphs_data->para.als_status, para, sizeof(T_MFW_CPHS_ALS_STATUS)); 408 memcpy(&cphs_data->para.als_status, para, sizeof(T_MFW_CPHS_ALS_STATUS));
409 break; 409 break;
410 case E_CPHS_SET_LINE: 410 case E_CPHS_SET_LINE:
411 memcpy(&cphs_data->para.result, para, sizeof(UBYTE)); 411 memcpy(&cphs_data->para.result, para, sizeof(UBYTE));
412 break; 412 break;
413 case E_CPHS_GET_CSP: 413 case E_CPHS_GET_CSP:
414 memcpy(&cphs_data->para.csp, para, sizeof(T_MFW_CPHS_CSP)); 414 memcpy(&cphs_data->para.csp, para, sizeof(T_MFW_CPHS_CSP));
415 break; 415 break;
416 case E_CPHS_GET_INFO_LIST: 416 case E_CPHS_GET_INFO_LIST:
417 memcpy(&cphs_data->para.num_list, para, sizeof(T_MFW_CPHS_INFONUM_LIST)); 417 memcpy(&cphs_data->para.num_list, para, sizeof(T_MFW_CPHS_INFONUM_LIST));
418 break; 418 break;
419 case E_CPHS_GET_INFO_NUM: 419 case E_CPHS_GET_INFO_NUM:
420 memcpy(&cphs_data->para.info_entry, para, sizeof(T_MFW_CPHS_INFONUM_ENTRY)); 420 memcpy(&cphs_data->para.info_entry, para, sizeof(T_MFW_CPHS_INFONUM_ENTRY));
421 break; 421 break;
422 case E_CPHS_GET_SIM_FIELD://MC added for generic read function 422 case E_CPHS_GET_SIM_FIELD://MC added for generic read function
423 memcpy(&cphs_data->para.read_sim_entry, para, sizeof(T_MFW_CPHS_READ_SIM_ENTRY)); 423 memcpy(&cphs_data->para.read_sim_entry, para, sizeof(T_MFW_CPHS_READ_SIM_ENTRY));
424 break; 424 break;
453 PURPOSE : Send a signal 453 PURPOSE : Send a signal
454 454
455 */ 455 */
456 456
457 static void cphs_signal (MfwEvt event, void *para) 457 static void cphs_signal (MfwEvt event, void *para)
458 { 458 {
459 /*MC, SPR 1389, we have to enable the display whenever 459 /*MC, SPR 1389, we have to enable the display whenever
460 we send an event up to the MMI*/ 460 we send an event up to the MMI*/
461 461
462 UBYTE temp=0; 462 UBYTE temp=0;
463 #ifndef FF_POWER_MANAGEMENT 463 #ifndef FF_POWER_MANAGEMENT
464 temp = dspl_Enable(0); 464 temp = dspl_Enable(0);
465 #else 465 #else
466 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) 466 /*OMAPS00098881 (removing power variant) a0393213(Prabakar)
467 display is enabled only when lcd refresh is needed*/ 467 display is enabled only when lcd refresh is needed*/
473 473
474 if (mfwSignallingMethod EQ 0) 474 if (mfwSignallingMethod EQ 0)
475 { 475 {
476 if (mfwFocus) 476 if (mfwFocus)
477 if (cphs_sign_exec(mfwFocus,event,para)) 477 if (cphs_sign_exec(mfwFocus,event,para))
478 { 478 {
479 #ifndef FF_POWER_MANAGEMENT 479 #ifndef FF_POWER_MANAGEMENT
480 dspl_Enable(temp);/*MC, SPR 1389*/ 480 dspl_Enable(temp);/*MC, SPR 1389*/
481 #else 481 #else
482 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) 482 /*OMAPS00098881 (removing power variant) a0393213(Prabakar)
483 display is enabled only when lcd refresh is needed*/ 483 display is enabled only when lcd refresh is needed*/
484 if(FFS_flashData.refresh == 1) 484 if(FFS_flashData.refresh == 1)
485 dspl_Enable(temp);/*MC, SPR 1389*/ 485 dspl_Enable(temp);/*MC, SPR 1389*/
486 #endif 486 #endif
487 return; 487 return;
488 } 488 }
489 if (mfwRoot) 489 if (mfwRoot)
490 cphs_sign_exec(mfwRoot,event,para); 490 cphs_sign_exec(mfwRoot,event,para);
491 } 491 }
501 /* 501 /*
502 * Focus not set, then start root 502 * Focus not set, then start root
503 */ 503 */
504 if (!h) 504 if (!h)
505 h = mfwRoot; 505 h = mfwRoot;
506 506
507 /* 507 /*
508 * No elements available, return 508 * No elements available, return
509 */ 509 */
510 510
511 while (h) 511 while (h)
512 { 512 {
513 /* 513 /*
514 * Signal consumed, then return 514 * Signal consumed, then return
515 */ 515 */
516 if (cphs_sign_exec (h, event, para)) 516 if (cphs_sign_exec (h, event, para))
517 { 517 {
518 #ifndef FF_POWER_MANAGEMENT 518 #ifndef FF_POWER_MANAGEMENT
519 dspl_Enable(temp);/*MC, SPR 1389*/ 519 dspl_Enable(temp);/*MC, SPR 1389*/
520 #else 520 #else
521 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) 521 /*OMAPS00098881 (removing power variant) a0393213(Prabakar)
522 display is enabled only when lcd refresh is needed*/ 522 display is enabled only when lcd refresh is needed*/
523 if(FFS_flashData.refresh == 1) 523 if(FFS_flashData.refresh == 1)
524 dspl_Enable(temp);/*MC, SPR 1389*/ 524 dspl_Enable(temp);/*MC, SPR 1389*/
525 #endif 525 #endif
526 return; 526 return;
527 } 527 }
528 528
529 /* 529 /*
530 * All windows tried inclusive root 530 * All windows tried inclusive root
535 dspl_Enable(temp);/*MC, SPR 1389*/ 535 dspl_Enable(temp);/*MC, SPR 1389*/
536 #else 536 #else
537 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) 537 /*OMAPS00098881 (removing power variant) a0393213(Prabakar)
538 display is enabled only when lcd refresh is needed*/ 538 display is enabled only when lcd refresh is needed*/
539 if(FFS_flashData.refresh == 1) 539 if(FFS_flashData.refresh == 1)
540 dspl_Enable(temp);/*MC, SPR 1389*/ 540 dspl_Enable(temp);/*MC, SPR 1389*/
541 #endif 541 #endif
542 return; 542 return;
543 } 543 }
544 544
545 /* 545 /*
546 * get parent window 546 * get parent window
547 */ 547 */
548 h = mfwParent(mfwParent(h)); 548 h = mfwParent(mfwParent(h));
549 if(h) 549 if(h)
550 h = ((MfwWin * )(h->data))->elems; 550 h = ((MfwWin * )(h->data))->elems;
551 } 551 }
552 cphs_sign_exec(mfwRoot,event,para); 552 cphs_sign_exec(mfwRoot,event,para);
553 } 553 }
554 // Power Management 554 // Power Management
555 #ifndef FF_POWER_MANAGEMENT 555 #ifndef FF_POWER_MANAGEMENT
556 dspl_Enable(temp);/*MC, SPR 1389*/ 556 dspl_Enable(temp);/*MC, SPR 1389*/
557 #else 557 #else
558 /*OMAPS00098881 (removing power variant) a0393213(Prabakar) 558 /*OMAPS00098881 (removing power variant) a0393213(Prabakar)
559 display is enabled only when lcd refresh is needed*/ 559 display is enabled only when lcd refresh is needed*/
560 if(FFS_flashData.refresh == 1) 560 if(FFS_flashData.refresh == 1)
561 dspl_Enable(temp);/*MC, SPR 1389*/ 561 dspl_Enable(temp);/*MC, SPR 1389*/
562 #endif 562 #endif
563 } 563 }
564 564
565 /* 565 /*
566 +--------------------------------------------------------------------+ 566 +--------------------------------------------------------------------+
567 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | 567 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS |
620 vc_stat.line1 = MFW_CFLAG_NotPresent; 620 vc_stat.line1 = MFW_CFLAG_NotPresent;
621 vc_stat.line2 = MFW_CFLAG_NotPresent; 621 vc_stat.line2 = MFW_CFLAG_NotPresent;
622 vc_stat.data = MFW_CFLAG_NotPresent; 622 vc_stat.data = MFW_CFLAG_NotPresent;
623 vc_stat.fax = MFW_CFLAG_NotPresent; 623 vc_stat.fax = MFW_CFLAG_NotPresent;
624 break; 624 break;
625 625
626 } 626 }
627 627
628 cphs_signal(E_CPHS_GET_VC_STAT,(void*)&vc_stat); 628 cphs_signal(E_CPHS_GET_VC_STAT,(void*)&vc_stat);
629 } 629 }
630 #endif 630 #endif
631 631
632 /* 632 /*
641 641
642 #ifdef FF_CPHS_REL4 642 #ifdef FF_CPHS_REL4
643 void sendCPHSSignal( UBYTE event, void* para) 643 void sendCPHSSignal( UBYTE event, void* para)
644 { 644 {
645 TRACE_FUNCTION("sendCPHSSignal()"); 645 TRACE_FUNCTION("sendCPHSSignal()");
646 cphs_signal(event,para); 646 cphs_signal(event,para);
647 } 647 }
648 #endif 648 #endif
649 /* 649 /*
650 +--------------------------------------------------------------------+ 650 +--------------------------------------------------------------------+
651 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | 651 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS |
666 /* Read failed */ 666 /* Read failed */
667 /*MC-CONQUEST5999->6007, 20/05/2002, set status to ERR rather than NotPresent*/ 667 /*MC-CONQUEST5999->6007, 20/05/2002, set status to ERR rather than NotPresent*/
668 cphsStatus = CPHS_ERR; 668 cphsStatus = CPHS_ERR;
669 TRACE_EVENT("CPHS, error reading support indication"); 669 TRACE_EVENT("CPHS, error reading support indication");
670 cphs_signal(E_CPHS_IND, &cphsStatus); 670 cphs_signal(E_CPHS_IND, &cphsStatus);
671 } 671 }
672 } 672 }
673 673
674 /* 674 /*
675 +--------------------------------------------------------------------+ 675 +--------------------------------------------------------------------+
676 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | 676 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS |
724 T_MFW cphs_operator_name (void) 724 T_MFW cphs_operator_name (void)
725 { 725 {
726 TRACE_FUNCTION ("cphs_operator_name()"); 726 TRACE_FUNCTION ("cphs_operator_name()");
727 727
728 /* Check CPHS support status */ 728 /* Check CPHS support status */
729 if (cphsStatus EQ CPHS_NotPresent) 729 if (cphsStatus EQ CPHS_NotPresent)
730 return cphsStatus; 730 return cphsStatus;
731 731
732 /* Read operator name sring */ 732 /* Read operator name sring */
733 if (!cphs_read_sim_dat(SIM_CPHS_ONSTR, NOT_PRESENT_8BIT, MFW_CPHS_ONS_SIZE)) 733 if (!cphs_read_sim_dat(SIM_CPHS_ONSTR, NOT_PRESENT_8BIT, MFW_CPHS_ONS_SIZE))
734 { 734 {
738 /* Read operator name shortform */ 738 /* Read operator name shortform */
739 if ((cphsPhase NEQ 2) OR 739 if ((cphsPhase NEQ 2) OR
740 (cphs_ssc(MFW_CHPS_NAME_SHORT, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) OR 740 (cphs_ssc(MFW_CHPS_NAME_SHORT, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) OR
741 !cphs_read_sim_dat(SIM_CPHS_ONSHF, NOT_PRESENT_8BIT, MFW_CPHS_ONSF_SIZE) ) 741 !cphs_read_sim_dat(SIM_CPHS_ONSHF, NOT_PRESENT_8BIT, MFW_CPHS_ONSF_SIZE) )
742 { 742 {
743 /* Read operator name shortform failed. 743 /* Read operator name shortform failed.
744 Send event with empty info to MMI */ 744 Send event with empty info to MMI */
745 opName.shortName.len = 0; 745 opName.shortName.len = 0;
746 cphs_signal(E_CPHS_OP_NAME, &opName); 746 cphs_signal(E_CPHS_OP_NAME, &opName);
747 } 747 }
748 } 748 }
757 757
758 PURPOSE : Request the Mailbox Numbers 758 PURPOSE : Request the Mailbox Numbers
759 759
760 */ 760 */
761 761
762 void cphs_get_mailbox (void) 762 void cphs_get_mailbox (void)
763 { 763 {
764 TRACE_FUNCTION ("cphs_get_mailbox()"); 764 TRACE_FUNCTION ("cphs_get_mailbox()");
765 765
766 mbNum.count = 0; 766 mbNum.count = 0;
767 767
768 /* Check CPHS support status. 768 /* Check CPHS support status.
769 When CPHS is not support, read mailbox numbers from EEPROM */ 769 When CPHS is not support, read mailbox numbers from EEPROM */
770 if (cphsStatus EQ CPHS_NotPresent) 770 if (cphsStatus EQ CPHS_NotPresent)
771 { 771 {
772 cphs_read_eeprom_mailbox(); 772 cphs_read_eeprom_mailbox();
773 return; 773 return;
774 } 774 }
775 775
776 /* Check CPHS service table. 776 /* Check CPHS service table.
777 When CPHS is not support, read mailbox numbers from EEPROM */ 777 When CPHS is not support, read mailbox numbers from EEPROM */
778 if (cphs_ssc(MFW_CPHS_MB_NUMBER, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) 778 if (cphs_ssc(MFW_CPHS_MB_NUMBER, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED)
779 { 779 {
780 cphs_read_eeprom_mailbox(); 780 cphs_read_eeprom_mailbox();
781 return; 781 return;
782 } 782 }
783 /* Read mailbox numbers from SIM. 783 /* Read mailbox numbers from SIM.
784 When this reading failed, read mailbox numbers from EEPROM */ 784 When this reading failed, read mailbox numbers from EEPROM */
785 if (!cphs_read_sim_rcd(SIM_CPHS_MBXN, 1, 0)) /* read the first record */ 785 if (!cphs_read_sim_rcd(SIM_CPHS_MBXN, 1, 0)) /* read the first record */
786 cphs_read_eeprom_mailbox(); 786 cphs_read_eeprom_mailbox();
787 } 787 }
788 788
789 static UBYTE cphs_write_sim_voicemail_rcd(void) 789 static UBYTE cphs_write_sim_voicemail_rcd(void)
790 { 790 {
791 BOOL bSavePossible = FALSE; 791 BOOL bSavePossible = FALSE;
792 UBYTE result = MFW_SIMOP_WRITE_OK; 792 UBYTE result = MFW_SIMOP_WRITE_OK;
793 793
794 TRACE_FUNCTION("cphs_write_sim_voicemail_rcd"); 794 TRACE_FUNCTION("cphs_write_sim_voicemail_rcd");
795 795
796 /* allocate mbnData (sizeof(dataLen)) */ 796 /* allocate mbnData (sizeof(dataLen)) */
797 // Mar 30, 2005 REF: CRR 29986 xpradipg 797 // Mar 30, 2005 REF: CRR 29986 xpradipg
798 // the dynamic allocation is done here, if the write fails it is deallocated 798 // the dynamic allocation is done here, if the write fails it is deallocated
799 // else if success it is deallocated in the callback 799 // else if success it is deallocated in the callback
800 #ifdef FF_MMI_OPTIM 800 #ifdef FF_MMI_OPTIM
813 /**************************************************************************************/ 813 /**************************************************************************************/
814 /* Check if enough EXT1 Records are available for storing the current number; If not, show Write Error */ 814 /* Check if enough EXT1 Records are available for storing the current number; If not, show Write Error */
815 if ( bSavePossible == FALSE ) 815 if ( bSavePossible == FALSE )
816 { 816 {
817 result = MFW_SIMOP_WRITE_ERR; 817 result = MFW_SIMOP_WRITE_ERR;
818 818
819 TRACE_FUNCTION("cphs_write_sim_voicemail_rcd: notenuf EXT1recs"); 819 TRACE_FUNCTION("cphs_write_sim_voicemail_rcd: notenuf EXT1recs");
820 cphs_signal(E_CPHS_SET_VC_NUM, &result); 820 cphs_signal(E_CPHS_SET_VC_NUM, &result);
821 821
822 // Mar 30, 2005 REF: CRR 29986 xpradipg 822 // Mar 30, 2005 REF: CRR 29986 xpradipg
823 // mbnData is deallocated, on failure of write operation 823 // mbnData is deallocated, on failure of write operation
824 #ifdef FF_MMI_OPTIM 824 #ifdef FF_MMI_OPTIM
825 if(mbnData) 825 if(mbnData)
826 mfwFree(mbnData,200); 826 mfwFree(mbnData,200);
828 828
829 return 0; 829 return 0;
830 } 830 }
831 /**************************************************************************************/ 831 /**************************************************************************************/
832 /**************************************************************************************/ 832 /**************************************************************************************/
833 833
834 if (!cphs_write_sim_rcd(SIM_CPHS_MBXN, vcEntry->index, 834 if (!cphs_write_sim_rcd(SIM_CPHS_MBXN, vcEntry->index,
835 mbnData, vcEntry->datalen)) 835 mbnData, vcEntry->datalen))
836 { 836 {
837 cphs_write_eeprom_mailbox(vcEntry); 837 cphs_write_eeprom_mailbox(vcEntry);
838 } 838 }
839 #ifdef FF_MMI_OPTIM 839 #ifdef FF_MMI_OPTIM
840 } 840 }
841 #endif 841 #endif
842 842
843 return 1; 843 return 1;
844 } 844 }
845 845
846 /* 846 /*
851 851
852 PURPOSE : Save the Mailbox Numbers 852 PURPOSE : Save the Mailbox Numbers
853 853
854 */ 854 */
855 855
856 T_MFW cphs_set_mailbox (T_MFW_CPHS_ENTRY *entry) 856 T_MFW cphs_set_mailbox (T_MFW_CPHS_ENTRY *entry)
857 { 857 {
858 858
859 TRACE_FUNCTION ("cphs_set_mailbox()"); 859 TRACE_FUNCTION ("cphs_set_mailbox()");
860 860
861 TRACE_EVENT_P1("no: %s", entry->number); 861 TRACE_EVENT_P1("no: %s", entry->number);
874 874
875 if ((entry->index <= 0) OR 875 if ((entry->index <= 0) OR
876 (entry->index > 4) ) 876 (entry->index > 4) )
877 return CPHS_ERR; 877 return CPHS_ERR;
878 878
879 /* Check CPHS support status. 879 /* Check CPHS support status.
880 When CPHS is not support, write mailbox numbers to EEPROM */ 880 When CPHS is not support, write mailbox numbers to EEPROM */
881 if (cphsStatus EQ CPHS_NotPresent) 881 if (cphsStatus EQ CPHS_NotPresent)
882 { 882 {
883 cphs_write_eeprom_mailbox(entry); 883 cphs_write_eeprom_mailbox(entry);
884 //x0pleela 11 June, 2006 DR:OMAPS00079692 884 //x0pleela 11 June, 2006 DR:OMAPS00079692
885 //changed from CPHS_OK to MFW_CPHS_OK 885 //changed from CPHS_OK to MFW_CPHS_OK
886 return MFW_CPHS_OK; 886 return MFW_CPHS_OK;
887 } 887 }
888 888
889 /* Check CPHS service table. 889 /* Check CPHS service table.
890 When CPHS is not support, write mailbox numbers to EEPROM */ 890 When CPHS is not support, write mailbox numbers to EEPROM */
891 if ( cphs_ssc(MFW_CPHS_MB_NUMBER, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED) 891 if ( cphs_ssc(MFW_CPHS_MB_NUMBER, cphsServTab) NEQ ALLOCATED_AND_ACTIVATED)
892 { 892 {
893 cphs_write_eeprom_mailbox(entry); 893 cphs_write_eeprom_mailbox(entry);
894 //x0pleela 11 June, 2006 DR:OMAPS00079692 894 //x0pleela 11 June, 2006 DR:OMAPS00079692
897 } 897 }
898 898
899 /* Read first record to determine the data length, 899 /* Read first record to determine the data length,
900 When the reading failed, write mailbox numbers to EEPROM */ 900 When the reading failed, write mailbox numbers to EEPROM */
901 // simStatus = MFW_SIMOP_WRITE_OK; 901 // simStatus = MFW_SIMOP_WRITE_OK;
902 if (!cphs_write_sim_voicemail_rcd()) 902 if (!cphs_write_sim_voicemail_rcd())
903 { 903 {
904 return CPHS_ERR; 904 return CPHS_ERR;
905 } 905 }
906 906
907 //x0pleela 11 June, 2006 DR:OMAPS00079692 907 //x0pleela 11 June, 2006 DR:OMAPS00079692
917 917
918 PURPOSE : get the voice message waiting flag 918 PURPOSE : get the voice message waiting flag
919 919
920 */ 920 */
921 921
922 T_MFW cphs_get_mailbox_status () 922 T_MFW cphs_get_mailbox_status ()
923 { 923 {
924 TRACE_FUNCTION ("cphs_get_mailbox_status()"); 924 TRACE_FUNCTION ("cphs_get_mailbox_status()");
925 925
926 926
927 /* Read voice message waiting flag. 927 /* Read voice message waiting flag.
928 When this reading failed, send event with "read error" parameter to MMI */ 928 When this reading failed, send event with "read error" parameter to MMI */
929 if (!cphs_read_sim_dat(SIM_CPHS_VMW, NOT_PRESENT_8BIT, MFW_CPHS_MBS_SIZE)) 929 if (!cphs_read_sim_dat(SIM_CPHS_VMW, NOT_PRESENT_8BIT, MFW_CPHS_MBS_SIZE))
930 { 930 {
931 mbStatus.result = MFW_SIMOP_READ_ERR; 931 mbStatus.result = MFW_SIMOP_READ_ERR;
932 cphs_signal(E_CPHS_GET_VC_STAT, &mbStatus); 932 cphs_signal(E_CPHS_GET_VC_STAT, &mbStatus);
933 } 933 }
934 return cphsStatus; 934 return cphsStatus;
962 962
963 PURPOSE : Save the voice message waiting flag 963 PURPOSE : Save the voice message waiting flag
964 964
965 */ 965 */
966 966
967 T_MFW cphs_set_mailbox_status (T_MFW_CFLAG_STATUS line1, 967 T_MFW cphs_set_mailbox_status (T_MFW_CFLAG_STATUS line1,
968 T_MFW_CFLAG_STATUS line2, 968 T_MFW_CFLAG_STATUS line2,
969 T_MFW_CFLAG_STATUS fax, 969 T_MFW_CFLAG_STATUS fax,
970 T_MFW_CFLAG_STATUS data) 970 T_MFW_CFLAG_STATUS data)
971 { 971 {
972 UBYTE result; 972 UBYTE result;
973 973
974 TRACE_FUNCTION ("cphs_set_mailbox_status()"); 974 TRACE_FUNCTION ("cphs_set_mailbox_status()");
975 975
989 /*else 989 /*else
990 mbsData[0] = 0x0F;*/ 990 mbsData[0] = 0x0F;*/
991 991
992 if (line2 EQ MFW_CFLAG_SET OR 992 if (line2 EQ MFW_CFLAG_SET OR
993 line2 EQ MFW_CFLAG_NOTSet ) 993 line2 EQ MFW_CFLAG_NOTSet )
994 { mbsData[0]&=0x0F; 994 { mbsData[0]&=0x0F;
995 mbsData[0] |= (line2 << 4)&0xF0;; /* high Nibble */ 995 mbsData[0] |= (line2 << 4)&0xF0;; /* high Nibble */
996 } 996 }
997 997
998 if (fax EQ MFW_CFLAG_SET OR 998 if (fax EQ MFW_CFLAG_SET OR
999 fax EQ MFW_CFLAG_NOTSet ) 999 fax EQ MFW_CFLAG_NOTSet )
1000 { mbsData[1] &= 0xF0; //zero the low nibble 1000 { mbsData[1] &= 0xF0; //zero the low nibble
1002 } 1002 }
1003 1003
1004 if (data EQ MFW_CFLAG_SET OR 1004 if (data EQ MFW_CFLAG_SET OR
1005 data EQ MFW_CFLAG_NOTSet ) 1005 data EQ MFW_CFLAG_NOTSet )
1006 { mbsData[1] &= 0x0F; //zero the high nibble 1006 { mbsData[1] &= 0x0F; //zero the high nibble
1007 mbsData[1] |= (data << 4)&0xF0; /* high Nibble */ 1007 mbsData[1] |= (data << 4)&0xF0; /* high Nibble */
1008 } 1008 }
1009 1009
1010 /* Read voice message waiting flag to determine the size */ 1010 /* Read voice message waiting flag to determine the size */
1011 simStatus = MFW_SIMOP_WRITE_OK; 1011 simStatus = MFW_SIMOP_WRITE_OK;
1012 if (!cphs_read_sim_dat(SIM_CPHS_VMW, NOT_PRESENT_8BIT, MFW_CPHS_MBS_SIZE)) 1012 if (!cphs_read_sim_dat(SIM_CPHS_VMW, NOT_PRESENT_8BIT, MFW_CPHS_MBS_SIZE))
1013 { 1013 {
1014 result = MFW_SIMOP_WRITE_ERR; 1014 result = MFW_SIMOP_WRITE_ERR;
1015 cphs_signal(E_CPHS_SET_VC_STAT, &result); 1015 cphs_signal(E_CPHS_SET_VC_STAT, &result);
1016 } 1016 }
1017 /* PATCH VO 22.01.01 end */ 1017 /* PATCH VO 22.01.01 end */
1026 1026
1027 PURPOSE : Request the call forwarding flags 1027 PURPOSE : Request the call forwarding flags
1028 1028
1029 */ 1029 */
1030 1030
1031 T_MFW cphs_get_divert_status () 1031 T_MFW cphs_get_divert_status ()
1032 { 1032 {
1033 TRACE_FUNCTION ("cphs_get_divert_status()"); 1033 TRACE_FUNCTION ("cphs_get_divert_status()");
1034 1034
1035 1035
1036 /* Read call forwarding flags. 1036 /* Read call forwarding flags.
1037 When this reading failed, send event with "read error" parameter to MMI */ 1037 When this reading failed, send event with "read error" parameter to MMI */
1038 /*a0393213 cphs rel4 - when EF(CFIS) is present call sAT_PercentCFIS to get CFIS*/ 1038 /*a0393213 cphs rel4 - when EF(CFIS) is present call sAT_PercentCFIS to get CFIS*/
1039 #ifdef FF_CPHS_REL4 1039 #ifdef FF_CPHS_REL4
1040 if(sim_serv_table_check((UBYTE)SRV_No_55) != ALLOCATED_AND_ACTIVATED ) 1040 if(sim_serv_table_check((UBYTE)SRV_No_55) != ALLOCATED_AND_ACTIVATED )
1041 { 1041 {
1042 #endif 1042 #endif
1043 1043
1044 if (!cphs_read_sim_dat(SIM_CPHS_CFF, NOT_PRESENT_8BIT, MFW_CPHS_CFF_SIZE)) 1044 if (!cphs_read_sim_dat(SIM_CPHS_CFF, NOT_PRESENT_8BIT, MFW_CPHS_CFF_SIZE))
1045 { 1045 {
1046 dvStatus.result = MFW_SIMOP_READ_ERR; 1046 dvStatus.result = MFW_SIMOP_READ_ERR;
1047 cphs_signal(E_CPHS_GET_DV_STAT, &dvStatus); 1047 cphs_signal(E_CPHS_GET_DV_STAT, &dvStatus);
1048 } 1048 }
1049 #ifdef FF_CPHS_REL4 1049 #ifdef FF_CPHS_REL4
1067 1067
1068 PURPOSE : Save the call forwarding flag 1068 PURPOSE : Save the call forwarding flag
1069 1069
1070 */ 1070 */
1071 1071
1072 T_MFW cphs_set_divert_status (T_MFW_CFLAG_STATUS line1, 1072 T_MFW cphs_set_divert_status (T_MFW_CFLAG_STATUS line1,
1073 T_MFW_CFLAG_STATUS line2, 1073 T_MFW_CFLAG_STATUS line2,
1074 T_MFW_CFLAG_STATUS fax, 1074 T_MFW_CFLAG_STATUS fax,
1075 T_MFW_CFLAG_STATUS data) 1075 T_MFW_CFLAG_STATUS data)
1076 { 1076 {
1077 UBYTE result; 1077 UBYTE result;
1078 1078
1079 TRACE_EVENT_P4 ("cphs_set_divert_status() %d %d %d %d",line1,line2,fax,data); 1079 TRACE_EVENT_P4 ("cphs_set_divert_status() %d %d %d %d",line1,line2,fax,data);
1080 1080
1087 } 1087 }
1088 1088
1089 if (line2 EQ MFW_CFLAG_SET OR 1089 if (line2 EQ MFW_CFLAG_SET OR
1090 line2 EQ MFW_CFLAG_NOTSet ) 1090 line2 EQ MFW_CFLAG_NOTSet )
1091 { dvData[0]&= 0x0F; 1091 { dvData[0]&= 0x0F;
1092 dvData[0] |= (line2 << 4)&0xF0; /* high Nibble */ 1092 dvData[0] |= (line2 << 4)&0xF0; /* high Nibble */
1093 } 1093 }
1094 1094
1095 if (fax EQ MFW_CFLAG_SET OR 1095 if (fax EQ MFW_CFLAG_SET OR
1096 fax EQ MFW_CFLAG_NOTSet ) 1096 fax EQ MFW_CFLAG_NOTSet )
1097 { dvData[1]&= 0xF0; //zero the lower nibble 1097 { dvData[1]&= 0xF0; //zero the lower nibble
1098 dvData[1] |= fax&0x0F; /* low Nibble */ 1098 dvData[1] |= fax&0x0F; /* low Nibble */
1099 } 1099 }
1100 1100
1101 1101
1102 if (data EQ MFW_CFLAG_SET OR 1102 if (data EQ MFW_CFLAG_SET OR
1103 data EQ MFW_CFLAG_NOTSet ) 1103 data EQ MFW_CFLAG_NOTSet )
1104 { dvData[1] &=0x0F; 1104 { dvData[1] &=0x0F;
1105 dvData[1] |= (data << 4)&0xF0; /* high Nibble */ 1105 dvData[1] |= (data << 4)&0xF0; /* high Nibble */
1106 } 1106 }
1107 1107
1108 /* Read call forwarding flag to determine the size */ 1108 /* Read call forwarding flag to determine the size */
1109 simStatus = MFW_SIMOP_WRITE_OK; 1109 simStatus = MFW_SIMOP_WRITE_OK;
1110 if (!cphs_read_sim_dat(SIM_CPHS_CFF, NOT_PRESENT_8BIT, MFW_CPHS_CFF_SIZE)) 1110 if (!cphs_read_sim_dat(SIM_CPHS_CFF, NOT_PRESENT_8BIT, MFW_CPHS_CFF_SIZE))
1111 { 1111 {
1112 TRACE_EVENT("cphs_set_divert_status:cphs_read_sim_dat failed"); 1112 TRACE_EVENT("cphs_set_divert_status:cphs_read_sim_dat failed");
1113 result = MFW_SIMOP_WRITE_ERR; 1113 result = MFW_SIMOP_WRITE_ERR;
1114 cphs_signal(E_CPHS_SET_DV_STAT, &result); 1114 cphs_signal(E_CPHS_SET_DV_STAT, &result);
1115 } 1115 }
1116 return cphsStatus; 1116 return cphsStatus;
1117 } 1117 }
1128 fax - call forward status for fax 1128 fax - call forward status for fax
1129 data - call forward status for data 1129 data - call forward status for data
1130 1130
1131 */ 1131 */
1132 #ifdef FF_CPHS_REL4 1132 #ifdef FF_CPHS_REL4
1133 T_MFW cphs_rel4_set_divert_status(T_MFW_CFLAG_STATUS voice, T_MFW_CFLAG_STATUS fax, 1133 T_MFW cphs_rel4_set_divert_status(T_MFW_CFLAG_STATUS voice, T_MFW_CFLAG_STATUS fax,
1134 T_MFW_CFLAG_STATUS data, char number[PHB_MAX_LEN]) 1134 T_MFW_CFLAG_STATUS data, char number[PHB_MAX_LEN])
1135 { 1135 {
1136 UBYTE mspId=mfw_cphs_get_reg_profile(); 1136 UBYTE mspId=mfw_cphs_get_reg_profile();
1137 UBYTE cfuStat=0x00; 1137 UBYTE cfuStat=0x00;
1138 1138
1139 TRACE_FUNCTION("cphs_rel4_set_divert_status"); 1139 TRACE_FUNCTION("cphs_rel4_set_divert_status");
1140 TRACE_EVENT_P4("voice - %d, fax - %d, data - %d, number - %s", voice, fax, data, number); 1140 TRACE_EVENT_P4("voice - %d, fax - %d, data - %d, number - %s", voice, fax, data, number);
1141 TRACE_EVENT_P1("msp id %d",mspId); 1141 TRACE_EVENT_P1("msp id %d",mspId);
1142 1142
1143 cfuStat= cfuStat | (voice == MFW_CFLAG_SET) | ((fax==MFW_CFLAG_SET)<<1) | ((data==MFW_CFLAG_SET)<<2); 1143 cfuStat= cfuStat | (voice == MFW_CFLAG_SET) | ((fax==MFW_CFLAG_SET)<<1) | ((data==MFW_CFLAG_SET)<<2);
1144 1144
1145 /*check third, fourth, sixth, seventh and eight parameters, number convert to 10 digit, TOA - psaSAT_getTonNpi is a local fn in ACI*/ 1145 /*check third, fourth, sixth, seventh and eight parameters, number convert to 10 digit, TOA - psaSAT_getTonNpi is a local fn in ACI*/
1146 sAT_PercentCFIS( CMD_SRC_LCL, 1146 sAT_PercentCFIS( CMD_SRC_LCL,
1147 CFIS_MOD_Write, 1147 CFIS_MOD_Write,
1148 mspId, 1148 mspId,
1149 mspId, 1149 mspId,
1150 cfuStat, 1150 cfuStat,
1151 number, 1151 number,
1152 NULL, 1152 NULL,
1153 0xFF); 1153 0xFF);
1154 return cphsStatus; 1154 return cphsStatus;
1155 1155
1156 1156
1157 } 1157 }
1158 #endif 1158 #endif
1159 1159
1160 1160
1161 1161
1169 (first read selected ALS line, dann status of this line). 1169 (first read selected ALS line, dann status of this line).
1170 When the field does not exist in SIM, read it from EEPROM. 1170 When the field does not exist in SIM, read it from EEPROM.
1171 1171
1172 */ 1172 */
1173 1173
1174 void cphs_get_als_info (T_MFW_CPHS_ALS_STATUS *info) 1174 void cphs_get_als_info (T_MFW_CPHS_ALS_STATUS *info)
1175 { 1175 {
1176 TRACE_FUNCTION ("cphs_get_als_info()"); 1176 TRACE_FUNCTION ("cphs_get_als_info()");
1177 1177
1178 /* read alternate line service from EEPROM */ 1178 /* read alternate line service from EEPROM */
1179 cphs_read_eeprom_als(info); 1179 cphs_read_eeprom_als(info);
1185 +---------------------------------------------------------------------+ 1185 +---------------------------------------------------------------------+
1186 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | 1186 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS |
1187 | STATE : code ROUTINE : cphs_select_line | 1187 | STATE : code ROUTINE : cphs_select_line |
1188 +---------------------------------------------------------------------+ 1188 +---------------------------------------------------------------------+
1189 1189
1190 PURPOSE : Select the current used line. When the field does not 1190 PURPOSE : Select the current used line. When the field does not
1191 exist in SIM, read it from EEPROM. 1191 exist in SIM, read it from EEPROM.
1192 1192
1193 */ 1193 */
1194 1194
1195 void cphs_select_line (T_MFW_LINE_INDEX line) 1195 void cphs_select_line (T_MFW_LINE_INDEX line)
1196 { 1196 {
1197 UBYTE result; 1197 UBYTE result;
1198 T_ACI_ALS_MOD alsMode=ALS_MOD_NOTPRESENT; 1198 T_ACI_ALS_MOD alsMode=ALS_MOD_NOTPRESENT;
1199 1199
1200 TRACE_EVENT_P1 ("cphs_select_line() %d",line); 1200 TRACE_EVENT_P1 ("cphs_select_line() %d",line);
1209 1209
1210 alsData = (UBYTE) line; 1210 alsData = (UBYTE) line;
1211 1211
1212 1212
1213 /* write alternate line service in EEPROM */ 1213 /* write alternate line service in EEPROM */
1214 cphs_write_eeprom_als(&result); 1214 cphs_write_eeprom_als(&result);
1215 1215
1216 if (line EQ MFW_SERV_LINE1) 1216 if (line EQ MFW_SERV_LINE1)
1217 alsMode = ALS_MOD_SPEECH; 1217 alsMode = ALS_MOD_SPEECH;
1218 if (line EQ MFW_SERV_LINE2) 1218 if (line EQ MFW_SERV_LINE2)
1219 alsMode = ALS_MOD_AUX_SPEECH; 1219 alsMode = ALS_MOD_AUX_SPEECH;
1220 sAT_PercentALS(CMD_SRC_LCL, alsMode); 1220 sAT_PercentALS(CMD_SRC_LCL, alsMode);
1221 1221
1222 cphs_signal(E_CPHS_SET_LINE, &result); 1222 cphs_signal(E_CPHS_SET_LINE, &result);
1223 } 1223 }
1224 1224
1225 /* 1225 /*
1226 +---------------------------------------------------------------------+ 1226 +---------------------------------------------------------------------+
1227 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | 1227 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS |
1228 | STATE : code ROUTINE : cphs_set_als_status | 1228 | STATE : code ROUTINE : cphs_set_als_status |
1229 +---------------------------------------------------------------------+ 1229 +---------------------------------------------------------------------+
1230 1230
1231 PURPOSE : Change the lock status of the line. When the field does 1231 PURPOSE : Change the lock status of the line. When the field does
1232 not exist in SIM, read it from EEPROM. 1232 not exist in SIM, read it from EEPROM.
1233 1233
1234 */ 1234 */
1235 1235
1236 T_MFW cphs_set_als_status (T_MFW_LINE_STATUS status) 1236 T_MFW cphs_set_als_status (T_MFW_LINE_STATUS status)
1237 { 1237 {
1238 UBYTE result; 1238 UBYTE result;
1239 T_MFW_SIM_PIN_STATUS pinStatus; 1239 T_MFW_SIM_PIN_STATUS pinStatus;
1240 1240
1241 TRACE_FUNCTION ("cphs_set_als_status()"); 1241 TRACE_FUNCTION ("cphs_set_als_status()");
1242 1242
1243 /* check PIN 2 requirement */ 1243 /* check PIN 2 requirement */
1244 pinStatus.type = MFW_SIM_PIN2; 1244 pinStatus.type = MFW_SIM_PIN2;
1245 sim_pin_status(&pinStatus); 1245 sim_pin_status(&pinStatus);
1246 if (pinStatus.stat NEQ MFW_SIM_NO_PIN) 1246 if (pinStatus.stat NEQ MFW_SIM_NO_PIN)
1247 return MFW_SIM_PIN2_REQ; 1247 return MFW_SIM_PIN2_REQ;
1248 1248
1249 /* check given parameter */ 1249 /* check given parameter */
1250 if (status NEQ MFW_LINE_LOCKED AND 1250 if (status NEQ MFW_LINE_LOCKED AND
1251 status NEQ MFW_LINE_UNLOCKED ) 1251 status NEQ MFW_LINE_UNLOCKED )
1252 { 1252 {
1273 1273
1274 PURPOSE : Request the customer service profile 1274 PURPOSE : Request the customer service profile
1275 1275
1276 */ 1276 */
1277 1277
1278 T_MFW cphs_get_csp () 1278 T_MFW cphs_get_csp ()
1279 { 1279 {
1280 UBYTE res; 1280 UBYTE res;
1281 1281
1282 TRACE_FUNCTION ("cphs_get_csp()"); 1282 TRACE_FUNCTION ("cphs_get_csp()");
1283 1283
1285 /* check CPHS service table */ 1285 /* check CPHS service table */
1286 res = cphs_ssc(MFW_CPHS_CSP, cphsServTab); 1286 res = cphs_ssc(MFW_CPHS_CSP, cphsServTab);
1287 if ( res NEQ ALLOCATED_AND_ACTIVATED) 1287 if ( res NEQ ALLOCATED_AND_ACTIVATED)
1288 return res; 1288 return res;
1289 1289
1290 /* Read customer service profile. 1290 /* Read customer service profile.
1291 When this reading failed, send event with empty parameter array to MMI */ 1291 When this reading failed, send event with empty parameter array to MMI */
1292 if (!cphs_read_sim_dat(SIM_CPHS_CSP, NOT_PRESENT_8BIT, MFW_CPHS_CSP_SIZE)) 1292 if (!cphs_read_sim_dat(SIM_CPHS_CSP, NOT_PRESENT_8BIT, MFW_CPHS_CSP_SIZE))
1293 { 1293 {
1294 csProfile.result = MFW_SIMOP_READ_ERR; 1294 csProfile.result = MFW_SIMOP_READ_ERR;
1295 memset(csProfile.csp, 0, sizeof(csProfile.csp)); 1295 memset(csProfile.csp, 0, sizeof(csProfile.csp));
1307 1307
1308 PURPOSE : Request information numbers directory 1308 PURPOSE : Request information numbers directory
1309 1309
1310 */ 1310 */
1311 1311
1312 T_MFW cphs_get_info_num (UBYTE level, UBYTE startIndex) 1312 T_MFW cphs_get_info_num (UBYTE level, UBYTE startIndex)
1313 { 1313 {
1314 // UBYTE res; // RAVI 1314 // UBYTE res; // RAVI
1315 T_MFW_CPHS_INFO cf_info; 1315 T_MFW_CPHS_INFO cf_info;
1316 1316
1317 TRACE_FUNCTION ("cphs_get_info_num()"); 1317 TRACE_FUNCTION ("cphs_get_info_num()");
1318 1318
1319 1319
1320 if (level < 1 OR 1320 if (level < 1 OR
1321 startIndex < 1 ) 1321 startIndex < 1 )
1322 return CPHS_ERR; 1322 return CPHS_ERR;
1323 cphs_config(&cf_info); 1323 cphs_config(&cf_info);
1324 1324
1325 1325
1326 /* Read customer service profile to check 1326 /* Read customer service profile to check
1327 whether information numbers are supported. */ 1327 whether information numbers are supported. */
1328 numList.count = 0; 1328 numList.count = 0;
1329 idxLevel = level; 1329 idxLevel = level;
1330 startIdx = startIndex; 1330 startIdx = startIndex;
1331 simStatus = MFW_SIMOP_READ_OK; 1331 simStatus = MFW_SIMOP_READ_OK;
1347 1347
1348 PURPOSE : read a information number entry 1348 PURPOSE : read a information number entry
1349 1349
1350 */ 1350 */
1351 1351
1352 T_MFW cphs_select_info_num (UBYTE index) 1352 T_MFW cphs_select_info_num (UBYTE index)
1353 { 1353 {
1354 TRACE_FUNCTION ("cphs_select_info_num()"); 1354 TRACE_FUNCTION ("cphs_select_info_num()");
1355 1355
1356 1356
1357 /* Read a information number entry. 1357 /* Read a information number entry.
1358 When this reading failed, send event with "read error" parameter to MMI */ 1358 When this reading failed, send event with "read error" parameter to MMI */
1359 simStatus = MFW_SIMOP_READ_OK; 1359 simStatus = MFW_SIMOP_READ_OK;
1360 startIdx = index; 1360 startIdx = index;
1361 1361
1362 // By now we know if 6F19 or EA01 are present for reading info. num entries from 1362 // By now we know if 6F19 or EA01 are present for reading info. num entries from
1363 // So lets use this knowledge. 1363 // So lets use this knowledge.
1364 1364
1365 if (cphsPrevRead == SIM_CPHS_INFN) 1365 if (cphsPrevRead == SIM_CPHS_INFN)
1366 { 1366 {
1367 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, 1, 0)) 1367 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, 1, 0))
1368 { 1368 {
1369 infoEntry.result = MFW_SIMOP_READ_ERR; 1369 infoEntry.result = MFW_SIMOP_READ_ERR;
1370 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); 1370 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry);
1371 TRACE_EVENT("Error reading single info num"); 1371 TRACE_EVENT("Error reading single info num");
1372 } 1372 }
1377 } 1377 }
1378 else 1378 else
1379 { 1379 {
1380 if (cphsPrevRead == SIM_CPHS_INFN2) 1380 if (cphsPrevRead == SIM_CPHS_INFN2)
1381 { 1381 {
1382 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0)) 1382 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0))
1383 {TRACE_EVENT("Error reading single info num 2"); 1383 {TRACE_EVENT("Error reading single info num 2");
1384 infoEntry.result = MFW_SIMOP_READ_ERR; 1384 infoEntry.result = MFW_SIMOP_READ_ERR;
1385 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); 1385 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry);
1386 } 1386 }
1387 else 1387 else
1404 */ 1404 */
1405 //x0018858 OMAPS00062632 The errcode type has been modified from SHORT to USHORT. 1405 //x0018858 OMAPS00062632 The errcode type has been modified from SHORT to USHORT.
1406 void cphs_read_information(USHORT errCode, UBYTE *data, UBYTE dataLen) 1406 void cphs_read_information(USHORT errCode, UBYTE *data, UBYTE dataLen)
1407 { 1407 {
1408 UBYTE *ptr; 1408 UBYTE *ptr;
1409 /* PATCH VO 22.01.01: copy CPHS service table according to 1409 /* PATCH VO 22.01.01: copy CPHS service table according to
1410 the actual length in the SIM card */ 1410 the actual length in the SIM card */
1411 UBYTE len; 1411 UBYTE len;
1412 /* PATCH VO 22.01.01 END */ 1412 /* PATCH VO 22.01.01 END */
1413 1413
1414 TRACE_FUNCTION ("cphs_read_information()"); 1414 TRACE_FUNCTION ("cphs_read_information()");
1415 1415
1416 ptr = data; 1416 ptr = data;
1417 /* PATCH VO 22.01.01: copy CPHS service table according to 1417 /* PATCH VO 22.01.01: copy CPHS service table according to
1418 the actual length in the SIM card */ 1418 the actual length in the SIM card */
1419 len = dataLen; 1419 len = dataLen;
1420 memset(cphsServTab, 0, sizeof(cphsServTab)); 1420 memset(cphsServTab, 0, sizeof(cphsServTab));
1421 /* PATCH VO 22.01.01 END */ 1421 /* PATCH VO 22.01.01 END */
1422 #ifdef FF_2TO1_PS 1422 #ifdef FF_2TO1_PS
1423 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR 1423 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR
1424 #else 1424 #else
1425 if ( errCode NEQ SIM_NO_ERROR OR 1425 if ( errCode NEQ SIM_NO_ERROR OR
1426 #endif 1426 #endif
1427 ptr EQ NULL OR 1427 ptr EQ NULL OR
1428 dataLen <= 0) /* PATCH VO 22.01.01: not check a certain length */ 1428 dataLen <= 0) /* PATCH VO 22.01.01: not check a certain length */
1429 { 1429 {
1430 cphs_signal(E_CPHS_IND, &cphsStatus); 1430 cphs_signal(E_CPHS_IND, &cphsStatus);
1431 } 1431 }
1432 else 1432 else
1433 { 1433 {
1434 cphsPhase = *ptr; 1434 cphsPhase = *ptr;
1435 len--; 1435 len--;
1436 if (len > 0) 1436 if (len > 0)
1437 { 1437 {
1438 ptr++; 1438 ptr++;
1439 memcpy (cphsServTab, ptr, MINIMUM(len, CPHS_SERVICE_TABLE)); 1439 memcpy (cphsServTab, ptr, MINIMUM(len, CPHS_SERVICE_TABLE));
1465 ptr = data; 1465 ptr = data;
1466 #ifdef FF_2TO1_PS 1466 #ifdef FF_2TO1_PS
1467 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR 1467 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR
1468 #else 1468 #else
1469 if ( errCode NEQ SIM_NO_ERROR OR 1469 if ( errCode NEQ SIM_NO_ERROR OR
1470 #endif 1470 #endif
1471 ptr EQ NULL OR 1471 ptr EQ NULL OR
1472 // dataLen < MFW_CPHS_ONS_SIZE ) 1472 // dataLen < MFW_CPHS_ONS_SIZE )
1473 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ 1473 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */
1474 { 1474 {
1475 opName.longName.len = 0; 1475 opName.longName.len = 0;
1476 } 1476 }
1477 else 1477 else
1478 { 1478 {
1479 cmhPHB_getMfwTagNt(ptr, (UBYTE)MINIMUM(LONG_NAME, dataLen), 1479 cmhPHB_getMfwTagNt(ptr, (UBYTE)MINIMUM(LONG_NAME, dataLen),
1480 opName.longName.data, &opName.longName.len); 1480 opName.longName.data, &opName.longName.len);
1481 opName.longName.dcs = MFW_DCS_SIM; 1481 opName.longName.dcs = MFW_DCS_SIM;
1482 1482
1483 /* Read operator name shortform */ 1483 /* Read operator name shortform */
1484 if ((cphsPhase NEQ 2) OR 1484 if ((cphsPhase NEQ 2) OR
1511 ptr = data; 1511 ptr = data;
1512 #ifdef FF_2TO1_PS 1512 #ifdef FF_2TO1_PS
1513 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR 1513 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR
1514 #else 1514 #else
1515 if ( errCode NEQ SIM_NO_ERROR OR 1515 if ( errCode NEQ SIM_NO_ERROR OR
1516 #endif 1516 #endif
1517 ptr EQ NULL OR 1517 ptr EQ NULL OR
1518 dataLen < MFW_CPHS_ONSF_SIZE ) 1518 dataLen < MFW_CPHS_ONSF_SIZE )
1519 { 1519 {
1520 opName.shortName.len = 0; 1520 opName.shortName.len = 0;
1521 } 1521 }
1522 else 1522 else
1523 { 1523 {
1524 cmhPHB_getMfwTagNt(ptr, MFW_CPHS_ONSF_SIZE, 1524 cmhPHB_getMfwTagNt(ptr, MFW_CPHS_ONSF_SIZE,
1525 opName.shortName.data, &opName.shortName.len); 1525 opName.shortName.data, &opName.shortName.len);
1526 opName.shortName.dcs = MFW_DCS_SIM; 1526 opName.shortName.dcs = MFW_DCS_SIM;
1527 TRACE_EVENT("Got a short Name"); 1527 TRACE_EVENT("Got a short Name");
1528 } 1528 }
1529 1529
1555 curr_recNr = simShrdPrm.atb[table_id].recNr; 1555 curr_recNr = simShrdPrm.atb[table_id].recNr;
1556 1556
1557 TRACE_EVENT_P1("curr_recNr: %d", curr_recNr); 1557 TRACE_EVENT_P1("curr_recNr: %d", curr_recNr);
1558 1558
1559 TRACE_EVENT_P1("dataLen: %d", dataLen); 1559 TRACE_EVENT_P1("dataLen: %d", dataLen);
1560 1560
1561 #ifdef FF_2TO1_PS 1561 #ifdef FF_2TO1_PS
1562 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR OR 1562 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR OR
1563 #else 1563 #else
1564 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR OR 1564 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR OR
1565 #endif 1565 #endif
1566 pData EQ NULL OR 1566 pData EQ NULL OR
1567 dataLen < MFW_CPHS_MIN_MBN_SIZE ) 1567 dataLen < MFW_CPHS_MIN_MBN_SIZE )
1568 { 1568 {
1569 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ 1569 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/
1570 if (curr_recNr <= 1) 1570 if (curr_recNr <= 1)
1593 { 1593 {
1594 alphaLen = 0; 1594 alphaLen = 0;
1595 } 1595 }
1596 1596
1597 /* Copy/encode data */ 1597 /* Copy/encode data */
1598 if ( ( *(pData + alphaLen) > 0 ) /* If Length of the contents is > 0 */ 1598 if ( ( *(pData + alphaLen) > 0 ) /* If Length of the contents is > 0 */
1599 && 1599 &&
1600 ( *(pData + alphaLen) <= 11 ) 1600 ( *(pData + alphaLen) <= 11 )
1601 ) 1601 )
1602 { 1602 {
1603 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ 1603 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/
1604 mbNum.entries[mbNum.count].index = curr_recNr; 1604 mbNum.entries[mbNum.count].index = curr_recNr;
1605 1605
1606 mbNum.entries[mbNum.count].datalen = dataLen; 1606 mbNum.entries[mbNum.count].datalen = dataLen;
1607 1607
1608 TRACE_EVENT_P1("mbNum.count: %d", mbNum.count); 1608 TRACE_EVENT_P1("mbNum.count: %d", mbNum.count);
1609 1609
1610 TRACE_EVENT_P1("mbNum.entries[mbNum.count].index: %d", mbNum.entries[mbNum.count].index); 1610 TRACE_EVENT_P1("mbNum.entries[mbNum.count].index: %d", mbNum.entries[mbNum.count].index);
1611 1611
1612 cmhPHB_getMfwTagNt(pData, alphaLen, 1612 cmhPHB_getMfwTagNt(pData, alphaLen,
1613 mbNum.entries[mbNum.count].alpha.data, 1613 mbNum.entries[mbNum.count].alpha.data,
1614 &mbNum.entries[mbNum.count].alpha.len); 1614 &mbNum.entries[mbNum.count].alpha.len);
1615 pData += alphaLen; 1615 pData += alphaLen;
1616 1616
1617 if ( *(pData) > 1 ) 1617 if ( *(pData) > 1 )
1618 { 1618 {
1635 TRACE_EVENT_P1("dataLen: %d", dataLen); 1635 TRACE_EVENT_P1("dataLen: %d", dataLen);
1636 1636
1637 TRACE_EVENT_P1("alphaLen: %d", alphaLen); 1637 TRACE_EVENT_P1("alphaLen: %d", alphaLen);
1638 1638
1639 TRACE_EVENT_P2("cphs_read_mbn: idx, ext_rec_number: %d, %d", mbNum.count, mbNum.entries[mbNum.count].ext_rec_number); 1639 TRACE_EVENT_P2("cphs_read_mbn: idx, ext_rec_number: %d, %d", mbNum.count, mbNum.entries[mbNum.count].ext_rec_number);
1640 1640
1641 pData += 12; 1641 pData += 12;
1642 1642
1643 if ( *pData NEQ 0xFF ) 1643 if ( *pData NEQ 0xFF )
1644 { 1644 {
1645 /* read bearer capability EF */ 1645 /* read bearer capability EF */
1646 /* return; */ 1646 /* return; */
1647 } 1647 }
1648 1648
1649 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ 1649 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/
1650 pData += 1; 1650 pData += 1;
1651 1651
1652 if ( *pData NEQ 0xFF ) 1652 if ( *pData NEQ 0xFF )
1653 { 1653 {
1654 /*Read EXT1 EF */ 1654 /*Read EXT1 EF */
1655 UBYTE rcd_no; 1655 UBYTE rcd_no;
1656 rcd_no= *pData; 1656 rcd_no= *pData;
1657 mbNum.entries[mbNum.count].ext_rec_idx[mbNum.entries[mbNum.count].ext_rec_number] = rcd_no; 1657 mbNum.entries[mbNum.count].ext_rec_idx[mbNum.entries[mbNum.count].ext_rec_number] = rcd_no;
1658 1658
1659 if(!cphs_read_sim_rcd(SIM_EXT1,rcd_no,UCHAR_MAX)) 1659 if(!cphs_read_sim_rcd(SIM_EXT1,rcd_no,UCHAR_MAX))
1660 { 1660 {
1661 /*Append the extension data to mailbox number*/ 1661 /*Append the extension data to mailbox number*/
1662 TRACE_FUNCTION("EXTENSION RECORD PRESENT"); 1662 TRACE_FUNCTION("EXTENSION RECORD PRESENT");
1663 } 1663 }
1664 else 1664 else
1665 { 1665 {
1666 /*EXT1 record is being read. Wait the corr callback.*/ 1666 /*EXT1 record is being read. Wait the corr callback.*/
1667 return; 1667 return;
1668 } 1668 }
1669 } 1669 }
1670 1670
1671 mbNum.count++; 1671 mbNum.count++;
1672 1672
1673 } 1673 }
1674 1674
1675 curr_recNr++; 1675 curr_recNr++;
1676 if (curr_recNr > maxRec) 1676 if (curr_recNr > maxRec)
1677 { 1677 {
1678 TRACE_EVENT("got CPHS MAilbox nos"); 1678 TRACE_EVENT("got CPHS MAilbox nos");
1679 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); 1679 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum);
1680 } 1680 }
1681 else 1681 else
1682 { 1682 {
1683 /* Read the next entry */ 1683 /* Read the next entry */
1684 if (!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX)) 1684 if (!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX))
1685 { 1685 {
1686 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); 1686 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum);
1687 } 1687 }
1688 } 1688 }
1689 } 1689 }
1713 1713
1714 pData = simShrdPrm.atb[table_id].exchData; 1714 pData = simShrdPrm.atb[table_id].exchData;
1715 dataLen = simShrdPrm.atb[table_id].dataLen; 1715 dataLen = simShrdPrm.atb[table_id].dataLen;
1716 recNr = simShrdPrm.atb[table_id].recNr; 1716 recNr = simShrdPrm.atb[table_id].recNr;
1717 1717
1718 if ( *pData EQ 0x02 ) //implies that the EF conatins additional data 1718 if ( *pData EQ 0x02 ) //implies that the EF conatins additional data
1719 { 1719 {
1720 1720
1721 /*Extract ext data*/ 1721 /*Extract ext data*/
1722 if(*(pData+1) NEQ 0xFF) 1722 if(*(pData+1) NEQ 0xFF)
1723 { 1723 {
1724 alphaLen=*(pData+1); 1724 alphaLen=*(pData+1);
1725 cmhPHB_getAdrStr ( (CHAR *)ext1num, 1725 cmhPHB_getAdrStr ( (CHAR *)ext1num,
1726 PHB_MAX_LEN - 1, 1726 PHB_MAX_LEN - 1,
1727 pData + 2, 1727 pData + 2,
1728 *(pData+1) ); 1728 *(pData+1) );
1729 1729
1730 strncat( (CHAR *)mbNum.entries[mbNum.count].number, (CHAR *)ext1num, 1730 strncat( (CHAR *)mbNum.entries[mbNum.count].number, (CHAR *)ext1num,
1731 strlen((CHAR *)ext1num) ); 1731 strlen((CHAR *)ext1num) );
1732 1732
1733 mbNum.entries[mbNum.count].ext_rec_number++; 1733 mbNum.entries[mbNum.count].ext_rec_number++;
1734 1734
1735 TRACE_EVENT_P2("cphs_read_ext1: idx, ext_rec_number: %d, %d", mbNum.count, mbNum.entries[mbNum.count].ext_rec_number); 1735 TRACE_EVENT_P2("cphs_read_ext1: idx, ext_rec_number: %d, %d", mbNum.count, mbNum.entries[mbNum.count].ext_rec_number);
1736 1736
1737 if ( *(pData + 12) == 0xFF ) 1737 if ( *(pData + 12) == 0xFF )
1738 { 1738 {
1739 //return control to mbn 1739 //return control to mbn
1740 curr_recNr++; 1740 curr_recNr++;
1741 1741
1742 mbNum.count++; 1742 mbNum.count++;
1743 1743
1744 if (curr_recNr > maxRec) 1744 if (curr_recNr > maxRec)
1745 { 1745 {
1746 TRACE_EVENT("got CPHS MAilbox nos-2"); 1746 TRACE_EVENT("got CPHS MAilbox nos-2");
1747 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum); 1747 cphs_signal(E_CPHS_GET_VC_NUM, &mbNum);
1748 } 1748 }
1749 else 1749 else
1750 { 1750 {
1751 if(!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX)) 1751 if(!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX))
1752 { 1752 {
1753 TRACE_FUNCTION("Control Back to mbn-1"); 1753 TRACE_FUNCTION("Control Back to mbn-1");
1754 return; 1754 return;
1755 } 1755 }
1756 } 1756 }
1758 else 1758 else
1759 { 1759 {
1760 ext_rec_no = *(pData + 12); 1760 ext_rec_no = *(pData + 12);
1761 1761
1762 mbNum.entries[mbNum.count].ext_rec_idx[mbNum.entries[mbNum.count].ext_rec_number] = ext_rec_no; 1762 mbNum.entries[mbNum.count].ext_rec_idx[mbNum.entries[mbNum.count].ext_rec_number] = ext_rec_no;
1763 1763
1764 if(!cphs_read_sim_rcd(SIM_EXT1,ext_rec_no,UCHAR_MAX)) 1764 if(!cphs_read_sim_rcd(SIM_EXT1,ext_rec_no,UCHAR_MAX))
1765 { 1765 {
1766 /*Append the extension data to mailbox number*/ 1766 /*Append the extension data to mailbox number*/
1767 TRACE_FUNCTION( " MORE EXTENSION RECORDS PRESENT -But read Error"); 1767 TRACE_FUNCTION( " MORE EXTENSION RECORDS PRESENT -But read Error");
1768 1768
1769 curr_recNr++; 1769 curr_recNr++;
1770 1770
1771 mbNum.count++; 1771 mbNum.count++;
1772 1772
1773 if(!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX)) 1773 if(!cphs_read_sim_rcd(SIM_CPHS_MBXN, curr_recNr, UCHAR_MAX))
1774 { 1774 {
1775 TRACE_FUNCTION("Control Back to mbn-2"); 1775 TRACE_FUNCTION("Control Back to mbn-2");
1776 return; 1776 return;
1777 } 1777 }
1778 } 1778 }
1779 } 1779 }
1780 } 1780 }
1781 } 1781 }
1782 else 1782 else
1783 ; 1783 ;
1784 1784
1785 return; 1785 return;
1786 } 1786 }
1787 1787
1788 /* 1788 /*
1789 +-----------------------------------------------------------------------+ 1789 +-----------------------------------------------------------------------+
1857 ptr = data; 1857 ptr = data;
1858 #ifdef FF_2TO1_PS 1858 #ifdef FF_2TO1_PS
1859 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR 1859 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR
1860 #else 1860 #else
1861 if ( errCode NEQ SIM_NO_ERROR OR 1861 if ( errCode NEQ SIM_NO_ERROR OR
1862 #endif 1862 #endif
1863 ptr EQ NULL OR 1863 ptr EQ NULL OR
1864 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ 1864 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */
1865 { 1865 {
1866 mbStatus.result = MFW_SIMOP_READ_ERR; 1866 mbStatus.result = MFW_SIMOP_READ_ERR;
1867 } 1867 }
1868 else 1868 else
1869 { 1869 {
1870 memset(&mbStatus, MFW_CFLAG_NotPresent, sizeof(mbStatus)); 1870 memset(&mbStatus, MFW_CFLAG_NotPresent, sizeof(mbStatus));
1871 1871
1872 //x0pleela, 07 June, 2006 DVT: OMAPS00079692 1872 //x0pleela, 07 June, 2006 DVT: OMAPS00079692
1873 //Copy SIM data into mbsData to initialise mbsData with the SIM data instead of zeros 1873 //Copy SIM data into mbsData to initialise mbsData with the SIM data instead of zeros
1874 memcpy( mbsData, ptr, dataLen ); 1874 memcpy( mbsData, ptr, dataLen );
1875 1875
1876 mbStatus.result = MFW_SIMOP_READ_OK; 1876 mbStatus.result = MFW_SIMOP_READ_OK;
1877 1877
1878 for (i=0; i<dataLen; i++) 1878 for (i=0; i<dataLen; i++)
1879 { 1879 {
1880 switch (i) 1880 switch (i)
1920 ptr = data; 1920 ptr = data;
1921 #ifdef FF_2TO1_PS 1921 #ifdef FF_2TO1_PS
1922 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR 1922 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR
1923 #else 1923 #else
1924 if ( errCode NEQ SIM_NO_ERROR OR 1924 if ( errCode NEQ SIM_NO_ERROR OR
1925 #endif 1925 #endif
1926 ptr EQ NULL OR 1926 ptr EQ NULL OR
1927 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ 1927 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */
1928 { 1928 {
1929 dvStatus.result = MFW_SIMOP_READ_ERR; 1929 dvStatus.result = MFW_SIMOP_READ_ERR;
1930 } 1930 }
1933 memset(&dvStatus, MFW_CFLAG_NotPresent, sizeof(dvStatus)); 1933 memset(&dvStatus, MFW_CFLAG_NotPresent, sizeof(dvStatus));
1934 /* May 30, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar) 1934 /* May 30, 2006 REF:OMAPS00079650 a0393213 (R.Prabakar)
1935 Description : CPHS Call Forwarding feature implementation 1935 Description : CPHS Call Forwarding feature implementation
1936 Solution : As part of this implementation, dvData is made to be consistent with the data 1936 Solution : As part of this implementation, dvData is made to be consistent with the data
1937 read from SIM*/ 1937 read from SIM*/
1938 memcpy(&dvData, ptr,dataLen); 1938 memcpy(&dvData, ptr,dataLen);
1939 dvStatus.result = MFW_SIMOP_READ_OK; 1939 dvStatus.result = MFW_SIMOP_READ_OK;
1940 for (i=0; i<dataLen; i++) 1940 for (i=0; i<dataLen; i++)
1941 { 1941 {
1942 switch (i) 1942 switch (i)
1943 { 1943 {
2010 ptr = data; 2010 ptr = data;
2011 #ifdef FF_2TO1_PS 2011 #ifdef FF_2TO1_PS
2012 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR 2012 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR
2013 #else 2013 #else
2014 if ( errCode NEQ SIM_NO_ERROR OR 2014 if ( errCode NEQ SIM_NO_ERROR OR
2015 #endif 2015 #endif
2016 ptr EQ NULL OR 2016 ptr EQ NULL OR
2017 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */ 2017 dataLen <= 0 ) /* PATCH VO 22.01.01: not check a certain length */
2018 { 2018 {
2019 if (simStatus EQ MFW_SIMOP_READ_OK) /* Used for read information numbers */ 2019 if (simStatus EQ MFW_SIMOP_READ_OK) /* Used for read information numbers */
2020 { 2020 {
2021 simStatus = MFW_SIMOP_UNKNOWN; 2021 simStatus = MFW_SIMOP_UNKNOWN;
2022 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2022 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2023 } 2023 }
2024 else 2024 else
2025 { 2025 {
2026 csProfile.result = MFW_SIMOP_READ_ERR; 2026 csProfile.result = MFW_SIMOP_READ_ERR;
2027 memset(csProfile.csp, 0, sizeof(csProfile.csp)); 2027 memset(csProfile.csp, 0, sizeof(csProfile.csp));
2028 cphs_signal(E_CPHS_GET_CSP, &csProfile); 2028 cphs_signal(E_CPHS_GET_CSP, &csProfile);
2029 } 2029 }
2046 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2046 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2047 return; 2047 return;
2048 } 2048 }
2049 2049
2050 /* Read the first information numbers record */ 2050 /* Read the first information numbers record */
2051 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, 1, 0)) 2051 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, 1, 0))
2052 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2052 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2053 else 2053 else
2054 cphsPrevRead = SIM_CPHS_INFN; 2054 cphsPrevRead = SIM_CPHS_INFN;
2055 } 2055 }
2056 else 2056 else
2081 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2081 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2082 else 2082 else
2083 { 2083 {
2084 if (cphsPrevRead == SIM_CPHS_INFN) 2084 if (cphsPrevRead == SIM_CPHS_INFN)
2085 { 2085 {
2086 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, rcd_num, dataLen)) 2086 if (!cphs_read_sim_rcd(SIM_CPHS_INFN, rcd_num, dataLen))
2087 { 2087 {
2088 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2088 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2089 } 2089 }
2090 else 2090 else
2091 { 2091 {
2094 } 2094 }
2095 else 2095 else
2096 { 2096 {
2097 if (cphsPrevRead == SIM_CPHS_INFN2) 2097 if (cphsPrevRead == SIM_CPHS_INFN2)
2098 { 2098 {
2099 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, rcd_num, dataLen)) 2099 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, rcd_num, dataLen))
2100 { 2100 {
2101 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2101 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2102 } 2102 }
2103 else 2103 else
2104 { 2104 {
2127 2127
2128 #ifdef FF_2TO1_PS 2128 #ifdef FF_2TO1_PS
2129 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR ) /* VO patch 040501 - remove dataLen and pData check */ 2129 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR ) /* VO patch 040501 - remove dataLen and pData check */
2130 #else 2130 #else
2131 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR ) /* VO patch 040501 - remove dataLen and pData check */ 2131 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR ) /* VO patch 040501 - remove dataLen and pData check */
2132 #endif 2132 #endif
2133 { 2133 {
2134 if (simStatus EQ MFW_SIMOP_READ_OK) /* Read entry of information numbers */ 2134 if (simStatus EQ MFW_SIMOP_READ_OK) /* Read entry of information numbers */
2135 { 2135 {
2136 simStatus = MFW_SIMOP_UNKNOWN; 2136 simStatus = MFW_SIMOP_UNKNOWN;
2137 infoEntry.result = MFW_SIMOP_READ_ERR; 2137 infoEntry.result = MFW_SIMOP_READ_ERR;
2138 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); 2138 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry);
2139 } 2139 }
2140 else 2140 else
2141 {// if we are here then its possible the read of 7F20 6F19 failed. 2141 {// if we are here then its possible the read of 7F20 6F19 failed.
2142 2142
2143 if (cphsPrevRead == SIM_CPHS_INFN) 2143 if (cphsPrevRead == SIM_CPHS_INFN)
2144 { 2144 {
2145 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0)) 2145 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0))
2146 { 2146 {
2147 infoEntry.result = MFW_SIMOP_READ_ERR; 2147 infoEntry.result = MFW_SIMOP_READ_ERR;
2148 cphs_signal(E_CPHS_GET_INFO_LIST, &infoEntry); 2148 cphs_signal(E_CPHS_GET_INFO_LIST, &infoEntry);
2149 } 2149 }
2150 else 2150 else
2152 cphsPrevRead = SIM_CPHS_INFN2; 2152 cphsPrevRead = SIM_CPHS_INFN2;
2153 } 2153 }
2154 } 2154 }
2155 else 2155 else
2156 { 2156 {
2157 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2157 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2158 } 2158 }
2159 } 2159 }
2160 } 2160 }
2161 else 2161 else
2162 { 2162 {
2176 cphs_req_info_num_read(startIdx, dataLen); 2176 cphs_req_info_num_read(startIdx, dataLen);
2177 } 2177 }
2178 else /* Read list of information numbers */ 2178 else /* Read list of information numbers */
2179 { 2179 {
2180 /* VO patch 040501 - add dataLen check: if (patch) else ... */ 2180 /* VO patch 040501 - add dataLen check: if (patch) else ... */
2181 if (dataLen < MFW_CPHS_MIN_INS_SIZE ) 2181 if (dataLen < MFW_CPHS_MIN_INS_SIZE )
2182 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2182 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2183 else 2183 else
2184 { 2184 {
2185 if (idxLevel EQ 1) /* read this entry */ 2185 if (idxLevel EQ 1) /* read this entry */
2186 cphs_read_info_num(table_id); 2186 cphs_read_info_num(table_id);
2217 2217
2218 #ifdef FF_2TO1_PS 2218 #ifdef FF_2TO1_PS
2219 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR OR 2219 if ( simShrdPrm.atb[table_id].errCode NEQ CAUSE_SIM_NO_ERROR OR
2220 #else 2220 #else
2221 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR OR 2221 if ( simShrdPrm.atb[table_id].errCode NEQ SIM_NO_ERROR OR
2222 #endif 2222 #endif
2223 pData EQ NULL OR 2223 pData EQ NULL OR
2224 dataLen < MFW_CPHS_MIN_INS_SIZE ) 2224 dataLen < MFW_CPHS_MIN_INS_SIZE )
2225 { 2225 {
2226 if (simStatus EQ MFW_SIMOP_READ_OK) /* Read entry of information numbers */ 2226 if (simStatus EQ MFW_SIMOP_READ_OK) /* Read entry of information numbers */
2227 { 2227 {
2233 {// if we are here then its possible the read of 7F20 6F19 failed. 2233 {// if we are here then its possible the read of 7F20 6F19 failed.
2234 // so we must try reading 7F10 EA01 instead. 2234 // so we must try reading 7F10 EA01 instead.
2235 2235
2236 if (cphsPrevRead == SIM_CPHS_INFN2) 2236 if (cphsPrevRead == SIM_CPHS_INFN2)
2237 { 2237 {
2238 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0)) 2238 if (!cphs_read_sim_rcd(SIM_CPHS_INFN2, 1, 0))
2239 { 2239 {
2240 infoEntry.result = MFW_SIMOP_READ_ERR; 2240 infoEntry.result = MFW_SIMOP_READ_ERR;
2241 cphs_signal(E_CPHS_GET_INFO_LIST, &infoEntry); 2241 cphs_signal(E_CPHS_GET_INFO_LIST, &infoEntry);
2242 } 2242 }
2243 else 2243 else
2245 cphsPrevRead = SIM_CPHS_INFN2; 2245 cphsPrevRead = SIM_CPHS_INFN2;
2246 } 2246 }
2247 } 2247 }
2248 else 2248 else
2249 { 2249 {
2250 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2250 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2251 } 2251 }
2252 } 2252 }
2253 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); // correct ??? VO 2253 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); // correct ??? VO
2254 } 2254 }
2255 else 2255 else
2256 { 2256 {
2257 if (simStatus EQ MFW_SIMOP_READ_OK) 2257 if (simStatus EQ MFW_SIMOP_READ_OK)
2258 { 2258 {
2259 /* Read entry of information numbers */ 2259 /* Read entry of information numbers */
2260 alphaLen = *pData; 2260 alphaLen = *pData;
2261 if (alphaLen) 2261 if (alphaLen)
2262 { 2262 {
2263 /* copy/encode entry */ 2263 /* copy/encode entry */
2264 infoEntry.index = recNr; 2264 infoEntry.index = recNr;
2265 infoEntry.entryStat = *(pData + 1); 2265 infoEntry.entryStat = *(pData + 1);
2266 2266
2267 cmhPHB_getMfwTagNt(pData + 2, alphaLen, 2267 cmhPHB_getMfwTagNt(pData + 2, alphaLen,
2268 infoEntry.alpha.data, &infoEntry.alpha.len); 2268 infoEntry.alpha.data, &infoEntry.alpha.len);
2269 2269
2270 pData += alphaLen + 2; 2270 pData += alphaLen + 2;
2271 2271
2272 if (*pData NEQ 0xFF) 2272 if (*pData NEQ 0xFF)
2289 } 2289 }
2290 infoEntry.result = MFW_SIMOP_READ_OK; 2290 infoEntry.result = MFW_SIMOP_READ_OK;
2291 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry); 2291 cphs_signal(E_CPHS_GET_INFO_NUM, &infoEntry);
2292 return; 2292 return;
2293 } 2293 }
2294 else if ((*(pData + 1) & 0x0F) < idxLevel) 2294 else if ((*(pData + 1) & 0x0F) < idxLevel)
2295 { 2295 {
2296 /* The index level is out the wished index level. */ 2296 /* The index level is out the wished index level. */
2297 cphs_signal(E_CPHS_GET_INFO_LIST, &numList); 2297 cphs_signal(E_CPHS_GET_INFO_LIST, &numList);
2298 } 2298 }
2299 else if ((*(pData + 1) & 0x0F) > idxLevel) 2299 else if ((*(pData + 1) & 0x0F) > idxLevel)
2300 { 2300 {
2301 /* This is not wished index level. Read the next */ 2301 /* This is not wished index level. Read the next */
2302 recNr++; 2302 recNr++;
2303 cphs_req_info_num_read(recNr, dataLen); 2303 cphs_req_info_num_read(recNr, dataLen);
2304 } 2304 }
2311 /* copy/encode this entry in list */ 2311 /* copy/encode this entry in list */
2312 numList.level = idxLevel; 2312 numList.level = idxLevel;
2313 numList.entry[numList.count].index = recNr; 2313 numList.entry[numList.count].index = recNr;
2314 numList.entry[numList.count].entryStat = *(pData + 1) & 0x7F; /* set bit 8 to 0 */ 2314 numList.entry[numList.count].entryStat = *(pData + 1) & 0x7F; /* set bit 8 to 0 */
2315 2315
2316 cmhPHB_getMfwTagNt(pData + 2, alphaLen, 2316 cmhPHB_getMfwTagNt(pData + 2, alphaLen,
2317 numList.entry[numList.count].alpha.data, 2317 numList.entry[numList.count].alpha.data,
2318 &numList.entry[numList.count].alpha.len); 2318 &numList.entry[numList.count].alpha.len);
2319 2319
2320 pData += alphaLen + 2; 2320 pData += alphaLen + 2;
2321 2321
2322 if (*pData NEQ 0xFF) 2322 if (*pData NEQ 0xFF)
2348 #ifdef PCM_2_FFS 2348 #ifdef PCM_2_FFS
2349 T_PSPDF_MBN mbn; 2349 T_PSPDF_MBN mbn;
2350 #else 2350 #else
2351 EF_MBN mbn; 2351 EF_MBN mbn;
2352 #endif 2352 #endif
2353 2353
2354 T_ACI_TOA numTp; 2354 T_ACI_TOA numTp;
2355 int i; 2355 int i;
2356 USHORT max_rcd; 2356 USHORT max_rcd;
2357 2357
2358 for (i=0; i<MAX_CPHS_ENTRY; i++) 2358 for (i=0; i<MAX_CPHS_ENTRY; i++)
2359 { 2359 {
2360 #ifdef PCM_2_FFS 2360 #ifdef PCM_2_FFS
2361 if (ffs_ReadRecord((UBYTE *)PSPDF_MBN_ID, (UBYTE *)&mbn, 2361 if (ffs_ReadRecord((UBYTE *)PSPDF_MBN_ID, (UBYTE *)&mbn,
2362 sizeof( T_PSPDF_MBN ), (USHORT)(i+1), 1 ) == sizeof( T_PSPDF_MBN ) ) 2362 sizeof( T_PSPDF_MBN ), (USHORT)(i+1), 1 ) == sizeof( T_PSPDF_MBN ) )
2363 2363
2364 #else 2364 #else
2365 if (pcm_ReadRecord((UBYTE *)EF_MBN_ID, 2365 if (pcm_ReadRecord((UBYTE *)EF_MBN_ID,
2366 (USHORT)(i+1), 2366 (USHORT)(i+1),
2367 SIZE_EF_MBN, 2367 SIZE_EF_MBN,
2368 (UBYTE *)&mbn, 2368 (UBYTE *)&mbn,
2369 &version, 2369 &version,
2370 &max_rcd) == PCM_OK) 2370 &max_rcd) == PCM_OK)
2371 #endif 2371 #endif
2372 2372
2373 { 2373 {
2374 if (mbn.len) 2374 if (mbn.len)
2375 { 2375 {
2376 mbNum.entries[mbNum.count].index = i+1; 2376 mbNum.entries[mbNum.count].index = i+1;
2377 cmhPHB_getAdrStr ( (char *)mbNum.entries[mbNum.count].number, 2377 cmhPHB_getAdrStr ( (char *)mbNum.entries[mbNum.count].number,
2378 PHB_MAX_LEN - 1, mbn.mbNum, mbn.len ); 2378 PHB_MAX_LEN - 1, mbn.mbNum, mbn.len );
2379 cmhPHB_getMfwTagNt ( mbn.alphId, 10, 2379 cmhPHB_getMfwTagNt ( mbn.alphId, 10,
2380 mbNum.entries[mbNum.count].alpha.data, 2380 mbNum.entries[mbNum.count].alpha.data,
2381 &mbNum.entries[mbNum.count].alpha.len ); 2381 &mbNum.entries[mbNum.count].alpha.len );
2382 cmhPHB_toaDmrg ( mbn.numTp, &numTp ); 2382 cmhPHB_toaDmrg ( mbn.numTp, &numTp );
2383 mbNum.entries[mbNum.count].ton = phb_cvtTon(numTp.ton); 2383 mbNum.entries[mbNum.count].ton = phb_cvtTon(numTp.ton);
2384 mbNum.entries[mbNum.count].npi = phb_cvtNpi(numTp.npi); 2384 mbNum.entries[mbNum.count].npi = phb_cvtNpi(numTp.npi);
2385 mbNum.entries[mbNum.count].service = i; 2385 mbNum.entries[mbNum.count].service = i;
2410 UBYTE result; 2410 UBYTE result;
2411 UBYTE outLen; 2411 UBYTE outLen;
2412 2412
2413 len = MINIMUM ( MAX_PCM_MAILBOX_LEN, entry->alpha.len); 2413 len = MINIMUM ( MAX_PCM_MAILBOX_LEN, entry->alpha.len);
2414 text.len = len; 2414 text.len = len;
2415 memcpy(text.data, entry->alpha.data, len); 2415 memcpy(text.data, entry->alpha.data, len);
2416 text.cs = CS_Sim; 2416 text.cs = CS_Sim;
2417 cmhPHB_getMfwTagSim ( &text, FFS_flashData.mbn_AlphId, &outLen, MAX_PCM_MAILBOX_LEN ); 2417 cmhPHB_getMfwTagSim ( &text, FFS_flashData.mbn_AlphId, &outLen, MAX_PCM_MAILBOX_LEN );
2418 2418
2419 if ( entry->number[0] EQ '+') 2419 if ( entry->number[0] EQ '+')
2420 { 2420 {
2493 } 2493 }
2494 } 2494 }
2495 2495
2496 info->selectedLine = alsStatus.selectedLine; 2496 info->selectedLine = alsStatus.selectedLine;
2497 info->status = alsStatus.status; 2497 info->status = alsStatus.status;
2498 2498
2499 } 2499 }
2500 2500
2501 /* 2501 /*
2502 +-----------------------------------------------------------------------+ 2502 +-----------------------------------------------------------------------+
2503 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | 2503 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS |
2519 2519
2520 TRACE_FUNCTION ("cphs_write_eeprom_als()"); 2520 TRACE_FUNCTION ("cphs_write_eeprom_als()");
2521 { 2521 {
2522 if (alsStatus.status EQ MFW_LINE_LOCKED) 2522 if (alsStatus.status EQ MFW_LINE_LOCKED)
2523 *res = MFW_SIMOP_WRITE_ERR; 2523 *res = MFW_SIMOP_WRITE_ERR;
2524 2524
2525 alsStatus.selectedLine = (T_MFW_LINE_INDEX)alsData; 2525 alsStatus.selectedLine = (T_MFW_LINE_INDEX)alsData;
2526 2526
2527 FFS_flashData.als_selLine = alsData; 2527 FFS_flashData.als_selLine = alsData;
2528 if (flash_write() == EFFS_OK) 2528 if (flash_write() == EFFS_OK)
2529 *res = MFW_SIMOP_WRITE_OK; 2529 *res = MFW_SIMOP_WRITE_OK;
2596 data_id, 2596 data_id,
2597 0, 2597 0,
2598 max_length, 2598 max_length,
2599 NULL, 2599 NULL,
2600 cphs_read_sim_dat_cb); 2600 cphs_read_sim_dat_cb);
2601 #endif 2601 #endif
2602 if (res NEQ AT_EXCT) 2602 if (res NEQ AT_EXCT)
2603 return FALSE; 2603 return FALSE;
2604 return TRUE; 2604 return TRUE;
2605 } 2605 }
2606 2606
2636 cphs_update_info_cnf(simShrdPrm.atb[table_id].errCode, 2636 cphs_update_info_cnf(simShrdPrm.atb[table_id].errCode,
2637 simShrdPrm.atb[table_id].exchData, 2637 simShrdPrm.atb[table_id].exchData,
2638 simShrdPrm.atb[table_id].dataLen); 2638 simShrdPrm.atb[table_id].dataLen);
2639 #endif 2639 #endif
2640 break; 2640 break;
2641 2641
2642 case SIM_CPHS_ONSTR: /* operator name string */ 2642 case SIM_CPHS_ONSTR: /* operator name string */
2643 cphs_read_ons(simShrdPrm.atb[table_id].errCode, 2643 cphs_read_ons(simShrdPrm.atb[table_id].errCode,
2644 simShrdPrm.atb[table_id].exchData, 2644 simShrdPrm.atb[table_id].exchData,
2645 simShrdPrm.atb[table_id].dataLen); 2645 simShrdPrm.atb[table_id].dataLen);
2646 break; 2646 break;
2647 2647
2648 case SIM_CPHS_ONSHF: /* operator name short form */ 2648 case SIM_CPHS_ONSHF: /* operator name short form */
2649 cphs_read_onsf(simShrdPrm.atb[table_id].errCode, 2649 cphs_read_onsf(simShrdPrm.atb[table_id].errCode,
2650 simShrdPrm.atb[table_id].exchData, 2650 simShrdPrm.atb[table_id].exchData,
2651 simShrdPrm.atb[table_id].dataLen); 2651 simShrdPrm.atb[table_id].dataLen);
2652 break; 2652 break;
2653 2653
2654 case SIM_CPHS_VMW: /* voice message waiting flag */ 2654 case SIM_CPHS_VMW: /* voice message waiting flag */
2655 /* PATCH VO 22.01.01 */ 2655 /* PATCH VO 22.01.01 */
2656 if (simStatus EQ MFW_SIMOP_WRITE_OK) 2656 if (simStatus EQ MFW_SIMOP_WRITE_OK)
2657 { 2657 {
2658 /* Determine the size of this field, and write the data. 2658 /* Determine the size of this field, and write the data.
2659 When the writing is not possible, write this voice 2659 When the writing is not possible, write this voice
2660 message waiting flag in EEPROM. */ 2660 message waiting flag in EEPROM. */
2661 simStatus = MFW_SIMOP_UNKNOWN; 2661 simStatus = MFW_SIMOP_UNKNOWN;
2662 #ifdef FF_2TO1_PS 2662 #ifdef FF_2TO1_PS
2663 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) 2663 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR )
2664 #else 2664 #else
2665 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) 2665 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR )
2666 #endif 2666 #endif
2667 { 2667 {
2668 dataLen = simShrdPrm.atb[table_id].dataLen; 2668 dataLen = simShrdPrm.atb[table_id].dataLen;
2669 /* Write voice message waiting flag. 2669 /* Write voice message waiting flag.
2670 When this writing failed, send event with "write error" parameter to MMI */ 2670 When this writing failed, send event with "write error" parameter to MMI */
2671 if (!cphs_write_sim_dat(SIM_CPHS_VMW, mbsData, dataLen)) 2671 if (!cphs_write_sim_dat(SIM_CPHS_VMW, mbsData, dataLen))
2672 { 2672 {
2673 result = MFW_SIMOP_WRITE_ERR; 2673 result = MFW_SIMOP_WRITE_ERR;
2674 cphs_signal(E_CPHS_SET_VC_STAT, &result); 2674 cphs_signal(E_CPHS_SET_VC_STAT, &result);
2675 } 2675 }
2676 } 2676 }
2687 simShrdPrm.atb[table_id].dataLen); 2687 simShrdPrm.atb[table_id].dataLen);
2688 break; 2688 break;
2689 2689
2690 case SIM_CPHS_CFF: /* call forwarding flag */ 2690 case SIM_CPHS_CFF: /* call forwarding flag */
2691 /* PATCH VO 22.01.01 */ 2691 /* PATCH VO 22.01.01 */
2692 if (simStatus EQ MFW_SIMOP_WRITE_OK) 2692 if (simStatus EQ MFW_SIMOP_WRITE_OK)
2693 { 2693 {
2694 /* Determine the size of this field, and write the data. 2694 /* Determine the size of this field, and write the data.
2695 When the writing is not possible, write this call forward flag in EEPROM*/ 2695 When the writing is not possible, write this call forward flag in EEPROM*/
2696 simStatus = MFW_SIMOP_UNKNOWN; 2696 simStatus = MFW_SIMOP_UNKNOWN;
2697 #ifdef FF_2TO1_PS 2697 #ifdef FF_2TO1_PS
2698 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) 2698 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR )
2699 #else 2699 #else
2700 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) 2700 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR )
2701 #endif 2701 #endif
2702 { 2702 {
2703 dataLen = simShrdPrm.atb[table_id].dataLen; 2703 dataLen = simShrdPrm.atb[table_id].dataLen;
2704 /* Write call forwarding flag. 2704 /* Write call forwarding flag.
2705 When this writing failed, send event with "write error" parameter to MMI */ 2705 When this writing failed, send event with "write error" parameter to MMI */
2706 TRACE_EVENT_P2("cphs_read_sim_dat_cb():%x %x",dvData[0],dvData[1]); 2706 TRACE_EVENT_P2("cphs_read_sim_dat_cb():%x %x",dvData[0],dvData[1]);
2707 if (!cphs_write_sim_dat(SIM_CPHS_CFF, dvData, dataLen)) 2707 if (!cphs_write_sim_dat(SIM_CPHS_CFF, dvData, dataLen))
2708 { 2708 {
2709 result = MFW_SIMOP_WRITE_ERR; 2709 result = MFW_SIMOP_WRITE_ERR;
2710 cphs_signal(E_CPHS_SET_DV_STAT, &result); 2710 cphs_signal(E_CPHS_SET_DV_STAT, &result);
2711 } 2711 }
2712 } 2712 }
2775 data_id, 2775 data_id,
2776 0, 2776 0,
2777 length, 2777 length,
2778 data, 2778 data,
2779 cphs_write_sim_dat_cb); 2779 cphs_write_sim_dat_cb);
2780 #endif 2780 #endif
2781 2781
2782 if (res NEQ AT_EXCT) 2782 if (res NEQ AT_EXCT)
2783 return FALSE; 2783 return FALSE;
2784 2784
2785 return TRUE; 2785 return TRUE;
2809 case SIM_CPHS_VMW: /* voice message waiting flag */ 2809 case SIM_CPHS_VMW: /* voice message waiting flag */
2810 #ifdef FF_2TO1_PS 2810 #ifdef FF_2TO1_PS
2811 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) 2811 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR )
2812 #else 2812 #else
2813 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) 2813 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR )
2814 #endif 2814 #endif
2815 { 2815 {
2816 result = MFW_SIMOP_WRITE_OK; 2816 result = MFW_SIMOP_WRITE_OK;
2817 cphs_signal(E_CPHS_SET_VC_STAT, &result); 2817 cphs_signal(E_CPHS_SET_VC_STAT, &result);
2818 } 2818 }
2819 else 2819 else
2826 case SIM_CPHS_CFF: /* call forwarding flag */ 2826 case SIM_CPHS_CFF: /* call forwarding flag */
2827 #ifdef FF_2TO1_PS 2827 #ifdef FF_2TO1_PS
2828 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) 2828 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR )
2829 #else 2829 #else
2830 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) 2830 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR )
2831 #endif 2831 #endif
2832 { 2832 {
2833 result = MFW_SIMOP_WRITE_OK; 2833 result = MFW_SIMOP_WRITE_OK;
2834 cphs_signal(E_CPHS_SET_DV_STAT, &result); 2834 cphs_signal(E_CPHS_SET_DV_STAT, &result);
2835 } 2835 }
2836 else 2836 else
2837 { 2837 {
2838 result = MFW_SIMOP_WRITE_ERR; 2838 result = MFW_SIMOP_WRITE_ERR;
2839 cphs_signal(E_CPHS_SET_DV_STAT, &result); 2839 cphs_signal(E_CPHS_SET_DV_STAT, &result);
2840 } 2840 }
2841 break; 2841 break;
2842 2842
2843 default: 2843 default:
2844 break; 2844 break;
2845 } 2845 }
2846 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; 2846 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE;
2847 } 2847 }
2888 data_id, 2888 data_id,
2889 rcd_num, 2889 rcd_num,
2890 dataLen, 2890 dataLen,
2891 NULL, 2891 NULL,
2892 cphs_read_sim_rcd_cb); 2892 cphs_read_sim_rcd_cb);
2893 #endif 2893 #endif
2894 2894
2895 if (res NEQ AT_EXCT) 2895 if (res NEQ AT_EXCT)
2896 return FALSE; 2896 return FALSE;
2897 2897
2898 return TRUE; 2898 return TRUE;
2915 TRACE_FUNCTION ("cphs_read_sim_rcd_cb()"); 2915 TRACE_FUNCTION ("cphs_read_sim_rcd_cb()");
2916 /***************************Go-lite Optimization changes Start***********************/ 2916 /***************************Go-lite Optimization changes Start***********************/
2917 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 2917 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
2918 TRACE_EVENT_P1("SIM Error code!!!%d", simShrdPrm.atb[table_id].errCode); 2918 TRACE_EVENT_P1("SIM Error code!!!%d", simShrdPrm.atb[table_id].errCode);
2919 2919
2920 2920
2921 TRACE_EVENT_P1("tableid: %d", table_id); 2921 TRACE_EVENT_P1("tableid: %d", table_id);
2922 /***************************Go-lite Optimization changes end***********************/ 2922 /***************************Go-lite Optimization changes end***********************/
2923 switch (simShrdPrm.atb[table_id].reqDataFld) 2923 switch (simShrdPrm.atb[table_id].reqDataFld)
2924 { 2924 {
2925 case SIM_CPHS_MBXN: /* mailbox numbers */ 2925 case SIM_CPHS_MBXN: /* mailbox numbers */
2926 if (simStatus EQ MFW_SIMOP_WRITE_OK) 2926 if (simStatus EQ MFW_SIMOP_WRITE_OK)
2927 { 2927 {
2928 /* Determine the size of record, and write a new record. 2928 /* Determine the size of record, and write a new record.
2929 When the writing is not possible, write this mailbox 2929 When the writing is not possible, write this mailbox
2930 number in EEPROM. */ 2930 number in EEPROM. */
2931 simStatus = MFW_SIMOP_UNKNOWN; 2931 simStatus = MFW_SIMOP_UNKNOWN;
2932 #ifdef FF_2TO1_PS 2932 #ifdef FF_2TO1_PS
2933 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) 2933 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR )
2934 #else 2934 #else
2935 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) 2935 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR )
2936 #endif 2936 #endif
2937 { 2937 {
2938 dataLen = simShrdPrm.atb[table_id].dataLen; 2938 dataLen = simShrdPrm.atb[table_id].dataLen;
2939 /* allocate mbnData (sizeof(dataLen)) */ 2939 /* allocate mbnData (sizeof(dataLen)) */
2940 // Mar 30, 2005 REF: CRR 29986 xpradipg 2940 // Mar 30, 2005 REF: CRR 29986 xpradipg
2941 // the dynamic allocation is done here, if the write fails it is deallocated 2941 // the dynamic allocation is done here, if the write fails it is deallocated
2946 { 2946 {
2947 #endif 2947 #endif
2948 ubCphsMbExtRecNo = 0; 2948 ubCphsMbExtRecNo = 0;
2949 2949
2950 cphs_build_mbn_data(mbnData, dataLen); 2950 cphs_build_mbn_data(mbnData, dataLen);
2951 2951
2952 if (!cphs_write_sim_rcd(SIM_CPHS_MBXN, vcEntry->index, 2952 if (!cphs_write_sim_rcd(SIM_CPHS_MBXN, vcEntry->index,
2953 mbnData, dataLen)) 2953 mbnData, dataLen))
2954 { 2954 {
2955 cphs_write_eeprom_mailbox(vcEntry); 2955 cphs_write_eeprom_mailbox(vcEntry);
2956 } 2956 }
2957 #ifdef FF_MMI_OPTIM 2957 #ifdef FF_MMI_OPTIM
2958 } 2958 }
2959 #endif 2959 #endif
2960 } 2960 }
2961 else 2961 else
2962 cphs_write_eeprom_mailbox(vcEntry); 2962 cphs_write_eeprom_mailbox(vcEntry);
2963 } 2963 }
2964 else 2964 else
2967 2967
2968 case SIM_CPHS_INFN: /* information numbers */ 2968 case SIM_CPHS_INFN: /* information numbers */
2969 if (simShrdPrm.atb[table_id].recNr EQ 1) 2969 if (simShrdPrm.atb[table_id].recNr EQ 1)
2970 { 2970 {
2971 /* VO patch 150501 */ 2971 /* VO patch 150501 */
2972 if ((startIdx EQ 1) AND (simStatus EQ MFW_SIMOP_READ_OK)) 2972 if ((startIdx EQ 1) AND (simStatus EQ MFW_SIMOP_READ_OK))
2973 cphs_read_info_num(table_id); 2973 cphs_read_info_num(table_id);
2974 else 2974 else
2975 /* VO patch 150501 end */ 2975 /* VO patch 150501 end */
2976 cphs_read_first_info_num(table_id); 2976 cphs_read_first_info_num(table_id);
2977 } 2977 }
2978 else 2978 else
2979 cphs_read_info_num(table_id); 2979 cphs_read_info_num(table_id);
2980 break; 2980 break;
2981 2981
2982 case SIM_CPHS_INFN2: /* information numbers 2 - 7F10 'EA01' selected if SIM_CPHS_INFN '6F19' isn't there*/ 2982 case SIM_CPHS_INFN2: /* information numbers 2 - 7F10 'EA01' selected if SIM_CPHS_INFN '6F19' isn't there*/
2983 if (simShrdPrm.atb[table_id].recNr EQ 1) 2983 if (simShrdPrm.atb[table_id].recNr EQ 1)
2984 { 2984 {
2985 /* VO patch 150501 */ 2985 /* VO patch 150501 */
2986 if ((startIdx EQ 1) AND (simStatus EQ MFW_SIMOP_READ_OK)) 2986 if ((startIdx EQ 1) AND (simStatus EQ MFW_SIMOP_READ_OK))
2987 cphs_read_info_num(table_id); 2987 cphs_read_info_num(table_id);
2988 else 2988 else
2989 /* VO patch end */ 2989 /* VO patch end */
2990 cphs_read_first_info_num(table_id); 2990 cphs_read_first_info_num(table_id);
2991 } 2991 }
2992 else 2992 else
2993 cphs_read_info_num(table_id); 2993 cphs_read_info_num(table_id);
2994 break; 2994 break;
2995 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/ 2995 /*June 27,2007 OMAPS00134788 x0066814(Geetha)*/
2996 case SIM_EXT1: 2996 case SIM_EXT1:
2997 2997
2998 cphs_read_ext1(table_id); 2998 cphs_read_ext1(table_id);
2999 2999
3000 3000
3001 3001
3002 break; 3002 break;
3003 3003
3004 default: 3004 default:
3005 break; 3005 break;
3006 } 3006 }
3007 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; 3007 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE;
3008 } 3008 }
3044 data_id, 3044 data_id,
3045 rcd_num, 3045 rcd_num,
3046 dataLen, 3046 dataLen,
3047 data, 3047 data,
3048 cphs_write_sim_rcd_cb); 3048 cphs_write_sim_rcd_cb);
3049 #endif 3049 #endif
3050 3050
3051 if (res NEQ AT_EXCT) 3051 if (res NEQ AT_EXCT)
3052 return FALSE; 3052 return FALSE;
3053 3053
3054 return TRUE; 3054 return TRUE;
3080 unsigned int length_no = 0; 3080 unsigned int length_no = 0;
3081 UBYTE byteno = 0; 3081 UBYTE byteno = 0;
3082 3082
3083 TRACE_FUNCTION ( "cphs_build_ext1()" ); 3083 TRACE_FUNCTION ( "cphs_build_ext1()" );
3084 3084
3085 memset( pData, MFW_INVALID_SIM_DATA, 13); 3085 memset( pData, MFW_INVALID_SIM_DATA, 13);
3086 3086
3087 3087
3088 *pData = 0x02; //implies that the EF contains additional data 3088 *pData = 0x02; //implies that the EF contains additional data
3089 temp_data = pData; 3089 temp_data = pData;
3090 3090
3091 /* number data and TON/NPI data */ 3091 /* number data and TON/NPI data */
3092 if ( vcEntry->number[0] EQ '+' ) 3092 if ( vcEntry->number[0] EQ '+' )
3093 { 3093 {
3094 vcEntry->ton = TON_International; 3094 vcEntry->ton = TON_International;
3095 pNumber = &vcEntry->number[1]; 3095 pNumber = &vcEntry->number[1];
3101 cmhPHB_getAdrBcd ( ext1num, &numLen, 3101 cmhPHB_getAdrBcd ( ext1num, &numLen,
3102 PHB_MAX_LEN - 1, (CHAR *) (pNumber)); 3102 PHB_MAX_LEN - 1, (CHAR *) (pNumber));
3103 3103
3104 for(i=0; i < strlen((CHAR *)pNumber); i++) 3104 for(i=0; i < strlen((CHAR *)pNumber); i++)
3105 { 3105 {
3106 TRACE_EVENT_P2("pNumber[%d] : %c", i,pNumber[i]); 3106 TRACE_EVENT_P2("pNumber[%d] : %c", i,pNumber[i]);
3107 } 3107 }
3108 3108
3109 3109
3110 length_no = numLen; //strlen( (CHAR *)pNumber ); 3110 length_no = numLen; //strlen( (CHAR *)pNumber );
3111 byteno = numLen; //( length_no / 2 ) + ( length_no % 2 ); 3111 byteno = numLen; //( length_no / 2 ) + ( length_no % 2 );
3112 3112
3113 indx = ( (ubCurrExtRcWrite + 1) * 10 ); 3113 indx = ( (ubCurrExtRcWrite + 1) * 10 );
3114 3114
3115 TRACE_EVENT_P1("length_no: %d", length_no); 3115 TRACE_EVENT_P1("length_no: %d", length_no);
3116 TRACE_EVENT_P1("indx: %d", indx); 3116 TRACE_EVENT_P1("indx: %d", indx);
3117 3117
3118 if ( ( byteno - indx ) > 10 ) 3118 if ( ( byteno - indx ) > 10 )
3119 { 3119 {
3120 count = 10; 3120 count = 10;
3121 } 3121 }
3122 else 3122 else
3126 3126
3127 TRACE_EVENT_P1("count: %d", count); 3127 TRACE_EVENT_P1("count: %d", count);
3128 3128
3129 if ( count != 0 ) 3129 if ( count != 0 )
3130 { 3130 {
3131 memcpy ( (void *)(pData + 2), (void *)&(ext1num[indx]), 3131 memcpy ( (void *)(pData + 2), (void *)&(ext1num[indx]),
3132 ( count ) ); 3132 ( count ) );
3133 } 3133 }
3134 3134
3135 for(i=0; i < count; i++) 3135 for(i=0; i < count; i++)
3136 { 3136 {
3137 TRACE_EVENT_P2("pData + 2 + %d : %x", i, *(pData + 2+i)); 3137 TRACE_EVENT_P2("pData + 2 + %d : %x", i, *(pData + 2+i));
3138 } 3138 }
3139 3139
3140 3140
3141 *(pData+1) = ( count ); 3141 *(pData+1) = ( count );
3142 3142
3143 pData += 12; 3143 pData += 12;
3144 3144
3145 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = sFreeRec; 3145 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = sFreeRec;
3147 TRACE_EVENT_P1("ubCurrExtRcWrite: %d", ubCurrExtRcWrite); 3147 TRACE_EVENT_P1("ubCurrExtRcWrite: %d", ubCurrExtRcWrite);
3148 3148
3149 TRACE_EVENT_P1("mbNum...ext_rec_idx[ubCurrExtRcWrite]: %d", mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite]); 3149 TRACE_EVENT_P1("mbNum...ext_rec_idx[ubCurrExtRcWrite]: %d", mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite]);
3150 3150
3151 ubCurrExtRcWrite++; 3151 ubCurrExtRcWrite++;
3152 3152
3153 if ( ubCphsMbExtRecNo <= ubCurrExtRcWrite ) 3153 if ( ubCphsMbExtRecNo <= ubCurrExtRcWrite )
3154 { 3154 {
3155 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) ) 3155 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) )
3156 { 3156 {
3157 TRACE_FUNCTION ("cphs_build_ext1() : ubCphsMbExtRecNo <= ubCurrExtRcWrite; no free rec"); 3157 TRACE_FUNCTION ("cphs_build_ext1() : ubCphsMbExtRecNo <= ubCurrExtRcWrite; no free rec");
3158 *(pData) = 0xFF; 3158 *(pData) = 0xFF;
3159 return FALSE; 3159 return FALSE;
3160 } 3160 }
3161 3161
3162 rec_no_to_write = sFreeRec; 3162 rec_no_to_write = sFreeRec;
3163 3163
3164 *(pData) = 0xFF; 3164 *(pData) = 0xFF;
3165 } 3165 }
3166 else 3166 else
3167 { 3167 {
3168 rec_no_to_write = sFreeRec; 3168 rec_no_to_write = sFreeRec;
3169 3169
3170 sFreeRec = 0; 3170 sFreeRec = 0;
3171 3171
3172 if ( mbNum.entries[vcEntry->list_index].ext_rec_number > ubCurrExtRcWrite ) 3172 if ( mbNum.entries[vcEntry->list_index].ext_rec_number > ubCurrExtRcWrite )
3173 { 3173 {
3174 3174
3175 TRACE_FUNCTION("ext rec taken from within"); 3175 TRACE_FUNCTION("ext rec taken from within");
3176 sFreeRec = mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite]; 3176 sFreeRec = mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite];
3177 } 3177 }
3178 else 3178 else
3179 { 3179 {
3180 3180
3181 TRACE_FUNCTION("ext rec taken from cmh"); 3181 TRACE_FUNCTION("ext rec taken from cmh");
3182 #ifdef TI_PS_FFS_PHB 3182 #ifdef TI_PS_FFS_PHB
3183 sFreeRec = cmh_Query_free_ext_record(); 3183 sFreeRec = cmh_Query_free_ext_record();
3184 #endif 3184 #endif
3185 } 3185 }
3186 3186
3187 TRACE_EVENT_P1("sFreeRec : %d", sFreeRec); 3187 TRACE_EVENT_P1("sFreeRec : %d", sFreeRec);
3188 3188
3189 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) ) 3189 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) )
3190 { 3190 {
3191 TRACE_FUNCTION ("cphs_build_ext1() : No free records available"); 3191 TRACE_FUNCTION ("cphs_build_ext1() : No free records available");
3192 *(pData) = 0xFF; 3192 *(pData) = 0xFF;
3193 } 3193 }
3194 else 3194 else
3195 { 3195 {
3196 *(pData) = 0x00; 3196 *(pData) = 0x00;
3197 *(pData) = sFreeRec; 3197 *(pData) = sFreeRec;
3198 TRACE_FUNCTION("cmh_PHB_update_ext_record to be"); 3198 TRACE_FUNCTION("cmh_PHB_update_ext_record to be");
3199 #ifdef TI_PS_FFS_PHB 3199 #ifdef TI_PS_FFS_PHB
3200 cmh_PHB_update_ext_record(sFreeRec,TRUE); 3200 cmh_PHB_update_ext_record(sFreeRec,TRUE);
3201 #endif 3201 #endif
3202 } 3202 }
3203 3203
3204 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = *(pData); 3204 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = *(pData);
3205 } 3205 }
3206 3206
3207 TRACE_EVENT_P1("rec_no_to_write : %d", rec_no_to_write); 3207 TRACE_EVENT_P1("rec_no_to_write : %d", rec_no_to_write);
3208 cphs_write_sim_rcd(SIM_EXT1, rec_no_to_write, temp_data, 13); 3208 cphs_write_sim_rcd(SIM_EXT1, rec_no_to_write, temp_data, 13);
3209 3209
3210 return TRUE; 3210 return TRUE;
3211 } 3211 }
3212 3212
3213 static UBYTE mfw_cphs_vm_write_cb_ext(void) 3213 static UBYTE mfw_cphs_vm_write_cb_ext(void)
3214 { 3214 {
3220 TRACE_EVENT_P1("ubCphsMbExtRecNo : %d", ubCphsMbExtRecNo); 3220 TRACE_EVENT_P1("ubCphsMbExtRecNo : %d", ubCphsMbExtRecNo);
3221 TRACE_EVENT_P1("ubCurrExtRcWrite : %d", ubCurrExtRcWrite); 3221 TRACE_EVENT_P1("ubCurrExtRcWrite : %d", ubCurrExtRcWrite);
3222 TRACE_EVENT_P2("idx, ext_rec_number : %d, %d", vcEntry->list_index, mbNum.entries[vcEntry->list_index].ext_rec_number); 3222 TRACE_EVENT_P2("idx, ext_rec_number : %d, %d", vcEntry->list_index, mbNum.entries[vcEntry->list_index].ext_rec_number);
3223 3223
3224 if ( ( ubCphsMbExtRecNo == 0 ) || ( ubCphsMbExtRecNo <= ubCurrExtRcWrite ) ) 3224 if ( ( ubCphsMbExtRecNo == 0 ) || ( ubCphsMbExtRecNo <= ubCurrExtRcWrite ) )
3225 { 3225 {
3226 3226
3227 TRACE_FUNCTION("inside if!"); 3227 TRACE_FUNCTION("inside if!");
3228 3228
3229 /* Flush any EXT Records, if any */ 3229 /* Flush any EXT Records, if any */
3230 if ( mbNum.entries[vcEntry->list_index].ext_rec_number > ubCphsMbExtRecNo ) 3230 if ( mbNum.entries[vcEntry->list_index].ext_rec_number > ubCphsMbExtRecNo )
3231 { 3231 {
3232 3232
3233 3233
3234 TRACE_FUNCTION("flush needed!--"); 3234 TRACE_FUNCTION("flush needed!--");
3235 3235
3236 if ( ubFlushRecords == 0 ) 3236 if ( ubFlushRecords == 0 )
3237 { 3237 {
3238 ubFlushRecords = 1; 3238 ubFlushRecords = 1;
3239 } 3239 }
3240 3240
3241 TRACE_EVENT_P1("ubFlushRecords : %d", ubFlushRecords); 3241 TRACE_EVENT_P1("ubFlushRecords : %d", ubFlushRecords);
3242 TRACE_EVENT_P1("i : %d", (ubCphsMbExtRecNo + ubFlushRecords - 1)); 3242 TRACE_EVENT_P1("i : %d", (ubCphsMbExtRecNo + ubFlushRecords - 1));
3243 TRACE_EVENT_P1("ext_rec_idx[i] : %d", mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1]); 3243 TRACE_EVENT_P1("ext_rec_idx[i] : %d", mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1]);
3244 3244
3245 memset ( (void *)&flush_data[0], 0xFF, 13 ); 3245 memset ( (void *)&flush_data[0], 0xFF, 13 );
3246 #ifdef TI_PS_FFS_PHB 3246 #ifdef TI_PS_FFS_PHB
3247 cmh_PHB_update_ext_record(mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1], 3247 cmh_PHB_update_ext_record(mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1],
3248 FALSE); 3248 FALSE);
3249 #endif 3249 #endif
3250 cphs_write_sim_rcd(SIM_EXT1, 3250 cphs_write_sim_rcd(SIM_EXT1,
3251 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1], 3251 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1],
3252 flush_data, 13); 3252 flush_data, 13);
3253 3253
3254 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1] = 0xFF; 3254 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCphsMbExtRecNo + ubFlushRecords - 1] = 0xFF;
3255 mbNum.entries[vcEntry->list_index].ext_rec_number--; 3255 mbNum.entries[vcEntry->list_index].ext_rec_number--;
3256 ubFlushRecords++; 3256 ubFlushRecords++;
3257 return 1; 3257 return 1;
3258 } 3258 }
3259 3259
3260 ubFlushRecords = 0; 3260 ubFlushRecords = 0;
3261 3261
3262 result = MFW_SIMOP_WRITE_OK; 3262 result = MFW_SIMOP_WRITE_OK;
3263 3263
3264 3264
3265 TRACE_FUNCTION("mfw_cphs_vm_write_cb_ext: write OK"); 3265 TRACE_FUNCTION("mfw_cphs_vm_write_cb_ext: write OK");
3266 cphs_signal(E_CPHS_SET_VC_NUM, &result); 3266 cphs_signal(E_CPHS_SET_VC_NUM, &result);
3267 3267
3268 // Mar 30, 2005 REF: CRR 29986 xpradipg 3268 // Mar 30, 2005 REF: CRR 29986 xpradipg
3269 // mbnData is deallocated, on successfull write operation 3269 // mbnData is deallocated, on successfull write operation
3270 #ifdef FF_MMI_OPTIM 3270 #ifdef FF_MMI_OPTIM
3271 if(mbnData) 3271 if(mbnData)
3272 mfwFree(mbnData,200); 3272 mfwFree(mbnData,200);
3273 #endif 3273 #endif
3274 3274
3275 return 0; 3275 return 0;
3276 3276
3277 } 3277 }
3278 else 3278 else
3279 { 3279 {
3280 ret_internal = cphs_build_ext1(ubExtRecData); 3280 ret_internal = cphs_build_ext1(ubExtRecData);
3281 if ( ret_internal == FALSE ) 3281 if ( ret_internal == FALSE )
3282 { 3282 {
3283 TRACE_FUNCTION("mfw_cphs_vm_write_cb_ext: cphs_build_ext1 returns FALSE"); 3283 TRACE_FUNCTION("mfw_cphs_vm_write_cb_ext: cphs_build_ext1 returns FALSE");
3284 3284
3285 result = MFW_SIMOP_WRITE_OK; 3285 result = MFW_SIMOP_WRITE_OK;
3286 3286
3287 cphs_signal(E_CPHS_SET_VC_NUM, &result); 3287 cphs_signal(E_CPHS_SET_VC_NUM, &result);
3288 3288
3289 // Mar 30, 2005 REF: CRR 29986 xpradipg 3289 // Mar 30, 2005 REF: CRR 29986 xpradipg
3290 // mbnData is deallocated, on successfull write operation 3290 // mbnData is deallocated, on successfull write operation
3291 #ifdef FF_MMI_OPTIM 3291 #ifdef FF_MMI_OPTIM
3292 if(mbnData) 3292 if(mbnData)
3293 mfwFree(mbnData,200); 3293 mfwFree(mbnData,200);
3294 #endif 3294 #endif
3295 3295
3296 return 0; 3296 return 0;
3297 } 3297 }
3298 } 3298 }
3299 3299
3300 return 1; 3300 return 1;
3301 } 3301 }
3315 { 3315 {
3316 UBYTE result; 3316 UBYTE result;
3317 UBYTE *data_write; 3317 UBYTE *data_write;
3318 UBYTE dataLen = 0; 3318 UBYTE dataLen = 0;
3319 UBYTE ret_internal = 0; 3319 UBYTE ret_internal = 0;
3320 3320
3321 TRACE_FUNCTION ("cphs_write_sim_rcd_cb()"); 3321 TRACE_FUNCTION ("cphs_write_sim_rcd_cb()");
3322 /***************************Go-lite Optimization changes Start***********************/ 3322 /***************************Go-lite Optimization changes Start***********************/
3323 //Aug 16, 2004 REF: CRR 24323 Deepa M.D 3323 //Aug 16, 2004 REF: CRR 24323 Deepa M.D
3324 TRACE_EVENT_P1("SIM Error code!!!%d", simShrdPrm.atb[table_id].errCode); 3324 TRACE_EVENT_P1("SIM Error code!!!%d", simShrdPrm.atb[table_id].errCode);
3325 /***************************Go-lite Optimization changes end***********************/ 3325 /***************************Go-lite Optimization changes end***********************/
3326 switch (simShrdPrm.atb[table_id].reqDataFld) 3326 switch (simShrdPrm.atb[table_id].reqDataFld)
3327 { 3327 {
3328 case SIM_CPHS_MBXN: /* mailbox numbers */ 3328 case SIM_CPHS_MBXN: /* mailbox numbers */
3329 3329
3330 #ifdef FF_2TO1_PS 3330 #ifdef FF_2TO1_PS
3331 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) 3331 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR )
3332 #else 3332 #else
3333 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) 3333 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR )
3334 #endif 3334 #endif
3335 { 3335 {
3336 result = MFW_SIMOP_WRITE_OK; 3336 result = MFW_SIMOP_WRITE_OK;
3337 3337
3338 ret_internal = mfw_cphs_vm_write_cb_ext(); 3338 ret_internal = mfw_cphs_vm_write_cb_ext();
3339 if ( ret_internal == 1 ) 3339 if ( ret_internal == 1 )
3343 } 3343 }
3344 else 3344 else
3345 { 3345 {
3346 cphs_write_eeprom_mailbox(vcEntry); 3346 cphs_write_eeprom_mailbox(vcEntry);
3347 } 3347 }
3348 3348
3349 break; 3349 break;
3350 3350
3351 case SIM_EXT1: /* mailbox ext numbers */ 3351 case SIM_EXT1: /* mailbox ext numbers */
3352 3352
3353 #ifdef FF_2TO1_PS 3353 #ifdef FF_2TO1_PS
3354 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR ) 3354 if ( simShrdPrm.atb[table_id].errCode EQ CAUSE_SIM_NO_ERROR )
3355 #else 3355 #else
3356 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR ) 3356 if ( simShrdPrm.atb[table_id].errCode EQ SIM_NO_ERROR )
3357 #endif 3357 #endif
3358 { 3358 {
3359 result = MFW_SIMOP_WRITE_OK; 3359 result = MFW_SIMOP_WRITE_OK;
3360 3360
3361 ret_internal = mfw_cphs_vm_write_cb_ext(); 3361 ret_internal = mfw_cphs_vm_write_cb_ext();
3362 if ( ret_internal == 1 ) 3362 if ( ret_internal == 1 )
3363 { 3363 {
3364 return; 3364 return;
3365 } 3365 }
3366 } 3366 }
3367 else 3367 else
3368 { 3368 {
3369 cphs_write_eeprom_mailbox(vcEntry); 3369 cphs_write_eeprom_mailbox(vcEntry);
3370 } 3370 }
3371 3371
3372 break; 3372 break;
3373 3373
3374 3374
3375 default: 3375 default:
3376 break; 3376 break;
3377 } 3377 }
3378 3378
3379 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; 3379 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE;
3380 } 3380 }
3381 3381
3382 /* 3382 /*
3383 +----------------------------------------------------------------------+ 3383 +----------------------------------------------------------------------+
3410 alphaLen = len - MFW_CPHS_MIN_MBN_SIZE; 3410 alphaLen = len - MFW_CPHS_MIN_MBN_SIZE;
3411 i = MINIMUM (alphaLen, vcEntry->alpha.len); 3411 i = MINIMUM (alphaLen, vcEntry->alpha.len);
3412 3412
3413 for ( j = 0; j < i; j++ ) 3413 for ( j = 0; j < i; j++ )
3414 data[j] = vcEntry->alpha.data[j]; 3414 data[j] = vcEntry->alpha.data[j];
3415 3415
3416 data += alphaLen; 3416 data += alphaLen;
3417 3417
3418 /* number data and TON/NPI data */ 3418 /* number data and TON/NPI data */
3419 if ( vcEntry->number[0] EQ '+' ) 3419 if ( vcEntry->number[0] EQ '+' )
3420 { 3420 {
3424 else 3424 else
3425 pNumber = &vcEntry->number[0]; 3425 pNumber = &vcEntry->number[0];
3426 3426
3427 for(i=0; i < strlen((CHAR *)pNumber); i++) 3427 for(i=0; i < strlen((CHAR *)pNumber); i++)
3428 { 3428 {
3429 TRACE_EVENT_P2("pNumber[%d] : %c", i,pNumber[i]); 3429 TRACE_EVENT_P2("pNumber[%d] : %c", i,pNumber[i]);
3430 } 3430 }
3431 3431
3432 cmhPHB_getAdrBcd ( data + 2, &numLen, 3432 cmhPHB_getAdrBcd ( data + 2, &numLen,
3433 PHB_MAX_LEN - 1, (CHAR *)pNumber ); 3433 PHB_MAX_LEN - 1, (CHAR *)pNumber );
3434 3434
3435 for(i=0; i < numLen; i++) 3435 for(i=0; i < numLen; i++)
3436 { 3436 {
3437 TRACE_EVENT_P2("data + 2 + %d : %x", i, *(data + 2+i)); 3437 TRACE_EVENT_P2("data + 2 + %d : %x", i, *(data + 2+i));
3438 } 3438 }
3439 3439
3440 if ( numLen < 11 ) 3440 if ( numLen < 11 )
3441 { 3441 {
3442 *data = numLen + 1; 3442 *data = numLen + 1;
3443 } 3443 }
3444 else 3444 else
3445 { 3445 {
3446 *data = 11; 3446 *data = 11;
3447 } 3447 }
3448 3448
3449 3449
3450 *(data + 1) = ((( vcEntry -> ton << 4 ) & 0xF0 ) + ( vcEntry -> npi & 0x0F )) | 0x80; 3450 *(data + 1) = ((( vcEntry -> ton << 4 ) & 0xF0 ) + ( vcEntry -> npi & 0x0F )) | 0x80;
3451 3451
3452 data += 12; 3452 data += 12;
3453 3453
3454 length_no = numLen; 3454 length_no = numLen;
3460 } 3460 }
3461 3461
3462 TRACE_EVENT_P1("length_no : %d", length_no); 3462 TRACE_EVENT_P1("length_no : %d", length_no);
3463 TRACE_EVENT_P1("byteno : %d", byteno); 3463 TRACE_EVENT_P1("byteno : %d", byteno);
3464 TRACE_EVENT_P1("ubCphsMbExtRecNo : %d", ubCphsMbExtRecNo); 3464 TRACE_EVENT_P1("ubCphsMbExtRecNo : %d", ubCphsMbExtRecNo);
3465 TRACE_EVENT_P1("vcEntry->index : %d", vcEntry->index); 3465 TRACE_EVENT_P1("vcEntry->index : %d", vcEntry->index);
3466 TRACE_EVENT_P1("vcEntry->list_index : %d", vcEntry->list_index); 3466 TRACE_EVENT_P1("vcEntry->list_index : %d", vcEntry->list_index);
3467 TRACE_EVENT_P1("dataLen : %d", len); 3467 TRACE_EVENT_P1("dataLen : %d", len);
3468 TRACE_EVENT_P1("ext_rec_number : %d", mbNum.entries[vcEntry->list_index].ext_rec_number); 3468 TRACE_EVENT_P1("ext_rec_number : %d", mbNum.entries[vcEntry->list_index].ext_rec_number);
3469 3469
3470 3470
3471 /**************************************************************************************/ 3471 /**************************************************************************************/
3472 /**************************************************************************************/ 3472 /**************************************************************************************/
3473 3473
3474 /* Check if enough EXT1 Records are available for storing the current number; If not, return FALSE */ 3474 /* Check if enough EXT1 Records are available for storing the current number; If not, return FALSE */
3475 3475
3476 if ( ( ubCphsMbExtRecNo > 0 ) && 3476 if ( ( ubCphsMbExtRecNo > 0 ) &&
3477 ( mbNum.entries[vcEntry->list_index].ext_rec_number < ubCphsMbExtRecNo ) ) 3477 ( mbNum.entries[vcEntry->list_index].ext_rec_number < ubCphsMbExtRecNo ) )
3478 { 3478 {
3479 for ( i = mbNum.entries[vcEntry->list_index].ext_rec_number; i < ubCphsMbExtRecNo; i++ ) 3479 for ( i = mbNum.entries[vcEntry->list_index].ext_rec_number; i < ubCphsMbExtRecNo; i++ )
3480 { 3480 {
3481 sFreeRec = 0; 3481 sFreeRec = 0;
3494 } 3494 }
3495 3495
3496 /**************************************************************************************/ 3496 /**************************************************************************************/
3497 /**************************************************************************************/ 3497 /**************************************************************************************/
3498 3498
3499 3499
3500 /* capability/configuration identifier data and EXT identifier data */ 3500 /* capability/configuration identifier data and EXT identifier data */
3501 *data = 0xFF; 3501 *data = 0xFF;
3502 3502
3503 if ( ubCphsMbExtRecNo == 0 ) 3503 if ( ubCphsMbExtRecNo == 0 )
3504 { 3504 {
3521 sFreeRec = cmh_Query_free_ext_record(); 3521 sFreeRec = cmh_Query_free_ext_record();
3522 #endif 3522 #endif
3523 } 3523 }
3524 3524
3525 TRACE_EVENT_P1("sFreeRec: %d", sFreeRec); 3525 TRACE_EVENT_P1("sFreeRec: %d", sFreeRec);
3526 3526
3527 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) ) 3527 if ( ( sFreeRec <= 0 ) || ( sFreeRec == 0xFF ) )
3528 { 3528 {
3529 TRACE_FUNCTION ("cphs_build_mbn_data() : No free records available"); 3529 TRACE_FUNCTION ("cphs_build_mbn_data() : No free records available");
3530 *(data + 1) = 0xFF; 3530 *(data + 1) = 0xFF;
3531 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = 0xFF; 3531 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = 0xFF;
3532 } 3532 }
3533 else 3533 else
3534 { 3534 {
3535 *(data + 1) = 0x00; 3535 *(data + 1) = 0x00;
3536 *(data + 1) = sFreeRec; 3536 *(data + 1) = sFreeRec;
3537 TRACE_FUNCTION("cmh_PHB_update_ext_record to be"); 3537 TRACE_FUNCTION("cmh_PHB_update_ext_record to be");
3538 #ifdef TI_PS_FFS_PHB 3538 #ifdef TI_PS_FFS_PHB
3539 cmh_PHB_update_ext_record(sFreeRec,TRUE); 3539 cmh_PHB_update_ext_record(sFreeRec,TRUE);
3540 #endif 3540 #endif
3541 TRACE_EVENT_P1(" *(data + 1) : %d", *(data + 1) ); 3541 TRACE_EVENT_P1(" *(data + 1) : %d", *(data + 1) );
3542 } 3542 }
3543 3543
3544 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = *(data + 1); 3544 mbNum.entries[vcEntry->list_index].ext_rec_idx[ubCurrExtRcWrite] = *(data + 1);
3545 } 3545 }
3567 serv_table = serv_table + (nr-1)/4; 3567 serv_table = serv_table + (nr-1)/4;
3568 value = * serv_table; 3568 value = * serv_table;
3569 3569
3570 value = value >> (((nr-1) & 3) * 2); 3570 value = value >> (((nr-1) & 3) * 2);
3571 value = value & 3; 3571 value = value & 3;
3572 3572
3573 return value; 3573 return value;
3574 } 3574 }
3575 3575
3576 /* 3576 /*
3577 +--------------------------------------------------------------------+ 3577 +--------------------------------------------------------------------+
3634 +---------------------------------------------------------------------+ 3634 +---------------------------------------------------------------------+
3635 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS | 3635 | PROJECT : MMI-Framework (8417) MODULE : MFW_CPHS |
3636 | STATE : code ROUTINE : cphs_update_info_cnf | 3636 | STATE : code ROUTINE : cphs_update_info_cnf |
3637 +---------------------------------------------------------------------+ 3637 +---------------------------------------------------------------------+
3638 3638
3639 PURPOSE : call back for SIM file read 3639 PURPOSE : call back for SIM file read
3640 3640
3641 */ 3641 */
3642 void cphs_update_info_cnf (USHORT errCode, UBYTE *data, UBYTE dataLen) 3642 void cphs_update_info_cnf (USHORT errCode, UBYTE *data, UBYTE dataLen)
3643 { 3643 {
3644 UBYTE *ptr; 3644 UBYTE *ptr;
3649 ptr = data; 3649 ptr = data;
3650 #ifdef FF_2TO1_PS 3650 #ifdef FF_2TO1_PS
3651 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR 3651 if ( errCode NEQ CAUSE_SIM_NO_ERROR OR
3652 #else 3652 #else
3653 if ( errCode NEQ SIM_NO_ERROR OR 3653 if ( errCode NEQ SIM_NO_ERROR OR
3654 #endif 3654 #endif
3655 ptr EQ NULL OR 3655 ptr EQ NULL OR
3656 dataLen < MFW_CPHS_INFO_SIZE) 3656 dataLen < MFW_CPHS_INFO_SIZE)
3657 { 3657 {
3658 satUpdateFiles(TRUE, SIM_CPHS_CINF); 3658 satUpdateFiles(TRUE, SIM_CPHS_CINF);
3659 } 3659 }
3660 else 3660 else
3661 { 3661 {
3662 cphsPhase = *ptr; 3662 cphsPhase = *ptr;
3663 ptr++; 3663 ptr++;
3664 memcpy (cphsServTab, ptr, CPHS_SERVICE_TABLE*sizeof(UBYTE)); 3664 memcpy (cphsServTab, ptr, CPHS_SERVICE_TABLE*sizeof(UBYTE));
3665 //x0pleela 11 June, 2006 DR:OMAPS00079692 3665 //x0pleela 11 June, 2006 DR:OMAPS00079692
3666 //changed from CPHS_OK to MFW_CPHS_OK 3666 //changed from CPHS_OK to MFW_CPHS_OK
3667 cphsStatus = MFW_CPHS_OK; 3667 cphsStatus = MFW_CPHS_OK;
3681 */ 3681 */
3682 3682
3683 BOOL Read_Sim(USHORT dat_id, USHORT offset, UBYTE max_len, UBYTE *exDat) 3683 BOOL Read_Sim(USHORT dat_id, USHORT offset, UBYTE max_len, UBYTE *exDat)
3684 { 3684 {
3685 T_ACI_RETURN res; 3685 T_ACI_RETURN res;
3686 /* 3686 /*
3687 * x0047685 Added path_info to support R99 SIM Interface changes. 3687 * x0047685 Added path_info to support R99 SIM Interface changes.
3688 */ 3688 */
3689 T_path_info tmp_path; 3689 T_path_info tmp_path;
3690 3690
3691 TRACE_FUNCTION ("Read_Sim()"); 3691 TRACE_FUNCTION ("Read_Sim()");
3711 dat_id, 3711 dat_id,
3712 offset, 3712 offset,
3713 max_len, 3713 max_len,
3714 exDat, 3714 exDat,
3715 cphs_read_sim_default_cb); 3715 cphs_read_sim_default_cb);
3716 #endif 3716 #endif
3717 3717
3718 if (res NEQ AT_EXCT) 3718 if (res NEQ AT_EXCT)
3719 return FALSE; 3719 return FALSE;
3720 3720
3721 return TRUE; 3721 return TRUE;
3722 } 3722 }
3735 3735
3736 BOOL Read_Sim_Record(USHORT dat_id, USHORT record, UBYTE len, UBYTE *exDat) 3736 BOOL Read_Sim_Record(USHORT dat_id, USHORT record, UBYTE len, UBYTE *exDat)
3737 { 3737 {
3738 T_ACI_RETURN res; 3738 T_ACI_RETURN res;
3739 UBYTE dataLen; 3739 UBYTE dataLen;
3740 /* 3740 /*
3741 * x0047685 Added path_info to support R99 SIM Interface changes. 3741 * x0047685 Added path_info to support R99 SIM Interface changes.
3742 */ 3742 */
3743 T_path_info tmp_path; 3743 T_path_info tmp_path;
3744 3744
3745 if (record EQ 1) 3745 if (record EQ 1)
3746 dataLen = UCHAR_MAX; 3746 dataLen = UCHAR_MAX;
3747 else 3747 else
3748 dataLen = len; 3748 dataLen = len;
3749 3749
3750 TRACE_FUNCTION ("Read_Sim_Record()"); 3750 TRACE_FUNCTION ("Read_Sim_Record()");
3751 3751
3752 tmp_path.df_level1 = SIM_DF_VI; 3752 tmp_path.df_level1 = SIM_DF_VI;
3753 tmp_path.v_df_level2 = FALSE; 3753 tmp_path.v_df_level2 = FALSE;
3754 3754
3755 #ifdef FF_2TO1_PS 3755 #ifdef FF_2TO1_PS
3756 res = cmhSIM_ReadRecordEF ( CMD_SRC_NONE, 3756 res = cmhSIM_ReadRecordEF ( CMD_SRC_NONE,
3757 AT_CMD_NONE, 3757 AT_CMD_NONE,
3758 FALSE, /* SCT: dummy only (path info valid flag) */ 3758 FALSE, /* SCT: dummy only (path info valid flag) */
3759 NULL, /* SCT: dummy only (path info) */ 3759 NULL, /* SCT: dummy only (path info) */
3770 dat_id, 3770 dat_id,
3771 record, 3771 record,
3772 dataLen, 3772 dataLen,
3773 exDat, 3773 exDat,
3774 cphs_read_sim_default_cb); 3774 cphs_read_sim_default_cb);
3775 #endif 3775 #endif
3776 if (res NEQ AT_EXCT) 3776 if (res NEQ AT_EXCT)
3777 return FALSE; 3777 return FALSE;
3778 3778
3779 return TRUE; 3779 return TRUE;
3780 } 3780 }
3811 dat_id, 3811 dat_id,
3812 0, 3812 0,
3813 len, 3813 len,
3814 exDat, 3814 exDat,
3815 cphs_write_sim_default_cb); 3815 cphs_write_sim_default_cb);
3816 #endif 3816 #endif
3817 3817
3818 if (res NEQ AT_EXCT) 3818 if (res NEQ AT_EXCT)
3819 return FALSE; 3819 return FALSE;
3820 3820
3821 return TRUE; 3821 return TRUE;
3834 */ 3834 */
3835 3835
3836 BOOL Write_Sim_Record(USHORT dat_id, USHORT record, UBYTE len, UBYTE *exDat) 3836 BOOL Write_Sim_Record(USHORT dat_id, USHORT record, UBYTE len, UBYTE *exDat)
3837 { 3837 {
3838 T_ACI_RETURN res; 3838 T_ACI_RETURN res;
3839 /* 3839 /*
3840 * x0047685 Added path_info to support R99 SIM Interface changes. 3840 * x0047685 Added path_info to support R99 SIM Interface changes.
3841 */ 3841 */
3842 T_path_info tmp_path; 3842 T_path_info tmp_path;
3843 3843
3844 TRACE_FUNCTION ("Write_Sim()"); 3844 TRACE_FUNCTION ("Write_Sim()");
3864 dat_id, 3864 dat_id,
3865 record, 3865 record,
3866 len, 3866 len,
3867 exDat, 3867 exDat,
3868 cphs_write_sim_default_cb); 3868 cphs_write_sim_default_cb);
3869 #endif 3869 #endif
3870 3870
3871 if (res NEQ AT_EXCT) 3871 if (res NEQ AT_EXCT)
3872 return FALSE; 3872 return FALSE;
3873 3873
3874 return TRUE; 3874 return TRUE;
3879 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | 3879 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS |
3880 | STATE : code ROUTINE: cphs_read_default_cb | 3880 | STATE : code ROUTINE: cphs_read_default_cb |
3881 +----------------------------------------------------------------------+ 3881 +----------------------------------------------------------------------+
3882 3882
3883 3883
3884 PURPOSE : Sends event to MMI 3884 PURPOSE : Sends event to MMI
3885 3885
3886 */ 3886 */
3887 void cphs_read_sim_default_cb(SHORT table_id) 3887 void cphs_read_sim_default_cb(SHORT table_id)
3888 { 3888 {
3889 3889
3890 read_sim_entry.requested_field = simShrdPrm.atb[table_id].reqDataFld; 3890 read_sim_entry.requested_field = simShrdPrm.atb[table_id].reqDataFld;
3891 read_sim_entry.exchange_data = simShrdPrm.atb[table_id].exchData; 3891 read_sim_entry.exchange_data = simShrdPrm.atb[table_id].exchData;
3892 read_sim_entry.sim_result = simShrdPrm.atb[table_id].errCode; 3892 read_sim_entry.sim_result = simShrdPrm.atb[table_id].errCode;
3893 read_sim_entry.data_len = simShrdPrm.atb[table_id].dataLen; 3893 read_sim_entry.data_len = simShrdPrm.atb[table_id].dataLen;
3894 read_sim_entry.record = simShrdPrm.atb[table_id].recNr; 3894 read_sim_entry.record = simShrdPrm.atb[table_id].recNr;
3895 #ifdef FF_2TO1_PS 3895 #ifdef FF_2TO1_PS
3896 if (read_sim_entry.sim_result != CAUSE_SIM_NO_ERROR) 3896 if (read_sim_entry.sim_result != CAUSE_SIM_NO_ERROR)
3897 #else 3897 #else
3898 if (read_sim_entry.sim_result != SIM_NO_ERROR) 3898 if (read_sim_entry.sim_result != SIM_NO_ERROR)
3899 #endif 3899 #endif
3900 { read_sim_entry.exchange_data = NULL; 3900 { read_sim_entry.exchange_data = NULL;
3901 read_sim_entry.data_len = 0; 3901 read_sim_entry.data_len = 0;
3902 } 3902 }
3903 3903
3904 cphs_signal(E_CPHS_GET_SIM_FIELD, &read_sim_entry); 3904 cphs_signal(E_CPHS_GET_SIM_FIELD, &read_sim_entry);
3905 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; 3905 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE;
3906 } 3906 }
3907 3907
3908 3908
3911 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS | 3911 | PROJECT: MMI-Framework (8417) MODULE: MFW_CPHS |
3912 | STATE : code ROUTINE: cphs_read_default_cb | 3912 | STATE : code ROUTINE: cphs_read_default_cb |
3913 +----------------------------------------------------------------------+ 3913 +----------------------------------------------------------------------+
3914 3914
3915 3915
3916 PURPOSE : Sends event to MMI 3916 PURPOSE : Sends event to MMI
3917 3917
3918 */ 3918 */
3919 void cphs_write_sim_default_cb(SHORT table_id) 3919 void cphs_write_sim_default_cb(SHORT table_id)
3920 { 3920 {
3921 3921
3922 read_sim_entry.requested_field = simShrdPrm.atb[table_id].reqDataFld; 3922 read_sim_entry.requested_field = simShrdPrm.atb[table_id].reqDataFld;
3923 read_sim_entry.exchange_data = simShrdPrm.atb[table_id].exchData; 3923 read_sim_entry.exchange_data = simShrdPrm.atb[table_id].exchData;
3924 read_sim_entry.sim_result = simShrdPrm.atb[table_id].errCode; 3924 read_sim_entry.sim_result = simShrdPrm.atb[table_id].errCode;
3925 read_sim_entry.data_len = simShrdPrm.atb[table_id].dataLen; 3925 read_sim_entry.data_len = simShrdPrm.atb[table_id].dataLen;
3926 #ifdef FF_2TO1_PS 3926 #ifdef FF_2TO1_PS
3927 if (read_sim_entry.sim_result != CAUSE_SIM_NO_ERROR) 3927 if (read_sim_entry.sim_result != CAUSE_SIM_NO_ERROR)
3928 #else 3928 #else
3929 if (read_sim_entry.sim_result != SIM_NO_ERROR) 3929 if (read_sim_entry.sim_result != SIM_NO_ERROR)
3930 #endif 3930 #endif
3931 { read_sim_entry.exchange_data = NULL; 3931 { read_sim_entry.exchange_data = NULL;
3932 read_sim_entry.data_len = 0; 3932 read_sim_entry.data_len = 0;
3933 } 3933 }
3934 3934
3935 cphs_signal(E_CPHS_SET_SIM_FIELD, &read_sim_entry); 3935 cphs_signal(E_CPHS_SET_SIM_FIELD, &read_sim_entry);
3936 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE; 3936 simShrdPrm.atb[table_id].ntryUsdFlg = FALSE;
3937 } 3937 }
3938 3938
3939 #ifdef FF_CPHS_REL4 3939 #ifdef FF_CPHS_REL4
3968 3968
3969 T_MFW_CPHS_MSP_INFO* mfw_cphs_get_msp(void) 3969 T_MFW_CPHS_MSP_INFO* mfw_cphs_get_msp(void)
3970 { 3970 {
3971 TRACE_FUNCTION("mfw_cphs_get_msp"); 3971 TRACE_FUNCTION("mfw_cphs_get_msp");
3972 TRACE_EVENT_P3("msp count - %d, def profile - %d, reg profile - %d ",mspinfo.count, mspinfo.default_profile, mspinfo.registered_profile); 3972 TRACE_EVENT_P3("msp count - %d, def profile - %d, reg profile - %d ",mspinfo.count, mspinfo.default_profile, mspinfo.registered_profile);
3973 3973
3974 return &mspinfo; 3974 return &mspinfo;
3975 } 3975 }
3976 3976
3977 UBYTE mfw_cphs_get_no_profile(void) 3977 UBYTE mfw_cphs_get_no_profile(void)
3978 { 3978 {
4053 T_MFW mfw_cphs_get_als_info(void) 4053 T_MFW mfw_cphs_get_als_info(void)
4054 { 4054 {
4055 T_ACI_ALS_MOD ALSmode = ALS_MOD_NOTPRESENT; /*a0393213 compiler warnings removal - 0 changed to ALS_MOD_NOTPRESENT*/ 4055 T_ACI_ALS_MOD ALSmode = ALS_MOD_NOTPRESENT; /*a0393213 compiler warnings removal - 0 changed to ALS_MOD_NOTPRESENT*/
4056 TRACE_FUNCTION("mfw_cphs_get_als_info"); 4056 TRACE_FUNCTION("mfw_cphs_get_als_info");
4057 4057
4058 if( qAT_PercentALS( CMD_SRC_LCL, &ALSmode )!= AT_CMPL ) 4058 if( qAT_PercentALS( CMD_SRC_LCL, &ALSmode )!= AT_CMPL )
4059 return ALS_MOD_NOTPRESENT; 4059 return ALS_MOD_NOTPRESENT;
4060 else 4060 else
4061 return ALSmode; 4061 return ALSmode;
4062 } 4062 }
4063 #endif 4063 #endif
4064 4064