diff src/ui/mfw/mfw_sms.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
line wrap: on
line diff
--- a/src/ui/mfw/mfw_sms.c	Tue Jan 19 05:41:26 2021 +0000
+++ b/src/ui/mfw/mfw_sms.c	Tue Jan 19 06:10:27 2021 +0000
@@ -23,34 +23,34 @@
 	July 27, 2006    DR: OMAPS00085347 x0021334
    	Description: The display freeze when reading a stored concatenated SMS (This concatenated
    	                  SMS consists of 3 SMS) from SIM.
-   	Solution: Added code to free the allocated memory after concatenated SMS has been read.   
+   	Solution: Added code to free the allocated memory after concatenated SMS has been read.
 
 	May 18, 2006    DR: OMAPS00070657 x0pleela
-   	Description: CPHS feature on Locosto-Lite 
-   	Solution: 	Enabling the voice mail indication if there are any voice mails		
+   	Description: CPHS feature on Locosto-Lite
+   	Solution: 	Enabling the voice mail indication if there are any voice mails
 
 	Feb 07, 2006    DR: OMAPS00059261 x0pleela
-   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI 
+   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI
    	Solution: sms_decode_status(): removed the code added for handling pending status of a status report
 			rat_plusCMGR(): updating sms_str based on tp_status of a status report
 			Removed macros STAT_MIN_VALUE and STAT_MAX_VALUE added earlier
-			Replaced MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed			
+			Replaced MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed
 
      	Feb 01, 2006    DR: OMAPS00059261 x0pleela
-   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI 
+   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI
    	Solution: Added two macros to check the range of status of status report
 			Used enums for the hardcoded values for MFW_MSG_DELIVER(MT), MFW_MSG_SUBMIT (MO) and MFW_MSG_STATUS_REPORT (STATUS REPORT) types while reading the messages
 			Added a check in "sms_decodeStatus" to support pending status of the status report
 			Made changes as per review comments
-   	
+
       	Jan 30, 2006    DR: OMAPS00059261 x0pleela
-   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI 
+   	Description: SMS is not forwarding STATUS reports that are read from SIM storage to ACI
    	Solution: Added code to read MT Status report
-   	
+
 
    	Jan 20, 2006    REF: DRT OMAPS00053377 xdeepadh
    	Description: SMS Validity Period - using MMI - Failure, MS not able to set SMS validity
-   	Solution: While setting the validity period, the validity period format also has been set in the 
+   	Solution: While setting the validity period, the validity period format also has been set in the
    	frst octet.
 
 	Nov 15,2005 	DR : OMAPS00057280	-	x0034700
@@ -59,35 +59,35 @@
 
 	Feb 22, 2006	REF: MMI-FIX-OMAPS00058684 x0035544(Sudha)
 	Description: Can't send a SMS with a specific SIM card
-	Solution: Check the PID(Protocol ID) value for an MO SMS and Set the PID(Protocol ID) accordingly. 
-	
+	Solution: Check the PID(Protocol ID) value for an MO SMS and Set the PID(Protocol ID) accordingly.
+
        Dec 15, 2005   REF: MMI-FIX-OMAPS00058684 x0035544
        Description: OMAPS00045726 / MMI-FIX-30439 Follow-Up : ifdef for FF Home Zone forgotten.
        Solution: Added Feature flag FF_HOMEZONE for the function sms_homezoneCBToggle(U8 Activate_CB)
-       
-        Nov 8, 2005 REF: OMAPS00050772, a0876501 (Shashi)  
+
+        Nov 8, 2005 REF: OMAPS00050772, a0876501 (Shashi)
   	Issue description:  CMGD merge from tcs4.0 to g23m.
   	Solution: New parameter is added to sAT_PlusCMGD function. Migrating the MFW changes.
 
 
    	Oct 18, 2005    REF: SPR 34678 xdeepadh
-   	Description: MMI Screen – shows garbled characters for Cell Information 
+   	Description: MMI Screen – shows garbled characters for Cell Information
    	Solution: The CB messages with DCS 242(class-2,default alphabet)  are discarded.
 
         May 27, 2005    MMI-FIX-29869 x0018858
-   	Description: There is a limitation on the number of messages that can be downloaded from 
+   	Description: There is a limitation on the number of messages that can be downloaded from
    	server even though there is space on the sim.
    	Solution: The limitation has been removed and the number of messages that can be dowloaded
    	has been modified to the masimum number that can be stored.
 
 	Jun 14, 2005 REF: MMI-FIX-30439 x0018858
    	Description: The homezone/cityzone tags were not being displayed properly.
-   	Solution: Modified to save the tags properly in caches and also made the 
+   	Solution: Modified to save the tags properly in caches and also made the
 	appropriate modifications to update the same properly during mobility.
 
-   	July 7, 2005 REF: CRR MMI-SPR-32179 x0018858  
+   	July 7, 2005 REF: CRR MMI-SPR-32179 x0018858
   	Issue description:  PS crashed while performing call Forwarding.
-  	Solution: Since this is related to memory leaks which occur, the code has been added to 
+  	Solution: Since this is related to memory leaks which occur, the code has been added to
   			free certain memory based on a a checking condition and also by cleaning the buffer.
 
        xrashmic 9 May, 2005 MMI-SPR-30159
@@ -99,7 +99,7 @@
 	there is a pending message.
 
       	March 31, 2005    REF: CRR MMI-SPR-24511   x0012852
-	Bug:The phone crashes when the user selects the 'Delete All' option 
+	Bug:The phone crashes when the user selects the 'Delete All' option
 	almost the same time as there's an incoming message.
        Fix:Check added for part message before deleting all messages.
 
@@ -115,15 +115,15 @@
 	The Optimization changes done for golite build have been incorpaorated to color build.
 	The  MMI_LITE flag used for rAT_PlusCMGR has been removed.
 
-   	Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+   	Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
   	Issue description:  BMI: using the tool nowSMS the voicemail indication via sms does not work
   	Solution: Instead of identifying voice using addr[0] and pid, we use dcs. Also, messages belonging
   	              to group "1100" are deleted when voicemail icon is displayed.
 
-   	Dec 23, 2004 REF: CRR MMI-SPR-27741 xkundadu 
+   	Dec 23, 2004 REF: CRR MMI-SPR-27741 xkundadu
   	Issue description:  BMI: crashing when using the function : sms_index_list() located in mfw
   	Solution: Changed the msg_list variable to array of T_MFW_SMS_IDX.
- 	
+
 	Aug 18, 2004    REF: CRR 24282   Deepa M.D
 	Bug:Go-lite Optimization  Dynamic allocation of sms_mo
 	Fix:static T_MFW_SMS_MO sms_mo has been made a local variable.
@@ -144,16 +144,16 @@
 	Jul 07, 2004    REF: CRR 15846     Deepa M.D
 	Bug	:	Concatenated SMT : SMS present but not displayed !!!
 	Fix :	Check has been made before freeing the memory.
-  
-	SPR 2260:  Merged in bugfixes 1833, 1669, 872,1830, 1828, 2031, and 2007 
+
+	SPR 2260:  Merged in bugfixes 1833, 1669, 872,1830, 1828, 2031, and 2007
 	fom the 1.6.3 branch into this file.
-	
+
 	Apr 12, 2004    REF: CRR 13370     Deepa M.D
 	Bug : The Sender name was not displayed properly in the status report.
 	Fix : The sendername had garbage values when the corresponding number was not
 	present in the Phonebook.So when the name was not present, only the number is displayed.
-	  
-			
+
+
 
 */
 
@@ -227,7 +227,7 @@
 #define FIRST_READ_OF_MEMORY_USE 1
 #define POST_DELETE_CHECK        2
 // Feb 22, 2006 DR:OMAPS00068268 x0035544
-//Added the #defines for the bits 7, 6 and 5 
+//Added the #defines for the bits 7, 6 and 5
 #define BIT_7	0x80
 #define BIT_6	0x40
 #define BIT_5	0x20
@@ -254,15 +254,15 @@
 static T_MFW_MEM_INFO sim_memory; /*a0393213 OMAPS00109953 - To keep track of sms memory in SIM*/
 static T_MFW_MEM_INFO ffs_memory;   /*a0393213 OMAPS00109953 - To keep track of sms memory in ME*/
 /*a0393213 OMAPS00109953 - state machine for index retrieval - first retrieve all SIM indexes then all ME indexes*/
-static T_MFW_SMS_INDEX_RETRIEVE_STATE index_retrieve_state; 
+static T_MFW_SMS_INDEX_RETRIEVE_STATE index_retrieve_state;
 
 static SHORT			 status_change_index;
 /*a0393213 - To store the memory(SIM/ME) where the message, whose status is to be changed, resides*/
-static T_MFW_SMS_MEM status_change_memory=MFW_MEM_NOTPRESENT; 
+static T_MFW_SMS_MEM status_change_memory=MFW_MEM_NOTPRESENT;
 
 static SHORT			 deleting_index;
 /*a0393213 OMAPS00109953 - To store the memory where the SMS, which is to be deleted, resides*/
-static T_MFW_SMS_MEM deleting_memory=MFW_MEM_NOTPRESENT; 
+static T_MFW_SMS_MEM deleting_memory=MFW_MEM_NOTPRESENT;
 
 static UBYTE              f_update;
 static UBYTE              int_req;
@@ -295,18 +295,18 @@
 static UBYTE sms_wap_sent_flag = FALSE;  /* SPR#2086 - SH - TRUE if SMS is sent */
 #endif
 
-// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
 // Added this variable to identify voice mail message to be deleted
-BOOL invalidVm = FALSE; 
-
-//x0pleela 30 Jan, 2006 DR: OMAPS00059261 
+BOOL invalidVm = FALSE;
+
+//x0pleela 30 Jan, 2006 DR: OMAPS00059261
 //SMS buffer storage size
-#define MAX_STAT_MSG_LEN 30 
+#define MAX_STAT_MSG_LEN 30
 
 extern UBYTE reply_path_bit ;
 /*********************Prototypes****************************************/
 
-//Feb 22, 2006 DR:OMAPS00068268 x0035544 
+//Feb 22, 2006 DR:OMAPS00068268 x0035544
 BOOL Sms_Check_PID(SHORT pid);
 /*SPR2260 added prototype for new function*/
 /*a0393213 OMAPS00109953 - memory added as new parameter*/
@@ -329,7 +329,7 @@
 | STATE   : code                         ROUTINE : Check_max_sms_allowed          |
 +--------------------------------------------------------------------+
 
-   PURPOSE : Check for the max number of messages that can be stored and aloocate 
+   PURPOSE : Check for the max number of messages that can be stored and aloocate
    memory accordingly.
 
 */
@@ -399,7 +399,7 @@
   /* PATCH-6363 VO 30.01.01 */
   /*a0393213 OMAPS00109953 - SMS memory related variables updated*/
 /*This member indicates the preferred memory - the memory, which is considered first for saving the incoming messages/drafts*/
-  memory.mem=(UBYTE)MFW_MEM_NOTPRESENT; 
+  memory.mem=(UBYTE)MFW_MEM_NOTPRESENT;
   memory.used=0;
   memory.total=0;
   ffs_memory.mem = MFW_MEM_ME;
