1 /* $NetBSD: scsipi_disk.h,v 1.20 2007/07/01 05:17:28 tsutsui Exp $ */
4 * SCSI and SCSI-like interfaces description
8 * Some lines of this file come from a file of the name "scsi.h"
9 * distributed by OSF as part of mach2.5,
10 * so the following disclaimer has been kept.
12 * Copyright 1990 by Open Software Foundation,
17 * Permission to use, copy, modify, and distribute this software and
18 * its documentation for any purpose and without fee is hereby granted,
19 * provided that the above copyright notice appears in all copies and
20 * that both the copyright notice and this permission notice appear in
21 * supporting documentation, and that the name of OSF or Open Software
22 * Foundation not be used in advertising or publicity pertaining to
23 * distribution of the software without specific, written prior
26 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
27 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
28 * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
29 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
30 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
31 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
32 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
36 * Largely written by Julian Elischer (julian@tfs.com)
37 * for TRW Financial Systems.
39 * TRW Financial Systems, in accordance with their agreement with Carnegie
40 * Mellon University, makes this software available to CMU to distribute
41 * or use in any manner that they see fit as long as this message is kept with
42 * the software. For this reason TFS also grants any other persons or
43 * organisations permission to use or modify this software.
45 * TFS supplies this software to be publicly redistributed
46 * on the understanding that TFS is not responsible for the correct
47 * functioning of this software in any circumstances.
49 * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
52 #ifndef _DEV_SCSIPI_SCSIPI_DISK_H_
53 #define _DEV_SCSIPI_SCSIPI_DISK_H_
64 #define SRWB_RELADDR 0x01 /* obsolete */
65 #define SRWB_FUA_NV 0x02 /* force unit access non-volatile cache */
66 #define SRWB_FUA 0x08 /* force unit access */
67 #define SRWB_DPO 0x10 /* disable page out */
68 #define SRWB_PROTECT(x) ((x) << 5)
79 u_int8_t byte2
; /* see scsipi_rw_big bits */
90 u_int8_t byte2
; /* see scsipi_rw_big bits */
97 #define READ_CAPACITY_10 0x25
98 struct scsipi_read_capacity_10
{
106 /* DATAs definitions for the above commands */
108 struct scsipi_read_capacity_10_data
{
113 #define READ_CAPACITY_16 0x9e /* really SERVICE ACTION IN */
114 struct scsipi_read_capacity_16
{
117 #define SRC16_SERVICE_ACTION 0x10
121 #define SRC16_PMI 0x01
125 struct scsipi_read_capacity_16_data
{
129 #define SRC16D_PROT_EN 0x01
130 #define SRC16D_RTO_EN 0x02
131 u_int8_t reserved
[19];
134 /* XXX SBC-2 says this is vendor-specific */
135 #define READ_FORMAT_CAPACITIES 0x23
136 struct scsipi_read_format_capacities
{
139 u_int8_t reserved1
[5];
141 u_int8_t reserved2
[3];
144 struct scsipi_capacity_list_header
{
145 u_int8_t reserved
[3];
149 struct scsipi_capacity_descriptor
{
155 /* codes only valid in the current/maximum capacity descriptor */
156 #define SCSIPI_CAP_DESC_CODE_MASK 0x3
157 #define SCSIPI_CAP_DESC_CODE_RESERVED 0x0
158 #define SCSIPI_CAP_DESC_CODE_UNFORMATTED 0x1
159 #define SCSIPI_CAP_DESC_CODE_FORMATTED 0x2
160 #define SCSIPI_CAP_DESC_CODE_NONE 0x3
162 #endif /* _DEV_SCSIPI_SCSIPI_DISK_H_ */