xref: /titanic_52/usr/src/uts/common/sys/scsi/impl/inquiry.h (revision 96c4a178a18cd52ee5001195f1552d9cef0c38f0)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5184cd04cScth  * Common Development and Distribution License (the "License").
6184cd04cScth  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*96c4a178SChris Horne  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23184cd04cScth  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_SYS_SCSI_IMPL_INQUIRY_H
277c478bd9Sstevel@tonic-gate #define	_SYS_SCSI_IMPL_INQUIRY_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
307c478bd9Sstevel@tonic-gate extern "C" {
317c478bd9Sstevel@tonic-gate #endif
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate /*
347c478bd9Sstevel@tonic-gate  * Implementation inquiry data that is not within
357c478bd9Sstevel@tonic-gate  * the scope of any released SCSI standard.
367c478bd9Sstevel@tonic-gate  */
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate /*
397c478bd9Sstevel@tonic-gate  * Minimum inquiry data length (includes up through RDF field)
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #define	SUN_MIN_INQLEN	4
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate /*
457c478bd9Sstevel@tonic-gate  * Inquiry data size definition
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate #define	SUN_INQSIZE	(sizeof (struct scsi_inquiry))
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate /*
50184cd04cScth  * SCSI inquiry properties.  The following properties figuratively
51184cd04cScth  * represent 'inquiry' data.  Some of the values may be more detailed
52184cd04cScth  * (longer in length) than the basic 'struct scsi_inquiry' fields. For
53184cd04cScth  * example the INQUIRY_REVISION_ID field in 'struct scsi_inquiry' is
54184cd04cScth  * four bytes long, but SATA's 'Identify Device Data' is eight bytes.
55184cd04cScth  * In situations like this an HBA driver's tran_tgt_init(9E)
56184cd04cScth  * implementation may establish different, more detailed, values than
57184cd04cScth  * those returned by 'struct scsi_inquiry'.  In addition some
58184cd04cScth  * properties like 'serial number' and 'capacity' are never derived
59184cd04cScth  * from 'struct scsi_inquiry'.  Instead, the information is obtained
60184cd04cScth  * from an INQUIRY command to another page (page 0x80 for serial
61184cd04cScth  * number), by some other SCSI commands (like READ_CAPACITY for
62184cd04cScth  * capacity), or by some HBA driver specific mechanism.
637c478bd9Sstevel@tonic-gate  */
64184cd04cScth #define	INQUIRY_DEVICE_TYPE	"inquiry-device-type"	/* int */
65184cd04cScth #define	INQUIRY_VENDOR_ID	"inquiry-vendor-id"	/* string */
66184cd04cScth #define	INQUIRY_PRODUCT_ID	"inquiry-product-id"	/* string */
67184cd04cScth #define	INQUIRY_REVISION_ID	"inquiry-revision-id"	/* string */
68184cd04cScth #define	INQUIRY_SERIAL_NO	"inquiry-serial-no"	/* string */
697c478bd9Sstevel@tonic-gate 
70*96c4a178SChris Horne #ifdef	_KERNEL
71*96c4a178SChris Horne int	scsi_ascii_inquiry_len(char *field, size_t length);
72*96c4a178SChris Horne #endif	/* _KERNEL */
73*96c4a178SChris Horne 
747c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
757c478bd9Sstevel@tonic-gate }
767c478bd9Sstevel@tonic-gate #endif
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate #endif	/* _SYS_SCSI_IMPL_INQUIRY_H */
79