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_DRIVE_CMD 0x31f
82
83
84 #define HDIO_SET_MULTCOUNT 0x321
85 #define HDIO_SET_UNMASKINTR 0x322
86 #define HDIO_SET_KEEPSETTINGS 0x323
87
88
89 struct hd_driveid {
90 unsigned short config;
91 unsigned short cyls;
92 unsigned short reserved2;
93 unsigned short heads;
94 unsigned short track_bytes;
95 unsigned short sector_bytes;
96 unsigned short sectors;
97 unsigned short vendor0;
98 unsigned short vendor1;
99 unsigned short vendor2;
100 unsigned char serial_no[20];
101 unsigned short buf_type;
102 unsigned short buf_size;
103 unsigned short ecc_bytes;
104 unsigned char fw_rev[8];
105 unsigned char model[40];
106 unsigned char max_multsect;
107 unsigned char vendor3;
108 unsigned short dword_io;
109 unsigned char vendor4;
110 unsigned char capability;
111 unsigned short reserved50;
112 unsigned char vendor5;
113 unsigned char tPIO;
114 unsigned char vendor6;
115 unsigned char tDMA;
116 unsigned short field_valid;
117 unsigned short cur_cyls;
118 unsigned short cur_heads;
119 unsigned short cur_sectors;
120 unsigned short cur_capacity0;
121 unsigned short cur_capacity1;
122 unsigned char multsect;
123 unsigned char multsect_valid;
124 unsigned int lba_capacity;
125 unsigned short dma_1word;
126 unsigned short dma_mword;
127 unsigned short eide_pio_modes;
128 unsigned short eide_dma_min;
129 unsigned short eide_dma_time;
130 unsigned short eide_pio;
131 unsigned short eide_pio_iordy;
132 unsigned short reserved69;
133 unsigned short reserved70;
134
135
136
137 };
138
139
140
141
142 #ifdef CONFIG_BLK_DEV_HD
143 void hd_setup(char *, int *);
144 #endif
145 #ifdef CONFIG_BLK_DEV_IDE
146 void ide_setup(char *, int *);
147 void hda_setup(char *, int *);
148 void hdb_setup(char *, int *);
149 void hdc_setup(char *, int *);
150 void hdd_setup(char *, int *);
151 #endif
152
153 #endif