0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs/*
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * CDDL HEADER START
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs *
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * The contents of this file are subject to the terms of the
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * Common Development and Distribution License (the "License").
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * You may not use this file except in compliance with the License.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs *
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * or http://www.opensolaris.org/os/licensing.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * See the License for the specific language governing permissions
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * and limitations under the License.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs *
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * When distributing Covered Code, include this CDDL HEADER in each
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * If applicable, add the following below this CDDL HEADER, with the
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * fields enclosed by brackets "[]" replaced with your own identifying
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * information: Portions Copyright [yyyy] [name of copyright owner]
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs *
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * CDDL HEADER END
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs */
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs/*
377116851d972902caefc86c848359c0273d8487wl * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * Use is subject to license terms.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs */
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#ifndef _SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define _SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs/*
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * max number of retries for std failover to complete where the ping
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * command is failing due to transport errors or commands being rejected by
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * std.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * STD_FO_MAX_RETRIES takes into account the case where CMD_CMPLTs but
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs * std takes time to complete the failover.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs */
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_FO_MAX_CMD_RETRIES 3
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_ACTIVE_OPTIMIZED 0x0
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_ACTIVE_NONOPTIMIZED 0x1
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_STANDBY 0x2
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_UNAVAILABLE 0x3
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_TRANSITIONING 0xf
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_SCSI_ASC_STATE_TRANS 0x04
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_SCSI_ASCQ_STATE_TRANS_FAIL 0x0A
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_SCSI_ASC_STATE_CHG 0x2A
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_SCSI_ASCQ_STATE_CHG_SUCC 0x06
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_SCSI_ASCQ_STATE_CHG_FAILED 0x07
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_SCSI_ASC_INVAL_PARAM_LIST 0x26
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_SCSI_ASC_INVAL_CMD_OPCODE 0x20
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_LOGICAL_UNIT_NOT_ACCESSIBLE 0x04
377116851d972902caefc86c848359c0273d8487wl#define STD_TGT_PORT_STANDBY 0x0B
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#define STD_TGT_PORT_UNAVAILABLE 0x0C
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphsextern int vhci_tpgs_get_target_fo_mode(struct scsi_device *sd, int *mode,
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs int *state, int *xlf_capable, int *preferred);
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs#endif /* _SYS_SCSI_ADAPTERS_SCSI_VHCI_TPGS_H */