1 #ifndef _LINUX_HDREG_H
2 #define _LINUX_HDREG_H
3
4 #include <linux/config.h>
5
6
7
8
9
10
11
12
13
14 #define HD_DATA 0x1f0
15 #define HD_ERROR 0x1f1
16 #define HD_NSECTOR 0x1f2
17 #define HD_SECTOR 0x1f3
18 #define HD_LCYL 0x1f4
19 #define HD_HCYL 0x1f5
20 #define HD_CURRENT 0x1f6
21 #define HD_STATUS 0x1f7
22 #define HD_FEATURE HD_ERROR
23 #define HD_PRECOMP HD_FEATURE
24 #define HD_COMMAND HD_STATUS
25
26 #define HD_CMD 0x3f6
27 #define HD_ALTSTATUS 0x3f6
28
29
30 #define ERR_STAT 0x01
31 #define INDEX_STAT 0x02
32 #define ECC_STAT 0x04
33 #define DRQ_STAT 0x08
34 #define SEEK_STAT 0x10
35 #define WRERR_STAT 0x20
36 #define READY_STAT 0x40
37 #define BUSY_STAT 0x80
38
39
40 #define WIN_RESTORE 0x10
41 #define WIN_READ 0x20
42 #define WIN_WRITE 0x30
43 #define WIN_VERIFY 0x40
44 #define WIN_FORMAT 0x50
45 #define WIN_INIT 0x60
46 #define WIN_SEEK 0x70
47 #define WIN_DIAGNOSE 0x90
48 #define WIN_SPECIFY 0x91
49 #define WIN_SETIDLE1 0xE3
50 #define WIN_SETIDLE2 0x97
51
52 #define WIN_PIDENTIFY 0xA1
53 #define WIN_MULTREAD 0xC4
54 #define WIN_MULTWRITE 0xC5
55 #define WIN_SETMULT 0xC6
56 #define WIN_IDENTIFY 0xEC
57 #define WIN_SETFEATURES 0xEF
58
59
60 #define MARK_ERR 0x01
61 #define TRK0_ERR 0x02
62 #define ABRT_ERR 0x04
63 #define ID_ERR 0x10
64 #define ECC_ERR 0x40
65 #define BBD_ERR 0x80
66
67 struct hd_geometry {
68 unsigned char heads;
69 unsigned char sectors;
70 unsigned short cylinders;
71 unsigned long start;
72 };
73
74
75 #define HDIO_GETGEO 0x301
76 #define HDIO_REQ HDIO_GETGEO
77 #define HDIO_GET_UNMASKINTR 0x302
78 #define HDIO_GET_MULTCOUNT 0x304
79 #define HDIO_GET_IDENTITY 0x307
80 #define HDIO_GET_KEEPSETTINGS 0x308
81 #define HDIO_GET_CHIPSET 0x309
82 #define HDIO_GET_NOWERR 0x30a
83 #define HDIO_DRIVE_CMD 0x31f
84
85
86 #define HDIO_SET_MULTCOUNT 0x321
87 #define HDIO_SET_UNMASKINTR 0x322
88 #define HDIO_SET_KEEPSETTINGS 0x323
89 #define HDIO_SET_CHIPSET 0x324
90 #define HDIO_SET_NOWERR 0x325
91
92
93 struct hd_driveid {
94 unsigned short config;
95 unsigned short cyls;
96 unsigned short reserved2;
97 unsigned short heads;
98 unsigned short track_bytes;
99 unsigned short sector_bytes;
100 unsigned short sectors;
101 unsigned short vendor0;
102 unsigned short vendor1;
103 unsigned short vendor2;
104 unsigned char serial_no[20];
105 unsigned short buf_type;
106 unsigned short buf_size;
107 unsigned short ecc_bytes;
108 unsigned char fw_rev[8];
109 unsigned char model[40];
110 unsigned char max_multsect;
111 unsigned char vendor3;
112 unsigned short dword_io;
113 unsigned char vendor4;
114 unsigned char capability;
115 unsigned short reserved50;
116 unsigned char vendor5;
117 unsigned char tPIO;
118 unsigned char vendor6;
119 unsigned char tDMA;
120 unsigned short field_valid;
121 unsigned short cur_cyls;
122 unsigned short cur_heads;
123 unsigned short cur_sectors;
124 unsigned short cur_capacity0;
125 unsigned short cur_capacity1;
126 unsigned char multsect;
127 unsigned char multsect_valid;
128 unsigned int lba_capacity;
129 unsigned short dma_1word;
130 unsigned short dma_mword;
131 unsigned short eide_pio_modes;
132 unsigned short eide_dma_min;
133 unsigned short eide_dma_time;
134 unsigned short eide_pio;
135 unsigned short eide_pio_iordy;
136 unsigned short reserved69;
137 unsigned short reserved70;
138
139
140
141 };
142
143
144
145
146 #ifdef CONFIG_BLK_DEV_HD
147 void hd_setup(char *, int *);
148 #endif
149 #ifdef CONFIG_BLK_DEV_IDE
150 void ide_setup(char *, int *);
151 void hda_setup(char *, int *);
152 void hdb_setup(char *, int *);
153 void hdc_setup(char *, int *);
154 void hdd_setup(char *, int *);
155 #endif
156
157 #endif