2 * Copyright 2004-2006, Haiku, Inc. All RightsReserved.
3 * Copyright 2002/03, Thomas Kurschel. All rights reserved.
5 * Distributed under the terms of the MIT License.
7 #ifndef _IDE_DEVICE_INFOBLOCK_H_
8 #define _IDE_DEVICE_INFOBLOCK_H_
11 Definition of response to IDE_CMD_IDENTIFY_DEVICE or
12 IDE_CMD_IDENTIFY_PACKET_DEVICE
14 When a new entry is inserted, add its offset in hex
15 and its index in decimal as a remark. Without that, you
16 have a rough time when you messed up the offsets.
20 #include <lendian_bitfield.h>
23 #define IDE_GET_INFO_BLOCK 0x2710
24 #define IDE_GET_STATUS 0x2711
27 // must be 512 bytes!!!
28 typedef struct tagdevice_infoblock
{
29 union { // 0 general configuration
34 response_incomplete
: 1,
36 removable_controller_or_media
: 1,
39 ATA
: 1 // 0 - is ATA!
44 packet_size
: 2, // 0 - 12 bytes, 1 - 16 bytes
45 response_incomplete
: 1,
47 drq_speed
: 2, // 0 - 3ms, 1 - IRQ, 2 - 50µs
51 ATAPI
: 2 // 2 - is ATAPI
55 uint16 cylinders
; // 2
58 uint16 dummy2
[2]; // 8
60 uint16 dummy3
[3]; // 0e
61 char serial_number
[20]; // 14
62 uint16 dummy4
[3]; // 28
63 char firmware_version
[8]; // 2e
64 char model_number
[40]; // 36
65 uint16 dummy5
[2]; // 5e
66 LBITFIELD5 ( // 62 (49) capabilities
70 IORDY_can_disable
: 1,
74 uint16 dummy6
[1]; // 64
75 LBITFIELD2 ( // 66 (51) obsolete: PIO modes?
79 uint16 dummy7
[1]; // 68
81 LBITFIELD3 ( // 6a (53) validity
86 uint16 current_cylinders
; // 6c (54)
87 uint16 current_heads
; // 6e
88 uint16 current_sectors
; // 70
90 uint16 capacity_low
; // 72 (57) ALIGNMENT SPLIT - don't merge
95 uint32 LBA_total_sectors
; // 78 (60)
96 uint16 dummy9
[1]; // 7c
98 LBITFIELD7 ( // 7e (63) MDMA modes
107 uint16 dummy10
[11]; // 80
109 LBITFIELD2 ( // 96 (75)
113 uint16 dummy11
[6]; // 98
115 LBITFIELD16 ( // a4 (82) supported_command_set
117 security_mode_supported
: 1,
118 removable_media_supported
: 1,
120 _81_fixed
: 1, // must be 0
121 write_cache_supported
: 1,
122 look_ahead_supported
: 1,
123 RELEASE_irq_supported
: 1,
125 SERVICE_irq_supported
: 1,
126 DEVICE_RESET_supported
: 1,
129 WRITE_BUFFER_supported
: 1,
130 READ_BUFFER_supported
: 1,
134 LBITFIELD15 ( // a6 (83) supported_command_sets
135 DOWNLOAD_MICROCODE_supported
: 1,
136 DMA_QUEUED_supported
: 1,
140 power_up_in_stand_by_supported
: 1,
141 SET_FEATURES_on_power_up_required
: 1,
142 reserved_boot_area_supported
: 1,
143 SET_MAX_security_supported
: 1,
144 auto_acustic_managemene_supported
: 1,
145 _48_bit_addresses_supported
: 1,
146 device_conf_overlay_supported
: 1,
147 FLUSH_CACHE_supported
: 1,
148 FLUSH_CACHE_EXT_supported
: 1,
149 _83_fixed
: 2 // must be 1
152 uint16 dummy12
[4]; // a8 (84)
153 LBITFIELD15 ( // b0 (88) UDMA modes
160 UDMA6_supported
: 1, // !guessed
171 uint16 dummy89
[11]; // b2 (89)
172 uint64 LBA48_total_sectors
; // c8 (100)
173 uint16 dummy102
[22]; // cc (104)
175 LBITFIELD2 ( // fc (126)
179 LBITFIELD4 ( // fe (127) RMSN support
180 _127_RMSN_support
: 2,// 0 = not supported, 1 = supported, 3, 4 = reserved
182 device_write_protect
: 2,
185 uint16 dummy14
[128]; // 100 (128)
186 } ide_device_infoblock
;
188 typedef struct ide_status
{
195 #endif /* _IDE_DEVICE_INFOBLOCK_H_ */