aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-09 19:43:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-09 19:43:30 -0400
commit6594d0b1cdfd9058f5b766e490ea1c94ae5e0ed4 (patch)
tree042a98424cf6321741bec534d3e3ef240a0bbed5 /include
parent0534c8cb5c8a8a954751fa01eef7831a475a9ec5 (diff)
parentf0edef8c8b35f04b89311590dd6f1249f07fab3a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (27 commits) xsysace: Fix dereferencing of cf_id after hd_driveid removal at91_ide: turn on PIO 6 support at91_ide: remove unused ide_mm_{outb,inb} ide-cd: reverse NOT_READY sense key logic ide: refactor tf_read() method ide: refactor tf_load() method ide: call write_devctl() method from tf_read() method ide: move common code out of tf_load() method ide: simplify 'struct ide_taskfile' ide: replace IDE_TFLAG_* flags by IDE_VALID_* ide-cd: fix intendation in cdrom_decode_status() ide-cd: unify handling of fs and pc requests in cdrom_decode_status() ide-cd: convert cdrom_decode_status() to use switch statements ide-cd: update debugging support ide-cd: respect REQ_QUIET for fs requests in cdrom_decode_status() ide: remove unused #include <linux/version.h> tx4939ide: Fix tx4939ide_{in,out}put_data_swap argument tx493[89]ide: Remove big endian version of tx493[89]ide_tf_{load,read} ide-cd: carve out an ide_cd_breathe()-helper for fs write requests ide-cd: move status checking into the IRQ handler ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h151
1 files changed, 57 insertions, 94 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index a5d26f66ef7..ff65fffb078 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -240,65 +240,38 @@ typedef enum {
240} ide_startstop_t; 240} ide_startstop_t;
241 241
242enum { 242enum {
243 IDE_VALID_ERROR = (1 << 1),
244 IDE_VALID_FEATURE = IDE_VALID_ERROR,
245 IDE_VALID_NSECT = (1 << 2),
246 IDE_VALID_LBAL = (1 << 3),
247 IDE_VALID_LBAM = (1 << 4),
248 IDE_VALID_LBAH = (1 << 5),
249 IDE_VALID_DEVICE = (1 << 6),
250 IDE_VALID_LBA = IDE_VALID_LBAL |
251 IDE_VALID_LBAM |
252 IDE_VALID_LBAH,
253 IDE_VALID_OUT_TF = IDE_VALID_FEATURE |
254 IDE_VALID_NSECT |
255 IDE_VALID_LBA,
256 IDE_VALID_IN_TF = IDE_VALID_NSECT |
257 IDE_VALID_LBA,
258 IDE_VALID_OUT_HOB = IDE_VALID_OUT_TF,
259 IDE_VALID_IN_HOB = IDE_VALID_ERROR |
260 IDE_VALID_NSECT |
261 IDE_VALID_LBA,
262};
263
264enum {
243 IDE_TFLAG_LBA48 = (1 << 0), 265 IDE_TFLAG_LBA48 = (1 << 0),
244 IDE_TFLAG_OUT_HOB_FEATURE = (1 << 1), 266 IDE_TFLAG_WRITE = (1 << 1),
245 IDE_TFLAG_OUT_HOB_NSECT = (1 << 2), 267 IDE_TFLAG_CUSTOM_HANDLER = (1 << 2),
246 IDE_TFLAG_OUT_HOB_LBAL = (1 << 3), 268 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 3),
247 IDE_TFLAG_OUT_HOB_LBAM = (1 << 4),
248 IDE_TFLAG_OUT_HOB_LBAH = (1 << 5),
249 IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE |
250 IDE_TFLAG_OUT_HOB_NSECT |
251 IDE_TFLAG_OUT_HOB_LBAL |
252 IDE_TFLAG_OUT_HOB_LBAM |
253 IDE_TFLAG_OUT_HOB_LBAH,
254 IDE_TFLAG_OUT_FEATURE = (1 << 6),
255 IDE_TFLAG_OUT_NSECT = (1 << 7),
256 IDE_TFLAG_OUT_LBAL = (1 << 8),
257 IDE_TFLAG_OUT_LBAM = (1 << 9),
258 IDE_TFLAG_OUT_LBAH = (1 << 10),
259 IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE |
260 IDE_TFLAG_OUT_NSECT |
261 IDE_TFLAG_OUT_LBAL |
262 IDE_TFLAG_OUT_LBAM |
263 IDE_TFLAG_OUT_LBAH,
264 IDE_TFLAG_OUT_DEVICE = (1 << 11),
265 IDE_TFLAG_WRITE = (1 << 12),
266 IDE_TFLAG_CUSTOM_HANDLER = (1 << 13),
267 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 14),
268 IDE_TFLAG_IN_HOB_ERROR = (1 << 15),
269 IDE_TFLAG_IN_HOB_NSECT = (1 << 16),
270 IDE_TFLAG_IN_HOB_LBAL = (1 << 17),
271 IDE_TFLAG_IN_HOB_LBAM = (1 << 18),
272 IDE_TFLAG_IN_HOB_LBAH = (1 << 19),
273 IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL |
274 IDE_TFLAG_IN_HOB_LBAM |
275 IDE_TFLAG_IN_HOB_LBAH,
276 IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_ERROR |
277 IDE_TFLAG_IN_HOB_NSECT |
278 IDE_TFLAG_IN_HOB_LBA,
279 IDE_TFLAG_IN_ERROR = (1 << 20),
280 IDE_TFLAG_IN_NSECT = (1 << 21),
281 IDE_TFLAG_IN_LBAL = (1 << 22),
282 IDE_TFLAG_IN_LBAM = (1 << 23),
283 IDE_TFLAG_IN_LBAH = (1 << 24),
284 IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL |
285 IDE_TFLAG_IN_LBAM |
286 IDE_TFLAG_IN_LBAH,
287 IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
288 IDE_TFLAG_IN_LBA,
289 IDE_TFLAG_IN_DEVICE = (1 << 25),
290 IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB |
291 IDE_TFLAG_IN_HOB,
292 IDE_TFLAG_TF = IDE_TFLAG_OUT_TF |
293 IDE_TFLAG_IN_TF,
294 IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE |
295 IDE_TFLAG_IN_DEVICE,
296 /* force 16-bit I/O operations */ 269 /* force 16-bit I/O operations */
297 IDE_TFLAG_IO_16BIT = (1 << 26), 270 IDE_TFLAG_IO_16BIT = (1 << 4),
298 /* struct ide_cmd was allocated using kmalloc() */ 271 /* struct ide_cmd was allocated using kmalloc() */
299 IDE_TFLAG_DYN = (1 << 27), 272 IDE_TFLAG_DYN = (1 << 5),
300 IDE_TFLAG_FS = (1 << 28), 273 IDE_TFLAG_FS = (1 << 6),
301 IDE_TFLAG_MULTI_PIO = (1 << 29), 274 IDE_TFLAG_MULTI_PIO = (1 << 7),
302}; 275};
303 276
304enum { 277enum {
@@ -309,45 +282,34 @@ enum {
309}; 282};
310 283
311struct ide_taskfile { 284struct ide_taskfile {
312 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */ 285 u8 data; /* 0: data byte (for TASKFILE ioctl) */
313 /* 1-5: additional data to support LBA48 */ 286 union { /* 1: */
314 union { 287 u8 error; /* read: error */
315 u8 hob_error; /* read: error */ 288 u8 feature; /* write: feature */
316 u8 hob_feature; /* write: feature */
317 };
318
319 u8 hob_nsect;
320 u8 hob_lbal;
321 u8 hob_lbam;
322 u8 hob_lbah;
323
324 u8 data; /* 6: low data byte (for TASKFILE IOCTL) */
325
326 union { /*  7: */
327 u8 error; /* read: error */
328 u8 feature; /* write: feature */
329 }; 289 };
330 290 u8 nsect; /* 2: number of sectors */
331 u8 nsect; /* 8: number of sectors */ 291 u8 lbal; /* 3: LBA low */
332 u8 lbal; /* 9: LBA low */ 292 u8 lbam; /* 4: LBA mid */
333 u8 lbam; /* 10: LBA mid */ 293 u8 lbah; /* 5: LBA high */
334 u8 lbah; /* 11: LBA high */ 294 u8 device; /* 6: device select */
335 295 union { /* 7: */
336 u8 device; /* 12: device select */ 296 u8 status; /* read: status */
337
338 union { /* 13: */
339 u8 status; /*  read: status  */
340 u8 command; /* write: command */ 297 u8 command; /* write: command */
341 }; 298 };
342}; 299};
343 300
344struct ide_cmd { 301struct ide_cmd {
345 union { 302 struct ide_taskfile tf;
346 struct ide_taskfile tf; 303 struct ide_taskfile hob;
347 u8 tf_array[14]; 304 struct {
348 }; 305 struct {
306 u8 tf;
307 u8 hob;
308 } out, in;
309 } valid;
310
311 u8 tf_flags;
349 u8 ftf_flags; /* for TASKFILE ioctl */ 312 u8 ftf_flags; /* for TASKFILE ioctl */
350 u32 tf_flags;
351 int protocol; 313 int protocol;
352 314
353 int sg_nents; /* number of sg entries */ 315 int sg_nents; /* number of sg entries */
@@ -662,8 +624,8 @@ struct ide_tp_ops {
662 void (*write_devctl)(struct hwif_s *, u8); 624 void (*write_devctl)(struct hwif_s *, u8);
663 625
664 void (*dev_select)(ide_drive_t *); 626 void (*dev_select)(ide_drive_t *);
665 void (*tf_load)(ide_drive_t *, struct ide_cmd *); 627 void (*tf_load)(ide_drive_t *, struct ide_taskfile *, u8);
666 void (*tf_read)(ide_drive_t *, struct ide_cmd *); 628 void (*tf_read)(ide_drive_t *, struct ide_taskfile *, u8);
667 629
668 void (*input_data)(ide_drive_t *, struct ide_cmd *, 630 void (*input_data)(ide_drive_t *, struct ide_cmd *,
669 void *, unsigned int); 631 void *, unsigned int);
@@ -1162,7 +1124,8 @@ extern int ide_devset_execute(ide_drive_t *drive,
1162void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8); 1124void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8);
1163int ide_complete_rq(ide_drive_t *, int, unsigned int); 1125int ide_complete_rq(ide_drive_t *, int, unsigned int);
1164 1126
1165void ide_tf_dump(const char *, struct ide_taskfile *); 1127void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd);
1128void ide_tf_dump(const char *, struct ide_cmd *);
1166 1129
1167void ide_exec_command(ide_hwif_t *, u8); 1130void ide_exec_command(ide_hwif_t *, u8);
1168u8 ide_read_status(ide_hwif_t *); 1131u8 ide_read_status(ide_hwif_t *);
@@ -1170,8 +1133,8 @@ u8 ide_read_altstatus(ide_hwif_t *);
1170void ide_write_devctl(ide_hwif_t *, u8); 1133void ide_write_devctl(ide_hwif_t *, u8);
1171 1134
1172void ide_dev_select(ide_drive_t *); 1135void ide_dev_select(ide_drive_t *);
1173void ide_tf_load(ide_drive_t *, struct ide_cmd *); 1136void ide_tf_load(ide_drive_t *, struct ide_taskfile *, u8);
1174void ide_tf_read(ide_drive_t *, struct ide_cmd *); 1137void ide_tf_read(ide_drive_t *, struct ide_taskfile *, u8);
1175 1138
1176void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1139void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
1177void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1140void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
@@ -1529,7 +1492,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data)
1529 1492
1530extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1493extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1531 1494
1532u64 ide_get_lba_addr(struct ide_taskfile *, int); 1495u64 ide_get_lba_addr(struct ide_cmd *, int);
1533u8 ide_dump_status(ide_drive_t *, const char *, u8); 1496u8 ide_dump_status(ide_drive_t *, const char *, u8);
1534 1497
1535struct ide_timing { 1498struct ide_timing {