mpapi_impl.h revision 8c4f8890c870d3bd16cbcaeed2dc4679d5e076b5
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_SCSI_ADAPTERS_MPAPI_IMPL_H
#define _SYS_SCSI_ADAPTERS_MPAPI_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/mdi_impldefs.h>
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_BIT_FIELDS_LTOH) && !defined(_BIT_FIELDS_HTOL)
#endif /* _BIT_FIELDS_LTOH */
/*
* All the structures (except mp_iocdata_t) are 64-bit aligned (padded,
* where necessary) to facilitate the use of the same structure for
* handling ioctl calls made by both 32-bit and 64-bit applications.
* There are no pointers to other structures inside these structures
* as copyout to user land may not produce desired result.
* The caddr_t structure is kept at the end due to the undeterminstic
* size it could accrue to its parent structure.
*/
/* Structure for MP_PLUGIN_PROPERTIES */
typedef struct mp_driver_prop {
char driverVersion[256];
char deviceFileNamespace[256];
/* Size of "proprietaryProp" field */
#define MP_MAX_PROP_BUF_SIZE 1024
/* Constants for autoFailbackSupport */
/*
* Both MP_DRVR_AUTO_FAILBACK_SUPPORT and
* MP_DRVR_AUTO_FAILBACK_SUPPORT_LU
* can be supported at the same time.
*/
#define MP_DRVR_AUTO_FAILBACK_SUPPORT_NONE 0
#define MP_DRVR_AUTO_FAILBACK_SUPPORT (1<<0)
/* Constants for defaultLoadBalanceType */
#define MP_DRVR_LOAD_BALANCE_TYPE_UNKNOWN 0
#define MP_DRVR_LOAD_BALANCE_TYPE_ROUNDROBIN (1<<0)
/* Constants for autoProbingSupport */
/*
* Both MP_DRVR_AUTO_PROBING_SUPPORT and
* MP_DRVR_AUTO_PROBING_SUPPORT_LU
* can be supported at the same time.
*/
#define MP_DRVR_AUTO_PROBING_SUPPORT_NONE 0
#define MP_DRVR_AUTO_PROBING_SUPPORT (1<<0)
/* Structures for MP_DEVICE_PRODUCT_PROPERTIES */
typedef struct mp_vendor_prod_info {
char vendor[8];
char product[16];
char revision[4];
typedef struct mp_dev_prod_prop {
struct mp_vendor_prod_info prodInfo;
/* Structure for MP_MULTIPATH_LOGICAL_UNIT_PROPERTIES */
typedef struct mp_logical_unit_prop {
struct mp_vendor_prod_info prodInfo;
char deviceFileName[256];
/* Constants for nameType */
#define MP_DRVR_NAME_TYPE_UNKNOWN 0
#define MP_DRVR_NAME_TYPE_VPD83_TYPE1 1
#define MP_DRVR_NAME_TYPE_VPD83_TYPE2 2
#define MP_DRVR_NAME_TYPE_VPD83_TYPE3 3
#define MP_DRVR_NAME_TYPE_DEVICE_SPECIFIC 4
/* Structure for MP_INITIATOR_PORT_PROPERTIES */
typedef struct mp_init_port_prop {
char portID[256];
char osDeviceFile[256];
/* Constants for portType */
#define MP_DRVR_TRANSPORT_TYPE_UNKNOWN 0
#define MP_DRVR_TRANSPORT_TYPE_FC 2
#define MP_DRVR_TRANSPORT_TYPE_SPI 3
#define MP_DRVR_TRANSPORT_TYPE_ISCSI 4
#define MP_DRVR_TRANSPORT_TYPE_IFB 5
/* Structure for MP_TARGET_PORT_PROPERTIES */
typedef struct mp_target_port_prop {
char portName[256];
/* Structure for MP_TARGET_PORT_GROUP_PROPERTIES */
typedef struct mp_tpg_prop {
/* Constants for accessState */
#define MP_DRVR_ACCESS_STATE_ACTIVE_OPTIMIZED 0
#define MP_DRVR_ACCESS_STATE_ACTIVE_NONOPTIMIZED 0x1
#define MP_DRVR_ACCESS_STATE_STANDBY 0x2
#define MP_DRVR_ACCESS_STATE_UNAVAILABLE 0x3
#define MP_DRVR_ACCESS_STATE_TRANSITIONING 0xf
#define MP_DRVR_ACCESS_STATE_ACTIVE 0x10
/* Structure for MP_PATH_LOGICAL_UNIT_PROPERTIES */
typedef struct mp_path_prop {
struct mp_init_port_prop initPort;
struct mp_target_port_prop targetPort;
struct mp_logical_unit_prop logicalUnit;
/* Constants for pathState */
#define MP_DRVR_PATH_STATE_ACTIVE 0
#define MP_DRVR_PATH_STATE_PASSIVE 1
#define MP_DRVR_PATH_STATE_PATH_ERR 2
#define MP_DRVR_PATH_STATE_LU_ERR 3
#define MP_DRVR_PATH_STATE_RESERVED 4
#define MP_DRVR_PATH_STATE_REMOVED 5
#define MP_DRVR_PATH_STATE_TRANSITIONING 6
#define MP_DRVR_PATH_STATE_UNKNOWN 7
/* Structure for MP_PROPRIETARY_LOAD_BALANCE_PROPERTIES */
typedef struct mp_proprietary_loadbalance_prop {
char name[256];
char vendorName[256];
/*
* Structure used as input to
* MP_ASSIGN_LU_TO_TPG subcmd.
*/
typedef struct mp_lu_tpg_pair {
/*
* Structure used as input to
* MP_SET_TPG_ACCESS_STATE subcmd.
*/
typedef struct mp_set_tpg_state_req {
struct mp_lu_tpg_pair luTpgPair;
/*
* Structure for ioctl data
*/
typedef struct mp_iocdata {
int mp_errno; /* MPAPI driver internal error code */
} mp_iocdata_t;
#ifdef _KERNEL
#if defined(_SYSCALL32)
#pragma pack(4)
#endif
/*
* Structure for 32-bit ioctl data
*/
typedef struct mp_iocdata32 {
#pragma pack()
#endif
#endif /* _SYSCALL32 */
#endif /* _KERNEL */
/* Constants for MP_XFER */
#define MP_XFER_NONE 0x00
#define MP_XFER_READ 0x01
#define MP_XFER_WRITE 0x02
/* Constants for MP_OBJECT_TYPE */
#define MP_OBJECT_TYPE_UNKNOWN 0
#define MP_OBJECT_TYPE_PLUGIN 1
#define MP_OBJECT_TYPE_INITIATOR_PORT 2
#define MP_OBJECT_TYPE_TARGET_PORT 3
#define MP_OBJECT_TYPE_MULTIPATH_LU 4
#define MP_OBJECT_TYPE_PATH_LU 5
#define MP_OBJECT_TYPE_DEVICE_PRODUCT 6
#define MP_OBJECT_TYPE_TARGET_PORT_GROUP 7
#define MP_OBJECT_TYPE_PROPRIETARY_LOAD_BALANCE 8
/* Constants for MP_CMD */
#define MP_API_SUBCMD_MAX (MP_ASSIGN_LU_TO_TPG)
/*
* Typical MP API ioctl interface specific Return Values
*/
#define MP_IOCTL_ERROR_START 0x5533
/*
* Macros for OID operations
*/
#define MP_ID_SHIFT4MAJOR 32
/*
* Event Class and Sub-Class definitions
*/
#define EC_SUN_MP "EC_sun_mp"
#define ESC_SUN_MP_LU_CHANGE "ESC_sun_mp_lu_change"
#define ESC_SUN_MP_PATH_CHANGE "ESC_sun_mp_path_change"
#define ESC_SUN_MP_PATH_ADD "ESC_sun_mp_path_add"
#define ESC_SUN_MP_PATH_REMOVE "ESC_sun_mp_path_remove"
#define ESC_SUN_MP_INIT_PORT_CHANGE "ESC_sun_mp_init_port_change"
#define ESC_SUN_MP_TPG_CHANGE "ESC_sun_mp_tpg_change"
#define ESC_SUN_MP_TPG_ADD "ESC_sun_mp_tpg_add"
#define ESC_SUN_MP_TPG_REMOVE "ESC_sun_mp_tpg_remove"
#define ESC_SUN_MP_TARGET_PORT_CHANGE "ESC_sun_mp_target_port_change"
#define ESC_SUN_MP_TARGET_PORT_ADD "ESC_sun_mp_target_port_add"
#define ESC_SUN_MP_TARGET_PORT_REMOVE "ESC_sun_mp_target_port_remove"
#define ESC_SUN_MP_DEV_PROD_CHANGE "ESC_sun_mp_dev_prod_change"
#define ESC_SUN_MP_DEV_PROD_ADD "ESC_sun_mp_dev_prod_add"
#define ESC_SUN_MP_DEV_PROD_REMOVE "ESC_sun_mp_dev_prod_remove"
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SCSI_ADAPTERS_MPAPI_IMPL_H */