ppc: Fix client stack setup
[openbios.git] / drivers / hdreg.h
blob91e4d1ff6cab54e1ddaded739bbd720e7f562e6f
1 /*
2 * this header holds data structures as dictated by spec
3 */
4 #ifndef HDREG_H
5 #define HDREG_H
7 struct hd_driveid {
8 unsigned short config; /* lots of obsolete bit flags */
9 unsigned short cyls; /* Obsolete, "physical" cyls */
10 unsigned short reserved2; /* reserved (word 2) */
11 unsigned short heads; /* Obsolete, "physical" heads */
12 unsigned short track_bytes; /* unformatted bytes per track */
13 unsigned short sector_bytes; /* unformatted bytes per sector */
14 unsigned short sectors; /* Obsolete, "physical" sectors per track */
15 unsigned short vendor0; /* vendor unique */
16 unsigned short vendor1; /* vendor unique */
17 unsigned short vendor2; /* Retired vendor unique */
18 unsigned char serial_no[20]; /* 0 = not_specified */
19 unsigned short buf_type; /* Retired */
20 unsigned short buf_size; /* Retired, 512 byte increments
21 * 0 = not_specified
23 unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */
24 unsigned char fw_rev[8]; /* 0 = not_specified */
25 unsigned char model[40]; /* 0 = not_specified */
26 unsigned char max_multsect; /* 0=not_implemented */
27 unsigned char vendor3; /* vendor unique */
28 unsigned short dword_io; /* 0=not_implemented; 1=implemented */
29 unsigned char vendor4; /* vendor unique */
30 unsigned char capability; /* (upper byte of word 49)
31 * 3: IORDYsup
32 * 2: IORDYsw
33 * 1: LBA
34 * 0: DMA
36 unsigned short reserved50; /* reserved (word 50) */
37 unsigned char vendor5; /* Obsolete, vendor unique */
38 unsigned char tPIO; /* Obsolete, 0=slow, 1=medium, 2=fast */
39 unsigned char vendor6; /* Obsolete, vendor unique */
40 unsigned char tDMA; /* Obsolete, 0=slow, 1=medium, 2=fast */
41 unsigned short field_valid; /* (word 53)
42 * 2: ultra_ok word 88
43 * 1: eide_ok words 64-70
44 * 0: cur_ok words 54-58
46 unsigned short cur_cyls; /* Obsolete, logical cylinders */
47 unsigned short cur_heads; /* Obsolete, l heads */
48 unsigned short cur_sectors; /* Obsolete, l sectors per track */
49 unsigned short cur_capacity0; /* Obsolete, l total sectors on drive */
50 unsigned short cur_capacity1; /* Obsolete, (2 words, misaligned int) */
51 unsigned char multsect; /* current multiple sector count */
52 unsigned char multsect_valid; /* when (bit0==1) multsect is ok */
53 unsigned int lba_capacity; /* Obsolete, total number of sectors */
54 unsigned short dma_1word; /* Obsolete, single-word dma info */
55 unsigned short dma_mword; /* multiple-word dma info */
56 unsigned short eide_pio_modes; /* bits 0:mode3 1:mode4 */
57 unsigned short eide_dma_min; /* min mword dma cycle time (ns) */
58 unsigned short eide_dma_time; /* recommended mword dma cycle time (ns) */
59 unsigned short eide_pio; /* min cycle time (ns), no IORDY */
60 unsigned short eide_pio_iordy; /* min cycle time (ns), with IORDY */
61 unsigned short words69_70[2]; /* reserved words 69-70
62 * future command overlap and queuing
64 /* HDIO_GET_IDENTITY currently returns only words 0 through 70 */
65 unsigned short words71_74[4]; /* reserved words 71-74
66 * for IDENTIFY PACKET DEVICE command
68 unsigned short queue_depth; /* (word 75)
69 * 15:5 reserved
70 * 4:0 Maximum queue depth -1
72 unsigned short words76_79[4]; /* reserved words 76-79 */
73 unsigned short major_rev_num; /* (word 80) */
74 unsigned short minor_rev_num; /* (word 81) */
75 unsigned short command_set_1; /* (word 82) supported
76 * 15: Obsolete
77 * 14: NOP command
78 * 13: READ_BUFFER
79 * 12: WRITE_BUFFER
80 * 11: Obsolete
81 * 10: Host Protected Area
82 * 9: DEVICE Reset
83 * 8: SERVICE Interrupt
84 * 7: Release Interrupt
85 * 6: look-ahead
86 * 5: write cache
87 * 4: PACKET Command
88 * 3: Power Management Feature Set
89 * 2: Removable Feature Set
90 * 1: Security Feature Set
91 * 0: SMART Feature Set
93 unsigned short command_set_2; /* (word 83)
94 * 15: Shall be ZERO
95 * 14: Shall be ONE
96 * 13: FLUSH CACHE EXT
97 * 12: FLUSH CACHE
98 * 11: Device Configuration Overlay
99 * 10: 48-bit Address Feature Set
100 * 9: Automatic Acoustic Management
101 * 8: SET MAX security
102 * 7: reserved 1407DT PARTIES
103 * 6: SetF sub-command Power-Up
104 * 5: Power-Up in Standby Feature Set
105 * 4: Removable Media Notification
106 * 3: APM Feature Set
107 * 2: CFA Feature Set
108 * 1: READ/WRITE DMA QUEUED
109 * 0: Download MicroCode
111 unsigned short cfsse; /* (word 84)
112 * cmd set-feature supported extensions
113 * 15: Shall be ZERO
114 * 14: Shall be ONE
115 * 13:6 reserved
116 * 5: General Purpose Logging
117 * 4: Streaming Feature Set
118 * 3: Media Card Pass Through
119 * 2: Media Serial Number Valid
120 * 1: SMART selt-test supported
121 * 0: SMART error logging
123 unsigned short cfs_enable_1; /* (word 85)
124 * command set-feature enabled
125 * 15: Obsolete
126 * 14: NOP command
127 * 13: READ_BUFFER
128 * 12: WRITE_BUFFER
129 * 11: Obsolete
130 * 10: Host Protected Area
131 * 9: DEVICE Reset
132 * 8: SERVICE Interrupt
133 * 7: Release Interrupt
134 * 6: look-ahead
135 * 5: write cache
136 * 4: PACKET Command
137 * 3: Power Management Feature Set
138 * 2: Removable Feature Set
139 * 1: Security Feature Set
140 * 0: SMART Feature Set
142 unsigned short cfs_enable_2; /* (word 86)
143 * command set-feature enabled
144 * 15: Shall be ZERO
145 * 14: Shall be ONE
146 * 13: FLUSH CACHE EXT
147 * 12: FLUSH CACHE
148 * 11: Device Configuration Overlay
149 * 10: 48-bit Address Feature Set
150 * 9: Automatic Acoustic Management
151 * 8: SET MAX security
152 * 7: reserved 1407DT PARTIES
153 * 6: SetF sub-command Power-Up
154 * 5: Power-Up in Standby Feature Set
155 * 4: Removable Media Notification
156 * 3: APM Feature Set
157 * 2: CFA Feature Set
158 * 1: READ/WRITE DMA QUEUED
159 * 0: Download MicroCode
161 unsigned short csf_default; /* (word 87)
162 * command set-feature default
163 * 15: Shall be ZERO
164 * 14: Shall be ONE
165 * 13:6 reserved
166 * 5: General Purpose Logging enabled
167 * 4: Valid CONFIGURE STREAM executed
168 * 3: Media Card Pass Through enabled
169 * 2: Media Serial Number Valid
170 * 1: SMART selt-test supported
171 * 0: SMART error logging
173 unsigned short dma_ultra; /* (word 88) */
174 unsigned short trseuc; /* time required for security erase */
175 unsigned short trsEuc; /* time required for enhanced erase */
176 unsigned short CurAPMvalues; /* current APM values */
177 unsigned short mprc; /* master password revision code */
178 unsigned short hw_config; /* hardware config (word 93)
179 * 15: Shall be ZERO
180 * 14: Shall be ONE
181 * 13:
182 * 12:
183 * 11:
184 * 10:
185 * 9:
186 * 8:
187 * 7:
188 * 6:
189 * 5:
190 * 4:
191 * 3:
192 * 2:
193 * 1:
194 * 0: Shall be ONE
196 unsigned short acoustic; /* (word 94)
197 * 15:8 Vendor's recommended value
198 * 7:0 current value
200 unsigned short msrqs; /* min stream request size */
201 unsigned short sxfert; /* stream transfer time */
202 unsigned short sal; /* stream access latency */
203 unsigned int spg; /* stream performance granularity */
204 unsigned long long lba_capacity_2;/* 48-bit total number of sectors */
205 unsigned short words104_125[22];/* reserved words 104-125 */
206 unsigned short last_lun; /* (word 126) */
207 unsigned short word127; /* (word 127) Feature Set
208 * Removable Media Notification
209 * 15:2 reserved
210 * 1:0 00 = not supported
211 * 01 = supported
212 * 10 = reserved
213 * 11 = reserved
215 unsigned short dlf; /* (word 128)
216 * device lock function
217 * 15:9 reserved
218 * 8 security level 1:max 0:high
219 * 7:6 reserved
220 * 5 enhanced erase
221 * 4 expire
222 * 3 frozen
223 * 2 locked
224 * 1 en/disabled
225 * 0 capability
227 unsigned short csfo; /* (word 129)
228 * current set features options
229 * 15:4 reserved
230 * 3: auto reassign
231 * 2: reverting
232 * 1: read-look-ahead
233 * 0: write cache
235 unsigned short words130_155[26];/* reserved vendor words 130-155 */
236 unsigned short word156; /* reserved vendor word 156 */
237 unsigned short words157_159[3];/* reserved vendor words 157-159 */
238 unsigned short cfa_power; /* (word 160) CFA Power Mode
239 * 15 word 160 supported
240 * 14 reserved
241 * 13
242 * 12
243 * 11:0
245 unsigned short words161_175[15];/* Reserved for CFA */
246 unsigned short words176_205[30];/* Current Media Serial Number */
247 unsigned short words206_254[49];/* reserved words 206-254 */
248 unsigned short integrity_word; /* (word 255)
249 * 15:8 Checksum
250 * 7:0 Signature
254 struct request_sense {
255 #if defined(CONFIG_BIG_ENDIAN)
256 u8 valid : 1;
257 u8 error_code : 7;
258 #elif defined(CONFIG_LITTLE_ENDIAN)
259 u8 error_code : 7;
260 u8 valid : 1;
261 #endif
262 u8 segment_number;
263 #if defined(CONFIG_BIG_ENDIAN)
264 u8 reserved1 : 2;
265 u8 ili : 1;
266 u8 reserved2 : 1;
267 u8 sense_key : 4;
268 #elif defined(CONFIG_LITTLE_ENDIAN)
269 u8 sense_key : 4;
270 u8 reserved2 : 1;
271 u8 ili : 1;
272 u8 reserved1 : 2;
273 #endif
274 u8 information[4];
275 u8 add_sense_len;
276 u8 command_info[4];
277 u8 asc;
278 u8 ascq;
279 u8 fruc;
280 u8 sks[3];
281 u8 asb[46];
284 struct atapi_capacity {
285 u32 lba;
286 u32 block_size;
289 #endif