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.h51
1 files changed, 31 insertions, 20 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 7cda65b5f798..a16b1df3deff 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -111,7 +111,7 @@ enum {
111 PCI_NUM_RESOURCES, 111 PCI_NUM_RESOURCES,
112 112
113 /* preserve this for compatibility */ 113 /* preserve this for compatibility */
114 DEVICE_COUNT_RESOURCE 114 DEVICE_COUNT_RESOURCE = PCI_NUM_RESOURCES,
115}; 115};
116 116
117typedef int __bitwise pci_power_t; 117typedef int __bitwise pci_power_t;
@@ -308,7 +308,7 @@ struct pci_dev {
308 unsigned int is_added:1; 308 unsigned int is_added:1;
309 unsigned int is_busmaster:1; /* device is busmaster */ 309 unsigned int is_busmaster:1; /* device is busmaster */
310 unsigned int no_msi:1; /* device may not use msi */ 310 unsigned int no_msi:1; /* device may not use msi */
311 unsigned int block_ucfg_access:1; /* userspace config space access is blocked */ 311 unsigned int block_cfg_access:1; /* config space access is blocked */
312 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 312 unsigned int broken_parity_status:1; /* Device generates false positive parity */
313 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */ 313 unsigned int irq_reroute_variant:2; /* device needs IRQ rerouting variant */
314 unsigned int msi_enabled:1; 314 unsigned int msi_enabled:1;
@@ -336,6 +336,7 @@ struct pci_dev {
336 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ 336 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */
337#ifdef CONFIG_PCI_MSI 337#ifdef CONFIG_PCI_MSI
338 struct list_head msi_list; 338 struct list_head msi_list;
339 struct kset *msi_kset;
339#endif 340#endif
340 struct pci_vpd *vpd; 341 struct pci_vpd *vpd;
341#ifdef CONFIG_PCI_ATS 342#ifdef CONFIG_PCI_ATS
@@ -660,17 +661,13 @@ extern struct pci_bus *pci_find_bus(int domain, int busnr);
660void pci_bus_add_devices(const struct pci_bus *bus); 661void pci_bus_add_devices(const struct pci_bus *bus);
661struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, 662struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus,
662 struct pci_ops *ops, void *sysdata); 663 struct pci_ops *ops, void *sysdata);
663static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops, 664struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
664 void *sysdata) 665struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
665{ 666 struct pci_ops *ops, void *sysdata,
666 struct pci_bus *root_bus; 667 struct list_head *resources);
667 root_bus = pci_scan_bus_parented(NULL, bus, ops, sysdata); 668struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus,
668 if (root_bus) 669 struct pci_ops *ops, void *sysdata,
669 pci_bus_add_devices(root_bus); 670 struct list_head *resources);
670 return root_bus;
671}
672struct pci_bus *pci_create_bus(struct device *parent, int bus,
673 struct pci_ops *ops, void *sysdata);
674struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, 671struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
675 int busnr); 672 int busnr);
676void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); 673void pcie_update_link_speed(struct pci_bus *bus, u16 link_status);
@@ -794,8 +791,11 @@ static inline int pci_is_managed(struct pci_dev *pdev)
794} 791}
795 792
796void pci_disable_device(struct pci_dev *dev); 793void pci_disable_device(struct pci_dev *dev);
794
795extern unsigned int pcibios_max_latency;
797void pci_set_master(struct pci_dev *dev); 796void pci_set_master(struct pci_dev *dev);
798void pci_clear_master(struct pci_dev *dev); 797void pci_clear_master(struct pci_dev *dev);
798
799int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); 799int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state);
800int pci_set_cacheline_size(struct pci_dev *dev); 800int pci_set_cacheline_size(struct pci_dev *dev);
801#define HAVE_PCI_SET_MWI 801#define HAVE_PCI_SET_MWI
@@ -803,6 +803,9 @@ int __must_check pci_set_mwi(struct pci_dev *dev);
803int pci_try_set_mwi(struct pci_dev *dev); 803int pci_try_set_mwi(struct pci_dev *dev);
804void pci_clear_mwi(struct pci_dev *dev); 804void pci_clear_mwi(struct pci_dev *dev);
805void pci_intx(struct pci_dev *dev, int enable); 805void pci_intx(struct pci_dev *dev, int enable);
806bool pci_intx_mask_supported(struct pci_dev *dev);
807bool pci_check_and_mask_intx(struct pci_dev *dev);
808bool pci_check_and_unmask_intx(struct pci_dev *dev);
806void pci_msi_off(struct pci_dev *dev); 809void pci_msi_off(struct pci_dev *dev);
807int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 810int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
808int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 811int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
@@ -910,6 +913,8 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *);
910void pci_release_selected_regions(struct pci_dev *, int); 913void pci_release_selected_regions(struct pci_dev *, int);
911 914
912/* drivers/pci/bus.c */ 915/* drivers/pci/bus.c */
916void pci_add_resource(struct list_head *resources, struct resource *res);
917void pci_free_resource_list(struct list_head *resources);
913void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); 918void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags);
914struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); 919struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n);
915void pci_bus_remove_resources(struct pci_bus *bus); 920void pci_bus_remove_resources(struct pci_bus *bus);
@@ -1084,8 +1089,9 @@ int ht_create_irq(struct pci_dev *dev, int idx);
1084void ht_destroy_irq(unsigned int irq); 1089void ht_destroy_irq(unsigned int irq);
1085#endif /* CONFIG_HT_IRQ */ 1090#endif /* CONFIG_HT_IRQ */
1086 1091
1087extern void pci_block_user_cfg_access(struct pci_dev *dev); 1092extern void pci_cfg_access_lock(struct pci_dev *dev);
1088extern void pci_unblock_user_cfg_access(struct pci_dev *dev); 1093extern bool pci_cfg_access_trylock(struct pci_dev *dev);
1094extern void pci_cfg_access_unlock(struct pci_dev *dev);
1089 1095
1090/* 1096/*
1091 * PCI domain support. Sometimes called PCI segment (eg by ACPI), 1097 * PCI domain support. Sometimes called PCI segment (eg by ACPI),
@@ -1282,10 +1288,13 @@ static inline void pci_release_regions(struct pci_dev *dev)
1282 1288
1283#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 1289#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
1284 1290
1285static inline void pci_block_user_cfg_access(struct pci_dev *dev) 1291static inline void pci_block_cfg_access(struct pci_dev *dev)
1286{ } 1292{ }
1287 1293
1288static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) 1294static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
1295{ return 0; }
1296
1297static inline void pci_unblock_cfg_access(struct pci_dev *dev)
1289{ } 1298{ }
1290 1299
1291static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) 1300static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
@@ -1423,10 +1432,10 @@ static inline void pci_fixup_device(enum pci_fixup_pass pass,
1423void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); 1432void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen);
1424void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); 1433void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr);
1425void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); 1434void __iomem * const *pcim_iomap_table(struct pci_dev *pdev);
1426int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); 1435int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name);
1427int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask, 1436int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask,
1428 const char *name); 1437 const char *name);
1429void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask); 1438void pcim_iounmap_regions(struct pci_dev *pdev, int mask);
1430 1439
1431extern int pci_pci_problems; 1440extern int pci_pci_problems;
1432#define PCIPCI_FAIL 1 /* No PCI PCI DMA */ 1441#define PCIPCI_FAIL 1 /* No PCI PCI DMA */
@@ -1445,8 +1454,10 @@ extern u8 pci_cache_line_size;
1445extern unsigned long pci_hotplug_io_size; 1454extern unsigned long pci_hotplug_io_size;
1446extern unsigned long pci_hotplug_mem_size; 1455extern unsigned long pci_hotplug_mem_size;
1447 1456
1457/* Architecture specific versions may override these (weak) */
1448int pcibios_add_platform_entries(struct pci_dev *dev); 1458int pcibios_add_platform_entries(struct pci_dev *dev);
1449void pcibios_disable_device(struct pci_dev *dev); 1459void pcibios_disable_device(struct pci_dev *dev);
1460void pcibios_set_master(struct pci_dev *dev);
1450int pcibios_set_pcie_reset_state(struct pci_dev *dev, 1461int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1451 enum pcie_reset_state state); 1462 enum pcie_reset_state state);
1452 1463