/*
* 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_INQUIRY_H
#define _SYS_SCSI_GENERIC_INQUIRY_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* SCSI Standard Inquiry Data:
*
* Format of data returned as a result of an INQUIRY command.
*
* NOTE: Fields marked 'DEPRECATED' are defined in older versions of t10 "SCSI
* Primary Command" spec, and are marked 'Obsolete' in newer versions.
*/
#if defined(_BIT_FIELDS_LTOH)
struct scsi_inquiry {
/*
* byte 0
*
* Bits 7-5 are the Peripheral Device Qualifier
* Bits 4-0 are the Peripheral Device Type
*/
/* byte 1 */
/* byte 2 */
/* byte 3 */
/* bytes 4-7 */
/* bytes 8-35 */
/*
* Bytes 36-47 are reserved:
* For Sun qualified hard disk drives the inq_serial field contains
* two bytes of mfg date year code (ascii)
* two bytes of mfg date week code (ascii)
* six bytes of mfg serial number (ascii)
* two bytes unused
*/
/*
* Bytes 48-55 are reserved.
*/
/*
* The meanings of byte 56 is specific to SPI-3. For protocols older
* or other than this these fields are reserved.
*/
/*
* byte pairs 58-73 are version descriptors
* See: Table 51: dpANS SCSI Primary Commands - 2 (SPC-2) T10/1236
*/
struct inq_vd {
/*
* Bytes 74-95 are reserved.
* 96 to 'n' are vendor-specific parameter bytes.
*
* Pad structure to 132 bytes so that access to some vendor-specific
* data is possible via scsi_device(9S) sd_inq (for mpxio).
*/
};
#elif defined(_BIT_FIELDS_HTOL)
struct scsi_inquiry {
/*
* byte 0
*
* Bits 7-5 are the Peripheral Device Qualifier
* Bits 4-0 are the Peripheral Device Type
*/
/* byte 1 */
/* byte 2 */
/* byte 3 */
/* bytes 4-7 */
/* bytes 8-35 */
/*
* Bytes 36-47 are reserved:
* For Sun qualified hard disk drives the inq_serial field contains
* two bytes of mfg date year code (ascii)
* two bytes of mfg date week code (ascii)
* six bytes of mfg serial number (ascii)
* two bytes unused
*/
/*
* Bytes 48-55 are reserved.
*/
/*
* The meanings of byte 56 is specific to SPI-3. For protocols older
* or other than this these fields are reserved.
*/
/*
* byte pairs 58-73 are version descriptors
* See: Table 51: dpANS SCSI Primary Commands - 2 (SPC-2) T10/1236
*/
struct inq_vd {
/*
* Bytes 74-95 are reserved.
* 96 to 'n' are vendor-specific parameter bytes.
*
* Pad structure to 132 bytes so that access to some vendor-specific
* data is possible via scsi_device(9S) sd_inq (for mpxio).
*/
};
#else
#endif /* _BIT_FIELDS_LTOH */
/*
* Defined Peripheral Device Types
*/
/*
* Device types 0x13-0x1D are reserved in spc-3 (r23)
*/
/* ASCII mapping used by scsi_dname(9F) */
#define DTYPE_ASCII { \
"Direct Access", "Sequential Access", "Printer", "Processor", \
"Optical", "Changer", "Communications", "Unknown-0A", \
"Unknown-0B", "Array Controller", "Enclosure-Services", \
"Simplified-Direct-Access", "Optical-Card", "Bridge", \
"Object-Storage", NULL}
/*
* The peripheral qualifier tells us more about a particular device.
* (DPQ == DEVICE PERIPHERAL QUALIFIER).
*/
/*
* The specified peripheral device type is
* currently connected to this logical unit.
* If the target cannot determine whether
* or not a physical device is currently
* connected, it shall also return this
* qualifier.
*/
/*
* The target is capable of supporting the
* specified peripheral device type on this
* logical unit, however the physical device
* is not currently connected to this logical
* unit.
*/
/*
* The target is not capable of supporting a
* physical device on this logical unit. For
* this peripheral qualifier, the peripheral
* device type will be set to DTYPE_UNKNOWN
* in order to provide compatibility with
* previous versions of SCSI.
*/
/*
* If this bit is set, this is a vendor
* unique qualifier.
*/
/*
* To maintain compatibility with previous versions
* of inquiry data formats, if a device peripheral
* qualifier states that the target is not capable
* of supporting a physical device on this logical unit,
* then the qualifier DPQ_NEVER is set, *AND* the
* actual device type must be set to DTYPE_UNKNOWN.
*
* This may make for some problems with older drivers
* that blindly check the entire first byte, where they
* should be checking for only the least 5 bits to see
* whether the correct type is at the specified nexus.
*/
/*
* Defined Response Data Formats:
*/
/*
* Defined Target Port Group Select values:
*/
/*
* SPC-3 revision 21c, section 7.6.4.1
* Table 289 -- Device Identification VPD page
*/
struct vpd_hdr {
#if defined(_BIT_FIELDS_LTOH)
#elif defined(_BIT_FIELDS_HTOL)
device_type : 4;
#else
#endif
};
/*
* SPC-3 revision 21c, section 7.6.4.1
* Table 290 -- Identification descriptor
*/
struct vpd_desc {
#if defined(_BIT_FIELDS_LTOH)
: 1,
#elif defined(_BIT_FIELDS_HTOL)
code_set : 4;
: 1,
association : 2,
id_type : 4;
#else
#endif
/* ---- data follows ---- */
};
/*
* "pm-capable" integer property bit mask definitions
*/
/* indicate PM mode */
/* indicate log specifics */
/* supported */
/* attributes instead of the */
/* default SCSI Log pages */
#ifdef __cplusplus
}
#endif
/*
* Include in implementation specifuc
* (non-generic) inquiry definitions.
*/
#endif /* _SYS_SCSI_GENERIC_INQUIRY_H */