Go to the documentation of this file.
37 #define hdSecCount 0x2
46 #define ATA_IDENTIFY_COMMAND_SET_SUPPORTED1_48BIT_ENABLE 0x0400
47 #define ATA_IDENTIFY_SECTOR_LARGER_THEN_512_ENABLE 0x0100
53 #define ATA_F_DMA 0x01
54 #define ATA_F_OVL 0x02
62 #define ATA_D_LBA 0x40
63 #define ATA_D_IBM 0xa0
68 #define ATA_E_ILI 0x01
70 #define ATA_E_ABORT 0x04
71 #define ATA_E_MCR 0x08
72 #define ATA_E_IDNF 0x10
74 #define ATA_E_UNC 0x40
75 #define ATA_E_ICRC 0x80
76 #define ATA_E_ATAPI_SENSE_MASK 0xf0
79 #define ATA_I_CMD 0x01
81 #define ATA_I_RELEASE 0x04
82 #define ATA_I_TAGMASK 0xf8
85 #define ATA_ALTSTAT 11
86 #define ATA_S_ERROR 0x01
87 #define ATA_S_INDEX 0x02
88 #define ATA_S_CORR 0x04
89 #define ATA_S_DRQ 0x08
90 #define ATA_S_DSC 0x10
91 #define ATA_S_SERVICE 0x10
92 #define ATA_S_DWF 0x20
93 #define ATA_S_DMA 0x20
94 #define ATA_S_READY 0x40
95 #define ATA_S_BUSY 0x80
97 #define ATA_CONTROL 12
99 #define ATA_CTLOFFSET 0x206
100 #define ATA_PCCARD_CTLOFFSET 0x0e
101 #define ATA_PC98_CTLOFFSET 0x10c
102 #define ATA_A_IDS 0x02
103 #define ATA_A_RESET 0x04
104 #ifdef ATA_LEGACY_SUPPORT
105 #define ATA_A_4BIT 0x08
107 #define ATA_A_4BIT 0x00
109 #define ATA_A_HOB 0x80
112 #define ATA_IDENTIFY 0xEC
113 #define ATA_CHECK_POWER_MODE 0xE5
114 #define ATA_STANDBY 0xE2
115 #define ATA_STANDBY_IMMED 0xE0
116 #define ATA_IDLE_IMMED 0xE1
117 #define ATA_IDLE 0xE3
118 #define ATA_FLUSH_CACHE 0xE7
119 #define ATA_FLUSH_CACHE_EXT 0xEA
120 #define ATA_READ_DMA_EXT 0x25
121 #define ATA_READ_DMA 0xC8
122 #define ATA_READ_SECTORS_EXT 0x24
123 #define ATA_READ_SECTORS 0x20
124 #define ATA_WRITE_DMA_EXT 0x35
125 #define ATA_WRITE_DMA 0xCA
126 #define ATA_WRITE_SECTORS_EXT 0x34
127 #define ATA_WRITE_SECTORS 0x30
128 #define ATA_WRITE_UNCORRECTABLE 0x45
129 #define ATA_READ_VERIFY_SECTORS 0x40
130 #define ATA_READ_VERIFY_SECTORS_EXT 0x42
131 #define ATA_READ_BUFFER 0xE4
132 #define ATA_WRITE_BUFFER 0xE8
133 #define ATA_EXECUTE_DEVICE_DIAG 0x90
134 #define ATA_SET_FEATURES 0xEF
135 #define ATA_SMART 0xB0
136 #define ATA_PACKET_IDENTIFY 0xA1
137 #define ATA_PACKET 0xA0
138 #define ATA_READ_FPDMA 0x60
139 #define ATA_WRITE_FPDMA 0x61
140 #define ATA_READ_LOG_EXT 0x2F
142 #define ATA_DEVICE_RESET 0x08
143 #define ATA_MEDIA_EJECT 0xED
144 #define ATA_SECURITY_UNLOCK 0xF2
145 #define ATA_SECURITY_FREEZE_LOCK 0xF5
146 #define ATA_DATA_SET_MANAGEMENT 0x06
147 #define ATA_DOWNLOAD_MICROCODE 0x92
148 #define ATA_WRITE_STREAM_DMA_EXT 0x3A
149 #define ATA_READ_LOG_DMA_EXT 0x47
150 #define ATA_READ_STREAM_DMA_EXT 0x2A
151 #define ATA_WRITE_DMA_FUA 0x3D
152 #define ATA_WRITE_LOG_DMA_EXT 0x57
153 #define ATA_READ_DMA_QUEUED 0xC7
154 #define ATA_READ_DMA_QUEUED_EXT 0x26
155 #define ATA_WRITE_DMA_QUEUED 0xCC
156 #define ATA_WRITE_DMA_QUEUED_EXT 0x36
157 #define ATA_WRITE_DMA_QUEUED_FUA_EXT 0x3E
158 #define ATA_READ_MULTIPLE 0xC4
159 #define ATA_READ_MULTIPLE_EXT 0x29
160 #define ATA_WRITE_MULTIPLE 0xC5
161 #define ATA_WRITE_MULTIPLE_EXT 0x39
162 #define ATA_WRITE_MULTIPLE_FUA_EXT 0xCE
208 #define MAXPARTITIONS 8
285 static const char *fstypenames[] = {
"unused",
"swap",
"Version 6",
"Version 7",
"System V",
"4.1BSD",
"Eighth Edition",
"4.2BSD",
"MSDOS",
"4.4LFS",
"unknown",
"HPFS",
"ISO9660",
"boot",
"vinum",
"raid",
"?",
"?",
"?",
"?",
"jfs",
NULL };
293 #define ATA_IDENTIFY_SERIAL_NUMBER_LEN 20
294 #define ATA_IDENTIFY_MODEL_NUMBER_LEN 40
295 #define ATA_IDENTIFY_FW_REVISION_LEN 8
296 #define ATA_IDENTIFY_48_LBA_LEN 8
297 #define ATA_IDENTIFY_MEDIA_SERIAL_NUMBER_LEN 30
298 #define ATA_IDENTIFY_WWN_LEN 8
395 static const char *
const part_types[256] = {
397 [0x01] =
"Primary DOS with 12 bit FAT",
398 [0x02] =
"XENIX / file system",
399 [0x03] =
"XENIX /usr file system",
400 [0x04] =
"Primary DOS with 16 bit FAT (< 32MB)",
401 [0x05] =
"Extended DOS",
402 [0x06] =
"Primary DOS, 16 bit FAT (>= 32MB)",
403 [0x07] =
"NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX",
404 [0x08] =
"AIX file system or SplitDrive",
405 [0x09] =
"AIX boot partition or Coherent",
406 [0x0A] =
"OS/2 Boot Manager, OPUS or Coherent swap",
407 [0x0B] =
"DOS or Windows 95 with 32 bit FAT",
408 [0x0C] =
"DOS or Windows 95 with 32 bit FAT (LBA)",
409 [0x0E] =
"Primary 'big' DOS (>= 32MB, LBA)",
410 [0x0F] =
"Extended DOS (LBA)",
412 [0x11] =
"OS/2 BM: hidden DOS with 12-bit FAT",
413 [0x12] =
"Compaq diagnostics",
414 [0x14] =
"OS/2 BM: hidden DOS with 16-bit FAT (< 32MB)",
415 [0x16] =
"OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)",
416 [0x17] =
"OS/2 BM: hidden IFS (e.g. HPFS)",
417 [0x18] =
"AST Windows swapfile",
418 [0x1b] =
"ASUS Recovery partition (NTFS)",
420 [0x3C] =
"PartitionMagic recovery",
422 [0x40] =
"VENIX 286",
423 [0x41] =
"Linux/MINIX (sharing disk with DRDOS)",
424 [0x42] =
"SFS or Linux swap (sharing disk with DRDOS)",
425 [0x43] =
"Linux native (sharing disk with DRDOS)",
426 [0x4D] =
"QNX 4.2 Primary",
427 [0x4E] =
"QNX 4.2 Secondary",
428 [0x4F] =
"QNX 4.2 Tertiary",
429 [0x50] =
"DM (disk manager)",
430 [0x51] =
"DM6 Aux1 (or Novell)",
431 [0x52] =
"CP/M or Microport SysV/AT",
434 [0x55] =
"EZ-Drive (disk manager)",
435 [0x56] =
"Golden Bow (disk manager)",
436 [0x5c] =
"Priam Edisk (disk manager)",
437 [0x61] =
"SpeedStor",
438 [0x63] =
"System V/386 (such as ISC UNIX), GNU HURD or Mach",
439 [0x64] =
"Novell Netware/286 2.xx",
440 [0x65] =
"Novell Netware/386 3.xx",
441 [0x70] =
"DiskSecure Multi-Boot",
444 [0x78] =
"QNX4.x 2nd part",
445 [0x79] =
"QNX4.x 3rd part",
446 [0x80] =
"Minix until 1.4a",
447 [0x81] =
"Minix since 1.4b, early Linux partition or Mitac disk manager",
448 [0x82] =
"Linux swap or Solaris x86",
449 [0x83] =
"Linux native",
450 [0x84] =
"OS/2 hidden C: drive",
451 [0x85] =
"Linux extended",
452 [0x86] =
"NTFS volume set??",
453 [0x87] =
"NTFS volume set??",
454 [0x93] =
"Amoeba file system",
455 [0x94] =
"Amoeba bad block table",
457 [0xA0] =
"Suspend to Disk",
458 [0xA5] =
"FreeBSD/NetBSD/386BSD",
464 [0xB7] =
"BSDI BSD/386 file system",
465 [0xB8] =
"BSDI BSD/386 swap",
466 [0xBE] =
"Solaris x86 boot",
467 [0xBF] =
"Solaris x86 (new)",
468 [0xC1] =
"DRDOS/sec with 12-bit FAT",
469 [0xC4] =
"DRDOS/sec with 16-bit FAT (< 32MB)",
470 [0xC6] =
"DRDOS/sec with 16-bit FAT (>= 32MB)",
472 [0xDB] =
"CP/M, Concurrent CP/M, Concurrent DOS or CTOS",
473 [0xDE] =
"DELL Utilities - FAT filesystem",
474 [0xE1] =
"DOS access or SpeedStor with 12-bit FAT extended partition",
475 [0xE3] =
"DOS R/O or SpeedStor",
476 [0xE4] =
"SpeedStor with 16-bit FAT extended partition < 1024 cyl.",
477 [0xEB] =
"BeOS file system",
479 [0xEF] =
"EFI System Partition",
480 [0xF1] =
"SpeedStor",
481 [0xF2] =
"DOS 3.3+ Secondary",
482 [0xF4] =
"SpeedStor large partition",
483 [0xFB] =
"VMware VMFS",
484 [0xFE] =
"SpeedStor >1024 cyl. or LANstep",
485 [0xFF] =
"Xenix bad blocks table", };
u_int16_t enhanced_security_erase_time
u_int16_t stream_transfer_time
u_int16_t min_num_blocks_per_microcode
u_int16_t logical_sector_alignment
u_int16_t serial_ata_reserved
u_int8_t words_per_logical_sector[4]
u_int16_t vendor_specific_config_bits
u_int16_t security_status
u_int16_t multi_word_dma_mode
u_int16_t pio_modes_supported
u_int16_t stream_min_request_size
u_int8_t total_num_sectors[4]
u_int16_t master_password_revision
u_int16_t reserved_for_compact_flash3[6]
u_int16_t streaming_transfer_time
struct ata_identify_data * ata_identify
u_int16_t command_set_default
#define ATA_IDENTIFY_48_LBA_LEN
u_int16_t nominal_media_rotation_rate
u_int16_t physical_logical_sector_info
u_int8_t serial_number[20]
u_int8_t world_wide_name[8]
#define ATA_IDENTIFY_MODEL_NUMBER_LEN
u_int16_t current_power_mgmt_value
u_int16_t serial_ata_capabilities
u_int16_t min_pio_transfer_no_flow_ctrl
struct driveDiskLabel * diskLabel
u_int16_t command_set_enabled1
u_int16_t command_set_supported0
u_int8_t model_number[40]
u_int16_t d_sparespertrack
u_int16_t command_set_supported1
u_int16_t stream_access_latency
u_int16_t max_num_blocks_per_microcode
u_int16_t reserved_for_compact_flash1[2]
u_int16_t command_set_enabled0
u_int16_t current_max_sectors_per_multiple
#define ATA_IDENTIFY_WWN_LEN
u_int16_t rec_min_multiword_dma_transfer_cycle
u_int16_t security_erase_completion_time
u_int16_t min_multiword_dma_transfer_cycle
u_int16_t reserved_for_compact_flash2[7]
u_int16_t current_media_serial_number[30]
u_int16_t serial_ata_features_supported
u_int16_t command_set_supported2
u_int16_t removable_media_status
u_int16_t acoustic_test_interseek_delay
u_int16_t command_set_supported_extention
int hdInit(struct device_node *dev)
int hdRead(struct driveInfo *hdd, void *, uInt32, uInt32)
u_int16_t vendor_specific1[31]
struct bsd_disklabel::partition d_partitions[8]
u_int8_t reserved_for_wwn_extention[8]
u_int16_t cfa_power_mode1
u_int16_t hardware_reset_result
u_int8_t firmware_revision[8]
#define ATA_IDENTIFY_FW_REVISION_LEN
u_int8_t max_48bit_lba[8]
int hdWrite(struct driveInfo *hdd, void *, uInt32, uInt32)
u_int16_t major_version_number
#define ATA_IDENTIFY_MEDIA_SERIAL_NUMBER_LEN
u_int16_t general_config_bits
#define ATA_IDENTIFY_SERIAL_NUMBER_LEN
u_int16_t data_set_management
u_int16_t stream_performance_granularity[2]
u_int16_t additional_supported
u_int16_t max_sectors_per_multiple
u_int16_t max_lba_range_entry_blocks
u_int16_t serial_ata_features_enabled
u_int16_t device_nominal_form_factor
u_int16_t current_acoustic_management_value
u_int16_t min_pio_transfer_with_flow_ctrl
u_int16_t minor_version_number