aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h65
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 */
1079extern void ide_fixstring(u8 *, const int, const int); 1080extern void ide_fixstring(u8 *, const int, const int);
1080 1081
1081/* 1082int 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 */
1090extern 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);
1161extern void QUIRK_LIST(ide_drive_t *); 1153extern void QUIRK_LIST(ide_drive_t *);
1162 1154
1163extern int drive_is_ready(ide_drive_t *); 1155extern int drive_is_ready(ide_drive_t *);
1164extern 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
1260typedef struct ide_pci_device_s { 1266typedef 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
1296int __ide_dma_bad_drive(ide_drive_t *); 1302int __ide_dma_bad_drive(ide_drive_t *);
1297int __ide_dma_good_drive(ide_drive_t *); 1303
1298u8 ide_max_dma_mode(ide_drive_t *); 1304u8 ide_find_dma_mode(ide_drive_t *, u8);
1305
1306static inline u8 ide_max_dma_mode(ide_drive_t *drive)
1307{
1308 return ide_find_dma_mode(drive, XFER_UDMA_6);
1309}
1310
1299int ide_tune_dma(ide_drive_t *); 1311int ide_tune_dma(ide_drive_t *);
1300void ide_dma_off(ide_drive_t *); 1312void ide_dma_off(ide_drive_t *);
1301void ide_dma_verbose(ide_drive_t *); 1313void 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
1336static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; }
1324static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } 1337static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
1325static inline int ide_tune_dma(ide_drive_t *drive) { return 0; } 1338static inline int ide_tune_dma(ide_drive_t *drive) { return 0; }
1326static inline void ide_dma_off(ide_drive_t *drive) { ; } 1339static inline void ide_dma_off(ide_drive_t *drive) { ; }
@@ -1337,11 +1350,13 @@ extern int ide_acpi_exec_tfs(ide_drive_t *drive);
1337extern void ide_acpi_get_timing(ide_hwif_t *hwif); 1350extern void ide_acpi_get_timing(ide_hwif_t *hwif);
1338extern void ide_acpi_push_timing(ide_hwif_t *hwif); 1351extern void ide_acpi_push_timing(ide_hwif_t *hwif);
1339extern void ide_acpi_init(ide_hwif_t *hwif); 1352extern void ide_acpi_init(ide_hwif_t *hwif);
1353extern void ide_acpi_set_state(ide_hwif_t *hwif, int on);
1340#else 1354#else
1341static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } 1355static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
1342static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } 1356static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
1343static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } 1357static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
1344static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } 1358static inline void ide_acpi_init(ide_hwif_t *hwif) { ; }
1359static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {}
1345#endif 1360#endif
1346 1361
1347extern int ide_hwif_request_regions(ide_hwif_t *hwif); 1362extern 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 */
1370u8 ide_rate_filter(ide_drive_t *, u8);
1371extern char *ide_xfer_verbose(u8 xfer_rate); 1385extern char *ide_xfer_verbose(u8 xfer_rate);
1372extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1386extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1373extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); 1387extern 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);
1404u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); 1418u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1405extern const ide_pio_timings_t ide_pio_timings[6]; 1419extern const ide_pio_timings_t ide_pio_timings[6];
1406 1420
1421int ide_set_pio_mode(ide_drive_t *, u8);
1422int ide_set_dma_mode(ide_drive_t *, u8);
1423
1424void ide_set_pio(ide_drive_t *, u8);
1425
1426static inline void ide_set_max_pio(ide_drive_t *drive)
1427{
1428 ide_set_pio(drive, 255);
1429}
1407 1430
1408extern spinlock_t ide_lock; 1431extern spinlock_t ide_lock;
1409extern struct mutex ide_cfg_mtx; 1432extern struct mutex ide_cfg_mtx;