diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:57 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:57 -0400 |
commit | 48c3c1072651922ed153bcf0a33ea82cf20df390 (patch) | |
tree | 92ad23e3869e70731eca99394c08a3bf06b8753e /include/linux/ide.h | |
parent | 374e042c3e767ac2e5a40b78529220e0b3de793c (diff) |
ide: add struct ide_host (take 3)
* Add struct ide_host which keeps pointers to host's ports.
* Add ide_host_alloc[_all]() and ide_host_remove() helpers.
* Pass 'struct ide_host *host' instead of 'u8 *idx' to
ide_device_add[_all]() and rename it to ide_host_register[_all]().
* Convert host drivers and core code to use struct ide_host.
* Remove no longer needed ide_find_port().
* Make ide_find_port_slot() static.
* Unexport ide_unregister().
v2:
* Add missing 'struct ide_host *host' to macide.c.
v3:
* Fix build problem in pmac.c (s/ide_alloc_host/ide_host_alloc/)
(Noticed by Stephen Rothwell).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 1286a2275efb..a41ae57fafc5 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -558,6 +558,11 @@ typedef struct hwif_s { | |||
558 | #endif | 558 | #endif |
559 | } ____cacheline_internodealigned_in_smp ide_hwif_t; | 559 | } ____cacheline_internodealigned_in_smp ide_hwif_t; |
560 | 560 | ||
561 | struct ide_host { | ||
562 | ide_hwif_t *ports[MAX_HWIFS]; | ||
563 | unsigned int n_ports; | ||
564 | }; | ||
565 | |||
561 | /* | 566 | /* |
562 | * internal ide interrupt handler type | 567 | * internal ide interrupt handler type |
563 | */ | 568 | */ |
@@ -813,13 +818,6 @@ int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsig | |||
813 | extern int ide_vlb_clk; | 818 | extern int ide_vlb_clk; |
814 | extern int ide_pci_clk; | 819 | extern int ide_pci_clk; |
815 | 820 | ||
816 | ide_hwif_t *ide_find_port_slot(const struct ide_port_info *); | ||
817 | |||
818 | static inline ide_hwif_t *ide_find_port(void) | ||
819 | { | ||
820 | return ide_find_port_slot(NULL); | ||
821 | } | ||
822 | |||
823 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); | 821 | extern int ide_end_request (ide_drive_t *drive, int uptodate, int nrsecs); |
824 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, | 822 | int ide_end_dequeued_request(ide_drive_t *drive, struct request *rq, |
825 | int uptodate, int nr_sectors); | 823 | int uptodate, int nr_sectors); |
@@ -1024,7 +1022,7 @@ extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *o | |||
1024 | #endif | 1022 | #endif |
1025 | 1023 | ||
1026 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, | 1024 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, int, |
1027 | u8 *, hw_regs_t *, hw_regs_t **); | 1025 | hw_regs_t *, hw_regs_t **); |
1028 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1026 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1029 | 1027 | ||
1030 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1028 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1236,8 +1234,11 @@ void ide_undecoded_slave(ide_drive_t *); | |||
1236 | 1234 | ||
1237 | void ide_port_apply_params(ide_hwif_t *); | 1235 | void ide_port_apply_params(ide_hwif_t *); |
1238 | 1236 | ||
1239 | int ide_device_add_all(u8 *, const struct ide_port_info *, hw_regs_t **); | 1237 | struct ide_host *ide_host_alloc_all(const struct ide_port_info *, hw_regs_t **); |
1240 | int ide_device_add(u8 *, const struct ide_port_info *, hw_regs_t **); | 1238 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); |
1239 | int ide_host_register(struct ide_host *, const struct ide_port_info *, | ||
1240 | hw_regs_t **); | ||
1241 | void ide_host_remove(struct ide_host *); | ||
1241 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); | 1242 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); |
1242 | void ide_port_unregister_devices(ide_hwif_t *); | 1243 | void ide_port_unregister_devices(ide_hwif_t *); |
1243 | void ide_port_scan(ide_hwif_t *); | 1244 | void ide_port_scan(ide_hwif_t *); |