diff options
Diffstat (limited to 'include/linux/pci.h')
| -rw-r--r-- | include/linux/pci.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index b5238bd18830..66798b46f308 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -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 | ||
| 736 | extern struct pci_bus *pci_find_bus(int domain, int busnr); | 736 | extern struct pci_bus *pci_find_bus(int domain, int busnr); |
| 737 | void pci_bus_add_devices(struct pci_bus *bus); | ||
| 737 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata); | 738 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata); |
| 738 | static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata) | 739 | static 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 | } |
| 742 | int pci_scan_slot(struct pci_bus *bus, int devfn); | 747 | int pci_scan_slot(struct pci_bus *bus, int devfn); |
| 743 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); | 748 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); |
| 744 | unsigned int pci_scan_child_bus(struct pci_bus *bus); | 749 | unsigned int pci_scan_child_bus(struct pci_bus *bus); |
| 745 | void pci_bus_add_device(struct pci_dev *dev); | 750 | void pci_bus_add_device(struct pci_dev *dev); |
| 746 | void pci_bus_add_devices(struct pci_bus *bus); | ||
| 747 | void pci_name_device(struct pci_dev *dev); | 751 | void pci_name_device(struct pci_dev *dev); |
| 748 | char *pci_class_name(u32 class); | 752 | char *pci_class_name(u32 class); |
| 749 | void pci_read_bridge_bases(struct pci_bus *child); | 753 | void pci_read_bridge_bases(struct pci_bus *child); |
| @@ -870,6 +874,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) | 874 | #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) | 875 | #define pci_pool_free(pool, vaddr, addr) dma_pool_free(pool, vaddr, addr) |
| 872 | 876 | ||
| 877 | enum pci_dma_burst_strategy { | ||
| 878 | PCI_DMA_BURST_INFINITY, /* make bursts as large as possible, | ||
| 879 | strategy_parameter is N/A */ | ||
| 880 | PCI_DMA_BURST_BOUNDARY, /* disconnect at every strategy_parameter | ||
| 881 | byte boundaries */ | ||
| 882 | PCI_DMA_BURST_MULTIPLE, /* disconnect at some multiple of | ||
| 883 | strategy_parameter byte boundaries */ | ||
| 884 | }; | ||
| 885 | |||
| 873 | #if defined(CONFIG_ISA) || defined(CONFIG_EISA) | 886 | #if defined(CONFIG_ISA) || defined(CONFIG_EISA) |
| 874 | extern struct pci_dev *isa_bridge; | 887 | extern struct pci_dev *isa_bridge; |
| 875 | #endif | 888 | #endif |
| @@ -972,6 +985,8 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
| 972 | } | 985 | } |
| 973 | #endif | 986 | #endif |
| 974 | 987 | ||
| 988 | #define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) | ||
| 989 | |||
| 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 | ||
| 1039 | static 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 |
