aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2014-01-10 16:23:15 -0500
committerBjorn Helgaas <bhelgaas@google.com>2014-01-10 16:23:15 -0500
commit96702be560374ee7e7139a34cab03554129abbb4 (patch)
treeede7f763c471fad6d268a2e6a1d17d029b3eaf31 /include/linux/pci.h
parent04f982beb900f37bc216d63c9dbc5bdddb4a3d3a (diff)
parentd56dbf5bab8ce44c5407bb099f71987f58d18bb4 (diff)
Merge branch 'pci/resource' into next
* pci/resource: PCI: Allocate 64-bit BARs above 4G when possible PCI: Enforce bus address limits in resource allocation PCI: Split out bridge window override of minimum allocation address agp/ati: Use PCI_COMMAND instead of hard-coded 4 agp/intel: Use CPU physical address, not bus address, for ioremap() agp/intel: Use pci_bus_address() to get GTTADR bus address agp/intel: Use pci_bus_address() to get MMADR bus address agp/intel: Support 64-bit GMADR agp/intel: Rename gtt_bus_addr to gtt_phys_addr drm/i915: Rename gtt_bus_addr to gtt_phys_addr agp: Use pci_resource_start() to get CPU physical address for BAR agp: Support 64-bit APBASE PCI: Add pci_bus_address() to get bus address of a BAR PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev PCI: Change pci_bus_region addresses to dma_addr_t
Diffstat (limited to 'include/linux/pci.h')
-rw-r--r--include/linux/pci.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b89069839020..f7d1dcc002fa 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -552,8 +552,8 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
552 int reg, int len, u32 val); 552 int reg, int len, u32 val);
553 553
554struct pci_bus_region { 554struct pci_bus_region {
555 resource_size_t start; 555 dma_addr_t start;
556 resource_size_t end; 556 dma_addr_t end;
557}; 557};
558 558
559struct pci_dynids { 559struct pci_dynids {
@@ -737,9 +737,9 @@ void pci_fixup_cardbus(struct pci_bus *);
737 737
738/* Generic PCI functions used internally */ 738/* Generic PCI functions used internally */
739 739
740void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 740void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
741 struct resource *res); 741 struct resource *res);
742void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 742void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
743 struct pci_bus_region *region); 743 struct pci_bus_region *region);
744void pcibios_scan_specific_bus(int busn); 744void pcibios_scan_specific_bus(int busn);
745struct pci_bus *pci_find_bus(int domain, int busnr); 745struct pci_bus *pci_find_bus(int domain, int busnr);
@@ -1089,6 +1089,14 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
1089 resource_size_t), 1089 resource_size_t),
1090 void *alignf_data); 1090 void *alignf_data);
1091 1091
1092static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar)
1093{
1094 struct pci_bus_region region;
1095
1096 pcibios_resource_to_bus(pdev->bus, &region, &pdev->resource[bar]);
1097 return region.start;
1098}
1099
1092/* Proper probing supporting hot-pluggable devices */ 1100/* Proper probing supporting hot-pluggable devices */
1093int __must_check __pci_register_driver(struct pci_driver *, struct module *, 1101int __must_check __pci_register_driver(struct pci_driver *, struct module *,
1094 const char *mod_name); 1102 const char *mod_name);
@@ -1510,10 +1518,6 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1510 1518
1511#include <asm/pci.h> 1519#include <asm/pci.h>
1512 1520
1513#ifndef PCIBIOS_MAX_MEM_32
1514#define PCIBIOS_MAX_MEM_32 (-1)
1515#endif
1516
1517/* these helpers provide future and backwards compatibility 1521/* these helpers provide future and backwards compatibility
1518 * for accessing popular PCI BAR info */ 1522 * for accessing popular PCI BAR info */
1519#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) 1523#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)