aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:08 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-05-09 18:01:08 -0400
commit2d5eaa6dd744a641e75503232a01f52d0768884c (patch)
tree0736bd00ea3bd032d601d0a676c998cb043b877a /include/linux/ide.h
parent18137207236285989dfc0ee7f929b954199228f3 (diff)
ide: rework the code for selecting the best DMA transfer mode (v3)
Depends on the "ide: fix UDMA/MWDMA/SWDMA masks" patch. * add ide_hwif_t.udma_filter hook for filtering UDMA mask (use it in alim15x3, hpt366, siimage and serverworks drivers) * add ide_max_dma_mode() for finding best DMA mode for the device (loosely based on some older libata-core.c code) * convert ide_dma_speed() users to use ide_max_dma_mode() * make ide_rate_filter() take "ide_drive_t *drive" as an argument instead of "u8 mode" and teach it to how to use UDMA mask to do filtering * use ide_rate_filter() in hpt366 driver * remove no longer needed ide_dma_speed() and *_ratemask() * unexport eighty_ninty_three() v2: * rename ->filter_udma_mask to ->udma_filter [ Suggested by Sergei Shtylyov <sshtylyov@ru.mvista.com>. ] v3: * updated for scc_pata driver (fixes XFER_UDMA_6 filtering for user-space originated transfer mode change requests when 100MHz clock is used) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c9375c86358..23ab4dc0500 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -717,11 +717,8 @@ typedef struct hwif_s {
717 int (*quirkproc)(ide_drive_t *); 717 int (*quirkproc)(ide_drive_t *);
718 /* driver soft-power interface */ 718 /* driver soft-power interface */
719 int (*busproc)(ide_drive_t *, int); 719 int (*busproc)(ide_drive_t *, int);
720// /* host rate limiter */
721// u8 (*ratemask)(ide_drive_t *);
722// /* device rate limiter */
723// u8 (*ratefilter)(ide_drive_t *, u8);
724#endif 720#endif
721 u8 (*udma_filter)(ide_drive_t *);
725 722
726 void (*ata_input_data)(ide_drive_t *, void *, u32); 723 void (*ata_input_data)(ide_drive_t *, void *, u32);
727 void (*ata_output_data)(ide_drive_t *, void *, u32); 724 void (*ata_output_data)(ide_drive_t *, void *, u32);
@@ -1279,6 +1276,7 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *);
1279int __ide_dma_bad_drive(ide_drive_t *); 1276int __ide_dma_bad_drive(ide_drive_t *);
1280int __ide_dma_good_drive(ide_drive_t *); 1277int __ide_dma_good_drive(ide_drive_t *);
1281int ide_use_dma(ide_drive_t *); 1278int ide_use_dma(ide_drive_t *);
1279u8 ide_max_dma_mode(ide_drive_t *);
1282void ide_dma_off(ide_drive_t *); 1280void ide_dma_off(ide_drive_t *);
1283void ide_dma_verbose(ide_drive_t *); 1281void ide_dma_verbose(ide_drive_t *);
1284int ide_set_dma(ide_drive_t *); 1282int ide_set_dma(ide_drive_t *);
@@ -1305,6 +1303,7 @@ extern int __ide_dma_timeout(ide_drive_t *);
1305 1303
1306#else 1304#else
1307static inline int ide_use_dma(ide_drive_t *drive) { return 0; } 1305static inline int ide_use_dma(ide_drive_t *drive) { return 0; }
1306static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
1308static inline void ide_dma_off(ide_drive_t *drive) { ; } 1307static inline void ide_dma_off(ide_drive_t *drive) { ; }
1309static inline void ide_dma_verbose(ide_drive_t *drive) { ; } 1308static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1310static inline int ide_set_dma(ide_drive_t *drive) { return 1; } 1309static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
@@ -1349,8 +1348,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data)
1349} 1348}
1350 1349
1351/* ide-lib.c */ 1350/* ide-lib.c */
1352extern u8 ide_dma_speed(ide_drive_t *drive, u8 mode); 1351u8 ide_rate_filter(ide_drive_t *, u8);
1353extern u8 ide_rate_filter(u8 mode, u8 speed);
1354extern int ide_dma_enable(ide_drive_t *drive); 1352extern int ide_dma_enable(ide_drive_t *drive);
1355extern char *ide_xfer_verbose(u8 xfer_rate); 1353extern char *ide_xfer_verbose(u8 xfer_rate);
1356extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1354extern void ide_toggle_bounce(ide_drive_t *drive, int on);