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.h78
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) || \
197static 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
1146extern int ide_vlb_clk; 1130extern int ide_vlb_clk;
1147extern int ide_pci_clk; 1131extern int ide_pci_clk;
1148 1132
1149extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); 1133int ide_end_request(ide_drive_t *, int, int);
1150int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, 1134int ide_end_dequeued_request(ide_drive_t *, struct request *, int, int);
1151 int uptodate, int nr_sectors); 1135void ide_kill_rq(ide_drive_t *, struct request *);
1152 1136
1153extern void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry); 1137void __ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int,
1138 ide_expiry_t *);
1139void ide_set_handler(ide_drive_t *, ide_handler_t *, unsigned int,
1140 ide_expiry_t *);
1154 1141
1155void ide_execute_command(ide_drive_t *, u8, ide_handler_t *, unsigned int, 1142void 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
1170int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); 1157int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
1171 1158
1159ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *);
1160ide_startstop_t ide_do_devset(ide_drive_t *, struct request *);
1161
1172extern ide_startstop_t ide_do_reset (ide_drive_t *); 1162extern ide_startstop_t ide_do_reset (ide_drive_t *);
1173 1163
1174extern int ide_devset_execute(ide_drive_t *drive, 1164extern 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
1177extern void ide_do_drive_cmd(ide_drive_t *, struct request *);
1178
1179extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); 1167extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
1180 1168
1181void ide_tf_dump(const char *, struct ide_taskfile *); 1169void ide_tf_dump(const char *, struct ide_taskfile *);
@@ -1200,10 +1188,6 @@ void SELECT_MASK(ide_drive_t *, int);
1200u8 ide_read_error(ide_drive_t *); 1188u8 ide_read_error(ide_drive_t *);
1201void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); 1189void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *);
1202 1190
1203extern int drive_is_ready(ide_drive_t *);
1204
1205void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8);
1206
1207int ide_check_atapi_device(ide_drive_t *, const char *); 1191int ide_check_atapi_device(ide_drive_t *, const char *);
1208 1192
1209void ide_init_pc(struct ide_atapi_pc *); 1193void ide_init_pc(struct ide_atapi_pc *);
@@ -1251,6 +1235,8 @@ int ide_no_data_taskfile(ide_drive_t *, ide_task_t *);
1251 1235
1252int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); 1236int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
1253 1237
1238int ide_dev_read_id(ide_drive_t *, u8, u16 *);
1239
1254extern int ide_driveid_update(ide_drive_t *); 1240extern int ide_driveid_update(ide_drive_t *);
1255extern int ide_config_drive_speed(ide_drive_t *, u8); 1241extern int ide_config_drive_speed(ide_drive_t *, u8);
1256extern u8 eighty_ninty_three (ide_drive_t *); 1242extern 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
1283void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, 1269void 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 **);
1285void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); 1271void 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
1381struct ide_port_info { 1363struct 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
1472void ide_dma_lost_irq(ide_drive_t *); 1454void ide_dma_lost_irq(ide_drive_t *);
1473void ide_dma_timeout(ide_drive_t *); 1455void ide_dma_timeout(ide_drive_t *);
1456ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int);
1474 1457
1475#else 1458#else
1476static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } 1459static 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) { ; }
1482static inline void ide_dma_verbose(ide_drive_t *drive) { ; } 1465static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1483static inline int ide_set_dma(ide_drive_t *drive) { return 1; } 1466static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1484static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } 1467static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1468static inline ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) { return ide_stopped; }
1485static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } 1469static 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
1473int ide_acpi_init(void);
1489extern int ide_acpi_exec_tfs(ide_drive_t *drive); 1474extern int ide_acpi_exec_tfs(ide_drive_t *drive);
1490extern void ide_acpi_get_timing(ide_hwif_t *hwif); 1475extern void ide_acpi_get_timing(ide_hwif_t *hwif);
1491extern void ide_acpi_push_timing(ide_hwif_t *hwif); 1476extern void ide_acpi_push_timing(ide_hwif_t *hwif);
1492extern void ide_acpi_init(ide_hwif_t *hwif); 1477void ide_acpi_init_port(ide_hwif_t *);
1493void ide_acpi_port_init_devices(ide_hwif_t *); 1478void ide_acpi_port_init_devices(ide_hwif_t *);
1494extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); 1479extern void ide_acpi_set_state(ide_hwif_t *hwif, int on);
1495#else 1480#else
1481static inline int ide_acpi_init(void) { return 0; }
1496static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } 1482static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; }
1497static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } 1483static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; }
1498static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } 1484static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; }
1499static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } 1485static inline void ide_acpi_init_port(ide_hwif_t *hwif) { ; }
1500static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; } 1486static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; }
1501static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} 1487static 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
1533const char *ide_xfer_verbose(u8 mode);
1534extern void ide_toggle_bounce(ide_drive_t *drive, int on); 1519extern void ide_toggle_bounce(ide_drive_t *drive, int on);
1535extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate);
1536 1520
1537u64 ide_get_lba_addr(struct ide_taskfile *, int); 1521u64 ide_get_lba_addr(struct ide_taskfile *, int);
1538u8 ide_dump_status(ide_drive_t *, const char *, u8); 1522u8 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);
1572int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int); 1556int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int);
1573 1557
1558#ifdef CONFIG_IDE_XFER_MODE
1574int ide_scan_pio_blacklist(char *); 1559int ide_scan_pio_blacklist(char *);
1575 1560const char *ide_xfer_verbose(u8);
1576u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); 1561u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1577
1578int ide_set_pio_mode(ide_drive_t *, u8); 1562int ide_set_pio_mode(ide_drive_t *, u8);
1579int ide_set_dma_mode(ide_drive_t *, u8); 1563int ide_set_dma_mode(ide_drive_t *, u8);
1580
1581void ide_set_pio(ide_drive_t *, u8); 1564void ide_set_pio(ide_drive_t *, u8);
1565int ide_set_xfer_rate(ide_drive_t *, u8);
1566#else
1567static inline void ide_set_pio(ide_drive_t *drive, u8 pio) { ; }
1568static inline int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) { return -1; }
1569#endif
1582 1570
1583static inline void ide_set_max_pio(ide_drive_t *drive) 1571static 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