1 /****************************************************************************
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  ****************************************************************************/
19 #ifndef _SCSI_PROTO_H_
20 #define _SCSI_PROTO_H_
21 #include <linux/types.h>
22 #define TEST_UNIT_READY 0x00
23 #define REZERO_UNIT 0x01
24 #define REQUEST_SENSE 0x03
25 #define FORMAT_UNIT 0x04
26 #define READ_BLOCK_LIMITS 0x05
27 #define REASSIGN_BLOCKS 0x07
28 #define INITIALIZE_ELEMENT_STATUS 0x07
29 #define READ_6 0x08
30 #define WRITE_6 0x0a
31 #define SEEK_6 0x0b
32 #define READ_REVERSE 0x0f
33 #define WRITE_FILEMARKS 0x10
34 #define SPACE 0x11
35 #define INQUIRY 0x12
36 #define RECOVER_BUFFERED_DATA 0x14
37 #define MODE_SELECT 0x15
38 #define RESERVE 0x16
39 #define RELEASE 0x17
40 #define COPY 0x18
41 #define ERASE 0x19
42 #define MODE_SENSE 0x1a
43 #define START_STOP 0x1b
44 #define RECEIVE_DIAGNOSTIC 0x1c
45 #define SEND_DIAGNOSTIC 0x1d
46 #define ALLOW_MEDIUM_REMOVAL 0x1e
47 #define READ_FORMAT_CAPACITIES 0x23
48 #define SET_WINDOW 0x24
49 #define READ_CAPACITY 0x25
50 #define READ_10 0x28
51 #define WRITE_10 0x2a
52 #define SEEK_10 0x2b
53 #define POSITION_TO_ELEMENT 0x2b
54 #define WRITE_VERIFY 0x2e
55 #define VERIFY 0x2f
56 #define SEARCH_HIGH 0x30
57 #define SEARCH_EQUAL 0x31
58 #define SEARCH_LOW 0x32
59 #define SET_LIMITS 0x33
60 #define PRE_FETCH 0x34
61 #define READ_POSITION 0x34
62 #define SYNCHRONIZE_CACHE 0x35
63 #define LOCK_UNLOCK_CACHE 0x36
64 #define READ_DEFECT_DATA 0x37
65 #define MEDIUM_SCAN 0x38
66 #define COMPARE 0x39
67 #define COPY_VERIFY 0x3a
68 #define WRITE_BUFFER 0x3b
69 #define READ_BUFFER 0x3c
70 #define UPDATE_BLOCK 0x3d
71 #define READ_LONG 0x3e
72 #define WRITE_LONG 0x3f
73 #define CHANGE_DEFINITION 0x40
74 #define WRITE_SAME 0x41
75 #define UNMAP 0x42
76 #define READ_TOC 0x43
77 #define READ_HEADER 0x44
78 #define GET_EVENT_STATUS_NOTIFICATION 0x4a
79 #define LOG_SELECT 0x4c
80 #define LOG_SENSE 0x4d
81 #define XDWRITEREAD_10 0x53
82 #define MODE_SELECT_10 0x55
83 #define RESERVE_10 0x56
84 #define RELEASE_10 0x57
85 #define MODE_SENSE_10 0x5a
86 #define PERSISTENT_RESERVE_IN 0x5e
87 #define PERSISTENT_RESERVE_OUT 0x5f
88 #define VARIABLE_LENGTH_CMD 0x7f
89 #define REPORT_LUNS 0xa0
90 #define SECURITY_PROTOCOL_IN 0xa2
91 #define MAINTENANCE_IN 0xa3
92 #define MAINTENANCE_OUT 0xa4
93 #define MOVE_MEDIUM 0xa5
94 #define EXCHANGE_MEDIUM 0xa6
95 #define READ_12 0xa8
96 #define SERVICE_ACTION_OUT_12 0xa9
97 #define WRITE_12 0xaa
98 #define READ_MEDIA_SERIAL_NUMBER 0xab
99 #define SERVICE_ACTION_IN_12 0xab
100 #define WRITE_VERIFY_12 0xae
101 #define VERIFY_12 0xaf
102 #define SEARCH_HIGH_12 0xb0
103 #define SEARCH_EQUAL_12 0xb1
104 #define SEARCH_LOW_12 0xb2
105 #define SECURITY_PROTOCOL_OUT 0xb5
106 #define READ_ELEMENT_STATUS 0xb8
107 #define SEND_VOLUME_TAG 0xb6
108 #define WRITE_LONG_2 0xea
109 #define EXTENDED_COPY 0x83
110 #define RECEIVE_COPY_RESULTS 0x84
111 #define ACCESS_CONTROL_IN 0x86
112 #define ACCESS_CONTROL_OUT 0x87
113 #define READ_16 0x88
114 #define COMPARE_AND_WRITE 0x89
115 #define WRITE_16 0x8a
116 #define READ_ATTRIBUTE 0x8c
117 #define WRITE_ATTRIBUTE 0x8d
118 #define WRITE_VERIFY_16 0x8e
119 #define VERIFY_16 0x8f
120 #define SYNCHRONIZE_CACHE_16 0x91
121 #define WRITE_SAME_16 0x93
122 #define ZBC_OUT 0x94
123 #define ZBC_IN 0x95
124 #define SERVICE_ACTION_BIDIRECTIONAL 0x9d
125 #define SERVICE_ACTION_IN_16 0x9e
126 #define SERVICE_ACTION_OUT_16 0x9f
127 #define GOOD 0x00
128 #define CHECK_CONDITION 0x01
129 #define CONDITION_GOOD 0x02
130 #define BUSY 0x04
131 #define INTERMEDIATE_GOOD 0x08
132 #define INTERMEDIATE_C_GOOD 0x0a
133 #define RESERVATION_CONFLICT 0x0c
134 #define COMMAND_TERMINATED 0x11
135 #define QUEUE_FULL 0x14
136 #define ACA_ACTIVE 0x18
137 #define TASK_ABORTED 0x20
138 #define STATUS_MASK 0xfe
139 #define NO_SENSE 0x00
140 #define RECOVERED_ERROR 0x01
141 #define NOT_READY 0x02
142 #define MEDIUM_ERROR 0x03
143 #define HARDWARE_ERROR 0x04
144 #define ILLEGAL_REQUEST 0x05
145 #define UNIT_ATTENTION 0x06
146 #define DATA_PROTECT 0x07
147 #define BLANK_CHECK 0x08
148 #define VENDOR_SPECIFIC 0x09
149 #define COPY_ABORTED 0x0a
150 #define ABORTED_COMMAND 0x0b
151 #define VOLUME_OVERFLOW 0x0d
152 #define MISCOMPARE 0x0e
153 #define TYPE_DISK 0x00
154 #define TYPE_TAPE 0x01
155 #define TYPE_PRINTER 0x02
156 #define TYPE_PROCESSOR 0x03
157 #define TYPE_WORM 0x04
158 #define TYPE_ROM 0x05
159 #define TYPE_SCANNER 0x06
160 #define TYPE_MOD 0x07
161 #define TYPE_MEDIUM_CHANGER 0x08
162 #define TYPE_COMM 0x09
163 #define TYPE_RAID 0x0c
164 #define TYPE_ENCLOSURE 0x0d
165 #define TYPE_RBC 0x0e
166 #define TYPE_OSD 0x11
167 #define TYPE_ZBC 0x14
168 #define TYPE_WLUN 0x1e
169 #define TYPE_NO_LUN 0x7f
170 #define SCSI_ACCESS_STATE_OPTIMAL 0x00
171 #define SCSI_ACCESS_STATE_ACTIVE 0x01
172 #define SCSI_ACCESS_STATE_STANDBY 0x02
173 #define SCSI_ACCESS_STATE_UNAVAILABLE 0x03
174 #define SCSI_ACCESS_STATE_LBA 0x04
175 #define SCSI_ACCESS_STATE_OFFLINE 0x0e
176 #define SCSI_ACCESS_STATE_TRANSITIONING 0x0f
177 #define SCSI_ACCESS_STATE_MASK 0x0f
178 #define SCSI_ACCESS_STATE_PREFERRED 0x80
179 enum zbc_zone_reporting_options {
180   ZBC_ZONE_REPORTING_OPTION_ALL = 0x00,
181   ZBC_ZONE_REPORTING_OPTION_EMPTY = 0x01,
182   ZBC_ZONE_REPORTING_OPTION_IMPLICIT_OPEN = 0x02,
183   ZBC_ZONE_REPORTING_OPTION_EXPLICIT_OPEN = 0x03,
184   ZBC_ZONE_REPORTING_OPTION_CLOSED = 0x04,
185   ZBC_ZONE_REPORTING_OPTION_FULL = 0x05,
186   ZBC_ZONE_REPORTING_OPTION_READONLY = 0x06,
187   ZBC_ZONE_REPORTING_OPTION_OFFLINE = 0x07,
188   ZBC_ZONE_REPORTING_OPTION_NEED_RESET_WP = 0x10,
189   ZBC_ZONE_REPORTING_OPTION_NON_SEQWRITE = 0x11,
190   ZBC_ZONE_REPORTING_OPTION_NON_WP = 0x3f,
191 };
192 #define ZBC_REPORT_ZONE_PARTIAL 0x80
193 enum zbc_zone_type {
194   ZBC_ZONE_TYPE_CONV = 0x1,
195   ZBC_ZONE_TYPE_SEQWRITE_REQ = 0x2,
196   ZBC_ZONE_TYPE_SEQWRITE_PREF = 0x3,
197 };
198 enum zbc_zone_cond {
199   ZBC_ZONE_COND_NO_WP = 0x0,
200   ZBC_ZONE_COND_EMPTY = 0x1,
201   ZBC_ZONE_COND_IMP_OPEN = 0x2,
202   ZBC_ZONE_COND_EXP_OPEN = 0x3,
203   ZBC_ZONE_COND_CLOSED = 0x4,
204   ZBC_ZONE_COND_READONLY = 0xd,
205   ZBC_ZONE_COND_FULL = 0xe,
206   ZBC_ZONE_COND_OFFLINE = 0xf,
207 };
208 #endif
209