diff options
Diffstat (limited to 'include/linux/pci.h')
| -rw-r--r-- | include/linux/pci.h | 51 |
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 | ||
| 117 | typedef int __bitwise pci_power_t; | 117 | typedef 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); | |||
| 660 | void pci_bus_add_devices(const struct pci_bus *bus); | 661 | void pci_bus_add_devices(const struct pci_bus *bus); |
| 661 | struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, | 662 | struct 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); |
| 663 | static inline struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops, | 664 | struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata); |
| 664 | void *sysdata) | 665 | struct 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); | 668 | struct 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 | } | ||
| 672 | struct pci_bus *pci_create_bus(struct device *parent, int bus, | ||
| 673 | struct pci_ops *ops, void *sysdata); | ||
| 674 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | 671 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, |
| 675 | int busnr); | 672 | int busnr); |
| 676 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); | 673 | void 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 | ||
| 796 | void pci_disable_device(struct pci_dev *dev); | 793 | void pci_disable_device(struct pci_dev *dev); |
| 794 | |||
| 795 | extern unsigned int pcibios_max_latency; | ||
| 797 | void pci_set_master(struct pci_dev *dev); | 796 | void pci_set_master(struct pci_dev *dev); |
| 798 | void pci_clear_master(struct pci_dev *dev); | 797 | void pci_clear_master(struct pci_dev *dev); |
| 798 | |||
| 799 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 799 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
| 800 | int pci_set_cacheline_size(struct pci_dev *dev); | 800 | int 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); | |||
| 803 | int pci_try_set_mwi(struct pci_dev *dev); | 803 | int pci_try_set_mwi(struct pci_dev *dev); |
| 804 | void pci_clear_mwi(struct pci_dev *dev); | 804 | void pci_clear_mwi(struct pci_dev *dev); |
| 805 | void pci_intx(struct pci_dev *dev, int enable); | 805 | void pci_intx(struct pci_dev *dev, int enable); |
| 806 | bool pci_intx_mask_supported(struct pci_dev *dev); | ||
| 807 | bool pci_check_and_mask_intx(struct pci_dev *dev); | ||
| 808 | bool pci_check_and_unmask_intx(struct pci_dev *dev); | ||
| 806 | void pci_msi_off(struct pci_dev *dev); | 809 | void pci_msi_off(struct pci_dev *dev); |
| 807 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); | 810 | int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); |
| 808 | int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); | 811 | int 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 *); | |||
| 910 | void pci_release_selected_regions(struct pci_dev *, int); | 913 | void pci_release_selected_regions(struct pci_dev *, int); |
| 911 | 914 | ||
| 912 | /* drivers/pci/bus.c */ | 915 | /* drivers/pci/bus.c */ |
| 916 | void pci_add_resource(struct list_head *resources, struct resource *res); | ||
| 917 | void pci_free_resource_list(struct list_head *resources); | ||
| 913 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); | 918 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); |
| 914 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); | 919 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); |
| 915 | void pci_bus_remove_resources(struct pci_bus *bus); | 920 | void pci_bus_remove_resources(struct pci_bus *bus); |
| @@ -1084,8 +1089,9 @@ int ht_create_irq(struct pci_dev *dev, int idx); | |||
| 1084 | void ht_destroy_irq(unsigned int irq); | 1089 | void ht_destroy_irq(unsigned int irq); |
| 1085 | #endif /* CONFIG_HT_IRQ */ | 1090 | #endif /* CONFIG_HT_IRQ */ |
| 1086 | 1091 | ||
| 1087 | extern void pci_block_user_cfg_access(struct pci_dev *dev); | 1092 | extern void pci_cfg_access_lock(struct pci_dev *dev); |
| 1088 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); | 1093 | extern bool pci_cfg_access_trylock(struct pci_dev *dev); |
| 1094 | extern 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 | ||
| 1285 | static inline void pci_block_user_cfg_access(struct pci_dev *dev) | 1291 | static inline void pci_block_cfg_access(struct pci_dev *dev) |
| 1286 | { } | 1292 | { } |
| 1287 | 1293 | ||
| 1288 | static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) | 1294 | static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) |
| 1295 | { return 0; } | ||
| 1296 | |||
| 1297 | static inline void pci_unblock_cfg_access(struct pci_dev *dev) | ||
| 1289 | { } | 1298 | { } |
| 1290 | 1299 | ||
| 1291 | static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) | 1300 | static 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, | |||
| 1423 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | 1432 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); |
| 1424 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); | 1433 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); |
| 1425 | void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); | 1434 | void __iomem * const *pcim_iomap_table(struct pci_dev *pdev); |
| 1426 | int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); | 1435 | int pcim_iomap_regions(struct pci_dev *pdev, int mask, const char *name); |
| 1427 | int pcim_iomap_regions_request_all(struct pci_dev *pdev, u16 mask, | 1436 | int pcim_iomap_regions_request_all(struct pci_dev *pdev, int mask, |
| 1428 | const char *name); | 1437 | const char *name); |
| 1429 | void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask); | 1438 | void pcim_iounmap_regions(struct pci_dev *pdev, int mask); |
| 1430 | 1439 | ||
| 1431 | extern int pci_pci_problems; | 1440 | extern 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; | |||
| 1445 | extern unsigned long pci_hotplug_io_size; | 1454 | extern unsigned long pci_hotplug_io_size; |
| 1446 | extern unsigned long pci_hotplug_mem_size; | 1455 | extern unsigned long pci_hotplug_mem_size; |
| 1447 | 1456 | ||
| 1457 | /* Architecture specific versions may override these (weak) */ | ||
| 1448 | int pcibios_add_platform_entries(struct pci_dev *dev); | 1458 | int pcibios_add_platform_entries(struct pci_dev *dev); |
| 1449 | void pcibios_disable_device(struct pci_dev *dev); | 1459 | void pcibios_disable_device(struct pci_dev *dev); |
| 1460 | void pcibios_set_master(struct pci_dev *dev); | ||
| 1450 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, | 1461 | int pcibios_set_pcie_reset_state(struct pci_dev *dev, |
| 1451 | enum pcie_reset_state state); | 1462 | enum pcie_reset_state state); |
| 1452 | 1463 | ||
