diff options
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 78 |
1 files changed, 35 insertions, 43 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 25087aead657..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> |
@@ -866,7 +850,7 @@ struct ide_host { | |||
866 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; | 850 | ide_hwif_t *ports[MAX_HOST_PORTS + 1]; |
867 | unsigned int n_ports; | 851 | unsigned int n_ports; |
868 | struct device *dev[2]; | 852 | struct device *dev[2]; |
869 | unsigned int (*init_chipset)(struct pci_dev *); | 853 | int (*init_chipset)(struct pci_dev *); |
870 | irq_handler_t irq_handler; | 854 | irq_handler_t irq_handler; |
871 | unsigned long host_flags; | 855 | unsigned long host_flags; |
872 | void *host_priv; | 856 | void *host_priv; |
@@ -1146,11 +1130,14 @@ int generic_ide_ioctl(ide_drive_t *, struct block_device *, unsigned, unsigned l | |||
1146 | extern int ide_vlb_clk; | 1130 | extern int ide_vlb_clk; |
1147 | extern int ide_pci_clk; | 1131 | extern int ide_pci_clk; |
1148 | 1132 | ||
1149 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 1133 | int ide_end_request(ide_drive_t *, int, int); |
1150 | 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); |
1151 | int uptodate, int nr_sectors); | 1135 | void ide_kill_rq(ide_drive_t *, struct request *); |
1152 | 1136 | ||
1153 | 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 *); | ||
1154 | 1141 | ||
1155 | 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, |
1156 | ide_expiry_t *); | 1143 | ide_expiry_t *); |
@@ -1169,13 +1156,14 @@ int ide_busy_sleep(ide_hwif_t *, unsigned long, int); | |||
1169 | 1156 | ||
1170 | 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); |
1171 | 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 | |||
1172 | extern ide_startstop_t ide_do_reset (ide_drive_t *); | 1162 | extern ide_startstop_t ide_do_reset (ide_drive_t *); |
1173 | 1163 | ||
1174 | extern int ide_devset_execute(ide_drive_t *drive, | 1164 | extern int ide_devset_execute(ide_drive_t *drive, |
1175 | const struct ide_devset *setting, int arg); | 1165 | const struct ide_devset *setting, int arg); |
1176 | 1166 | ||
1177 | extern void ide_do_drive_cmd(ide_drive_t *, struct request *); | ||
1178 | |||
1179 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); | 1167 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); |
1180 | 1168 | ||
1181 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1169 | void ide_tf_dump(const char *, struct ide_taskfile *); |
@@ -1200,10 +1188,6 @@ void SELECT_MASK(ide_drive_t *, int); | |||
1200 | u8 ide_read_error(ide_drive_t *); | 1188 | u8 ide_read_error(ide_drive_t *); |
1201 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); | 1189 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); |
1202 | 1190 | ||
1203 | extern int drive_is_ready(ide_drive_t *); | ||
1204 | |||
1205 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | ||
1206 | |||
1207 | int ide_check_atapi_device(ide_drive_t *, const char *); | 1191 | int ide_check_atapi_device(ide_drive_t *, const char *); |
1208 | 1192 | ||
1209 | void ide_init_pc(struct ide_atapi_pc *); | 1193 | void ide_init_pc(struct ide_atapi_pc *); |
@@ -1251,6 +1235,8 @@ int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); | |||
1251 | 1235 | ||
1252 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); | 1236 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); |
1253 | 1237 | ||
1238 | int ide_dev_read_id(ide_drive_t *, u8, u16 *); | ||
1239 | |||
1254 | extern int ide_driveid_update(ide_drive_t *); | 1240 | extern int ide_driveid_update(ide_drive_t *); |
1255 | extern int ide_config_drive_speed(ide_drive_t *, u8); | 1241 | extern int ide_config_drive_speed(ide_drive_t *, u8); |
1256 | extern u8 eighty_ninty_three (ide_drive_t *); | 1242 | extern u8 eighty_ninty_three (ide_drive_t *); |
@@ -1280,7 +1266,7 @@ static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev) | |||
1280 | return 0; | 1266 | return 0; |
1281 | } | 1267 | } |
1282 | 1268 | ||
1283 | 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 *, |
1284 | hw_regs_t *, hw_regs_t **); | 1270 | hw_regs_t *, hw_regs_t **); |
1285 | 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 *); |
1286 | 1272 | ||
@@ -1349,10 +1335,6 @@ enum { | |||
1349 | IDE_HFLAG_ERROR_STOPS_FIFO = (1 << 19), | 1335 | IDE_HFLAG_ERROR_STOPS_FIFO = (1 << 19), |
1350 | /* serialize ports */ | 1336 | /* serialize ports */ |
1351 | IDE_HFLAG_SERIALIZE = (1 << 20), | 1337 | IDE_HFLAG_SERIALIZE = (1 << 20), |
1352 | /* use legacy IRQs */ | ||
1353 | IDE_HFLAG_LEGACY_IRQS = (1 << 21), | ||
1354 | /* force use of legacy IRQs */ | ||
1355 | IDE_HFLAG_FORCE_LEGACY_IRQS = (1 << 22), | ||
1356 | /* host is TRM290 */ | 1338 | /* host is TRM290 */ |
1357 | IDE_HFLAG_TRM290 = (1 << 23), | 1339 | IDE_HFLAG_TRM290 = (1 << 23), |
1358 | /* use 32-bit I/O ops */ | 1340 | /* use 32-bit I/O ops */ |
@@ -1380,7 +1362,7 @@ enum { | |||
1380 | 1362 | ||
1381 | struct ide_port_info { | 1363 | struct ide_port_info { |
1382 | char *name; | 1364 | char *name; |
1383 | unsigned int (*init_chipset)(struct pci_dev *); | 1365 | int (*init_chipset)(struct pci_dev *); |
1384 | void (*init_iops)(ide_hwif_t *); | 1366 | void (*init_iops)(ide_hwif_t *); |
1385 | void (*init_hwif)(ide_hwif_t *); | 1367 | void (*init_hwif)(ide_hwif_t *); |
1386 | int (*init_dma)(ide_hwif_t *, | 1368 | int (*init_dma)(ide_hwif_t *, |
@@ -1471,6 +1453,7 @@ static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; } | |||
1471 | 1453 | ||
1472 | void ide_dma_lost_irq(ide_drive_t *); | 1454 | void ide_dma_lost_irq(ide_drive_t *); |
1473 | 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); | ||
1474 | 1457 | ||
1475 | #else | 1458 | #else |
1476 | 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; } |
@@ -1482,21 +1465,24 @@ static inline void ide_dma_on(ide_drive_t *drive) { ; } | |||
1482 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1465 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1483 | 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; } |
1484 | 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; } | ||
1485 | static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } | 1469 | static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } |
1486 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 1470 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
1487 | 1471 | ||
1488 | #ifdef CONFIG_BLK_DEV_IDEACPI | 1472 | #ifdef CONFIG_BLK_DEV_IDEACPI |
1473 | int ide_acpi_init(void); | ||
1489 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); | 1474 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); |
1490 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); | 1475 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); |
1491 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); | 1476 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); |
1492 | extern void ide_acpi_init(ide_hwif_t *hwif); | 1477 | void ide_acpi_init_port(ide_hwif_t *); |
1493 | void ide_acpi_port_init_devices(ide_hwif_t *); | 1478 | void ide_acpi_port_init_devices(ide_hwif_t *); |
1494 | 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); |
1495 | #else | 1480 | #else |
1481 | static inline int ide_acpi_init(void) { return 0; } | ||
1496 | 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; } |
1497 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } | 1483 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } |
1498 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } | 1484 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } |
1499 | static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } | 1485 | static inline void ide_acpi_init_port(ide_hwif_t *hwif) { ; } |
1500 | 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) { ; } |
1501 | 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) {} |
1502 | #endif | 1488 | #endif |
@@ -1530,9 +1516,7 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) | |||
1530 | hwif->hwif_data = data; | 1516 | hwif->hwif_data = data; |
1531 | } | 1517 | } |
1532 | 1518 | ||
1533 | const char *ide_xfer_verbose(u8 mode); | ||
1534 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1519 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1535 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | ||
1536 | 1520 | ||
1537 | u64 ide_get_lba_addr(struct ide_taskfile *, int); | 1521 | u64 ide_get_lba_addr(struct ide_taskfile *, int); |
1538 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1522 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
@@ -1571,14 +1555,18 @@ void ide_timing_merge(struct ide_timing *, struct ide_timing *, | |||
1571 | struct ide_timing *, unsigned int); | 1555 | struct ide_timing *, unsigned int); |
1572 | 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); |
1573 | 1557 | ||
1558 | #ifdef CONFIG_IDE_XFER_MODE | ||
1574 | int ide_scan_pio_blacklist(char *); | 1559 | int ide_scan_pio_blacklist(char *); |
1575 | 1560 | const char *ide_xfer_verbose(u8); | |
1576 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); | 1561 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); |
1577 | |||
1578 | int ide_set_pio_mode(ide_drive_t *, u8); | 1562 | int ide_set_pio_mode(ide_drive_t *, u8); |
1579 | int ide_set_dma_mode(ide_drive_t *, u8); | 1563 | int ide_set_dma_mode(ide_drive_t *, u8); |
1580 | |||
1581 | 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 | ||
1582 | 1570 | ||
1583 | static inline void ide_set_max_pio(ide_drive_t *drive) | 1571 | static inline void ide_set_max_pio(ide_drive_t *drive) |
1584 | { | 1572 | { |
@@ -1611,6 +1599,10 @@ static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) | |||
1611 | #define ide_port_for_each_dev(i, dev, port) \ | 1599 | #define ide_port_for_each_dev(i, dev, port) \ |
1612 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) | 1600 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) |
1613 | 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 | |||
1614 | #define ide_host_for_each_port(i, port, host) \ | 1606 | #define ide_host_for_each_port(i, port, host) \ |
1615 | 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)++) |
1616 | 1608 | ||