diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:08 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-05-09 18:01:08 -0400 |
commit | 2d5eaa6dd744a641e75503232a01f52d0768884c (patch) | |
tree | 0736bd00ea3bd032d601d0a676c998cb043b877a /include/linux/ide.h | |
parent | 18137207236285989dfc0ee7f929b954199228f3 (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.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index c9375c863584..23ab4dc05009 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 *); | |||
1279 | int __ide_dma_bad_drive(ide_drive_t *); | 1276 | int __ide_dma_bad_drive(ide_drive_t *); |
1280 | int __ide_dma_good_drive(ide_drive_t *); | 1277 | int __ide_dma_good_drive(ide_drive_t *); |
1281 | int ide_use_dma(ide_drive_t *); | 1278 | int ide_use_dma(ide_drive_t *); |
1279 | u8 ide_max_dma_mode(ide_drive_t *); | ||
1282 | void ide_dma_off(ide_drive_t *); | 1280 | void ide_dma_off(ide_drive_t *); |
1283 | void ide_dma_verbose(ide_drive_t *); | 1281 | void ide_dma_verbose(ide_drive_t *); |
1284 | int ide_set_dma(ide_drive_t *); | 1282 | int ide_set_dma(ide_drive_t *); |
@@ -1305,6 +1303,7 @@ extern int __ide_dma_timeout(ide_drive_t *); | |||
1305 | 1303 | ||
1306 | #else | 1304 | #else |
1307 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } | 1305 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } |
1306 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } | ||
1308 | static inline void ide_dma_off(ide_drive_t *drive) { ; } | 1307 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
1309 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1308 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1310 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | 1309 | static 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 */ |
1352 | extern u8 ide_dma_speed(ide_drive_t *drive, u8 mode); | 1351 | u8 ide_rate_filter(ide_drive_t *, u8); |
1353 | extern u8 ide_rate_filter(u8 mode, u8 speed); | ||
1354 | extern int ide_dma_enable(ide_drive_t *drive); | 1352 | extern int ide_dma_enable(ide_drive_t *drive); |
1355 | extern char *ide_xfer_verbose(u8 xfer_rate); | 1353 | extern char *ide_xfer_verbose(u8 xfer_rate); |
1356 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1354 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |