mpapi_impl.h revision 17d7121191d7d90045353185656b2128127d2178
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#ifndef _SYS_SCSI_ADAPTERS_MPAPI_IMPL_H
#define _SYS_SCSI_ADAPTERS_MPAPI_IMPL_H
#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)
/*
* Declaration of the MP_LOAD_BALANCE_TYPE constants - should be
* the same defines as in mpapi.h
*/
#define MP_DRVR_LOAD_BALANCE_TYPE_NONE 0
#define MP_DRVR_LOAD_BALANCE_TYPE_UNKNOWN (1<<0)
/*
* Proprietary load balance type should start from 0x10000(1<<16) or greater.
* It is exposed through API MP_GetProprietaryLoadBalanceProperties if exists.
*/
/* 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
#define MP_DRVR_PATH_STATE_UNINIT 8
/* 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 {
/* used for uscsi commmands */
typedef struct mp_uscsi_cmd {
int arq_enabled; /* auto-rqsense enable flag */
/*
* 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_SEND_SCSI_CMD)
/*
* 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_PLUGIN_CHANGE "ESC_sun_mp_plugin_change"
#define ESC_SUN_MP_LU_CHANGE "ESC_sun_mp_lu_change"
#define ESC_SUN_MP_LU_ADD "ESC_sun_mp_lu_add"
#define ESC_SUN_MP_LU_REMOVE "ESC_sun_mp_lu_remove"
#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 */