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