summaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-02-23 20:19:00 -0700
committerBjorn Helgaas <bhelgaas@google.com>2012-02-23 20:19:00 -0700
commit0efd5aab41e18a1175f72641696cfda154ba6c87 (patch)
tree2480b5ade8937d18104c5ecc1423ca1eac1b154e /include/linux/pci.h
parent5a21d70dbd33d20713fb735ad9381711b0ae2c9b (diff)
downloadop-kernel-dev-0efd5aab41e18a1175f72641696cfda154ba6c87.zip
op-kernel-dev-0efd5aab41e18a1175f72641696cfda154ba6c87.tar.gz
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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 2c946b3..419f78f 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)
return (pdev->error_state != pci_channel_io_normal);
}
+struct pci_host_bridge_window {
+ struct list_head list;
+ struct resource *res; /* host bridge aperture (CPU address) */
+ resource_size_t offset; /* bus address + offset = CPU address */
+};
+
struct pci_host_bridge {
struct list_head list;
struct pci_bus *bus; /* root bus */
+ struct list_head windows; /* pci_host_bridge_windows */
};
/*
@@ -901,6 +908,8 @@ void pci_release_selected_regions(struct pci_dev *, int);
/* drivers/pci/bus.c */
void pci_add_resource(struct list_head *resources, struct resource *res);
+void pci_add_resource_offset(struct list_head *resources, struct resource *res,
+ resource_size_t offset);
void pci_free_resource_list(struct list_head *resources);
void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags);
struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n);
OpenPOWER on IntegriCloud