Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 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 Ferris | 5956b4e | 2016-07-20 12:28:56 -0700 | [diff] [blame] | 7 | #ifndef _SCSI_PROTO_H_ |
| 8 | #define _SCSI_PROTO_H_ |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 9 | #include <linux/types.h> |
| 10 | #define TEST_UNIT_READY 0x00 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 11 | #define REZERO_UNIT 0x01 |
| 12 | #define REQUEST_SENSE 0x03 |
| 13 | #define FORMAT_UNIT 0x04 |
| 14 | #define READ_BLOCK_LIMITS 0x05 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 15 | #define REASSIGN_BLOCKS 0x07 |
| 16 | #define INITIALIZE_ELEMENT_STATUS 0x07 |
| 17 | #define READ_6 0x08 |
| 18 | #define WRITE_6 0x0a |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 19 | #define SEEK_6 0x0b |
| 20 | #define READ_REVERSE 0x0f |
| 21 | #define WRITE_FILEMARKS 0x10 |
| 22 | #define SPACE 0x11 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 23 | #define INQUIRY 0x12 |
| 24 | #define RECOVER_BUFFERED_DATA 0x14 |
| 25 | #define MODE_SELECT 0x15 |
| 26 | #define RESERVE 0x16 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 27 | #define RELEASE 0x17 |
| 28 | #define COPY 0x18 |
| 29 | #define ERASE 0x19 |
| 30 | #define MODE_SENSE 0x1a |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 31 | #define START_STOP 0x1b |
| 32 | #define RECEIVE_DIAGNOSTIC 0x1c |
| 33 | #define SEND_DIAGNOSTIC 0x1d |
| 34 | #define ALLOW_MEDIUM_REMOVAL 0x1e |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 35 | #define READ_FORMAT_CAPACITIES 0x23 |
| 36 | #define SET_WINDOW 0x24 |
| 37 | #define READ_CAPACITY 0x25 |
| 38 | #define READ_10 0x28 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 39 | #define WRITE_10 0x2a |
| 40 | #define SEEK_10 0x2b |
| 41 | #define POSITION_TO_ELEMENT 0x2b |
| 42 | #define WRITE_VERIFY 0x2e |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 43 | #define VERIFY 0x2f |
| 44 | #define SEARCH_HIGH 0x30 |
| 45 | #define SEARCH_EQUAL 0x31 |
| 46 | #define SEARCH_LOW 0x32 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 47 | #define SET_LIMITS 0x33 |
| 48 | #define PRE_FETCH 0x34 |
| 49 | #define READ_POSITION 0x34 |
| 50 | #define SYNCHRONIZE_CACHE 0x35 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 51 | #define LOCK_UNLOCK_CACHE 0x36 |
| 52 | #define READ_DEFECT_DATA 0x37 |
| 53 | #define MEDIUM_SCAN 0x38 |
| 54 | #define COMPARE 0x39 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 55 | #define COPY_VERIFY 0x3a |
| 56 | #define WRITE_BUFFER 0x3b |
| 57 | #define READ_BUFFER 0x3c |
| 58 | #define UPDATE_BLOCK 0x3d |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 59 | #define READ_LONG 0x3e |
| 60 | #define WRITE_LONG 0x3f |
| 61 | #define CHANGE_DEFINITION 0x40 |
| 62 | #define WRITE_SAME 0x41 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 63 | #define UNMAP 0x42 |
| 64 | #define READ_TOC 0x43 |
| 65 | #define READ_HEADER 0x44 |
| 66 | #define GET_EVENT_STATUS_NOTIFICATION 0x4a |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 67 | #define LOG_SELECT 0x4c |
| 68 | #define LOG_SENSE 0x4d |
| 69 | #define XDWRITEREAD_10 0x53 |
| 70 | #define MODE_SELECT_10 0x55 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 71 | #define RESERVE_10 0x56 |
| 72 | #define RELEASE_10 0x57 |
| 73 | #define MODE_SENSE_10 0x5a |
| 74 | #define PERSISTENT_RESERVE_IN 0x5e |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 75 | #define PERSISTENT_RESERVE_OUT 0x5f |
| 76 | #define VARIABLE_LENGTH_CMD 0x7f |
| 77 | #define REPORT_LUNS 0xa0 |
| 78 | #define SECURITY_PROTOCOL_IN 0xa2 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 79 | #define MAINTENANCE_IN 0xa3 |
| 80 | #define MAINTENANCE_OUT 0xa4 |
| 81 | #define MOVE_MEDIUM 0xa5 |
| 82 | #define EXCHANGE_MEDIUM 0xa6 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 83 | #define READ_12 0xa8 |
Christopher Ferris | 5956b4e | 2016-07-20 12:28:56 -0700 | [diff] [blame] | 84 | #define SERVICE_ACTION_OUT_12 0xa9 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 85 | #define WRITE_12 0xaa |
| 86 | #define READ_MEDIA_SERIAL_NUMBER 0xab |
Christopher Ferris | 5956b4e | 2016-07-20 12:28:56 -0700 | [diff] [blame] | 87 | #define SERVICE_ACTION_IN_12 0xab |
| 88 | #define WRITE_VERIFY_12 0xae |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 89 | #define VERIFY_12 0xaf |
| 90 | #define SEARCH_HIGH_12 0xb0 |
| 91 | #define SEARCH_EQUAL_12 0xb1 |
| 92 | #define SEARCH_LOW_12 0xb2 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 93 | #define SECURITY_PROTOCOL_OUT 0xb5 |
| 94 | #define READ_ELEMENT_STATUS 0xb8 |
| 95 | #define SEND_VOLUME_TAG 0xb6 |
| 96 | #define WRITE_LONG_2 0xea |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 97 | #define EXTENDED_COPY 0x83 |
| 98 | #define RECEIVE_COPY_RESULTS 0x84 |
| 99 | #define ACCESS_CONTROL_IN 0x86 |
| 100 | #define ACCESS_CONTROL_OUT 0x87 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 101 | #define READ_16 0x88 |
| 102 | #define COMPARE_AND_WRITE 0x89 |
| 103 | #define WRITE_16 0x8a |
| 104 | #define READ_ATTRIBUTE 0x8c |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 105 | #define WRITE_ATTRIBUTE 0x8d |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 106 | #define WRITE_VERIFY_16 0x8e |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 107 | #define VERIFY_16 0x8f |
| 108 | #define SYNCHRONIZE_CACHE_16 0x91 |
| 109 | #define WRITE_SAME_16 0x93 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 110 | #define ZBC_OUT 0x94 |
| 111 | #define ZBC_IN 0x95 |
Christopher Ferris | 5956b4e | 2016-07-20 12:28:56 -0700 | [diff] [blame] | 112 | #define SERVICE_ACTION_BIDIRECTIONAL 0x9d |
| 113 | #define SERVICE_ACTION_IN_16 0x9e |
Christopher Ferris | 5956b4e | 2016-07-20 12:28:56 -0700 | [diff] [blame] | 114 | #define SERVICE_ACTION_OUT_16 0x9f |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 115 | #define STATUS_MASK 0xfe |
| 116 | #define NO_SENSE 0x00 |
| 117 | #define RECOVERED_ERROR 0x01 |
| 118 | #define NOT_READY 0x02 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 119 | #define MEDIUM_ERROR 0x03 |
| 120 | #define HARDWARE_ERROR 0x04 |
| 121 | #define ILLEGAL_REQUEST 0x05 |
| 122 | #define UNIT_ATTENTION 0x06 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 123 | #define DATA_PROTECT 0x07 |
| 124 | #define BLANK_CHECK 0x08 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 125 | #define VENDOR_SPECIFIC 0x09 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 126 | #define COPY_ABORTED 0x0a |
| 127 | #define ABORTED_COMMAND 0x0b |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 128 | #define VOLUME_OVERFLOW 0x0d |
| 129 | #define MISCOMPARE 0x0e |
Christopher Ferris | 8b7fdc9 | 2023-02-21 13:36:32 -0800 | [diff] [blame] | 130 | #define COMPLETED 0x0f |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 131 | #define TYPE_DISK 0x00 |
| 132 | #define TYPE_TAPE 0x01 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 133 | #define TYPE_PRINTER 0x02 |
| 134 | #define TYPE_PROCESSOR 0x03 |
| 135 | #define TYPE_WORM 0x04 |
| 136 | #define TYPE_ROM 0x05 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 137 | #define TYPE_SCANNER 0x06 |
| 138 | #define TYPE_MOD 0x07 |
| 139 | #define TYPE_MEDIUM_CHANGER 0x08 |
| 140 | #define TYPE_COMM 0x09 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 141 | #define TYPE_RAID 0x0c |
| 142 | #define TYPE_ENCLOSURE 0x0d |
| 143 | #define TYPE_RBC 0x0e |
| 144 | #define TYPE_OSD 0x11 |
Christopher Ferris | 6048173 | 2015-09-17 21:22:44 -0700 | [diff] [blame] | 145 | #define TYPE_ZBC 0x14 |
| 146 | #define TYPE_WLUN 0x1e |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 147 | #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 Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 151 | #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 Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 155 | #define SCSI_ACCESS_STATE_MASK 0x0f |
| 156 | #define SCSI_ACCESS_STATE_PREFERRED 0x80 |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 157 | enum zbc_zone_reporting_options { |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 158 | 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 Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 166 | ZBC_ZONE_REPORTING_OPTION_NEED_RESET_WP = 0x10, |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 167 | ZBC_ZONE_REPORTING_OPTION_NON_SEQWRITE = 0x11, |
Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 168 | ZBC_ZONE_REPORTING_OPTION_NON_WP = 0x3f, |
| 169 | }; |
| 170 | #define ZBC_REPORT_ZONE_PARTIAL 0x80 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 171 | enum zbc_zone_type { |
| 172 | ZBC_ZONE_TYPE_CONV = 0x1, |
| 173 | ZBC_ZONE_TYPE_SEQWRITE_REQ = 0x2, |
| 174 | ZBC_ZONE_TYPE_SEQWRITE_PREF = 0x3, |
Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 175 | ZBC_ZONE_TYPE_SEQ_OR_BEFORE_REQ = 0x4, |
| 176 | ZBC_ZONE_TYPE_GAP = 0x5, |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 177 | }; |
| 178 | enum 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 Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 188 | enum zbc_zone_alignment_method { |
| 189 | ZBC_CONSTANT_ZONE_LENGTH = 0x1, |
| 190 | ZBC_CONSTANT_ZONE_START_OFFSET = 0x8, |
| 191 | }; |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 192 | enum 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 Ferris | 8b7fdc9 | 2023-02-21 13:36:32 -0800 | [diff] [blame] | 202 | enum 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 Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 210 | #endif |