@@ -429,8 +429,8 @@
 {
 	if(0 == cind_Settings)
 		return MFW_SMS_FAIL;
-		
-		
+
+
 	if(sAT_PlusCIND(CMD_SRC_LCL,CIND_SIGNAL_INDICATOR_LVL0,CIND_SMSFULL_INDICATOR_MEMFULL)NEQ AT_CMPL)
 	{
 		TRACE_EVENT(" The indication couldnt not be set");
@@ -457,7 +457,7 @@
 	#if (BOARD==61)
 		if(sAT_PlusCMER(CMD_SRC_LCL,CMER_MODE_2,(T_ACI_CMER_KEYP_TYPE)CMER_INDICATOR_2,
                                           (T_ACI_CMER_IND_TYPE)CMER_BFR_1, (T_ACI_CMER_BFR_TYPE)0)NEQ AT_CMPL)  /* typecast to remove warning Aug - 11 */
-	#else	
+	#else
 		if(sAT_PlusCMER(CMD_SRC_LCL,CMER_MODE_2,CMER_INDICATOR_2,CMER_BFR_1)NEQ AT_CMPL)
 	#endif
 	// END ADDITION RAVI - 6-10-2005
@@ -577,7 +577,7 @@
   T_MFW_HDR *hdr;
   T_MFW_SMS *sms_para;
   MfwHdr *insert_status =0;
-  
+
   TRACE_FUNCTION ("sms_create()");
 
   hdr      = (T_MFW_HDR *) mfwAlloc(sizeof(T_MFW_HDR));
@@ -586,13 +586,13 @@
   if (!hdr OR !sms_para)
   	{
     	TRACE_ERROR("ERROR: sms_create() Mem Alloc Failed.");
-			
+
 	   	if(hdr)
    			mfwFree((U8*)hdr,sizeof(MfwHdr));
 
    		if(sms_para)
    			mfwFree((U8*)sms_para,sizeof(T_MFW_SMS));
-   		
+
 	   	return FALSE;
     }
   /* initialisation of the handler */
@@ -605,12 +605,12 @@
   /* installation of the handler */
 
   insert_status =  mfwInsert((T_MFW_HDR *)hWin, hdr);/*SPR 1968, inserted inadvertently deleted function call*/
-  
+
   if(!insert_status)
   	{
   		TRACE_ERROR("ERROR: sms_create() Failed to Install Handler. ");
    		mfwFree((U8*)hdr,sizeof(MfwHdr));
-   		mfwFree((U8*)sms_para,sizeof(T_MFW_SIM)); 	
+   		mfwFree((U8*)sms_para,sizeof(T_MFW_SIM));
 		return 0;
   	}
     return insert_status;
@@ -870,7 +870,7 @@
     }
 
     /*a0393213 OMAPS00109953 - set preferred memory before calling sAT_PlusCMGL
-	Retrieve SMS indexes in SIM first*/	
+	Retrieve SMS indexes in SIM first*/
     if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
     	{
     	TRACE_ERROR("sms_read_msg_info():Not able to set pref memory");
@@ -908,10 +908,10 @@
 {
   T_SMS_TYPE received_sms_type;
   T_CONC_ASSEMBLY_RETURN concatenated_status=CONC_ERR_UNKN;
-#ifdef TI_PS_FF_CONC_SMS  
+#ifdef TI_PS_FF_CONC_SMS
   T_SM_DATA_EXT conc_data_ext={NULL,0};
 #endif /*TI_PS_FF_CONC_SMS*/
-  
+
   TRACE_FUNCTION ("rAT_PlusCMGL()");
   /*a0393213 OMAPS00109953 - third parameter added for SMS_getSMSType()*/
   if(initialising_flag == TRUE)
@@ -940,10 +940,10 @@
 	  	}
 		TRACE_EVENT_P2("conc status: %d, conc length: %d", concatenated_status, conc_data_ext.len);
 
-  
+
 	  }
 // July 27, 2006    DR: OMAPS00085347 x0021334
-// Free the allocated memory after concatenated SMS has been read. 
+// Free the allocated memory after concatenated SMS has been read.
   if (concatenated_status EQ CONC_COMPLETED)
   {
       if (conc_data_ext.data != NULL)
@@ -951,11 +951,11 @@
            MFREE (conc_data_ext.data);
       }
   }
-#endif /*TI_PS_FF_CONC_SMS*/ 	
-  
+#endif /*TI_PS_FF_CONC_SMS*/
+
   /*a0393213 OMAPS00109953 - memory added as parameter*/
-  sms_store_new_msg_info(smLst->msg_ref, smLst, TRUE/*MC SPR 2260*/, concatenated_status,received_sms_type,(T_MFW_SMS_MEM)memory.mem);  
-	
+  sms_store_new_msg_info(smLst->msg_ref, smLst, TRUE/*MC SPR 2260*/, concatenated_status,received_sms_type,(T_MFW_SMS_MEM)memory.mem);
+
 
 			f_update = MFW_SMS_NEW;
 {
@@ -1006,7 +1006,7 @@
     for (i=0; i<MAX_MESSAGES; i++)
 #endif
     {
-        if (msg_info[i].index EQ status_change_index && 
+        if (msg_info[i].index EQ status_change_index &&
        	msg_info[i].mem EQ status_change_memory) /*a0393213 OMAPS00109953 - memory also taken into consideration*/
         	{
             	msg_info[i].stat = stat;
@@ -1162,7 +1162,7 @@
 #endif
     {
         /*a0393213 OMAPS00109953 - memory also taken into consideration*/
-        if (msg_info[i].index == index	&& msg_info[i].mem == sms_memory)    
+        if (msg_info[i].index == index	&& msg_info[i].mem == sms_memory)
         {
             if ((msg_info[i].stat == MFW_SMS_UNREAD) ||
                (msg_info[i].stat == MFW_SMS_STOR_UNSENT))
@@ -1191,13 +1191,13 @@
         return 0;
     }
 
-     /*a0393213 OMAPS00109953 - set preferred memory before calling sAT_PlusCMGR*/	
+     /*a0393213 OMAPS00109953 - set preferred memory before calling sAT_PlusCMGR*/
      if(sms_set_pref_memory(sms_memory)!=MFW_SMS_OK)
      	{
      	TRACE_ERROR("sms_change_read_status():Not able to set pref memory");
  	return 0;
      	}
- 
+
     sms_type = MFW_NO_MESSAGE;/* SPR 2260 Don't do anything scary in rAT_PlusCMGR callback func*/
 /*CONQUEST 5991- MC- Changed third parameter in function call*/
     ret = sAT_PlusCMGR(CMD_SRC_LCL, (UBYTE)index, SMS_READ_StatusChange);
@@ -1241,7 +1241,7 @@
 #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
 /* NM, 27.5.04
 
-the sms_submit function with the parameters : addr_type and sca 
+the sms_submit function with the parameters : addr_type and sca
 has been taken out as it does not send SMS ?!
 
 */
@@ -1286,7 +1286,7 @@
   T_ACI_TOA			toa;
   T_ACI_TOA			tosca;
 #endif
-  //Mar 22 2007 ER:OMAPS00113882 x0061088 (Prachi) 
+  //Mar 22 2007 ER:OMAPS00113882 x0061088 (Prachi)
    T_ACI_TOA	set_toa;
    int addr_type;
    T_ACI_RETURN ACI_MFW_return;
@@ -1329,10 +1329,10 @@
   {
   	    set_toa.ton = TON_Alphanumeric;
         set_toa.npi = NPI_NotPresent;
-        ACI_MFW_return = sAT_PlusCMGS(CMD_SRC_LCL, dest_addr, &set_toa, &conc_data_ext, sca, NULL, rp); 
+        ACI_MFW_return = sAT_PlusCMGS(CMD_SRC_LCL, dest_addr, &set_toa, &conc_data_ext, sca, NULL, rp);
 
   }
-  else 
+  else
      ACI_MFW_return = sAT_PlusCMGS(CMD_SRC_LCL, dest_addr, NULL, &conc_data_ext, sca, NULL, rp);
 
   if(ACI_MFW_return != AT_EXCT)
@@ -1340,7 +1340,7 @@
 	//NM  if (sAT_PlusCMGS(CMD_SRC_LCL, dest_addr, &toa, &conc_data_ext, sca, &tosca, rp) NEQ AT_EXCT)
   #endif
        return MFW_SMS_FAIL;
-  return MFW_SMS_OK; 
+  return MFW_SMS_OK;
 
 }
 
@@ -1366,16 +1366,16 @@
                  T_MFW_PHB_TON sc_type)
 {
 	TRACE_FUNCTION ("sms_submit_wap_sms()");
-	
+
 	sms_wap_sent_flag = TRUE;
 
 /* NM, 27.5.04
 
-the sms_submit function with the parameters : addr_type and sca 
+the sms_submit function with the parameters : addr_type and sca
 has been taken out as it does not send SMS ?!
 
 */
-	
+
 //NM	return sms_submit(type, dest_addr, addr_type, msg, msg_len, sca, sc_type);
 }
 
@@ -1437,7 +1437,7 @@
 void rAT_PlusCMT(T_ACI_CMGL_SM*  sm)
 {	T_SMS_TYPE received_sms_type;
 	T_CONC_ASSEMBLY_RETURN concatenated_status;
-#ifdef TI_PS_FF_CONC_SMS	
+#ifdef TI_PS_FF_CONC_SMS
 	T_SM_DATA_EXT conc_data_ext;
 #endif /*TI_PS_FF_CONC_SMS*/
 	int i;
@@ -1519,7 +1519,7 @@
 				  memcpy(sms_mt.sms_msg, (char*)conc_data_ext.data, conc_data_ext.len);
 				  sms_mt.udh_len = sm->udh.len;
 				  memcpy((char *)sms_mt.udh, (char *)sm->udh.data, sm->udh.len);
-		
+
 				  /*SPR#1408 - DS - Now done at end of function
 				   *sms_signal(E_SMS_MT, &sms_mt);
 				   */
@@ -1532,7 +1532,7 @@
 #endif /*TI_PS_FF_CONC_SMS*/
   {
 
-		
+
 	  memset(&sms_mt, 0, sizeof(sms_mt));
 
 #ifdef NO_ASCIIZ
@@ -1580,13 +1580,13 @@
 	  memcpy(sms_mt.sms_msg, (char *)sm->data.data, sm->data.len);
 	  sms_mt.udh_len = sm->udh.len;
 	  memcpy((char *)sms_mt.udh, (char *)sm->udh.data, sm->udh.len);
-	  
+
 	  /*SPR#1408 - DS - Now done at end of function
 	    *sms_signal(E_SMS_MT, &sms_mt);
 	    */
   	}
-  
-  /*MC SPR 1364, need to call this function to update CPHS voicemail data*/ 
+
+  /*MC SPR 1364, need to call this function to update CPHS voicemail data*/
  /*SPR#1408 - DS - Modified to store voicemail status in SMS structure. Port of 1669 */
   if (sms_check_voice_mail(sm->pid, sm->dcs, sm->adress,
            &sm->toa, &sm->udh) == MFW_SMS_VOICE)
@@ -1599,7 +1599,7 @@
 	sms_mt.voicemail = FALSE;
   }
   sms_signal(E_SMS_MT, &sms_mt);
-  
+
 }
 
 #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
@@ -1673,7 +1673,7 @@
 
 	header_len=sm->data.data[SMS_PUSH_PDU_OFFSET+1];
 
-	pdu_len=sm->data.len-(header_len+1)-(SMS_PUSH_PDU_OFFSET+1);	
+	pdu_len=sm->data.len-(header_len+1)-(SMS_PUSH_PDU_OFFSET+1);
 	memcpy(MMS_pdu,sm->data.data+SMS_PUSH_PDU_OFFSET+2+header_len,pdu_len);
 
 	TRACE_EVENT("First SMS been recorded");
@@ -1703,14 +1703,14 @@
 #endif
   T_SMS_TYPE received_sms_type;
   T_CONC_ASSEMBLY_RETURN concatenated_status=CONC_ERR_UNKN;
-#ifdef TI_PS_FF_CONC_SMS  
+#ifdef TI_PS_FF_CONC_SMS
   T_SM_DATA_EXT conc_data_ext={NULL,0};
 #endif /*TI_PS_FF_CONC_SMS*/
 
  if (initialising_flag == FALSE)
   	{
   		/* Ignore CMTI if initialising */
-  		 	
+
 
 	  TRACE_FUNCTION ("rAT_PlusCMTI()");
 	  TRACE_EVENT_P1("f_update is = % in CMTI", f_update);
@@ -1726,7 +1726,7 @@
          }
 	  TRACE_EVENT_P1("SMS Type is = %d", received_sms_type);
 	  TRACE_EVENT_P2("msg_ref: %d, index: %d", sm->msg_ref, index);
- 
+
 #ifdef TI_PS_FF_CONC_SMS
 	  if (received_sms_type == CONCATE)
 		  {
@@ -1742,15 +1742,15 @@
 		  	}
 			TRACE_EVENT_P2("conc status: %d, conc length: %d", concatenated_status, conc_data_ext.len);
 		  }
-// July 7, 2005 REF: CRR MMI-SPR-32179 x0018858 
+// July 7, 2005 REF: CRR MMI-SPR-32179 x0018858
 // Added a check to free the variable only when CONC_COMPLETED status is encountered.
        if (concatenated_status EQ CONC_COMPLETED)
        {
     	    if(conc_data_ext.data != NULL)
 		{
 			MFREE(conc_data_ext.data);
-		}       
-       } 
+		}
+       }
 #else /*TI_PS_FF_CONC_SMS*/
 	concatenated_status = CONC_ERR_UNKN;
 #endif /*TI_PS_FF_CONC_SMS*/
