diff options
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 80 |
1 files changed, 37 insertions, 43 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index fe235b65207e..854eba8b2ba3 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | #include <asm/mutex.h> | 27 | #include <asm/mutex.h> |
28 | 28 | ||
29 | #if defined(CONFIG_CRIS) || defined(CONFIG_FRV) | 29 | #if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) |
30 | # define SUPPORT_VLB_SYNC 0 | 30 | # define SUPPORT_VLB_SYNC 0 |
31 | #else | 31 | #else |
32 | # define SUPPORT_VLB_SYNC 1 | 32 | # define SUPPORT_VLB_SYNC 1 |
@@ -193,24 +193,8 @@ static inline void ide_std_init_ports(hw_regs_t *hw, | |||
193 | hw->io_ports.ctl_addr = ctl_addr; | 193 | hw->io_ports.ctl_addr = ctl_addr; |
194 | } | 194 | } |
195 | 195 | ||
196 | /* for IDE PCI controllers in legacy mode, temporary */ | 196 | #if defined(CONFIG_ARM) || defined(CONFIG_M68K) || defined(CONFIG_MIPS) || \ |
197 | static inline int __ide_default_irq(unsigned long base) | 197 | defined(CONFIG_PARISC) || defined(CONFIG_PPC) || defined(CONFIG_SPARC) |
198 | { | ||
199 | switch (base) { | ||
200 | #ifdef CONFIG_IA64 | ||
201 | case 0x1f0: return isa_irq_to_vector(14); | ||
202 | case 0x170: return isa_irq_to_vector(15); | ||
203 | #else | ||
204 | case 0x1f0: return 14; | ||
205 | case 0x170: return 15; | ||
206 | #endif | ||
207 | } | ||
208 | return 0; | ||
209 | } | ||
210 | |||
211 | #if defined(CONFIG_ARM) || defined(CONFIG_FRV) || defined(CONFIG_M68K) || \ | ||
212 | defined(CONFIG_MIPS) || defined(CONFIG_MN10300) || defined(CONFIG_PARISC) \ | ||
213 | || defined(CONFIG_PPC) || defined(CONFIG_SPARC) || defined(CONFIG_SPARC64) | ||
214 | #include <asm/ide.h> | 198 | #include <asm/ide.h> |
215 | #else | 199 | #else |
216 | #include <asm-generic/ide_iops.h> | 200 | #include <asm-generic/ide_iops.h> |
@@ -797,6 +781,7 @@ typedef struct hwif_s { | |||
797 | struct scatterlist *sg_table; | 781 | struct scatterlist *sg_table; |
798 | int sg_max_nents; /* Maximum number of entries in it */ | 782 | int sg_max_nents; /* Maximum number of entries in it */ |
799 | int sg_nents; /* Current number of entries in it */ | 783 | int sg_nents; /* Current number of entries in it */ |
784 | int orig_sg_nents; | ||
800 | int sg_dma_direction; /* dma transfer direction */ | 785 | int sg_dma_direction; /* dma transfer direction */ |
801 | 786 | ||
802 | /* data phase of the active command (currently only valid for PIO/DMA) */ | 787 | /* data phase of the active command (currently only valid for PIO/DMA) */ |
@@ -865,7 +850,8 @@ struct ide_host { | |||
865 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; | 850 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; |
866 | unsigned int n_ports; | 851 | unsigned int n_ports; |
867 | struct device *dev[2]; | 852 | struct device *dev[2]; |
868 | unsigned int (*init_chipset)(struct pci_dev *); | 853 | int (*init_chipset)(struct pci_dev *); |
854 | irq_handler_t irq_handler; | ||
869 | unsigned long host_flags; | 855 | unsigned long host_flags; |
870 | void *host_priv; | 856 | void *host_priv; |
871 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ | 857 | ide_hwif_t *cur_port; /* for hosts requiring serialization */ |
@@ -1144,11 +1130,14 @@ int generic_ide_ioctl(ide_drive_t *, struct block_device *, unsigned, unsigned l | |||
1144 | extern int ide_vlb_clk; | 1130 | extern int ide_vlb_clk; |
1145 | extern int ide_pci_clk; | 1131 | extern int ide_pci_clk; |
1146 | 1132 | ||
1147 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 1133 | int ide_end_request(ide_drive_t *, int, int); |
1148 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | 1134 | int ide_end_dequeued_request(ide_drive_t *, struct request *, int, int); |
1149 | int uptodate, int nr_sectors); | 1135 | void ide_kill_rq(ide_drive_t *, struct request *); |
1150 | 1136 | ||
1151 | extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); | 1137 | void __ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int, |
1138 | ide_expiry_t *); | ||
1139 | void ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int, | ||
1140 | ide_expiry_t *); | ||
1152 | 1141 | ||
1153 | void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int, | 1142 | void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int, |
1154 | ide_expiry_t *); | 1143 | ide_expiry_t *); |
@@ -1167,13 +1156,14 @@ int ide_busy_sleep(ide_hwif_t *, unsigned long, int); | |||
1167 | 1156 | ||
1168 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); | 1157 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); |
1169 | 1158 | ||
1159 | ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *); | ||
1160 | ide_startstop_t ide_do_devset(ide_drive_t *, struct request *); | ||
1161 | |||
1170 | extern ide_startstop_t ide_do_reset (ide_drive_t *); | 1162 | extern ide_startstop_t ide_do_reset (ide_drive_t *); |
1171 | 1163 | ||
1172 | extern int ide_devset_execute(ide_drive_t *drive, | 1164 | extern int ide_devset_execute(ide_drive_t *drive, |
1173 | const struct ide_devset *setting, int arg); | 1165 | const struct ide_devset *setting, int arg); |
1174 | 1166 | ||
1175 | extern void ide_do_drive_cmd(ide_drive_t *, struct request *); | ||
1176 | |||
1177 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); | 1167 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); |
1178 | 1168 | ||
1179 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1169 | void ide_tf_dump(const char *, struct ide_taskfile *); |
@@ -1198,10 +1188,6 @@ void SELECT_MASK(ide_drive_t *, int); | |||
1198 | u8 ide_read_error(ide_drive_t *); | 1188 | u8 ide_read_error(ide_drive_t *); |
1199 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); | 1189 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); |
1200 | 1190 | ||
1201 | extern int drive_is_ready(ide_drive_t *); | ||
1202 | |||
1203 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | ||
1204 | |||
1205 | int ide_check_atapi_device(ide_drive_t *, const char *); | 1191 | int ide_check_atapi_device(ide_drive_t *, const char *); |
1206 | 1192 | ||
1207 | void ide_init_pc(struct ide_atapi_pc *); | 1193 | void ide_init_pc(struct ide_atapi_pc *); |
@@ -1249,6 +1235,8 @@ int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); | |||
1249 | 1235 | ||
1250 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); | 1236 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); |
1251 | 1237 | ||
1238 | int ide_dev_read_id(ide_drive_t *, u8, u16 *); | ||
1239 | |||
1252 | extern int ide_driveid_update(ide_drive_t *); | 1240 | extern int ide_driveid_update(ide_drive_t *); |
1253 | extern int ide_config_drive_speed(ide_drive_t *, u8); | 1241 | extern int ide_config_drive_speed(ide_drive_t *, u8); |
1254 | extern u8 eighty_ninty_three (ide_drive_t *); | 1242 | extern u8 eighty_ninty_three (ide_drive_t *); |
@@ -1278,7 +1266,7 @@ static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev) | |||
1278 | return 0; | 1266 | return 0; |
1279 | } | 1267 | } |
1280 | 1268 | ||
1281 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, | 1269 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, |
1282 | hw_regs_t *, hw_regs_t **); | 1270 | hw_regs_t *, hw_regs_t **); |
1283 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1271 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1284 | 1272 | ||
@@ -1347,10 +1335,6 @@ enum { | |||
1347 | IDE_HFLAG_ERROR_STOPS_FIFO = (1 << 19), | 1335 | IDE_HFLAG_ERROR_STOPS_FIFO = (1 << 19), |
1348 | /* serialize ports */ | 1336 | /* serialize ports */ |
1349 | IDE_HFLAG_SERIALIZE = (1 << 20), | 1337 | IDE_HFLAG_SERIALIZE = (1 << 20), |
1350 | /* use legacy IRQs */ | ||
1351 | IDE_HFLAG_LEGACY_IRQS = (1 << 21), | ||
1352 | /* force use of legacy IRQs */ | ||
1353 | IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22), | ||
1354 | /* host is TRM290 */ | 1338 | /* host is TRM290 */ |
1355 | IDE_HFLAG_TRM290 = (1 << 23), | 1339 | IDE_HFLAG_TRM290 = (1 << 23), |
1356 | /* use 32-bit I/O ops */ | 1340 | /* use 32-bit I/O ops */ |
@@ -1378,7 +1362,7 @@ enum { | |||
1378 | 1362 | ||
1379 | struct ide_port_info { | 1363 | struct ide_port_info { |
1380 | char *name; | 1364 | char *name; |
1381 | unsigned int (*init_chipset)(struct pci_dev *); | 1365 | int (*init_chipset)(struct pci_dev *); |
1382 | void (*init_iops)(ide_hwif_t *); | 1366 | void (*init_iops)(ide_hwif_t *); |
1383 | void (*init_hwif)(ide_hwif_t *); | 1367 | void (*init_hwif)(ide_hwif_t *); |
1384 | int (*init_dma)(ide_hwif_t *, | 1368 | int (*init_dma)(ide_hwif_t *, |
@@ -1469,6 +1453,7 @@ static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } | |||
1469 | 1453 | ||
1470 | void ide_dma_lost_irq(ide_drive_t *); | 1454 | void ide_dma_lost_irq(ide_drive_t *); |
1471 | void ide_dma_timeout(ide_drive_t *); | 1455 | void ide_dma_timeout(ide_drive_t *); |
1456 | ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int); | ||
1472 | 1457 | ||
1473 | #else | 1458 | #else |
1474 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } | 1459 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } |
@@ -1480,21 +1465,24 @@ static inline void ide_dma_on(ide_drive_t *drive) { ; } | |||
1480 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1465 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1481 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | 1466 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } |
1482 | static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } | 1467 | static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } |
1468 | static inline ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) { return ide_stopped; } | ||
1483 | static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } | 1469 | static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } |
1484 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 1470 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
1485 | 1471 | ||
1486 | #ifdef CONFIG_BLK_DEV_IDEACPI | 1472 | #ifdef CONFIG_BLK_DEV_IDEACPI |
1473 | int ide_acpi_init(void); | ||
1487 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); | 1474 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); |
1488 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); | 1475 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); |
1489 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); | 1476 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); |
1490 | extern void ide_acpi_init(ide_hwif_t *hwif); | 1477 | void ide_acpi_init_port(ide_hwif_t *); |
1491 | void ide_acpi_port_init_devices(ide_hwif_t *); | 1478 | void ide_acpi_port_init_devices(ide_hwif_t *); |
1492 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); | 1479 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); |
1493 | #else | 1480 | #else |
1481 | static inline int ide_acpi_init(void) { return 0; } | ||
1494 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } | 1482 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } |
1495 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } | 1483 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } |
1496 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } | 1484 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } |
1497 | static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } | 1485 | static inline void ide_acpi_init_port(ide_hwif_t *hwif) { ; } |
1498 | static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; } | 1486 | static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; } |
1499 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | 1487 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} |
1500 | #endif | 1488 | #endif |
@@ -1528,9 +1516,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) | |||
1528 | hwif->hwif_data = data; | 1516 | hwif->hwif_data = data; |
1529 | } | 1517 | } |
1530 | 1518 | ||
1531 | const char *ide_xfer_verbose(u8 mode); | ||
1532 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1519 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1533 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | ||
1534 | 1520 | ||
1535 | u64 ide_get_lba_addr(struct ide_taskfile *, int); | 1521 | u64 ide_get_lba_addr(struct ide_taskfile *, int); |
1536 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1522 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
@@ -1569,14 +1555,18 @@ void ide_timing_merge(struct ide_timing *, struct ide_timing *, | |||
1569 | struct ide_timing *, unsigned int); | 1555 | struct ide_timing *, unsigned int); |
1570 | int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int); | 1556 | int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int); |
1571 | 1557 | ||
1558 | #ifdef CONFIG_IDE_XFER_MODE | ||
1572 | int ide_scan_pio_blacklist(char *); | 1559 | int ide_scan_pio_blacklist(char *); |
1573 | 1560 | const char *ide_xfer_verbose(u8); | |
1574 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); | 1561 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); |
1575 | |||
1576 | int ide_set_pio_mode(ide_drive_t *, u8); | 1562 | int ide_set_pio_mode(ide_drive_t *, u8); |
1577 | int ide_set_dma_mode(ide_drive_t *, u8); | 1563 | int ide_set_dma_mode(ide_drive_t *, u8); |
1578 | |||
1579 | void ide_set_pio(ide_drive_t *, u8); | 1564 | void ide_set_pio(ide_drive_t *, u8); |
1565 | int ide_set_xfer_rate(ide_drive_t *, u8); | ||
1566 | #else | ||
1567 | static inline void ide_set_pio(ide_drive_t *drive, u8 pio) { ; } | ||
1568 | static inline int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) { return -1; } | ||
1569 | #endif | ||
1580 | 1570 | ||
1581 | static inline void ide_set_max_pio(ide_drive_t *drive) | 1571 | static inline void ide_set_max_pio(ide_drive_t *drive) |
1582 | { | 1572 | { |
@@ -1609,6 +1599,10 @@ static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) | |||
1609 | #define ide_port_for_each_dev(i, dev, port) \ | 1599 | #define ide_port_for_each_dev(i, dev, port) \ |
1610 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) | 1600 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) |
1611 | 1601 | ||
1602 | #define ide_port_for_each_present_dev(i, dev, port) \ | ||
1603 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) \ | ||
1604 | if ((dev)->dev_flags & IDE_DFLAG_PRESENT) | ||
1605 | |||
1612 | #define ide_host_for_each_port(i, port, host) \ | 1606 | #define ide_host_for_each_port(i, port, host) \ |
1613 | for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++) | 1607 | for ((i) = 0; ((port) = (host)->ports[i]) || (i) < MAX_HOST_PORTS; (i)++) |
1614 | 1608 | ||