/*===========================================================================
                    IMPORTANT NOTICE

            Not to be distributed in source format.

FILE:  bridle_GSM1xCardHandler.h

SERVICES:  Bridle'd GSM1xCardHandler calls. 

GENERAL DESCRIPTION:
   Contains inlined code that does swi into Supervisor mode and invokes
   appropriate routine.

        Copyright © 2003 QUALCOMM Incorporated.
               All Rights Reserved.
            QUALCOMM Proprietary/GTDR
===========================================================================*/

#ifndef __BRIDLE_GSM1XCARDHANDLER_H__
#define __BRIDLE_GSM1XCARDHANDLER_H__

#include "OEMGSM1xCardHandler_SVC.h"
#include "AEEBridle.h"

/* Subroutine Id to map different functions invoked in Supervisor mode. */
enum {
    BRIDLE_GSM1XCARDHANDLER_INIT,        
    BRIDLE_GSM1XCARDHANDLER_ISSMSINIT,        
    BRIDLE_GSM1XCARDHANDLER_ISSMSENABLED,        
    BRIDLE_GSM1XCARDHANDLER_GETSMSSTATUS,        
    BRIDLE_GSM1XCARDHANDLER_GETNUMSMSSLOTS,        
    BRIDLE_GSM1XCARDHANDLER_GETSMS,
    BRIDLE_GSM1XCARDHANDLER_SETSMS,
    BRIDLE_GSM1XCARDHANDLER_CLEARSMS,
    BRIDLE_GSM1XCARDHANDLER_CLEARALLSMS,      
    BRIDLE_GSM1XCARDHANDLER_READSMSCADDRESS,
    BRIDLE_GSM1XCARDHANDLER_SETSMSCADDRESS,
    BRIDLE_GSM1XCARDHANDLER_READSMSS,
    BRIDLE_GSM1XCARDHANDLER_SETSMSS,
    BRIDLE_GSM1XCARDHANDLER_READFORBIDDENPLMN,
    BRIDLE_GSM1XCARDHANDLER_WRITEFORBIDDENPLMN,
    BRIDLE_GSM1XCARDHANDLER_READPLMNSELECTOR,
    BRIDLE_GSM1XCARDHANDLER_WRITEPLMNSELECTOR,
    BRIDLE_GSM1XCARDHANDLER_READACCESSCLASS,
    BRIDLE_GSM1XCARDHANDLER_READICCID,
    BRIDLE_GSM1XCARDHANDLER_READIMSI,
    BRIDLE_GSM1XCARDHANDLER_READMSISDN,
    BRIDLE_GSM1XCARDHANDLER_READAD,
    BRIDLE_GSM1XCARDHANDLER_GETDIRPRESENCE,
    BRIDLE_GSM1XCARDHANDLER_GETADN,
    BRIDLE_GSM1XCARDHANDLER_SETADN,
    BRIDLE_GSM1XCARDHANDLER_GETNUMADNREC,        
    BRIDLE_GSM1XCARDHANDLER_GETADNALPHASIZE,        

    BRIDLE_GSM1XCARDHANDLER_MAX
};

//extern int    RegisterGSM1xCardHandlerForSWI(void *po);
extern uint32 bridle_oemGSM1xCardHandler_swi;

/* inlined functions packbridle_* and unpackbridle_* */

BRIDLE0_RET(
    boolean, // return value type
    OEMGSM1xCardHandler_SVC_Init,
    bridle_oemGSM1xCardHandler_swi, 
    BRIDLE_GSM1XCARDHANDLER_INIT
    )

BRIDLE0_RET(
    boolean, // return value type
    OEMGSM1xCardHandler_SVC_IsSMSInit,
    bridle_oemGSM1xCardHandler_swi, 
    BRIDLE_GSM1XCARDHANDLER_ISSMSINIT
    )

BRIDLE0_RET(
    boolean, // return value type
    OEMGSM1xCardHandler_SVC_IsSMSEnabled,
    bridle_oemGSM1xCardHandler_swi, 
    BRIDLE_GSM1XCARDHANDLER_ISSMSENABLED
    )

BRIDLE2_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_GetSMSStatus,
    uint8, BRIDLE_CHECK_NONE, 0,
    uint8*, BRIDLE_CHECK_WRITEACCESS, sizeof(uint8),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_GETSMSSTATUS
    )

BRIDLE0_RET(
    uint8, // return value type
    OEMGSM1xCardHandler_SVC_GetNumSMSSlots,
    bridle_oemGSM1xCardHandler_swi, 
    BRIDLE_GSM1XCARDHANDLER_GETNUMSMSSLOTS
    )

