diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-02-23 22:19:00 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-02-23 22:19:00 -0500 |
commit | 0efd5aab41e18a1175f72641696cfda154ba6c87 (patch) | |
tree | 2480b5ade8937d18104c5ecc1423ca1eac1b154e /include/linux/pci.h | |
parent | 5a21d70dbd33d20713fb735ad9381711b0ae2c9b (diff) |
PCI: add struct pci_host_bridge_window with CPU/bus address offset
Some PCI host bridges apply an address offset, so bus addresses on PCI are
different from CPU addresses. This patch adds a way for architectures to
tell the PCI core about this offset. For example:
LIST_HEAD(resources);
pci_add_resource_offset(&resources, host->io_space, host->io_offset);
pci_add_resource_offset(&resources, host->mem_space, host->mem_offset);
pci_scan_root_bus(parent, bus, ops, sysdata, &resources);
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r-- | include/linux/pci.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 2c946b3bbf77..419f78f96375 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -368,9 +368,16 @@ static inline int pci_channel_offline(struct pci_dev *pdev) | |||
368 | return (pdev->error_state != pci_channel_io_normal); | 368 | return (pdev->error_state != pci_channel_io_normal); |
369 | } | 369 | } |
370 | 370 | ||
371 | struct pci_host_bridge_window { | ||
372 | struct list_head list; | ||
373 | struct resource *res; /* host bridge aperture (CPU address) */ | ||
374 | resource_size_t offset; /* bus address + offset = CPU address */ | ||
375 | }; | ||
376 | |||
371 | struct pci_host_bridge { | 377 | struct pci_host_bridge { |
372 | struct list_head list; | 378 | struct list_head list; |
373 | struct pci_bus *bus; /* root bus */ | 379 | struct pci_bus *bus; /* root bus */ |
380 | struct list_head windows; /* pci_host_bridge_windows */ | ||
374 | }; | 381 | }; |
375 | 382 | ||
376 | /* | 383 | /* |
@@ -901,6 +908,8 @@ void pci_release_selected_regions(struct pci_dev *, int); | |||
901 | 908 | ||
902 | /* drivers/pci/bus.c */ | 909 | /* drivers/pci/bus.c */ |
903 | void pci_add_resource(struct list_head *resources, struct resource *res); | 910 | void pci_add_resource(struct list_head *resources, struct resource *res); |
911 | void pci_add_resource_offset(struct list_head *resources, struct resource *res, | ||
912 | resource_size_t offset); | ||
904 | void pci_free_resource_list(struct list_head *resources); | 913 | void pci_free_resource_list(struct list_head *resources); |
905 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); | 914 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); |
906 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); | 915 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); |