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.h45
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! */
128extern const char *pci_power_names[];
129
130static 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 {
188struct pcie_link_state; 196struct pcie_link_state;
189struct pci_vpd; 197struct pci_vpd;
190struct pci_sriov; 198struct pci_sriov;
199struct 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);
599struct pci_dev __deprecated *pci_find_device(unsigned int vendor, 609struct 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);
602struct 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
606enum pci_lost_interrupt_reason { 614enum 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);
640int 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,
641 int where, u32 val); 649 int where, u32 val);
650struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops);
642 651
643static 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)
644{ 653{
@@ -703,8 +712,8 @@ int pcix_get_mmrbc(struct pci_dev *dev);
703int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 712int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
704int pcie_get_readrq(struct pci_dev *dev); 713int pcie_get_readrq(struct pci_dev *dev);
705int 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);
706int pci_reset_function(struct pci_dev *dev); 716int pci_reset_function(struct pci_dev *dev);
707int pci_execute_reset_function(struct pci_dev *dev);
708void pci_update_resource(struct pci_dev *dev, int resno); 717void pci_update_resource(struct pci_dev *dev, int resno);
709int __must_check pci_assign_resource(struct pci_dev *dev, int i); 718int __must_check pci_assign_resource(struct pci_dev *dev, int i);
710int pci_select_bars(struct pci_dev *dev, unsigned long flags); 719int 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);
724pci_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);
725bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); 734bool pci_pme_capable(struct pci_dev *dev, pci_power_t state);
726void pci_pme_active(struct pci_dev *dev, bool enable); 735void pci_pme_active(struct pci_dev *dev, bool enable);
727int 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);
728int pci_wake_from_d3(struct pci_dev *dev, bool enable); 737int pci_wake_from_d3(struct pci_dev *dev, bool enable);
729pci_power_t pci_target_state(struct pci_dev *dev); 738pci_power_t pci_target_state(struct pci_dev *dev);
730int pci_prepare_to_sleep(struct pci_dev *dev); 739int 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,
790int 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,
791 int pass); 800 int pass);
792 801
793void 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 *),
794 void *userdata); 803 void *userdata);
795int pci_cfg_space_size_ext(struct pci_dev *dev); 804int pci_cfg_space_size_ext(struct pci_dev *dev);
796int pci_cfg_space_size(struct pci_dev *dev); 805int pci_cfg_space_size(struct pci_dev *dev);
@@ -880,6 +889,17 @@ static inline int pcie_aspm_enabled(void)
880extern int pcie_aspm_enabled(void); 889extern int pcie_aspm_enabled(void);
881#endif 890#endif
882 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
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
939static inline struct pci_dev *pci_find_slot(unsigned int bus,
940 unsigned int devfn)
941{
942 return NULL;
943}
944
945static inline struct pci_dev *pci_get_device(unsigned int vendor, 959static 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)
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
1256#endif /* __KERNEL__ */ 1279#endif /* __KERNEL__ */
1257#endif /* LINUX_PCI_H */ 1280#endif /* LINUX_PCI_H */