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