BRIDLE2_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_GetSms,
    uint16, BRIDLE_CHECK_NONE, 0,
    CardHandlerRawSMSType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerRawSMSType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_GETSMS
    )

BRIDLE2_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_SetSms,
    uint16, BRIDLE_CHECK_NONE, 0,
    CardHandlerRawSMSType*, BRIDLE_CHECK_READACCESS, sizeof(CardHandlerRawSMSType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_SETSMS
    )
  
BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ClearSms,
    uint16, BRIDLE_CHECK_NONE, 0,
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_CLEARSMS
    )    
 
BRIDLE0_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ClearAllSms,
    bridle_oemGSM1xCardHandler_swi, 
    BRIDLE_GSM1XCARDHANDLER_CLEARALLSMS
    )
 
BRIDLE2_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadSMSCAddress,
    uint16, BRIDLE_CHECK_NONE, 0,
    CardHandlerAddressType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerAddressType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READSMSCADDRESS
    )

BRIDLE2_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_SetSMSCAddress,
    uint16, BRIDLE_CHECK_NONE, 0,
    const CardHandlerAddressType*, BRIDLE_CHECK_READACCESS, sizeof(CardHandlerAddressType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_SETSMSCADDRESS
    )

BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadSMSS,
    CardHandlerSMSSinfoType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerSMSSinfoType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READSMSS
    )    

BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_SetSMSS,
    CardHandlerSMSSinfoType*, BRIDLE_CHECK_READACCESS, sizeof(CardHandlerSMSSinfoType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_SETSMSS
    )  

BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadForbiddenPLMN,
    CardHandlerFPLMNListType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerFPLMNListType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READFORBIDDENPLMN
    )    

BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_WriteForbiddenPLMN,
    CardHandlerFPLMNListType*, BRIDLE_CHECK_READACCESS, sizeof(CardHandlerFPLMNListType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_WRITEFORBIDDENPLMN
    )   
 
BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadPLMNSelector,
    CardHandlerPLMNSelectorListType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerPLMNSelectorListType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READPLMNSELECTOR
    )   
 
 BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_WritePLMNSelector,
    CardHandlerPLMNSelectorListType*, BRIDLE_CHECK_READACCESS, sizeof(CardHandlerPLMNSelectorListType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_WRITEPLMNSELECTOR
    )   

BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadAccessClass,
    CardHandlerAaccessClassBufType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerAaccessClassBufType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READACCESSCLASS
    )  
    
BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadICCId,
    CardHandlerICCIdBufType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerICCIdBufType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READICCID
    )      
 
BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadIMSI,
    CardHandlerImsiBufType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerImsiBufType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READIMSI
    )      

BRIDLE3_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadMSISDN,
    CardHandlerMSISDNBufType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerMSISDNBufType),
    int, BRIDLE_CHECK_NONE, 0,
    uint8*, BRIDLE_CHECK_WRITEACCESS, sizeof(uint8),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READMSISDN
    )

BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_ReadAD,
    CardHandlerADBufType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerADBufType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_READAD
    )     
 
BRIDLE1_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_GetDirPresence,
    CardHandlerDirPresenceBitMaskType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerDirPresenceBitMaskType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_GETDIRPRESENCE
    ) 

BRIDLE3_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_GetAdn,
    uint16, BRIDLE_CHECK_NONE, 0,
    CardHandlerRawADNType*, BRIDLE_CHECK_WRITEACCESS, sizeof(CardHandlerRawADNType),
    uint8*, BRIDLE_CHECK_WRITEACCESS, sizeof(uint8),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_GETADN
    )
 
BRIDLE2_RET(
    uint32, // return value type
    OEMGSM1xCardHandler_SVC_SetAdn,
    uint16, BRIDLE_CHECK_NONE, 0,
    CardHandlerRawADNType*, BRIDLE_CHECK_READACCESS, sizeof(CardHandlerRawADNType),
    bridle_oemGSM1xCardHandler_swi,
    BRIDLE_GSM1XCARDHANDLER_SETADN
    )
 
BRIDLE0_RET(
    uint8, // return value type
    OEMGSM1xCardHandler_SVC_GetNumAdnRec,
    bridle_oemGSM1xCardHandler_swi, 
    BRIDLE_GSM1XCARDHANDLER_GETNUMADNREC
    ) 

BRIDLE0_RET(
    uint8, // return value type
    OEMGSM1xCardHandler_SVC_GetAdnAlphaSize,
    bridle_oemGSM1xCardHandler_swi, 
    BRIDLE_GSM1XCARDHANDLER_GETADNALPHASIZE
    ) 

#endif // __BRIDLE_GSM1XCARDHANDLER_H__