@@ -1784,14 +1784,14 @@
   	{
   		TRACE_EVENT_P2("memory used is = %d, of %d", memory.used, memory.total);
   		sms_signal(E_SMS_MEM_FULL, NULL);
-  	} 
+  	}
   	}
- if(msg_info != NULL)	
+ if(msg_info != NULL)
   {
 	TRACE_EVENT_P4("CMTI Msg table: %d,%d,%d, %d", msg_info[0].index, msg_info[1].index,msg_info[2].index,msg_info[3].index);
 	TRACE_EVENT_P4("CMTI Msg table: %d,%d,%d, %d", msg_info[4].index, msg_info[5].index,msg_info[6].index,msg_info[7].index);
 }
-/*MC SPR 1364, need to call this function to update CPHS voicemail data*/ 
+/*MC SPR 1364, need to call this function to update CPHS voicemail data*/
   	 sms_check_voice_mail(sm->pid, sm->dcs, sm->adress,
                                        &sm->toa, &sm->udh);
  /*SPR 2260, this is already called in sms_store_new_msg_info, BUT we need it in for initialisation*/
@@ -1808,7 +1808,7 @@
 void sms_getPortId(UBYTE* data, UBYTE length, USHORT * destinatorPort, USHORT *originatorPort)
 {
     UBYTE ucOffset = 0;
-    USHORT usTempOffset; 
+    USHORT usTempOffset;
     UBYTE i;
 
     *destinatorPort = 0;
@@ -1818,7 +1818,7 @@
     {
         return;
     }
-    
+
     for (i = 0 ; i < 47; i++)//140/3=47
     {
         /*3GPP protocal 23040 clause 9.2.3.24*/
@@ -1838,11 +1838,11 @@
             {
                 break;
             }
-            
+
             ucOffset = usTempOffset;
         }
     }
-    
+
     return;
 }
 
@@ -1854,15 +1854,15 @@
 {
     BOOL Ret = FALSE;
     UBYTE ucOffset = 0;
-    USHORT usTempOffset; 
-    
+    USHORT usTempOffset;
+
     UBYTE i;
 
     if (UdhLength == 0)
     {
         return Ret;
     }
-    
+
     for (i = 0 ; i < 47; i++)
     {
         /*3GPP protocal 23040 clause 9.2.3.24*/
@@ -1879,12 +1879,12 @@
         else
         {
             usTempOffset    = ucOffset + UdhData[ucOffset + 1] + 2;
-            
+
             if ((usTempOffset >= MAX_SM_LEN) ||(usTempOffset >= UdhLength))
             {
                 break;
             }
-            
+
             ucOffset = usTempOffset;
         }
     }
@@ -1907,7 +1907,7 @@
 EXTERN void sms_save_to_m4(U8* pSmsPud);
 #endif
 
-BOOL sms_save_to_m4_in_Mfw( T_MNSMS_MESSAGE_IND *mnsms_message_ind ) 
+BOOL sms_save_to_m4_in_Mfw( T_MNSMS_MESSAGE_IND *mnsms_message_ind )
 {
     T_sms_sdu * sms_sdu = &mnsms_message_ind->sms_sdu;
     U8 align_pdu[SIM_PDU_LEN];
@@ -1922,7 +1922,7 @@
  pData += sms_sdu->o_buf / EIGHT_BITS;
  offset = sms_sdu->o_buf % EIGHT_BITS;
 
- 
+
 
  if (offset)
  {
@@ -1946,13 +1946,13 @@
     {
         ByteLength = (sms_sdu->l_buf/8) + 1;
     }
-    
+
 //NM    sms_save_tpdu_ffs(pSmsPud, ByteLength);
 
 #if defined (FF_MMI_MMS) || defined (FF_MMI_EMS)
     sms_save_to_m4(pSmsPud);
 #endif
-    
+
  return TRUE;
 }
 
@@ -1975,19 +1975,19 @@
   T_ACI_RETURN ret;
   T_SMS_TYPE received_sms_type;
   T_CONC_ASSEMBLY_RETURN concatenated_status;
-#ifdef TI_PS_FF_CONC_SMS  
+#ifdef TI_PS_FF_CONC_SMS
   T_SM_DATA_EXT conc_data_ext;
 #endif /*TI_PS_FF_CONC_SMS*/
   int i, j;
   static int fileid=0;
- 
+
  if (initialising_flag == FALSE)
   	{
   		/* Ignore CMTI if initialising */
-  		 	
+
 
 	  TRACE_FUNCTION ("rAT_PlusCMTI()");
-  		
+
 #if 0
 	  /////////////////////////////////////////////////////////added by ellen
 	{
@@ -2011,7 +2011,7 @@
 		    	temp2+=3;
 		    	i_sum ++;
 		    	if(i_sum > 30) 	break;
-		    	
+
 		    }
 		TRACE_EVENT(temp);
 
@@ -2029,7 +2029,7 @@
 		    	temp2+=3;
 		    	i_sum ++;
 		    	if(i_sum > 30) 	break;
-		    	
+
 		    }
 		TRACE_EVENT(temp);
 
@@ -2039,10 +2039,10 @@
 
 		/* SPR#2086 - SH - Intercept a WAP SMS *///TISHMMS Project
 		{
-            
+
 			USHORT destinatorPort;
 			USHORT originatorPort;
-            
+
                      sms_getPortId(sm->udh.data, sm->udh.len, &destinatorPort, &originatorPort);
 
 			//xmzhou_trace_string_value("New Msg arrived,desti port=",destinatorPort);
@@ -2050,7 +2050,7 @@
 
   			//xmzhou_trace_string_value("CMTI new msg udh length=",sm->udh.len);
   			//xmzhou_trace_n_bytes(sm->udh.data,sm->udh.len);
-  		
+
 			TRACE_EVENT_P2("+++++ In rAT_PlusCMTI ready to judge PUSH or not DestP=%d,OrgP=%d +++++",destinatorPort,originatorPort);
 			if (destinatorPort==2948
 				|| destinatorPort==2949
@@ -2061,21 +2061,21 @@
 				|| originatorPort==9202
 				|| originatorPort==9203)
 
-			{	
+			{
 				USHORT index_i;
-				
+
   		//xmzhou_trace_string_value("CMTI new msg data length=",sm->data.len);
               //xmzhou_trace_string("WAP SMS be identified!!!!!!!");
   		//xmzhou_trace_n_bytes(sm->data.data,sm->data.len);
-#if 0				
+#if 0
   		fileid++;
-  		
+
   		if(fileid==1){
   		xmzhou_trace_string_value("CMTI new msg data1 length=",sm->data.len);
   		if((sm->data.len)<2048)	ffs_fwrite("/mms/data1", sm->data.data, sm->data.len);
 
 		rvf_delay(500);
-		
+
   		xmzhou_trace_string_value("CMTI new msg udh1 length=",sm->udh.len);
   		if((sm->udh.len)<2048)  ffs_fwrite("/mms/udh1", sm->udh.data, sm->udh.len);
 
@@ -2092,9 +2092,9 @@
   		}
 
   		rvf_delay(1000);
-#endif  		
+#endif
 				/*a0393213 OMAPS00109953 - memory added as parameter*/
-				sms_msg_delete(index,mem);				
+				sms_msg_delete(index,mem);
 #if 0
 //////////////////////////////////////////////////////////////////////////////////
 				TRACE_EVENT("MMS Notification");
@@ -2102,7 +2102,7 @@
 					redirectMMSNotification(sm);
 				}
 				else {
-/////////////////////////////////////////////////////////////////////////////////			
+/////////////////////////////////////////////////////////////////////////////////
 #endif
 				memset(&sms_mt, 0, sizeof(sms_mt));
 
@@ -2110,7 +2110,7 @@
 				{
 					TRACE_EVENT_P2("Adress: %X (%c)", sm->adress[index_i], sm->adress[index_i]);
 				}
-				
+
 				memcpy(sms_mt.orig_addr.tag, sm->alpha.data, sm->alpha.len);
 				sms_mt.orig_addr.len = sm->alpha.len;
 				strcpy(sms_mt.orig_addr.number, sm->adress);
@@ -2135,31 +2135,31 @@
 				sms_signal(E_SMS_WAP_MT_RECEIVED, &sms_mt);
 
 				/* Delete the message */
-				
+
 				return;
-#if 0				
+#if 0
 			}/*end of else*/
-#endif			
+#endif
 		}
 	}
 
        {
         //BOOL sms_is_ems_type(UBYTE* UdhData, UBYTE UdhLength)
             BOOL bIsEms = FALSE;
-        
+
             bIsEms = sms_is_ems_type(sm->udh.data, sm->udh.len);
 
             if (bIsEms == TRUE)
             {
                 //xmzhou_trace_string("EMS SMS received!!!!!!!!!!!!");//proc EMS message
 		   /*a0393213 OMAPS00109953 - memory added as parameter*/
-                sms_msg_delete(index,mem);				
+                sms_msg_delete(index,mem);
                 sms_save_to_m4_in_Mfw( &gTpduData );
             }
 
 
        }
-	
+
 	  TRACE_EVENT_P1("f_update is = % in CMTI", f_update);
 	/*a0393213 OMAPS00109953 - new parameter added to SMS_getSMSType()*/
 	if(initialising_flag == TRUE)
@@ -2172,7 +2172,7 @@
        }
        TRACE_EVENT_P1("SMS Type is = %d", received_sms_type);
 	 TRACE_EVENT_P2("msg_ref: %d, index: %d", sm->msg_ref, index);
- 
+
 #ifdef TI_PS_FF_CONC_SMS
 
 	  if (received_sms_type == CONCATE)
@@ -2189,7 +2189,7 @@
 		  	}
 			TRACE_EVENT_P2("conc status: %d, conc length: %d", concatenated_status, conc_data_ext.len);
 		  }
-#else /*TI_PS_FF_CONC_SMS*/	  
+#else /*TI_PS_FF_CONC_SMS*/
 	concatenated_status = CONC_ERR_UNKN;
 #endif /*TI_PS_FF_CONC_SMS*/
 
@@ -2224,14 +2224,14 @@
   	{
   		TRACE_EVENT_P2("memory used is = %d, of %d", memory.used, memory.total);
   		sms_signal(E_SMS_MEM_FULL, NULL);
-  	} 
+  	}
   	}
