aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:24 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:24 -0400
commit5e37bdc081a980dd0d669e6387bcf15ca9666f81 (patch)
treed842166c3bd23fbf3dfba0ccaa0f9ed5cc3096db /include
parent1fd1890594bd355a4217f5658a34763e77decee3 (diff)
ide: add struct ide_dma_ops (take 3)
Add struct ide_dma_ops and convert core code + drivers to use it. While at it: * Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods. * Drop "ide_" "infixes" from DMA methods. * au1xxx-ide.c: - use auide_dma_{test_irq,end}() directly in auide_dma_timeout() * pdc202xx_old.c: - drop "old_" "infixes" from DMA methods * siimage.c: - add siimage_dma_test_irq() helper - print SATA warning in siimage_init_one() * Remove no longer needed ->init_hwif implementations. v2: * Changes based on review from Sergei: - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/ - s/drive->hwif/hwif/ in idefloppy_pc_intr(). - fix patch description w.r.t. au1xxx-ide changes - fix au1xxx-ide build - fix naming for cmd64*_dma_ops - drop "ide_" and "old_" infixes - s/hpt3xxx_dma_ops/hpt37x_dma_ops/ - s/hpt370x_dma_ops/hpt370_dma_ops/ - use correct DMA ops for HPT302/N, HPT371/N and HPT374 - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/ v3: * Two bugs slipped in v2 (noticed by Sergei): - use correct DMA ops for HPT374 (for real this time) - handle HPT370/HPT370A properly Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index e5f41741ba9..079b6f9405e 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -413,6 +413,17 @@ struct ide_port_ops {
413 u8 (*cable_detect)(struct hwif_s *); 413 u8 (*cable_detect)(struct hwif_s *);
414}; 414};
415 415
416struct ide_dma_ops {
417 void (*dma_host_set)(struct ide_drive_s *, int);
418 int (*dma_setup)(struct ide_drive_s *);
419 void (*dma_exec_cmd)(struct ide_drive_s *, u8);
420 void (*dma_start)(struct ide_drive_s *);
421 int (*dma_end)(struct ide_drive_s *);
422 int (*dma_test_irq)(struct ide_drive_s *);
423 void (*dma_lost_irq)(struct ide_drive_s *);
424 void (*dma_timeout)(struct ide_drive_s *);
425};
426
416typedef struct hwif_s { 427typedef struct hwif_s {
417 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ 428 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
418 struct hwif_s *mate; /* other hwif from same PCI chip */ 429 struct hwif_s *mate; /* other hwif from same PCI chip */
@@ -451,6 +462,7 @@ typedef struct hwif_s {
451 void (*rw_disk)(ide_drive_t *, struct request *); 462 void (*rw_disk)(ide_drive_t *, struct request *);
452 463
453 const struct ide_port_ops *port_ops; 464 const struct ide_port_ops *port_ops;
465 struct ide_dma_ops *dma_ops;
454 466
455 void (*ata_input_data)(ide_drive_t *, void *, u32); 467 void (*ata_input_data)(ide_drive_t *, void *, u32);
456 void (*ata_output_data)(ide_drive_t *, void *, u32); 468 void (*ata_output_data)(ide_drive_t *, void *, u32);
@@ -458,15 +470,7 @@ typedef struct hwif_s {
458 void (*atapi_input_bytes)(ide_drive_t *, void *, u32); 470 void (*atapi_input_bytes)(ide_drive_t *, void *, u32);
459 void (*atapi_output_bytes)(ide_drive_t *, void *, u32); 471 void (*atapi_output_bytes)(ide_drive_t *, void *, u32);
460 472
461 void (*dma_host_set)(ide_drive_t *, int);
462 int (*dma_setup)(ide_drive_t *);
463 void (*dma_exec_cmd)(ide_drive_t *, u8);
464 void (*dma_start)(ide_drive_t *);
465 int (*ide_dma_end)(ide_drive_t *drive);
466 int (*ide_dma_test_irq)(ide_drive_t *drive);
467 void (*ide_dma_clear_irq)(ide_drive_t *drive); 473 void (*ide_dma_clear_irq)(ide_drive_t *drive);
468 void (*dma_lost_irq)(ide_drive_t *drive);
469 void (*dma_timeout)(ide_drive_t *drive);
470 474
471 void (*OUTB)(u8 addr, unsigned long port); 475 void (*OUTB)(u8 addr, unsigned long port);
472 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); 476 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
@@ -1114,6 +1118,7 @@ struct ide_port_info {
1114 const struct ide_port_info *); 1118 const struct ide_port_info *);
1115 1119
1116 const struct ide_port_ops *port_ops; 1120 const struct ide_port_ops *port_ops;
1121 struct ide_dma_ops *dma_ops;
1117 1122
1118 ide_pci_enablebit_t enablebits[2]; 1123 ide_pci_enablebit_t enablebits[2];
1119 hwif_chipset_t chipset; 1124 hwif_chipset_t chipset;
@@ -1165,7 +1170,7 @@ void ide_destroy_dmatable(ide_drive_t *);
1165extern int ide_build_dmatable(ide_drive_t *, struct request *); 1170extern int ide_build_dmatable(ide_drive_t *, struct request *);
1166int ide_allocate_dma_engine(ide_hwif_t *); 1171int ide_allocate_dma_engine(ide_hwif_t *);
1167void ide_release_dma_engine(ide_hwif_t *); 1172void ide_release_dma_engine(ide_hwif_t *);
1168extern void ide_setup_dma(ide_hwif_t *, unsigned long); 1173void ide_setup_dma(ide_hwif_t *, unsigned long, const struct ide_port_info *);
1169 1174
1170void ide_dma_host_set(ide_drive_t *, int); 1175void ide_dma_host_set(ide_drive_t *, int);
1171extern int ide_dma_setup(ide_drive_t *); 1176extern int ide_dma_setup(ide_drive_t *);