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

            Not to be distributed in source format.

FILE:  bridle_GSM1xControl.h

SERVICES:  Bridle'd GSM1xControl 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_GSM1XCONTROL_H__
#define __BRIDLE_GSM1XCONTROL_H__

#include "OEMGSM1xControl_SVC.h"
#include "AEEBridle.h"

/* Subroutine Id to map different functions invoked in Supervisor mode. */
enum {
   BRIDLE_GSM1XCONTROL_INIT,
   BRIDLE_GSM1XCONTROL_ACTIVATENONGSM1XMODE,
   BRIDLE_GSM1XCONTROL_GETSUPPORTEDPROVISIONINGMODE,
   BRIDLE_GSM1XCONTROL_GETUIMUNIQUEID,
   BRIDLE_GSM1XCONTROL_GETDFPRESENCE,
   BRIDLE_GSM1XCONTROL_PROVISIONGSM1XPARAMETERS,
   BRIDLE_GSM1XCONTROL_ENABLEGSM1XMODE,
   BRIDLE_GSM1XCONTROL_GETPLMN,
   BRIDLE_GSM1XCONTROL_SETPLMN,
   BRIDLE_GSM1XCONTROL_GETGSM1XPRL,
   BRIDLE_GSM1XCONTROL_SETGSM1XPRL,
   BRIDLE_GSM1XCONTROL_VALIDATEPRL,
   BRIDLE_GSM1XCONTROL_SETGSM1XSIDNIDPAIRS,
   BRIDLE_GSM1XCONTROL_GETGSM1XSIDNIDPAIRS,
   BRIDLE_GSM1XCONTROL_GETAVAILABLEMODES,
   BRIDLE_GSM1XCONTROL_GETCURRENTMODE,
   BRIDLE_GSM1XCONTROL_PROCESSPOWERUP,
   BRIDLE_GSM1XCONTROL_GETSTATUS,
   BRIDLE_GSM1XCONTROL_MAX
};


//extern int    RegisterGSM1xControlForSWI(void *po);
extern uint32 bridle_oemGSM1xControl_swi;

/* inlined functions packbridle_* and unpackbridle_* */

BRIDLE0_VOID(
    OEMGSM1xControl_SVC_Init,
    bridle_oemGSM1xControl_swi, 
    BRIDLE_GSM1XCONTROL_INIT
    )

BRIDLE1_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_ActivateNonGSM1xMode,
    AEEGSM1xControl_modeBitMaskType, BRIDLE_CHECK_NONE, 0,
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_ACTIVATENONGSM1XMODE
    )

BRIDLE1_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetSupportedProvisioningModes,
    AEEGSM1xControl_DFPresenceBitMaskType*, BRIDLE_CHECK_WRITEACCESS, sizeof(AEEGSM1xControl_DFPresenceBitMaskType),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETSUPPORTEDPROVISIONINGMODE
    )

BRIDLE3_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetUIMUniqueId,
    uint16, BRIDLE_CHECK_NONE, 0,
    byte*,  BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_1,
    uint16*,BRIDLE_CHECK_WRITEACCESS, sizeof(uint16),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETUIMUNIQUEID
    )

BRIDLE1_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetDFPresence,
    AEEGSM1xControl_DFPresenceBitMaskType*, BRIDLE_CHECK_WRITEACCESS, sizeof(AEEGSM1xControl_DFPresenceBitMaskType),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETDFPRESENCE
    )

BRIDLE0_RET(
    AEEGSM1xControl_statusType,
    OEMGSM1xControl_SVC_ProvisionGSM1xParameters,
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_PROVISIONGSM1XPARAMETERS
    )

BRIDLE0_RET(
    AEEGSM1xControl_statusType,
    OEMGSM1xControl_SVC_EnableGSM1xMode,
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_ENABLEGSM1XMODE
    )

