162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * This header file contains public constants and structures used by 462306a36Sopenharmony_ci * both the SCSI initiator and the SCSI target code. 562306a36Sopenharmony_ci * 662306a36Sopenharmony_ci * For documentation on the OPCODES, MESSAGES, and SENSE values, 762306a36Sopenharmony_ci * please consult the SCSI standard. 862306a36Sopenharmony_ci */ 962306a36Sopenharmony_ci 1062306a36Sopenharmony_ci#ifndef _SCSI_PROTO_H_ 1162306a36Sopenharmony_ci#define _SCSI_PROTO_H_ 1262306a36Sopenharmony_ci 1362306a36Sopenharmony_ci#include <linux/types.h> 1462306a36Sopenharmony_ci 1562306a36Sopenharmony_ci/* 1662306a36Sopenharmony_ci * SCSI opcodes 1762306a36Sopenharmony_ci */ 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci#define TEST_UNIT_READY 0x00 2062306a36Sopenharmony_ci#define REZERO_UNIT 0x01 2162306a36Sopenharmony_ci#define REQUEST_SENSE 0x03 2262306a36Sopenharmony_ci#define FORMAT_UNIT 0x04 2362306a36Sopenharmony_ci#define READ_BLOCK_LIMITS 0x05 2462306a36Sopenharmony_ci#define REASSIGN_BLOCKS 0x07 2562306a36Sopenharmony_ci#define INITIALIZE_ELEMENT_STATUS 0x07 2662306a36Sopenharmony_ci#define READ_6 0x08 2762306a36Sopenharmony_ci#define WRITE_6 0x0a 2862306a36Sopenharmony_ci#define SEEK_6 0x0b 2962306a36Sopenharmony_ci#define READ_REVERSE 0x0f 3062306a36Sopenharmony_ci#define WRITE_FILEMARKS 0x10 3162306a36Sopenharmony_ci#define SPACE 0x11 3262306a36Sopenharmony_ci#define INQUIRY 0x12 3362306a36Sopenharmony_ci#define RECOVER_BUFFERED_DATA 0x14 3462306a36Sopenharmony_ci#define MODE_SELECT 0x15 3562306a36Sopenharmony_ci#define RESERVE 0x16 3662306a36Sopenharmony_ci#define RELEASE 0x17 3762306a36Sopenharmony_ci#define COPY 0x18 3862306a36Sopenharmony_ci#define ERASE 0x19 3962306a36Sopenharmony_ci#define MODE_SENSE 0x1a 4062306a36Sopenharmony_ci#define START_STOP 0x1b 4162306a36Sopenharmony_ci#define RECEIVE_DIAGNOSTIC 0x1c 4262306a36Sopenharmony_ci#define SEND_DIAGNOSTIC 0x1d 4362306a36Sopenharmony_ci#define ALLOW_MEDIUM_REMOVAL 0x1e 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci#define READ_FORMAT_CAPACITIES 0x23 4662306a36Sopenharmony_ci#define SET_WINDOW 0x24 4762306a36Sopenharmony_ci#define READ_CAPACITY 0x25 4862306a36Sopenharmony_ci#define READ_10 0x28 4962306a36Sopenharmony_ci#define WRITE_10 0x2a 5062306a36Sopenharmony_ci#define SEEK_10 0x2b 5162306a36Sopenharmony_ci#define POSITION_TO_ELEMENT 0x2b 5262306a36Sopenharmony_ci#define WRITE_VERIFY 0x2e 5362306a36Sopenharmony_ci#define VERIFY 0x2f 5462306a36Sopenharmony_ci#define SEARCH_HIGH 0x30 5562306a36Sopenharmony_ci#define SEARCH_EQUAL 0x31 5662306a36Sopenharmony_ci#define SEARCH_LOW 0x32 5762306a36Sopenharmony_ci#define SET_LIMITS 0x33 5862306a36Sopenharmony_ci#define PRE_FETCH 0x34 5962306a36Sopenharmony_ci#define READ_POSITION 0x34 6062306a36Sopenharmony_ci#define SYNCHRONIZE_CACHE 0x35 6162306a36Sopenharmony_ci#define LOCK_UNLOCK_CACHE 0x36 6262306a36Sopenharmony_ci#define READ_DEFECT_DATA 0x37 6362306a36Sopenharmony_ci#define MEDIUM_SCAN 0x38 6462306a36Sopenharmony_ci#define COMPARE 0x39 6562306a36Sopenharmony_ci#define COPY_VERIFY 0x3a 6662306a36Sopenharmony_ci#define WRITE_BUFFER 0x3b 6762306a36Sopenharmony_ci#define READ_BUFFER 0x3c 6862306a36Sopenharmony_ci#define UPDATE_BLOCK 0x3d 6962306a36Sopenharmony_ci#define READ_LONG 0x3e 7062306a36Sopenharmony_ci#define WRITE_LONG 0x3f 7162306a36Sopenharmony_ci#define CHANGE_DEFINITION 0x40 7262306a36Sopenharmony_ci#define WRITE_SAME 0x41 7362306a36Sopenharmony_ci#define UNMAP 0x42 7462306a36Sopenharmony_ci#define READ_TOC 0x43 7562306a36Sopenharmony_ci#define READ_HEADER 0x44 7662306a36Sopenharmony_ci#define GET_EVENT_STATUS_NOTIFICATION 0x4a 7762306a36Sopenharmony_ci#define LOG_SELECT 0x4c 7862306a36Sopenharmony_ci#define LOG_SENSE 0x4d 7962306a36Sopenharmony_ci#define XDWRITEREAD_10 0x53 8062306a36Sopenharmony_ci#define MODE_SELECT_10 0x55 8162306a36Sopenharmony_ci#define RESERVE_10 0x56 8262306a36Sopenharmony_ci#define RELEASE_10 0x57 8362306a36Sopenharmony_ci#define MODE_SENSE_10 0x5a 8462306a36Sopenharmony_ci#define PERSISTENT_RESERVE_IN 0x5e 8562306a36Sopenharmony_ci#define PERSISTENT_RESERVE_OUT 0x5f 8662306a36Sopenharmony_ci#define VARIABLE_LENGTH_CMD 0x7f 8762306a36Sopenharmony_ci#define REPORT_LUNS 0xa0 8862306a36Sopenharmony_ci#define SECURITY_PROTOCOL_IN 0xa2 8962306a36Sopenharmony_ci#define MAINTENANCE_IN 0xa3 9062306a36Sopenharmony_ci#define MAINTENANCE_OUT 0xa4 9162306a36Sopenharmony_ci#define MOVE_MEDIUM 0xa5 9262306a36Sopenharmony_ci#define EXCHANGE_MEDIUM 0xa6 9362306a36Sopenharmony_ci#define READ_12 0xa8 9462306a36Sopenharmony_ci#define SERVICE_ACTION_OUT_12 0xa9 9562306a36Sopenharmony_ci#define WRITE_12 0xaa 9662306a36Sopenharmony_ci#define READ_MEDIA_SERIAL_NUMBER 0xab /* Obsolete with SPC-2 */ 9762306a36Sopenharmony_ci#define SERVICE_ACTION_IN_12 0xab 9862306a36Sopenharmony_ci#define WRITE_VERIFY_12 0xae 9962306a36Sopenharmony_ci#define VERIFY_12 0xaf 10062306a36Sopenharmony_ci#define SEARCH_HIGH_12 0xb0 10162306a36Sopenharmony_ci#define SEARCH_EQUAL_12 0xb1 10262306a36Sopenharmony_ci#define SEARCH_LOW_12 0xb2 10362306a36Sopenharmony_ci#define SECURITY_PROTOCOL_OUT 0xb5 10462306a36Sopenharmony_ci#define READ_ELEMENT_STATUS 0xb8 10562306a36Sopenharmony_ci#define SEND_VOLUME_TAG 0xb6 10662306a36Sopenharmony_ci#define WRITE_LONG_2 0xea 10762306a36Sopenharmony_ci#define EXTENDED_COPY 0x83 10862306a36Sopenharmony_ci#define RECEIVE_COPY_RESULTS 0x84 10962306a36Sopenharmony_ci#define ACCESS_CONTROL_IN 0x86 11062306a36Sopenharmony_ci#define ACCESS_CONTROL_OUT 0x87 11162306a36Sopenharmony_ci#define READ_16 0x88 11262306a36Sopenharmony_ci#define COMPARE_AND_WRITE 0x89 11362306a36Sopenharmony_ci#define WRITE_16 0x8a 11462306a36Sopenharmony_ci#define READ_ATTRIBUTE 0x8c 11562306a36Sopenharmony_ci#define WRITE_ATTRIBUTE 0x8d 11662306a36Sopenharmony_ci#define WRITE_VERIFY_16 0x8e 11762306a36Sopenharmony_ci#define VERIFY_16 0x8f 11862306a36Sopenharmony_ci#define SYNCHRONIZE_CACHE_16 0x91 11962306a36Sopenharmony_ci#define WRITE_SAME_16 0x93 12062306a36Sopenharmony_ci#define ZBC_OUT 0x94 12162306a36Sopenharmony_ci#define ZBC_IN 0x95 12262306a36Sopenharmony_ci#define SERVICE_ACTION_BIDIRECTIONAL 0x9d 12362306a36Sopenharmony_ci#define SERVICE_ACTION_IN_16 0x9e 12462306a36Sopenharmony_ci#define SERVICE_ACTION_OUT_16 0x9f 12562306a36Sopenharmony_ci/* values for service action in */ 12662306a36Sopenharmony_ci#define SAI_READ_CAPACITY_16 0x10 12762306a36Sopenharmony_ci#define SAI_GET_LBA_STATUS 0x12 12862306a36Sopenharmony_ci#define SAI_REPORT_REFERRALS 0x13 12962306a36Sopenharmony_ci/* values for maintenance in */ 13062306a36Sopenharmony_ci#define MI_REPORT_IDENTIFYING_INFORMATION 0x05 13162306a36Sopenharmony_ci#define MI_REPORT_TARGET_PGS 0x0a 13262306a36Sopenharmony_ci#define MI_REPORT_ALIASES 0x0b 13362306a36Sopenharmony_ci#define MI_REPORT_SUPPORTED_OPERATION_CODES 0x0c 13462306a36Sopenharmony_ci#define MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0d 13562306a36Sopenharmony_ci#define MI_REPORT_PRIORITY 0x0e 13662306a36Sopenharmony_ci#define MI_REPORT_TIMESTAMP 0x0f 13762306a36Sopenharmony_ci#define MI_MANAGEMENT_PROTOCOL_IN 0x10 13862306a36Sopenharmony_ci/* value for MI_REPORT_TARGET_PGS ext header */ 13962306a36Sopenharmony_ci#define MI_EXT_HDR_PARAM_FMT 0x20 14062306a36Sopenharmony_ci/* values for maintenance out */ 14162306a36Sopenharmony_ci#define MO_SET_IDENTIFYING_INFORMATION 0x06 14262306a36Sopenharmony_ci#define MO_SET_TARGET_PGS 0x0a 14362306a36Sopenharmony_ci#define MO_CHANGE_ALIASES 0x0b 14462306a36Sopenharmony_ci#define MO_SET_PRIORITY 0x0e 14562306a36Sopenharmony_ci#define MO_SET_TIMESTAMP 0x0f 14662306a36Sopenharmony_ci#define MO_MANAGEMENT_PROTOCOL_OUT 0x10 14762306a36Sopenharmony_ci/* values for ZBC_IN */ 14862306a36Sopenharmony_ci#define ZI_REPORT_ZONES 0x00 14962306a36Sopenharmony_ci/* values for ZBC_OUT */ 15062306a36Sopenharmony_ci#define ZO_CLOSE_ZONE 0x01 15162306a36Sopenharmony_ci#define ZO_FINISH_ZONE 0x02 15262306a36Sopenharmony_ci#define ZO_OPEN_ZONE 0x03 15362306a36Sopenharmony_ci#define ZO_RESET_WRITE_POINTER 0x04 15462306a36Sopenharmony_ci/* values for PR in service action */ 15562306a36Sopenharmony_ci#define READ_KEYS 0x00 15662306a36Sopenharmony_ci#define READ_RESERVATION 0x01 15762306a36Sopenharmony_ci#define REPORT_CAPABILITES 0x02 15862306a36Sopenharmony_ci#define READ_FULL_STATUS 0x03 15962306a36Sopenharmony_ci/* values for variable length command */ 16062306a36Sopenharmony_ci#define XDREAD_32 0x03 16162306a36Sopenharmony_ci#define XDWRITE_32 0x04 16262306a36Sopenharmony_ci#define XPWRITE_32 0x06 16362306a36Sopenharmony_ci#define XDWRITEREAD_32 0x07 16462306a36Sopenharmony_ci#define READ_32 0x09 16562306a36Sopenharmony_ci#define VERIFY_32 0x0a 16662306a36Sopenharmony_ci#define WRITE_32 0x0b 16762306a36Sopenharmony_ci#define WRITE_VERIFY_32 0x0c 16862306a36Sopenharmony_ci#define WRITE_SAME_32 0x0d 16962306a36Sopenharmony_ci#define ATA_32 0x1ff0 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ci/* Values for T10/04-262r7 */ 17262306a36Sopenharmony_ci#define ATA_16 0x85 /* 16-byte pass-thru */ 17362306a36Sopenharmony_ci#define ATA_12 0xa1 /* 12-byte pass-thru */ 17462306a36Sopenharmony_ci 17562306a36Sopenharmony_ci/* Vendor specific CDBs start here */ 17662306a36Sopenharmony_ci#define VENDOR_SPECIFIC_CDB 0xc0 17762306a36Sopenharmony_ci 17862306a36Sopenharmony_ci/* 17962306a36Sopenharmony_ci * SCSI command lengths 18062306a36Sopenharmony_ci */ 18162306a36Sopenharmony_ci 18262306a36Sopenharmony_ci#define SCSI_MAX_VARLEN_CDB_SIZE 260 18362306a36Sopenharmony_ci 18462306a36Sopenharmony_ci/* defined in T10 SCSI Primary Commands-2 (SPC2) */ 18562306a36Sopenharmony_cistruct scsi_varlen_cdb_hdr { 18662306a36Sopenharmony_ci __u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */ 18762306a36Sopenharmony_ci __u8 control; 18862306a36Sopenharmony_ci __u8 misc[5]; 18962306a36Sopenharmony_ci __u8 additional_cdb_length; /* total cdb length - 8 */ 19062306a36Sopenharmony_ci __be16 service_action; 19162306a36Sopenharmony_ci /* service specific data follows */ 19262306a36Sopenharmony_ci}; 19362306a36Sopenharmony_ci 19462306a36Sopenharmony_ci/* 19562306a36Sopenharmony_ci * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft 19662306a36Sopenharmony_ci * T10/1561-D Revision 4 Draft dated 7th November 2002. 19762306a36Sopenharmony_ci */ 19862306a36Sopenharmony_cienum sam_status { 19962306a36Sopenharmony_ci SAM_STAT_GOOD = 0x00, 20062306a36Sopenharmony_ci SAM_STAT_CHECK_CONDITION = 0x02, 20162306a36Sopenharmony_ci SAM_STAT_CONDITION_MET = 0x04, 20262306a36Sopenharmony_ci SAM_STAT_BUSY = 0x08, 20362306a36Sopenharmony_ci SAM_STAT_INTERMEDIATE = 0x10, 20462306a36Sopenharmony_ci SAM_STAT_INTERMEDIATE_CONDITION_MET = 0x14, 20562306a36Sopenharmony_ci SAM_STAT_RESERVATION_CONFLICT = 0x18, 20662306a36Sopenharmony_ci SAM_STAT_COMMAND_TERMINATED = 0x22, /* obsolete in SAM-3 */ 20762306a36Sopenharmony_ci SAM_STAT_TASK_SET_FULL = 0x28, 20862306a36Sopenharmony_ci SAM_STAT_ACA_ACTIVE = 0x30, 20962306a36Sopenharmony_ci SAM_STAT_TASK_ABORTED = 0x40, 21062306a36Sopenharmony_ci}; 21162306a36Sopenharmony_ci 21262306a36Sopenharmony_ci#define STATUS_MASK 0xfe 21362306a36Sopenharmony_ci 21462306a36Sopenharmony_ci/* 21562306a36Sopenharmony_ci * SENSE KEYS 21662306a36Sopenharmony_ci */ 21762306a36Sopenharmony_ci#define NO_SENSE 0x00 21862306a36Sopenharmony_ci#define RECOVERED_ERROR 0x01 21962306a36Sopenharmony_ci#define NOT_READY 0x02 22062306a36Sopenharmony_ci#define MEDIUM_ERROR 0x03 22162306a36Sopenharmony_ci#define HARDWARE_ERROR 0x04 22262306a36Sopenharmony_ci#define ILLEGAL_REQUEST 0x05 22362306a36Sopenharmony_ci#define UNIT_ATTENTION 0x06 22462306a36Sopenharmony_ci#define DATA_PROTECT 0x07 22562306a36Sopenharmony_ci#define BLANK_CHECK 0x08 22662306a36Sopenharmony_ci#define VENDOR_SPECIFIC 0x09 22762306a36Sopenharmony_ci#define COPY_ABORTED 0x0a 22862306a36Sopenharmony_ci#define ABORTED_COMMAND 0x0b 22962306a36Sopenharmony_ci#define VOLUME_OVERFLOW 0x0d 23062306a36Sopenharmony_ci#define MISCOMPARE 0x0e 23162306a36Sopenharmony_ci#define COMPLETED 0x0f 23262306a36Sopenharmony_ci 23362306a36Sopenharmony_ci/* 23462306a36Sopenharmony_ci * DEVICE TYPES 23562306a36Sopenharmony_ci * Please keep them in 0x%02x format for $MODALIAS to work 23662306a36Sopenharmony_ci */ 23762306a36Sopenharmony_ci 23862306a36Sopenharmony_ci#define TYPE_DISK 0x00 23962306a36Sopenharmony_ci#define TYPE_TAPE 0x01 24062306a36Sopenharmony_ci#define TYPE_PRINTER 0x02 24162306a36Sopenharmony_ci#define TYPE_PROCESSOR 0x03 /* HP scanners use this */ 24262306a36Sopenharmony_ci#define TYPE_WORM 0x04 /* Treated as ROM by our system */ 24362306a36Sopenharmony_ci#define TYPE_ROM 0x05 24462306a36Sopenharmony_ci#define TYPE_SCANNER 0x06 24562306a36Sopenharmony_ci#define TYPE_MOD 0x07 /* Magneto-optical disk - 24662306a36Sopenharmony_ci * - treated as TYPE_DISK */ 24762306a36Sopenharmony_ci#define TYPE_MEDIUM_CHANGER 0x08 24862306a36Sopenharmony_ci#define TYPE_COMM 0x09 /* Communications device */ 24962306a36Sopenharmony_ci#define TYPE_RAID 0x0c 25062306a36Sopenharmony_ci#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ 25162306a36Sopenharmony_ci#define TYPE_RBC 0x0e 25262306a36Sopenharmony_ci#define TYPE_OSD 0x11 25362306a36Sopenharmony_ci#define TYPE_ZBC 0x14 25462306a36Sopenharmony_ci#define TYPE_WLUN 0x1e /* well-known logical unit */ 25562306a36Sopenharmony_ci#define TYPE_NO_LUN 0x7f 25662306a36Sopenharmony_ci 25762306a36Sopenharmony_ci/* SCSI protocols; these are taken from SPC-3 section 7.5 */ 25862306a36Sopenharmony_cienum scsi_protocol { 25962306a36Sopenharmony_ci SCSI_PROTOCOL_FCP = 0, /* Fibre Channel */ 26062306a36Sopenharmony_ci SCSI_PROTOCOL_SPI = 1, /* parallel SCSI */ 26162306a36Sopenharmony_ci SCSI_PROTOCOL_SSA = 2, /* Serial Storage Architecture - Obsolete */ 26262306a36Sopenharmony_ci SCSI_PROTOCOL_SBP = 3, /* firewire */ 26362306a36Sopenharmony_ci SCSI_PROTOCOL_SRP = 4, /* Infiniband RDMA */ 26462306a36Sopenharmony_ci SCSI_PROTOCOL_ISCSI = 5, 26562306a36Sopenharmony_ci SCSI_PROTOCOL_SAS = 6, 26662306a36Sopenharmony_ci SCSI_PROTOCOL_ADT = 7, /* Media Changers */ 26762306a36Sopenharmony_ci SCSI_PROTOCOL_ATA = 8, 26862306a36Sopenharmony_ci SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */ 26962306a36Sopenharmony_ci}; 27062306a36Sopenharmony_ci 27162306a36Sopenharmony_ci/* 27262306a36Sopenharmony_ci * ScsiLun: 8 byte LUN. 27362306a36Sopenharmony_ci */ 27462306a36Sopenharmony_cistruct scsi_lun { 27562306a36Sopenharmony_ci __u8 scsi_lun[8]; 27662306a36Sopenharmony_ci}; 27762306a36Sopenharmony_ci 27862306a36Sopenharmony_ci/* SPC asymmetric access states */ 27962306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_OPTIMAL 0x00 28062306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_ACTIVE 0x01 28162306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_STANDBY 0x02 28262306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_UNAVAILABLE 0x03 28362306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_LBA 0x04 28462306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_OFFLINE 0x0e 28562306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_TRANSITIONING 0x0f 28662306a36Sopenharmony_ci 28762306a36Sopenharmony_ci/* Values for REPORT TARGET GROUP STATES */ 28862306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_MASK 0x0f 28962306a36Sopenharmony_ci#define SCSI_ACCESS_STATE_PREFERRED 0x80 29062306a36Sopenharmony_ci 29162306a36Sopenharmony_ci/* Reporting options for REPORT ZONES */ 29262306a36Sopenharmony_cienum zbc_zone_reporting_options { 29362306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_ALL = 0x00, 29462306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_EMPTY = 0x01, 29562306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_IMPLICIT_OPEN = 0x02, 29662306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_EXPLICIT_OPEN = 0x03, 29762306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_CLOSED = 0x04, 29862306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_FULL = 0x05, 29962306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_READONLY = 0x06, 30062306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_OFFLINE = 0x07, 30162306a36Sopenharmony_ci /* 0x08 to 0x0f are reserved */ 30262306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_NEED_RESET_WP = 0x10, 30362306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_NON_SEQWRITE = 0x11, 30462306a36Sopenharmony_ci /* 0x12 to 0x3e are reserved */ 30562306a36Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_NON_WP = 0x3f, 30662306a36Sopenharmony_ci}; 30762306a36Sopenharmony_ci 30862306a36Sopenharmony_ci#define ZBC_REPORT_ZONE_PARTIAL 0x80 30962306a36Sopenharmony_ci 31062306a36Sopenharmony_ci/* Zone types of REPORT ZONES zone descriptors */ 31162306a36Sopenharmony_cienum zbc_zone_type { 31262306a36Sopenharmony_ci ZBC_ZONE_TYPE_CONV = 0x1, 31362306a36Sopenharmony_ci ZBC_ZONE_TYPE_SEQWRITE_REQ = 0x2, 31462306a36Sopenharmony_ci ZBC_ZONE_TYPE_SEQWRITE_PREF = 0x3, 31562306a36Sopenharmony_ci ZBC_ZONE_TYPE_SEQ_OR_BEFORE_REQ = 0x4, 31662306a36Sopenharmony_ci ZBC_ZONE_TYPE_GAP = 0x5, 31762306a36Sopenharmony_ci /* 0x6 to 0xf are reserved */ 31862306a36Sopenharmony_ci}; 31962306a36Sopenharmony_ci 32062306a36Sopenharmony_ci/* Zone conditions of REPORT ZONES zone descriptors */ 32162306a36Sopenharmony_cienum zbc_zone_cond { 32262306a36Sopenharmony_ci ZBC_ZONE_COND_NO_WP = 0x0, 32362306a36Sopenharmony_ci ZBC_ZONE_COND_EMPTY = 0x1, 32462306a36Sopenharmony_ci ZBC_ZONE_COND_IMP_OPEN = 0x2, 32562306a36Sopenharmony_ci ZBC_ZONE_COND_EXP_OPEN = 0x3, 32662306a36Sopenharmony_ci ZBC_ZONE_COND_CLOSED = 0x4, 32762306a36Sopenharmony_ci /* 0x5 to 0xc are reserved */ 32862306a36Sopenharmony_ci ZBC_ZONE_COND_READONLY = 0xd, 32962306a36Sopenharmony_ci ZBC_ZONE_COND_FULL = 0xe, 33062306a36Sopenharmony_ci ZBC_ZONE_COND_OFFLINE = 0xf, 33162306a36Sopenharmony_ci}; 33262306a36Sopenharmony_ci 33362306a36Sopenharmony_cienum zbc_zone_alignment_method { 33462306a36Sopenharmony_ci ZBC_CONSTANT_ZONE_LENGTH = 0x1, 33562306a36Sopenharmony_ci ZBC_CONSTANT_ZONE_START_OFFSET = 0x8, 33662306a36Sopenharmony_ci}; 33762306a36Sopenharmony_ci 33862306a36Sopenharmony_ci/* Version descriptor values for INQUIRY */ 33962306a36Sopenharmony_cienum scsi_version_descriptor { 34062306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_FCP4 = 0x0a40, 34162306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_ISCSI = 0x0960, 34262306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_SAM5 = 0x00a0, 34362306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_SAS3 = 0x0c60, 34462306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_SBC3 = 0x04c0, 34562306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_SBP3 = 0x0980, 34662306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_SPC4 = 0x0460, 34762306a36Sopenharmony_ci SCSI_VERSION_DESCRIPTOR_SRP = 0x0940 34862306a36Sopenharmony_ci}; 34962306a36Sopenharmony_ci 35062306a36Sopenharmony_cienum scsi_support_opcode { 35162306a36Sopenharmony_ci SCSI_SUPPORT_NO_INFO = 0, 35262306a36Sopenharmony_ci SCSI_SUPPORT_NOT_SUPPORTED = 1, 35362306a36Sopenharmony_ci SCSI_SUPPORT_FULL = 3, 35462306a36Sopenharmony_ci SCSI_SUPPORT_VENDOR = 5, 35562306a36Sopenharmony_ci}; 35662306a36Sopenharmony_ci 35762306a36Sopenharmony_ci#define SCSI_CONTROL_MASK 0 35862306a36Sopenharmony_ci#define SCSI_GROUP_NUMBER_MASK 0 35962306a36Sopenharmony_ci 36062306a36Sopenharmony_ci#endif /* _SCSI_PROTO_H_ */ 361