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.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 8e366bb0705..d304ddf412d 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -196,6 +196,7 @@ struct pci_cap_saved_state {
196struct pcie_link_state; 196struct pcie_link_state;
197struct pci_vpd; 197struct pci_vpd;
198struct pci_sriov; 198struct pci_sriov;
199struct pci_ats;
199 200
200/* 201/*
201 * The pci_dev structure is used to describe PCI devices. 202 * The pci_dev structure is used to describe PCI devices.
@@ -293,6 +294,7 @@ struct pci_dev {
293 struct pci_sriov *sriov; /* SR-IOV capability related */ 294 struct pci_sriov *sriov; /* SR-IOV capability related */
294 struct pci_dev *physfn; /* the PF this VF is associated with */ 295 struct pci_dev *physfn; /* the PF this VF is associated with */
295 }; 296 };
297 struct pci_ats *ats; /* Address Translation Service */
296#endif 298#endif
297}; 299};
298 300
@@ -607,8 +609,6 @@ extern void pci_sort_breadthfirst(void);
607struct pci_dev __deprecated *pci_find_device(unsigned int vendor, 609struct pci_dev __deprecated *pci_find_device(unsigned int vendor,
608 unsigned int device, 610 unsigned int device,
609 struct pci_dev *from); 611 struct pci_dev *from);
610struct pci_dev __deprecated *pci_find_slot(unsigned int bus,
611 unsigned int devfn);
612#endif /* CONFIG_PCI_LEGACY */ 612#endif /* CONFIG_PCI_LEGACY */
613 613
614enum pci_lost_interrupt_reason { 614enum pci_lost_interrupt_reason {
@@ -647,6 +647,7 @@ int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn,
647 int where, u16 val); 647 int where, u16 val);
648int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, 648int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn,
649 int where, u32 val); 649 int where, u32 val);
650struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops);
650 651
651static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) 652static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val)
652{ 653{
@@ -711,8 +712,8 @@ int pcix_get_mmrbc(struct pci_dev *dev);
711int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 712int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
712int pcie_get_readrq(struct pci_dev *dev); 713int pcie_get_readrq(struct pci_dev *dev);
713int pcie_set_readrq(struct pci_dev *dev, int rq); 714int pcie_set_readrq(struct pci_dev *dev, int rq);
715int __pci_reset_function(struct pci_dev *dev);
714int pci_reset_function(struct pci_dev *dev); 716int pci_reset_function(struct pci_dev *dev);
715int pci_execute_reset_function(struct pci_dev *dev);
716void pci_update_resource(struct pci_dev *dev, int resno); 717void pci_update_resource(struct pci_dev *dev, int resno);
717int __must_check pci_assign_resource(struct pci_dev *dev, int i); 718int __must_check pci_assign_resource(struct pci_dev *dev, int i);
718int pci_select_bars(struct pci_dev *dev, unsigned long flags); 719int pci_select_bars(struct pci_dev *dev, unsigned long flags);
@@ -732,7 +733,7 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
732pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 733pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
733bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); 734bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
734void pci_pme_active(struct pci_dev *dev, bool enable); 735void pci_pme_active(struct pci_dev *dev, bool enable);
735int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); 736int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable);
736int pci_wake_from_d3(struct pci_dev *dev, bool enable); 737int pci_wake_from_d3(struct pci_dev *dev, bool enable);
737pci_power_t pci_target_state(struct pci_dev *dev); 738pci_power_t pci_target_state(struct pci_dev *dev);
738int pci_prepare_to_sleep(struct pci_dev *dev); 739int pci_prepare_to_sleep(struct pci_dev *dev);
@@ -798,7 +799,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
798int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, 799int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
799 int pass); 800 int pass);
800 801
801void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), 802void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *),
802 void *userdata); 803 void *userdata);
803int pci_cfg_space_size_ext(struct pci_dev *dev); 804int pci_cfg_space_size_ext(struct pci_dev *dev);
804int pci_cfg_space_size(struct pci_dev *dev); 805int pci_cfg_space_size(struct pci_dev *dev);
@@ -888,6 +889,17 @@ static inline int pcie_aspm_enabled(void)
888extern int pcie_aspm_enabled(void); 889extern int pcie_aspm_enabled(void);
889#endif 890#endif
890 891
892#ifndef CONFIG_PCIE_ECRC
893static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
894{
895 return;
896}
897static inline void pcie_ecrc_get_policy(char *str) {};
898#else
899extern void pcie_set_ecrc_checking(struct pci_dev *dev);
900extern void pcie_ecrc_get_policy(char *str);
901#endif
902
891#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 903#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
892 904
893#ifdef CONFIG_HT_IRQ 905#ifdef CONFIG_HT_IRQ
@@ -944,12 +956,6 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor,
944 return NULL; 956 return NULL;
945} 957}
946 958
947static inline struct pci_dev *pci_find_slot(unsigned int bus,
948 unsigned int devfn)
949{
950 return NULL;
951}
952
953static inline struct pci_dev *pci_get_device(unsigned int vendor, 959static inline struct pci_dev *pci_get_device(unsigned int vendor,
954 unsigned int device, 960 unsigned int device,
955 struct pci_dev *from) 961 struct pci_dev *from)
@@ -1105,6 +1111,10 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1105 1111
1106#include <asm/pci.h> 1112#include <asm/pci.h>
1107 1113
1114#ifndef PCIBIOS_MAX_MEM_32
1115#define PCIBIOS_MAX_MEM_32 (-1)
1116#endif
1117
1108/* these helpers provide future and backwards compatibility 1118/* these helpers provide future and backwards compatibility
1109 * for accessing popular PCI BAR info */ 1119 * for accessing popular PCI BAR info */
1110#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) 1120#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
@@ -1261,5 +1271,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1261} 1271}
1262#endif 1272#endif
1263 1273
1274#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
1275extern void pci_hp_create_module_link(struct pci_slot *pci_slot);
1276extern void pci_hp_remove_module_link(struct pci_slot *pci_slot);
1277#endif
1278
1264#endif /* __KERNEL__ */ 1279#endif /* __KERNEL__ */
1265#endif /* LINUX_PCI_H */ 1280#endif /* LINUX_PCI_H */