-  if(msg_info != NULL)	
-  {	
+  if(msg_info != NULL)
+  {
 	TRACE_EVENT_P4("CMTI Msg table: %d,%d,%d, %d", msg_info[0].index, msg_info[1].index,msg_info[2].index,msg_info[3].index);
 	TRACE_EVENT_P4("CMTI Msg table: %d,%d,%d, %d", msg_info[4].index, msg_info[5].index,msg_info[6].index,msg_info[7].index);
 }
-/*MC SPR 1366, need to call this function to update CPHS voicemail data*/ 
+/*MC SPR 1366, need to call this function to update CPHS voicemail data*/
   	 sms_check_voice_mail(sm->pid, sm->dcs, sm->adress,
                                       &sm->toa, &sm->udh);
  /*SPR 1833, this is already called in sms_store_new_msg_info, BUT we need it in for initialisation*/
@@ -2254,7 +2254,7 @@
     int i;
 
     TRACE_FUNCTION("find_slot_in_msg_info");
-    
+
     if (index >= 1)
     {
         /* A valid index, so look for it already being in msg_info */
@@ -2265,7 +2265,7 @@
 #endif
         {
             /*a0393213 OMAPS00109953 - mem also taken into consideration*/
-            if (msg_info[i].index == index && msg_info[i].mem==mem) 
+            if (msg_info[i].index == index && msg_info[i].mem==mem)
             {
                 /* Index already in msg_info, so replace */
                 ret = i;
@@ -2319,9 +2319,9 @@
 									   T_SMS_TYPE received_sms_type, T_MFW_SMS_MEM mem)
 {
   int j;
-  // Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+  // Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
   // Added this variable to store the voice mail status
-  T_MFW status; 
+  T_MFW status;
 
 #ifndef MMI_LITE
   //T_CONC_ASSEMBLY_RETURN concatenated_status;  // RAVI
@@ -2331,47 +2331,47 @@
 
 
   TRACE_EVENT("sms_store_new_msg_info");
-  
+
 #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
   sms_type = MFW_SMS_MESSAGE;
 #else
 	/*SPR 2530 removed setting of sms_type flag*/
 #endif
     /*a0393213 OMAPS00109953 - memory added as parameter*/
-    if ((j = find_slot_in_msg_info(index, update_mem,mem)) != -1)		
+    if ((j = find_slot_in_msg_info(index, update_mem,mem)) != -1)
 	{
 		//x0pleela 07 Feb, 2006  DR: OMAPS00059261
 		//Initial value of msg_type is set to not voice
 		 msg_info[j].msg_type = MFW_SMS_NotVOICE;
 
 	    TRACE_EVENT_P1("SMS Type is = %d", received_sms_type);
-	 	
-
-#ifdef TI_PS_FF_CONC_SMS	
+
+
+#ifdef TI_PS_FF_CONC_SMS
 			/*SPR 2260*/
 		  if (received_sms_type == CONCATE)
-		  {	 
+		  {
              	/*a0393213 OMAPS00109953 - code cleanup done*/
 			UBYTE first_index=0;
 			T_MFW_SMS_MEM first_mem=MFW_MEM_NOTPRESENT;
 			T_CONC_BUF_ELEM* conc_buf_elem;
 			conc_buf_elem=concSMS_GetFirstIndex_ext(concSMS_GetMsgRef ( sm ), sm->adress);
-			/*a0393213 OMAPS00109953 - The memory type returned by concSMS_GetFirstIndex_ext 
+			/*a0393213 OMAPS00109953 - The memory type returned by concSMS_GetFirstIndex_ext
 			if of psa type. It should be changed to cmh type. Clean solution would be to move this conversion to ACI */
 			if(conc_buf_elem)
 				{
 				first_index=conc_buf_elem->rec_num;
-				cmhSMS_getMemCmh(conc_buf_elem->mem,(T_ACI_SMS_STOR*)(&first_mem));			
+				cmhSMS_getMemCmh(conc_buf_elem->mem,(T_ACI_SMS_STOR*)(&first_mem));
 				}
 			/*a0393213 OMAPS00109953 - Msg Ref (unique number to each message, don't confuse with index) is stored*/
 			msg_info[j].msg_ref=concSMS_GetMsgRef ( sm );
-		   	 	
+
 	   	  	if (conc_stat == CONC_COMPLETED)
 		   	{	/*replace index withat of first message*/
 		   		index = first_index;
 				/*a0393213 OMAPS00109953 - first_mem is the memory where the first segment of the cSMS resides*/
 				mem=first_mem;
-			
+
 				msg_info[j].concat_status = MFW_SMS_CONC_WHOLE;
 				TRACE_EVENT("Setting to WHOLE");
 		   	 }
@@ -2389,17 +2389,17 @@
 							return 1;/*don't bother copying this message into the table*/ // RAVI - Changed return to return 1
 					}
 				}
-						
+
 		   	  msg_info[j].concat_status = MFW_SMS_CONC_PART;
 		   	  TRACE_EVENT("Setting to PART");
 		   	  }
-		   	 
+
 		   	  TRACE_EVENT_P1("index = %d",index);
 
 		   	  msg_info[j].first_index =first_index;
 /*a0393213 OMAPS00109953*/
           		  msg_info[j].first_mem=first_mem;
-	   	  		
+
 		  		/*if complete SMS, delete old fragments*/
 		  		if (conc_stat == CONC_COMPLETED)
 #ifdef FF_MMI_SMS_DYNAMIC
@@ -2407,18 +2407,18 @@
 #else
 		  		for (i=0; i<MAX_MESSAGES; i++)
 #endif
-		   	  	{	
+		   	  	{
 					if (msg_info[i].index != -1)
 					{
   					       /*a0393213 OMAPS00109953*/
 						 if (msg_info[i].msg_ref==concSMS_GetMsgRef ( sm )
                                                &&(msg_info[i].concat_status == MFW_SMS_CONC_PART ))
-						 {	
+						 {
 						 	TRACE_EVENT_P1("Deleting index number:%d", msg_info[i].index);
 			  				delete_sms_from_table(msg_info[i].index, msg_info[i].mem);/*a0393213 OMAPS00109953*/
 			  			}
 					}
-		  			
+
 		  	  	}
 		  }
 		  /*a0393213 OMAPS00109953 - new case added - it's the case where segments of cSMS are treated as normal SMS*/
@@ -2428,24 +2428,24 @@
 			msg_info[j].first_index = 0xFF;/*invalid index*/
 			msg_info[j].first_mem=MFW_MEM_NOTPRESENT;/*a0393213 OMAPS00109953*/
 		  	msg_info[j].concat_status = MFW_SMS_CONC_PART;
-		  }	
+		  }
 		  else
-#endif /*TI_PS_FF_CONC_SMS*/	
-		  {	
+#endif /*TI_PS_FF_CONC_SMS*/
+		  {
 		  	msg_info[j].first_index = 0xFF;/*invalid index*/
 			msg_info[j].first_mem=MFW_MEM_NOTPRESENT;/*a0393213 OMAPS00109953*/
 		  	msg_info[j].concat_status = MFW_SMS_NO_CONC;
 		  	TRACE_EVENT("Setting to NO CONC");
 		  }
-	
-	   	
+
+
    	    sm->index = index;
    		msg_info[j].index = index;
 		msg_info[j].mem=mem;/*a0393213 OMAPS00109953*/
 
    		//x0pleela 08 Feb, 2006 DR: OMAPS00059261
 		//Replacing MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed
-		
+
 		//x0pleela 07 Feb, 2006 DR: OMAPS00059261
 		//Update msg_info's message type for STATUS REPORT
 		if(( 0x03 & sm->fo ) EQ MFW_MSG_STATUS_REPORT )
@@ -2453,26 +2453,26 @@
 			msg_info[j].msg_type = MFW_SMS_STATRPT;
 		}
 		msg_info[j].stat = sms_decodeStatus(sm->stat);
-		
+
 		strcpy((char *)msg_info[j].addr.number, sm->adress);
 		msg_info[j].addr.ton = phb_cvtTon(sm->toa.ton);
 		msg_info[j].addr.npi = (T_MFW_PHB_NPI)phb_cvtNpi(sm->toa.npi);
 
 
 #ifdef NO_ASCIIZ
-			memcpy(msg_info[j].addr.tag, 
-			sm->alpha.data, 
+			memcpy(msg_info[j].addr.tag,
+			sm->alpha.data,
 			sm->alpha.len);
 			msg_info[j].addr.len = sm->alpha.len;
 #else
-			phb_Alpha2Gsm(&sm->alpha, 
+			phb_Alpha2Gsm(&sm->alpha,
 			(UBYTE *)msg_info[j].addr.tag);
 #endif
 
 		memcpy(&msg_info[j].rctp, &sm->scts, sizeof(T_MFW_SMS_SCTP));
 
 		// check voice mail status
-		// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+		// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
 		// Commented the 'if' condition below.
 /*		if (sms_check_voice_mail(sm->pid, sm->dcs, sm->adress,
 		    &sm->toa, &sm->udh) EQ MFW_SMS_VOICE)
@@ -2484,13 +2484,13 @@
 		{
 			// If voicemail message is from group "1100"
 			if(status == MFW_SMS_VOICEMSG_DELETE)
-			{	
+			{
 				// Mark this message for deletion
 				msg_info[j].stat= MFW_SMS_VOICEMSG_DELETE;
 			}
 		    msg_info[j].msg_type = MFW_SMS_VOICE;
-		} 
-		
+		}
+
 		coll_sms_read = MFW_SMS_FREE;
         f_update = MFW_SMS_FREE;
         TRACE_EVENT_P1("UDH Length is = %d", sm->udh.len);
@@ -2499,9 +2499,9 @@
     TRACE_EVENT_P2("memory used is = %d, of %d", memory.used, memory.total);
     if(memory.total == memory.used)
   	{
-  		
+
   		sms_signal(E_SMS_MEM_FULL, NULL);
-  	}  
+  	}
 	return 1; // RAVI
 }
 
@@ -2547,7 +2547,7 @@
 				else
 				{
 					//Aug 26, 2004    REF: CRR 23287     Deepa M.D
-					//The second parameter is not used in case of 
+					//The second parameter is not used in case of
 					//E_SMS_MT_RECEIVED event.sms_id_wait is the variable
 					//used for MT SMS, which is ignored anyway.
 					sms_signal(E_SMS_MT_RECEIVED, &sms_id_wait);
@@ -2565,7 +2565,7 @@
 		else
 		{
 			//Aug 26, 2004    REF: CRR 23287     Deepa M.D
-			//The second parameter is not used in case of 
+			//The second parameter is not used in case of
 			//E_SMS_MT_RECEIVED event.sms_id_wait is the variable
 			//used for MT SMS, which is ignored anyway.
 			sms_signal(E_SMS_MT_RECEIVED, &sms_id_wait);
@@ -2689,14 +2689,14 @@
              phb_list.entry->name.data,
              phb_list.entry->name.len);
       sms_status.addr.len = phb_list.entry->name.len;
-		  
+
 	  }
 //  Apr 12, 2004    REF: CRR 13370     Deepa M.D
 	  else
 	  {
 		  sms_status.addr.tag[0]='\0';
 		  sms_status.addr.len = 0;
-		  
+
     }
   }
 #else
@@ -2706,11 +2706,11 @@
                          st->ra,
                          &phb_list) EQ MFW_PHB_OK)
   {
-	  
+
     if (phb_list.num_entries)
     {
       strcpy((char *)sms_status.addr.tag, (char *)phb_list.entry->name);
-		  
+
     }
   }
 #endif
@@ -2745,7 +2745,7 @@
   TRACE_FUNCTION ("sms_set_pref_memory()");
 
   /*a0393213 OMAPS00109953 - The pref memory is already same as mem*/
-  if(memory.mem==mem)	
+  if(memory.mem==mem)
   	return MFW_SMS_OK;
 
   if (sAT_PlusCPMS(CMD_SRC_LCL,
@@ -2771,7 +2771,7 @@
 {
   TRACE_EVENT_P1("sms_read():%d",index);
 
-     /*a0393213 OMAPS00109953 - set preferred memory before calling sAT_PlusCMGR*/	
+     /*a0393213 OMAPS00109953 - set preferred memory before calling sAT_PlusCMGR*/
      if(sms_set_pref_memory(sms_memory)!=MFW_SMS_OK)
      	{
      	TRACE_ERROR("sms_read_msg_info():Not able to set pref memory");
@@ -2817,14 +2817,14 @@
 #endif /*TI_PS_FF_CONC_SMS*/
 	//Feb 28, 2004    REF: CRR 28809   Deepa M.D
 	//sms_mo is  made a local variable.It will be allocated /deallocated dynamically.
-	T_MFW_SMS_MO *sms_mo=NULL;   
+	T_MFW_SMS_MO *sms_mo=NULL;
 #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
 UBYTE wap_sms = FALSE;
 #endif
   TRACE_FUNCTION ("rAT_PlusCMGR()");
   TRACE_EVENT_P2("messagepointer:%d, Cellbroadcast pointer:%d", sm, cbm);
   cmgr_awaiting_ok = TRUE; // Marcus: Issue 2260: 03/10/2002
-#ifdef TI_PS_FF_CONC_SMS  
+#ifdef TI_PS_FF_CONC_SMS
   conc_data_ext.data = NULL; //  Jul 07, 2004    REF: CRR 15846     Deepa M.D
 #endif /*TI_PS_FF_CONC_SMS*/
   #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
@@ -2832,14 +2832,14 @@
       {
           USHORT destinatorPort = sm->udh.data[3]+sm->udh.data[2]*0x100;
           USHORT originatorPort = sm->udh.data[5]+sm->udh.data[4]*0x100;
-          
+
           if (destinatorPort==2948
               || destinatorPort==2949
               || originatorPort==9200
               || originatorPort==9201
               || originatorPort==9202
               || originatorPort==9203)
-          {   
+          {
               wap_sms = TRUE;
           }
       }
@@ -2851,7 +2851,7 @@
       	{   switch (0x03 & sm->fo)
 	      {
 	         case MFW_MSG_DELIVER:  //x0pleela 01 Feb, 2006 DR: OMAPS00059261 /* SMS type: MT */
-	        { 
+	        {
 #ifdef TI_PS_FF_CONC_SMS
 	    	USHORT conc_msg_ref;
 	          	UBYTE conc_index;
@@ -2860,21 +2860,21 @@
 			  BOOL continue_flag=FALSE;/*SPR2260*/
 #endif /*TI_PS_FF_CONC_SMS*/
 
-			
+
 	          	TRACE_EVENT_P1("UDH Length is = %d", sm->udh.len);
 	    		received_sms_type = SMS_getSMSType( &sm->udh, sm->adress, MODE3);/*a0393213 OMAPS00109953*/
 			TRACE_EVENT_P1("SMS Type is = %d", received_sms_type);
-  		
+
 #ifdef TI_PS_FF_CONC_SMS
 	  		if (received_sms_type == CONCATE)
 	  		{
 			  /*a0393213 OMAPS00109953*/
 			  concatenated_status =concSMS_Collect(&conc_data_ext, sm, FALSE, SMS_STOR_NotPresent);
 			  TRACE_EVENT_P2("conc status: %d, conc length: %d", concatenated_status, conc_data_ext.len);
-	  		
+
 				switch (concatenated_status)
 				{
-				  
+
 				  case CONC_ERR_BUF_FULL:
 				    TRACE_EVENT("Concatented SMS buffer Full Error");
 				     sms_signal(E_SMS_ERR, NULL);
@@ -2885,7 +2885,7 @@
 				  	TRACE_EVENT("Concatenation Continued");
 					/*SPR 2260*/
 	                cmgr_awaiting_ok = FALSE; // Marcus: Issue 2260: 03/10/2002
-					
+
 					/*if the index exists in the message table, process the message*/
 #ifdef FF_MMI_SMS_DYNAMIC
 					for (i=0; i <g_max_messages;i++)
@@ -2896,14 +2896,14 @@
 							continue_flag = TRUE;
 					if (!continue_flag)
 						break;
-				  
+
 				  case CONC_COMPLETED:
 				  {
 				    TRACE_EVENT("Concatenation Completed");
 					memset(&sms_mt, 0, sizeof(sms_mt));
 					/*a0393213 OMAPS00109953*/
 					conc_msg_ref=concSMS_GetMsgRef(sm);
-					conc_buf_elem=concSMS_GetFirstIndex_ext(conc_msg_ref,sm->adress);	
+					conc_buf_elem=concSMS_GetFirstIndex_ext(conc_msg_ref,sm->adress);
 					conc_index=conc_buf_elem->rec_num;
 #ifdef NO_ASCIIZ
 					memcpy(sms_mt.orig_addr.tag,
@@ -2932,7 +2932,7 @@
 						sms_mt.index = sm->msg_ref;
 					/*a0393213 OMAPS00109953 - the memory is of psa type. It should be converted to cmh type
 					Clean solution would be to move this conversion to ACI*/
-					cmhSMS_getMemCmh(conc_buf_elem->mem,(T_ACI_SMS_STOR*)(&(sms_mt.memory)));								
+					cmhSMS_getMemCmh(conc_buf_elem->mem,(T_ACI_SMS_STOR*)(&(sms_mt.memory)));
 					sms_mt.rp      = sm->fo >> 7 & 1;
 
 					/* SBH */
@@ -2945,7 +2945,7 @@
 						sms_mt.ti = 1;
 					}
 					/* SBH end */
-					
+
 					memcpy((char *)sms_mt.sctp.year, (char *)sm->scts.year, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mt.sctp.month, (char *)sm->scts.month, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mt.sctp.day, (char *)sm->scts.day, MAX_SCTP_DIGITS);
@@ -2953,7 +2953,7 @@
 					memcpy((char *)sms_mt.sctp.minute, (char *)sm->scts.minute, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mt.sctp.second, (char *)sm->scts.second, MAX_SCTP_DIGITS);
 					sms_mt.sctp.timezone = sm->scts.timezone;
-						  
+
 					/* copy length of whole concat SMS*/
 					if (conc_data_ext.len > MAX_MSG_LEN)
 					  sms_mt.msg_len = MAX_MSG_LEN;
@@ -2980,22 +2980,22 @@
 					}
 					sms_mt.udh_len = sm->udh.len;
 					memcpy((char *)sms_mt.udh, (char *)sm->udh.data, sm->udh.len);
-					
-				  /*MC SPR 2260, need to call this function to update CPHS voicemail data*/ 
+
+				  /*MC SPR 2260, need to call this function to update CPHS voicemail data*/
   	 				if (sms_check_voice_mail(sm->pid, sm->dcs, sm->adress,
                                        &sm->toa, &sm->udh) == MFW_SMS_VOICE)
                   		sms_mt.voicemail = TRUE;
   	 				else
   	 					sms_mt.voicemail = FALSE;
-  	 				
+
 	          			  sms_type = MFW_NO_MESSAGE;
 
 	          			  coll_sms_read = MFW_SMS_FREE;
     					 /*whenever some operation is done the pref memory should be set back to SIM*/
        				  if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
    					  {
-       					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
-       				  }						  
+       					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
+       				  }
 	         			  sms_signal(E_SMS_MT, &sms_mt);
 						}
 					}
@@ -3015,17 +3015,17 @@
 
 					if (sm->toa.ton == TON_International)
 						sprintf(sms_mt.orig_addr.number, "+%s", sm->adress);
-					else	
+					else
 						strcpy(sms_mt.orig_addr.number, sm->adress);
 
 					sms_mt.orig_addr.ton = phb_cvtTon(sm->toa.ton);
 					sms_mt.orig_addr.npi = (T_MFW_PHB_NPI)phb_cvtNpi(sm->toa.npi);
-		          
+
 					if (sm->tosca.ton == TON_International)
 						sprintf(sms_mt.sc_addr, "+%s", sm->sca);
 					else
 						strcpy(sms_mt.sc_addr, sm->sca);
-		          
+
 					sms_mt.prot_id = (UBYTE)sm->pid;
 					sms_mt.dcs     = (UBYTE)sm->dcs & 0xFC;	/* Ignore message class */
 					sms_mt.rp		 = sm->fo >> 7 & 1;
@@ -3043,7 +3043,7 @@
 					/* SBH end */
 
 					TRACE_EVENT_P2("dcs: %d, ti: %d", sms_mt.dcs, sms_mt.ti);
-					
+
 					memcpy((char *)sms_mt.sctp.year, (char *)sm->scts.year, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mt.sctp.month, (char *)sm->scts.month, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mt.sctp.day, (char *)sm->scts.day, MAX_SCTP_DIGITS);
@@ -3056,7 +3056,7 @@
 				#if defined (FF_WAP) && defined (FF_GPF_TCPIP)
 				        /* SPR#2086 - SH - If we've got a WAP SMS, replace the message
 					 * with a string */
-				
+
 					if (wap_sms)
 					{
 						char *message = "WAP SMS";
@@ -3066,7 +3066,7 @@
 					}
                                     else
                                     {
-                                        
+
                                         /*SPR 2260, if invalid message just set text to NULL*/
 				#endif
 		         if (sm->stat == SMS_STAT_Invalid)
@@ -3075,7 +3075,7 @@
 				 {
 				  	memcpy(sms_mt.sms_msg, (char*)sm->data.data, sm->data.len);
 					sms_mt.msg_len = sm->data.len;
-				  
+
 				 }
 		         /*SPR 2260 end*/
 					sms_mt.udh_len = sm->udh.len;
@@ -3087,7 +3087,7 @@
                                     }
 #endif
 
-			  /*MC SPR 2260, need to call this function to update CPHS voicemail data*/ 
+			  /*MC SPR 2260, need to call this function to update CPHS voicemail data*/
   	 				if (sms_check_voice_mail(sm->pid, sm->dcs, sm->adress,
                                        &sm->toa, &sm->udh) == MFW_SMS_VOICE)
                   		sms_mt.voicemail = TRUE;
@@ -3096,15 +3096,15 @@
 					/*whenever some operation is done the pref memory should be set back to SIM*/
 				      if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
 					{
-    					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
-    					}					
+    					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
+    					}
 					sms_signal(E_SMS_MT, &sms_mt);
 				}
 	        }
 	          break;
 
 	        case MFW_MSG_SUBMIT://x0pleela 01 Feb, 2006 DR: OMAPS00059261 /* SMS type: MO */
-	        	{	 
+	        	{
 #ifdef TI_PS_FF_CONC_SMS
 					int i;/*SPR2260*/
 			  		BOOL continue_flag=FALSE;
@@ -3112,11 +3112,11 @@
 	          		UBYTE conc_index;
 				/*a0393213 OMAPS00109953*/
 				T_CONC_BUF_ELEM* conc_buf_elem=NULL;
-#endif /*TI_PS_FF_CONC_SMS*/					
+#endif /*TI_PS_FF_CONC_SMS*/
 
 				//Feb 28, 2004    REF: CRR 28809   Deepa M.D
 				//Allocate sms_mo dynamically
-				sms_mo = (T_MFW_SMS_MO*)mfwAlloc(sizeof(T_MFW_SMS_MO));  
+				sms_mo = (T_MFW_SMS_MO*)mfwAlloc(sizeof(T_MFW_SMS_MO));
 				if (sms_mo == NULL)
 				{
 					TRACE_EVENT("sms_mo alloc failed");
@@ -3131,15 +3131,15 @@
 					/*a0393213 OMAPS00109953 - memory added as parameter*/
 					concatenated_status =concSMS_Collect(&conc_data_ext, sm, FALSE, SMS_STOR_NotPresent);
 					TRACE_EVENT_P2("conc status: %d, conc length: %d", concatenated_status, conc_data_ext.len);
-				
-				
+
+
 				TRACE_EVENT_P1("UDH Length is = %d", sm->udh.len);
-				
-				
-				
+
+
+
 					switch (concatenated_status)
 					{
-						
+
 					case CONC_ERR_BUF_FULL:
 						TRACE_EVENT("Concatented SMS buffer Full Error");
 						sms_signal(E_SMS_ERR, NULL);
@@ -3160,18 +3160,18 @@
 							if (!continue_flag)
 								break;
 					case CONC_COMPLETED:
-						{ 	
-							
+						{
+
 							TRACE_EVENT("Concatenation Completed");
-							
+
 							memset(sms_mo, 0, sizeof(T_MFW_SMS_MO));
 							/*SPR 2260*/
 							/*a0393213 OMAPS00109953*/
 							conc_msg_ref=concSMS_GetMsgRef(sm);
-							conc_buf_elem=concSMS_GetFirstIndex_ext(conc_msg_ref,sm->adress);	
+							conc_buf_elem=concSMS_GetFirstIndex_ext(conc_msg_ref,sm->adress);
 							conc_index=conc_buf_elem->rec_num;
 							TRACE_EVENT_P2("msg_len: %d conc len: %d", sms_mo->msg_len, conc_data_ext.len);
-							
+
 #ifdef NO_ASCIIZ
 							memcpy(sms_mo->dest_addr.tag,
 								sm->alpha.data,
@@ -3187,10 +3187,10 @@
 								sprintf(sms_mo->sc_addr, "+%s", sm->sca);
 							else
 								strcpy((char *)sms_mo->sc_addr, sm->sca);
-							
+
 							sms_mo->prot_id = (UBYTE)sm->pid;
 							sms_mo->dcs     = sm->dcs;
-							
+
 							/*MC SPR 2260, message index should be set to that of first index in
 							concatenated message if this is a complete message*/
 							if (concatenated_status == CONC_COMPLETED)
@@ -3199,11 +3199,11 @@
 								sms_mo->msg_ref = sm->msg_ref;
 							/*a0393213 OMAPS00109953 - the memory is of psa type. It should be converted to cmh type.
 							Clean solution would be to move this ACI*/
-							cmhSMS_getMemCmh(conc_buf_elem->mem,(T_ACI_SMS_STOR*)(&(sms_mo->memory )));															
-							
+							cmhSMS_getMemCmh(conc_buf_elem->mem,(T_ACI_SMS_STOR*)(&(sms_mo->memory )));
+
 							sms_mo->vp_mode = 0x03 & sm->fo << 2;
 							sms_mo->vp_rel  = (UBYTE)sm->vp_rel;
-							
+
 							memcpy((char *)sms_mo->vp_abs.year, (char *)sm->scts.year, MAX_SCTP_DIGITS);
 							memcpy((char *)sms_mo->vp_abs.month, (char *)sm->scts.month, MAX_SCTP_DIGITS);
 							memcpy((char *)sms_mo->vp_abs.day, (char *)sm->scts.day, MAX_SCTP_DIGITS);
@@ -3211,7 +3211,7 @@
 							memcpy((char *)sms_mo->vp_abs.minute, (char *)sm->scts.minute, MAX_SCTP_DIGITS);
 							memcpy((char *)sms_mo->vp_abs.second, (char *)sm->scts.second, MAX_SCTP_DIGITS);
 							sms_mo->vp_abs.timezone = sm->scts.timezone;
-							
+
 							/* copy length of whole concat SMS*/
 							if (conc_data_ext.len > MAX_MSG_LEN)
 								sms_mo->msg_len = MAX_MSG_LEN;
@@ -3228,7 +3228,7 @@
 							sms_mo->msg_len = sm->data.len;
 							}
 							}
-							
+
 							/* Free memory allocated by the ACI */
 							//  Jul 07, 2004    REF: CRR 15846     Deepa M.D
 							//Free the memory only if conc_data_ext.data  is not NULL.
@@ -3240,14 +3240,14 @@
 							/*whenever some operation is done the pref memory should be set back to SIM*/
 						      if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
     							{
-		    					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
+		    					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
 		    					}
 							sms_signal(E_SMS_MO, sms_mo);
 						}
 					}
 				}
 				else
-#endif /*TI_PS_FF_CONC_SMS*/					
+#endif /*TI_PS_FF_CONC_SMS*/
 				{
 #ifdef NO_ASCIIZ
 					memcpy(sms_mo->dest_addr.tag,
@@ -3264,7 +3264,7 @@
 						sprintf(sms_mo->sc_addr, "+%s", sm->sca);
 					else
 						strcpy((char *)sms_mo->sc_addr, sm->sca);
-					
+
 					sms_mo->prot_id = (UBYTE)sm->pid;
 					sms_mo->dcs     = sm->dcs;
 					sms_mo->msg_ref = sm->msg_ref;
@@ -3273,7 +3273,7 @@
 					/*a0393213 OMAPS00109953 - for normal sms the memory, from where the message is read,
 					would be the preferred memory, which is set just before calling sAT_PlusCMGR*/
 					sms_mo->memory=(T_MFW_SMS_MEM)memory.mem;
-					
+
 					memcpy((char *)sms_mo->vp_abs.year, (char *)sm->scts.year, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mo->vp_abs.month, (char *)sm->scts.month, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mo->vp_abs.day, (char *)sm->scts.day, MAX_SCTP_DIGITS);
@@ -3281,7 +3281,7 @@
 					memcpy((char *)sms_mo->vp_abs.minute, (char *)sm->scts.minute, MAX_SCTP_DIGITS);
 					memcpy((char *)sms_mo->vp_abs.second, (char *)sm->scts.second, MAX_SCTP_DIGITS);
 					sms_mo->vp_abs.timezone = sm->scts.timezone;
-					
+
 					TRACE_EVENT("Normal MO Message");
 					sms_mo->msg_len = sm->data.len;
 					#if defined (FF_WAP) && defined (FF_GPF_TCPIP)
@@ -3295,12 +3295,12 @@
 				}
                             else
                             {
-	#endif   
+	#endif
 					/* CQ:16780 clear the buffer before reading in the retrieved SMS, prevents residual characters
 					from previous message being displayed. 15-01-04 MZ*/
-					
-					memset(sms_mo->sms_msg, NULL, MAX_MSG_LEN_ARRAY);  
-					
+
+					memset(sms_mo->sms_msg, NULL, MAX_MSG_LEN_ARRAY);
+
 					/*SPR 2260 if invalid message just set text to NULL*/
 					if (sm->stat != SMS_STAT_Invalid)
 						memcpy(sms_mo->sms_msg, (char *)sm->data.data, sm->data.len);
@@ -3311,7 +3311,7 @@
 					/*whenever some operation is done the pref memory should be set back to SIM*/
 				      if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
 					{
-    					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
+    					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
     					}
 					sms_signal(E_SMS_MO, sms_mo);
 				}
@@ -3320,12 +3320,12 @@
 				//Deallocate the variable
 				if(sms_mo!=NULL)
 				{
-					mfwFree((U8*)sms_mo, sizeof(T_MFW_SMS_MO)); 
+					mfwFree((U8*)sms_mo, sizeof(T_MFW_SMS_MO));
 					sms_mo=NULL;
 				}
-				
+
 				break;
- 
+
 				//x0pleela 30 Jan, 2006 DR: OMAPS00059261
 				//Store the status report message into sms_mt
 #ifndef NEPTUNE_BOARD
@@ -3343,7 +3343,7 @@
 #endif
 				  if (sm->toa.ton == TON_International)
 				    sprintf(sms_mt.orig_addr.number, "+%s", sm->adress);
-				  else	
+				  else
 				    strcpy(sms_mt.orig_addr.number, sm->adress);
 
   				  sms_mt.orig_addr.ton = phb_cvtTon(sm->toa.ton);
@@ -3384,13 +3384,13 @@
 
 				  memset(sms_str, 0, MAX_STAT_MSG_LEN);
 				  memset(sms_mt.sms_msg, NULL, MAX_MSG_LEN_ARRAY);
-				  
+
 				  //x0pleela 01 Feb, 2006 DR: OMAPS00059261
 				  //To display the message as "Delivered" or "Pending" as per the status
 				  TRACE_EVENT_P1("sm->stat: %d", sm->tp_status);
   				  //x0pleela 06 Feb, 2006 DR: OMAPS00059261
 				  //To display the message as "Delivered" or "Pending" as per the tp_status
-				  if( !sm->tp_status ) 
+				  if( !sm->tp_status )
 				  {
 				    strcpy(sms_str, "Delivered:");
 				  }
@@ -3402,7 +3402,7 @@
 				  memcpy(sms_mt.sms_msg, sms_str, strlen(sms_str));
 				  sms_mt.msg_len = strlen(sms_str);
 				  TRACE_EVENT_P2("sm->adress:%s, sms_str:%s ",sm->adress,sms_str);
- 				  							
+
 				  /*SPR 2260 end*/
 				  sms_mt.udh_len = sm->udh.len;
 				  memcpy((char *)sms_mt.udh, (char *)sm->udh.data, sm->udh.len);
@@ -3412,7 +3412,7 @@
 
 				//x0pleela 08 Feb, 2006 DR: OMAPS00059261
 				//Replacing MT_STATUS_RPT with MFW_SMS_STATRPT as MT_STATUS_RPT is removed
-		
+
 				  //x0pleela 30 Jan, 2006 DR: OMAPS00059261
 				  //Store sms message type
 				  sms_mt.sms_msg_type = MFW_SMS_STATRPT;
@@ -3420,8 +3420,8 @@
    				  /*whenever some operation is done the pref memory should be set back to SIM*/
 				  if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
 				  {
-					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
-				  }				  
+					TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
+				  }
  				  sms_signal(E_SMS_MT, &sms_mt);
 				}
 				break;
@@ -3430,10 +3430,10 @@
 				sms_signal(E_SMS_ERR, NULL);
 			}
 		}
-		
+
 		else
 		{	TRACE_EVENT("rAT_plusCMGR: SMS pointer error");
-		
+
 		}
   }
   break;
@@ -3448,7 +3448,7 @@
 			  sms_cb.pages  = cbm->pages;
 			  sms_cb.msg_len = cbm->data.len;
 			  memcpy((char *)sms_cb.cb_msg, (char *)cbm->data.data, cbm->data.len);
-			  
+
 			  /* send cell broadcast message event */
 			  sms_type = MFW_NO_MESSAGE;
 			  sms_signal(E_SMS_CB, &sms_cb);
@@ -3456,7 +3456,7 @@
 		  else
 			  TRACE_EVENT("rAT_plusCMGR: SMS CB pointer error");
 		  break;
-		  
+
       case MFW_NO_MESSAGE:
 		  TRACE_EVENT("read=free no msg");
 		  coll_sms_read = MFW_SMS_FREE;
@@ -3464,10 +3464,10 @@
 			  coll_sms_read = MFW_SMS_FREE;
 		  break;
   }
-  
+
   sms_check_mt_update();
-  
-  {	
+
+  {
 	  TRACE_EVENT_P4("CMGR Msg table: %d,%d,%d, %d", msg_info[0].index, msg_info[1].index,msg_info[2].index,msg_info[3].index);
 	  TRACE_EVENT_P4("CMGR Msg table: %d,%d,%d, %d", msg_info[4].index, msg_info[5].index,msg_info[6].index,msg_info[7].index);
   }
@@ -3536,7 +3536,7 @@
   SHORT            rp;
   /*a0393213 OMAPS00109953*/
   T_MFW_SMS_MEM pref_mem=MFW_MEM_NOTPRESENT;
-//Mar 22 2007 ER:OMAPS00113882 x0061088 (Prachi) 
+//Mar 22 2007 ER:OMAPS00113882 x0061088 (Prachi)
    T_ACI_TOA set_toa;
    int addr_type;
    T_ACI_RETURN ACI_MFW_return;
@@ -3549,7 +3549,7 @@
   		if(ffs_memory.used==ffs_memory.total)
   			{
   			    sms_signal(E_SMS_MEM_FULL, 0);
-			    return MFW_SMS_FAIL;  			
+			    return MFW_SMS_FAIL;
   			}
 		else
 			{
@@ -3604,15 +3604,15 @@
   {
   	    set_toa.ton = TON_Alphanumeric;
         set_toa.npi = NPI_NotPresent;
-        ACI_MFW_return = sAT_PlusCMGW(CMD_SRC_LCL, 0, addr, &set_toa, 
-                       sentStatus, 0xFF,   
+        ACI_MFW_return = sAT_PlusCMGW(CMD_SRC_LCL, 0, addr, &set_toa,
+                       sentStatus, 0xFF,
                        &conc_data_ext, sca,
                        NULL, rp);
 
   }
-  else 
-     ACI_MFW_return = sAT_PlusCMGW(CMD_SRC_LCL, 0, addr, NULL, 
-                       sentStatus, 0xFF,   
+  else
+     ACI_MFW_return = sAT_PlusCMGW(CMD_SRC_LCL, 0, addr, NULL,
+                       sentStatus, 0xFF,
                        &conc_data_ext, sca,
                        NULL, rp);
 
@@ -3626,7 +3626,7 @@
   sms_type = MFW_WR_NEW_MESSAGE;
   return MFW_SMS_OK;
 
- 
+
 }
 
 
@@ -3663,7 +3663,7 @@
   		if(ffs_memory.used==ffs_memory.total)
   			{
   			    sms_signal(E_SMS_MEM_FULL, 0);
-			    return MFW_SMS_FAIL;  			
+			    return MFW_SMS_FAIL;
   			}
 		else
 			{
@@ -3795,7 +3795,7 @@
   /*whenever some operation is done the pref memory should be set back to SIM*/
   if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
   {
-	TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
+	TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
   }
   memset(&phb_entry, 0, sizeof(phb_entry));
 	memset(&phb_list, 0, sizeof(phb_list));
@@ -3863,7 +3863,7 @@
 	can be saved successfully*/
       if (numSeg == 1)
       	msg_info[i].concat_status = MFW_SMS_NO_CONC;
-#ifdef TI_PS_FF_CONC_SMS	  
+#ifdef TI_PS_FF_CONC_SMS
       else
       	msg_info[i].concat_status = MFW_SMS_CONC_WHOLE;
 #endif /*TI_PS_FF_CONC_SMS*/
@@ -3883,9 +3883,9 @@
   TRACE_EVENT_P2("memory used is = %d, of %d", memory.used, memory.total);
  if(memory.total == memory.used)
   {
-  	
+
   	sms_signal(E_SMS_MEM_FULL, NULL);
-  }  
+  }
   sms_type = MFW_NO_MESSAGE;
 
   sms_check_mt_update();
@@ -3905,7 +3905,7 @@
 
 */
 /*a0393213 OMAPS00109953 - memory added as parameter*/
-T_MFW sms_msg_delete(UBYTE index, T_MFW_SMS_MEM sms_memory) 
+T_MFW sms_msg_delete(UBYTE index, T_MFW_SMS_MEM sms_memory)
 {
   TRACE_FUNCTION ("sms_msg_delete()");
 
@@ -3947,7 +3947,7 @@
 
 
 
-//  Dec 23, 2004 REF: CRR MMI-SPR-27741 xkundadu 
+//  Dec 23, 2004 REF: CRR MMI-SPR-27741 xkundadu
 //  Issue description:  BMI: crashing when using the function : sms_index_list() located in mfw
 //  Solution: Changed the msg_list variable to array of T_MFW_SMS_IDX.
 
@@ -3962,7 +3962,7 @@
 //	May 27, 2005    MMI-FIX-29869 x0018858 - Modified from static to dynamic variable
 #ifdef FF_MMI_SMS_DYNAMIC
 	msg_list = (T_MFW_SMS_IDX*)ALLOC_MEMORY(g_max_messages*sizeof(T_MFW_SMS_IDX));
-#endif   
+#endif
 
     TRACE_FUNCTION ("sms_ok_change()");
 
@@ -3981,8 +3981,8 @@
 
         sms_check_mt_update();
 
-        
-//  Dec 23, 2004 REF: CRR MMI-SPR-27741 xkundadu 
+
+//  Dec 23, 2004 REF: CRR MMI-SPR-27741 xkundadu
 //  Issue description:  BMI: crashing when using the function : sms_index_list() located in mfw
 //  Solution: Changed the msg_list variable to array of T_MFW_SMS_IDX.
 #ifdef FF_MMI_SMS_DYNAMIC
@@ -4001,12 +4001,12 @@
 			if(msg_list[i].stat == MFW_SMS_READ)
 			{
     				/*a0393213 OMAPS00109953 - memory type passed as parameter*/
-				sms_msg_delete(msg_list[i].index,msg_list[i].memory);				
+				sms_msg_delete(msg_list[i].index,msg_list[i].memory);
 				break;
 			}
 		}
         }
-	
+
     /* Marcus: Issue 2260: 03/10/2002: Start */
     }
     else
@@ -4033,17 +4033,17 @@
 
 void sms_ok_delete()
 {
- 
+
   	TRACE_FUNCTION ("sms_ok_delete()");
 	/*SPR2530, moved flag claering code here from delete_sms_from_table*/
-	
+
   	 if(coll_sms_delete EQ MFW_SMS_WAIT)
     coll_sms_delete = MFW_SMS_FREE;
 	/*whenever some operation is done the pref memory should be set back to SIM*/
       if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
       	{
-		TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
-	}	 
+		TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
+	}
   	/*SPR 1833, replaces section of code with function call*/
 	/*a0393213 OMAPS00109953 - memory type passed as parameter*/
   	if (delete_sms_from_table (deleting_index, deleting_memory))
@@ -4064,7 +4064,7 @@
 
 	  	sms_check_mt_update();
   	}
-  	{	
+  	{
 		TRACE_EVENT_P4("CMGD Msg table: %d,%d,%d, %d", msg_info[0].index, msg_info[1].index,msg_info[2].index,msg_info[3].index);
 		TRACE_EVENT_P4("CMGD Msg table: %d,%d,%d, %d", msg_info[4].index, msg_info[5].index,msg_info[6].index,msg_info[7].index);
 	}
@@ -4084,7 +4084,7 @@
 BOOL delete_sms_from_table (SHORT index, T_MFW_SMS_MEM memory)
 {
   int i;
- 
+
   TRACE_FUNCTION ("delete_sms_from_table()");
 
  /*SPR2530, removed flag clearing code*/
@@ -4095,7 +4095,7 @@
 #endif
   {
     /*a0393213 OMAPS00109953 - memory is also taken into consideration*/
-    if (msg_info[i].index == index&& msg_info[i].mem == memory) 
+    if (msg_info[i].index == index&& msg_info[i].mem == memory)
     {
       msg_info[i].index = -1;
 	/*a0393213 OMAPS00109953*/
@@ -4114,7 +4114,7 @@
       return TRUE;
     }
   }
-  
+
 return FALSE;
 }
 /*
@@ -4294,9 +4294,9 @@
 	Hence, set the validity period format to relative for all the cases*/
 	 if ((sms_info->vp_mode EQ SMS_VPF_NUMERICAL) ||(sms_info->vp_mode EQ SMS_VPF_STRING) ||(sms_info->vp_mode EQ SMS_VPF_NOTPRESENT))
       	{
-      		
+
       		 TRACE_EVENT_P1("sms_info->vp_mode  %d",sms_info->vp_mode);
-		TRACE_EVENT("MMI  supports only the relative validity period format ");	
+		TRACE_EVENT("MMI  supports only the relative validity period format ");
 
 		/*Set the TP-Validity-Period-Format (TP-VPF)  bits  to relative format	*/
 		sms_info->first_oct  = sms_info->first_oct  | 0x10 ;
@@ -4304,8 +4304,8 @@
       	}
 
    	 TRACE_EVENT_P1("first_oct is %d",sms_info->first_oct);
-	 
-   //Send text mode parameters to ACI 
+
+   //Send text mode parameters to ACI
    if (sAT_PlusCSMP(CMD_SRC_LCL, sms_info->first_oct, sms_info->vp_rel,
                        NULL, NULL, ACI_NumParmNotPresent,
                        ACI_NumParmNotPresent) NEQ AT_CMPL)
@@ -4314,35 +4314,35 @@
    return MFW_SMS_OK;
 }
 
-//Feb 22, 2006 DR:OMAPS00068268 x0035544 
+//Feb 22, 2006 DR:OMAPS00068268 x0035544
 BOOL Sms_Check_PID(SHORT pid)
 {
 TRACE_FUNCTION("Sms_Check_PID()");
 
-if(pid & BIT_7)    
+if(pid & BIT_7)
 {
-	if(!(pid & BIT_6)) // Bit 7 = 1 and Bit 6 = 0 
+	if(!(pid & BIT_6)) // Bit 7 = 1 and Bit 6 = 0
   		return TRUE;
-} 
-else  
+}
+else
  {
 	 if(pid & BIT_6) // Bit 7 = 0 and Bit 6 = 1, Bits 5...0 some values are reserved
 	 {
-	     if(((pid >= 0x48) AND (pid <= 0x5E)) OR 
+	     if(((pid >= 0x48) AND (pid <= 0x5E)) OR
 		 ((pid >= 0x60) AND (pid <= 0x7B)))
 			 return TRUE;
 	 }
-	 else  
+	 else
 	 {
 	  if(pid & BIT_5) // Bit 7 = 0, Bit 6 = 0 and Bit 5 = 1, Bits 4...0 some values are reserved
 	   {
-	 	  if((pid EQ 0x2E) OR (pid EQ 0x2F) OR 
+	 	  if((pid EQ 0x2E) OR (pid EQ 0x2F) OR
 		    ((pid >= 0x33) AND (pid <= 0x37)))
 			  return TRUE;
 	   }
     	 }
 }
-			
+
 return FALSE;
 }
 
@@ -4402,10 +4402,10 @@
         sprintf(sms_info->sc_addr, "+%s", sca);
       else
       strcpy((char *)sms_info->sc_addr, (char *)sca);
-	//x0035544 Feb 22, 2006 DR:OMAPS00068268	
+	//x0035544 Feb 22, 2006 DR:OMAPS00068268
 	PIDReserved = Sms_Check_PID(pid);
 	/* If pid value falls in to any of Reserved category then set it to 0 */
-	if(PIDReserved) 
+	if(PIDReserved)
 		pid = 0;
       sms_info->prot_id = pid;
       sms_info->dcs = dcs;
@@ -4503,9 +4503,9 @@
   T_ACI_RETURN     res;
 
   TRACE_FUNCTION ("sms_set_cell_broadcast_info()");
-	/*SPR 2470, if the Channel ID list is empty, the mode logic is inverted due to the warped logic of 
+	/*SPR 2470, if the Channel ID list is empty, the mode logic is inverted due to the warped logic of
 	AT commands*/
-	
+
 	/*if we are disabling cell broadcast*/
 	if (mode == 1)
 	{	/* and the channel ID list is empty*/
@@ -4690,7 +4690,7 @@
       coll_sms_send = MFW_SMS_FREE;
 
 #if defined (FF_WAP) && defined (FF_GPF_TCPIP)
-        
+
         /* SPR#2086 - SH - Check if it's a WAP SMS */
  	  if (sms_wap_sent_flag)
   	  {
@@ -4806,7 +4806,7 @@
 	default:
 		TRACE_ERROR("rAT_PlusCPMS():Unknown memory");
     	}
-		
+
     memory.mem=sms_mem.mem=mem1->mem;
     memory.total=sms_mem.total=sim_memory.total+ffs_memory.total;
     memory.used=sms_mem.used=sim_memory.used+ffs_memory.used;
@@ -4826,7 +4826,7 @@
         	sms_signal(E_SMS_READY, 0);
         int_req = 0;
         int_init_req = 0;
-	/*a0393213 OMAPS00109953*/		
+	/*a0393213 OMAPS00109953*/
 	if(memory.used==memory.total)
             sms_signal(E_SMS_MEM_FULL, 0);
 
@@ -5171,7 +5171,7 @@
 //	 March 31, 2005    REF: CRR MMI-SPR-24511   x0012852
 //     first_index, concat_status are also added to use it  later on.
     msg_list->concat_status =  msg_info[num].concat_status;
-    msg_list->first_index =  msg_info[num].first_index; 
+    msg_list->first_index =  msg_info[num].first_index;
     /*a0393213 OMAPS00109953*/
     msg_list->first_mem=msg_info[num].first_mem;
 #ifdef NO_ASCIIZ
@@ -5263,7 +5263,7 @@
         case SMS_STAT_StoUnsent:        return MFW_SMS_STOR_UNSENT;
         case SMS_STAT_StoSent:          return MFW_SMS_STOR_SENT;
         case SMS_STAT_All:              return MFW_SMS_ALL;
-        default:               
+        default:
       	    return MFW_SMS_UNKNOWN;
     }
 }
@@ -5404,30 +5404,30 @@
       OR dcs == 0xE0
       OR dcs == 0xE8)
   	{
-    	
+
     	status = MFW_SMS_VOICE;
   	}
 
   else if (udh->len > 0 AND udh->data[0] == 0x01
-           AND (udh->data[2] == 0x80 OR udh->data[2] == 0x00)) /* check user data header */ 
-  { 
-           status = MFW_SMS_VOICE; 
+           AND (udh->data[2] == 0x80 OR udh->data[2] == 0x00)) /* check user data header */
+  {
+           status = MFW_SMS_VOICE;
 	  //x0pleela 24 Mar, 2006  ER OMAPS00070657
-	  /*If message count is zero, so delete icon */ 
-#ifdef FF_CPHS	  
-	    if( udh->data[3] == 0x00 )   
-	    { 
-	      TRACE_EVENT("message count is zero" ); 
-	      udh_flag = TRUE; 
+	  /*If message count is zero, so delete icon */
+#ifdef FF_CPHS
+	    if( udh->data[3] == 0x00 )
+	    {
+	      TRACE_EVENT("message count is zero" );
+	      udh_flag = TRUE;
            }
 #endif
    }
 
-// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
 // Voice mail identification is already done using dcs. Identification should not be done using pid. Check commented
 //  else if (pid == 0x5F OR pid ==0x42 /*On power-up check pid to determine SMS VM */)                              /* check message identifier */
 /*  	{	status = MFW_SMS_VOICE;
-    	
+
   	} */
   else if (toa->ton == TON_Alphanumeric
   		 // 0x30 special case for one-2-one when voice mail has been deleted.
@@ -5443,15 +5443,15 @@
   			Display_1_2_1_vm_icon = TRUE;
 
   		status = MFW_SMS_VOICE;
-    	
+
   	}
 	TRACE_EVENT_P2("Addr[0]:%x, Addr[1]:%x", addr[0], addr[1]);
 	TRACE_EVENT_P2("Addr[2]:%x, Addr[3]:%x", addr[2], addr[3]);
   /*MC1364, improved this to check if voicemail indicator to be set or cleared*/
 
-// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
 // Instead of identifying voice mail ON (indication)/OFF(deletion) using addr[0], we use dcs.
-// (addr[0]&0x01) condition replaced with (dcs & 0x08) 
+// (addr[0]&0x01) condition replaced with (dcs & 0x08)
 
 	//x0pleela 24 Mar, 2006  ER OMAPS00070657
 #ifdef FF_CPHS
@@ -5459,13 +5459,13 @@
 #else
 	 if ((status == MFW_SMS_VOICE) && (dcs & 0x08))
 #endif
-  	{	
+  	{
   		Delete_1_2_1_vm_icon = FALSE;/*SPR2260*/
 	  	Display_1_2_1_vm_icon = TRUE;
 
 //x0pleela 09 June, 2006 DR: OMAPS00079692
-//following code is commented as MMI need not set the VMWI flag 
-#if 0 
+//following code is commented as MMI need not set the VMWI flag
+#if 0
 
   		/*MC, if MSB set, bit 0 of second char in 7-bit encoding)*/
  		if (addr[1] & 0x08) /*SPR 2260 experimentally, bit set by orange*/
@@ -5478,15 +5478,15 @@
 #ifdef FF_CPHS
 	if ( ((status == MFW_SMS_VOICE) && !(dcs & 0x08)) OR(udh_flag)) //if a voicemail deletion
 #else
-	if ((status == MFW_SMS_VOICE) && !(dcs & 0x08)) 
+	if ((status == MFW_SMS_VOICE) && !(dcs & 0x08))
 #endif
-  	{	
+  	{
 		Delete_1_2_1_vm_icon = TRUE;/*SPR2260*/
 	  	Display_1_2_1_vm_icon = FALSE;
 
 //x0pleela 09 June, 2006 DR: OMAPS00079692
-//following code is commented as MMI need not set the VMWI flag 
-#if 0 		
+//following code is commented as MMI need not set the VMWI flag
+#if 0
   		/*MC, if MSB set, bit 0 of second char in 7-bit encoding)*/
  	 	if (addr[1] & 0x08) /*SPR 2260 experimentally, bit set by orange*/
   			cphs_set_mailbox_status(0,MFW_CFLAG_NOTSet , 0, 0);/*clear line2*/
@@ -5494,14 +5494,14 @@
   			cphs_set_mailbox_status(MFW_CFLAG_NOTSet, 0, 0, 0);/*clear line1*/
 #endif
   	}
-// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar 
+// Feb 16, 2005 REF: CRR MMI-SPR-27900 xnkulkar
 // If voicemail message is from group "1100", update status as MFW_SMS_VOICEMSG_DELETE
-	if ((status == MFW_SMS_VOICE) && ((dcs & 0xF0) == 0xC0)) 
+	if ((status == MFW_SMS_VOICE) && ((dcs & 0xF0) == 0xC0))
 	{
 		status = MFW_SMS_VOICEMSG_DELETE;
 		invalidVm = TRUE; // set this flag to TRUE to indicate that this voice mail sms is to be deleted
 	}
-  	
+
     return status;
 }
 
@@ -5754,7 +5754,7 @@
     msg_list->msg_type = msg_info[num].msg_type;
 	/*a0393213 OMAPS00109953*/
 	msg_list->memory=msg_info[num].mem;
-	
+
 }
 /*a0393213 OMAPS00109953 - memory type added as a parameter*/
 void sms_copy_idx(UBYTE index, T_MFW_SMS_IDX *msg_list, T_MFW_SMS_MEM sms_memory)
@@ -5768,11 +5768,11 @@
 #endif
 	{
           /*a0393213 OMAPS00109953 - memory is also taken into consideration*/
-	    if (index==msg_info[i].index && sms_memory==msg_info[i].mem) 
+	    if (index==msg_info[i].index && sms_memory==msg_info[i].mem)
     	/*
      	* forward message reference to MMI
      	*/
-    	{	
+    	{
 		msg_list->concat_status = msg_info[i].concat_status;/*SPR 2260*/
 	       msg_list->stat = msg_info[i].stat;
     		msg_list->msg_type = msg_info[i].msg_type;
@@ -5795,13 +5795,13 @@
 void sms_ok_CMGL (void)
 {
         TRACE_FUNCTION("sms_ok_CMGL: rAT_PlusCMGL cmpl");
-	  /*a0393213 OMAPS00109953*/		
+	  /*a0393213 OMAPS00109953*/
 	   if(index_retrieve_state==MFW_SMS_SIM_INDEX_RETRIEVING)
 	   	{
 	   	/*all the indexes of SMes residing in SIM has been got - now get indexes from ME*/
 		    if(sms_set_pref_memory(MFW_MEM_ME)!=MFW_SMS_OK)
     			{
-		    	TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
+		    	TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
 		    	}
 			else
 			{
@@ -5813,10 +5813,10 @@
 			                      0, SMS_READ_Preview) NEQ AT_EXCT)/*a0393213 warnings removal-READ_PREVIEW changed to SMS_READ_Preview*/
 				  #endif
 			    {
-			        TRACE_EVENT("sAT_PlusCMGL error");		        
-			    }			  
+			        TRACE_EVENT("sAT_PlusCMGL error");
+			    }
 			    else
-			    	{		    	
+			    	{
 			    	index_retrieve_state=MFW_SMS_FFS_INDEX_RETRIEVING;
 				return;
 			    	}
@@ -5829,7 +5829,7 @@
 			/*setting the pref memory back to SIM*/
 		      if(sms_set_pref_memory(MFW_MEM_SIM)!=MFW_SMS_OK)
     			{
-		    	TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");			
+		    	TRACE_ERROR("sms_ok_CMGL():Not able to set pref memory");
 		    	}
 	   	}
 	   else
@@ -5841,7 +5841,7 @@
           int_req = FIRST_READ_OF_MEMORY_USE;/*SPR2260*/
 
           qAT_PlusCPMS(CMD_SRC_LCL);
-	    
+
 }
 
 
@@ -5854,7 +5854,7 @@
 | STATE   : code                         ROUTINE : sms_homezoneCBToggle    |
 +---------------------------------------------------------------------------+
 
-  PURPOSE : 
+  PURPOSE :
 
 */
 #ifndef NEPTUNE_BOARD
@@ -5876,7 +5876,7 @@
 	if (ret EQ AT_FAIL)
 	{
 	//Aug 16, 2005 REF: MMI-FIX-30439 x0018858
-	//Incase the querying fails, we still wil have to activate/ de-activate with default 
+	//Incase the querying fails, we still wil have to activate/ de-activate with default
 	//values for dcs and timeout
 		if(1 == Activate_CB )
 		{
@@ -5888,7 +5888,7 @@
 		{
 			TRACE_FUNCTION("DE-ACTIVATING HOMEZONE");
 			/*a0393213 warnings removal-CS_GsmDef used instead of 0*/
-			ret = sAT_PercentCBHZ(CMD_SRC_LCL , CBHZ_MOD_NotActive,CS_GsmDef,def_timeout);	
+			ret = sAT_PercentCBHZ(CMD_SRC_LCL , CBHZ_MOD_NotActive,CS_GsmDef,def_timeout);
 		}
 		return;
 	}
@@ -5902,7 +5902,7 @@
 	else
 	{
 		TRACE_FUNCTION("DE-ACTIVATING HOMEZONE");
-		ret = sAT_PercentCBHZ(CMD_SRC_LCL , CBHZ_MOD_NotActive,dcs,timeout);	
+		ret = sAT_PercentCBHZ(CMD_SRC_LCL , CBHZ_MOD_NotActive,dcs,timeout);
 	}
 	return;
 
@@ -5917,7 +5917,7 @@
  $Function:     is_alphanumeric_addr
 
  $Description:  check whether the address entered by user is alphanumeric or numeric.
- 				
+
  $Returns:    None
 
  $Arguments:  win
@@ -5934,10 +5934,10 @@
   	   	{
 	   	   dest_addr++;
            index++; /* address is numeric */
-  	   	}   
+  	   	}
        else
           return TRUE;  /*alphanumeric address*/
-        
+
   	}
   return FALSE;
 }