/*
* 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.
*/
#ifndef _SYS_SCSI_GENERIC_SENSE_H
#define _SYS_SCSI_GENERIC_SENSE_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Standard (Non-Extended) SCSI Sense.
*
* For Error Classe 0-6. This is all
* Vendor Unique sense information.
*
* Note: This is pre-SCSI-2.
*/
struct scsi_sense {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif /* _BIT_FIELDS_LTOH */
};
/*
* SCSI Extended Sense structure
*
* For Error Class 7, the Extended Sense Structure is applicable (now referred
* to in SPC-3 as "fixed format sense data"). The es_code field is used
* to determine whether the extended sense data is actually "fixed format" or
* the newer "descriptor format" introduced in SPC-3.
*/
struct scsi_extended_sense {
#if defined(_BIT_FIELDS_LTOH)
: 1, /* reserved */
#elif defined(_BIT_FIELDS_HTOL)
: 1, /* reserved */
#else
#endif /* _BIT_FIELDS_LTOH */
/*
* Additional bytes may be defined in each implementation.
* The actual amount of space allocated for Sense Information
* is also implementation dependent.
*
* Modulo that, the declaration of an array two bytes in size
* nicely rounds this entire structure to a size of 20 bytes.
*/
};
/*
* Sense code values for Extended Sense
*/
CODE_FMT_DESCR_CURRENT) || \
/*
* Sense Key values for Extended Sense.
*/
/*
* Descriptor sense data header
*
* Descriptor format sense data is described in the SPC-3 standard. Unlike
* the fixed format sense data, descriptor format consists of a header
* followed by a variable length list of sense data descriptors.
*/
struct scsi_descr_sense_hdr {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif /* _BIT_FIELDS_LTOH */
};
/*
* SCSI sense descriptors
*/
struct scsi_information_sense_descr {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif /* _BIT_FIELDS_LTOH */
};
struct scsi_cmd_specific_sense_descr {
};
union scsi_sk_specific_data {
/*
* Field pointer (Sense key = Illegal Request)
*/
struct {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
cd : 1,
reserved : 2,
bpv : 1,
bit_pointer : 3;
#else
#endif /* _BIT_FIELDS_LTOH */
} fp;
/*
* Actual Retry Count (Sense key = Hardware error,
* Medium Error or Recovered Error)
*/
struct {
} arc;
/*
* Progress Indication (Sense key = No Sense or Not Ready
*/
struct {
} pi;
/*
* Segment Pointer (Sense key = Copy Aborted)
*/
struct {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
reserved2 : 1,
sd : 1,
reserved : 1,
bpv : 1,
bit_pointer : 3;
#else
#endif /* _BIT_FIELDS_LTOH */
} sp;
};
struct scsi_sk_specific_sense_descr {
};
struct scsi_fru_sense_descr {
};
struct scsi_stream_cmd_data {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
scs_eom : 1,
scs_ili : 1,
scs_reserved2 : 5;
#else
#endif /* _BIT_FIELDS_LTOH */
};
struct scsi_stream_cmd_sense_descr {
};
struct scsi_block_cmd_sense_descr {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif /* _BIT_FIELDS_LTOH */
};
struct scsi_ata_status_ret_sense_descr {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
#else
#endif /* _BIT_FIELDS_LTOH */
};
struct scsi_vendor_specific_sense_descr {
/*
* Variable length vendor specific data
*/
};
/*
* SCSI Descriptor Types
*/
#ifdef __cplusplus
}
#endif
/*
* Each implementation will have specific mappings to what
* Sense Information means
*/
#endif /* _SYS_SCSI_GENERIC_SENSE_H */