mpapi_scsi_vhci.h revision 4c06356b0f0fffb4fc1b6eccc8e5d8e2254a84d6
/*
* 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
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(_BIT_FIELDS_LTOH) && !defined(_BIT_FIELDS_HTOL)
#endif /* _BIT_FIELDS_LTOH */
#define MPAPI_SCSI_MAXPCLASSLEN 25
/* Structure for MP_OID (kernel level only) */
typedef struct mp_oid {
#if defined(_BIT_FIELDS_HTOL)
seq_id:24;
#else
type:8;
#endif
} mp_oid_t;
typedef union mpoid {
} mpoid_t;
/*
* MP API item - A generic one to use in a list setup
* in a common way for all types of elements of
* Object type items required for mpapi.
*/
typedef struct mpapi_item {
void *idata; /* item data */
} mpapi_item_t;
typedef struct mpapi_item_list {
struct mpapi_item_list *next;
/*
* MP API item header definition.
*/
typedef struct mpapi_list_header {
/*
* Structure to maintain mpapi initiator data.
*/
typedef struct mpapi_initiator_data {
void *resp; /* initiator-port prop */
int valid;
/*
* Structure to maintain mpapi lu data.
*/
typedef struct mpapi_lu_data {
void *resp; /* vlun */
int valid;
/*
* Structure to maintain mpapi path data.
*
* The hide flag is set when pip was detroyed or should
* have been destroyed(MDI_PATHINFO_FLAGS_DEVICE_REMOVED).
* The valid flag is set to 0 when the path is neither online
* nor standby state. When hide flag is set the valid flag set
* to 0 also.
*/
typedef struct mpapi_path_data {
void *resp; /* pip */
char *path_name;
int valid;
int hide;
char pclass[MPAPI_SCSI_MAXPCLASSLEN];
/*
* Structure to maintain mpapi tpg data.
*/
typedef struct mpapi_tpg_data {
void *resp;
int valid;
char pclass[MPAPI_SCSI_MAXPCLASSLEN];
/*
* Structure to maintain mpapi tport data.
*/
typedef struct mpapi_tport_data {
void *resp; /* target port prop */
int valid;
/* Structure for mpapi private data */
typedef struct mpapi_priv {
/*
* Will be initialized with tod(time of day)
* This will enable detection of stale OIDs used by the upper layers.
*/
/*
* The Sequence number space is unique within an Object Type -
* that is there can be a seq# 2 in Object Type "initiator port"
* and also a seq#2 in object type 'Path LU'.
* Even though the Seq# space collides, the Object type field
* will make the OIDs unique.
* The following field will indicate what the next sequence number
* that can be used for a particular type of Object type -
* Object type will be used to index into the array element.
*/
/*
* One list for each type of object.
*/
} mpapi_priv_t;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_SCSI_ADAPTERS_MPAPI_SCSI_VHCI_H */