diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-15 12:15:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-15 12:15:17 -0400 |
commit | f3efbe582b5396d134024c03a5fa253f2a85d9a6 (patch) | |
tree | e4e15b7567b82d24cb1e7327398286a2b88df04c /include/linux/ide.h | |
parent | 05d3ed0a1fe3ea05ab9f3b8d32576a0bc2e19660 (diff) | |
parent | b635acec48bcaa9183fcbf4e3955616b0d4119b5 (diff) |
Merge branch 'linus' into x86/gart
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 247 |
1 files changed, 163 insertions, 84 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 4726126f5a59..87c12ed96954 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,13 +211,16 @@ 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> |
214 | 218 | #else | |
215 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) | 219 | #include <asm-generic/ide_iops.h> |
216 | #undef MAX_HWIFS | ||
217 | #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS | ||
218 | #endif | 220 | #endif |
219 | 221 | ||
222 | #define MAX_HWIFS 10 | ||
223 | |||
220 | /* Currently only m68k, apus and m8xx need it */ | 224 | /* Currently only m68k, apus and m8xx need it */ |
221 | #ifndef IDE_ARCH_ACK_INTR | 225 | #ifndef IDE_ARCH_ACK_INTR |
222 | # define ide_ack_intr(hwif) (1) | 226 | # define ide_ack_intr(hwif) (1) |
@@ -307,7 +311,65 @@ struct ide_acpi_drive_link; | |||
307 | struct ide_acpi_hwif_link; | 311 | struct ide_acpi_hwif_link; |
308 | #endif | 312 | #endif |
309 | 313 | ||
310 | typedef struct ide_drive_s { | 314 | /* ATAPI device flags */ |
315 | enum { | ||
316 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), | ||
317 | IDE_AFLAG_MEDIA_CHANGED = (1 << 1), | ||
318 | |||
319 | /* ide-cd */ | ||
320 | /* Drive cannot lock the door. */ | ||
321 | IDE_AFLAG_NO_DOORLOCK = (1 << 2), | ||
322 | /* Drive cannot eject the disc. */ | ||
323 | IDE_AFLAG_NO_EJECT = (1 << 3), | ||
324 | /* Drive is a pre ATAPI 1.2 drive. */ | ||
325 | IDE_AFLAG_PRE_ATAPI12 = (1 << 4), | ||
326 | /* TOC addresses are in BCD. */ | ||
327 | IDE_AFLAG_TOCADDR_AS_BCD = (1 << 5), | ||
328 | /* TOC track numbers are in BCD. */ | ||
329 | IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 6), | ||
330 | /* | ||
331 | * Drive does not provide data in multiples of SECTOR_SIZE | ||
332 | * when more than one interrupt is needed. | ||
333 | */ | ||
334 | IDE_AFLAG_LIMIT_NFRAMES = (1 << 7), | ||
335 | /* Seeking in progress. */ | ||
336 | IDE_AFLAG_SEEKING = (1 << 8), | ||
337 | /* Saved TOC information is current. */ | ||
338 | IDE_AFLAG_TOC_VALID = (1 << 9), | ||
339 | /* We think that the drive door is locked. */ | ||
340 | IDE_AFLAG_DOOR_LOCKED = (1 << 10), | ||
341 | /* SET_CD_SPEED command is unsupported. */ | ||
342 | IDE_AFLAG_NO_SPEED_SELECT = (1 << 11), | ||
343 | IDE_AFLAG_VERTOS_300_SSD = (1 << 12), | ||
344 | IDE_AFLAG_VERTOS_600_ESD = (1 << 13), | ||
345 | IDE_AFLAG_SANYO_3CD = (1 << 14), | ||
346 | IDE_AFLAG_FULL_CAPS_PAGE = (1 << 15), | ||
347 | IDE_AFLAG_PLAY_AUDIO_OK = (1 << 16), | ||
348 | IDE_AFLAG_LE_SPEED_FIELDS = (1 << 17), | ||
349 | |||
350 | /* ide-floppy */ | ||
351 | /* Format in progress */ | ||
352 | IDE_AFLAG_FORMAT_IN_PROGRESS = (1 << 18), | ||
353 | /* Avoid commands not supported in Clik drive */ | ||
354 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), | ||
355 | /* Requires BH algorithm for packets */ | ||
356 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), | ||
357 | |||
358 | /* ide-tape */ | ||
359 | IDE_AFLAG_IGNORE_DSC = (1 << 21), | ||
360 | /* 0 When the tape position is unknown */ | ||
361 | IDE_AFLAG_ADDRESS_VALID = (1 << 22), | ||
362 | /* Device already opened */ | ||
363 | IDE_AFLAG_BUSY = (1 << 23), | ||
364 | /* Attempt to auto-detect the current user block size */ | ||
365 | IDE_AFLAG_DETECT_BS = (1 << 24), | ||
366 | /* Currently on a filemark */ | ||
367 | IDE_AFLAG_FILEMARK = (1 << 25), | ||
368 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ | ||
369 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) | ||
370 | }; | ||
371 | |||
372 | struct ide_drive_s { | ||
311 | char name[4]; /* drive name, such as "hda" */ | 373 | char name[4]; /* drive name, such as "hda" */ |
312 | char driver_req[10]; /* requests specific driver */ | 374 | char driver_req[10]; /* requests specific driver */ |
313 | 375 | ||
@@ -355,7 +417,6 @@ typedef struct ide_drive_s { | |||
355 | unsigned nodma : 1; /* disallow DMA */ | 417 | unsigned nodma : 1; /* disallow DMA */ |
356 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | 418 | 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 */ | 419 | 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 */ | 420 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ |
360 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | 421 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ |
361 | unsigned post_reset : 1; | 422 | unsigned post_reset : 1; |
@@ -400,7 +461,14 @@ typedef struct ide_drive_s { | |||
400 | struct list_head list; | 461 | struct list_head list; |
401 | struct device gendev; | 462 | struct device gendev; |
402 | struct completion gendev_rel_comp; /* to deal with device release() */ | 463 | struct completion gendev_rel_comp; /* to deal with device release() */ |
403 | } ide_drive_t; | 464 | |
465 | /* callback for packet commands */ | ||
466 | void (*pc_callback)(struct ide_drive_s *); | ||
467 | |||
468 | unsigned long atapi_flags; | ||
469 | }; | ||
470 | |||
471 | typedef struct ide_drive_s ide_drive_t; | ||
404 | 472 | ||
405 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) | 473 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) |
406 | 474 | ||
@@ -408,26 +476,55 @@ typedef struct ide_drive_s { | |||
408 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) | 476 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) |
409 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) | 477 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) |
410 | 478 | ||
479 | struct ide_task_s; | ||
411 | struct ide_port_info; | 480 | struct ide_port_info; |
412 | 481 | ||
482 | struct ide_tp_ops { | ||
483 | void (*exec_command)(struct hwif_s *, u8); | ||
484 | u8 (*read_status)(struct hwif_s *); | ||
485 | u8 (*read_altstatus)(struct hwif_s *); | ||
486 | u8 (*read_sff_dma_status)(struct hwif_s *); | ||
487 | |||
488 | void (*set_irq)(struct hwif_s *, int); | ||
489 | |||
490 | void (*tf_load)(ide_drive_t *, struct ide_task_s *); | ||
491 | void (*tf_read)(ide_drive_t *, struct ide_task_s *); | ||
492 | |||
493 | void (*input_data)(ide_drive_t *, struct request *, void *, | ||
494 | unsigned int); | ||
495 | void (*output_data)(ide_drive_t *, struct request *, void *, | ||
496 | unsigned int); | ||
497 | }; | ||
498 | |||
499 | extern const struct ide_tp_ops default_tp_ops; | ||
500 | |||
501 | /** | ||
502 | * struct ide_port_ops - IDE port operations | ||
503 | * | ||
504 | * @init_dev: host specific initialization of a device | ||
505 | * @set_pio_mode: routine to program host for PIO mode | ||
506 | * @set_dma_mode: routine to program host for DMA mode | ||
507 | * @selectproc: tweaks hardware to select drive | ||
508 | * @reset_poll: chipset polling based on hba specifics | ||
509 | * @pre_reset: chipset specific changes to default for device-hba resets | ||
510 | * @resetproc: routine to reset controller after a disk reset | ||
511 | * @maskproc: special host masking for drive selection | ||
512 | * @quirkproc: check host's drive quirk list | ||
513 | * | ||
514 | * @mdma_filter: filter MDMA modes | ||
515 | * @udma_filter: filter UDMA modes | ||
516 | * | ||
517 | * @cable_detect: detect cable type | ||
518 | */ | ||
413 | struct ide_port_ops { | 519 | struct ide_port_ops { |
414 | /* host specific initialization of a device */ | ||
415 | void (*init_dev)(ide_drive_t *); | 520 | void (*init_dev)(ide_drive_t *); |
416 | /* routine to program host for PIO mode */ | ||
417 | void (*set_pio_mode)(ide_drive_t *, const u8); | 521 | void (*set_pio_mode)(ide_drive_t *, const u8); |
418 | /* routine to program host for DMA mode */ | ||
419 | void (*set_dma_mode)(ide_drive_t *, const u8); | 522 | void (*set_dma_mode)(ide_drive_t *, const u8); |
420 | /* tweaks hardware to select drive */ | ||
421 | void (*selectproc)(ide_drive_t *); | 523 | void (*selectproc)(ide_drive_t *); |
422 | /* chipset polling based on hba specifics */ | ||
423 | int (*reset_poll)(ide_drive_t *); | 524 | int (*reset_poll)(ide_drive_t *); |
424 | /* chipset specific changes to default for device-hba resets */ | ||
425 | void (*pre_reset)(ide_drive_t *); | 525 | void (*pre_reset)(ide_drive_t *); |
426 | /* routine to reset controller after a disk reset */ | ||
427 | void (*resetproc)(ide_drive_t *); | 526 | void (*resetproc)(ide_drive_t *); |
428 | /* special host masking for drive selection */ | ||
429 | void (*maskproc)(ide_drive_t *, int); | 527 | void (*maskproc)(ide_drive_t *, int); |
430 | /* check host's drive quirk list */ | ||
431 | void (*quirkproc)(ide_drive_t *); | 528 | void (*quirkproc)(ide_drive_t *); |
432 | 529 | ||
433 | u8 (*mdma_filter)(ide_drive_t *); | 530 | u8 (*mdma_filter)(ide_drive_t *); |
@@ -447,7 +544,7 @@ struct ide_dma_ops { | |||
447 | void (*dma_timeout)(struct ide_drive_s *); | 544 | void (*dma_timeout)(struct ide_drive_s *); |
448 | }; | 545 | }; |
449 | 546 | ||
450 | struct ide_task_s; | 547 | struct ide_host; |
451 | 548 | ||
452 | typedef struct hwif_s { | 549 | typedef struct hwif_s { |
453 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ | 550 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ |
@@ -455,6 +552,8 @@ typedef struct hwif_s { | |||
455 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ | 552 | struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ |
456 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 553 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
457 | 554 | ||
555 | struct ide_host *host; | ||
556 | |||
458 | char name[6]; /* name of interface, eg. "ide0" */ | 557 | char name[6]; /* name of interface, eg. "ide0" */ |
459 | 558 | ||
460 | struct ide_io_ports io_ports; | 559 | struct ide_io_ports io_ports; |
@@ -486,22 +585,12 @@ typedef struct hwif_s { | |||
486 | 585 | ||
487 | void (*rw_disk)(ide_drive_t *, struct request *); | 586 | void (*rw_disk)(ide_drive_t *, struct request *); |
488 | 587 | ||
588 | const struct ide_tp_ops *tp_ops; | ||
489 | const struct ide_port_ops *port_ops; | 589 | const struct ide_port_ops *port_ops; |
490 | const struct ide_dma_ops *dma_ops; | 590 | const struct ide_dma_ops *dma_ops; |
491 | 591 | ||
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); | 592 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
499 | 593 | ||
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) */ | 594 | /* dma physical region descriptor table (cpu view) */ |
506 | unsigned int *dmatable_cpu; | 595 | unsigned int *dmatable_cpu; |
507 | /* dma physical region descriptor table (dma view) */ | 596 | /* dma physical region descriptor table (dma view) */ |
@@ -524,8 +613,6 @@ typedef struct hwif_s { | |||
524 | int irq; /* our irq number */ | 613 | int irq; /* our irq number */ |
525 | 614 | ||
526 | unsigned long dma_base; /* base addr for dma ports */ | 615 | 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 | 616 | ||
530 | unsigned long config_data; /* for use by chipset-specific code */ | 617 | unsigned long config_data; /* for use by chipset-specific code */ |
531 | unsigned long select_data; /* for use by chipset-specific code */ | 618 | unsigned long select_data; /* for use by chipset-specific code */ |
@@ -552,6 +639,14 @@ typedef struct hwif_s { | |||
552 | #endif | 639 | #endif |
553 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 640 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
554 | 641 | ||
642 | struct ide_host { | ||
643 | ide_hwif_t *ports[MAX_HWIFS]; | ||
644 | unsigned int n_ports; | ||
645 | struct device *dev[2]; | ||
646 | unsigned long host_flags; | ||
647 | void *host_priv; | ||
648 | }; | ||
649 | |||
555 | /* | 650 | /* |
556 | * internal ide interrupt handler type | 651 | * internal ide interrupt handler type |
557 | */ | 652 | */ |
@@ -611,8 +706,6 @@ enum { | |||
611 | PC_FLAG_WRITING = (1 << 6), | 706 | PC_FLAG_WRITING = (1 << 6), |
612 | /* command timed out */ | 707 | /* command timed out */ |
613 | PC_FLAG_TIMEDOUT = (1 << 7), | 708 | PC_FLAG_TIMEDOUT = (1 << 7), |
614 | PC_FLAG_ZIP_DRIVE = (1 << 8), | ||
615 | PC_FLAG_DRQ_INTERRUPT = (1 << 9), | ||
616 | }; | 709 | }; |
617 | 710 | ||
618 | struct ide_atapi_pc { | 711 | struct ide_atapi_pc { |
@@ -646,8 +739,6 @@ struct ide_atapi_pc { | |||
646 | */ | 739 | */ |
647 | u8 pc_buf[256]; | 740 | u8 pc_buf[256]; |
648 | 741 | ||
649 | void (*callback)(ide_drive_t *); | ||
650 | |||
651 | /* idetape only */ | 742 | /* idetape only */ |
652 | struct idetape_bh *bh; | 743 | struct idetape_bh *bh; |
653 | char *b_data; | 744 | char *b_data; |
@@ -802,18 +893,14 @@ struct ide_driver_s { | |||
802 | 893 | ||
803 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) | 894 | #define to_ide_driver(drv) container_of(drv, ide_driver_t, gen_driver) |
804 | 895 | ||
896 | int ide_device_get(ide_drive_t *); | ||
897 | void ide_device_put(ide_drive_t *); | ||
898 | |||
805 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 899 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); |
806 | 900 | ||
807 | extern int ide_vlb_clk; | 901 | extern int ide_vlb_clk; |
808 | extern int ide_pci_clk; | 902 | extern int ide_pci_clk; |
809 | 903 | ||
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); | 904 | 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, | 905 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, |
819 | int uptodate, int nr_sectors); | 906 | int uptodate, int nr_sectors); |
@@ -884,6 +971,7 @@ enum { | |||
884 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | | 971 | IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | |
885 | IDE_TFLAG_IN_HOB_NSECT | | 972 | IDE_TFLAG_IN_HOB_NSECT | |
886 | IDE_TFLAG_IN_HOB_LBA, | 973 | IDE_TFLAG_IN_HOB_LBA, |
974 | IDE_TFLAG_IN_FEATURE = (1 << 1), | ||
887 | IDE_TFLAG_IN_NSECT = (1 << 25), | 975 | IDE_TFLAG_IN_NSECT = (1 << 25), |
888 | IDE_TFLAG_IN_LBAL = (1 << 26), | 976 | IDE_TFLAG_IN_LBAL = (1 << 26), |
889 | IDE_TFLAG_IN_LBAM = (1 << 27), | 977 | IDE_TFLAG_IN_LBAM = (1 << 27), |
@@ -948,9 +1036,25 @@ typedef struct ide_task_s { | |||
948 | 1036 | ||
949 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1037 | void ide_tf_dump(const char *, struct ide_taskfile *); |
950 | 1038 | ||
1039 | void ide_exec_command(ide_hwif_t *, u8); | ||
1040 | u8 ide_read_status(ide_hwif_t *); | ||
1041 | u8 ide_read_altstatus(ide_hwif_t *); | ||
1042 | u8 ide_read_sff_dma_status(ide_hwif_t *); | ||
1043 | |||
1044 | void ide_set_irq(ide_hwif_t *, int); | ||
1045 | |||
1046 | void ide_tf_load(ide_drive_t *, ide_task_t *); | ||
1047 | void ide_tf_read(ide_drive_t *, ide_task_t *); | ||
1048 | |||
1049 | void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); | ||
1050 | void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); | ||
1051 | |||
951 | extern void SELECT_DRIVE(ide_drive_t *); | 1052 | extern void SELECT_DRIVE(ide_drive_t *); |
952 | void SELECT_MASK(ide_drive_t *, int); | 1053 | void SELECT_MASK(ide_drive_t *, int); |
953 | 1054 | ||
1055 | u8 ide_read_error(ide_drive_t *); | ||
1056 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); | ||
1057 | |||
954 | extern int drive_is_ready(ide_drive_t *); | 1058 | extern int drive_is_ready(ide_drive_t *); |
955 | 1059 | ||
956 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | 1060 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); |
@@ -1000,12 +1104,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) | 1104 | #define ide_pci_register_driver(d) pci_register_driver(d) |
1001 | #endif | 1105 | #endif |
1002 | 1106 | ||
1003 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, u8 *); | 1107 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, |
1108 | hw_regs_t *, hw_regs_t **); | ||
1004 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1109 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1005 | 1110 | ||
1006 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1111 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
1007 | int ide_pci_set_master(struct pci_dev *, const char *); | 1112 | 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 *); | 1113 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); |
1114 | extern const struct ide_dma_ops sff_dma_ops; | ||
1115 | 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 *); | 1116 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1010 | #else | 1117 | #else |
1011 | static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | 1118 | static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, |
@@ -1015,10 +1122,6 @@ static inline int ide_hwif_setup_dma(ide_hwif_t *hwif, | |||
1015 | } | 1122 | } |
1016 | #endif | 1123 | #endif |
1017 | 1124 | ||
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 { | 1125 | typedef struct ide_pci_enablebit_s { |
1023 | u8 reg; /* byte pci reg holding the enable-bit */ | 1126 | u8 reg; /* byte pci reg holding the enable-bit */ |
1024 | u8 mask; /* mask to isolate the enable-bit */ | 1127 | u8 mask; /* mask to isolate the enable-bit */ |
@@ -1081,7 +1184,6 @@ enum { | |||
1081 | IDE_HFLAG_IO_32BIT = (1 << 24), | 1184 | IDE_HFLAG_IO_32BIT = (1 << 24), |
1082 | /* unmask IRQs */ | 1185 | /* unmask IRQs */ |
1083 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), | 1186 | IDE_HFLAG_UNMASK_IRQS = (1 << 25), |
1084 | IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), | ||
1085 | /* serialize ports if DMA is possible (for sl82c105) */ | 1187 | /* serialize ports if DMA is possible (for sl82c105) */ |
1086 | IDE_HFLAG_SERIALIZE_DMA = (1 << 27), | 1188 | IDE_HFLAG_SERIALIZE_DMA = (1 << 27), |
1087 | /* force host out of "simplex" mode */ | 1189 | /* force host out of "simplex" mode */ |
@@ -1092,8 +1194,6 @@ enum { | |||
1092 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), | 1194 | IDE_HFLAG_NO_IO_32BIT = (1 << 30), |
1093 | /* never unmask IRQs */ | 1195 | /* never unmask IRQs */ |
1094 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), | 1196 | IDE_HFLAG_NO_UNMASK_IRQS = (1 << 31), |
1095 | /* host uses VDMA (disabled for now) */ | ||
1096 | IDE_HFLAG_VDMA = 0, | ||
1097 | }; | 1197 | }; |
1098 | 1198 | ||
1099 | #ifdef CONFIG_BLK_DEV_OFFBOARD | 1199 | #ifdef CONFIG_BLK_DEV_OFFBOARD |
@@ -1104,12 +1204,13 @@ enum { | |||
1104 | 1204 | ||
1105 | struct ide_port_info { | 1205 | struct ide_port_info { |
1106 | char *name; | 1206 | char *name; |
1107 | unsigned int (*init_chipset)(struct pci_dev *, const char *); | 1207 | unsigned int (*init_chipset)(struct pci_dev *); |
1108 | void (*init_iops)(ide_hwif_t *); | 1208 | void (*init_iops)(ide_hwif_t *); |
1109 | void (*init_hwif)(ide_hwif_t *); | 1209 | void (*init_hwif)(ide_hwif_t *); |
1110 | int (*init_dma)(ide_hwif_t *, | 1210 | int (*init_dma)(ide_hwif_t *, |
1111 | const struct ide_port_info *); | 1211 | const struct ide_port_info *); |
1112 | 1212 | ||
1213 | const struct ide_tp_ops *tp_ops; | ||
1113 | const struct ide_port_ops *port_ops; | 1214 | const struct ide_port_ops *port_ops; |
1114 | const struct ide_dma_ops *dma_ops; | 1215 | const struct ide_dma_ops *dma_ops; |
1115 | 1216 | ||
@@ -1122,8 +1223,10 @@ struct ide_port_info { | |||
1122 | u8 udma_mask; | 1223 | u8 udma_mask; |
1123 | }; | 1224 | }; |
1124 | 1225 | ||
1125 | int ide_setup_pci_device(struct pci_dev *, const struct ide_port_info *); | 1226 | 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 *); | 1227 | int ide_pci_init_two(struct pci_dev *, struct pci_dev *, |
1228 | const struct ide_port_info *, void *); | ||
1229 | void ide_pci_remove(struct pci_dev *); | ||
1127 | 1230 | ||
1128 | void ide_map_sg(ide_drive_t *, struct request *); | 1231 | void ide_map_sg(ide_drive_t *, struct request *); |
1129 | void ide_init_sg_cmd(ide_drive_t *, struct request *); | 1232 | void ide_init_sg_cmd(ide_drive_t *, struct request *); |
@@ -1163,7 +1266,6 @@ void ide_destroy_dmatable(ide_drive_t *); | |||
1163 | extern int ide_build_dmatable(ide_drive_t *, struct request *); | 1266 | extern int ide_build_dmatable(ide_drive_t *, struct request *); |
1164 | int ide_allocate_dma_engine(ide_hwif_t *); | 1267 | int ide_allocate_dma_engine(ide_hwif_t *); |
1165 | void ide_release_dma_engine(ide_hwif_t *); | 1268 | void ide_release_dma_engine(ide_hwif_t *); |
1166 | void ide_setup_dma(ide_hwif_t *, unsigned long); | ||
1167 | 1269 | ||
1168 | void ide_dma_host_set(ide_drive_t *, int); | 1270 | void ide_dma_host_set(ide_drive_t *, int); |
1169 | extern int ide_dma_setup(ide_drive_t *); | 1271 | extern int ide_dma_setup(ide_drive_t *); |
@@ -1217,8 +1319,14 @@ void ide_undecoded_slave(ide_drive_t *); | |||
1217 | 1319 | ||
1218 | void ide_port_apply_params(ide_hwif_t *); | 1320 | void ide_port_apply_params(ide_hwif_t *); |
1219 | 1321 | ||
1220 | int ide_device_add_all(u8 *idx, const struct ide_port_info *); | 1322 | 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 *); | 1323 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); |
1324 | void ide_host_free(struct ide_host *); | ||
1325 | int ide_host_register(struct ide_host *, const struct ide_port_info *, | ||
1326 | hw_regs_t **); | ||
1327 | int ide_host_add(const struct ide_port_info *, hw_regs_t **, | ||
1328 | struct ide_host **); | ||
1329 | void ide_host_remove(struct ide_host *); | ||
1222 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); | 1330 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); |
1223 | void ide_port_unregister_devices(ide_hwif_t *); | 1331 | void ide_port_unregister_devices(ide_hwif_t *); |
1224 | void ide_port_scan(ide_hwif_t *); | 1332 | void ide_port_scan(ide_hwif_t *); |
@@ -1350,33 +1458,4 @@ static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | |||
1350 | 1458 | ||
1351 | return &hwif->drives[(drive->dn ^ 1) & 1]; | 1459 | return &hwif->drives[(drive->dn ^ 1) & 1]; |
1352 | } | 1460 | } |
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 */ | 1461 | #endif /* _IDE_H */ |