1 #ifndef _LINUX_HDREG_H
2 #define _LINUX_HDREG_H
3
4
5
6
7
8
9
10
11 #define HD_DATA 0x1f0
12 #define HD_ERROR 0x1f1
13 #define HD_NSECTOR 0x1f2
14 #define HD_SECTOR 0x1f3
15 #define HD_LCYL 0x1f4
16 #define HD_HCYL 0x1f5
17 #define HD_CURRENT 0x1f6
18 #define HD_STATUS 0x1f7
19 #define HD_PRECOMP HD_ERROR
20 #define HD_COMMAND HD_STATUS
21
22 #define HD_CMD 0x3f6
23
24
25 #define ERR_STAT 0x01
26 #define INDEX_STAT 0x02
27 #define ECC_STAT 0x04
28 #define DRQ_STAT 0x08
29 #define SEEK_STAT 0x10
30 #define WRERR_STAT 0x20
31 #define READY_STAT 0x40
32 #define BUSY_STAT 0x80
33
34
35 #define WIN_RESTORE 0x10
36 #define WIN_READ 0x20
37 #define WIN_WRITE 0x30
38 #define WIN_VERIFY 0x40
39 #define WIN_FORMAT 0x50
40 #define WIN_INIT 0x60
41 #define WIN_SEEK 0x70
42 #define WIN_DIAGNOSE 0x90
43 #define WIN_SPECIFY 0x91
44
45 #define WIN_MULTREAD 0xC4
46 #define WIN_MULTWRITE 0xC5
47 #define WIN_SETMULT 0xC6
48 #define WIN_IDENTIFY 0xEC
49 #define WIN_SETFEATURES 0xEF
50
51
52 #define MARK_ERR 0x01
53 #define TRK0_ERR 0x02
54 #define ABRT_ERR 0x04
55 #define ID_ERR 0x10
56 #define ECC_ERR 0x40
57 #define BBD_ERR 0x80
58
59
60
61
62 #define HDIO_REQ 0x301
63 #define HDIO_GETGEO 0x301
64 struct hd_geometry {
65 unsigned char heads;
66 unsigned char sectors;
67 unsigned short cylinders;
68 unsigned long start;
69 };
70 #define HDIO_GETUNMASKINTR 0x302
71 #define HDIO_SETUNMASKINTR 0x303
72 #define HDIO_GETMULTCOUNT 0x304
73 #define HDIO_SETMULTCOUNT 0x305
74 #define HDIO_SETFEATURE 0x306
75 #define HDIO_GETIDENTITY 0x307
76 #endif
77
78
79 struct hd_driveid {
80 unsigned short config;
81 unsigned short cyls;
82 unsigned short reserved0;
83 unsigned short heads;
84 unsigned short track_bytes;
85 unsigned short sector_bytes;
86 unsigned short sectors;
87 unsigned short vendor0;
88 unsigned short vendor1;
89 unsigned short vendor2;
90 unsigned char serial_no[20];
91 unsigned short buf_type;
92 unsigned short buf_size;
93 unsigned short ecc_bytes;
94 unsigned char fw_rev[8];
95 unsigned char model[40];
96 unsigned char max_multsect;
97 unsigned char vendor3;
98 unsigned short dword_io;
99 unsigned char vendor4;
100 unsigned char capability;
101 unsigned short reserved1;
102 unsigned char vendor5;
103 unsigned char tPIO;
104 unsigned char vendor6;
105 unsigned char tDMA;
106 unsigned short cur_valid;
107 unsigned short cur_cyls;
108 unsigned short cur_heads;
109 unsigned short cur_sectors;
110 unsigned short cur_capacity0;
111 unsigned short cur_capacity1;
112 unsigned char multsect;
113 unsigned char multsect_valid;
114 unsigned int lba_capacity;
115 unsigned short dma_1word;
116 unsigned short dma_mword;
117
118
119
120 };