/*=============================================================================

FILE: bridle_phone.c
    
GENERAL DESCRIPTION:
      
PUBLIC CLASSES AND STATIC FUNCTIONS:

INITIALIZATION AND SEQUENCING REQUIREMENTS:
   No additional module-level initialization or sequencing requirements.
            
        Copyright © 1999-2003 QUALCOMM Incorporated.
              All Rights Reserved.
              QUALCOMM Proprietary/GTDR
=============================================================================*/
#include "OEMFeatures.h"
#include "BRIDLEInit.h"
#ifndef PHONE_SVC
#define PHONE_SVC
#endif
#include "msm/OEMPhone.h"
#include "AEEBRIDLE.h"

#if __ARMCC_VERSION >= 120000
#pragma arm section zidata = "bridle_svc_rw_usr_ro"
#endif
uint32 bridle_oemphone_swi;
#if __ARMCC_VERSION >= 120000
#pragma arm section zidata
#endif

/* List of handlers that patch calls to actual routines. The order 
** corresponds to the subroutine ids enumerated in enum _tagBridlePhoneId */
static const PFNSWIHANDLER gPtrTable[BRIDLE_PHONE_ID_MAX] = { 
   (PFNSWIHANDLER)unpackbridle_OEMPhone_New, 
   (PFNSWIHANDLER)unpackbridle_OEMPhone_AddRef,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_Release,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_SetMask,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_AddListener,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetPhoneInfo,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetCallInfo,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetSystemInfo,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetPhoneInfo2,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetCallInfo2,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetSystemInfo2,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetMinWStr,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_GetMinStr,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_SetRSSIThreshold,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_MakeCall,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_AnswerCall,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_AnswerVoice,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_EndCall,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_Flash,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_SetPrefMode,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_SetNAM,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_SetOprtMode,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_BurstDTMF,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_StartDTMF,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_StopDTMF,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_IsVoiceCall,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_IsDataSupported,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_IsOffline,
   (PFNSWIHANDLER)unpackbridle_OEMPhone_InConversation,
};

/*===========================================================================

FUNCTION   
   bridle_phone_swihandler

DESCRIPTION
   Invokes the appropriate unpack routine and passes its arguments.
  
DEPENDENCIES
   This is invoked by SWI handler.

RETURN VALUE

SIDE EFFECTS

===========================================================================*/
uint32 bridle_phone_swihandler( uint32 arg1, uint32 arg2, uint32 arg3, uint32 arg4, uint32 arg5 )
{
   return bridle_generic_swihandler( arg1, arg2, arg3, arg4, arg5, 
                                     BRIDLE_PHONE_ID_MAX, gPtrTable );
}

/*===========================================================================

FUNCTION   
   RegisterPhoneForSWI

DESCRIPTION
   Registers with SWI handler and obtains ID for Phone Module.
  
DEPENDENCIES

RETURN VALUE

SIDE EFFECTS

===========================================================================*/
int RegisterPhoneForSWI(void *po)
{
   return bridle_RegisterSubSystem( bridle_phone_swihandler, &bridle_oemphone_swi );
}

