18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * This header file contains public constants and structures used by 48c2ecf20Sopenharmony_ci * both the SCSI initiator and the SCSI target code. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * For documentation on the OPCODES, MESSAGES, and SENSE values, 78c2ecf20Sopenharmony_ci * please consult the SCSI standard. 88c2ecf20Sopenharmony_ci */ 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#ifndef _SCSI_PROTO_H_ 118c2ecf20Sopenharmony_ci#define _SCSI_PROTO_H_ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#include <linux/types.h> 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ci/* 168c2ecf20Sopenharmony_ci * SCSI opcodes 178c2ecf20Sopenharmony_ci */ 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#define TEST_UNIT_READY 0x00 208c2ecf20Sopenharmony_ci#define REZERO_UNIT 0x01 218c2ecf20Sopenharmony_ci#define REQUEST_SENSE 0x03 228c2ecf20Sopenharmony_ci#define FORMAT_UNIT 0x04 238c2ecf20Sopenharmony_ci#define READ_BLOCK_LIMITS 0x05 248c2ecf20Sopenharmony_ci#define REASSIGN_BLOCKS 0x07 258c2ecf20Sopenharmony_ci#define INITIALIZE_ELEMENT_STATUS 0x07 268c2ecf20Sopenharmony_ci#define READ_6 0x08 278c2ecf20Sopenharmony_ci#define WRITE_6 0x0a 288c2ecf20Sopenharmony_ci#define SEEK_6 0x0b 298c2ecf20Sopenharmony_ci#define READ_REVERSE 0x0f 308c2ecf20Sopenharmony_ci#define WRITE_FILEMARKS 0x10 318c2ecf20Sopenharmony_ci#define SPACE 0x11 328c2ecf20Sopenharmony_ci#define INQUIRY 0x12 338c2ecf20Sopenharmony_ci#define RECOVER_BUFFERED_DATA 0x14 348c2ecf20Sopenharmony_ci#define MODE_SELECT 0x15 358c2ecf20Sopenharmony_ci#define RESERVE 0x16 368c2ecf20Sopenharmony_ci#define RELEASE 0x17 378c2ecf20Sopenharmony_ci#define COPY 0x18 388c2ecf20Sopenharmony_ci#define ERASE 0x19 398c2ecf20Sopenharmony_ci#define MODE_SENSE 0x1a 408c2ecf20Sopenharmony_ci#define START_STOP 0x1b 418c2ecf20Sopenharmony_ci#define RECEIVE_DIAGNOSTIC 0x1c 428c2ecf20Sopenharmony_ci#define SEND_DIAGNOSTIC 0x1d 438c2ecf20Sopenharmony_ci#define ALLOW_MEDIUM_REMOVAL 0x1e 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define READ_FORMAT_CAPACITIES 0x23 468c2ecf20Sopenharmony_ci#define SET_WINDOW 0x24 478c2ecf20Sopenharmony_ci#define READ_CAPACITY 0x25 488c2ecf20Sopenharmony_ci#define READ_10 0x28 498c2ecf20Sopenharmony_ci#define WRITE_10 0x2a 508c2ecf20Sopenharmony_ci#define SEEK_10 0x2b 518c2ecf20Sopenharmony_ci#define POSITION_TO_ELEMENT 0x2b 528c2ecf20Sopenharmony_ci#define WRITE_VERIFY 0x2e 538c2ecf20Sopenharmony_ci#define VERIFY 0x2f 548c2ecf20Sopenharmony_ci#define SEARCH_HIGH 0x30 558c2ecf20Sopenharmony_ci#define SEARCH_EQUAL 0x31 568c2ecf20Sopenharmony_ci#define SEARCH_LOW 0x32 578c2ecf20Sopenharmony_ci#define SET_LIMITS 0x33 588c2ecf20Sopenharmony_ci#define PRE_FETCH 0x34 598c2ecf20Sopenharmony_ci#define READ_POSITION 0x34 608c2ecf20Sopenharmony_ci#define SYNCHRONIZE_CACHE 0x35 618c2ecf20Sopenharmony_ci#define LOCK_UNLOCK_CACHE 0x36 628c2ecf20Sopenharmony_ci#define READ_DEFECT_DATA 0x37 638c2ecf20Sopenharmony_ci#define MEDIUM_SCAN 0x38 648c2ecf20Sopenharmony_ci#define COMPARE 0x39 658c2ecf20Sopenharmony_ci#define COPY_VERIFY 0x3a 668c2ecf20Sopenharmony_ci#define WRITE_BUFFER 0x3b 678c2ecf20Sopenharmony_ci#define READ_BUFFER 0x3c 688c2ecf20Sopenharmony_ci#define UPDATE_BLOCK 0x3d 698c2ecf20Sopenharmony_ci#define READ_LONG 0x3e 708c2ecf20Sopenharmony_ci#define WRITE_LONG 0x3f 718c2ecf20Sopenharmony_ci#define CHANGE_DEFINITION 0x40 728c2ecf20Sopenharmony_ci#define WRITE_SAME 0x41 738c2ecf20Sopenharmony_ci#define UNMAP 0x42 748c2ecf20Sopenharmony_ci#define READ_TOC 0x43 758c2ecf20Sopenharmony_ci#define READ_HEADER 0x44 768c2ecf20Sopenharmony_ci#define GET_EVENT_STATUS_NOTIFICATION 0x4a 778c2ecf20Sopenharmony_ci#define LOG_SELECT 0x4c 788c2ecf20Sopenharmony_ci#define LOG_SENSE 0x4d 798c2ecf20Sopenharmony_ci#define XDWRITEREAD_10 0x53 808c2ecf20Sopenharmony_ci#define MODE_SELECT_10 0x55 818c2ecf20Sopenharmony_ci#define RESERVE_10 0x56 828c2ecf20Sopenharmony_ci#define RELEASE_10 0x57 838c2ecf20Sopenharmony_ci#define MODE_SENSE_10 0x5a 848c2ecf20Sopenharmony_ci#define PERSISTENT_RESERVE_IN 0x5e 858c2ecf20Sopenharmony_ci#define PERSISTENT_RESERVE_OUT 0x5f 868c2ecf20Sopenharmony_ci#define VARIABLE_LENGTH_CMD 0x7f 878c2ecf20Sopenharmony_ci#define REPORT_LUNS 0xa0 888c2ecf20Sopenharmony_ci#define SECURITY_PROTOCOL_IN 0xa2 898c2ecf20Sopenharmony_ci#define MAINTENANCE_IN 0xa3 908c2ecf20Sopenharmony_ci#define MAINTENANCE_OUT 0xa4 918c2ecf20Sopenharmony_ci#define MOVE_MEDIUM 0xa5 928c2ecf20Sopenharmony_ci#define EXCHANGE_MEDIUM 0xa6 938c2ecf20Sopenharmony_ci#define READ_12 0xa8 948c2ecf20Sopenharmony_ci#define SERVICE_ACTION_OUT_12 0xa9 958c2ecf20Sopenharmony_ci#define WRITE_12 0xaa 968c2ecf20Sopenharmony_ci#define READ_MEDIA_SERIAL_NUMBER 0xab /* Obsolete with SPC-2 */ 978c2ecf20Sopenharmony_ci#define SERVICE_ACTION_IN_12 0xab 988c2ecf20Sopenharmony_ci#define WRITE_VERIFY_12 0xae 998c2ecf20Sopenharmony_ci#define VERIFY_12 0xaf 1008c2ecf20Sopenharmony_ci#define SEARCH_HIGH_12 0xb0 1018c2ecf20Sopenharmony_ci#define SEARCH_EQUAL_12 0xb1 1028c2ecf20Sopenharmony_ci#define SEARCH_LOW_12 0xb2 1038c2ecf20Sopenharmony_ci#define SECURITY_PROTOCOL_OUT 0xb5 1048c2ecf20Sopenharmony_ci#define READ_ELEMENT_STATUS 0xb8 1058c2ecf20Sopenharmony_ci#define SEND_VOLUME_TAG 0xb6 1068c2ecf20Sopenharmony_ci#define WRITE_LONG_2 0xea 1078c2ecf20Sopenharmony_ci#define EXTENDED_COPY 0x83 1088c2ecf20Sopenharmony_ci#define RECEIVE_COPY_RESULTS 0x84 1098c2ecf20Sopenharmony_ci#define ACCESS_CONTROL_IN 0x86 1108c2ecf20Sopenharmony_ci#define ACCESS_CONTROL_OUT 0x87 1118c2ecf20Sopenharmony_ci#define READ_16 0x88 1128c2ecf20Sopenharmony_ci#define COMPARE_AND_WRITE 0x89 1138c2ecf20Sopenharmony_ci#define WRITE_16 0x8a 1148c2ecf20Sopenharmony_ci#define READ_ATTRIBUTE 0x8c 1158c2ecf20Sopenharmony_ci#define WRITE_ATTRIBUTE 0x8d 1168c2ecf20Sopenharmony_ci#define WRITE_VERIFY_16 0x8e 1178c2ecf20Sopenharmony_ci#define VERIFY_16 0x8f 1188c2ecf20Sopenharmony_ci#define SYNCHRONIZE_CACHE_16 0x91 1198c2ecf20Sopenharmony_ci#define WRITE_SAME_16 0x93 1208c2ecf20Sopenharmony_ci#define ZBC_OUT 0x94 1218c2ecf20Sopenharmony_ci#define ZBC_IN 0x95 1228c2ecf20Sopenharmony_ci#define SERVICE_ACTION_BIDIRECTIONAL 0x9d 1238c2ecf20Sopenharmony_ci#define SERVICE_ACTION_IN_16 0x9e 1248c2ecf20Sopenharmony_ci#define SERVICE_ACTION_OUT_16 0x9f 1258c2ecf20Sopenharmony_ci/* values for service action in */ 1268c2ecf20Sopenharmony_ci#define SAI_READ_CAPACITY_16 0x10 1278c2ecf20Sopenharmony_ci#define SAI_GET_LBA_STATUS 0x12 1288c2ecf20Sopenharmony_ci#define SAI_REPORT_REFERRALS 0x13 1298c2ecf20Sopenharmony_ci/* values for maintenance in */ 1308c2ecf20Sopenharmony_ci#define MI_REPORT_IDENTIFYING_INFORMATION 0x05 1318c2ecf20Sopenharmony_ci#define MI_REPORT_TARGET_PGS 0x0a 1328c2ecf20Sopenharmony_ci#define MI_REPORT_ALIASES 0x0b 1338c2ecf20Sopenharmony_ci#define MI_REPORT_SUPPORTED_OPERATION_CODES 0x0c 1348c2ecf20Sopenharmony_ci#define MI_REPORT_SUPPORTED_TASK_MANAGEMENT_FUNCTIONS 0x0d 1358c2ecf20Sopenharmony_ci#define MI_REPORT_PRIORITY 0x0e 1368c2ecf20Sopenharmony_ci#define MI_REPORT_TIMESTAMP 0x0f 1378c2ecf20Sopenharmony_ci#define MI_MANAGEMENT_PROTOCOL_IN 0x10 1388c2ecf20Sopenharmony_ci/* value for MI_REPORT_TARGET_PGS ext header */ 1398c2ecf20Sopenharmony_ci#define MI_EXT_HDR_PARAM_FMT 0x20 1408c2ecf20Sopenharmony_ci/* values for maintenance out */ 1418c2ecf20Sopenharmony_ci#define MO_SET_IDENTIFYING_INFORMATION 0x06 1428c2ecf20Sopenharmony_ci#define MO_SET_TARGET_PGS 0x0a 1438c2ecf20Sopenharmony_ci#define MO_CHANGE_ALIASES 0x0b 1448c2ecf20Sopenharmony_ci#define MO_SET_PRIORITY 0x0e 1458c2ecf20Sopenharmony_ci#define MO_SET_TIMESTAMP 0x0f 1468c2ecf20Sopenharmony_ci#define MO_MANAGEMENT_PROTOCOL_OUT 0x10 1478c2ecf20Sopenharmony_ci/* values for ZBC_IN */ 1488c2ecf20Sopenharmony_ci#define ZI_REPORT_ZONES 0x00 1498c2ecf20Sopenharmony_ci/* values for ZBC_OUT */ 1508c2ecf20Sopenharmony_ci#define ZO_CLOSE_ZONE 0x01 1518c2ecf20Sopenharmony_ci#define ZO_FINISH_ZONE 0x02 1528c2ecf20Sopenharmony_ci#define ZO_OPEN_ZONE 0x03 1538c2ecf20Sopenharmony_ci#define ZO_RESET_WRITE_POINTER 0x04 1548c2ecf20Sopenharmony_ci/* values for variable length command */ 1558c2ecf20Sopenharmony_ci#define XDREAD_32 0x03 1568c2ecf20Sopenharmony_ci#define XDWRITE_32 0x04 1578c2ecf20Sopenharmony_ci#define XPWRITE_32 0x06 1588c2ecf20Sopenharmony_ci#define XDWRITEREAD_32 0x07 1598c2ecf20Sopenharmony_ci#define READ_32 0x09 1608c2ecf20Sopenharmony_ci#define VERIFY_32 0x0a 1618c2ecf20Sopenharmony_ci#define WRITE_32 0x0b 1628c2ecf20Sopenharmony_ci#define WRITE_VERIFY_32 0x0c 1638c2ecf20Sopenharmony_ci#define WRITE_SAME_32 0x0d 1648c2ecf20Sopenharmony_ci#define ATA_32 0x1ff0 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci/* Values for T10/04-262r7 */ 1678c2ecf20Sopenharmony_ci#define ATA_16 0x85 /* 16-byte pass-thru */ 1688c2ecf20Sopenharmony_ci#define ATA_12 0xa1 /* 12-byte pass-thru */ 1698c2ecf20Sopenharmony_ci 1708c2ecf20Sopenharmony_ci/* Vendor specific CDBs start here */ 1718c2ecf20Sopenharmony_ci#define VENDOR_SPECIFIC_CDB 0xc0 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_ci/* 1748c2ecf20Sopenharmony_ci * SCSI command lengths 1758c2ecf20Sopenharmony_ci */ 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci#define SCSI_MAX_VARLEN_CDB_SIZE 260 1788c2ecf20Sopenharmony_ci 1798c2ecf20Sopenharmony_ci/* defined in T10 SCSI Primary Commands-2 (SPC2) */ 1808c2ecf20Sopenharmony_cistruct scsi_varlen_cdb_hdr { 1818c2ecf20Sopenharmony_ci __u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */ 1828c2ecf20Sopenharmony_ci __u8 control; 1838c2ecf20Sopenharmony_ci __u8 misc[5]; 1848c2ecf20Sopenharmony_ci __u8 additional_cdb_length; /* total cdb length - 8 */ 1858c2ecf20Sopenharmony_ci __be16 service_action; 1868c2ecf20Sopenharmony_ci /* service specific data follows */ 1878c2ecf20Sopenharmony_ci}; 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_ci/* 1908c2ecf20Sopenharmony_ci * SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft 1918c2ecf20Sopenharmony_ci * T10/1561-D Revision 4 Draft dated 7th November 2002. 1928c2ecf20Sopenharmony_ci */ 1938c2ecf20Sopenharmony_ci#define SAM_STAT_GOOD 0x00 1948c2ecf20Sopenharmony_ci#define SAM_STAT_CHECK_CONDITION 0x02 1958c2ecf20Sopenharmony_ci#define SAM_STAT_CONDITION_MET 0x04 1968c2ecf20Sopenharmony_ci#define SAM_STAT_BUSY 0x08 1978c2ecf20Sopenharmony_ci#define SAM_STAT_INTERMEDIATE 0x10 1988c2ecf20Sopenharmony_ci#define SAM_STAT_INTERMEDIATE_CONDITION_MET 0x14 1998c2ecf20Sopenharmony_ci#define SAM_STAT_RESERVATION_CONFLICT 0x18 2008c2ecf20Sopenharmony_ci#define SAM_STAT_COMMAND_TERMINATED 0x22 /* obsolete in SAM-3 */ 2018c2ecf20Sopenharmony_ci#define SAM_STAT_TASK_SET_FULL 0x28 2028c2ecf20Sopenharmony_ci#define SAM_STAT_ACA_ACTIVE 0x30 2038c2ecf20Sopenharmony_ci#define SAM_STAT_TASK_ABORTED 0x40 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci/* 2068c2ecf20Sopenharmony_ci * Status codes. These are deprecated as they are shifted 1 bit right 2078c2ecf20Sopenharmony_ci * from those found in the SCSI standards. This causes confusion for 2088c2ecf20Sopenharmony_ci * applications that are ported to several OSes. Prefer SAM Status codes 2098c2ecf20Sopenharmony_ci * above. 2108c2ecf20Sopenharmony_ci */ 2118c2ecf20Sopenharmony_ci 2128c2ecf20Sopenharmony_ci#define GOOD 0x00 2138c2ecf20Sopenharmony_ci#define CHECK_CONDITION 0x01 2148c2ecf20Sopenharmony_ci#define CONDITION_GOOD 0x02 2158c2ecf20Sopenharmony_ci#define BUSY 0x04 2168c2ecf20Sopenharmony_ci#define INTERMEDIATE_GOOD 0x08 2178c2ecf20Sopenharmony_ci#define INTERMEDIATE_C_GOOD 0x0a 2188c2ecf20Sopenharmony_ci#define RESERVATION_CONFLICT 0x0c 2198c2ecf20Sopenharmony_ci#define COMMAND_TERMINATED 0x11 2208c2ecf20Sopenharmony_ci#define QUEUE_FULL 0x14 2218c2ecf20Sopenharmony_ci#define ACA_ACTIVE 0x18 2228c2ecf20Sopenharmony_ci#define TASK_ABORTED 0x20 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_ci#define STATUS_MASK 0xfe 2258c2ecf20Sopenharmony_ci 2268c2ecf20Sopenharmony_ci/* 2278c2ecf20Sopenharmony_ci * SENSE KEYS 2288c2ecf20Sopenharmony_ci */ 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ci#define NO_SENSE 0x00 2318c2ecf20Sopenharmony_ci#define RECOVERED_ERROR 0x01 2328c2ecf20Sopenharmony_ci#define NOT_READY 0x02 2338c2ecf20Sopenharmony_ci#define MEDIUM_ERROR 0x03 2348c2ecf20Sopenharmony_ci#define HARDWARE_ERROR 0x04 2358c2ecf20Sopenharmony_ci#define ILLEGAL_REQUEST 0x05 2368c2ecf20Sopenharmony_ci#define UNIT_ATTENTION 0x06 2378c2ecf20Sopenharmony_ci#define DATA_PROTECT 0x07 2388c2ecf20Sopenharmony_ci#define BLANK_CHECK 0x08 2398c2ecf20Sopenharmony_ci#define VENDOR_SPECIFIC 0x09 2408c2ecf20Sopenharmony_ci#define COPY_ABORTED 0x0a 2418c2ecf20Sopenharmony_ci#define ABORTED_COMMAND 0x0b 2428c2ecf20Sopenharmony_ci#define VOLUME_OVERFLOW 0x0d 2438c2ecf20Sopenharmony_ci#define MISCOMPARE 0x0e 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_ci 2468c2ecf20Sopenharmony_ci/* 2478c2ecf20Sopenharmony_ci * DEVICE TYPES 2488c2ecf20Sopenharmony_ci * Please keep them in 0x%02x format for $MODALIAS to work 2498c2ecf20Sopenharmony_ci */ 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_ci#define TYPE_DISK 0x00 2528c2ecf20Sopenharmony_ci#define TYPE_TAPE 0x01 2538c2ecf20Sopenharmony_ci#define TYPE_PRINTER 0x02 2548c2ecf20Sopenharmony_ci#define TYPE_PROCESSOR 0x03 /* HP scanners use this */ 2558c2ecf20Sopenharmony_ci#define TYPE_WORM 0x04 /* Treated as ROM by our system */ 2568c2ecf20Sopenharmony_ci#define TYPE_ROM 0x05 2578c2ecf20Sopenharmony_ci#define TYPE_SCANNER 0x06 2588c2ecf20Sopenharmony_ci#define TYPE_MOD 0x07 /* Magneto-optical disk - 2598c2ecf20Sopenharmony_ci * - treated as TYPE_DISK */ 2608c2ecf20Sopenharmony_ci#define TYPE_MEDIUM_CHANGER 0x08 2618c2ecf20Sopenharmony_ci#define TYPE_COMM 0x09 /* Communications device */ 2628c2ecf20Sopenharmony_ci#define TYPE_RAID 0x0c 2638c2ecf20Sopenharmony_ci#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ 2648c2ecf20Sopenharmony_ci#define TYPE_RBC 0x0e 2658c2ecf20Sopenharmony_ci#define TYPE_OSD 0x11 2668c2ecf20Sopenharmony_ci#define TYPE_ZBC 0x14 2678c2ecf20Sopenharmony_ci#define TYPE_WLUN 0x1e /* well-known logical unit */ 2688c2ecf20Sopenharmony_ci#define TYPE_NO_LUN 0x7f 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ci/* SCSI protocols; these are taken from SPC-3 section 7.5 */ 2718c2ecf20Sopenharmony_cienum scsi_protocol { 2728c2ecf20Sopenharmony_ci SCSI_PROTOCOL_FCP = 0, /* Fibre Channel */ 2738c2ecf20Sopenharmony_ci SCSI_PROTOCOL_SPI = 1, /* parallel SCSI */ 2748c2ecf20Sopenharmony_ci SCSI_PROTOCOL_SSA = 2, /* Serial Storage Architecture - Obsolete */ 2758c2ecf20Sopenharmony_ci SCSI_PROTOCOL_SBP = 3, /* firewire */ 2768c2ecf20Sopenharmony_ci SCSI_PROTOCOL_SRP = 4, /* Infiniband RDMA */ 2778c2ecf20Sopenharmony_ci SCSI_PROTOCOL_ISCSI = 5, 2788c2ecf20Sopenharmony_ci SCSI_PROTOCOL_SAS = 6, 2798c2ecf20Sopenharmony_ci SCSI_PROTOCOL_ADT = 7, /* Media Changers */ 2808c2ecf20Sopenharmony_ci SCSI_PROTOCOL_ATA = 8, 2818c2ecf20Sopenharmony_ci SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */ 2828c2ecf20Sopenharmony_ci}; 2838c2ecf20Sopenharmony_ci 2848c2ecf20Sopenharmony_ci/* 2858c2ecf20Sopenharmony_ci * ScsiLun: 8 byte LUN. 2868c2ecf20Sopenharmony_ci */ 2878c2ecf20Sopenharmony_cistruct scsi_lun { 2888c2ecf20Sopenharmony_ci __u8 scsi_lun[8]; 2898c2ecf20Sopenharmony_ci}; 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci/* SPC asymmetric access states */ 2928c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_OPTIMAL 0x00 2938c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_ACTIVE 0x01 2948c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_STANDBY 0x02 2958c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_UNAVAILABLE 0x03 2968c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_LBA 0x04 2978c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_OFFLINE 0x0e 2988c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_TRANSITIONING 0x0f 2998c2ecf20Sopenharmony_ci 3008c2ecf20Sopenharmony_ci/* Values for REPORT TARGET GROUP STATES */ 3018c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_MASK 0x0f 3028c2ecf20Sopenharmony_ci#define SCSI_ACCESS_STATE_PREFERRED 0x80 3038c2ecf20Sopenharmony_ci 3048c2ecf20Sopenharmony_ci/* Reporting options for REPORT ZONES */ 3058c2ecf20Sopenharmony_cienum zbc_zone_reporting_options { 3068c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_ALL = 0x00, 3078c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_EMPTY = 0x01, 3088c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_IMPLICIT_OPEN = 0x02, 3098c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_EXPLICIT_OPEN = 0x03, 3108c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_CLOSED = 0x04, 3118c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_FULL = 0x05, 3128c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_READONLY = 0x06, 3138c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_OFFLINE = 0x07, 3148c2ecf20Sopenharmony_ci /* 0x08 to 0x0f are reserved */ 3158c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_NEED_RESET_WP = 0x10, 3168c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_NON_SEQWRITE = 0x11, 3178c2ecf20Sopenharmony_ci /* 0x12 to 0x3e are reserved */ 3188c2ecf20Sopenharmony_ci ZBC_ZONE_REPORTING_OPTION_NON_WP = 0x3f, 3198c2ecf20Sopenharmony_ci}; 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_ci#define ZBC_REPORT_ZONE_PARTIAL 0x80 3228c2ecf20Sopenharmony_ci 3238c2ecf20Sopenharmony_ci/* Zone types of REPORT ZONES zone descriptors */ 3248c2ecf20Sopenharmony_cienum zbc_zone_type { 3258c2ecf20Sopenharmony_ci ZBC_ZONE_TYPE_CONV = 0x1, 3268c2ecf20Sopenharmony_ci ZBC_ZONE_TYPE_SEQWRITE_REQ = 0x2, 3278c2ecf20Sopenharmony_ci ZBC_ZONE_TYPE_SEQWRITE_PREF = 0x3, 3288c2ecf20Sopenharmony_ci /* 0x4 to 0xf are reserved */ 3298c2ecf20Sopenharmony_ci}; 3308c2ecf20Sopenharmony_ci 3318c2ecf20Sopenharmony_ci/* Zone conditions of REPORT ZONES zone descriptors */ 3328c2ecf20Sopenharmony_cienum zbc_zone_cond { 3338c2ecf20Sopenharmony_ci ZBC_ZONE_COND_NO_WP = 0x0, 3348c2ecf20Sopenharmony_ci ZBC_ZONE_COND_EMPTY = 0x1, 3358c2ecf20Sopenharmony_ci ZBC_ZONE_COND_IMP_OPEN = 0x2, 3368c2ecf20Sopenharmony_ci ZBC_ZONE_COND_EXP_OPEN = 0x3, 3378c2ecf20Sopenharmony_ci ZBC_ZONE_COND_CLOSED = 0x4, 3388c2ecf20Sopenharmony_ci /* 0x5 to 0xc are reserved */ 3398c2ecf20Sopenharmony_ci ZBC_ZONE_COND_READONLY = 0xd, 3408c2ecf20Sopenharmony_ci ZBC_ZONE_COND_FULL = 0xe, 3418c2ecf20Sopenharmony_ci ZBC_ZONE_COND_OFFLINE = 0xf, 3428c2ecf20Sopenharmony_ci}; 3438c2ecf20Sopenharmony_ci 3448c2ecf20Sopenharmony_ci#endif /* _SCSI_PROTO_H_ */ 345