diff options
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 59 |
1 files changed, 42 insertions, 17 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index e26a03981a94..79c028251c70 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -18,6 +18,9 @@ | |||
18 | #include <linux/device.h> | 18 | #include <linux/device.h> |
19 | #include <linux/pci.h> | 19 | #include <linux/pci.h> |
20 | #include <linux/completion.h> | 20 | #include <linux/completion.h> |
21 | #ifdef CONFIG_BLK_DEV_IDEACPI | ||
22 | #include <acpi/acpi.h> | ||
23 | #endif | ||
21 | #include <asm/byteorder.h> | 24 | #include <asm/byteorder.h> |
22 | #include <asm/system.h> | 25 | #include <asm/system.h> |
23 | #include <asm/io.h> | 26 | #include <asm/io.h> |
@@ -541,6 +544,11 @@ typedef enum { | |||
541 | struct ide_driver_s; | 544 | struct ide_driver_s; |
542 | struct ide_settings_s; | 545 | struct ide_settings_s; |
543 | 546 | ||
547 | #ifdef CONFIG_BLK_DEV_IDEACPI | ||
548 | struct ide_acpi_drive_link; | ||
549 | struct ide_acpi_hwif_link; | ||
550 | #endif | ||
551 | |||
544 | typedef struct ide_drive_s { | 552 | typedef struct ide_drive_s { |
545 | char name[4]; /* drive name, such as "hda" */ | 553 | char name[4]; /* drive name, such as "hda" */ |
546 | char driver_req[10]; /* requests specific driver */ | 554 | char driver_req[10]; /* requests specific driver */ |
@@ -628,7 +636,6 @@ typedef struct ide_drive_s { | |||
628 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ | 636 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ |
629 | unsigned int cyl; /* "real" number of cyls */ | 637 | unsigned int cyl; /* "real" number of cyls */ |
630 | unsigned int drive_data; /* use by tuneproc/selectproc */ | 638 | unsigned int drive_data; /* use by tuneproc/selectproc */ |
631 | unsigned int usage; /* current "open()" count for drive */ | ||
632 | unsigned int failures; /* current failure count */ | 639 | unsigned int failures; /* current failure count */ |
633 | unsigned int max_failures; /* maximum allowed failure count */ | 640 | unsigned int max_failures; /* maximum allowed failure count */ |
634 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | 641 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ |
@@ -637,6 +644,9 @@ typedef struct ide_drive_s { | |||
637 | 644 | ||
638 | int lun; /* logical unit */ | 645 | int lun; /* logical unit */ |
639 | int crc_count; /* crc counter to reduce drive speed */ | 646 | int crc_count; /* crc counter to reduce drive speed */ |
647 | #ifdef CONFIG_BLK_DEV_IDEACPI | ||
648 | struct ide_acpi_drive_link *acpidata; | ||
649 | #endif | ||
640 | struct list_head list; | 650 | struct list_head list; |
641 | struct device gendev; | 651 | struct device gendev; |
642 | struct completion gendev_rel_comp; /* to deal with device release() */ | 652 | struct completion gendev_rel_comp; /* to deal with device release() */ |
@@ -725,23 +735,22 @@ typedef struct hwif_s { | |||
725 | int (*ide_dma_end)(ide_drive_t *drive); | 735 | int (*ide_dma_end)(ide_drive_t *drive); |
726 | int (*ide_dma_check)(ide_drive_t *drive); | 736 | int (*ide_dma_check)(ide_drive_t *drive); |
727 | int (*ide_dma_on)(ide_drive_t *drive); | 737 | int (*ide_dma_on)(ide_drive_t *drive); |
728 | int (*ide_dma_off_quietly)(ide_drive_t *drive); | 738 | void (*dma_off_quietly)(ide_drive_t *drive); |
729 | int (*ide_dma_test_irq)(ide_drive_t *drive); | 739 | int (*ide_dma_test_irq)(ide_drive_t *drive); |
730 | int (*ide_dma_host_on)(ide_drive_t *drive); | 740 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
731 | int (*ide_dma_host_off)(ide_drive_t *drive); | 741 | void (*dma_host_on)(ide_drive_t *drive); |
742 | void (*dma_host_off)(ide_drive_t *drive); | ||
732 | int (*ide_dma_lostirq)(ide_drive_t *drive); | 743 | int (*ide_dma_lostirq)(ide_drive_t *drive); |
733 | int (*ide_dma_timeout)(ide_drive_t *drive); | 744 | int (*ide_dma_timeout)(ide_drive_t *drive); |
734 | 745 | ||
735 | void (*OUTB)(u8 addr, unsigned long port); | 746 | void (*OUTB)(u8 addr, unsigned long port); |
736 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); | 747 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); |
737 | void (*OUTW)(u16 addr, unsigned long port); | 748 | void (*OUTW)(u16 addr, unsigned long port); |
738 | void (*OUTL)(u32 addr, unsigned long port); | ||
739 | void (*OUTSW)(unsigned long port, void *addr, u32 count); | 749 | void (*OUTSW)(unsigned long port, void *addr, u32 count); |
740 | void (*OUTSL)(unsigned long port, void *addr, u32 count); | 750 | void (*OUTSL)(unsigned long port, void *addr, u32 count); |
741 | 751 | ||
742 | u8 (*INB)(unsigned long port); | 752 | u8 (*INB)(unsigned long port); |
743 | u16 (*INW)(unsigned long port); | 753 | u16 (*INW)(unsigned long port); |
744 | u32 (*INL)(unsigned long port); | ||
745 | void (*INSW)(unsigned long port, void *addr, u32 count); | 754 | void (*INSW)(unsigned long port, void *addr, u32 count); |
746 | void (*INSL)(unsigned long port, void *addr, u32 count); | 755 | void (*INSL)(unsigned long port, void *addr, u32 count); |
747 | 756 | ||
@@ -763,7 +772,6 @@ typedef struct hwif_s { | |||
763 | unsigned int cursg; | 772 | unsigned int cursg; |
764 | unsigned int cursg_ofs; | 773 | unsigned int cursg_ofs; |
765 | 774 | ||
766 | int mmio; /* hosts iomio (0) or custom (2) select */ | ||
767 | int rqsize; /* max sectors per request */ | 775 | int rqsize; /* max sectors per request */ |
768 | int irq; /* our irq number */ | 776 | int irq; /* our irq number */ |
769 | 777 | ||
@@ -791,12 +799,11 @@ typedef struct hwif_s { | |||
791 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ | 799 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ |
792 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ | 800 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ |
793 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ | 801 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ |
794 | unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */ | ||
795 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 802 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
796 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 803 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
797 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | 804 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ |
798 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ | 805 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ |
799 | unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */ | 806 | unsigned mmio : 1; /* host uses MMIO */ |
800 | 807 | ||
801 | struct device gendev; | 808 | struct device gendev; |
802 | struct completion gendev_rel_comp; /* To deal with device release() */ | 809 | struct completion gendev_rel_comp; /* To deal with device release() */ |
@@ -804,6 +811,10 @@ typedef struct hwif_s { | |||
804 | void *hwif_data; /* extra hwif data */ | 811 | void *hwif_data; /* extra hwif data */ |
805 | 812 | ||
806 | unsigned dma; | 813 | unsigned dma; |
814 | |||
815 | #ifdef CONFIG_BLK_DEV_IDEACPI | ||
816 | struct ide_acpi_hwif_link *acpidata; | ||
817 | #endif | ||
807 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 818 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
808 | 819 | ||
809 | /* | 820 | /* |
@@ -1192,8 +1203,8 @@ void ide_init_disk(struct gendisk *, ide_drive_t *); | |||
1192 | extern int ideprobe_init(void); | 1203 | extern int ideprobe_init(void); |
1193 | 1204 | ||
1194 | extern void ide_scan_pcibus(int scan_direction) __init; | 1205 | extern void ide_scan_pcibus(int scan_direction) __init; |
1195 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner); | 1206 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name); |
1196 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) | 1207 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME) |
1197 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); | 1208 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); |
1198 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); | 1209 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); |
1199 | 1210 | ||
@@ -1265,8 +1276,9 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | |||
1265 | int __ide_dma_bad_drive(ide_drive_t *); | 1276 | int __ide_dma_bad_drive(ide_drive_t *); |
1266 | int __ide_dma_good_drive(ide_drive_t *); | 1277 | int __ide_dma_good_drive(ide_drive_t *); |
1267 | int ide_use_dma(ide_drive_t *); | 1278 | int ide_use_dma(ide_drive_t *); |
1268 | int __ide_dma_off(ide_drive_t *); | 1279 | void ide_dma_off(ide_drive_t *); |
1269 | void ide_dma_verbose(ide_drive_t *); | 1280 | void ide_dma_verbose(ide_drive_t *); |
1281 | int ide_set_dma(ide_drive_t *); | ||
1270 | ide_startstop_t ide_dma_intr(ide_drive_t *); | 1282 | ide_startstop_t ide_dma_intr(ide_drive_t *); |
1271 | 1283 | ||
1272 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1284 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1276,9 +1288,9 @@ extern void ide_destroy_dmatable(ide_drive_t *); | |||
1276 | extern int ide_release_dma(ide_hwif_t *); | 1288 | extern int ide_release_dma(ide_hwif_t *); |
1277 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); | 1289 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); |
1278 | 1290 | ||
1279 | extern int __ide_dma_host_off(ide_drive_t *); | 1291 | void ide_dma_host_off(ide_drive_t *); |
1280 | extern int __ide_dma_off_quietly(ide_drive_t *); | 1292 | void ide_dma_off_quietly(ide_drive_t *); |
1281 | extern int __ide_dma_host_on(ide_drive_t *); | 1293 | void ide_dma_host_on(ide_drive_t *); |
1282 | extern int __ide_dma_on(ide_drive_t *); | 1294 | extern int __ide_dma_on(ide_drive_t *); |
1283 | extern int __ide_dma_check(ide_drive_t *); | 1295 | extern int __ide_dma_check(ide_drive_t *); |
1284 | extern int ide_dma_setup(ide_drive_t *); | 1296 | extern int ide_dma_setup(ide_drive_t *); |
@@ -1290,14 +1302,27 @@ extern int __ide_dma_timeout(ide_drive_t *); | |||
1290 | 1302 | ||
1291 | #else | 1303 | #else |
1292 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } | 1304 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } |
1293 | static inline int __ide_dma_off(ide_drive_t *drive) { return 0; } | 1305 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
1294 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1306 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1307 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | ||
1295 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 1308 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
1296 | 1309 | ||
1297 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI | 1310 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI |
1298 | static inline void ide_release_dma(ide_hwif_t *drive) {;} | 1311 | static inline void ide_release_dma(ide_hwif_t *drive) {;} |
1299 | #endif | 1312 | #endif |
1300 | 1313 | ||
1314 | #ifdef CONFIG_BLK_DEV_IDEACPI | ||
1315 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); | ||
1316 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); | ||
1317 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); | ||
1318 | extern void ide_acpi_init(ide_hwif_t *hwif); | ||
1319 | #else | ||
1320 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } | ||
1321 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } | ||
1322 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } | ||
1323 | static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } | ||
1324 | #endif | ||
1325 | |||
1301 | extern int ide_hwif_request_regions(ide_hwif_t *hwif); | 1326 | extern int ide_hwif_request_regions(ide_hwif_t *hwif); |
1302 | extern void ide_hwif_release_regions(ide_hwif_t* hwif); | 1327 | extern void ide_hwif_release_regions(ide_hwif_t* hwif); |
1303 | extern void ide_unregister (unsigned int index); | 1328 | extern void ide_unregister (unsigned int index); |
@@ -1327,6 +1352,7 @@ extern int ide_dma_enable(ide_drive_t *drive); | |||
1327 | extern char *ide_xfer_verbose(u8 xfer_rate); | 1352 | extern char *ide_xfer_verbose(u8 xfer_rate); |
1328 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1353 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1329 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1354 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1355 | int ide_use_fast_pio(ide_drive_t *); | ||
1330 | 1356 | ||
1331 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1357 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1332 | 1358 | ||
@@ -1340,7 +1366,6 @@ typedef struct ide_pio_data_s { | |||
1340 | u8 pio_mode; | 1366 | u8 pio_mode; |
1341 | u8 use_iordy; | 1367 | u8 use_iordy; |
1342 | u8 overridden; | 1368 | u8 overridden; |
1343 | u8 blacklisted; | ||
1344 | unsigned int cycle_time; | 1369 | unsigned int cycle_time; |
1345 | } ide_pio_data_t; | 1370 | } ide_pio_data_t; |
1346 | 1371 | ||