blob: 13ac4c88dfeed2487a28a51bb943c96a518ef8a9 [file] [log] [blame]
Christopher Ferris60481732015-09-17 21:22:44 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
Christopher Ferris5956b4e2016-07-20 12:28:56 -070019#ifndef _SCSI_PROTO_H_
20#define _SCSI_PROTO_H_
Christopher Ferris60481732015-09-17 21:22:44 -070021#include <linux/types.h>
22#define TEST_UNIT_READY 0x00
Christopher Ferris60481732015-09-17 21:22:44 -070023#define REZERO_UNIT 0x01
24#define REQUEST_SENSE 0x03
25#define FORMAT_UNIT 0x04
26#define READ_BLOCK_LIMITS 0x05
Christopher Ferris60481732015-09-17 21:22:44 -070027#define REASSIGN_BLOCKS 0x07
28#define INITIALIZE_ELEMENT_STATUS 0x07
29#define READ_6 0x08
30#define WRITE_6 0x0a
Christopher Ferris60481732015-09-17 21:22:44 -070031#define SEEK_6 0x0b
32#define READ_REVERSE 0x0f
33#define WRITE_FILEMARKS 0x10
34#define SPACE 0x11
Christopher Ferris60481732015-09-17 21:22:44 -070035#define INQUIRY 0x12
36#define RECOVER_BUFFERED_DATA 0x14
37#define MODE_SELECT 0x15
38#define RESERVE 0x16
Christopher Ferris60481732015-09-17 21:22:44 -070039#define RELEASE 0x17
40#define COPY 0x18
41#define ERASE 0x19
42#define MODE_SENSE 0x1a
Christopher Ferris60481732015-09-17 21:22:44 -070043#define START_STOP 0x1b
44#define RECEIVE_DIAGNOSTIC 0x1c
45#define SEND_DIAGNOSTIC 0x1d
46#define ALLOW_MEDIUM_REMOVAL 0x1e
Christopher Ferris60481732015-09-17 21:22:44 -070047#define READ_FORMAT_CAPACITIES 0x23
48#define SET_WINDOW 0x24
49#define READ_CAPACITY 0x25
50#define READ_10 0x28
Christopher Ferris60481732015-09-17 21:22:44 -070051#define WRITE_10 0x2a
52#define SEEK_10 0x2b
53#define POSITION_TO_ELEMENT 0x2b
54#define WRITE_VERIFY 0x2e
Christopher Ferris60481732015-09-17 21:22:44 -070055#define VERIFY 0x2f
56#define SEARCH_HIGH 0x30
57#define SEARCH_EQUAL 0x31
58#define SEARCH_LOW 0x32
Christopher Ferris60481732015-09-17 21:22:44 -070059#define SET_LIMITS 0x33
60#define PRE_FETCH 0x34
61#define READ_POSITION 0x34
62#define SYNCHRONIZE_CACHE 0x35
Christopher Ferris60481732015-09-17 21:22:44 -070063#define LOCK_UNLOCK_CACHE 0x36
64#define READ_DEFECT_DATA 0x37
65#define MEDIUM_SCAN 0x38
66#define COMPARE 0x39
Christopher Ferris60481732015-09-17 21:22:44 -070067#define COPY_VERIFY 0x3a
68#define WRITE_BUFFER 0x3b
69#define READ_BUFFER 0x3c
70#define UPDATE_BLOCK 0x3d
Christopher Ferris60481732015-09-17 21:22:44 -070071#define READ_LONG 0x3e
72#define WRITE_LONG 0x3f
73#define CHANGE_DEFINITION 0x40
74#define WRITE_SAME 0x41
Christopher Ferris60481732015-09-17 21:22:44 -070075#define UNMAP 0x42
76#define READ_TOC 0x43
77#define READ_HEADER 0x44
78#define GET_EVENT_STATUS_NOTIFICATION 0x4a
Christopher Ferris60481732015-09-17 21:22:44 -070079#define LOG_SELECT 0x4c
80#define LOG_SENSE 0x4d
81#define XDWRITEREAD_10 0x53
82#define MODE_SELECT_10 0x55
Christopher Ferris60481732015-09-17 21:22:44 -070083#define RESERVE_10 0x56
84#define RELEASE_10 0x57
85#define MODE_SENSE_10 0x5a
86#define PERSISTENT_RESERVE_IN 0x5e
Christopher Ferris60481732015-09-17 21:22:44 -070087#define PERSISTENT_RESERVE_OUT 0x5f
88#define VARIABLE_LENGTH_CMD 0x7f
89#define REPORT_LUNS 0xa0
90#define SECURITY_PROTOCOL_IN 0xa2
Christopher Ferris60481732015-09-17 21:22:44 -070091#define MAINTENANCE_IN 0xa3
92#define MAINTENANCE_OUT 0xa4
93#define MOVE_MEDIUM 0xa5
94#define EXCHANGE_MEDIUM 0xa6
Christopher Ferris60481732015-09-17 21:22:44 -070095#define READ_12 0xa8
Christopher Ferris5956b4e2016-07-20 12:28:56 -070096#define SERVICE_ACTION_OUT_12 0xa9
Christopher Ferris60481732015-09-17 21:22:44 -070097#define WRITE_12 0xaa
98#define READ_MEDIA_SERIAL_NUMBER 0xab
Christopher Ferris5956b4e2016-07-20 12:28:56 -070099#define SERVICE_ACTION_IN_12 0xab
100#define WRITE_VERIFY_12 0xae
Christopher Ferris60481732015-09-17 21:22:44 -0700101#define VERIFY_12 0xaf
102#define SEARCH_HIGH_12 0xb0
103#define SEARCH_EQUAL_12 0xb1
104#define SEARCH_LOW_12 0xb2
Christopher Ferris60481732015-09-17 21:22:44 -0700105#define SECURITY_PROTOCOL_OUT 0xb5
106#define READ_ELEMENT_STATUS 0xb8
107#define SEND_VOLUME_TAG 0xb6
108#define WRITE_LONG_2 0xea
Christopher Ferris60481732015-09-17 21:22:44 -0700109#define EXTENDED_COPY 0x83
110#define RECEIVE_COPY_RESULTS 0x84
111#define ACCESS_CONTROL_IN 0x86
112#define ACCESS_CONTROL_OUT 0x87
Christopher Ferris60481732015-09-17 21:22:44 -0700113#define READ_16 0x88
114#define COMPARE_AND_WRITE 0x89
115#define WRITE_16 0x8a
116#define READ_ATTRIBUTE 0x8c
Christopher Ferris60481732015-09-17 21:22:44 -0700117#define WRITE_ATTRIBUTE 0x8d
Christopher Ferris525ce912017-07-26 13:12:53 -0700118#define WRITE_VERIFY_16 0x8e
Christopher Ferris60481732015-09-17 21:22:44 -0700119#define VERIFY_16 0x8f
120#define SYNCHRONIZE_CACHE_16 0x91
121#define WRITE_SAME_16 0x93
Christopher Ferris49f525c2016-12-12 14:55:36 -0800122#define ZBC_OUT 0x94
123#define ZBC_IN 0x95
Christopher Ferris5956b4e2016-07-20 12:28:56 -0700124#define SERVICE_ACTION_BIDIRECTIONAL 0x9d
125#define SERVICE_ACTION_IN_16 0x9e
Christopher Ferris5956b4e2016-07-20 12:28:56 -0700126#define SERVICE_ACTION_OUT_16 0x9f
Christopher Ferris60481732015-09-17 21:22:44 -0700127#define STATUS_MASK 0xfe
128#define NO_SENSE 0x00
129#define RECOVERED_ERROR 0x01
130#define NOT_READY 0x02
Christopher Ferris60481732015-09-17 21:22:44 -0700131#define MEDIUM_ERROR 0x03
132#define HARDWARE_ERROR 0x04
133#define ILLEGAL_REQUEST 0x05
134#define UNIT_ATTENTION 0x06
Christopher Ferris60481732015-09-17 21:22:44 -0700135#define DATA_PROTECT 0x07
136#define BLANK_CHECK 0x08
Christopher Ferris76a1d452018-06-27 14:12:29 -0700137#define VENDOR_SPECIFIC 0x09
Christopher Ferris60481732015-09-17 21:22:44 -0700138#define COPY_ABORTED 0x0a
139#define ABORTED_COMMAND 0x0b
Christopher Ferris60481732015-09-17 21:22:44 -0700140#define VOLUME_OVERFLOW 0x0d
141#define MISCOMPARE 0x0e
142#define TYPE_DISK 0x00
143#define TYPE_TAPE 0x01
Christopher Ferris60481732015-09-17 21:22:44 -0700144#define TYPE_PRINTER 0x02
145#define TYPE_PROCESSOR 0x03
146#define TYPE_WORM 0x04
147#define TYPE_ROM 0x05
Christopher Ferris60481732015-09-17 21:22:44 -0700148#define TYPE_SCANNER 0x06
149#define TYPE_MOD 0x07
150#define TYPE_MEDIUM_CHANGER 0x08
151#define TYPE_COMM 0x09
Christopher Ferris60481732015-09-17 21:22:44 -0700152#define TYPE_RAID 0x0c
153#define TYPE_ENCLOSURE 0x0d
154#define TYPE_RBC 0x0e
155#define TYPE_OSD 0x11
Christopher Ferris60481732015-09-17 21:22:44 -0700156#define TYPE_ZBC 0x14
157#define TYPE_WLUN 0x1e
Christopher Ferris49f525c2016-12-12 14:55:36 -0800158#define TYPE_NO_LUN 0x7f
159#define SCSI_ACCESS_STATE_OPTIMAL 0x00
160#define SCSI_ACCESS_STATE_ACTIVE 0x01
161#define SCSI_ACCESS_STATE_STANDBY 0x02
Christopher Ferris49f525c2016-12-12 14:55:36 -0800162#define SCSI_ACCESS_STATE_UNAVAILABLE 0x03
163#define SCSI_ACCESS_STATE_LBA 0x04
164#define SCSI_ACCESS_STATE_OFFLINE 0x0e
165#define SCSI_ACCESS_STATE_TRANSITIONING 0x0f
Christopher Ferris49f525c2016-12-12 14:55:36 -0800166#define SCSI_ACCESS_STATE_MASK 0x0f
167#define SCSI_ACCESS_STATE_PREFERRED 0x80
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800168enum zbc_zone_reporting_options {
Christopher Ferris934ec942018-01-31 15:29:16 -0800169 ZBC_ZONE_REPORTING_OPTION_ALL = 0x00,
170 ZBC_ZONE_REPORTING_OPTION_EMPTY = 0x01,
171 ZBC_ZONE_REPORTING_OPTION_IMPLICIT_OPEN = 0x02,
172 ZBC_ZONE_REPORTING_OPTION_EXPLICIT_OPEN = 0x03,
173 ZBC_ZONE_REPORTING_OPTION_CLOSED = 0x04,
174 ZBC_ZONE_REPORTING_OPTION_FULL = 0x05,
175 ZBC_ZONE_REPORTING_OPTION_READONLY = 0x06,
176 ZBC_ZONE_REPORTING_OPTION_OFFLINE = 0x07,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800177 ZBC_ZONE_REPORTING_OPTION_NEED_RESET_WP = 0x10,
Christopher Ferris934ec942018-01-31 15:29:16 -0800178 ZBC_ZONE_REPORTING_OPTION_NON_SEQWRITE = 0x11,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800179 ZBC_ZONE_REPORTING_OPTION_NON_WP = 0x3f,
180};
181#define ZBC_REPORT_ZONE_PARTIAL 0x80
Christopher Ferris934ec942018-01-31 15:29:16 -0800182enum zbc_zone_type {
183 ZBC_ZONE_TYPE_CONV = 0x1,
184 ZBC_ZONE_TYPE_SEQWRITE_REQ = 0x2,
185 ZBC_ZONE_TYPE_SEQWRITE_PREF = 0x3,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700186 ZBC_ZONE_TYPE_SEQ_OR_BEFORE_REQ = 0x4,
187 ZBC_ZONE_TYPE_GAP = 0x5,
Christopher Ferris934ec942018-01-31 15:29:16 -0800188};
189enum zbc_zone_cond {
190 ZBC_ZONE_COND_NO_WP = 0x0,
191 ZBC_ZONE_COND_EMPTY = 0x1,
192 ZBC_ZONE_COND_IMP_OPEN = 0x2,
193 ZBC_ZONE_COND_EXP_OPEN = 0x3,
194 ZBC_ZONE_COND_CLOSED = 0x4,
195 ZBC_ZONE_COND_READONLY = 0xd,
196 ZBC_ZONE_COND_FULL = 0xe,
197 ZBC_ZONE_COND_OFFLINE = 0xf,
198};
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700199enum zbc_zone_alignment_method {
200 ZBC_CONSTANT_ZONE_LENGTH = 0x1,
201 ZBC_CONSTANT_ZONE_START_OFFSET = 0x8,
202};
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000203enum scsi_version_descriptor {
204 SCSI_VERSION_DESCRIPTOR_FCP4 = 0x0a40,
205 SCSI_VERSION_DESCRIPTOR_ISCSI = 0x0960,
206 SCSI_VERSION_DESCRIPTOR_SAM5 = 0x00a0,
207 SCSI_VERSION_DESCRIPTOR_SAS3 = 0x0c60,
208 SCSI_VERSION_DESCRIPTOR_SBC3 = 0x04c0,
209 SCSI_VERSION_DESCRIPTOR_SBP3 = 0x0980,
210 SCSI_VERSION_DESCRIPTOR_SPC4 = 0x0460,
211 SCSI_VERSION_DESCRIPTOR_SRP = 0x0940
212};
Christopher Ferris49f525c2016-12-12 14:55:36 -0800213#endif