1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2c5f1ac8bSBart Van Assche /* 3c5f1ac8bSBart Van Assche * This header file contains public constants and structures used by 4c5f1ac8bSBart Van Assche * both the SCSI initiator and the SCSI target code. 5c5f1ac8bSBart Van Assche * 6c5f1ac8bSBart Van Assche * For documentation on the OPCODES, MESSAGES, and SENSE values, 7c5f1ac8bSBart Van Assche * please consult the SCSI standard. 8c5f1ac8bSBart Van Assche */ 9c5f1ac8bSBart Van Assche 10c5f1ac8bSBart Van Assche #ifndef _SCSI_PROTO_H_ 11c5f1ac8bSBart Van Assche #define _SCSI_PROTO_H_ 12c5f1ac8bSBart Van Assche 13c5f1ac8bSBart Van Assche #include <linux/types.h> 14c5f1ac8bSBart Van Assche 15c5f1ac8bSBart Van Assche /* 16c5f1ac8bSBart Van Assche * SCSI opcodes 17c5f1ac8bSBart Van Assche */ 18c5f1ac8bSBart Van Assche 19c5f1ac8bSBart Van Assche #define TEST_UNIT_READY 0x00 20c5f1ac8bSBart Van Assche #define REZERO_UNIT 0x01 21c5f1ac8bSBart Van Assche #define REQUEST_SENSE 0x03 22c5f1ac8bSBart Van Assche #define FORMAT_UNIT 0x04 23c5f1ac8bSBart Van Assche #define READ_BLOCK_LIMITS 0x05 24c5f1ac8bSBart Van Assche #define REASSIGN_BLOCKS 0x07 25c5f1ac8bSBart Van Assche #define INITIALIZE_ELEMENT_STATUS 0x07 26c5f1ac8bSBart Van Assche #define READ_6 0x08 27c5f1ac8bSBart Van Assche #define WRITE_6 0x0a 28c5f1ac8bSBart Van Assche #define SEEK_6 0x0b 29c5f1ac8bSBart Van Assche #define READ_REVERSE 0x0f 30c5f1ac8bSBart Van Assche #define WRITE_FILEMARKS 0x10 31c5f1ac8bSBart Van Assche #define SPACE 0x11 32c5f1ac8bSBart Van Assche #define INQUIRY 0x12 33c5f1ac8bSBart Van Assche #define RECOVER_BUFFERED_DATA 0x14 34c5f1ac8bSBart Van Assche #define MODE_SELECT 0x15 35c5f1ac8bSBart Van Assche #define RESERVE 0x16 36c5f1ac8bSBart Van Assche #define RELEASE 0x17 37c5f1ac8bSBart Van Assche #define COPY 0x18 38c5f1ac8bSBart Van Assche #define ERASE 0x19 39c5f1ac8bSBart Van Assche #define MODE_SENSE 0x1a 40c5f1ac8bSBart Van Assche #define START_STOP 0x1b 41c5f1ac8bSBart Van Assche #define RECEIVE_DIAGNOSTIC 0x1c 42c5f1ac8bSBart Van Assche #define SEND_DIAGNOSTIC 0x1d 43c5f1ac8bSBart Van Assche #define ALLOW_MEDIUM_REMOVAL 0x1e 44c5f1ac8bSBart Van Assche 45c5f1ac8bSBart Van Assche #define READ_FORMAT_CAPACITIES 0x23 46c5f1ac8bSBart Van Assche #define SET_WINDOW 0x24 47c5f1ac8bSBart Van Assche #define READ_CAPACITY 0x25 48c5f1ac8bSBart Van Assche #define READ_10 0x28 49c5f1ac8bSBart Van Assche #define WRITE_10 0x2a 50c5f1ac8bSBart Van Assche #define SEEK_10 0x2b 51c5f1ac8bSBart Van Assche #define POSITION_TO_ELEMENT 0x2b 52c5f1ac8bSBart Van Assche #define WRITE_VERIFY 0x2e 53c5f1ac8bSBart Van Assche #define VERIFY 0x2f 54c5f1ac8bSBart Van Assche #define SEARCH_HIGH 0x30 55c5f1ac8bSBart Van Assche #define SEARCH_EQUAL 0x31 56c5f1ac8bSBart Van Assche #define SEARCH_LOW 0x32 57c5f1ac8bSBart Van Assche #define SET_LIMITS 0x33 58c5f1ac8bSBart Van Assche #define PRE_FETCH 0x34 59c5f1ac8bSBart Van Assche #define READ_POSITION 0x34 60c5f1ac8bSBart Van Assche #define SYNCHRONIZE_CACHE 0x35 61c5f1ac8bSBart Van Assche #define LOCK_UNLOCK_CACHE 0x36 62c5f1ac8bSBart Van Assche #define READ_DEFECT_DATA 0x37 63c5f1ac8bSBart Van Assche #define MEDIUM_SCAN 0x38 64c5f1ac8bSBart Van Assche #define COMPARE 0x39 65c5f1ac8bSBart Van Assche #define COPY_VERIFY 0x3a 66c5f1ac8bSBart Van Assche #define WRITE_BUFFER 0x3b 67c5f1ac8bSBart Van Assche #define READ_BUFFER 0x3c 68c5f1ac8bSBart Van Assche #define UPDATE_BLOCK 0x3d 69c5f1ac8bSBart Van Assche #define READ_LONG 0x3e 70c5f1ac8bSBart Van Assche #define WRITE_LONG 0x3f 71c5f1ac8bSBart Van Assche #define CHANGE_DEFINITION 0x40 72c5f1ac8bSBart Van Assche #define WRITE_SAME 0x41 73c5f1ac8bSBart Van Assche #define UNMAP 0x42 74c5f1ac8bSBart Van Assche #define READ_TOC 0x43 75c5f1ac8bSBart Van Assche #define READ_HEADER 0x44 76c5f1ac8bSBart Van Assche #define GET_EVENT_STATUS_NOTIFICATION 0x4a 77c5f1ac8bSBart Van Assche #define LOG_SELECT 0x4c 78c5f1ac8bSBart Van Assche #define LOG_SENSE 0x4d 79c5f1ac8bSBart Van Assche #define XDWRITEREAD_10 0x53 80c5f1ac8bSBart Van Assche #define MODE_SELECT_10 0x55 81c5f1ac8bSBart Van Assche #define RESERVE_10 0x56 82c5f1ac8bSBart Van Assche #define RELEASE_10 0x57 83c5f1ac8bSBart Van Assche #define MODE_SENSE_10 0x5a 84c5f1ac8bSBart Van Assche #define PERSISTENT_RESERVE_IN 0x5e 85c5f1ac8bSBart Van Assche #define PERSISTENT_RESERVE_OUT 0x5f 86c5f1ac8bSBart Van Assche #define VARIABLE_LENGTH_CMD 0x7f 87c5f1ac8bSBart Van Assche #define REPORT_LUNS 0xa0 88c5f1ac8bSBart Van Assche #define SECURITY_PROTOCOL_IN 0xa2 89c5f1ac8bSBart Van Assche #define MAINTENANCE_IN 0xa3 90c5f1ac8bSBart Van Assche #define MAINTENANCE_OUT 0xa4 91c5f1ac8bSBart Van Assche #define MOVE_MEDIUM 0xa5 92c5f1ac8bSBart Van Assche #define EXCHANGE_MEDIUM 0xa6 93c5f1ac8bSBart Van Assche #define READ_12 0xa8 94c5f1ac8bSBart Van Assche #define SERVICE_ACTION_OUT_12 0xa9 95c5f1ac8bSBart Van Assche #define WRITE_12 0xaa 96c5f1ac8bSBart Van Assche #define READ_MEDIA_SERIAL_NUMBER 0xab /* Obsolete with SPC-2 */ 97c5f1ac8bSBart Van Assche #define SERVICE_ACTION_IN_12 0xab 98c5f1ac8bSBart Van Assche #define WRITE_VERIFY_12 0xae 99c5f1ac8bSBart Van Assche #define VERIFY_12 0xaf 100c5f1ac8bSBart Van Assche #define SEARCH_HIGH_12 0xb0 101c5f1ac8bSBart Van Assche #define SEARCH_EQUAL_12 0xb1 102c5f1ac8bSBart Van Assche #define SEARCH_LOW_12 0xb2 103c5f1ac8bSBart Van Assche #define SECURITY_PROTOCOL_OUT 0xb5 104c5f1ac8bSBart Van Assche #define READ_ELEMENT_STATUS 0xb8 105c5f1ac8bSBart Van Assche #define SEND_VOLUME_TAG 0xb6 106c5f1ac8bSBart Van Assche #define WRITE_LONG_2 0xea 107c5f1ac8bSBart Van Assche #define EXTENDED_COPY 0x83 108c5f1ac8bSBart Van Assche #define RECEIVE_COPY_RESULTS 0x84 109c5f1ac8bSBart Van Assche #define ACCESS_CONTROL_IN 0x86 110c5f1ac8bSBart Van Assche #define ACCESS_CONTROL_OUT 0x87 111c5f1ac8bSBart Van Assche #define READ_16 0x88 112c5f1ac8bSBart Van Assche #define COMPARE_AND_WRITE 0x89 113c5f1ac8bSBart Van Assche #define WRITE_16 0x8a 114c5f1ac8bSBart Van Assche #define READ_ATTRIBUTE 0x8c 115c5f1ac8bSBart Van Assche #define WRITE_ATTRIBUTE 0x8d 116c2d26f18SBryant G. Ly #define WRITE_VERIFY_16 0x8e 117c5f1ac8bSBart Van Assche #define VERIFY_16 0x8f 118c5f1ac8bSBart Van Assche #define SYNCHRONIZE_CACHE_16 0x91 119c5f1ac8bSBart Van Assche #define WRITE_SAME_16 0x93 1200008f1e7SHannes Reinecke #define ZBC_OUT 0x94 1210008f1e7SHannes Reinecke #define ZBC_IN 0x95 122c5f1ac8bSBart Van Assche #define SERVICE_ACTION_BIDIRECTIONAL 0x9d 123c5f1ac8bSBart Van Assche #define SERVICE_ACTION_IN_16 0x9e 124c5f1ac8bSBart Van Assche #define SERVICE_ACTION_OUT_16 0x9f 125c5f1ac8bSBart Van Assche /* values for service action in */ 126c5f1ac8bSBart Van Assche #define SAI_READ_CAPACITY_16 0x10 127c5f1ac8bSBart Van Assche #define SAI_GET_LBA_STATUS 0x12 128c5f1ac8bSBart Van Assche #define SAI_REPORT_REFERRALS 0x13 129c5f1ac8bSBart Van Assche /* values for maintenance in */ 130c5f1ac8bSBart Van Assche #define MI_REPORT_IDENTIFYING_INFORMATION 0x05 131c5f1ac8bSBart Van Assche #define MI_REPORT_TARGET_PGS 0x0a 132c5f1ac8bSBart Van Assche #define MI_REPORT_ALIASES 0x0b 133c5f1ac8bSBart Van Assche #define MI_REPORT_SUPPORTED_OPERATION_CODES 0x0c 134c5f1ac8bSBart Van Assche #define MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0d 135c5f1ac8bSBart Van Assche #define MI_REPORT_PRIORITY 0x0e 136c5f1ac8bSBart Van Assche #define MI_REPORT_TIMESTAMP 0x0f 137c5f1ac8bSBart Van Assche #define MI_MANAGEMENT_PROTOCOL_IN 0x10 138c5f1ac8bSBart Van Assche /* value for MI_REPORT_TARGET_PGS ext header */ 139c5f1ac8bSBart Van Assche #define MI_EXT_HDR_PARAM_FMT 0x20 140c5f1ac8bSBart Van Assche /* values for maintenance out */ 141c5f1ac8bSBart Van Assche #define MO_SET_IDENTIFYING_INFORMATION 0x06 142c5f1ac8bSBart Van Assche #define MO_SET_TARGET_PGS 0x0a 143c5f1ac8bSBart Van Assche #define MO_CHANGE_ALIASES 0x0b 144c5f1ac8bSBart Van Assche #define MO_SET_PRIORITY 0x0e 145c5f1ac8bSBart Van Assche #define MO_SET_TIMESTAMP 0x0f 146c5f1ac8bSBart Van Assche #define MO_MANAGEMENT_PROTOCOL_OUT 0x10 1470008f1e7SHannes Reinecke /* values for ZBC_IN */ 1480008f1e7SHannes Reinecke #define ZI_REPORT_ZONES 0x00 1490008f1e7SHannes Reinecke /* values for ZBC_OUT */ 1500008f1e7SHannes Reinecke #define ZO_CLOSE_ZONE 0x01 1510008f1e7SHannes Reinecke #define ZO_FINISH_ZONE 0x02 1520008f1e7SHannes Reinecke #define ZO_OPEN_ZONE 0x03 1530008f1e7SHannes Reinecke #define ZO_RESET_WRITE_POINTER 0x04 154*0af7b5e2SMike Christie /* values for PR in service action */ 155*0af7b5e2SMike Christie #define READ_KEYS 0x00 156*0af7b5e2SMike Christie #define READ_RESERVATION 0x01 157*0af7b5e2SMike Christie #define REPORT_CAPABILITES 0x02 158*0af7b5e2SMike Christie #define READ_FULL_STATUS 0x03 159c5f1ac8bSBart Van Assche /* values for variable length command */ 160c5f1ac8bSBart Van Assche #define XDREAD_32 0x03 161c5f1ac8bSBart Van Assche #define XDWRITE_32 0x04 162c5f1ac8bSBart Van Assche #define XPWRITE_32 0x06 163c5f1ac8bSBart Van Assche #define XDWRITEREAD_32 0x07 164c5f1ac8bSBart Van Assche #define READ_32 0x09 165c5f1ac8bSBart Van Assche #define VERIFY_32 0x0a 166c5f1ac8bSBart Van Assche #define WRITE_32 0x0b 167e5dc9a70SDamien Le Moal #define WRITE_VERIFY_32 0x0c 168c5f1ac8bSBart Van Assche #define WRITE_SAME_32 0x0d 169b1ffbf85SMinwoo Im #define ATA_32 0x1ff0 170c5f1ac8bSBart Van Assche 171c5f1ac8bSBart Van Assche /* Values for T10/04-262r7 */ 172c5f1ac8bSBart Van Assche #define ATA_16 0x85 /* 16-byte pass-thru */ 173c5f1ac8bSBart Van Assche #define ATA_12 0xa1 /* 12-byte pass-thru */ 174c5f1ac8bSBart Van Assche 175c5f1ac8bSBart Van Assche /* Vendor specific CDBs start here */ 176c5f1ac8bSBart Van Assche #define VENDOR_SPECIFIC_CDB 0xc0 177c5f1ac8bSBart Van Assche 178c5f1ac8bSBart Van Assche /* 179c5f1ac8bSBart Van Assche * SCSI command lengths 180c5f1ac8bSBart Van Assche */ 181c5f1ac8bSBart Van Assche 182c5f1ac8bSBart Van Assche #define SCSI_MAX_VARLEN_CDB_SIZE 260 183c5f1ac8bSBart Van Assche 184c5f1ac8bSBart Van Assche /* defined in T10 SCSI Primary Commands-2 (SPC2) */ 185c5f1ac8bSBart Van Assche struct scsi_varlen_cdb_hdr { 186c5f1ac8bSBart Van Assche __u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */ 187c5f1ac8bSBart Van Assche __u8 control; 188c5f1ac8bSBart Van Assche __u8 misc[5]; 189c5f1ac8bSBart Van Assche __u8 additional_cdb_length; /* total cdb length - 8 */ 190c5f1ac8bSBart Van Assche __be16 service_action; 191c5f1ac8bSBart Van Assche /* service specific data follows */ 192c5f1ac8bSBart Van Assche }; 193c5f1ac8bSBart Van Assche 194c5f1ac8bSBart Van Assche /* 195c5f1ac8bSBart Van Assche * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft 196c5f1ac8bSBart Van Assche * T10/1561-D Revision 4 Draft dated 7th November 2002. 197c5f1ac8bSBart Van Assche */ 198149d0e48SBart Van Assche enum sam_status { 199149d0e48SBart Van Assche SAM_STAT_GOOD = 0x00, 200149d0e48SBart Van Assche SAM_STAT_CHECK_CONDITION = 0x02, 201149d0e48SBart Van Assche SAM_STAT_CONDITION_MET = 0x04, 202149d0e48SBart Van Assche SAM_STAT_BUSY = 0x08, 203149d0e48SBart Van Assche SAM_STAT_INTERMEDIATE = 0x10, 204149d0e48SBart Van Assche SAM_STAT_INTERMEDIATE_CONDITION_MET = 0x14, 205149d0e48SBart Van Assche SAM_STAT_RESERVATION_CONFLICT = 0x18, 206149d0e48SBart Van Assche SAM_STAT_COMMAND_TERMINATED = 0x22, /* obsolete in SAM-3 */ 207149d0e48SBart Van Assche SAM_STAT_TASK_SET_FULL = 0x28, 208149d0e48SBart Van Assche SAM_STAT_ACA_ACTIVE = 0x30, 209149d0e48SBart Van Assche SAM_STAT_TASK_ABORTED = 0x40, 210149d0e48SBart Van Assche }; 211c5f1ac8bSBart Van Assche 212c5f1ac8bSBart Van Assche #define STATUS_MASK 0xfe 213d9504c65SDamien Le Moal 214c5f1ac8bSBart Van Assche /* 215c5f1ac8bSBart Van Assche * SENSE KEYS 216c5f1ac8bSBart Van Assche */ 217c5f1ac8bSBart Van Assche #define NO_SENSE 0x00 218c5f1ac8bSBart Van Assche #define RECOVERED_ERROR 0x01 219c5f1ac8bSBart Van Assche #define NOT_READY 0x02 220c5f1ac8bSBart Van Assche #define MEDIUM_ERROR 0x03 221c5f1ac8bSBart Van Assche #define HARDWARE_ERROR 0x04 222c5f1ac8bSBart Van Assche #define ILLEGAL_REQUEST 0x05 223c5f1ac8bSBart Van Assche #define UNIT_ATTENTION 0x06 224c5f1ac8bSBart Van Assche #define DATA_PROTECT 0x07 225c5f1ac8bSBart Van Assche #define BLANK_CHECK 0x08 2269c661a49SHannes Reinecke #define VENDOR_SPECIFIC 0x09 227c5f1ac8bSBart Van Assche #define COPY_ABORTED 0x0a 228c5f1ac8bSBart Van Assche #define ABORTED_COMMAND 0x0b 229c5f1ac8bSBart Van Assche #define VOLUME_OVERFLOW 0x0d 230c5f1ac8bSBart Van Assche #define MISCOMPARE 0x0e 231d9504c65SDamien Le Moal #define COMPLETED 0x0f 232c5f1ac8bSBart Van Assche 233c5f1ac8bSBart Van Assche /* 234c5f1ac8bSBart Van Assche * DEVICE TYPES 235c5f1ac8bSBart Van Assche * Please keep them in 0x%02x format for $MODALIAS to work 236c5f1ac8bSBart Van Assche */ 237c5f1ac8bSBart Van Assche 238c5f1ac8bSBart Van Assche #define TYPE_DISK 0x00 239c5f1ac8bSBart Van Assche #define TYPE_TAPE 0x01 240c5f1ac8bSBart Van Assche #define TYPE_PRINTER 0x02 241c5f1ac8bSBart Van Assche #define TYPE_PROCESSOR 0x03 /* HP scanners use this */ 242c5f1ac8bSBart Van Assche #define TYPE_WORM 0x04 /* Treated as ROM by our system */ 243c5f1ac8bSBart Van Assche #define TYPE_ROM 0x05 244c5f1ac8bSBart Van Assche #define TYPE_SCANNER 0x06 245c5f1ac8bSBart Van Assche #define TYPE_MOD 0x07 /* Magneto-optical disk - 246c5f1ac8bSBart Van Assche * - treated as TYPE_DISK */ 247c5f1ac8bSBart Van Assche #define TYPE_MEDIUM_CHANGER 0x08 248c5f1ac8bSBart Van Assche #define TYPE_COMM 0x09 /* Communications device */ 249c5f1ac8bSBart Van Assche #define TYPE_RAID 0x0c 250c5f1ac8bSBart Van Assche #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ 251c5f1ac8bSBart Van Assche #define TYPE_RBC 0x0e 252c5f1ac8bSBart Van Assche #define TYPE_OSD 0x11 253c5f1ac8bSBart Van Assche #define TYPE_ZBC 0x14 254c5f1ac8bSBart Van Assche #define TYPE_WLUN 0x1e /* well-known logical unit */ 255c5f1ac8bSBart Van Assche #define TYPE_NO_LUN 0x7f 256c5f1ac8bSBart Van Assche 257c5f1ac8bSBart Van Assche /* SCSI protocols; these are taken from SPC-3 section 7.5 */ 258c5f1ac8bSBart Van Assche enum scsi_protocol { 259c5f1ac8bSBart Van Assche SCSI_PROTOCOL_FCP = 0, /* Fibre Channel */ 260c5f1ac8bSBart Van Assche SCSI_PROTOCOL_SPI = 1, /* parallel SCSI */ 261c5f1ac8bSBart Van Assche SCSI_PROTOCOL_SSA = 2, /* Serial Storage Architecture - Obsolete */ 262c5f1ac8bSBart Van Assche SCSI_PROTOCOL_SBP = 3, /* firewire */ 263c5f1ac8bSBart Van Assche SCSI_PROTOCOL_SRP = 4, /* Infiniband RDMA */ 264c5f1ac8bSBart Van Assche SCSI_PROTOCOL_ISCSI = 5, 265c5f1ac8bSBart Van Assche SCSI_PROTOCOL_SAS = 6, 266c5f1ac8bSBart Van Assche SCSI_PROTOCOL_ADT = 7, /* Media Changers */ 267c5f1ac8bSBart Van Assche SCSI_PROTOCOL_ATA = 8, 268c5f1ac8bSBart Van Assche SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */ 269c5f1ac8bSBart Van Assche }; 270c5f1ac8bSBart Van Assche 271c5f1ac8bSBart Van Assche /* 272c5f1ac8bSBart Van Assche * ScsiLun: 8 byte LUN. 273c5f1ac8bSBart Van Assche */ 274c5f1ac8bSBart Van Assche struct scsi_lun { 275c5f1ac8bSBart Van Assche __u8 scsi_lun[8]; 276c5f1ac8bSBart Van Assche }; 277c5f1ac8bSBart Van Assche 27877c9df96SHannes Reinecke /* SPC asymmetric access states */ 27977c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_OPTIMAL 0x00 28077c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_ACTIVE 0x01 28177c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_STANDBY 0x02 28277c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_UNAVAILABLE 0x03 28377c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_LBA 0x04 28477c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_OFFLINE 0x0e 28577c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_TRANSITIONING 0x0f 28677c9df96SHannes Reinecke 28777c9df96SHannes Reinecke /* Values for REPORT TARGET GROUP STATES */ 28877c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_MASK 0x0f 28977c9df96SHannes Reinecke #define SCSI_ACCESS_STATE_PREFERRED 0x80 290c5f1ac8bSBart Van Assche 29189d94756SHannes Reinecke /* Reporting options for REPORT ZONES */ 29289d94756SHannes Reinecke enum zbc_zone_reporting_options { 293aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_ALL = 0x00, 294aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_EMPTY = 0x01, 295aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_IMPLICIT_OPEN = 0x02, 296aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_EXPLICIT_OPEN = 0x03, 297aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_CLOSED = 0x04, 298aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_FULL = 0x05, 299aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_READONLY = 0x06, 300aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_OFFLINE = 0x07, 301aa8a8456SDamien Le Moal /* 0x08 to 0x0f are reserved */ 30289d94756SHannes Reinecke ZBC_ZONE_REPORTING_OPTION_NEED_RESET_WP = 0x10, 303aa8a8456SDamien Le Moal ZBC_ZONE_REPORTING_OPTION_NON_SEQWRITE = 0x11, 304aa8a8456SDamien Le Moal /* 0x12 to 0x3e are reserved */ 30589d94756SHannes Reinecke ZBC_ZONE_REPORTING_OPTION_NON_WP = 0x3f, 30689d94756SHannes Reinecke }; 30789d94756SHannes Reinecke 30889d94756SHannes Reinecke #define ZBC_REPORT_ZONE_PARTIAL 0x80 30989d94756SHannes Reinecke 310aa8a8456SDamien Le Moal /* Zone types of REPORT ZONES zone descriptors */ 311aa8a8456SDamien Le Moal enum zbc_zone_type { 312aa8a8456SDamien Le Moal ZBC_ZONE_TYPE_CONV = 0x1, 313aa8a8456SDamien Le Moal ZBC_ZONE_TYPE_SEQWRITE_REQ = 0x2, 314aa8a8456SDamien Le Moal ZBC_ZONE_TYPE_SEQWRITE_PREF = 0x3, 315c976e588SDamien Le Moal ZBC_ZONE_TYPE_SEQ_OR_BEFORE_REQ = 0x4, 316c976e588SDamien Le Moal ZBC_ZONE_TYPE_GAP = 0x5, 317c976e588SDamien Le Moal /* 0x6 to 0xf are reserved */ 318aa8a8456SDamien Le Moal }; 319aa8a8456SDamien Le Moal 320aa8a8456SDamien Le Moal /* Zone conditions of REPORT ZONES zone descriptors */ 321aa8a8456SDamien Le Moal enum zbc_zone_cond { 322aa8a8456SDamien Le Moal ZBC_ZONE_COND_NO_WP = 0x0, 323aa8a8456SDamien Le Moal ZBC_ZONE_COND_EMPTY = 0x1, 324aa8a8456SDamien Le Moal ZBC_ZONE_COND_IMP_OPEN = 0x2, 325aa8a8456SDamien Le Moal ZBC_ZONE_COND_EXP_OPEN = 0x3, 326aa8a8456SDamien Le Moal ZBC_ZONE_COND_CLOSED = 0x4, 327aa8a8456SDamien Le Moal /* 0x5 to 0xc are reserved */ 328aa8a8456SDamien Le Moal ZBC_ZONE_COND_READONLY = 0xd, 329aa8a8456SDamien Le Moal ZBC_ZONE_COND_FULL = 0xe, 330aa8a8456SDamien Le Moal ZBC_ZONE_COND_OFFLINE = 0xf, 331aa8a8456SDamien Le Moal }; 332aa8a8456SDamien Le Moal 333c976e588SDamien Le Moal enum zbc_zone_alignment_method { 334c976e588SDamien Le Moal ZBC_CONSTANT_ZONE_LENGTH = 0x1, 335c976e588SDamien Le Moal ZBC_CONSTANT_ZONE_START_OFFSET = 0x8, 336c976e588SDamien Le Moal }; 337c976e588SDamien Le Moal 338b790a56dSKonstantin Shelekhin /* Version descriptor values for INQUIRY */ 339b790a56dSKonstantin Shelekhin enum scsi_version_descriptor { 340b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_FCP4 = 0x0a40, 341b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_ISCSI = 0x0960, 342b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_SAM5 = 0x00a0, 343b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_SAS3 = 0x0c60, 344b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_SBC3 = 0x04c0, 345b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_SBP3 = 0x0980, 346b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_SPC4 = 0x0460, 347b790a56dSKonstantin Shelekhin SCSI_VERSION_DESCRIPTOR_SRP = 0x0940 348b790a56dSKonstantin Shelekhin }; 349b790a56dSKonstantin Shelekhin 350b9b8782fSDmitry Bogdanov enum scsi_support_opcode { 351b9b8782fSDmitry Bogdanov SCSI_SUPPORT_NO_INFO = 0, 352b9b8782fSDmitry Bogdanov SCSI_SUPPORT_NOT_SUPPORTED = 1, 353b9b8782fSDmitry Bogdanov SCSI_SUPPORT_FULL = 3, 354b9b8782fSDmitry Bogdanov SCSI_SUPPORT_VENDOR = 5, 355b9b8782fSDmitry Bogdanov }; 356b9b8782fSDmitry Bogdanov 3570016e820SDmitry Bogdanov #define SCSI_CONTROL_MASK 0 3580016e820SDmitry Bogdanov #define SCSI_GROUP_NUMBER_MASK 0 3590016e820SDmitry Bogdanov 360c5f1ac8bSBart Van Assche #endif /* _SCSI_PROTO_H_ */ 361