xref: /titanic_51/usr/src/uts/common/sys/scsi/adapters/scsi_vhci_tpgs.h (revision 377116851d972902caefc86c848359c0273d8487)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 #ifndef	_SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H
26 #define	_SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H
27 
28 /*
29  * max number of retries for std failover to complete where the ping
30  * command is failing due to transport errors or commands being rejected by
31  * std.
32  * STD_FO_MAX_RETRIES takes into account the case where CMD_CMPLTs but
33  * std takes time to complete the failover.
34  */
35 #define	STD_FO_MAX_CMD_RETRIES	3
36 
37 #define	STD_ACTIVE_OPTIMIZED    0x0
38 #define	STD_ACTIVE_NONOPTIMIZED 0x1
39 #define	STD_STANDBY		0x2
40 #define	STD_UNAVAILABLE		0x3
41 #define	STD_TRANSITIONING	0xf
42 
43 #define	STD_SCSI_ASC_STATE_TRANS	0x04
44 #define	STD_SCSI_ASCQ_STATE_TRANS_FAIL  0x0A
45 #define	STD_SCSI_ASC_STATE_CHG		0x2A
46 #define	STD_SCSI_ASCQ_STATE_CHG_SUCC	0x06
47 #define	STD_SCSI_ASCQ_STATE_CHG_FAILED	0x07
48 #define	STD_SCSI_ASC_INVAL_PARAM_LIST	0x26
49 #define	STD_SCSI_ASC_INVAL_CMD_OPCODE	0x20
50 #define	STD_LOGICAL_UNIT_NOT_ACCESSIBLE	0x04
51 #define	STD_TGT_PORT_STANDBY		0x0B
52 #define	STD_TGT_PORT_UNAVAILABLE	0x0C
53 
54 extern int vhci_tpgs_get_target_fo_mode(struct scsi_device *sd, int *mode,
55     int *state, int *xlf_capable, int *preferred);
56 
57 #endif /* _SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H */
58