diff options
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index ec10b2a3bb6e..367c17084a28 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -112,18 +112,12 @@ typedef unsigned char byte; /* used everywhere */ | |||
112 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ | 112 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ |
113 | 113 | ||
114 | #define SATA_STATUS_OFFSET (0) | 114 | #define SATA_STATUS_OFFSET (0) |
115 | #define SATA_STATUS_REG (HWIF(drive)->sata_scr[SATA_STATUS_OFFSET]) | ||
116 | #define SATA_ERROR_OFFSET (1) | 115 | #define SATA_ERROR_OFFSET (1) |
117 | #define SATA_ERROR_REG (HWIF(drive)->sata_scr[SATA_ERROR_OFFSET]) | ||
118 | #define SATA_CONTROL_OFFSET (2) | 116 | #define SATA_CONTROL_OFFSET (2) |
119 | #define SATA_CONTROL_REG (HWIF(drive)->sata_scr[SATA_CONTROL_OFFSET]) | ||
120 | 117 | ||
121 | #define SATA_MISC_OFFSET (0) | 118 | #define SATA_MISC_OFFSET (0) |
122 | #define SATA_MISC_REG (HWIF(drive)->sata_misc[SATA_MISC_OFFSET]) | ||
123 | #define SATA_PHY_OFFSET (1) | 119 | #define SATA_PHY_OFFSET (1) |
124 | #define SATA_PHY_REG (HWIF(drive)->sata_misc[SATA_PHY_OFFSET]) | ||
125 | #define SATA_IEN_OFFSET (2) | 120 | #define SATA_IEN_OFFSET (2) |
126 | #define SATA_IEN_REG (HWIF(drive)->sata_misc[SATA_IEN_OFFSET]) | ||
127 | 121 | ||
128 | /* | 122 | /* |
129 | * Our Physical Region Descriptor (PRD) table should be large enough | 123 | * Our Physical Region Descriptor (PRD) table should be large enough |
@@ -196,6 +190,7 @@ typedef struct hw_regs_s { | |||
196 | } hw_regs_t; | 190 | } hw_regs_t; |
197 | 191 | ||
198 | struct hwif_s * ide_find_port(unsigned long); | 192 | struct hwif_s * ide_find_port(unsigned long); |
193 | struct hwif_s *ide_deprecated_find_port(unsigned long); | ||
199 | void ide_init_port_data(struct hwif_s *, unsigned int); | 194 | void ide_init_port_data(struct hwif_s *, unsigned int); |
200 | void ide_init_port_hw(struct hwif_s *, hw_regs_t *); | 195 | void ide_init_port_hw(struct hwif_s *, hw_regs_t *); |
201 | 196 | ||
@@ -406,8 +401,6 @@ typedef struct ide_drive_s { | |||
406 | unsigned no_unmask : 1; /* disallow setting unmask bit */ | 401 | unsigned no_unmask : 1; /* disallow setting unmask bit */ |
407 | unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ | 402 | unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ |
408 | unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */ | 403 | unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */ |
409 | unsigned nice0 : 1; /* give obvious excess bandwidth */ | ||
410 | unsigned nice2 : 1; /* give a share in our own bandwidth */ | ||
411 | unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ | 404 | unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ |
412 | unsigned nodma : 1; /* disallow DMA */ | 405 | unsigned nodma : 1; /* disallow DMA */ |
413 | unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */ | 406 | unsigned autotune : 2; /* 0=default, 1=autotune, 2=noautotune */ |
@@ -487,7 +480,6 @@ typedef struct hwif_s { | |||
487 | u8 major; /* our major number */ | 480 | u8 major; /* our major number */ |
488 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 481 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
489 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ | 482 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ |
490 | u8 straight8; /* Alan's straight 8 check */ | ||
491 | u8 bus_state; /* power state of the IDE bus */ | 483 | u8 bus_state; /* power state of the IDE bus */ |
492 | 484 | ||
493 | u32 host_flags; | 485 | u32 host_flags; |
@@ -513,6 +505,8 @@ typedef struct hwif_s { | |||
513 | #if 0 | 505 | #if 0 |
514 | ide_hwif_ops_t *hwifops; | 506 | ide_hwif_ops_t *hwifops; |
515 | #else | 507 | #else |
508 | /* host specific initialization of devices on a port */ | ||
509 | void (*port_init_devs)(struct hwif_s *); | ||
516 | /* routine to program host for PIO mode */ | 510 | /* routine to program host for PIO mode */ |
517 | void (*set_pio_mode)(ide_drive_t *, const u8); | 511 | void (*set_pio_mode)(ide_drive_t *, const u8); |
518 | /* routine to program host for DMA mode */ | 512 | /* routine to program host for DMA mode */ |
@@ -535,6 +529,8 @@ typedef struct hwif_s { | |||
535 | u8 (*mdma_filter)(ide_drive_t *); | 529 | u8 (*mdma_filter)(ide_drive_t *); |
536 | u8 (*udma_filter)(ide_drive_t *); | 530 | u8 (*udma_filter)(ide_drive_t *); |
537 | 531 | ||
532 | u8 (*cable_detect)(struct hwif_s *); | ||
533 | |||
538 | void (*ata_input_data)(ide_drive_t *, void *, u32); | 534 | void (*ata_input_data)(ide_drive_t *, void *, u32); |
539 | void (*ata_output_data)(ide_drive_t *, void *, u32); | 535 | void (*ata_output_data)(ide_drive_t *, void *, u32); |
540 | 536 | ||
@@ -602,10 +598,9 @@ typedef struct hwif_s { | |||
602 | unsigned serialized : 1; /* serialized all channel operation */ | 598 | unsigned serialized : 1; /* serialized all channel operation */ |
603 | unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ | 599 | unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ |
604 | unsigned reset : 1; /* reset after probe */ | 600 | unsigned reset : 1; /* reset after probe */ |
605 | unsigned auto_poll : 1; /* supports nop auto-poll */ | ||
606 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 601 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
607 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | ||
608 | unsigned mmio : 1; /* host uses MMIO */ | 602 | unsigned mmio : 1; /* host uses MMIO */ |
603 | unsigned straight8 : 1; /* Alan's straight 8 check */ | ||
609 | 604 | ||
610 | struct device gendev; | 605 | struct device gendev; |
611 | struct completion gendev_rel_comp; /* To deal with device release() */ | 606 | struct completion gendev_rel_comp; /* To deal with device release() */ |
@@ -625,6 +620,9 @@ typedef struct hwif_s { | |||
625 | typedef ide_startstop_t (ide_handler_t)(ide_drive_t *); | 620 | typedef ide_startstop_t (ide_handler_t)(ide_drive_t *); |
626 | typedef int (ide_expiry_t)(ide_drive_t *); | 621 | typedef int (ide_expiry_t)(ide_drive_t *); |
627 | 622 | ||
623 | /* used by ide-cd, ide-floppy, etc. */ | ||
624 | typedef void (xfer_func_t)(ide_drive_t *, void *, u32); | ||
625 | |||
628 | typedef struct hwgroup_s { | 626 | typedef struct hwgroup_s { |
629 | /* irq handler, if active */ | 627 | /* irq handler, if active */ |
630 | ide_startstop_t (*handler)(ide_drive_t *); | 628 | ide_startstop_t (*handler)(ide_drive_t *); |
@@ -708,6 +706,7 @@ typedef struct { | |||
708 | void proc_ide_create(void); | 706 | void proc_ide_create(void); |
709 | void proc_ide_destroy(void); | 707 | void proc_ide_destroy(void); |
710 | void ide_proc_register_port(ide_hwif_t *); | 708 | void ide_proc_register_port(ide_hwif_t *); |
709 | void ide_proc_port_register_devices(ide_hwif_t *); | ||
711 | void ide_proc_unregister_port(ide_hwif_t *); | 710 | void ide_proc_unregister_port(ide_hwif_t *); |
712 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); | 711 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); |
713 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); | 712 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); |
@@ -740,6 +739,7 @@ void ide_pci_create_host_proc(const char *, get_info_t *); | |||
740 | static inline void proc_ide_create(void) { ; } | 739 | static inline void proc_ide_create(void) { ; } |
741 | static inline void proc_ide_destroy(void) { ; } | 740 | static inline void proc_ide_destroy(void) { ; } |
742 | static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; } | 741 | static inline void ide_proc_register_port(ide_hwif_t *hwif) { ; } |
742 | static inline void ide_proc_port_register_devices(ide_hwif_t *hwif) { ; } | ||
743 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } | 743 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } |
744 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 744 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } |
745 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 745 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } |
@@ -988,10 +988,8 @@ int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long); | |||
988 | extern int system_bus_clock(void); | 988 | extern int system_bus_clock(void); |
989 | 989 | ||
990 | extern int ide_driveid_update(ide_drive_t *); | 990 | extern int ide_driveid_update(ide_drive_t *); |
991 | extern int ide_ata66_check(ide_drive_t *, ide_task_t *); | ||
992 | extern int ide_config_drive_speed(ide_drive_t *, u8); | 991 | extern int ide_config_drive_speed(ide_drive_t *, u8); |
993 | extern u8 eighty_ninty_three (ide_drive_t *); | 992 | extern u8 eighty_ninty_three (ide_drive_t *); |
994 | extern int set_transfer(ide_drive_t *, ide_task_t *); | ||
995 | extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *); | 993 | extern int taskfile_lib_get_identify(ide_drive_t *drive, u8 *); |
996 | 994 | ||
997 | extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); | 995 | extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); |
@@ -1016,6 +1014,13 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o | |||
1016 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); | 1014 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); |
1017 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1015 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1018 | 1016 | ||
1017 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | ||
1018 | void ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | ||
1019 | #else | ||
1020 | static inline void ide_hwif_setup_dma(ide_hwif_t *hwif, | ||
1021 | const struct ide_port_info *d) { } | ||
1022 | #endif | ||
1023 | |||
1019 | extern void default_hwif_iops(ide_hwif_t *); | 1024 | extern void default_hwif_iops(ide_hwif_t *); |
1020 | extern void default_hwif_mmiops(ide_hwif_t *); | 1025 | extern void default_hwif_mmiops(ide_hwif_t *); |
1021 | extern void default_hwif_transport(ide_hwif_t *); | 1026 | extern void default_hwif_transport(ide_hwif_t *); |
@@ -1052,7 +1057,7 @@ enum { | |||
1052 | IDE_HFLAG_NO_SET_MODE = (1 << 9), | 1057 | IDE_HFLAG_NO_SET_MODE = (1 << 9), |
1053 | /* trust BIOS for programming chipset/device for DMA */ | 1058 | /* trust BIOS for programming chipset/device for DMA */ |
1054 | IDE_HFLAG_TRUST_BIOS_FOR_DMA = (1 << 10), | 1059 | IDE_HFLAG_TRUST_BIOS_FOR_DMA = (1 << 10), |
1055 | /* host uses VDMA */ | 1060 | /* host uses VDMA (tied with IDE_HFLAG_CS5520 for now) */ |
1056 | IDE_HFLAG_VDMA = (1 << 11), | 1061 | IDE_HFLAG_VDMA = (1 << 11), |
1057 | /* ATAPI DMA is unsupported */ | 1062 | /* ATAPI DMA is unsupported */ |
1058 | IDE_HFLAG_NO_ATAPI_DMA = (1 << 12), | 1063 | IDE_HFLAG_NO_ATAPI_DMA = (1 << 12), |
@@ -1062,8 +1067,10 @@ enum { | |||
1062 | IDE_HFLAG_NO_DMA = (1 << 14), | 1067 | IDE_HFLAG_NO_DMA = (1 << 14), |
1063 | /* check if host is PCI IDE device before allowing DMA */ | 1068 | /* check if host is PCI IDE device before allowing DMA */ |
1064 | IDE_HFLAG_NO_AUTODMA = (1 << 15), | 1069 | IDE_HFLAG_NO_AUTODMA = (1 << 15), |
1070 | /* don't autotune PIO */ | ||
1071 | IDE_HFLAG_NO_AUTOTUNE = (1 << 16), | ||
1065 | /* host is CS5510/CS5520 */ | 1072 | /* host is CS5510/CS5520 */ |
1066 | IDE_HFLAG_CS5520 = (1 << 16), | 1073 | IDE_HFLAG_CS5520 = IDE_HFLAG_VDMA, |
1067 | /* no LBA48 */ | 1074 | /* no LBA48 */ |
1068 | IDE_HFLAG_NO_LBA48 = (1 << 17), | 1075 | IDE_HFLAG_NO_LBA48 = (1 << 17), |
1069 | /* no LBA48 DMA */ | 1076 | /* no LBA48 DMA */ |
@@ -1089,6 +1096,10 @@ enum { | |||
1089 | IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28), | 1096 | IDE_HFLAG_CLEAR_SIMPLEX = (1 << 28), |
1090 | /* DSC overlap is unsupported */ | 1097 | /* DSC overlap is unsupported */ |
1091 | IDE_HFLAG_NO_DSC = (1 << 29), | 1098 | IDE_HFLAG_NO_DSC = (1 << 29), |
1099 | /* never use 32-bit I/O ops */ | ||
1100 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), | ||
1101 | /* never unmask IRQs */ | ||
1102 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), | ||
1092 | }; | 1103 | }; |
1093 | 1104 | ||
1094 | #ifdef CONFIG_BLK_DEV_OFFBOARD | 1105 | #ifdef CONFIG_BLK_DEV_OFFBOARD |
@@ -1144,6 +1155,7 @@ void ide_dma_off_quietly(ide_drive_t *); | |||
1144 | void ide_dma_off(ide_drive_t *); | 1155 | void ide_dma_off(ide_drive_t *); |
1145 | void ide_dma_on(ide_drive_t *); | 1156 | void ide_dma_on(ide_drive_t *); |
1146 | int ide_set_dma(ide_drive_t *); | 1157 | int ide_set_dma(ide_drive_t *); |
1158 | void ide_check_dma_crc(ide_drive_t *); | ||
1147 | ide_startstop_t ide_dma_intr(ide_drive_t *); | 1159 | ide_startstop_t ide_dma_intr(ide_drive_t *); |
1148 | 1160 | ||
1149 | int ide_build_sglist(ide_drive_t *, struct request *); | 1161 | int ide_build_sglist(ide_drive_t *, struct request *); |
@@ -1171,6 +1183,7 @@ static inline void ide_dma_off(ide_drive_t *drive) { ; } | |||
1171 | static inline void ide_dma_on(ide_drive_t *drive) { ; } | 1183 | static inline void ide_dma_on(ide_drive_t *drive) { ; } |
1172 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1184 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1173 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | 1185 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } |
1186 | static inline void ide_check_dma_crc(ide_drive_t *drive) { ; } | ||
1174 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 1187 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
1175 | 1188 | ||
1176 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI | 1189 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1182,27 +1195,29 @@ extern int ide_acpi_exec_tfs(ide_drive_t *drive); | |||
1182 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); | 1195 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); |
1183 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); | 1196 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); |
1184 | extern void ide_acpi_init(ide_hwif_t *hwif); | 1197 | extern void ide_acpi_init(ide_hwif_t *hwif); |
1198 | void ide_acpi_port_init_devices(ide_hwif_t *); | ||
1185 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); | 1199 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); |
1186 | #else | 1200 | #else |
1187 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } | 1201 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } |
1188 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } | 1202 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } |
1189 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } | 1203 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } |
1190 | static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } | 1204 | static inline void ide_acpi_init(ide_hwif_t *hwif) { ; } |
1205 | static inline void ide_acpi_port_init_devices(ide_hwif_t *hwif) { ; } | ||
1191 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | 1206 | static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} |
1192 | #endif | 1207 | #endif |
1193 | 1208 | ||
1194 | void ide_remove_port_from_hwgroup(ide_hwif_t *); | 1209 | void ide_remove_port_from_hwgroup(ide_hwif_t *); |
1195 | extern int ide_hwif_request_regions(ide_hwif_t *hwif); | 1210 | extern int ide_hwif_request_regions(ide_hwif_t *hwif); |
1196 | extern void ide_hwif_release_regions(ide_hwif_t* hwif); | 1211 | extern void ide_hwif_release_regions(ide_hwif_t* hwif); |
1197 | extern void ide_unregister (unsigned int index); | 1212 | void ide_unregister(unsigned int, int, int); |
1198 | 1213 | ||
1199 | void ide_register_region(struct gendisk *); | 1214 | void ide_register_region(struct gendisk *); |
1200 | void ide_unregister_region(struct gendisk *); | 1215 | void ide_unregister_region(struct gendisk *); |
1201 | 1216 | ||
1202 | void ide_undecoded_slave(ide_drive_t *); | 1217 | void ide_undecoded_slave(ide_drive_t *); |
1203 | 1218 | ||
1204 | int ide_device_add_all(u8 *idx); | 1219 | int ide_device_add_all(u8 *idx, const struct ide_port_info *); |
1205 | int ide_device_add(u8 idx[4]); | 1220 | int ide_device_add(u8 idx[4], const struct ide_port_info *); |
1206 | 1221 | ||
1207 | static inline void *ide_get_hwifdata (ide_hwif_t * hwif) | 1222 | static inline void *ide_get_hwifdata (ide_hwif_t * hwif) |
1208 | { | 1223 | { |