blob: d873fad68c316f18274d8b043668d13703510465 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris5956b4e2016-07-20 12:28:56 -07007#ifndef _SCSI_PROTO_H_
8#define _SCSI_PROTO_H_
Christopher Ferris60481732015-09-17 21:22:44 -07009#include <linux/types.h>
10#define TEST_UNIT_READY 0x00
Christopher Ferris60481732015-09-17 21:22:44 -070011#define REZERO_UNIT 0x01
12#define REQUEST_SENSE 0x03
13#define FORMAT_UNIT 0x04
14#define READ_BLOCK_LIMITS 0x05
Christopher Ferris60481732015-09-17 21:22:44 -070015#define REASSIGN_BLOCKS 0x07
16#define INITIALIZE_ELEMENT_STATUS 0x07
17#define READ_6 0x08
18#define WRITE_6 0x0a
Christopher Ferris60481732015-09-17 21:22:44 -070019#define SEEK_6 0x0b
20#define READ_REVERSE 0x0f
21#define WRITE_FILEMARKS 0x10
22#define SPACE 0x11
Christopher Ferris60481732015-09-17 21:22:44 -070023#define INQUIRY 0x12
24#define RECOVER_BUFFERED_DATA 0x14
25#define MODE_SELECT 0x15
26#define RESERVE 0x16
Christopher Ferris60481732015-09-17 21:22:44 -070027#define RELEASE 0x17
28#define COPY 0x18
29#define ERASE 0x19
30#define MODE_SENSE 0x1a
Christopher Ferris60481732015-09-17 21:22:44 -070031#define START_STOP 0x1b
32#define RECEIVE_DIAGNOSTIC 0x1c
33#define SEND_DIAGNOSTIC 0x1d
34#define ALLOW_MEDIUM_REMOVAL 0x1e
Christopher Ferris60481732015-09-17 21:22:44 -070035#define READ_FORMAT_CAPACITIES 0x23
36#define SET_WINDOW 0x24
37#define READ_CAPACITY 0x25
38#define READ_10 0x28
Christopher Ferris60481732015-09-17 21:22:44 -070039#define WRITE_10 0x2a
40#define SEEK_10 0x2b
41#define POSITION_TO_ELEMENT 0x2b
42#define WRITE_VERIFY 0x2e
Christopher Ferris60481732015-09-17 21:22:44 -070043#define VERIFY 0x2f
44#define SEARCH_HIGH 0x30
45#define SEARCH_EQUAL 0x31
46#define SEARCH_LOW 0x32
Christopher Ferris60481732015-09-17 21:22:44 -070047#define SET_LIMITS 0x33
48#define PRE_FETCH 0x34
49#define READ_POSITION 0x34
50#define SYNCHRONIZE_CACHE 0x35
Christopher Ferris60481732015-09-17 21:22:44 -070051#define LOCK_UNLOCK_CACHE 0x36
52#define READ_DEFECT_DATA 0x37
53#define MEDIUM_SCAN 0x38
54#define COMPARE 0x39
Christopher Ferris60481732015-09-17 21:22:44 -070055#define COPY_VERIFY 0x3a
56#define WRITE_BUFFER 0x3b
57#define READ_BUFFER 0x3c
58#define UPDATE_BLOCK 0x3d
Christopher Ferris60481732015-09-17 21:22:44 -070059#define READ_LONG 0x3e
60#define WRITE_LONG 0x3f
61#define CHANGE_DEFINITION 0x40
62#define WRITE_SAME 0x41
Christopher Ferris60481732015-09-17 21:22:44 -070063#define UNMAP 0x42
64#define READ_TOC 0x43
65#define READ_HEADER 0x44
66#define GET_EVENT_STATUS_NOTIFICATION 0x4a
Christopher Ferris60481732015-09-17 21:22:44 -070067#define LOG_SELECT 0x4c
68#define LOG_SENSE 0x4d
69#define XDWRITEREAD_10 0x53
70#define MODE_SELECT_10 0x55
Christopher Ferris60481732015-09-17 21:22:44 -070071#define RESERVE_10 0x56
72#define RELEASE_10 0x57
73#define MODE_SENSE_10 0x5a
74#define PERSISTENT_RESERVE_IN 0x5e
Christopher Ferris60481732015-09-17 21:22:44 -070075#define PERSISTENT_RESERVE_OUT 0x5f
76#define VARIABLE_LENGTH_CMD 0x7f
77#define REPORT_LUNS 0xa0
78#define SECURITY_PROTOCOL_IN 0xa2
Christopher Ferris60481732015-09-17 21:22:44 -070079#define MAINTENANCE_IN 0xa3
80#define MAINTENANCE_OUT 0xa4
81#define MOVE_MEDIUM 0xa5
82#define EXCHANGE_MEDIUM 0xa6
Christopher Ferris60481732015-09-17 21:22:44 -070083#define READ_12 0xa8
Christopher Ferris5956b4e2016-07-20 12:28:56 -070084#define SERVICE_ACTION_OUT_12 0xa9
Christopher Ferris60481732015-09-17 21:22:44 -070085#define WRITE_12 0xaa
86#define READ_MEDIA_SERIAL_NUMBER 0xab
Christopher Ferris5956b4e2016-07-20 12:28:56 -070087#define SERVICE_ACTION_IN_12 0xab
88#define WRITE_VERIFY_12 0xae
Christopher Ferris60481732015-09-17 21:22:44 -070089#define VERIFY_12 0xaf
90#define SEARCH_HIGH_12 0xb0
91#define SEARCH_EQUAL_12 0xb1
92#define SEARCH_LOW_12 0xb2
Christopher Ferris60481732015-09-17 21:22:44 -070093#define SECURITY_PROTOCOL_OUT 0xb5
94#define READ_ELEMENT_STATUS 0xb8
95#define SEND_VOLUME_TAG 0xb6
96#define WRITE_LONG_2 0xea
Christopher Ferris60481732015-09-17 21:22:44 -070097#define EXTENDED_COPY 0x83
98#define RECEIVE_COPY_RESULTS 0x84
99#define ACCESS_CONTROL_IN 0x86
100#define ACCESS_CONTROL_OUT 0x87
Christopher Ferris60481732015-09-17 21:22:44 -0700101#define READ_16 0x88
102#define COMPARE_AND_WRITE 0x89
103#define WRITE_16 0x8a
104#define READ_ATTRIBUTE 0x8c
Christopher Ferris60481732015-09-17 21:22:44 -0700105#define WRITE_ATTRIBUTE 0x8d
Christopher Ferris525ce912017-07-26 13:12:53 -0700106#define WRITE_VERIFY_16 0x8e
Christopher Ferris60481732015-09-17 21:22:44 -0700107#define VERIFY_16 0x8f
108#define SYNCHRONIZE_CACHE_16 0x91
109#define WRITE_SAME_16 0x93
Christopher Ferris49f525c2016-12-12 14:55:36 -0800110#define ZBC_OUT 0x94
111#define ZBC_IN 0x95
Christopher Ferris5956b4e2016-07-20 12:28:56 -0700112#define SERVICE_ACTION_BIDIRECTIONAL 0x9d
113#define SERVICE_ACTION_IN_16 0x9e
Christopher Ferris5956b4e2016-07-20 12:28:56 -0700114#define SERVICE_ACTION_OUT_16 0x9f
Christopher Ferris60481732015-09-17 21:22:44 -0700115#define STATUS_MASK 0xfe
116#define NO_SENSE 0x00
117#define RECOVERED_ERROR 0x01
118#define NOT_READY 0x02
Christopher Ferris60481732015-09-17 21:22:44 -0700119#define MEDIUM_ERROR 0x03
120#define HARDWARE_ERROR 0x04
121#define ILLEGAL_REQUEST 0x05
122#define UNIT_ATTENTION 0x06
Christopher Ferris60481732015-09-17 21:22:44 -0700123#define DATA_PROTECT 0x07
124#define BLANK_CHECK 0x08
Christopher Ferris76a1d452018-06-27 14:12:29 -0700125#define VENDOR_SPECIFIC 0x09
Christopher Ferris60481732015-09-17 21:22:44 -0700126#define COPY_ABORTED 0x0a
127#define ABORTED_COMMAND 0x0b
Christopher Ferris60481732015-09-17 21:22:44 -0700128#define VOLUME_OVERFLOW 0x0d
129#define MISCOMPARE 0x0e
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800130#define COMPLETED 0x0f
Christopher Ferris60481732015-09-17 21:22:44 -0700131#define TYPE_DISK 0x00
132#define TYPE_TAPE 0x01
Christopher Ferris60481732015-09-17 21:22:44 -0700133#define TYPE_PRINTER 0x02
134#define TYPE_PROCESSOR 0x03
135#define TYPE_WORM 0x04
136#define TYPE_ROM 0x05
Christopher Ferris60481732015-09-17 21:22:44 -0700137#define TYPE_SCANNER 0x06
138#define TYPE_MOD 0x07
139#define TYPE_MEDIUM_CHANGER 0x08
140#define TYPE_COMM 0x09
Christopher Ferris60481732015-09-17 21:22:44 -0700141#define TYPE_RAID 0x0c
142#define TYPE_ENCLOSURE 0x0d
143#define TYPE_RBC 0x0e
144#define TYPE_OSD 0x11
Christopher Ferris60481732015-09-17 21:22:44 -0700145#define TYPE_ZBC 0x14
146#define TYPE_WLUN 0x1e
Christopher Ferris49f525c2016-12-12 14:55:36 -0800147#define TYPE_NO_LUN 0x7f
148#define SCSI_ACCESS_STATE_OPTIMAL 0x00
149#define SCSI_ACCESS_STATE_ACTIVE 0x01
150#define SCSI_ACCESS_STATE_STANDBY 0x02
Christopher Ferris49f525c2016-12-12 14:55:36 -0800151#define SCSI_ACCESS_STATE_UNAVAILABLE 0x03
152#define SCSI_ACCESS_STATE_LBA 0x04
153#define SCSI_ACCESS_STATE_OFFLINE 0x0e
154#define SCSI_ACCESS_STATE_TRANSITIONING 0x0f
Christopher Ferris49f525c2016-12-12 14:55:36 -0800155#define SCSI_ACCESS_STATE_MASK 0x0f
156#define SCSI_ACCESS_STATE_PREFERRED 0x80
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800157enum zbc_zone_reporting_options {
Christopher Ferris934ec942018-01-31 15:29:16 -0800158 ZBC_ZONE_REPORTING_OPTION_ALL = 0x00,
159 ZBC_ZONE_REPORTING_OPTION_EMPTY = 0x01,
160 ZBC_ZONE_REPORTING_OPTION_IMPLICIT_OPEN = 0x02,
161 ZBC_ZONE_REPORTING_OPTION_EXPLICIT_OPEN = 0x03,
162 ZBC_ZONE_REPORTING_OPTION_CLOSED = 0x04,
163 ZBC_ZONE_REPORTING_OPTION_FULL = 0x05,
164 ZBC_ZONE_REPORTING_OPTION_READONLY = 0x06,
165 ZBC_ZONE_REPORTING_OPTION_OFFLINE = 0x07,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800166 ZBC_ZONE_REPORTING_OPTION_NEED_RESET_WP = 0x10,
Christopher Ferris934ec942018-01-31 15:29:16 -0800167 ZBC_ZONE_REPORTING_OPTION_NON_SEQWRITE = 0x11,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800168 ZBC_ZONE_REPORTING_OPTION_NON_WP = 0x3f,
169};
170#define ZBC_REPORT_ZONE_PARTIAL 0x80
Christopher Ferris934ec942018-01-31 15:29:16 -0800171enum zbc_zone_type {
172 ZBC_ZONE_TYPE_CONV = 0x1,
173 ZBC_ZONE_TYPE_SEQWRITE_REQ = 0x2,
174 ZBC_ZONE_TYPE_SEQWRITE_PREF = 0x3,
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700175 ZBC_ZONE_TYPE_SEQ_OR_BEFORE_REQ = 0x4,
176 ZBC_ZONE_TYPE_GAP = 0x5,
Christopher Ferris934ec942018-01-31 15:29:16 -0800177};
178enum zbc_zone_cond {
179 ZBC_ZONE_COND_NO_WP = 0x0,
180 ZBC_ZONE_COND_EMPTY = 0x1,
181 ZBC_ZONE_COND_IMP_OPEN = 0x2,
182 ZBC_ZONE_COND_EXP_OPEN = 0x3,
183 ZBC_ZONE_COND_CLOSED = 0x4,
184 ZBC_ZONE_COND_READONLY = 0xd,
185 ZBC_ZONE_COND_FULL = 0xe,
186 ZBC_ZONE_COND_OFFLINE = 0xf,
187};
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700188enum zbc_zone_alignment_method {
189 ZBC_CONSTANT_ZONE_LENGTH = 0x1,
190 ZBC_CONSTANT_ZONE_START_OFFSET = 0x8,
191};
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000192enum scsi_version_descriptor {
193 SCSI_VERSION_DESCRIPTOR_FCP4 = 0x0a40,
194 SCSI_VERSION_DESCRIPTOR_ISCSI = 0x0960,
195 SCSI_VERSION_DESCRIPTOR_SAM5 = 0x00a0,
196 SCSI_VERSION_DESCRIPTOR_SAS3 = 0x0c60,
197 SCSI_VERSION_DESCRIPTOR_SBC3 = 0x04c0,
198 SCSI_VERSION_DESCRIPTOR_SBP3 = 0x0980,
199 SCSI_VERSION_DESCRIPTOR_SPC4 = 0x0460,
200 SCSI_VERSION_DESCRIPTOR_SRP = 0x0940
201};
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800202enum scsi_support_opcode {
203 SCSI_SUPPORT_NO_INFO = 0,
204 SCSI_SUPPORT_NOT_SUPPORTED = 1,
205 SCSI_SUPPORT_FULL = 3,
206 SCSI_SUPPORT_VENDOR = 5,
207};
208#define SCSI_CONTROL_MASK 0
209#define SCSI_GROUP_NUMBER_MASK 0
Christopher Ferris49f525c2016-12-12 14:55:36 -0800210#endif