diff options
Diffstat (limited to 'include/linux/pci.h')
| -rw-r--r-- | include/linux/pci.h | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h index 72698d89e767..d304ddf412d0 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -124,6 +124,14 @@ typedef int __bitwise pci_power_t; | |||
| 124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) | 124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) |
| 125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) | 125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) |
| 126 | 126 | ||
| 127 | /* Remember to update this when the list above changes! */ | ||
| 128 | extern const char *pci_power_names[]; | ||
| 129 | |||
| 130 | static inline const char *pci_power_name(pci_power_t state) | ||
| 131 | { | ||
| 132 | return pci_power_names[1 + (int) state]; | ||
| 133 | } | ||
| 134 | |||
| 127 | #define PCI_PM_D2_DELAY 200 | 135 | #define PCI_PM_D2_DELAY 200 |
| 128 | #define PCI_PM_D3_WAIT 10 | 136 | #define PCI_PM_D3_WAIT 10 |
| 129 | #define PCI_PM_BUS_WAIT 50 | 137 | #define PCI_PM_BUS_WAIT 50 |
| @@ -188,6 +196,7 @@ struct pci_cap_saved_state { | |||
| 188 | struct pcie_link_state; | 196 | struct pcie_link_state; |
| 189 | struct pci_vpd; | 197 | struct pci_vpd; |
| 190 | struct pci_sriov; | 198 | struct pci_sriov; |
| 199 | struct pci_ats; | ||
| 191 | 200 | ||
| 192 | /* | 201 | /* |
| 193 | * The pci_dev structure is used to describe PCI devices. | 202 | * The pci_dev structure is used to describe PCI devices. |
| @@ -285,6 +294,7 @@ struct pci_dev { | |||
| 285 | struct pci_sriov *sriov; /* SR-IOV capability related */ | 294 | struct pci_sriov *sriov; /* SR-IOV capability related */ |
| 286 | struct pci_dev *physfn; /* the PF this VF is associated with */ | 295 | struct pci_dev *physfn; /* the PF this VF is associated with */ |
| 287 | }; | 296 | }; |
| 297 | struct pci_ats *ats; /* Address Translation Service */ | ||
| 288 | #endif | 298 | #endif |
| 289 | }; | 299 | }; |
| 290 | 300 | ||
| @@ -599,8 +609,6 @@ extern void pci_sort_breadthfirst(void); | |||
| 599 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | 609 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, |
| 600 | unsigned int device, | 610 | unsigned int device, |
| 601 | struct pci_dev *from); | 611 | struct pci_dev *from); |
| 602 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, | ||
| 603 | unsigned int devfn); | ||
| 604 | #endif /* CONFIG_PCI_LEGACY */ | 612 | #endif /* CONFIG_PCI_LEGACY */ |
| 605 | 613 | ||
| 606 | enum pci_lost_interrupt_reason { | 614 | enum pci_lost_interrupt_reason { |
| @@ -639,6 +647,7 @@ int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn, | |||
| 639 | int where, u16 val); | 647 | int where, u16 val); |
| 640 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, | 648 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, |
| 641 | int where, u32 val); | 649 | int where, u32 val); |
| 650 | struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); | ||
| 642 | 651 | ||
| 643 | static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) | 652 | static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) |
| 644 | { | 653 | { |
| @@ -703,8 +712,8 @@ int pcix_get_mmrbc(struct pci_dev *dev); | |||
| 703 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); | 712 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); |
| 704 | int pcie_get_readrq(struct pci_dev *dev); | 713 | int pcie_get_readrq(struct pci_dev *dev); |
| 705 | int pcie_set_readrq(struct pci_dev *dev, int rq); | 714 | int pcie_set_readrq(struct pci_dev *dev, int rq); |
| 715 | int __pci_reset_function(struct pci_dev *dev); | ||
| 706 | int pci_reset_function(struct pci_dev *dev); | 716 | int pci_reset_function(struct pci_dev *dev); |
| 707 | int pci_execute_reset_function(struct pci_dev *dev); | ||
| 708 | void pci_update_resource(struct pci_dev *dev, int resno); | 717 | void pci_update_resource(struct pci_dev *dev, int resno); |
| 709 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 718 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
| 710 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 719 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
| @@ -724,7 +733,7 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | |||
| 724 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 733 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| 725 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | 734 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); |
| 726 | void pci_pme_active(struct pci_dev *dev, bool enable); | 735 | void pci_pme_active(struct pci_dev *dev, bool enable); |
| 727 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); | 736 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable); |
| 728 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 737 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
| 729 | pci_power_t pci_target_state(struct pci_dev *dev); | 738 | pci_power_t pci_target_state(struct pci_dev *dev); |
| 730 | int pci_prepare_to_sleep(struct pci_dev *dev); | 739 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| @@ -790,7 +799,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, | |||
| 790 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | 799 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, |
| 791 | int pass); | 800 | int pass); |
| 792 | 801 | ||
| 793 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), | 802 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), |
| 794 | void *userdata); | 803 | void *userdata); |
| 795 | int pci_cfg_space_size_ext(struct pci_dev *dev); | 804 | int pci_cfg_space_size_ext(struct pci_dev *dev); |
| 796 | int pci_cfg_space_size(struct pci_dev *dev); | 805 | int pci_cfg_space_size(struct pci_dev *dev); |
| @@ -880,6 +889,17 @@ static inline int pcie_aspm_enabled(void) | |||
| 880 | extern int pcie_aspm_enabled(void); | 889 | extern int pcie_aspm_enabled(void); |
| 881 | #endif | 890 | #endif |
| 882 | 891 | ||
| 892 | #ifndef CONFIG_PCIE_ECRC | ||
| 893 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | ||
| 894 | { | ||
| 895 | return; | ||
| 896 | } | ||
| 897 | static inline void pcie_ecrc_get_policy(char *str) {}; | ||
| 898 | #else | ||
| 899 | extern void pcie_set_ecrc_checking(struct pci_dev *dev); | ||
| 900 | extern void pcie_ecrc_get_policy(char *str); | ||
| 901 | #endif | ||
| 902 | |||
| 883 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 903 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
| 884 | 904 | ||
| 885 | #ifdef CONFIG_HT_IRQ | 905 | #ifdef CONFIG_HT_IRQ |
| @@ -936,12 +956,6 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, | |||
| 936 | return NULL; | 956 | return NULL; |
| 937 | } | 957 | } |
| 938 | 958 | ||
| 939 | static inline struct pci_dev *pci_find_slot(unsigned int bus, | ||
| 940 | unsigned int devfn) | ||
| 941 | { | ||
| 942 | return NULL; | ||
| 943 | } | ||
| 944 | |||
| 945 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 959 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
| 946 | unsigned int device, | 960 | unsigned int device, |
| 947 | struct pci_dev *from) | 961 | struct pci_dev *from) |
| @@ -1097,6 +1111,10 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | |||
| 1097 | 1111 | ||
| 1098 | #include <asm/pci.h> | 1112 | #include <asm/pci.h> |
| 1099 | 1113 | ||
| 1114 | #ifndef PCIBIOS_MAX_MEM_32 | ||
| 1115 | #define PCIBIOS_MAX_MEM_32 (-1) | ||
| 1116 | #endif | ||
| 1117 | |||
| 1100 | /* these helpers provide future and backwards compatibility | 1118 | /* these helpers provide future and backwards compatibility |
| 1101 | * for accessing popular PCI BAR info */ | 1119 | * for accessing popular PCI BAR info */ |
| 1102 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) | 1120 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) |
| @@ -1253,5 +1271,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | |||
| 1253 | } | 1271 | } |
| 1254 | #endif | 1272 | #endif |
| 1255 | 1273 | ||
| 1274 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | ||
| 1275 | extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | ||
| 1276 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | ||
| 1277 | #endif | ||
| 1278 | |||
| 1256 | #endif /* __KERNEL__ */ | 1279 | #endif /* __KERNEL__ */ |
| 1257 | #endif /* LINUX_PCI_H */ | 1280 | #endif /* LINUX_PCI_H */ |
