aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pci.h
diff options
context:
space:
mode:
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)