diff options
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 223 |
1 files changed, 152 insertions, 71 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 4726126f5a59..b846bc44a27e 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -178,6 +178,7 @@ typedef struct hw_regs_s { | |||
178 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | 178 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ |
179 | hwif_chipset_t chipset; | 179 | hwif_chipset_t chipset; |
180 | struct device *dev, *parent; | 180 | struct device *dev, *parent; |
181 | unsigned long config; | ||
181 | } hw_regs_t; | 182 | } hw_regs_t; |
182 | 183 | ||
183 | void ide_init_port_data(struct hwif_s *, unsigned int); | 184 | void ide_init_port_data(struct hwif_s *, unsigned int); |
@@ -210,7 +211,21 @@ static inline int __ide_default_irq(unsigned long base) | |||
210 | return 0; | 211 | return 0; |
211 | } | 212 | } |
212 | 213 | ||
214 | #if defined(CONFIG_ARM) || defined(CONFIG_FRV) || defined(CONFIG_M68K) || \ | ||
215 | defined(CONFIG_MIPS) || defined(CONFIG_MN10300) || defined(CONFIG_PARISC) \ | ||
216 | || defined(CONFIG_PPC) || defined(CONFIG_SPARC) || defined(CONFIG_SPARC64) | ||
213 | #include <asm/ide.h> | 217 | #include <asm/ide.h> |
218 | #else | ||
219 | #include <asm-generic/ide_iops.h> | ||
220 | #endif | ||
221 | |||
222 | #ifndef MAX_HWIFS | ||
223 | #if defined(CONFIG_BLACKFIN) || defined(CONFIG_H8300) || defined(CONFIG_XTENSA) | ||
224 | # define MAX_HWIFS 1 | ||
225 | #else | ||
226 | # define MAX_HWIFS 10 | ||
227 | #endif | ||
228 | #endif | ||
214 | 229 | ||
215 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) | 230 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) |
216 | #undef MAX_HWIFS | 231 | #undef MAX_HWIFS |
@@ -307,7 +322,65 @@ struct ide_acpi_drive_link; | |||
307 | struct ide_acpi_hwif_link; | 322 | struct ide_acpi_hwif_link; |
308 | #endif | 323 | #endif |
309 | 324 | ||
310 | typedef struct ide_drive_s { | 325 | /* ATAPI device flags */ |
326 | enum { | ||
327 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), | ||
328 | IDE_AFLAG_MEDIA_CHANGED = (1 << 1), | ||
329 | |||
330 | /* ide-cd */ | ||
331 | /* Drive cannot lock the door. */ | ||
332 | IDE_AFLAG_NO_DOORLOCK = (1 << 2), | ||
333 | /* Drive cannot eject the disc. */ | ||
334 | IDE_AFLAG_NO_EJECT = (1 << 3), | ||
335 | /* Drive is a pre ATAPI 1.2 drive. */ | ||
336 | IDE_AFLAG_PRE_ATAPI12 = (1 << 4), | ||
337 | /* TOC addresses are in BCD. */ | ||
338 | IDE_AFLAG_TOCADDR_AS_BCD = (1 << 5), | ||
339 | /* TOC track numbers are in BCD. */ | ||
340 | IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 6), | ||
341 | /* | ||
342 | * Drive does not provide data in multiples of SECTOR_SIZE | ||
343 | * when more than one interrupt is needed. | ||
344 | */ | ||
345 | IDE_AFLAG_LIMIT_NFRAMES = (1 << 7), | ||
346 | /* Seeking in progress. */ | ||
347 | IDE_AFLAG_SEEKING = (1 << 8), | ||
348 | /* Saved TOC information is current. */ | ||
349 | IDE_AFLAG_TOC_VALID = (1 << 9), | ||
350 | /* We think that the drive door is locked. */ | ||
351 | IDE_AFLAG_DOOR_LOCKED = (1 << 10), | ||
352 | /* SET_CD_SPEED command is unsupported. */ | ||
353 | IDE_AFLAG_NO_SPEED_SELECT = (1 << 11), | ||
354 | IDE_AFLAG_VERTOS_300_SSD = (1 << 12), | ||
355 | IDE_AFLAG_VERTOS_600_ESD = (1 << 13), | ||
356 | IDE_AFLAG_SANYO_3CD = (1 << 14), | ||
357 | IDE_AFLAG_FULL_CAPS_PAGE = (1 << 15), | ||
358 | IDE_AFLAG_PLAY_AUDIO_OK = (1 << 16), | ||
359 | IDE_AFLAG_LE_SPEED_FIELDS = (1 << 17), | ||
360 | |||
361 | /* ide-floppy */ | ||
362 | /* Format in progress */ | ||
363 | IDE_AFLAG_FORMAT_IN_PROGRESS = (1 << 18), | ||
364 | /* Avoid commands not supported in Clik drive */ | ||
365 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), | ||
366 | /* Requires BH algorithm for packets */ | ||
367 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), | ||
368 | |||
369 | /* ide-tape */ | ||
370 | IDE_AFLAG_IGNORE_DSC = (1 << 21), | ||
371 | /* 0 When the tape position is unknown */ | ||
372 | IDE_AFLAG_ADDRESS_VALID = (1 << 22), | ||
373 | /* Device already opened */ | ||
374 | IDE_AFLAG_BUSY = (1 << 23), | ||
375 | /* Attempt to auto-detect the current user block size */ | ||
376 | IDE_AFLAG_DETECT_BS = (1 << 24), | ||
377 | /* Currently on a filemark */ | ||
378 | IDE_AFLAG_FILEMARK = (1 << 25), | ||
379 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ | ||
380 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) | ||
381 | }; | ||
382 | |||
383 | struct ide_drive_s { | ||
311 | char name[4]; /* drive name, such as "hda" */ | 384 | char name[4]; /* drive name, such as "hda" */ |
312 | char driver_req[10]; /* requests specific driver */ | 385 | char driver_req[10]; /* requests specific driver */ |
313 | 386 | ||
@@ -355,7 +428,6 @@ typedef struct ide_drive_s { | |||
355 | unsigned nodma : 1; /* disallow DMA */ | 428 | unsigned nodma : 1; /* disallow DMA */ |
356 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | 429 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ |
357 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ | 430 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ |
358 | unsigned vdma : 1; /* 1=doing PIO over DMA 0=doing normal DMA */ | ||
359 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ | 431 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ |
360 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | 432 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ |
361 | unsigned post_reset : 1; | 433 | unsigned post_reset : 1; |
@@ -400,7 +472,14 @@ typedef struct ide_drive_s { | |||
400 | struct list_head list; | 472 | struct list_head list; |
401 | struct device gendev; | 473 | struct device gendev; |
402 | struct completion gendev_rel_comp; /* to deal with device release() */ | 474 | struct completion gendev_rel_comp; /* to deal with device release() */ |
403 | } ide_drive_t; | 475 | |
476 | /* callback for packet commands */ | ||
477 | void (*pc_callback)(struct ide_drive_s *); | ||
478 | |||
479 | unsigned long atapi_flags; | ||
480 | }; | ||
481 | |||
482 | typedef struct ide_drive_s ide_drive_t; | ||
404 | 483 | ||
405 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) | 484 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) |
406 | 485 | ||
@@ -408,8 +487,28 @@ typedef struct ide_drive_s { | |||
408 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) | 487 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) |
409 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) | 488 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) |
410 | 489 | ||
490 | struct ide_task_s; | ||
411 | struct ide_port_info; | 491 | struct ide_port_info; |
412 | 492 | ||
493 | struct ide_tp_ops { | ||
494 | void (*exec_command)(struct hwif_s *, u8); | ||
495 | u8 (*read_status)(struct hwif_s *); | ||
496 | u8 (*read_altstatus)(struct hwif_s *); | ||
497 | u8 (*read_sff_dma_status)(struct hwif_s *); | ||
498 | |||
499 | void (*set_irq)(struct hwif_s *, int); | ||
500 | |||
501 | void (*tf_load)(ide_drive_t *, struct ide_task_s *); | ||
502 | void (*tf_read)(ide_drive_t *, struct ide_task_s *); | ||
503 | |||
504 | void (*input_data)(ide_drive_t *, struct request *, void *, | ||
505 | unsigned int); | ||
506 | void (*output_data)(ide_drive_t *, struct request *, void *, | ||
507 | unsigned int); | ||
508 | }; | ||
509 | |||
510 | extern const struct ide_tp_ops default_tp_ops; | ||
511 | |||
413 | struct ide_port_ops { | 512 | struct ide_port_ops { |
414 | /* host specific initialization of a device */ | 513 | /* host specific initialization of a device */ |
415 | void (*init_dev)(ide_drive_t *); | 514 | void (*init_dev)(ide_drive_t *); |
@@ -447,7 +546,7 @@ struct ide_dma_ops { | |||
447 | void (*dma_timeout)(struct ide_drive_s *); | 546 | void (*dma_timeout)(struct ide_drive_s *); |
448 | }; | 547 | }; |
449 | 548 | ||
450 | struct ide_task_s; | 549 | struct ide_host; |
451 | 550 | ||
452 | typedef struct hwif_s { | 551 | typedef struct hwif_s { |
453 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ | 552 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ |
@@ -455,6 +554,8 @@ typedef struct hwif_s { | |||
455 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ | 554 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ |
456 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 555 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
457 | 556 | ||
557 | struct ide_host *host; | ||
558 | |||
458 | char name[6]; /* name of interface, eg. "ide0" */ | 559 | char name[6]; /* name of interface, eg. "ide0" */ |
459 | 560 | ||
460 | struct ide_io_ports io_ports; | 561 | struct ide_io_ports io_ports; |
@@ -486,22 +587,12 @@ typedef struct hwif_s { | |||
486 | 587 | ||
487 | void (*rw_disk)(ide_drive_t *, struct request *); | 588 | void (*rw_disk)(ide_drive_t *, struct request *); |
488 | 589 | ||
590 | const struct ide_tp_ops *tp_ops; | ||
489 | const struct ide_port_ops *port_ops; | 591 | const struct ide_port_ops *port_ops; |
490 | const struct ide_dma_ops *dma_ops; | 592 | const struct ide_dma_ops *dma_ops; |
491 | 593 | ||
492 | void (*tf_load)(ide_drive_t *, struct ide_task_s *); | ||
493 | void (*tf_read)(ide_drive_t *, struct ide_task_s *); | ||
494 | |||
495 | void (*input_data)(ide_drive_t *, struct request *, void *, unsigned); | ||
496 | void (*output_data)(ide_drive_t *, struct request *, void *, unsigned); | ||
497 | |||
498 | void (*ide_dma_clear_irq)(ide_drive_t *drive); | 594 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
499 | 595 | ||
500 | void (*OUTB)(u8 addr, unsigned long port); | ||
501 | void (*OUTBSYNC)(struct hwif_s *hwif, u8 addr, unsigned long port); | ||
502 | |||
503 | u8 (*INB)(unsigned long port); | ||
504 | |||
505 | /* dma physical region descriptor table (cpu view) */ | 596 | /* dma physical region descriptor table (cpu view) */ |
506 | unsigned int *dmatable_cpu; | 597 | unsigned int *dmatable_cpu; |
507 | /* dma physical region descriptor table (dma view) */ | 598 | /* dma physical region descriptor table (dma view) */ |
@@ -524,8 +615,6 @@ typedef struct hwif_s { | |||
524 | int irq; /* our irq number */ | 615 | int irq; /* our irq number */ |
525 | 616 | ||
526 | unsigned long dma_base; /* base addr for dma ports */ | 617 | unsigned long dma_base; /* base addr for dma ports */ |
527 | unsigned long dma_command; /* dma command register */ | ||
528 | unsigned long dma_status; /* dma status register */ | ||
529 | 618 | ||
530 | unsigned long config_data; /* for use by chipset-specific code */ | 619 | unsigned long config_data; /* for use by chipset-specific code */ |
531 | unsigned long select_data; /* for use by chipset-specific code */ | 620 | unsigned long select_data; /* for use by chipset-specific code */ |
@@ -552,6 +641,14 @@ typedef struct hwif_s { | |||
552 | #endif | 641 | #endif |
553 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 642 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
554 | 643 | ||
644 | struct ide_host { | ||
645 | ide_hwif_t *ports[MAX_HWIFS]; | ||
646 | unsigned int n_ports; | ||
647 | struct device *dev[2]; | ||
648 | unsigned long host_flags; | ||
649 | void *host_priv; | ||
650 | }; | ||
651 | |||
555 | /* | 652 | /* |
556 | * internal ide interrupt handler type | 653 | * internal ide interrupt handler type |
557 | */ | 654 | */ |
@@ -611,8 +708,6 @@ enum { | |||
611 | PC_FLAG_WRITING = (1 << 6), | 708 | PC_FLAG_WRITING = (1 << 6), |
612 | /* command timed out */ | 709 | /* command timed out */ |
613 | PC_FLAG_TIMEDOUT = (1 << 7), | 710 | PC_FLAG_TIMEDOUT = (1 << 7), |
614 | PC_FLAG_ZIP_DRIVE = (1 << 8), | ||
615 | PC_FLAG_DRQ_INTERRUPT = (1 << 9), | ||
616 | }; | 711 | }; |
617 | 712 | ||
618 | struct ide_atapi_pc { | 713 | struct ide_atapi_pc { |
@@ -646,8 +741,6 @@ struct ide_atapi_pc { | |||
646 | */ | 741 | */ |
647 | u8 pc_buf[256]; | 742 | u8 pc_buf[256]; |
648 | 743 | ||
649 | void (*callback)(ide_drive_t *); | ||
650 | |||
651 | /* idetape only */ | 744 | /* idetape only */ |
652 | struct idetape_bh *bh; | 745 | struct idetape_bh *bh; |
653 | char *b_data; | 746 | char *b_data; |
@@ -802,18 +895,14 @@ struct ide_driver_s { | |||
802 | 895 | ||
803 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) | 896 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) |
804 | 897 | ||
898 | int ide_device_get(ide_drive_t *); | ||
899 | void ide_device_put(ide_drive_t *); | ||
900 | |||
805 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 901 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); |
806 | 902 | ||
807 | extern int ide_vlb_clk; | 903 | extern int ide_vlb_clk; |
808 | extern int ide_pci_clk; | 904 | extern int ide_pci_clk; |
809 | 905 | ||
810 | ide_hwif_t *ide_find_port_slot(const struct ide_port_info *); | ||
811 | |||
812 | static inline ide_hwif_t *ide_find_port(void) | ||
813 | { | ||
814 | return ide_find_port_slot(NULL); | ||
815 | } | ||
816 | |||
817 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 906 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); |
818 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | 907 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, |
819 | int uptodate, int nr_sectors); | 908 | int uptodate, int nr_sectors); |
@@ -884,6 +973,7 @@ enum { | |||
884 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | | 973 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | |
885 | IDE_TFLAG_IN_HOB_NSECT | | 974 | IDE_TFLAG_IN_HOB_NSECT | |
886 | IDE_TFLAG_IN_HOB_LBA, | 975 | IDE_TFLAG_IN_HOB_LBA, |
976 | IDE_TFLAG_IN_FEATURE = (1 << 1), | ||
887 | IDE_TFLAG_IN_NSECT = (1 << 25), | 977 | IDE_TFLAG_IN_NSECT = (1 << 25), |
888 | IDE_TFLAG_IN_LBAL = (1 << 26), | 978 | IDE_TFLAG_IN_LBAL = (1 << 26), |
889 | IDE_TFLAG_IN_LBAM = (1 << 27), | 979 | IDE_TFLAG_IN_LBAM = (1 << 27), |
@@ -948,9 +1038,25 @@ typedef struct ide_task_s { | |||
948 | 1038 | ||
949 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1039 | void ide_tf_dump(const char *, struct ide_taskfile *); |
950 | 1040 | ||
1041 | void ide_exec_command(ide_hwif_t *, u8); | ||
1042 | u8 ide_read_status(ide_hwif_t *); | ||
1043 | u8 ide_read_altstatus(ide_hwif_t *); | ||
1044 | u8 ide_read_sff_dma_status(ide_hwif_t *); | ||
1045 | |||
1046 | void ide_set_irq(ide_hwif_t *, int); | ||
1047 | |||
1048 | void ide_tf_load(ide_drive_t *, ide_task_t *); | ||
1049 | void ide_tf_read(ide_drive_t *, ide_task_t *); | ||
1050 | |||
1051 | void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); | ||
1052 | void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); | ||
1053 | |||
951 | extern void SELECT_DRIVE(ide_drive_t *); | 1054 | extern void SELECT_DRIVE(ide_drive_t *); |
952 | void SELECT_MASK(ide_drive_t *, int); | 1055 | void SELECT_MASK(ide_drive_t *, int); |
953 | 1056 | ||
1057 | u8 ide_read_error(ide_drive_t *); | ||
1058 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); | ||
1059 | |||
954 | extern int drive_is_ready(ide_drive_t *); | 1060 | extern int drive_is_ready(ide_drive_t *); |
955 | 1061 | ||
956 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | 1062 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); |
@@ -1000,12 +1106,15 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o | |||
1000 | #define ide_pci_register_driver(d) pci_register_driver(d) | 1106 | #define ide_pci_register_driver(d) pci_register_driver(d) |
1001 | #endif | 1107 | #endif |
1002 | 1108 | ||
1003 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); | 1109 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, |
1110 | hw_regs_t *, hw_regs_t **); | ||
1004 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1111 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1005 | 1112 | ||
1006 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1113 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
1007 | int ide_pci_set_master(struct pci_dev *, const char *); | 1114 | int ide_pci_set_master(struct pci_dev *, const char *); |
1008 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); | 1115 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); |
1116 | extern const struct ide_dma_ops sff_dma_ops; | ||
1117 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); | ||
1009 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1118 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1010 | #else | 1119 | #else |
1011 | static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | 1120 | static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, |
@@ -1015,10 +1124,6 @@ static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | |||
1015 | } | 1124 | } |
1016 | #endif | 1125 | #endif |
1017 | 1126 | ||
1018 | extern void default_hwif_iops(ide_hwif_t *); | ||
1019 | extern void default_hwif_mmiops(ide_hwif_t *); | ||
1020 | extern void default_hwif_transport(ide_hwif_t *); | ||
1021 | |||
1022 | typedef struct ide_pci_enablebit_s { | 1127 | typedef struct ide_pci_enablebit_s { |
1023 | u8 reg; /* byte pci reg holding the enable-bit */ | 1128 | u8 reg; /* byte pci reg holding the enable-bit */ |
1024 | u8 mask; /* mask to isolate the enable-bit */ | 1129 | u8 mask; /* mask to isolate the enable-bit */ |
@@ -1081,7 +1186,6 @@ enum { | |||
1081 | IDE_HFLAG_IO_32BIT = (1 << 24), | 1186 | IDE_HFLAG_IO_32BIT = (1 << 24), |
1082 | /* unmask IRQs */ | 1187 | /* unmask IRQs */ |
1083 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), | 1188 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), |
1084 | IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), | ||
1085 | /* serialize ports if DMA is possible (for sl82c105) */ | 1189 | /* serialize ports if DMA is possible (for sl82c105) */ |
1086 | IDE_HFLAG_SERIALIZE_DMA = (1 << 27), | 1190 | IDE_HFLAG_SERIALIZE_DMA = (1 << 27), |
1087 | /* force host out of "simplex" mode */ | 1191 | /* force host out of "simplex" mode */ |
@@ -1092,8 +1196,6 @@ enum { | |||
1092 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), | 1196 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), |
1093 | /* never unmask IRQs */ | 1197 | /* never unmask IRQs */ |
1094 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), | 1198 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), |
1095 | /* host uses VDMA (disabled for now) */ | ||
1096 | IDE_HFLAG_VDMA = 0, | ||
1097 | }; | 1199 | }; |
1098 | 1200 | ||
1099 | #ifdef CONFIG_BLK_DEV_OFFBOARD | 1201 | #ifdef CONFIG_BLK_DEV_OFFBOARD |
@@ -1104,12 +1206,13 @@ enum { | |||
1104 | 1206 | ||
1105 | struct ide_port_info { | 1207 | struct ide_port_info { |
1106 | char *name; | 1208 | char *name; |
1107 | unsigned int (*init_chipset)(struct pci_dev *, const char *); | 1209 | unsigned int (*init_chipset)(struct pci_dev *); |
1108 | void (*init_iops)(ide_hwif_t *); | 1210 | void (*init_iops)(ide_hwif_t *); |
1109 | void (*init_hwif)(ide_hwif_t *); | 1211 | void (*init_hwif)(ide_hwif_t *); |
1110 | int (*init_dma)(ide_hwif_t *, | 1212 | int (*init_dma)(ide_hwif_t *, |
1111 | const struct ide_port_info *); | 1213 | const struct ide_port_info *); |
1112 | 1214 | ||
1215 | const struct ide_tp_ops *tp_ops; | ||
1113 | const struct ide_port_ops *port_ops; | 1216 | const struct ide_port_ops *port_ops; |
1114 | const struct ide_dma_ops *dma_ops; | 1217 | const struct ide_dma_ops *dma_ops; |
1115 | 1218 | ||
@@ -1122,8 +1225,10 @@ struct ide_port_info { | |||
1122 | u8 udma_mask; | 1225 | u8 udma_mask; |
1123 | }; | 1226 | }; |
1124 | 1227 | ||
1125 | int ide_setup_pci_device(struct pci_dev *, const struct ide_port_info *); | 1228 | int ide_pci_init_one(struct pci_dev *, const struct ide_port_info *, void *); |
1126 | int ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, const struct ide_port_info *); | 1229 | int ide_pci_init_two(struct pci_dev *, struct pci_dev *, |
1230 | const struct ide_port_info *, void *); | ||
1231 | void ide_pci_remove(struct pci_dev *); | ||
1127 | 1232 | ||
1128 | void ide_map_sg(ide_drive_t *, struct request *); | 1233 | void ide_map_sg(ide_drive_t *, struct request *); |
1129 | void ide_init_sg_cmd(ide_drive_t *, struct request *); | 1234 | void ide_init_sg_cmd(ide_drive_t *, struct request *); |
@@ -1163,7 +1268,6 @@ void ide_destroy_dmatable(ide_drive_t *); | |||
1163 | extern int ide_build_dmatable(ide_drive_t *, struct request *); | 1268 | extern int ide_build_dmatable(ide_drive_t *, struct request *); |
1164 | int ide_allocate_dma_engine(ide_hwif_t *); | 1269 | int ide_allocate_dma_engine(ide_hwif_t *); |
1165 | void ide_release_dma_engine(ide_hwif_t *); | 1270 | void ide_release_dma_engine(ide_hwif_t *); |
1166 | void ide_setup_dma(ide_hwif_t *, unsigned long); | ||
1167 | 1271 | ||
1168 | void ide_dma_host_set(ide_drive_t *, int); | 1272 | void ide_dma_host_set(ide_drive_t *, int); |
1169 | extern int ide_dma_setup(ide_drive_t *); | 1273 | extern int ide_dma_setup(ide_drive_t *); |
@@ -1217,8 +1321,14 @@ void ide_undecoded_slave(ide_drive_t *); | |||
1217 | 1321 | ||
1218 | void ide_port_apply_params(ide_hwif_t *); | 1322 | void ide_port_apply_params(ide_hwif_t *); |
1219 | 1323 | ||
1220 | int ide_device_add_all(u8 *idx, const struct ide_port_info *); | 1324 | struct ide_host *ide_host_alloc_all(const struct ide_port_info *, hw_regs_t **); |
1221 | int ide_device_add(u8 idx[4], const struct ide_port_info *); | 1325 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); |
1326 | void ide_host_free(struct ide_host *); | ||
1327 | int ide_host_register(struct ide_host *, const struct ide_port_info *, | ||
1328 | hw_regs_t **); | ||
1329 | int ide_host_add(const struct ide_port_info *, hw_regs_t **, | ||
1330 | struct ide_host **); | ||
1331 | void ide_host_remove(struct ide_host *); | ||
1222 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); | 1332 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); |
1223 | void ide_port_unregister_devices(ide_hwif_t *); | 1333 | void ide_port_unregister_devices(ide_hwif_t *); |
1224 | void ide_port_scan(ide_hwif_t *); | 1334 | void ide_port_scan(ide_hwif_t *); |
@@ -1350,33 +1460,4 @@ static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | |||
1350 | 1460 | ||
1351 | return &hwif->drives[(drive->dn ^ 1) & 1]; | 1461 | return &hwif->drives[(drive->dn ^ 1) & 1]; |
1352 | } | 1462 | } |
1353 | |||
1354 | static inline void ide_set_irq(ide_drive_t *drive, int on) | ||
1355 | { | ||
1356 | ide_hwif_t *hwif = drive->hwif; | ||
1357 | |||
1358 | hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | (on ? 0 : 2), | ||
1359 | hwif->io_ports.ctl_addr); | ||
1360 | } | ||
1361 | |||
1362 | static inline u8 ide_read_status(ide_drive_t *drive) | ||
1363 | { | ||
1364 | ide_hwif_t *hwif = drive->hwif; | ||
1365 | |||
1366 | return hwif->INB(hwif->io_ports.status_addr); | ||
1367 | } | ||
1368 | |||
1369 | static inline u8 ide_read_altstatus(ide_drive_t *drive) | ||
1370 | { | ||
1371 | ide_hwif_t *hwif = drive->hwif; | ||
1372 | |||
1373 | return hwif->INB(hwif->io_ports.ctl_addr); | ||
1374 | } | ||
1375 | |||
1376 | static inline u8 ide_read_error(ide_drive_t *drive) | ||
1377 | { | ||
1378 | ide_hwif_t *hwif = drive->hwif; | ||
1379 | |||
1380 | return hwif->INB(hwif->io_ports.error_addr); | ||
1381 | } | ||
1382 | #endif /* _IDE_H */ | 1463 | #endif /* _IDE_H */ |