9a016c63ca347047a236dff12f0da83aac8981d1stevel * CDDL HEADER START
9a016c63ca347047a236dff12f0da83aac8981d1stevel * The contents of this file are subject to the terms of the
9a016c63ca347047a236dff12f0da83aac8981d1stevel * Common Development and Distribution License (the "License").
9a016c63ca347047a236dff12f0da83aac8981d1stevel * You may not use this file except in compliance with the License.
9a016c63ca347047a236dff12f0da83aac8981d1stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a016c63ca347047a236dff12f0da83aac8981d1stevel * See the License for the specific language governing permissions
9a016c63ca347047a236dff12f0da83aac8981d1stevel * and limitations under the License.
9a016c63ca347047a236dff12f0da83aac8981d1stevel * When distributing Covered Code, include this CDDL HEADER in each
9a016c63ca347047a236dff12f0da83aac8981d1stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9a016c63ca347047a236dff12f0da83aac8981d1stevel * If applicable, add the following below this CDDL HEADER, with the
9a016c63ca347047a236dff12f0da83aac8981d1stevel * fields enclosed by brackets "[]" replaced with your own identifying
9a016c63ca347047a236dff12f0da83aac8981d1stevel * information: Portions Copyright [yyyy] [name of copyright owner]
9a016c63ca347047a236dff12f0da83aac8981d1stevel * CDDL HEADER END
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9a016c63ca347047a236dff12f0da83aac8981d1stevel * Use is subject to license terms.
9a016c63ca347047a236dff12f0da83aac8981d1stevel * Copyright Siemens 1999
9a016c63ca347047a236dff12f0da83aac8981d1stevel * All rights reserved.
9a016c63ca347047a236dff12f0da83aac8981d1stevel#pragma ident "%Z%%M% %I% %E% SMI"
9a016c63ca347047a236dff12f0da83aac8981d1stevelextern "C" {
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_trans_err; /* error trying to transport pkt */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_restart; /* command restart attempted */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_incmp_err; /* command failed to complete */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_autosen_rcv; /* autosense occurred */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_autosen_bad; /* autosense data looks malformed */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_sense_rcv; /* sense fetch occurred */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_sense_bad; /* sense data looks malformed */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_recov_err; /* sense key is KEY_RECOVERABLE */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_nosen_err; /* sense key is KEY_NO_SENSE */
9a016c63ca347047a236dff12f0da83aac8981d1stevel kstat_named_t sgen_unrecov_err; /* sense key indicates other err */
9a016c63ca347047a236dff12f0da83aac8981d1stevel struct scsi_device *sgen_scsidev; /* pointer to scsi_device */
9a016c63ca347047a236dff12f0da83aac8981d1stevel struct uscsi_cmd *sgen_ucmd; /* uscsi command struct */
9a016c63ca347047a236dff12f0da83aac8981d1stevel struct scsi_pkt *sgen_cmdpkt; /* scsi packet for command */
9a016c63ca347047a236dff12f0da83aac8981d1stevel struct scsi_pkt *sgen_rqspkt; /* request sense packet */
9a016c63ca347047a236dff12f0da83aac8981d1stevel struct buf *sgen_rqsbuf; /* request sense xfer buffer */
9a016c63ca347047a236dff12f0da83aac8981d1stevel int sgen_arq_enabled; /* auto request sense enabled */
9a016c63ca347047a236dff12f0da83aac8981d1stevel timeout_id_t sgen_restart_timeid; /* timeout for sgen_restart */
9a016c63ca347047a236dff12f0da83aac8981d1stevel * Convenience accessors for sgen_state_t.
9a016c63ca347047a236dff12f0da83aac8981d1stevel (((sgen_state_t *)(stp))->sgen_flags |= SGEN_FL_OPEN)
9a016c63ca347047a236dff12f0da83aac8981d1stevel (((sgen_state_t *)(stp))->sgen_flags &= ~SGEN_FL_OPEN)
9a016c63ca347047a236dff12f0da83aac8981d1stevel ((((sgen_state_t *)(stp))->sgen_flags & SGEN_FL_OPEN) == SGEN_FL_OPEN)
9a016c63ca347047a236dff12f0da83aac8981d1stevel (((sgen_state_t *)(stp))->sgen_flags |= SGEN_FL_SUSP)
9a016c63ca347047a236dff12f0da83aac8981d1stevel (((sgen_state_t *)(stp))->sgen_flags &= ~SGEN_FL_SUSP)
9a016c63ca347047a236dff12f0da83aac8981d1stevel ((((sgen_state_t *)(stp))->sgen_flags & SGEN_FL_SUSP) == SGEN_FL_SUSP)
9a016c63ca347047a236dff12f0da83aac8981d1stevel (((sgen_state_t *)(stp))->sgen_flags |= SGEN_FL_BUSY)
9a016c63ca347047a236dff12f0da83aac8981d1stevel (((sgen_state_t *)(stp))->sgen_flags &= ~SGEN_FL_BUSY)
9a016c63ca347047a236dff12f0da83aac8981d1stevel ((((sgen_state_t *)(stp))->sgen_flags & SGEN_FL_BUSY) == SGEN_FL_BUSY)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock (((sgen_state_t *)(stp))->sgen_flags |= SGEN_FL_EXCL)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock (((sgen_state_t *)(stp))->sgen_flags &= ~SGEN_FL_EXCL)
275c9da86e89f8abf71135cf63d9fc23671b2e60eschrock ((((sgen_state_t *)(stp))->sgen_flags & SGEN_FL_EXCL) == SGEN_FL_EXCL)
9a016c63ca347047a236dff12f0da83aac8981d1stevel * These structures form the driver's database of binding information.
9a016c63ca347047a236dff12f0da83aac8981d1stevel * Inquiry strings and device types from the inquiry-config-list and
9a016c63ca347047a236dff12f0da83aac8981d1stevel * device-type-config-list properties are stored.
9a016c63ca347047a236dff12f0da83aac8981d1stevel sgen_inq_node_t *sdb_inq_nodes; /* inquiry binding nodes */
9a016c63ca347047a236dff12f0da83aac8981d1stevel sgen_type_node_t *sdb_type_nodes; /* dev-type binding nodes */
9a016c63ca347047a236dff12f0da83aac8981d1stevel#define SGEN_ESTIMATED_NUM_DEVS 4 /* for soft-state allocation */
9a016c63ca347047a236dff12f0da83aac8981d1stevel * Time to wait before a retry for commands returning Busy Status
9a016c63ca347047a236dff12f0da83aac8981d1stevel * sgen_callback action codes
9a016c63ca347047a236dff12f0da83aac8981d1stevel#define COMMAND_DONE 0 /* command completed, biodone it */
9a016c63ca347047a236dff12f0da83aac8981d1stevel#define COMMAND_DONE_ERROR 1 /* command completed, indicate error */
9a016c63ca347047a236dff12f0da83aac8981d1stevel#define FETCH_SENSE 2 /* CHECK CONDITION, so initiate sense */
9a016c63ca347047a236dff12f0da83aac8981d1stevel /* fetch */
9a016c63ca347047a236dff12f0da83aac8981d1stevel#endif /* defined(_KERNEL) */
9a016c63ca347047a236dff12f0da83aac8981d1stevel#endif /* _SYS_SCSI_TARGETS_SGENDEF_H */