]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/IndustryStandard/Atapi.h
7a406e114e2724d9a00cb852083e94f5ea98acad
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Atapi.h
1 /** @file
2 This file contains just some basic definitions that are needed by drivers
3 that dealing with ATA/ATAPI interface.
4
5 Copyright (c) 2007 - 2009, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _ATAPI_H_
17 #define _ATAPI_H_
18
19 #pragma pack(1)
20
21 ///
22 /// ATA_IDENTIFY_DATA is defined in ATA-5
23 ///
24 typedef struct {
25 UINT16 config; ///< General Configuration
26 UINT16 cylinders; ///< Number of Cylinders
27 UINT16 reserved_2;
28 UINT16 heads; ///< Number of logical heads
29 UINT16 vendor_data1;
30 UINT16 vendor_data2;
31 UINT16 sectors_per_track;
32 UINT16 vendor_specific_7_9[3];
33 CHAR8 SerialNo[20]; ///< ASCII
34 UINT16 vendor_specific_20_21[2];
35 UINT16 ecc_bytes_available;
36 CHAR8 FirmwareVer[8]; ///< ASCII
37 CHAR8 ModelName[40]; ///< ASCII
38 UINT16 multi_sector_cmd_max_sct_cnt;
39 UINT16 reserved_48;
40 UINT16 capabilities;
41 UINT16 reserved_50;
42 UINT16 pio_cycle_timing;
43 UINT16 reserved_52;
44 UINT16 field_validity;
45 UINT16 current_cylinders;
46 UINT16 current_heads;
47 UINT16 current_sectors;
48 UINT16 CurrentCapacityLsb;
49 UINT16 CurrentCapacityMsb;
50 UINT16 reserved_59;
51 UINT16 user_addressable_sectors_lo;
52 UINT16 user_addressable_sectors_hi;
53 UINT16 reserved_62;
54 UINT16 multi_word_dma_mode;
55 UINT16 advanced_pio_modes;
56 UINT16 min_multi_word_dma_cycle_time;
57 UINT16 rec_multi_word_dma_cycle_time;
58 UINT16 min_pio_cycle_time_without_flow_control;
59 UINT16 min_pio_cycle_time_with_flow_control;
60 UINT16 reserved_69_79[11];
61 UINT16 major_version_no;
62 UINT16 minor_version_no;
63 UINT16 command_set_supported_82; ///< word 82
64 UINT16 command_set_supported_83; ///< word 83
65 UINT16 command_set_feature_extn; ///< word 84
66 UINT16 command_set_feature_enb_85; ///< word 85
67 UINT16 command_set_feature_enb_86; ///< word 86
68 UINT16 command_set_feature_default; ///< word 87
69 UINT16 ultra_dma_mode; ///< word 88
70 UINT16 reserved_89_127[39];
71 UINT16 security_status;
72 UINT16 vendor_data_129_159[31];
73 UINT16 reserved_160_255[96];
74 } ATA_IDENTIFY_DATA;
75
76 ///
77 /// ATAPI_IDENTIFY_DATA is defined in ATA-6
78 ///
79 typedef struct {
80 UINT16 config; ///< General Configuration
81 UINT16 obsolete_1;
82 UINT16 specific_config;
83 UINT16 obsolete_3;
84 UINT16 retired_4_5[2];
85 UINT16 obsolete_6;
86 UINT16 cfa_reserved_7_8[2];
87 UINT16 retired_9;
88 CHAR8 SerialNo[20]; ///< ASCII
89 UINT16 retired_20_21[2];
90 UINT16 obsolete_22;
91 CHAR8 FirmwareVer[8]; ///< ASCII
92 CHAR8 ModelName[40]; ///< ASCII
93 UINT16 multi_sector_cmd_max_sct_cnt;
94 UINT16 reserved_48;
95 UINT16 capabilities_49;
96 UINT16 capabilities_50;
97 UINT16 obsolete_51_52[2];
98 UINT16 field_validity;
99 UINT16 obsolete_54_58[5];
100 UINT16 mutil_sector_setting;
101 UINT16 user_addressable_sectors_lo;
102 UINT16 user_addressable_sectors_hi;
103 UINT16 obsolete_62;
104 UINT16 multi_word_dma_mode;
105 UINT16 advanced_pio_modes;
106 UINT16 min_multi_word_dma_cycle_time;
107 UINT16 rec_multi_word_dma_cycle_time;
108 UINT16 min_pio_cycle_time_without_flow_control;
109 UINT16 min_pio_cycle_time_with_flow_control;
110 UINT16 reserved_69_74[6];
111 UINT16 queue_depth;
112 UINT16 reserved_76_79[4];
113 UINT16 major_version_no;
114 UINT16 minor_version_no;
115 UINT16 cmd_set_support_82;
116 UINT16 cmd_set_support_83;
117 UINT16 cmd_feature_support;
118 UINT16 cmd_feature_enable_85;
119 UINT16 cmd_feature_enable_86;
120 UINT16 cmd_feature_default;
121 UINT16 ultra_dma_select;
122 UINT16 time_required_for_sec_erase;
123 UINT16 time_required_for_enhanced_sec_erase;
124 UINT16 current_advanced_power_mgmt_value;
125 UINT16 master_pwd_revison_code;
126 UINT16 hardware_reset_result;
127 UINT16 current_auto_acoustic_mgmt_value;
128 UINT16 reserved_95_99[5];
129 UINT16 max_user_lba_for_48bit_addr[4];
130 UINT16 reserved_104_126[23];
131 UINT16 removable_media_status_notification_support;
132 UINT16 security_status;
133 UINT16 vendor_data_129_159[31];
134 UINT16 cfa_power_mode;
135 UINT16 cfa_reserved_161_175[15];
136 UINT16 current_media_serial_no[30];
137 UINT16 reserved_206_254[49];
138 UINT16 integrity_word;
139 } ATAPI_IDENTIFY_DATA;
140
141 ///
142 /// Standard Quiry Data format, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
143 ///
144 typedef struct {
145 UINT8 peripheral_type;
146 UINT8 RMB;
147 UINT8 version;
148 UINT8 response_data_format;
149 UINT8 addnl_length; ///< n - 4, Numbers of bytes following this one
150 UINT8 reserved_5;
151 UINT8 reserved_6;
152 UINT8 reserved_7;
153 UINT8 vendor_info[8];
154 UINT8 product_id[16];
155 UINT8 product_revision_level[4];
156 UINT8 vendor_specific_36_55[55 - 36 + 1];
157 UINT8 reserved_56_95[95 - 56 + 1];
158 ///
159 /// Vendor specific parameters fields, the sizeof (ATAPI_INQUIRY_DATA) is 254
160 /// since allocation_length is one byte in ATAPI_INQUIRY_CMD.
161 ///
162 UINT8 vendor_specific_96_253[253 - 96 + 1];
163 } ATAPI_INQUIRY_DATA;
164
165 ///
166 /// Request Sense Standard Data, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
167 ///
168 typedef struct {
169 UINT8 error_code : 7;
170 UINT8 valid : 1;
171 UINT8 reserved_1;
172 UINT8 sense_key : 4;
173 UINT8 reserved_2 : 1;
174 UINT8 Vendor_specifc_1 : 3;
175 UINT8 vendor_specific_3;
176 UINT8 vendor_specific_4;
177 UINT8 vendor_specific_5;
178 UINT8 vendor_specific_6;
179 UINT8 addnl_sense_length; ///< n - 7
180 UINT8 vendor_specific_8;
181 UINT8 vendor_specific_9;
182 UINT8 vendor_specific_10;
183 UINT8 vendor_specific_11;
184 UINT8 addnl_sense_code; ///< mandatory
185 UINT8 addnl_sense_code_qualifier; ///< mandatory
186 UINT8 field_replaceable_unit_code; ///< optional
187 UINT8 sense_key_specific_15 : 7;
188 UINT8 SKSV : 1;
189 UINT8 sense_key_specific_16;
190 UINT8 sense_key_specific_17;
191 } ATAPI_REQUEST_SENSE_DATA;
192
193 ///
194 /// READ CAPACITY Data, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
195 ///
196 typedef struct {
197 UINT8 LastLba3;
198 UINT8 LastLba2;
199 UINT8 LastLba1;
200 UINT8 LastLba0;
201 UINT8 BlockSize3;
202 UINT8 BlockSize2;
203 UINT8 BlockSize1;
204 UINT8 BlockSize0;
205 } ATAPI_READ_CAPACITY_DATA;
206
207 ///
208 /// Capacity List Header + Current/Maximum Capacity Descriptor,
209 /// defined in SFF-8070i(ATAPI Removable Rewritable Specification)
210 ///
211 typedef struct {
212 UINT8 reserved_0;
213 UINT8 reserved_1;
214 UINT8 reserved_2;
215 UINT8 Capacity_Length;
216 UINT8 LastLba3;
217 UINT8 LastLba2;
218 UINT8 LastLba1;
219 UINT8 LastLba0;
220 UINT8 DesCode : 2;
221 UINT8 reserved_9 : 6;
222 UINT8 BlockSize2;
223 UINT8 BlockSize1;
224 UINT8 BlockSize0;
225 } ATAPI_READ_FORMAT_CAPACITY_DATA;
226
227 ///
228 /// Test Unit Ready Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
229 ///
230 typedef struct {
231 UINT8 opcode;
232 UINT8 reserved_1;
233 UINT8 reserved_2;
234 UINT8 reserved_3;
235 UINT8 reserved_4;
236 UINT8 reserved_5;
237 UINT8 reserved_6;
238 UINT8 reserved_7;
239 UINT8 reserved_8;
240 UINT8 reserved_9;
241 UINT8 reserved_10;
242 UINT8 reserved_11;
243 } ATAPI_TEST_UNIT_READY_CMD;
244
245 ///
246 /// INQUIRY Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
247 ///
248 typedef struct {
249 UINT8 opcode;
250 UINT8 reserved_1 : 5;
251 UINT8 lun : 3;
252 UINT8 page_code; ///< defined in SFF8090i, V6
253 UINT8 reserved_3;
254 UINT8 allocation_length;
255 UINT8 reserved_5;
256 UINT8 reserved_6;
257 UINT8 reserved_7;
258 UINT8 reserved_8;
259 UINT8 reserved_9;
260 UINT8 reserved_10;
261 UINT8 reserved_11;
262 } ATAPI_INQUIRY_CMD;
263
264 ///
265 /// REQUEST SENSE Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
266 ///
267 typedef struct {
268 UINT8 opcode;
269 UINT8 reserved_1 : 5;
270 UINT8 lun : 3;
271 UINT8 reserved_2;
272 UINT8 reserved_3;
273 UINT8 allocation_length;
274 UINT8 reserved_5;
275 UINT8 reserved_6;
276 UINT8 reserved_7;
277 UINT8 reserved_8;
278 UINT8 reserved_9;
279 UINT8 reserved_10;
280 UINT8 reserved_11;
281 } ATAPI_REQUEST_SENSE_CMD;
282
283 ///
284 /// READ (10) Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
285 ///
286 typedef struct {
287 UINT8 opcode;
288 UINT8 reserved_1 : 5;
289 UINT8 lun : 3;
290 UINT8 Lba0;
291 UINT8 Lba1;
292 UINT8 Lba2;
293 UINT8 Lba3;
294 UINT8 reserved_6;
295 UINT8 TranLen0;
296 UINT8 TranLen1;
297 UINT8 reserved_9;
298 UINT8 reserved_10;
299 UINT8 reserved_11;
300 } ATAPI_READ10_CMD;
301
302 ///
303 /// READ Format Capacity Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
304 ///
305 typedef struct {
306 UINT8 opcode;
307 UINT8 reserved_1 : 5;
308 UINT8 lun : 3;
309 UINT8 reserved_2;
310 UINT8 reserved_3;
311 UINT8 reserved_4;
312 UINT8 reserved_5;
313 UINT8 reserved_6;
314 UINT8 allocation_length_hi;
315 UINT8 allocation_length_lo;
316 UINT8 reserved_9;
317 UINT8 reserved_10;
318 UINT8 reserved_11;
319 } ATAPI_READ_FORMAT_CAP_CMD;
320
321 ///
322 /// MODE SENSE Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification)
323 ///
324 typedef struct {
325 UINT8 opcode;
326 UINT8 reserved_1 : 5;
327 UINT8 lun : 3;
328 UINT8 page_code : 6;
329 UINT8 page_control : 2;
330 UINT8 reserved_3;
331 UINT8 reserved_4;
332 UINT8 reserved_5;
333 UINT8 reserved_6;
334 UINT8 parameter_list_length_hi;
335 UINT8 parameter_list_length_lo;
336 UINT8 reserved_9;
337 UINT8 reserved_10;
338 UINT8 reserved_11;
339 } ATAPI_MODE_SENSE_CMD;
340
341 ///
342 /// ATAPI_PACKET_COMMAND is not defined in ATA specification.
343 /// We add it here for the convenience for ATA/ATAPI module writer.
344 ///
345 typedef union {
346 UINT16 Data16[6];
347 ATAPI_TEST_UNIT_READY_CMD TestUnitReady;
348 ATAPI_READ10_CMD Read10;
349 ATAPI_REQUEST_SENSE_CMD RequestSence;
350 ATAPI_INQUIRY_CMD Inquiry;
351 ATAPI_MODE_SENSE_CMD ModeSense;
352 ATAPI_READ_FORMAT_CAP_CMD ReadFormatCapacity;
353 } ATAPI_PACKET_COMMAND;
354
355 #pragma pack()
356
357
358 #define ATAPI_MAX_DMA_EXT_CMD_SECTORS 0x10000
359 #define ATAPI_MAX_DMA_CMD_SECTORS 0x100
360
361 //
362 // ATA Packet Command Code
363 //
364 #define ATA_CMD_SOFT_RESET 0x08 ///< defined from ATA-3
365 #define ATA_CMD_PACKET 0xA0 ///< defined from ATA-3
366 #define ATA_CMD_IDENTIFY_DEVICE 0xA1 ///< defined from ATA-3
367 #define ATA_CMD_SERVICE 0xA2 ///< defined from ATA-3
368 #define ATA_CMD_TEST_UNIT_READY 0x00 ///< defined from ATA-1
369 #define ATA_CMD_REQUEST_SENSE 0x03 ///< defined from ATA-4
370 #define ATA_CMD_INQUIRY 0x12 ///< defined in ATAPI Removable Rewritable Media Devcies
371 #define ATA_CMD_READ_FORMAT_CAPACITY 0x23 ///< defined in ATAPI Removable Rewritable Media Devcies
372 #define ATA_CMD_READ_CAPACITY 0x25 ///< defined in ATAPI Removable Rewritable Media Devcies
373 #define ATA_CMD_READ_10 0x28 ///< defined in ATAPI Removable Rewritable Media Devcies
374 #define ATA_CMD_WRITE_10 0x2A ///< defined in ATAPI Removable Rewritable Media Devcies
375
376 //
377 // ATA Commands Code
378 //
379
380 //
381 // Class 1: PIO Data-In Commands
382 //
383 #define ATA_CMD_IDENTIFY_DRIVE 0xec ///< defined from ATA-3
384 #define ATA_CMD_READ_BUFFER 0xe4 ///< defined from ATA-1
385 #define ATA_CMD_READ_SECTORS 0x20 ///< defined from ATA-1
386 #define ATA_CMD_READ_SECTORS_WITH_RETRY 0x21 ///< defined from ATA-1, obsoleted from ATA-5
387 #define ATA_CMD_READ_LONG 0x22 ///< defined from ATA-1, obsoleted from ATA-5
388 #define ATA_CMD_READ_LONG_WITH_RETRY 0x23 ///< defined from ATA-1, obsoleted from ATA-5
389 #define ATA_CMD_READ_SECTORS_EXT 0x24 ///< defined from ATA-6
390
391 //
392 // Class 2: PIO Data-Out Commands
393 //
394 #define ATA_CMD_FORMAT_TRACK 0x50 ///< defined from ATA-1, obsoleted from ATA-4
395 #define ATA_CMD_WRITE_BUFFER 0xe8 ///< defined from ATA-1
396 #define ATA_CMD_WRITE_SECTORS 0x30 ///< defined from ATA-1
397 #define ATA_CMD_WRITE_SECTORS_WITH_RETRY 0x31 ///< defined from ATA-1, obsoleted from ATA-5
398 #define ATA_CMD_WRITE_LONG 0x32 ///< defined from ATA-1, obsoleted from ATA-5
399 #define ATA_CMD_WRITE_LONG_WITH_RETRY 0x33 ///< defined from ATA-1, obsoleted from ATA-5
400 #define ATA_CMD_WRITE_VERIFY 0x3c ///< defined from ATA-1, obsoleted from ATA-5
401 #define ATA_CMD_WRITE_SECTORS_EXT 0x34 ///< defined from ATA-6
402
403 //
404 // Class 3 No Data Command
405 //
406 #define ATA_CMD_ACK_MEDIA_CHANGE 0xdb ///< defined from ATA-1, obsoleted from ATA-5
407 #define ATA_CMD_BOOT_POST_BOOT 0xdc ///< defined from ATA-1, obsoleted from ATA-3
408 #define ATA_CMD_BOOT_PRE_BOOT 0xdd ///< defined from ATA-1, obsoleted from ATA-3
409 #define ATA_CMD_CHECK_POWER_MODE 0x98 ///< defined from ATA-1, obsoleted from ATA-4
410 #define ATA_CMD_CHECK_POWER_MODE_ALIAS 0xe5 ///< defined from ATA-1
411 #define ATA_CMD_DOOR_LOCK 0xde ///< defined from ATA-1
412 #define ATA_CMD_DOOR_UNLOCK 0xdf ///< defined from ATA-1
413 #define ATA_CMD_EXEC_DRIVE_DIAG 0x90 ///< defined from ATA-1
414 #define ATA_CMD_IDLE_ALIAS 0x97 ///< defined from ATA-1, obsoleted from ATA-4
415 #define ATA_CMD_IDLE 0xe3 ///< defined from ATA-1
416 #define ATA_CMD_IDLE_IMMEDIATE 0x95 ///< defined from ATA-1, obsoleted from ATA-4
417 #define ATA_CMD_IDLE_IMMEDIATE_ALIAS 0xe1 ///< defined from ATA-1
418 #define ATA_CMD_INIT_DRIVE_PARAM 0x91 ///< defined from ATA-1, obsoleted from ATA-6
419 #define ATA_CMD_RECALIBRATE 0x10 ///< defined from ATA-1, obsoleted from ATA-4
420 #define ATA_CMD_READ_DRIVE_STATE 0xe9 ///< defined from ATA-1, obsoleted from ATA-3
421 #define ATA_CMD_SET_MULTIPLE_MODE 0xC6 ///< defined from ATA-2
422 #define ATA_CMD_READ_VERIFY 0x40 ///< defined from ATA-1
423 #define ATA_CMD_READ_VERIFY_WITH_RETRY 0x41 ///< defined from ATA-1, obsoleted from ATA-5
424 #define ATA_CMD_SEEK 0x70 ///< defined from ATA-1
425 #define ATA_CMD_SET_FEATURES 0xef ///< defined from ATA-1
426 #define ATA_CMD_STANDBY 0x96 ///< defined from ATA-1, obsoleted from ATA-4
427 #define ATA_CMD_STANDBY_ALIAS 0xe2 ///< defined from ATA-1
428 #define ATA_CMD_STANDBY_IMMEDIATE 0x94 ///< defined from ATA-1, obsoleted from ATA-4
429 #define ATA_CMD_STANDBY_IMMEDIATE_ALIAS 0xe0 ///< defined from ATA-1
430 //
431 // S.M.A.R.T
432 //
433 #define ATA_CMD_SMART 0xb0 ///< defined from ATA-3
434 #define ATA_CONSTANT_C2 0xc2 ///< reserved
435 #define ATA_CONSTANT_4F 0x4f ///< reserved
436 #define ATA_SMART_ENABLE_OPERATION 0xd8 ///< reserved
437 #define ATA_SMART_RETURN_STATUS 0xda ///< defined from ATA-3
438
439 //
440 // Class 4: DMA Command
441 //
442 #define ATA_CMD_READ_DMA 0xc8 ///< defined from ATA-1
443 #define ATA_CMD_READ_DMA_WITH_RETRY 0xc9 ///< defined from ATA-1, obsoleted from ATA-5
444 #define ATA_CMD_READ_DMA_EXT 0x25 ///< defined from ATA-6
445 #define ATA_CMD_WRITE_DMA 0xca ///< defined from ATA-1
446 #define ATA_CMD_WRITE_DMA_WITH_RETRY 0xcb ///< defined from ATA-1, obsoleted from ATA-
447 #define ATA_CMD_WRITE_DMA_EXT 0x35 ///< defined from ATA-6
448
449 ///
450 /// default content of device control register, disable INT,
451 /// Bit3 is set to 1 according ATA-1
452 ///
453 #define ATA_DEFAULT_CTL (0x0a)
454 ///
455 /// default context of Device/Head Register,
456 /// Bit7 and Bit5 are set to 1 for back-compatibilities
457 ///
458 #define ATA_DEFAULT_CMD (0xa0)
459
460 #define ATAPI_MAX_BYTE_COUNT (0xfffe)
461
462 #define ATA_REQUEST_SENSE_ERROR (0x70) ///< defined in SFF-8070i
463
464 //
465 // Sense Key, Additional Sense Codes and Additional Sense Code Qualifier
466 // defined in MultiMedia Commands (MMC, MMC-2)
467 //
468 // Sense Key
469 //
470 #define ATA_SK_NO_SENSE (0x0)
471 #define ATA_SK_RECOVERY_ERROR (0x1)
472 #define ATA_SK_NOT_READY (0x2)
473 #define ATA_SK_MEDIUM_ERROR (0x3)
474 #define ATA_SK_HARDWARE_ERROR (0x4)
475 #define ATA_SK_ILLEGAL_REQUEST (0x5)
476 #define ATA_SK_UNIT_ATTENTION (0x6)
477 #define ATA_SK_DATA_PROTECT (0x7)
478 #define ATA_SK_BLANK_CHECK (0x8)
479 #define ATA_SK_VENDOR_SPECIFIC (0x9)
480 #define ATA_SK_RESERVED_A (0xA)
481 #define ATA_SK_ABORT (0xB)
482 #define ATA_SK_RESERVED_C (0xC)
483 #define ATA_SK_OVERFLOW (0xD)
484 #define ATA_SK_MISCOMPARE (0xE)
485 #define ATA_SK_RESERVED_F (0xF)
486
487 //
488 // Additional Sense Codes
489 //
490 #define ATA_ASC_NOT_READY (0x04)
491 #define ATA_ASC_MEDIA_ERR1 (0x10)
492 #define ATA_ASC_MEDIA_ERR2 (0x11)
493 #define ATA_ASC_MEDIA_ERR3 (0x14)
494 #define ATA_ASC_MEDIA_ERR4 (0x30)
495 #define ATA_ASC_MEDIA_UPSIDE_DOWN (0x06)
496 #define ATA_ASC_INVALID_CMD (0x20)
497 #define ATA_ASC_LBA_OUT_OF_RANGE (0x21)
498 #define ATA_ASC_INVALID_FIELD (0x24)
499 #define ATA_ASC_WRITE_PROTECTED (0x27)
500 #define ATA_ASC_MEDIA_CHANGE (0x28)
501 #define ATA_ASC_RESET (0x29) ///< Power On Reset or Bus Reset occurred
502 #define ATA_ASC_ILLEGAL_FIELD (0x26)
503 #define ATA_ASC_NO_MEDIA (0x3A)
504 #define ATA_ASC_ILLEGAL_MODE_FOR_THIS_TRACK (0x64)
505
506 //
507 // Additional Sense Code Qualifier
508 //
509 #define ATA_ASCQ_IN_PROGRESS (0x01)
510
511 //
512 // Error Register
513 //
514 #define ATA_ERRREG_BBK BIT7 ///< Bad block detected defined from ATA-1, obsoleted from ATA-2
515 #define ATA_ERRREG_UNC BIT6 ///< Uncorrectable Data defined from ATA-1, obsoleted from ATA-4
516 #define ATA_ERRREG_MC BIT5 ///< Media Change defined from ATA-1, obsoleted from ATA-4
517 #define ATA_ERRREG_IDNF BIT4 ///< ID Not Found defined from ATA-1, obsoleted from ATA-4
518 #define ATA_ERRREG_MCR BIT3 ///< Media Change Requested defined from ATA-1, obsoleted from ATA-4
519 #define ATA_ERRREG_ABRT BIT2 ///< Aborted Command defined from ATA-1
520 #define ATA_ERRREG_TK0NF BIT1 ///< Track 0 Not Found defined from ATA-1, obsoleted from ATA-4
521 #define ATA_ERRREG_AMNF BIT0 ///< Address Mark Not Found defined from ATA-1, obsoleted from ATA-4
522
523 //
524 // Status Register
525 //
526 #define ATA_STSREG_BSY BIT7 ///< Controller Busy defined from ATA-1
527 #define ATA_STSREG_DRDY BIT6 ///< Drive Ready defined from ATA-1
528 #define ATA_STSREG_DWF BIT5 ///< Drive Write Fault defined from ATA-1, obsoleted from ATA-4
529 #define ATA_STSREG_DF BIT5 ///< Drive Fault defined from ATA-6
530 #define ATA_STSREG_DSC BIT4 ///< Disk Seek Complete defined from ATA-1, obsoleted from ATA-4
531 #define ATA_STSREG_DRQ BIT3 ///< Data Request defined from ATA-1
532 #define ATA_STSREG_CORR BIT2 ///< Corrected Data defined from ATA-1, obsoleted from ATA-4
533 #define ATA_STSREG_IDX BIT1 ///< Index defined from ATA-1, obsoleted from ATA-4
534 #define ATA_STSREG_ERR BIT0 ///< Error defined from ATA-1
535
536 //
537 // Device Control Register
538 //
539 #define ATA_CTLREG_SRST BIT2 ///< Software Reset
540 #define ATA_CTLREG_IEN_L BIT1 ///< Interrupt Enable #
541
542 #endif
543