xref: /onnv-gate/usr/src/uts/common/sys/scsi/adapters/scsi_vhci_tpgs.h (revision 10356:8780417789fd)
16941Srralphs /*
26941Srralphs  * CDDL HEADER START
36941Srralphs  *
46941Srralphs  * The contents of this file are subject to the terms of the
56941Srralphs  * Common Development and Distribution License (the "License").
66941Srralphs  * You may not use this file except in compliance with the License.
76941Srralphs  *
86941Srralphs  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
96941Srralphs  * or http://www.opensolaris.org/os/licensing.
106941Srralphs  * See the License for the specific language governing permissions
116941Srralphs  * and limitations under the License.
126941Srralphs  *
136941Srralphs  * When distributing Covered Code, include this CDDL HEADER in each
146941Srralphs  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
156941Srralphs  * If applicable, add the following below this CDDL HEADER, with the
166941Srralphs  * fields enclosed by brackets "[]" replaced with your own identifying
176941Srralphs  * information: Portions Copyright [yyyy] [name of copyright owner]
186941Srralphs  *
196941Srralphs  * CDDL HEADER END
206941Srralphs  */
216941Srralphs /*
22*10356Swl202157@icefox  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
236941Srralphs  * Use is subject to license terms.
246941Srralphs  */
256941Srralphs #ifndef	_SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H
266941Srralphs #define	_SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H
276941Srralphs 
286941Srralphs /*
296941Srralphs  * max number of retries for std failover to complete where the ping
306941Srralphs  * command is failing due to transport errors or commands being rejected by
316941Srralphs  * std.
326941Srralphs  * STD_FO_MAX_RETRIES takes into account the case where CMD_CMPLTs but
336941Srralphs  * std takes time to complete the failover.
346941Srralphs  */
356941Srralphs #define	STD_FO_MAX_CMD_RETRIES	3
366941Srralphs 
376941Srralphs #define	STD_ACTIVE_OPTIMIZED    0x0
386941Srralphs #define	STD_ACTIVE_NONOPTIMIZED 0x1
396941Srralphs #define	STD_STANDBY		0x2
406941Srralphs #define	STD_UNAVAILABLE		0x3
416941Srralphs #define	STD_TRANSITIONING	0xf
426941Srralphs 
436941Srralphs #define	STD_SCSI_ASC_STATE_TRANS	0x04
446941Srralphs #define	STD_SCSI_ASCQ_STATE_TRANS_FAIL  0x0A
456941Srralphs #define	STD_SCSI_ASC_STATE_CHG		0x2A
466941Srralphs #define	STD_SCSI_ASCQ_STATE_CHG_SUCC	0x06
476941Srralphs #define	STD_SCSI_ASCQ_STATE_CHG_FAILED	0x07
486941Srralphs #define	STD_SCSI_ASC_INVAL_PARAM_LIST	0x26
496941Srralphs #define	STD_SCSI_ASC_INVAL_CMD_OPCODE	0x20
506941Srralphs #define	STD_LOGICAL_UNIT_NOT_ACCESSIBLE	0x04
51*10356Swl202157@icefox #define	STD_TGT_PORT_STANDBY		0x0B
526941Srralphs #define	STD_TGT_PORT_UNAVAILABLE	0x0C
536941Srralphs 
546941Srralphs extern int vhci_tpgs_get_target_fo_mode(struct scsi_device *sd, int *mode,
556941Srralphs     int *state, int *xlf_capable, int *preferred);
566941Srralphs 
576941Srralphs #endif /* _SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H */
58