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