UbixOS V2  2.0
hd.h
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2002-2018 The UbixOS Project.
3  * All rights reserved.
4  *
5  * This was developed by Christopher W. Olsen for the UbixOS Project.
6  *
7  * Redistribution and use in source and binary forms, with or without modification, are permitted
8  * provided that the following conditions are met:
9  *
10  * 1) Redistributions of source code must retain the above copyright notice, this list of
11  * conditions, the following disclaimer and the list of authors.
12  * 2) Redistributions in binary form must reproduce the above copyright notice, this list of
13  * conditions, the following disclaimer and the list of authors in the documentation and/or
14  * other materials provided with the distribution.
15  * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to
16  * endorse or promote products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef _PCI_HD_H_
30 #define _PCI_HD_H_
31 
32 #include <sys/types.h>
33 #include <ubixfs/ubixfs.h>
34 
35 #define hdData 0x0
36 #define hdError 0x1
37 #define hdSecCount 0x2
38 #define hdSecNum 0x3
39 #define hdCylLow 0x4
40 #define hdCylHi 0x5
41 #define hdHead 0x6
42 #define hdStat 0x7
43 #define hdCmd 0x7
44 
45 /* ATA Uhm? */
46 #define ATA_IDENTIFY_COMMAND_SET_SUPPORTED1_48BIT_ENABLE 0x0400
47 #define ATA_IDENTIFY_SECTOR_LARGER_THEN_512_ENABLE 0x0100
48 
49 /* ATA register defines */
50 #define ATA_DATA 0 /* (RW) data */
51 
52 #define ATA_FEATURE 1 /* (W) feature */
53 #define ATA_F_DMA 0x01 /* enable DMA */
54 #define ATA_F_OVL 0x02 /* enable overlap */
55 
56 #define ATA_COUNT 2 /* (W) sector count */
57 
58 #define ATA_SECTOR 3 /* (RW) sector # */
59 #define ATA_CYL_LSB 4 /* (RW) cylinder# LSB */
60 #define ATA_CYL_MSB 5 /* (RW) cylinder# MSB */
61 #define ATA_DRIVE 6 /* (W) Sector/Drive/Head */
62 #define ATA_D_LBA 0x40 /* use LBA addressing */
63 #define ATA_D_IBM 0xa0 /* 512 byte sectors, ECC */
64 
65 #define ATA_COMMAND 7 /* (W) command */
66 
67 #define ATA_ERROR 8 /* (R) error */
68 #define ATA_E_ILI 0x01 /* illegal length */
69 #define ATA_E_NM 0x02 /* no media */
70 #define ATA_E_ABORT 0x04 /* command aborted */
71 #define ATA_E_MCR 0x08 /* media change request */
72 #define ATA_E_IDNF 0x10 /* ID not found */
73 #define ATA_E_MC 0x20 /* media changed */
74 #define ATA_E_UNC 0x40 /* uncorrectable data */
75 #define ATA_E_ICRC 0x80 /* UDMA crc error */
76 #define ATA_E_ATAPI_SENSE_MASK 0xf0 /* ATAPI sense key mask */
77 
78 #define ATA_IREASON 9 /* (R) interrupt reason */
79 #define ATA_I_CMD 0x01 /* cmd (1) | data (0) */
80 #define ATA_I_IN 0x02 /* read (1) | write (0) */
81 #define ATA_I_RELEASE 0x04 /* released bus (1) */
82 #define ATA_I_TAGMASK 0xf8 /* tag mask */
83 
84 #define ATA_STATUS 10 /* (R) status */
85 #define ATA_ALTSTAT 11 /* (R) alternate status */
86 #define ATA_S_ERROR 0x01 /* error */
87 #define ATA_S_INDEX 0x02 /* index */
88 #define ATA_S_CORR 0x04 /* data corrected */
89 #define ATA_S_DRQ 0x08 /* data request */
90 #define ATA_S_DSC 0x10 /* drive seek completed */
91 #define ATA_S_SERVICE 0x10 /* drive needs service */
92 #define ATA_S_DWF 0x20 /* drive write fault */
93 #define ATA_S_DMA 0x20 /* DMA ready */
94 #define ATA_S_READY 0x40 /* drive ready */
95 #define ATA_S_BUSY 0x80 /* busy */
96 
97 #define ATA_CONTROL 12 /* (W) control */
98 
99 #define ATA_CTLOFFSET 0x206 /* control register offset */
100 #define ATA_PCCARD_CTLOFFSET 0x0e /* do for PCCARD devices */
101 #define ATA_PC98_CTLOFFSET 0x10c /* do for PC98 devices */
102 #define ATA_A_IDS 0x02 /* disable interrupts */
103 #define ATA_A_RESET 0x04 /* RESET controller */
104 #ifdef ATA_LEGACY_SUPPORT
105 #define ATA_A_4BIT 0x08 /* 4 head bits: obsolete 1996 */
106 #else
107 #define ATA_A_4BIT 0x00
108 #endif
109 #define ATA_A_HOB 0x80 /* High Order Byte enable */
110 
111 /* ATA Commands */
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
141 #define ATA_NOP 0x00
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
163 
164 struct driveInfo {
165  struct driveDiskLabel *diskLabel;
170  char hdEnable;
171  char hdDev;
172  char hdFlags;
173  char hdShift;
174  long hdMask;
176  long hdPort;
177  long hdSize;
178  long hdCalc;
179  long parOffset;
180  int part;
181  long lba_start;
182  long lba_end;
183 };
184 
185 int initHardDisk();
186 int hdWrite(struct driveInfo *hdd, void *, uInt32, uInt32);
187 int hdRead(struct driveInfo *hdd, void *, uInt32, uInt32);
188 int hdReset();
189 int hdIoctl();
190 int hdStart();
191 int hdStop();
192 int hdStandby();
193 int hdInit(struct device_node *dev);
194 
196  unsigned char dp_flag; /* bootstrap flags */
197  unsigned char dp_shd; /* starting head */
198  unsigned char dp_ssect; /* starting sector */
199  unsigned char dp_scyl; /* starting cylinder */
200  unsigned char dp_type; /* partition type */
201  unsigned char dp_ehd; /* end head */
202  unsigned char dp_esect; /* end sector */
203  unsigned char dp_ecyl; /* end cylinder */
204  uInt32 dp_start; /* absolute starting sector number */
205  uInt32 dp_size; /* partition size in sectors */
206 };
207 
208 #define MAXPARTITIONS 8
209 
211  uint32_t d_magic; /* the magic number */
212  u_int16_t d_type; /* drive type */
213  u_int16_t d_subtype; /* controller/d_type specific */
214  char d_typename[16]; /* type name, e.g. "eagle" */
215 
216  char d_packname[16]; /* pack identifier */
217 
218  /* disk geometry: */
219  uint32_t d_secsize; /* # of bytes per sector */
220  uint32_t d_nsectors; /* # of data sectors per track */
221  uint32_t d_ntracks; /* # of tracks per cylinder */
222  uint32_t d_ncylinders; /* # of data cylinders per unit */
223  uint32_t d_secpercyl; /* # of data sectors per cylinder */
224  uint32_t d_secperunit; /* # of data sectors per unit */
225 
226  /*
227  * Spares (bad sector replacements) below are not counted in
228  * d_nsectors or d_secpercyl. Spare sectors are assumed to
229  * be physical sectors which occupy space at the end of each
230  * track and/or cylinder.
231  */
232  u_int16_t d_sparespertrack; /* # of spare sectors per track */
233  u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */
234  /*
235  * Alternate cylinders include maintenance, replacement, configuration
236  * description areas, etc.
237  */
238  uint32_t d_acylinders; /* # of alt. cylinders per unit */
239 
240  /* hardware characteristics: */
241  /*
242  * d_interleave, d_trackskew and d_cylskew describe perturbations
243  * in the media format used to compensate for a slow controller.
244  * Interleave is physical sector interleave, set up by the
245  * formatter or controller when formatting. When interleaving is
246  * in use, logically adjacent sectors are not physically
247  * contiguous, but instead are separated by some number of
248  * sectors. It is specified as the ratio of physical sectors
249  * traversed per logical sector. Thus an interleave of 1:1
250  * implies contiguous layout, while 2:1 implies that logical
251  * sector 0 is separated by one sector from logical sector 1.
252  * d_trackskew is the offset of sector 0 on track N relative to
253  * sector 0 on track N-1 on the same cylinder. Finally, d_cylskew
254  * is the offset of sector 0 on cylinder N relative to sector 0
255  * on cylinder N-1.
256  */
257  u_int16_t d_rpm; /* rotational speed */
258  u_int16_t d_interleave; /* hardware sector interleave */
259  u_int16_t d_trackskew; /* sector 0 skew, per track */
260  u_int16_t d_cylskew; /* sector 0 skew, per cylinder */
261  uint32_t d_headswitch; /* head switch time, usec */
262  uint32_t d_trkseek; /* track-to-track seek, usec */
263  uint32_t d_flags; /* generic flags */
264 #define NDDATA 5
265  uint32_t d_drivedata[NDDATA]; /* drive-type specific information */
266 #define NSPARE 5
267  uint32_t d_spare[NSPARE]; /* reserved for future use */
268  uint32_t d_magic2; /* the magic number (again) */
269  u_int16_t d_checksum; /* xor of data incl. partitions */
270 
271  /* filesystem and partition information: */
272  u_int16_t d_npartitions; /* number of partitions in following */
273  uint32_t d_bbsize; /* size of boot area at sn0, bytes */
274  uint32_t d_sbsize; /* max size of fs superblock, bytes */
275  struct partition { /* the partition table */
276  uint32_t p_size; /* number of sectors in partition */
277  uint32_t p_offset; /* starting sector */
278  uint32_t p_fsize; /* filesystem basic fragment size */
279  u_int8_t p_fstype; /* filesystem type, see below */
280  u_int8_t p_frag; /* filesystem fragments per block */
281  u_int16_t p_cpg; /* filesystem cylinders per group */
282  } d_partitions[MAXPARTITIONS]; /* actually may be more */
283 };
284 
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 };
286 
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
299 
302  u_int16_t obsolete0; // word 01 (num cylinders)
304  u_int16_t obsolete1; // word 03 (num heads)
305  u_int16_t retired1[2]; // words 04-05
306  u_int16_t obsolete2; // word 06 (sectors / track)
308  u_int16_t retired0; // word 09
310  u_int16_t retired2[2]; // words 20-21
311  u_int16_t obsolete4; // word 22
315  u_int16_t reserved0; // word 48
318  u_int16_t obsolete5[2]; // words 51-52
320  u_int16_t obsolete6[5]; // words 54-58 Used to be:
321  // current cylinders,
322  // current heads,
323  // current sectors/Track,
324  // current capacity
326  u_int8_t total_num_sectors[4]; // words 60-61
327  u_int16_t obsolete7; // word 62
335  u_int16_t reserved1; // word 70
336  u_int16_t reserved2[4]; // words 71-74
337  u_int16_t queue_depth; // word 75
368  u_int16_t reserved4; // word 116
369  u_int8_t words_per_logical_sector[4]; // words 117-118
371  u_int16_t reserved5[7]; // words 120-126
374  u_int16_t vendor_specific1[31]; // words 129-159
381  u_int16_t reserved6[3]; // words 206-208
383  u_int16_t reserved7[7]; // words 210-216
385  u_int16_t reserved8[16]; // words 218-233
388  u_int16_t reserved9[19]; // words 236-254
390 };
391 
392 /*
393  * A list of partition types, probably outdated.
394  */
395 static const char * const part_types[256] = {
396  [0x00] = "unused",
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)",
411  [0x10] = "OPUS",
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)",
419  [0x24] = "NEC DOS",
420  [0x3C] = "PartitionMagic recovery",
421  [0x39] = "plan9",
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",
432  [0x53] = "DM6 Aux3",
433  [0x54] = "DM6",
434  [0x55] = "EZ-Drive (disk manager)",
435  [0x56] = "Golden Bow (disk manager)",
436  [0x5c] = "Priam Edisk (disk manager)", /* according to S. Widlake */
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",
442  [0x75] = "PCIX",
443  [0x77] = "QNX4.x",
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",
456  [0x9F] = "BSD/OS",
457  [0xA0] = "Suspend to Disk",
458  [0xA5] = "FreeBSD/NetBSD/386BSD",
459  [0xA6] = "OpenBSD",
460  [0xA7] = "NeXTSTEP",
461  [0xA9] = "NetBSD",
462  [0xAC] = "IBM JFS",
463  [0xAF] = "HFS+",
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)",
471  [0xC7] = "Syrinx",
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",
478  [0xEE] = "EFI GPT",
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", };
486 
487 #endif
ata_identify_data::enhanced_security_erase_time
u_int16_t enhanced_security_erase_time
Definition: hd.h:352
ata_identify_data::integrity_word
u_int16_t integrity_word
Definition: hd.h:389
ata_identify_data::stream_transfer_time
u_int16_t stream_transfer_time
Definition: hd.h:358
bsd_disklabel::partition
Definition: hd.h:275
ata_identify_data::min_num_blocks_per_microcode
u_int16_t min_num_blocks_per_microcode
Definition: hd.h:386
NDDATA
#define NDDATA
Definition: hd.h:264
ata_identify_data::obsolete4
u_int16_t obsolete4
Definition: hd.h:311
ata_identify_data::logical_sector_alignment
u_int16_t logical_sector_alignment
Definition: hd.h:382
ata_identify_data::serial_ata_reserved
u_int16_t serial_ata_reserved
Definition: hd.h:339
bsd_disklabel::d_drivedata
uint32_t d_drivedata[5]
Definition: hd.h:265
ata_identify_data::words_per_logical_sector
u_int8_t words_per_logical_sector[4]
Definition: hd.h:369
ata_identify_data::vendor_specific_config_bits
u_int16_t vendor_specific_config_bits
Definition: hd.h:303
ata_identify_data::security_status
u_int16_t security_status
Definition: hd.h:373
dos_partition
Definition: hd.h:195
bsd_disklabel::d_bbsize
uint32_t d_bbsize
Definition: hd.h:273
ata_identify_data::multi_word_dma_mode
u_int16_t multi_word_dma_mode
Definition: hd.h:328
ata_identify_data::pio_modes_supported
u_int16_t pio_modes_supported
Definition: hd.h:329
driveInfo::lba_high
uint32_t lba_high
Definition: hd.h:167
dos_partition::dp_ehd
unsigned char dp_ehd
Definition: hd.h:201
ata_identify_data::stream_min_request_size
u_int16_t stream_min_request_size
Definition: hd.h:357
uInt32
unsigned long int uInt32
Definition: objgfx30.h:49
ata_identify_data::total_num_sectors
u_int8_t total_num_sectors[4]
Definition: hd.h:326
ata_identify_data::obsolete6
u_int16_t obsolete6[5]
Definition: hd.h:320
ata_identify_data::master_password_revision
u_int16_t master_password_revision
Definition: hd.h:354
dos_partition::dp_scyl
unsigned char dp_scyl
Definition: hd.h:199
bsd_disklabel::d_nsectors
uint32_t d_nsectors
Definition: hd.h:220
bsd_disklabel::d_magic
uint32_t d_magic
Definition: hd.h:211
ata_identify_data::capabilities2
u_int16_t capabilities2
Definition: hd.h:317
bsd_disklabel::d_rpm
u_int16_t d_rpm
Definition: hd.h:257
ata_identify_data::reserved_for_compact_flash3
u_int16_t reserved_for_compact_flash3[6]
Definition: hd.h:379
ata_identify_data::streaming_transfer_time
u_int16_t streaming_transfer_time
Definition: hd.h:362
driveInfo::ata_identify
struct ata_identify_data * ata_identify
Definition: hd.h:166
ata_identify_data::command_set_default
u_int16_t command_set_default
Definition: hd.h:349
bsd_disklabel::d_sbsize
uint32_t d_sbsize
Definition: hd.h:274
initHardDisk
int initHardDisk()
Definition: hd.c:42
bsd_disklabel::d_secsize
uint32_t d_secsize
Definition: hd.h:219
ata_identify_data::reserved0
u_int16_t reserved0
Definition: hd.h:315
ata_identify_data::ultra_dma_mode
u_int16_t ultra_dma_mode
Definition: hd.h:350
hdStart
int hdStart()
Definition: hd.c:201
ata_identify_data::reserved9
u_int16_t reserved9[19]
Definition: hd.h:388
bsd_disklabel::d_flags
uint32_t d_flags
Definition: hd.h:263
ata_identify_data::obsolete2
u_int16_t obsolete2
Definition: hd.h:306
ata_identify_data::retired1
u_int16_t retired1[2]
Definition: hd.h:305
driveInfo
Definition: hd.h:164
ATA_IDENTIFY_48_LBA_LEN
#define ATA_IDENTIFY_48_LBA_LEN
Definition: hd.h:296
ata_identify_data::reserved5
u_int16_t reserved5[7]
Definition: hd.h:371
dos_partition::dp_type
unsigned char dp_type
Definition: hd.h:200
driveInfo::hdDev
char hdDev
Definition: hd.h:171
bsd_disklabel::d_spare
uint32_t d_spare[5]
Definition: hd.h:267
ata_identify_data::nominal_media_rotation_rate
u_int16_t nominal_media_rotation_rate
Definition: hd.h:384
bsd_disklabel::d_acylinders
uint32_t d_acylinders
Definition: hd.h:238
bsd_disklabel::d_subtype
u_int16_t d_subtype
Definition: hd.h:213
ata_identify_data::physical_logical_sector_info
u_int16_t physical_logical_sector_info
Definition: hd.h:364
ata_identify_data::serial_number
u_int8_t serial_number[20]
Definition: hd.h:309
ata_identify_data::world_wide_name
u_int8_t world_wide_name[8]
Definition: hd.h:366
ATA_IDENTIFY_MODEL_NUMBER_LEN
#define ATA_IDENTIFY_MODEL_NUMBER_LEN
Definition: hd.h:294
ata_identify_data::current_power_mgmt_value
u_int16_t current_power_mgmt_value
Definition: hd.h:353
bsd_disklabel::d_type
u_int16_t d_type
Definition: hd.h:212
types.h
driveInfo::hdEnable
char hdEnable
Definition: hd.h:170
driveInfo::hdSize
long hdSize
Definition: hd.h:177
ata_identify_data::serial_ata_capabilities
u_int16_t serial_ata_capabilities
Definition: hd.h:338
bsd_disklabel::d_secpercyl
uint32_t d_secpercyl
Definition: hd.h:223
dos_partition::dp_shd
unsigned char dp_shd
Definition: hd.h:197
bsd_disklabel::d_cylskew
u_int16_t d_cylskew
Definition: hd.h:260
ata_identify_data::min_pio_transfer_no_flow_ctrl
u_int16_t min_pio_transfer_no_flow_ctrl
Definition: hd.h:332
u_int16_t
__uint16_t u_int16_t
Definition: types.h:52
driveInfo::diskLabel
struct driveDiskLabel * diskLabel
Definition: hd.h:165
ata_identify_data::command_set_enabled1
u_int16_t command_set_enabled1
Definition: hd.h:348
bsd_disklabel::d_sparespercyl
u_int16_t d_sparespercyl
Definition: hd.h:233
ata_identify_data::command_set_supported0
u_int16_t command_set_supported0
Definition: hd.h:344
ata_identify_data::model_number
u_int8_t model_number[40]
Definition: hd.h:313
bsd_disklabel::partition::p_frag
u_int8_t p_frag
Definition: hd.h:280
hdStandby
int hdStandby()
Definition: hd.c:196
bsd_disklabel::d_sparespertrack
u_int16_t d_sparespertrack
Definition: hd.h:232
driveInfo::lba_low
uint32_t lba_low
Definition: hd.h:168
driveInfo::part
int part
Definition: hd.h:180
ata_identify_data::reserved8
u_int16_t reserved8[16]
Definition: hd.h:385
ata_identify_data::command_set_supported1
u_int16_t command_set_supported1
Definition: hd.h:345
ata_identify_data::stream_access_latency
u_int16_t stream_access_latency
Definition: hd.h:359
ata_identify_data::max_num_blocks_per_microcode
u_int16_t max_num_blocks_per_microcode
Definition: hd.h:387
ata_identify_data::obsolete0
u_int16_t obsolete0
Definition: hd.h:302
u_int8_t
__uint8_t u_int8_t
Definition: types.h:51
ata_identify_data::reserved_for_compact_flash1
u_int16_t reserved_for_compact_flash1[2]
Definition: hd.h:307
device_node
Definition: device.h:34
bsd_disklabel::partition::p_fsize
uint32_t p_fsize
Definition: hd.h:278
ata_identify_data::command_set_enabled0
u_int16_t command_set_enabled0
Definition: hd.h:347
ata_identify_data::current_max_sectors_per_multiple
u_int16_t current_max_sectors_per_multiple
Definition: hd.h:325
ata_identify_data::reserved6
u_int16_t reserved6[3]
Definition: hd.h:381
hdReset
int hdReset()
Definition: hd.c:216
bsd_disklabel::d_magic2
uint32_t d_magic2
Definition: hd.h:268
ATA_IDENTIFY_WWN_LEN
#define ATA_IDENTIFY_WWN_LEN
Definition: hd.h:298
ata_identify_data::rec_min_multiword_dma_transfer_cycle
u_int16_t rec_min_multiword_dma_transfer_cycle
Definition: hd.h:331
dos_partition::dp_esect
unsigned char dp_esect
Definition: hd.h:202
ata_identify_data::security_erase_completion_time
u_int16_t security_erase_completion_time
Definition: hd.h:351
bsd_disklabel::d_secperunit
uint32_t d_secperunit
Definition: hd.h:224
ata_identify_data::min_multiword_dma_transfer_cycle
u_int16_t min_multiword_dma_transfer_cycle
Definition: hd.h:330
bsd_disklabel::d_typename
char d_typename[16]
Definition: hd.h:214
uint32_t
__uint32_t uint32_t
Definition: types.h:46
driveInfo::hdShift
char hdShift
Definition: hd.h:173
driveInfo::hdPort
long hdPort
Definition: hd.h:176
ata_identify_data
Definition: hd.h:300
ata_identify_data::queue_depth
u_int16_t queue_depth
Definition: hd.h:337
ata_identify_data::reserved_for_compact_flash2
u_int16_t reserved_for_compact_flash2[7]
Definition: hd.h:376
driveInfo::lba_start
long lba_start
Definition: hd.h:181
ata_identify_data::current_media_serial_number
u_int16_t current_media_serial_number[30]
Definition: hd.h:380
driveInfo::hdFlags
char hdFlags
Definition: hd.h:172
bsd_disklabel::d_trackskew
u_int16_t d_trackskew
Definition: hd.h:259
ata_identify_data::retired0
u_int16_t retired0
Definition: hd.h:308
bsd_disklabel::d_interleave
u_int16_t d_interleave
Definition: hd.h:258
ata_identify_data::serial_ata_features_supported
u_int16_t serial_ata_features_supported
Definition: hd.h:340
ata_identify_data::command_set_supported2
u_int16_t command_set_supported2
Definition: hd.h:370
ata_identify_data::removable_media_status
u_int16_t removable_media_status
Definition: hd.h:372
driveInfo::sector_size
uint32_t sector_size
Definition: hd.h:169
bsd_disklabel::d_npartitions
u_int16_t d_npartitions
Definition: hd.h:272
ata_identify_data::acoustic_test_interseek_delay
u_int16_t acoustic_test_interseek_delay
Definition: hd.h:365
ata_identify_data::command_set_supported_extention
u_int16_t command_set_supported_extention
Definition: hd.h:346
hdInit
int hdInit(struct device_node *dev)
Definition: hd.c:221
bsd_disklabel::partition::p_fstype
u_int8_t p_fstype
Definition: hd.h:279
ata_identify_data::reserved2
u_int16_t reserved2[4]
Definition: hd.h:336
hdRead
int hdRead(struct driveInfo *hdd, void *, uInt32, uInt32)
Definition: hd.c:423
ata_identify_data::vendor_specific1
u_int16_t vendor_specific1[31]
Definition: hd.h:374
driveInfo::parOffset
long parOffset
Definition: hd.h:179
ata_identify_data::obsolete1
u_int16_t obsolete1
Definition: hd.h:304
ubixfs.h
ata_identify_data::validity_bits
u_int16_t validity_bits
Definition: hd.h:319
bsd_disklabel::d_partitions
struct bsd_disklabel::partition d_partitions[8]
dos_partition::dp_size
uInt32 dp_size
Definition: hd.h:205
driveInfo::lba_end
long lba_end
Definition: hd.h:182
ata_identify_data::obsolete7
u_int16_t obsolete7
Definition: hd.h:327
driveInfo::hdCalc
long hdCalc
Definition: hd.h:178
MAXPARTITIONS
#define MAXPARTITIONS
Definition: hd.h:208
bsd_disklabel::d_ntracks
uint32_t d_ntracks
Definition: hd.h:221
ata_identify_data::reserved_for_wwn_extention
u_int8_t reserved_for_wwn_extention[8]
Definition: hd.h:367
ata_identify_data::cfa_power_mode1
u_int16_t cfa_power_mode1
Definition: hd.h:375
ata_identify_data::hardware_reset_result
u_int16_t hardware_reset_result
Definition: hd.h:355
ata_identify_data::firmware_revision
u_int8_t firmware_revision[8]
Definition: hd.h:312
ATA_IDENTIFY_FW_REVISION_LEN
#define ATA_IDENTIFY_FW_REVISION_LEN
Definition: hd.h:295
bsd_disklabel::d_checksum
u_int16_t d_checksum
Definition: hd.h:269
ata_identify_data::max_48bit_lba
u_int8_t max_48bit_lba[8]
Definition: hd.h:361
ata_identify_data::reserved7
u_int16_t reserved7[7]
Definition: hd.h:383
bsd_disklabel::d_packname
char d_packname[16]
Definition: hd.h:216
hdWrite
int hdWrite(struct driveInfo *hdd, void *, uInt32, uInt32)
Definition: hd.c:356
ata_identify_data::reserved1
u_int16_t reserved1
Definition: hd.h:335
ata_identify_data::obsolete5
u_int16_t obsolete5[2]
Definition: hd.h:318
ata_identify_data::major_version_number
u_int16_t major_version_number
Definition: hd.h:342
hdIoctl
int hdIoctl()
Definition: hd.c:211
ata_identify_data::reserved4
u_int16_t reserved4
Definition: hd.h:368
ATA_IDENTIFY_MEDIA_SERIAL_NUMBER_LEN
#define ATA_IDENTIFY_MEDIA_SERIAL_NUMBER_LEN
Definition: hd.h:297
bsd_disklabel::d_headswitch
uint32_t d_headswitch
Definition: hd.h:261
ata_identify_data::general_config_bits
u_int16_t general_config_bits
Definition: hd.h:301
bsd_disklabel::partition::p_cpg
u_int16_t p_cpg
Definition: hd.h:281
bsd_disklabel::partition::p_size
uint32_t p_size
Definition: hd.h:276
bsd_disklabel::partition::p_offset
uint32_t p_offset
Definition: hd.h:277
ATA_IDENTIFY_SERIAL_NUMBER_LEN
#define ATA_IDENTIFY_SERIAL_NUMBER_LEN
Definition: hd.h:293
ata_identify_data::data_set_management
u_int16_t data_set_management
Definition: hd.h:378
dos_partition::dp_ecyl
unsigned char dp_ecyl
Definition: hd.h:203
dos_partition::dp_start
uInt32 dp_start
Definition: hd.h:204
hdStop
int hdStop()
Definition: hd.c:206
ata_identify_data::stream_performance_granularity
u_int16_t stream_performance_granularity[2]
Definition: hd.h:360
driveInfo::hdMask
long hdMask
Definition: hd.h:174
bsd_disklabel
Definition: hd.h:210
ata_identify_data::retired2
u_int16_t retired2[2]
Definition: hd.h:310
dos_partition::dp_flag
unsigned char dp_flag
Definition: hd.h:196
ata_identify_data::additional_supported
u_int16_t additional_supported
Definition: hd.h:334
ata_identify_data::max_sectors_per_multiple
u_int16_t max_sectors_per_multiple
Definition: hd.h:314
driveInfo::hdMulti
uint32_t hdMulti
Definition: hd.h:175
ata_identify_data::capabilities1
u_int16_t capabilities1
Definition: hd.h:316
bsd_disklabel::d_trkseek
uint32_t d_trkseek
Definition: hd.h:262
NSPARE
#define NSPARE
Definition: hd.h:266
ata_identify_data::max_lba_range_entry_blocks
u_int16_t max_lba_range_entry_blocks
Definition: hd.h:363
bsd_disklabel::d_ncylinders
uint32_t d_ncylinders
Definition: hd.h:222
ata_identify_data::serial_ata_features_enabled
u_int16_t serial_ata_features_enabled
Definition: hd.h:341
ata_identify_data::device_nominal_form_factor
u_int16_t device_nominal_form_factor
Definition: hd.h:377
dos_partition::dp_ssect
unsigned char dp_ssect
Definition: hd.h:198
ata_identify_data::current_acoustic_management_value
u_int16_t current_acoustic_management_value
Definition: hd.h:356
ata_identify_data::min_pio_transfer_with_flow_ctrl
u_int16_t min_pio_transfer_with_flow_ctrl
Definition: hd.h:333
ata_identify_data::minor_version_number
u_int16_t minor_version_number
Definition: hd.h:343
NULL
#define NULL
Definition: fat_string.h:17