diff options
Diffstat (limited to 'include/linux/pci.h')
| -rw-r--r-- | include/linux/pci.h | 64 |
1 files changed, 43 insertions, 21 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index c133ccfa002e..e72ca8dd6241 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -261,6 +261,9 @@ enum pci_bus_speed { | |||
| 261 | PCI_SPEED_UNKNOWN = 0xff, | 261 | PCI_SPEED_UNKNOWN = 0xff, |
| 262 | }; | 262 | }; |
| 263 | 263 | ||
| 264 | enum pci_bus_speed pcie_get_speed_cap(struct pci_dev *dev); | ||
| 265 | enum pcie_link_width pcie_get_width_cap(struct pci_dev *dev); | ||
| 266 | |||
| 264 | struct pci_cap_saved_data { | 267 | struct pci_cap_saved_data { |
| 265 | u16 cap_nr; | 268 | u16 cap_nr; |
| 266 | bool cap_extended; | 269 | bool cap_extended; |
| @@ -299,6 +302,7 @@ struct pci_dev { | |||
| 299 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 302 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
| 300 | #ifdef CONFIG_PCIEAER | 303 | #ifdef CONFIG_PCIEAER |
| 301 | u16 aer_cap; /* AER capability offset */ | 304 | u16 aer_cap; /* AER capability offset */ |
| 305 | struct aer_stats *aer_stats; /* AER stats for this device */ | ||
| 302 | #endif | 306 | #endif |
| 303 | u8 pcie_cap; /* PCIe capability offset */ | 307 | u8 pcie_cap; /* PCIe capability offset */ |
| 304 | u8 msi_cap; /* MSI capability offset */ | 308 | u8 msi_cap; /* MSI capability offset */ |
| @@ -350,6 +354,7 @@ struct pci_dev { | |||
| 350 | unsigned int ltr_path:1; /* Latency Tolerance Reporting | 354 | unsigned int ltr_path:1; /* Latency Tolerance Reporting |
| 351 | supported from root to here */ | 355 | supported from root to here */ |
| 352 | #endif | 356 | #endif |
| 357 | unsigned int eetlp_prefix_path:1; /* End-to-End TLP Prefix */ | ||
| 353 | 358 | ||
| 354 | pci_channel_state_t error_state; /* Current connectivity state */ | 359 | pci_channel_state_t error_state; /* Current connectivity state */ |
| 355 | struct device dev; /* Generic device interface */ | 360 | struct device dev; /* Generic device interface */ |
| @@ -387,6 +392,7 @@ struct pci_dev { | |||
| 387 | unsigned int is_virtfn:1; | 392 | unsigned int is_virtfn:1; |
| 388 | unsigned int reset_fn:1; | 393 | unsigned int reset_fn:1; |
| 389 | unsigned int is_hotplug_bridge:1; | 394 | unsigned int is_hotplug_bridge:1; |
| 395 | unsigned int shpc_managed:1; /* SHPC owned by shpchp */ | ||
| 390 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ | 396 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ |
| 391 | unsigned int __aer_firmware_first_valid:1; | 397 | unsigned int __aer_firmware_first_valid:1; |
| 392 | unsigned int __aer_firmware_first:1; | 398 | unsigned int __aer_firmware_first:1; |
| @@ -818,6 +824,21 @@ struct pci_driver { | |||
| 818 | .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \ | 824 | .vendor = PCI_VENDOR_ID_##vend, .device = (dev), \ |
| 819 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0 | 825 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0 |
| 820 | 826 | ||
| 827 | /** | ||
| 828 | * PCI_DEVICE_DATA - macro used to describe a specific PCI device in very short form | ||
| 829 | * @vend: the vendor name (without PCI_VENDOR_ID_ prefix) | ||
| 830 | * @dev: the device name (without PCI_DEVICE_ID_<vend>_ prefix) | ||
| 831 | * @data: the driver data to be filled | ||
| 832 | * | ||
| 833 | * This macro is used to create a struct pci_device_id that matches a | ||
| 834 | * specific PCI device. The subvendor, and subdevice fields will be set | ||
| 835 | * to PCI_ANY_ID. | ||
| 836 | */ | ||
| 837 | #define PCI_DEVICE_DATA(vend, dev, data) \ | ||
| 838 | .vendor = PCI_VENDOR_ID_##vend, .device = PCI_DEVICE_ID_##vend##_##dev, \ | ||
| 839 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0, \ | ||
| 840 | .driver_data = (kernel_ulong_t)(data) | ||
| 841 | |||
| 821 | enum { | 842 | enum { |
| 822 | PCI_REASSIGN_ALL_RSRC = 0x00000001, /* Ignore firmware setup */ | 843 | PCI_REASSIGN_ALL_RSRC = 0x00000001, /* Ignore firmware setup */ |
| 823 | PCI_REASSIGN_ALL_BUS = 0x00000002, /* Reassign all bus numbers */ | 844 | PCI_REASSIGN_ALL_BUS = 0x00000002, /* Reassign all bus numbers */ |
| @@ -1088,20 +1109,17 @@ u32 pcie_bandwidth_available(struct pci_dev *dev, struct pci_dev **limiting_dev, | |||
| 1088 | enum pci_bus_speed *speed, | 1109 | enum pci_bus_speed *speed, |
| 1089 | enum pcie_link_width *width); | 1110 | enum pcie_link_width *width); |
| 1090 | void pcie_print_link_status(struct pci_dev *dev); | 1111 | void pcie_print_link_status(struct pci_dev *dev); |
| 1112 | bool pcie_has_flr(struct pci_dev *dev); | ||
| 1091 | int pcie_flr(struct pci_dev *dev); | 1113 | int pcie_flr(struct pci_dev *dev); |
| 1092 | int __pci_reset_function_locked(struct pci_dev *dev); | 1114 | int __pci_reset_function_locked(struct pci_dev *dev); |
| 1093 | int pci_reset_function(struct pci_dev *dev); | 1115 | int pci_reset_function(struct pci_dev *dev); |
| 1094 | int pci_reset_function_locked(struct pci_dev *dev); | 1116 | int pci_reset_function_locked(struct pci_dev *dev); |
| 1095 | int pci_try_reset_function(struct pci_dev *dev); | 1117 | int pci_try_reset_function(struct pci_dev *dev); |
| 1096 | int pci_probe_reset_slot(struct pci_slot *slot); | 1118 | int pci_probe_reset_slot(struct pci_slot *slot); |
| 1097 | int pci_reset_slot(struct pci_slot *slot); | ||
| 1098 | int pci_try_reset_slot(struct pci_slot *slot); | ||
| 1099 | int pci_probe_reset_bus(struct pci_bus *bus); | 1119 | int pci_probe_reset_bus(struct pci_bus *bus); |
| 1100 | int pci_reset_bus(struct pci_bus *bus); | 1120 | int pci_reset_bus(struct pci_dev *dev); |
| 1101 | int pci_try_reset_bus(struct pci_bus *bus); | ||
| 1102 | void pci_reset_secondary_bus(struct pci_dev *dev); | 1121 | void pci_reset_secondary_bus(struct pci_dev *dev); |
| 1103 | void pcibios_reset_secondary_bus(struct pci_dev *dev); | 1122 | void pcibios_reset_secondary_bus(struct pci_dev *dev); |
| 1104 | int pci_reset_bridge_secondary_bus(struct pci_dev *dev); | ||
| 1105 | void pci_update_resource(struct pci_dev *dev, int resno); | 1123 | void pci_update_resource(struct pci_dev *dev, int resno); |
| 1106 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 1124 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| 1107 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); | 1125 | int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); |
| @@ -1121,7 +1139,6 @@ int pci_enable_rom(struct pci_dev *pdev); | |||
| 1121 | void pci_disable_rom(struct pci_dev *pdev); | 1139 | void pci_disable_rom(struct pci_dev *pdev); |
| 1122 | void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); | 1140 | void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size); |
| 1123 | void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); | 1141 | void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); |
| 1124 | size_t pci_get_rom_size(struct pci_dev *pdev, void __iomem *rom, size_t size); | ||
| 1125 | void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); | 1142 | void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size); |
| 1126 | 1143 | ||
| 1127 | /* Power management related routines */ | 1144 | /* Power management related routines */ |
| @@ -1469,13 +1486,9 @@ static inline bool pcie_aspm_support_enabled(void) { return false; } | |||
| 1469 | #endif | 1486 | #endif |
| 1470 | 1487 | ||
| 1471 | #ifdef CONFIG_PCIEAER | 1488 | #ifdef CONFIG_PCIEAER |
| 1472 | void pci_no_aer(void); | ||
| 1473 | bool pci_aer_available(void); | 1489 | bool pci_aer_available(void); |
| 1474 | int pci_aer_init(struct pci_dev *dev); | ||
| 1475 | #else | 1490 | #else |
| 1476 | static inline void pci_no_aer(void) { } | ||
| 1477 | static inline bool pci_aer_available(void) { return false; } | 1491 | static inline bool pci_aer_available(void) { return false; } |
| 1478 | static inline int pci_aer_init(struct pci_dev *d) { return -ENODEV; } | ||
| 1479 | #endif | 1492 | #endif |
| 1480 | 1493 | ||
| 1481 | #ifdef CONFIG_PCIE_ECRC | 1494 | #ifdef CONFIG_PCIE_ECRC |
| @@ -1796,7 +1809,11 @@ struct pci_fixup { | |||
| 1796 | u16 device; /* Or PCI_ANY_ID */ | 1809 | u16 device; /* Or PCI_ANY_ID */ |
| 1797 | u32 class; /* Or PCI_ANY_ID */ | 1810 | u32 class; /* Or PCI_ANY_ID */ |
| 1798 | unsigned int class_shift; /* should be 0, 8, 16 */ | 1811 | unsigned int class_shift; /* should be 0, 8, 16 */ |
| 1812 | #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS | ||
| 1813 | int hook_offset; | ||
| 1814 | #else | ||
| 1799 | void (*hook)(struct pci_dev *dev); | 1815 | void (*hook)(struct pci_dev *dev); |
| 1816 | #endif | ||
| 1800 | }; | 1817 | }; |
| 1801 | 1818 | ||
| 1802 | enum pci_fixup_pass { | 1819 | enum pci_fixup_pass { |
| @@ -1810,12 +1827,28 @@ enum pci_fixup_pass { | |||
| 1810 | pci_fixup_suspend_late, /* pci_device_suspend_late() */ | 1827 | pci_fixup_suspend_late, /* pci_device_suspend_late() */ |
| 1811 | }; | 1828 | }; |
| 1812 | 1829 | ||
| 1830 | #ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS | ||
| 1831 | #define __DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ | ||
| 1832 | class_shift, hook) \ | ||
| 1833 | __ADDRESSABLE(hook) \ | ||
| 1834 | asm(".section " #sec ", \"a\" \n" \ | ||
| 1835 | ".balign 16 \n" \ | ||
| 1836 | ".short " #vendor ", " #device " \n" \ | ||
| 1837 | ".long " #class ", " #class_shift " \n" \ | ||
| 1838 | ".long " #hook " - . \n" \ | ||
| 1839 | ".previous \n"); | ||
| 1840 | #define DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ | ||
| 1841 | class_shift, hook) \ | ||
| 1842 | __DECLARE_PCI_FIXUP_SECTION(sec, name, vendor, device, class, \ | ||
| 1843 | class_shift, hook) | ||
| 1844 | #else | ||
| 1813 | /* Anonymous variables would be nice... */ | 1845 | /* Anonymous variables would be nice... */ |
| 1814 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ | 1846 | #define DECLARE_PCI_FIXUP_SECTION(section, name, vendor, device, class, \ |
| 1815 | class_shift, hook) \ | 1847 | class_shift, hook) \ |
| 1816 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ | 1848 | static const struct pci_fixup __PASTE(__pci_fixup_##name,__LINE__) __used \ |
| 1817 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ | 1849 | __attribute__((__section__(#section), aligned((sizeof(void *))))) \ |
| 1818 | = { vendor, device, class, class_shift, hook }; | 1850 | = { vendor, device, class, class_shift, hook }; |
| 1851 | #endif | ||
| 1819 | 1852 | ||
| 1820 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ | 1853 | #define DECLARE_PCI_FIXUP_CLASS_EARLY(vendor, device, class, \ |
| 1821 | class_shift, hook) \ | 1854 | class_shift, hook) \ |
| @@ -1877,20 +1910,9 @@ enum pci_fixup_pass { | |||
| 1877 | 1910 | ||
| 1878 | #ifdef CONFIG_PCI_QUIRKS | 1911 | #ifdef CONFIG_PCI_QUIRKS |
| 1879 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 1912 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
| 1880 | int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); | ||
| 1881 | int pci_dev_specific_enable_acs(struct pci_dev *dev); | ||
| 1882 | #else | 1913 | #else |
| 1883 | static inline void pci_fixup_device(enum pci_fixup_pass pass, | 1914 | static inline void pci_fixup_device(enum pci_fixup_pass pass, |
| 1884 | struct pci_dev *dev) { } | 1915 | struct pci_dev *dev) { } |
| 1885 | static inline int pci_dev_specific_acs_enabled(struct pci_dev *dev, | ||
| 1886 | u16 acs_flags) | ||
| 1887 | { | ||
| 1888 | return -ENOTTY; | ||
| 1889 | } | ||
| 1890 | static inline int pci_dev_specific_enable_acs(struct pci_dev *dev) | ||
| 1891 | { | ||
| 1892 | return -ENOTTY; | ||
| 1893 | } | ||
| 1894 | #endif | 1916 | #endif |
| 1895 | 1917 | ||
| 1896 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | 1918 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); |
