diff options
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 65 |
1 files changed, 44 insertions, 21 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index b9f66c10caa0..02a27e8cbad2 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -634,7 +634,7 @@ typedef struct ide_drive_s { | |||
634 | 634 | ||
635 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ | 635 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ |
636 | unsigned int cyl; /* "real" number of cyls */ | 636 | unsigned int cyl; /* "real" number of cyls */ |
637 | unsigned int drive_data; /* use by tuneproc/selectproc */ | 637 | unsigned int drive_data; /* used by set_pio_mode/selectproc */ |
638 | unsigned int failures; /* current failure count */ | 638 | unsigned int failures; /* current failure count */ |
639 | unsigned int max_failures; /* maximum allowed failure count */ | 639 | unsigned int max_failures; /* maximum allowed failure count */ |
640 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | 640 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ |
@@ -681,7 +681,7 @@ typedef struct hwif_s { | |||
681 | u8 straight8; /* Alan's straight 8 check */ | 681 | u8 straight8; /* Alan's straight 8 check */ |
682 | u8 bus_state; /* power state of the IDE bus */ | 682 | u8 bus_state; /* power state of the IDE bus */ |
683 | 683 | ||
684 | u8 host_flags; | 684 | u16 host_flags; |
685 | 685 | ||
686 | u8 pio_mask; | 686 | u8 pio_mask; |
687 | 687 | ||
@@ -702,10 +702,10 @@ typedef struct hwif_s { | |||
702 | #if 0 | 702 | #if 0 |
703 | ide_hwif_ops_t *hwifops; | 703 | ide_hwif_ops_t *hwifops; |
704 | #else | 704 | #else |
705 | /* routine to tune PIO mode for drives */ | 705 | /* routine to program host for PIO mode */ |
706 | void (*tuneproc)(ide_drive_t *, u8); | 706 | void (*set_pio_mode)(ide_drive_t *, const u8); |
707 | /* routine to retune DMA modes for drives */ | 707 | /* routine to program host for DMA mode */ |
708 | int (*speedproc)(ide_drive_t *, u8); | 708 | void (*set_dma_mode)(ide_drive_t *, const u8); |
709 | /* tweaks hardware to select drive */ | 709 | /* tweaks hardware to select drive */ |
710 | void (*selectproc)(ide_drive_t *); | 710 | void (*selectproc)(ide_drive_t *); |
711 | /* chipset polling based on hba specifics */ | 711 | /* chipset polling based on hba specifics */ |
@@ -723,6 +723,7 @@ typedef struct hwif_s { | |||
723 | /* driver soft-power interface */ | 723 | /* driver soft-power interface */ |
724 | int (*busproc)(ide_drive_t *, int); | 724 | int (*busproc)(ide_drive_t *, int); |
725 | #endif | 725 | #endif |
726 | u8 (*mdma_filter)(ide_drive_t *); | ||
726 | u8 (*udma_filter)(ide_drive_t *); | 727 | u8 (*udma_filter)(ide_drive_t *); |
727 | 728 | ||
728 | void (*ata_input_data)(ide_drive_t *, void *, u32); | 729 | void (*ata_input_data)(ide_drive_t *, void *, u32); |
@@ -1078,16 +1079,7 @@ extern void ide_fix_driveid(struct hd_driveid *); | |||
1078 | */ | 1079 | */ |
1079 | extern void ide_fixstring(u8 *, const int, const int); | 1080 | extern void ide_fixstring(u8 *, const int, const int); |
1080 | 1081 | ||
1081 | /* | 1082 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); |
1082 | * This routine busy-waits for the drive status to be not "busy". | ||
1083 | * It then checks the status for all of the "good" bits and none | ||
1084 | * of the "bad" bits, and if all is okay it returns 0. All other | ||
1085 | * cases return 1 after doing "*startstop = ide_error()", and the | ||
1086 | * caller should return the updated value of "startstop" in this case. | ||
1087 | * "startstop" is unchanged when the function returns 0; | ||
1088 | * (startstop, drive, good, bad, timeout) | ||
1089 | */ | ||
1090 | extern int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); | ||
1091 | 1083 | ||
1092 | /* | 1084 | /* |
1093 | * Start a reset operation for an IDE interface. | 1085 | * Start a reset operation for an IDE interface. |
@@ -1161,7 +1153,6 @@ extern void SELECT_MASK(ide_drive_t *, int); | |||
1161 | extern void QUIRK_LIST(ide_drive_t *); | 1153 | extern void QUIRK_LIST(ide_drive_t *); |
1162 | 1154 | ||
1163 | extern int drive_is_ready(ide_drive_t *); | 1155 | extern int drive_is_ready(ide_drive_t *); |
1164 | extern int wait_for_ready(ide_drive_t *, int /* timeout */); | ||
1165 | 1156 | ||
1166 | /* | 1157 | /* |
1167 | * taskfile io for disks for now...and builds request from ide_ioctl | 1158 | * taskfile io for disks for now...and builds request from ide_ioctl |
@@ -1255,6 +1246,21 @@ enum { | |||
1255 | IDE_HFLAG_PIO_NO_BLACKLIST = (1 << 2), | 1246 | IDE_HFLAG_PIO_NO_BLACKLIST = (1 << 2), |
1256 | /* don't use conservative PIO "downgrade" */ | 1247 | /* don't use conservative PIO "downgrade" */ |
1257 | IDE_HFLAG_PIO_NO_DOWNGRADE = (1 << 3), | 1248 | IDE_HFLAG_PIO_NO_DOWNGRADE = (1 << 3), |
1249 | /* use PIO8/9 for prefetch off/on */ | ||
1250 | IDE_HFLAG_ABUSE_PREFETCH = (1 << 4), | ||
1251 | /* use PIO6/7 for fast-devsel off/on */ | ||
1252 | IDE_HFLAG_ABUSE_FAST_DEVSEL = (1 << 5), | ||
1253 | /* use 100-102 and 200-202 PIO values to set DMA modes */ | ||
1254 | IDE_HFLAG_ABUSE_DMA_MODES = (1 << 6), | ||
1255 | /* | ||
1256 | * keep DMA setting when programming PIO mode, may be used only | ||
1257 | * for hosts which have separate PIO and DMA timings (ie. PMAC) | ||
1258 | */ | ||
1259 | IDE_HFLAG_SET_PIO_MODE_KEEP_DMA = (1 << 7), | ||
1260 | /* program host for the transfer mode after programming device */ | ||
1261 | IDE_HFLAG_POST_SET_MODE = (1 << 8), | ||
1262 | /* don't program host/device for the transfer mode ("smart" hosts) */ | ||
1263 | IDE_HFLAG_NO_SET_MODE = (1 << 9), | ||
1258 | }; | 1264 | }; |
1259 | 1265 | ||
1260 | typedef struct ide_pci_device_s { | 1266 | typedef struct ide_pci_device_s { |
@@ -1271,7 +1277,7 @@ typedef struct ide_pci_device_s { | |||
1271 | u8 bootable; | 1277 | u8 bootable; |
1272 | unsigned int extra; | 1278 | unsigned int extra; |
1273 | struct ide_pci_device_s *next; | 1279 | struct ide_pci_device_s *next; |
1274 | u8 host_flags; | 1280 | u16 host_flags; |
1275 | u8 pio_mask; | 1281 | u8 pio_mask; |
1276 | u8 udma_mask; | 1282 | u8 udma_mask; |
1277 | } ide_pci_device_t; | 1283 | } ide_pci_device_t; |
@@ -1294,8 +1300,14 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | |||
1294 | 1300 | ||
1295 | #ifdef CONFIG_BLK_DEV_IDEDMA | 1301 | #ifdef CONFIG_BLK_DEV_IDEDMA |
1296 | int __ide_dma_bad_drive(ide_drive_t *); | 1302 | int __ide_dma_bad_drive(ide_drive_t *); |
1297 | int __ide_dma_good_drive(ide_drive_t *); | 1303 | |
1298 | u8 ide_max_dma_mode(ide_drive_t *); | 1304 | u8 ide_find_dma_mode(ide_drive_t *, u8); |
1305 | |||
1306 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) | ||
1307 | { | ||
1308 | return ide_find_dma_mode(drive, XFER_UDMA_6); | ||
1309 | } | ||
1310 | |||
1299 | int ide_tune_dma(ide_drive_t *); | 1311 | int ide_tune_dma(ide_drive_t *); |
1300 | void ide_dma_off(ide_drive_t *); | 1312 | void ide_dma_off(ide_drive_t *); |
1301 | void ide_dma_verbose(ide_drive_t *); | 1313 | void ide_dma_verbose(ide_drive_t *); |
@@ -1321,6 +1333,7 @@ extern void ide_dma_timeout(ide_drive_t *); | |||
1321 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ | 1333 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ |
1322 | 1334 | ||
1323 | #else | 1335 | #else |
1336 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } | ||
1324 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } | 1337 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } |
1325 | static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } | 1338 | static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } |
1326 | static inline void ide_dma_off(ide_drive_t *drive) { ; } | 1339 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
@@ -1337,11 +1350,13 @@ extern int ide_acpi_exec_tfs(ide_drive_t *drive); | |||
1337 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); | 1350 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); |
1338 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); | 1351 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); |
1339 | extern void ide_acpi_init(ide_hwif_t *hwif); | 1352 | extern void ide_acpi_init(ide_hwif_t *hwif); |
1353 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); | ||
1340 | #else | 1354 | #else |
1341 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } | 1355 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } |
1342 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } | 1356 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } |
1343 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } | 1357 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } |
1344 | static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } | 1358 | static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } |
1359 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | ||
1345 | #endif | 1360 | #endif |
1346 | 1361 | ||
1347 | extern int ide_hwif_request_regions(ide_hwif_t *hwif); | 1362 | extern int ide_hwif_request_regions(ide_hwif_t *hwif); |
@@ -1367,7 +1382,6 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) | |||
1367 | } | 1382 | } |
1368 | 1383 | ||
1369 | /* ide-lib.c */ | 1384 | /* ide-lib.c */ |
1370 | u8 ide_rate_filter(ide_drive_t *, u8); | ||
1371 | extern char *ide_xfer_verbose(u8 xfer_rate); | 1385 | extern char *ide_xfer_verbose(u8 xfer_rate); |
1372 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1386 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1373 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1387 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
@@ -1404,6 +1418,15 @@ unsigned int ide_pio_cycle_time(ide_drive_t *, u8); | |||
1404 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); | 1418 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); |
1405 | extern const ide_pio_timings_t ide_pio_timings[6]; | 1419 | extern const ide_pio_timings_t ide_pio_timings[6]; |
1406 | 1420 | ||
1421 | int ide_set_pio_mode(ide_drive_t *, u8); | ||
1422 | int ide_set_dma_mode(ide_drive_t *, u8); | ||
1423 | |||
1424 | void ide_set_pio(ide_drive_t *, u8); | ||
1425 | |||
1426 | static inline void ide_set_max_pio(ide_drive_t *drive) | ||
1427 | { | ||
1428 | ide_set_pio(drive, 255); | ||
1429 | } | ||
1407 | 1430 | ||
1408 | extern spinlock_t ide_lock; | 1431 | extern spinlock_t ide_lock; |
1409 | extern struct mutex ide_cfg_mtx; | 1432 | extern struct mutex ide_cfg_mtx; |