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.h39
1 files changed, 34 insertions, 5 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b5238bd18830..8621cf42b46f 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -586,7 +586,7 @@ struct pci_dev {
586#define PCI_NUM_RESOURCES 11 586#define PCI_NUM_RESOURCES 11
587 587
588#ifndef PCI_BUS_NUM_RESOURCES 588#ifndef PCI_BUS_NUM_RESOURCES
589#define PCI_BUS_NUM_RESOURCES 4 589#define PCI_BUS_NUM_RESOURCES 8
590#endif 590#endif
591 591
592#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ 592#define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */
@@ -734,16 +734,20 @@ void pcibios_update_irq(struct pci_dev *, int irq);
734/* Generic PCI functions used internally */ 734/* Generic PCI functions used internally */
735 735
736extern struct pci_bus *pci_find_bus(int domain, int busnr); 736extern struct pci_bus *pci_find_bus(int domain, int busnr);
737void pci_bus_add_devices(struct pci_bus *bus);
737struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata); 738struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
738static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata) 739static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)
739{ 740{
740 return pci_scan_bus_parented(NULL, bus, ops, sysdata); 741 struct pci_bus *root_bus;
742 root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata);
743 if (root_bus)
744 pci_bus_add_devices(root_bus);
745 return root_bus;
741} 746}
742int pci_scan_slot(struct pci_bus *bus, int devfn); 747int pci_scan_slot(struct pci_bus *bus, int devfn);
743struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); 748struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn);
744unsigned int pci_scan_child_bus(struct pci_bus *bus); 749unsigned int pci_scan_child_bus(struct pci_bus *bus);
745void pci_bus_add_device(struct pci_dev *dev); 750void pci_bus_add_device(struct pci_dev *dev);
746void pci_bus_add_devices(struct pci_bus *bus);
747void pci_name_device(struct pci_dev *dev); 751void pci_name_device(struct pci_dev *dev);
748char *pci_class_name(u32 class); 752char *pci_class_name(u32 class);
749void pci_read_bridge_bases(struct pci_bus *child); 753void pci_read_bridge_bases(struct pci_bus *child);
@@ -856,7 +860,8 @@ int pci_register_driver(struct pci_driver *);
856void pci_unregister_driver(struct pci_driver *); 860void pci_unregister_driver(struct pci_driver *);
857void pci_remove_behind_bridge(struct pci_dev *); 861void pci_remove_behind_bridge(struct pci_dev *);
858struct pci_driver *pci_dev_driver(const struct pci_dev *); 862struct pci_driver *pci_dev_driver(const struct pci_dev *);
859const struct pci_device_id *pci_match_device(const struct pci_device_id *ids, const struct pci_dev *dev); 863const struct pci_device_id *pci_match_device(struct pci_driver *drv, struct pci_dev *dev);
864const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, struct pci_dev *dev);
860int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass); 865int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass);
861 866
862/* kmem_cache style wrapper around pci_alloc_consistent() */ 867/* kmem_cache style wrapper around pci_alloc_consistent() */
@@ -870,6 +875,15 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass
870#define pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle) 875#define pci_pool_alloc(pool, flags, handle) dma_pool_alloc(pool, flags, handle)
871#define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr) 876#define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr)
872 877
878enum pci_dma_burst_strategy {
879 PCI_DMA_BURST_INFINITY, /* make bursts as large as possible,
880 strategy_parameter is N/A */
881 PCI_DMA_BURST_BOUNDARY, /* disconnect at every strategy_parameter
882 byte boundaries */
883 PCI_DMA_BURST_MULTIPLE, /* disconnect at some multiple of
884 strategy_parameter byte boundaries */
885};
886
873#if defined(CONFIG_ISA) || defined(CONFIG_EISA) 887#if defined(CONFIG_ISA) || defined(CONFIG_EISA)
874extern struct pci_dev *isa_bridge; 888extern struct pci_dev *isa_bridge;
875#endif 889#endif
@@ -957,6 +971,8 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int en
957 971
958#define isa_bridge ((struct pci_dev *)NULL) 972#define isa_bridge ((struct pci_dev *)NULL)
959 973
974#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
975
960#else 976#else
961 977
962/* 978/*
@@ -971,7 +987,6 @@ static inline int pci_proc_domain(struct pci_bus *bus)
971 return 0; 987 return 0;
972} 988}
973#endif 989#endif
974
975#endif /* !CONFIG_PCI */ 990#endif /* !CONFIG_PCI */
976 991
977/* these helpers provide future and backwards compatibility 992/* these helpers provide future and backwards compatibility
@@ -1016,6 +1031,20 @@ static inline char *pci_name(struct pci_dev *pdev)
1016#define pci_pretty_name(dev) "" 1031#define pci_pretty_name(dev) ""
1017#endif 1032#endif
1018 1033
1034
1035/* Some archs don't want to expose struct resource to userland as-is
1036 * in sysfs and /proc
1037 */
1038#ifndef HAVE_ARCH_PCI_RESOURCE_TO_USER
1039static inline void pci_resource_to_user(const struct pci_dev *dev, int bar,
1040 const struct resource *rsrc, u64 *start, u64 *end)
1041{
1042 *start = rsrc->start;
1043 *end = rsrc->end;
1044}
1045#endif /* HAVE_ARCH_PCI_RESOURCE_TO_USER */
1046
1047
1019/* 1048/*
1020 * The world is not perfect and supplies us with broken PCI devices. 1049 * The world is not perfect and supplies us with broken PCI devices.
1021 * For at least a part of these bugs we need a work-around, so both 1050 * For at least a part of these bugs we need a work-around, so both