BRIDLE4_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetPLMN,
    AEEGSM1xControl_PLMNTypeBitMaskType, BRIDLE_CHECK_NONE, 0,
    uint16, BRIDLE_CHECK_NONE, 0,
    AEEGSM1xControl_PLMNTripletType*, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_2*sizeof(AEEGSM1xControl_PLMNTripletType),
    uint16*,BRIDLE_CHECK_WRITEACCESS, sizeof(uint16),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETPLMN
    )

BRIDLE2_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_SetPLMN,
    uint16, BRIDLE_CHECK_NONE, 0,
    AEEGSM1xControl_PLMNTripletType*, BRIDLE_CHECK_READACCESS, UNPACKBRIDLE_PARAM_1*sizeof(AEEGSM1xControl_PLMNTripletType),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_SETPLMN
    )

BRIDLE2_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetGSM1xPRL,
    uint16, BRIDLE_CHECK_NONE, 0,
    byte*, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_1,
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETGSM1XPRL
    )

BRIDLE2_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_SetGSM1xPRL,
    uint16, BRIDLE_CHECK_NONE, 0,
    byte*, BRIDLE_CHECK_READACCESS, UNPACKBRIDLE_PARAM_1,
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_SETGSM1XPRL
    )

BRIDLE3_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_ValidatePRL,
    uint16, BRIDLE_CHECK_NONE, 0,
    byte*, BRIDLE_CHECK_READACCESS, UNPACKBRIDLE_PARAM_1,
    boolean*, BRIDLE_CHECK_WRITEACCESS, sizeof(boolean),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_VALIDATEPRL
    )

BRIDLE4_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_SetGSM1xSIDNIDPairs,
    uint16, BRIDLE_CHECK_NONE, 0,
    AEEGSM1xControl_SIDNIDPairType*, BRIDLE_CHECK_READACCESS, UNPACKBRIDLE_PARAM_1*sizeof(AEEGSM1xControl_SIDNIDPairType),
    uint16, BRIDLE_CHECK_NONE, 0,
    AEEGSM1xControl_SIDNIDPairType*, BRIDLE_CHECK_READACCESS, UNPACKBRIDLE_PARAM_3*sizeof(AEEGSM1xControl_SIDNIDPairType),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_SETGSM1XSIDNIDPAIRS
    )
 
BRIDLE6_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetGSM1xSIDNIDPairs, uint16, BRIDLE_CHECK_NONE, 0,
    AEEGSM1xControl_SIDNIDPairType*, BRIDLE_CHECK_WRITEACCESS, UNPACKBRIDLE_PARAM_1*sizeof(AEEGSM1xControl_SIDNIDPairType),
    uint16*, BRIDLE_CHECK_WRITEACCESS, sizeof(uint16), uint16, BRIDLE_CHECK_NONE, 0,
    AEEGSM1xControl_SIDNIDPairType*, BRIDLE_CHECK_READACCESS, UNPACKBRIDLE_PARAM_4*sizeof(AEEGSM1xControl_SIDNIDPairType),
    uint16*, BRIDLE_CHECK_WRITEACCESS, sizeof(uint16),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETGSM1XSIDNIDPAIRS)

BRIDLE1_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetAvailableModes,
    AEEGSM1xControl_modeBitMaskType*, BRIDLE_CHECK_WRITEACCESS, sizeof(AEEGSM1xControl_modeBitMaskType),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETAVAILABLEMODES
    )

BRIDLE1_RET(
    AEEGSM1xControl_statusType, // return value type
    OEMGSM1xControl_SVC_GetCurrentMode,
    AEEGSM1xControl_modeBitMaskType*, BRIDLE_CHECK_WRITEACCESS, sizeof(AEEGSM1xControl_modeBitMaskType),
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETCURRENTMODE
    )

BRIDLE0_VOID(
    OEMGSM1xControl_SVC_ProcessPowerUp,
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_PROCESSPOWERUP
    )

BRIDLE0_RET(
    AEEGSM1xSig_Status,
    OEMGSM1xControl_SVC_GetStatus,
    bridle_oemGSM1xControl_swi,
    BRIDLE_GSM1XCONTROL_GETSTATUS
    )
    


#endif // __BRIDLE_GSM1XCONTROL_H__
