Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 1 | /* Copyright (C) 1998, 1999 Free Software Foundation, Inc. |
| 2 | This file is part of the GNU C Library. |
| 3 | |
| 4 | The GNU C Library is free software; you can redistribute it and/or |
| 5 | modify it under the terms of the GNU Lesser General Public |
| 6 | License as published by the Free Software Foundation; either |
| 7 | version 2.1 of the License, or (at your option) any later version. |
| 8 | |
| 9 | The GNU C Library is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | Lesser General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Lesser General Public |
Blue Swirl | 70539e1 | 2010-03-07 15:48:43 +0000 | [diff] [blame] | 15 | License along with this library; if not, see <http://www.gnu.org/licenses/>. |
| 16 | */ |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 17 | |
| 18 | /* |
| 19 | * This header file contains public constants and structures used by |
| 20 | * the scsi code for linux. |
| 21 | */ |
Markus Armbruster | 121d071 | 2016-06-29 10:12:57 +0200 | [diff] [blame] | 22 | |
Markus Armbruster | 58ea30f | 2019-03-15 15:51:20 +0100 | [diff] [blame] | 23 | #ifndef SCSI_CONSTANTS_H |
| 24 | #define SCSI_CONSTANTS_H |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 25 | |
| 26 | /* |
| 27 | * SCSI opcodes |
| 28 | */ |
| 29 | |
| 30 | #define TEST_UNIT_READY 0x00 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 31 | #define REWIND 0x01 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 32 | #define REQUEST_SENSE 0x03 |
| 33 | #define FORMAT_UNIT 0x04 |
| 34 | #define READ_BLOCK_LIMITS 0x05 |
Christian Hoff | 40723a9 | 2012-06-14 15:55:27 +0200 | [diff] [blame] | 35 | #define INITIALIZE_ELEMENT_STATUS 0x07 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 36 | #define REASSIGN_BLOCKS 0x07 |
| 37 | #define READ_6 0x08 |
| 38 | #define WRITE_6 0x0a |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 39 | #define SET_CAPACITY 0x0b |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 40 | #define READ_REVERSE 0x0f |
| 41 | #define WRITE_FILEMARKS 0x10 |
| 42 | #define SPACE 0x11 |
| 43 | #define INQUIRY 0x12 |
| 44 | #define RECOVER_BUFFERED_DATA 0x14 |
| 45 | #define MODE_SELECT 0x15 |
| 46 | #define RESERVE 0x16 |
| 47 | #define RELEASE 0x17 |
| 48 | #define COPY 0x18 |
| 49 | #define ERASE 0x19 |
| 50 | #define MODE_SENSE 0x1a |
Christian Hoff | 15e58a2 | 2012-06-14 15:55:26 +0200 | [diff] [blame] | 51 | #define LOAD_UNLOAD 0x1b |
Jarkko Lavinen | 297b044 | 2016-06-28 21:51:52 +0300 | [diff] [blame] | 52 | #define SCAN 0x1b |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 53 | #define START_STOP 0x1b |
| 54 | #define RECEIVE_DIAGNOSTIC 0x1c |
| 55 | #define SEND_DIAGNOSTIC 0x1d |
| 56 | #define ALLOW_MEDIUM_REMOVAL 0x1e |
Jarkko Lavinen | 297b044 | 2016-06-28 21:51:52 +0300 | [diff] [blame] | 57 | #define SET_WINDOW 0x24 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 58 | #define READ_CAPACITY_10 0x25 |
Jarkko Lavinen | 297b044 | 2016-06-28 21:51:52 +0300 | [diff] [blame] | 59 | #define GET_WINDOW 0x25 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 60 | #define READ_10 0x28 |
| 61 | #define WRITE_10 0x2a |
Jarkko Lavinen | 297b044 | 2016-06-28 21:51:52 +0300 | [diff] [blame] | 62 | #define SEND 0x2a |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 63 | #define SEEK_10 0x2b |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 64 | #define LOCATE_10 0x2b |
Christian Hoff | 40723a9 | 2012-06-14 15:55:27 +0200 | [diff] [blame] | 65 | #define POSITION_TO_ELEMENT 0x2b |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 66 | #define WRITE_VERIFY_10 0x2e |
| 67 | #define VERIFY_10 0x2f |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 68 | #define SEARCH_HIGH 0x30 |
| 69 | #define SEARCH_EQUAL 0x31 |
Jarkko Lavinen | 297b044 | 2016-06-28 21:51:52 +0300 | [diff] [blame] | 70 | #define OBJECT_POSITION 0x31 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 71 | #define SEARCH_LOW 0x32 |
| 72 | #define SET_LIMITS 0x33 |
| 73 | #define PRE_FETCH 0x34 |
| 74 | #define READ_POSITION 0x34 |
Jarkko Lavinen | 297b044 | 2016-06-28 21:51:52 +0300 | [diff] [blame] | 75 | #define GET_DATA_BUFFER_STATUS 0x34 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 76 | #define SYNCHRONIZE_CACHE 0x35 |
| 77 | #define LOCK_UNLOCK_CACHE 0x36 |
Christian Hoff | 40723a9 | 2012-06-14 15:55:27 +0200 | [diff] [blame] | 78 | #define INITIALIZE_ELEMENT_STATUS_WITH_RANGE 0x37 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 79 | #define READ_DEFECT_DATA 0x37 |
| 80 | #define MEDIUM_SCAN 0x38 |
| 81 | #define COMPARE 0x39 |
| 82 | #define COPY_VERIFY 0x3a |
| 83 | #define WRITE_BUFFER 0x3b |
| 84 | #define READ_BUFFER 0x3c |
| 85 | #define UPDATE_BLOCK 0x3d |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 86 | #define READ_LONG_10 0x3e |
| 87 | #define WRITE_LONG_10 0x3f |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 88 | #define CHANGE_DEFINITION 0x40 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 89 | #define WRITE_SAME_10 0x41 |
| 90 | #define UNMAP 0x42 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 91 | #define READ_TOC 0x43 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 92 | #define REPORT_DENSITY_SUPPORT 0x44 |
| 93 | #define GET_CONFIGURATION 0x46 |
Paolo Bonzini | 3e46d87 | 2012-04-19 15:43:41 +0200 | [diff] [blame] | 94 | #define SANITIZE 0x48 |
Paolo Bonzini | 6dc06f0 | 2011-08-03 10:49:17 +0200 | [diff] [blame] | 95 | #define GET_EVENT_STATUS_NOTIFICATION 0x4a |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 96 | #define LOG_SELECT 0x4c |
| 97 | #define LOG_SENSE 0x4d |
Paolo Bonzini | 1a4f0c3 | 2012-05-25 12:59:55 +0200 | [diff] [blame] | 98 | #define READ_DISC_INFORMATION 0x51 |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 99 | #define RESERVE_TRACK 0x53 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 100 | #define MODE_SELECT_10 0x55 |
| 101 | #define RESERVE_10 0x56 |
| 102 | #define RELEASE_10 0x57 |
| 103 | #define MODE_SENSE_10 0x5a |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 104 | #define SEND_CUE_SHEET 0x5d |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 105 | #define PERSISTENT_RESERVE_IN 0x5e |
| 106 | #define PERSISTENT_RESERVE_OUT 0x5f |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 107 | #define VARLENGTH_CDB 0x7f |
| 108 | #define WRITE_FILEMARKS_16 0x80 |
Paolo Bonzini | 065c259 | 2012-05-04 10:28:55 +0200 | [diff] [blame] | 109 | #define READ_REVERSE_16 0x81 |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 110 | #define ALLOW_OVERWRITE 0x82 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 111 | #define EXTENDED_COPY 0x83 |
Cong Meng | e4b6526 | 2012-08-03 12:02:19 +0800 | [diff] [blame] | 112 | #define ATA_PASSTHROUGH_16 0x85 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 113 | #define ACCESS_CONTROL_IN 0x86 |
| 114 | #define ACCESS_CONTROL_OUT 0x87 |
| 115 | #define READ_16 0x88 |
| 116 | #define COMPARE_AND_WRITE 0x89 |
| 117 | #define WRITE_16 0x8a |
| 118 | #define WRITE_VERIFY_16 0x8e |
| 119 | #define VERIFY_16 0x8f |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 120 | #define PRE_FETCH_16 0x90 |
| 121 | #define SPACE_16 0x91 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 122 | #define SYNCHRONIZE_CACHE_16 0x91 |
| 123 | #define LOCATE_16 0x92 |
Christoph Hellwig | ea3bd56 | 2010-12-16 19:36:43 +0100 | [diff] [blame] | 124 | #define WRITE_SAME_16 0x93 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 125 | #define ERASE_16 0x93 |
Paolo Bonzini | f651526 | 2011-09-06 12:31:42 +0200 | [diff] [blame] | 126 | #define SERVICE_ACTION_IN_16 0x9e |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 127 | #define WRITE_LONG_16 0x9f |
| 128 | #define REPORT_LUNS 0xa0 |
Cong Meng | e4b6526 | 2012-08-03 12:02:19 +0800 | [diff] [blame] | 129 | #define ATA_PASSTHROUGH_12 0xa1 |
Nicholas Bellinger | c7126d5 | 2010-06-16 06:43:06 -0700 | [diff] [blame] | 130 | #define MAINTENANCE_IN 0xa3 |
| 131 | #define MAINTENANCE_OUT 0xa4 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 132 | #define MOVE_MEDIUM 0xa5 |
Christian Hoff | 40723a9 | 2012-06-14 15:55:27 +0200 | [diff] [blame] | 133 | #define EXCHANGE_MEDIUM 0xa6 |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 134 | #define SET_READ_AHEAD 0xa7 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 135 | #define READ_12 0xa8 |
| 136 | #define WRITE_12 0xaa |
Paolo Bonzini | f651526 | 2011-09-06 12:31:42 +0200 | [diff] [blame] | 137 | #define SERVICE_ACTION_IN_12 0xab |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 138 | #define ERASE_12 0xac |
Paolo Bonzini | b6c251a | 2011-09-13 14:33:47 +0200 | [diff] [blame] | 139 | #define READ_DVD_STRUCTURE 0xad |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 140 | #define WRITE_VERIFY_12 0xae |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 141 | #define VERIFY_12 0xaf |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 142 | #define SEARCH_HIGH_12 0xb0 |
| 143 | #define SEARCH_EQUAL_12 0xb1 |
| 144 | #define SEARCH_LOW_12 0xb2 |
| 145 | #define READ_ELEMENT_STATUS 0xb8 |
| 146 | #define SEND_VOLUME_TAG 0xb6 |
Hannes Reinecke | 5e30a07 | 2011-07-22 16:51:15 +0200 | [diff] [blame] | 147 | #define READ_DEFECT_DATA_12 0xb7 |
| 148 | #define SET_CD_SPEED 0xbb |
Paolo Bonzini | b6c251a | 2011-09-13 14:33:47 +0200 | [diff] [blame] | 149 | #define MECHANISM_STATUS 0xbd |
| 150 | #define READ_CD 0xbe |
Paolo Bonzini | 00a01ad | 2011-11-14 14:31:48 +0100 | [diff] [blame] | 151 | #define SEND_DVD_STRUCTURE 0xbf |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 152 | |
| 153 | /* |
Paolo Bonzini | f651526 | 2011-09-06 12:31:42 +0200 | [diff] [blame] | 154 | * SERVICE ACTION IN subcodes |
| 155 | */ |
| 156 | #define SAI_READ_CAPACITY_16 0x10 |
| 157 | |
| 158 | /* |
Christian Hoff | 9ce1bb2 | 2012-06-14 15:55:28 +0200 | [diff] [blame] | 159 | * READ POSITION service action codes |
| 160 | */ |
| 161 | #define SHORT_FORM_BLOCK_ID 0x00 |
| 162 | #define SHORT_FORM_VENDOR_SPECIFIC 0x01 |
| 163 | #define LONG_FORM 0x06 |
| 164 | #define EXTENDED_FORM 0x08 |
| 165 | |
| 166 | /* |
Hannes Reinecke | f017132 | 2010-11-24 12:15:57 +0100 | [diff] [blame] | 167 | * SAM Status codes |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 168 | */ |
| 169 | |
| 170 | #define GOOD 0x00 |
Hannes Reinecke | f017132 | 2010-11-24 12:15:57 +0100 | [diff] [blame] | 171 | #define CHECK_CONDITION 0x02 |
| 172 | #define CONDITION_GOOD 0x04 |
| 173 | #define BUSY 0x08 |
| 174 | #define INTERMEDIATE_GOOD 0x10 |
| 175 | #define INTERMEDIATE_C_GOOD 0x14 |
| 176 | #define RESERVATION_CONFLICT 0x18 |
| 177 | #define COMMAND_TERMINATED 0x22 |
| 178 | #define TASK_SET_FULL 0x28 |
| 179 | #define ACA_ACTIVE 0x30 |
| 180 | #define TASK_ABORTED 0x40 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 181 | |
| 182 | #define STATUS_MASK 0x3e |
| 183 | |
| 184 | /* |
| 185 | * SENSE KEYS |
| 186 | */ |
| 187 | |
| 188 | #define NO_SENSE 0x00 |
| 189 | #define RECOVERED_ERROR 0x01 |
| 190 | #define NOT_READY 0x02 |
| 191 | #define MEDIUM_ERROR 0x03 |
| 192 | #define HARDWARE_ERROR 0x04 |
| 193 | #define ILLEGAL_REQUEST 0x05 |
| 194 | #define UNIT_ATTENTION 0x06 |
| 195 | #define DATA_PROTECT 0x07 |
| 196 | #define BLANK_CHECK 0x08 |
| 197 | #define COPY_ABORTED 0x0a |
| 198 | #define ABORTED_COMMAND 0x0b |
| 199 | #define VOLUME_OVERFLOW 0x0d |
| 200 | #define MISCOMPARE 0x0e |
| 201 | |
| 202 | |
| 203 | /* |
| 204 | * DEVICE TYPES |
| 205 | */ |
| 206 | |
| 207 | #define TYPE_DISK 0x00 |
| 208 | #define TYPE_TAPE 0x01 |
Hannes Reinecke | f37bd73 | 2011-07-22 16:44:46 +0200 | [diff] [blame] | 209 | #define TYPE_PRINTER 0x02 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 210 | #define TYPE_PROCESSOR 0x03 /* HP scanners use this */ |
| 211 | #define TYPE_WORM 0x04 /* Treated as ROM by our system */ |
| 212 | #define TYPE_ROM 0x05 |
| 213 | #define TYPE_SCANNER 0x06 |
| 214 | #define TYPE_MOD 0x07 /* Magneto-optical disk - |
Paolo Bonzini | 7d37435 | 2018-12-13 23:37:37 +0100 | [diff] [blame] | 215 | * - treated as TYPE_DISK */ |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 216 | #define TYPE_MEDIUM_CHANGER 0x08 |
Hannes Reinecke | f37bd73 | 2011-07-22 16:44:46 +0200 | [diff] [blame] | 217 | #define TYPE_STORAGE_ARRAY 0x0c /* Storage array device */ |
| 218 | #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */ |
| 219 | #define TYPE_RBC 0x0e /* Simplified Direct-Access Device */ |
| 220 | #define TYPE_OSD 0x11 /* Object-storage Device */ |
Dmitry Fomichev | afff2db | 2020-08-12 07:51:22 +0900 | [diff] [blame] | 221 | #define TYPE_ZBC 0x14 /* Host-managed Zoned SCSI Device */ |
Paolo Bonzini | fdaef06 | 2011-08-03 10:49:14 +0200 | [diff] [blame] | 222 | #define TYPE_WLUN 0x1e /* Well known LUN */ |
| 223 | #define TYPE_NOT_PRESENT 0x1f |
| 224 | #define TYPE_INACTIVE 0x20 |
Gerd Hoffmann | 0d65e1f | 2009-11-26 15:33:53 +0100 | [diff] [blame] | 225 | #define TYPE_NO_LUN 0x7f |
| 226 | |
Paolo Bonzini | 67cc61e | 2011-09-13 14:41:56 +0200 | [diff] [blame] | 227 | /* Mode page codes for mode sense/set */ |
Mark Cave-Ayland | 09274de | 2022-06-22 11:53:06 +0100 | [diff] [blame] | 228 | #define MODE_PAGE_VENDOR_SPECIFIC 0x00 |
Paolo Bonzini | 67cc61e | 2011-09-13 14:41:56 +0200 | [diff] [blame] | 229 | #define MODE_PAGE_R_W_ERROR 0x01 |
| 230 | #define MODE_PAGE_HD_GEOMETRY 0x04 |
| 231 | #define MODE_PAGE_FLEXIBLE_DISK_GEOMETRY 0x05 |
| 232 | #define MODE_PAGE_CACHING 0x08 |
| 233 | #define MODE_PAGE_AUDIO_CTL 0x0e |
| 234 | #define MODE_PAGE_POWER 0x1a |
| 235 | #define MODE_PAGE_FAULT_FAIL 0x1c |
| 236 | #define MODE_PAGE_TO_PROTECT 0x1d |
| 237 | #define MODE_PAGE_CAPABILITIES 0x2a |
Mark Cave-Ayland | 09d3786 | 2022-06-22 11:53:02 +0100 | [diff] [blame] | 238 | #define MODE_PAGE_APPLE_VENDOR 0x30 |
Paolo Bonzini | 67cc61e | 2011-09-13 14:41:56 +0200 | [diff] [blame] | 239 | #define MODE_PAGE_ALLS 0x3f |
Veres Lajos | 67cc32e | 2015-09-08 22:45:14 +0100 | [diff] [blame] | 240 | /* Not in Mt. Fuji, but in ATAPI 2.6 -- deprecated now in favor |
Paolo Bonzini | 67cc61e | 2011-09-13 14:41:56 +0200 | [diff] [blame] | 241 | * of MODE_PAGE_SENSE_POWER */ |
| 242 | #define MODE_PAGE_CDROM 0x0d |
| 243 | |
Paolo Bonzini | f0f992e | 2011-09-13 16:00:52 +0200 | [diff] [blame] | 244 | /* Event notification classes for GET EVENT STATUS NOTIFICATION */ |
| 245 | #define GESN_NO_EVENTS 0 |
| 246 | #define GESN_OPERATIONAL_CHANGE 1 |
| 247 | #define GESN_POWER_MANAGEMENT 2 |
| 248 | #define GESN_EXTERNAL_REQUEST 3 |
| 249 | #define GESN_MEDIA 4 |
| 250 | #define GESN_MULTIPLE_HOSTS 5 |
| 251 | #define GESN_DEVICE_BUSY 6 |
| 252 | |
| 253 | /* Event codes for MEDIA event status notification */ |
| 254 | #define MEC_NO_CHANGE 0 |
| 255 | #define MEC_EJECT_REQUESTED 1 |
| 256 | #define MEC_NEW_MEDIA 2 |
| 257 | #define MEC_MEDIA_REMOVAL 3 /* only for media changers */ |
| 258 | #define MEC_MEDIA_CHANGED 4 /* only for media changers */ |
| 259 | #define MEC_BG_FORMAT_COMPLETED 5 /* MRW or DVD+RW b/g format completed */ |
| 260 | #define MEC_BG_FORMAT_RESTARTED 6 /* MRW or DVD+RW b/g format restarted */ |
| 261 | |
| 262 | #define MS_TRAY_OPEN 1 |
| 263 | #define MS_MEDIA_PRESENT 2 |
| 264 | |
Paolo Bonzini | 67cc61e | 2011-09-13 14:41:56 +0200 | [diff] [blame] | 265 | /* |
| 266 | * Based on values from <linux/cdrom.h> but extending CD_MINS |
| 267 | * to the maximum common size allowed by the Orange's Book ATIP |
| 268 | * |
| 269 | * 90 and 99 min CDs are also available but using them as the |
| 270 | * upper limit reduces the effectiveness of the heuristic to |
| 271 | * detect DVDs burned to less than 25% of their maximum capacity |
| 272 | */ |
| 273 | |
| 274 | /* Some generally useful CD-ROM information */ |
| 275 | #define CD_MINS 80 /* max. minutes per CD */ |
| 276 | #define CD_SECS 60 /* seconds per minute */ |
| 277 | #define CD_FRAMES 75 /* frames per second */ |
| 278 | #define CD_FRAMESIZE 2048 /* bytes per frame, "cooked" mode */ |
| 279 | #define CD_MAX_BYTES (CD_MINS * CD_SECS * CD_FRAMES * CD_FRAMESIZE) |
| 280 | #define CD_MAX_SECTORS (CD_MAX_BYTES / 512) |
| 281 | |
| 282 | /* |
| 283 | * The MMC values are not IDE specific and might need to be moved |
| 284 | * to a common header if they are also needed for the SCSI emulation |
| 285 | */ |
| 286 | |
| 287 | /* Profile list from MMC-6 revision 1 table 91 */ |
| 288 | #define MMC_PROFILE_NONE 0x0000 |
| 289 | #define MMC_PROFILE_CD_ROM 0x0008 |
| 290 | #define MMC_PROFILE_CD_R 0x0009 |
| 291 | #define MMC_PROFILE_CD_RW 0x000A |
| 292 | #define MMC_PROFILE_DVD_ROM 0x0010 |
| 293 | #define MMC_PROFILE_DVD_R_SR 0x0011 |
| 294 | #define MMC_PROFILE_DVD_RAM 0x0012 |
| 295 | #define MMC_PROFILE_DVD_RW_RO 0x0013 |
| 296 | #define MMC_PROFILE_DVD_RW_SR 0x0014 |
| 297 | #define MMC_PROFILE_DVD_R_DL_SR 0x0015 |
| 298 | #define MMC_PROFILE_DVD_R_DL_JR 0x0016 |
| 299 | #define MMC_PROFILE_DVD_RW_DL 0x0017 |
| 300 | #define MMC_PROFILE_DVD_DDR 0x0018 |
| 301 | #define MMC_PROFILE_DVD_PLUS_RW 0x001A |
| 302 | #define MMC_PROFILE_DVD_PLUS_R 0x001B |
| 303 | #define MMC_PROFILE_DVD_PLUS_RW_DL 0x002A |
| 304 | #define MMC_PROFILE_DVD_PLUS_R_DL 0x002B |
| 305 | #define MMC_PROFILE_BD_ROM 0x0040 |
| 306 | #define MMC_PROFILE_BD_R_SRM 0x0041 |
| 307 | #define MMC_PROFILE_BD_R_RRM 0x0042 |
| 308 | #define MMC_PROFILE_BD_RE 0x0043 |
| 309 | #define MMC_PROFILE_HDDVD_ROM 0x0050 |
| 310 | #define MMC_PROFILE_HDDVD_R 0x0051 |
| 311 | #define MMC_PROFILE_HDDVD_RAM 0x0052 |
| 312 | #define MMC_PROFILE_HDDVD_RW 0x0053 |
| 313 | #define MMC_PROFILE_HDDVD_R_DL 0x0058 |
| 314 | #define MMC_PROFILE_HDDVD_RW_DL 0x005A |
| 315 | #define MMC_PROFILE_INVALID 0xFFFF |
Paolo Bonzini | cb9c377 | 2012-12-06 12:15:58 +0100 | [diff] [blame] | 316 | |
Fam Zheng | 604dfaa | 2018-06-01 17:26:46 +0800 | [diff] [blame] | 317 | #define XCOPY_DESC_OFFSET 16 |
| 318 | #define IDENT_DESCR_TGT_DESCR_SIZE 32 |
| 319 | #define XCOPY_BLK2BLK_SEG_DESC_SIZE 28 |
| 320 | |
Paolo Bonzini | cb9c377 | 2012-12-06 12:15:58 +0100 | [diff] [blame] | 321 | #endif |