4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef _SYS_SCSI_GENERIC_INQUIRY_H
27 #define _SYS_SCSI_GENERIC_INQUIRY_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /*
34 * SCSI Standard Inquiry Data:
35 *
36 * Format of data returned as a result of an INQUIRY command.
37 *
38 * NOTE: Fields marked 'DEPRECATED' are defined in older versions of t10 "SCSI
39 * Primary Command" spec, and are marked 'Obsolete' in newer versions.
40 */
41 #if defined(_BIT_FIELDS_LTOH)
42 struct scsi_inquiry {
43 /*
364 /*
365 * Defined Response Data Formats:
366 */
367 #define RDF_LEVEL0 0x00 /* no conformance claim (SCSI-1) */
368 #define RDF_CCS 0x01 /* Obsolete (pseudo-spec) */
369 #define RDF_SCSI2 0x02 /* Obsolete (SCSI-2/3 spec) */
370 #define RDF_SCSI_SPC 0x03 /* ANSI INCITS 301-1997 (SPC) */
371 #define RDF_SCSI_SPC2 0x04 /* ANSI INCITS 351-2001 (SPC-2) */
372 #define RDF_SCSI_SPC3 0x05 /* ANSI INCITS 408-2005 (SPC-3) */
373 #define RDF_SCSI_SPC4 0x06 /* t10 (SPC-4) */
374
375 /*
376 * Defined Target Port Group Select values:
377 */
378 #define TPGS_FAILOVER_NONE 0x0
379 #define TPGS_FAILOVER_IMPLICIT 0x1
380 #define TPGS_FAILOVER_EXPLICIT 0x2
381 #define TPGS_FAILOVER_BOTH 0x3
382
383 /*
384 * SPC-3 revision 21c, section 7.6.4.1
385 * Table 289 -- Device Identification VPD page
386 */
387 struct vpd_hdr {
388 #if defined(_BIT_FIELDS_LTOH)
389 uchar_t device_type : 4,
390 periph_qual : 4;
391 #elif defined(_BIT_FIELDS_HTOL)
392 uchar_t periph_qual : 4,
393 device_type : 4;
394 #else
395 #error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
396 #endif
397 uchar_t page_code,
398 page_len[2];
399 };
400
401 /*
402 * SPC-3 revision 21c, section 7.6.4.1
403 * Table 290 -- Identification descriptor
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
25 */
26
27 #ifndef _SYS_SCSI_GENERIC_INQUIRY_H
28 #define _SYS_SCSI_GENERIC_INQUIRY_H
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33
34 /*
35 * SCSI Standard Inquiry Data:
36 *
37 * Format of data returned as a result of an INQUIRY command.
38 *
39 * NOTE: Fields marked 'DEPRECATED' are defined in older versions of t10 "SCSI
40 * Primary Command" spec, and are marked 'Obsolete' in newer versions.
41 */
42 #if defined(_BIT_FIELDS_LTOH)
43 struct scsi_inquiry {
44 /*
365 /*
366 * Defined Response Data Formats:
367 */
368 #define RDF_LEVEL0 0x00 /* no conformance claim (SCSI-1) */
369 #define RDF_CCS 0x01 /* Obsolete (pseudo-spec) */
370 #define RDF_SCSI2 0x02 /* Obsolete (SCSI-2/3 spec) */
371 #define RDF_SCSI_SPC 0x03 /* ANSI INCITS 301-1997 (SPC) */
372 #define RDF_SCSI_SPC2 0x04 /* ANSI INCITS 351-2001 (SPC-2) */
373 #define RDF_SCSI_SPC3 0x05 /* ANSI INCITS 408-2005 (SPC-3) */
374 #define RDF_SCSI_SPC4 0x06 /* t10 (SPC-4) */
375
376 /*
377 * Defined Target Port Group Select values:
378 */
379 #define TPGS_FAILOVER_NONE 0x0
380 #define TPGS_FAILOVER_IMPLICIT 0x1
381 #define TPGS_FAILOVER_EXPLICIT 0x2
382 #define TPGS_FAILOVER_BOTH 0x3
383
384 /*
385 * VPD page code macros:
386 */
387 #define DEV_ID_VPD_PAGE_CODE 0x83 /* this page is mandatory */
388 #define USN_VPD_PAGE_CODE 0x80
389
390 /*
391 * SPC-3 revision 21c, section 7.6.4.1
392 * Table 289 -- Device Identification VPD page
393 */
394 struct vpd_hdr {
395 #if defined(_BIT_FIELDS_LTOH)
396 uchar_t device_type : 4,
397 periph_qual : 4;
398 #elif defined(_BIT_FIELDS_HTOL)
399 uchar_t periph_qual : 4,
400 device_type : 4;
401 #else
402 #error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
403 #endif
404 uchar_t page_code,
405 page_len[2];
406 };
407
408 /*
409 * SPC-3 revision 21c, section 7.6.4.1
410 * Table 290 -- Identification descriptor
|