aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 20:30:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 20:30:26 -0400
commit8ab68ab420d5fc084b8cdd76a72df72c5e1cdb5d (patch)
tree6aef86d06a5eda99f09ac00c1af4084c2d49d2ac /include/linux
parentf05c463be51898e745c4aa8245b05e25d73fa975 (diff)
parent7b255436df0543856faaae4704034fe83bc20717 (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: (35 commits) siimage: coding style cleanup (take 2) ide-cd: clean up cdrom_analyze_sense_data() ide-cd: fix test unsigned var < 0 ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[] piix: add Asus Eee 701 controller to short cable list ARM: always select HAVE_IDE remove the broken ETRAX_IDE driver ide: remove ->dma_prdtable field from ide_hwif_t ide: remove ->dma_vendor{1,3} fields from ide_hwif_t scc_pata: add ->dma_host_set and ->dma_start methods ide: skip "VLB sync" if host uses MMIO ide: add ide_pad_transfer() helper ide: remove ->INW and ->OUTW methods ide: use IDE I/O helpers directly in ide_tf_{load,read}() ns87415: add ->tf_read method scc_pata: add ->tf_{load,read} methods ide-h8300: add ->tf_{load,read} methods ide-cris: add ->tf_{load,read} methods ide: add ->tf_load and ->tf_read methods ide: move ide_tf_{load,read} to ide-iops.c ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ide.h53
1 files changed, 14 insertions, 39 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 32fd77bb4436..b0135b0c3a04 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -427,6 +427,8 @@ struct ide_dma_ops {
427 void (*dma_timeout)(struct ide_drive_s *); 427 void (*dma_timeout)(struct ide_drive_s *);
428}; 428};
429 429
430struct ide_task_s;
431
430typedef struct hwif_s { 432typedef struct hwif_s {
431 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ 433 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
432 struct hwif_s *mate; /* other hwif from same PCI chip */ 434 struct hwif_s *mate; /* other hwif from same PCI chip */
@@ -467,24 +469,18 @@ typedef struct hwif_s {
467 const struct ide_port_ops *port_ops; 469 const struct ide_port_ops *port_ops;
468 const struct ide_dma_ops *dma_ops; 470 const struct ide_dma_ops *dma_ops;
469 471
470 void (*ata_input_data)(ide_drive_t *, void *, u32); 472 void (*tf_load)(ide_drive_t *, struct ide_task_s *);
471 void (*ata_output_data)(ide_drive_t *, void *, u32); 473 void (*tf_read)(ide_drive_t *, struct ide_task_s *);
472 474
473 void (*atapi_input_bytes)(ide_drive_t *, void *, u32); 475 void (*input_data)(ide_drive_t *, struct request *, void *, unsigned);
474 void (*atapi_output_bytes)(ide_drive_t *, void *, u32); 476 void (*output_data)(ide_drive_t *, struct request *, void *, unsigned);
475 477
476 void (*ide_dma_clear_irq)(ide_drive_t *drive); 478 void (*ide_dma_clear_irq)(ide_drive_t *drive);
477 479
478 void (*OUTB)(u8 addr, unsigned long port); 480 void (*OUTB)(u8 addr, unsigned long port);
479 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); 481 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
480 void (*OUTW)(u16 addr, unsigned long port);
481 void (*OUTSW)(unsigned long port, void *addr, u32 count);
482 void (*OUTSL)(unsigned long port, void *addr, u32 count);
483 482
484 u8 (*INB)(unsigned long port); 483 u8 (*INB)(unsigned long port);
485 u16 (*INW)(unsigned long port);
486 void (*INSW)(unsigned long port, void *addr, u32 count);
487 void (*INSL)(unsigned long port, void *addr, u32 count);
488 484
489 /* dma physical region descriptor table (cpu view) */ 485 /* dma physical region descriptor table (cpu view) */
490 unsigned int *dmatable_cpu; 486 unsigned int *dmatable_cpu;
@@ -509,10 +505,7 @@ typedef struct hwif_s {
509 505
510 unsigned long dma_base; /* base addr for dma ports */ 506 unsigned long dma_base; /* base addr for dma ports */
511 unsigned long dma_command; /* dma command register */ 507 unsigned long dma_command; /* dma command register */
512 unsigned long dma_vendor1; /* dma vendor 1 register */
513 unsigned long dma_status; /* dma status register */ 508 unsigned long dma_status; /* dma status register */
514 unsigned long dma_vendor3; /* dma vendor 3 register */
515 unsigned long dma_prdtable; /* actual prd table address */
516 509
517 unsigned long config_data; /* for use by chipset-specific code */ 510 unsigned long config_data; /* for use by chipset-specific code */
518 unsigned long select_data; /* for use by chipset-specific code */ 511 unsigned long select_data; /* for use by chipset-specific code */
@@ -547,7 +540,7 @@ typedef ide_startstop_t (ide_handler_t)(ide_drive_t *);
547typedef int (ide_expiry_t)(ide_drive_t *); 540typedef int (ide_expiry_t)(ide_drive_t *);
548 541
549/* used by ide-cd, ide-floppy, etc. */ 542/* used by ide-cd, ide-floppy, etc. */
550typedef void (xfer_func_t)(ide_drive_t *, void *, u32); 543typedef void (xfer_func_t)(ide_drive_t *, struct request *rq, void *, unsigned);
551 544
552typedef struct hwgroup_s { 545typedef struct hwgroup_s {
553 /* irq handler, if active */ 546 /* irq handler, if active */
@@ -829,6 +822,10 @@ extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigne
829void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int, 822void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int,
830 ide_expiry_t *); 823 ide_expiry_t *);
831 824
825void ide_execute_pkt_cmd(ide_drive_t *);
826
827void ide_pad_transfer(ide_drive_t *, int, int);
828
832ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); 829ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
833 830
834ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); 831ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
@@ -965,8 +962,7 @@ typedef struct ide_task_s {
965 void *special; /* valid_t generally */ 962 void *special; /* valid_t generally */
966} ide_task_t; 963} ide_task_t;
967 964
968void ide_tf_load(ide_drive_t *, ide_task_t *); 965void ide_tf_dump(const char *, struct ide_taskfile *);
969void ide_tf_read(ide_drive_t *, ide_task_t *);
970 966
971extern void SELECT_DRIVE(ide_drive_t *); 967extern void SELECT_DRIVE(ide_drive_t *);
972extern void SELECT_MASK(ide_drive_t *, int); 968extern void SELECT_MASK(ide_drive_t *, int);
@@ -1072,6 +1068,8 @@ enum {
1072 IDE_HFLAG_NO_DMA = (1 << 14), 1068 IDE_HFLAG_NO_DMA = (1 << 14),
1073 /* check if host is PCI IDE device before allowing DMA */ 1069 /* check if host is PCI IDE device before allowing DMA */
1074 IDE_HFLAG_NO_AUTODMA = (1 << 15), 1070 IDE_HFLAG_NO_AUTODMA = (1 << 15),
1071 /* host uses MMIO */
1072 IDE_HFLAG_MMIO = (1 << 16),
1075 /* host is CS5510/CS5520 */ 1073 /* host is CS5510/CS5520 */
1076 IDE_HFLAG_CS5520 = IDE_HFLAG_VDMA, 1074 IDE_HFLAG_CS5520 = IDE_HFLAG_VDMA,
1077 /* no LBA48 */ 1075 /* no LBA48 */
@@ -1360,27 +1358,4 @@ static inline u8 ide_read_error(ide_drive_t *drive)
1360 1358
1361 return hwif->INB(hwif->io_ports.error_addr); 1359 return hwif->INB(hwif->io_ports.error_addr);
1362} 1360}
1363
1364/*
1365 * Too bad. The drive wants to send us data which we are not ready to accept.
1366 * Just throw it away.
1367 */
1368static inline void ide_atapi_discard_data(ide_drive_t *drive, unsigned bcount)
1369{
1370 ide_hwif_t *hwif = drive->hwif;
1371
1372 /* FIXME: use ->atapi_input_bytes */
1373 while (bcount--)
1374 (void)hwif->INB(hwif->io_ports.data_addr);
1375}
1376
1377static inline void ide_atapi_write_zeros(ide_drive_t *drive, unsigned bcount)
1378{
1379 ide_hwif_t *hwif = drive->hwif;
1380
1381 /* FIXME: use ->atapi_output_bytes */
1382 while (bcount--)
1383 hwif->OUTB(0, hwif->io_ports.data_addr);
1384}
1385
1386#endif /* _IDE_H */ 1361#endif /* _IDE_H */