diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2011-09-27 09:57:15 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-10-14 12:05:34 -0400 |
commit | c320b976d7837c561ce4aa49dfe0a64f0e527ce4 (patch) | |
tree | 09d12286e3c63ab15a472468795204eeb154f83c /include/linux/pci-ats.h | |
parent | d4c0636c2107010f0ef8c4dfbb1d6368ae3b3ed9 (diff) |
PCI: Add implementation for PRI capability
Implement the necessary functions to handle PRI capabilities
on PCIe devices. With PRI devices behind an IOMMU can signal
page fault conditions to software and recover from such
faults.
Reviewed-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'include/linux/pci-ats.h')
-rw-r--r-- | include/linux/pci-ats.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 4eab42bf2af9..071395251abf 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
@@ -17,6 +17,7 @@ struct pci_ats { | |||
17 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | 17 | extern int pci_enable_ats(struct pci_dev *dev, int ps); |
18 | extern void pci_disable_ats(struct pci_dev *dev); | 18 | extern void pci_disable_ats(struct pci_dev *dev); |
19 | extern int pci_ats_queue_depth(struct pci_dev *dev); | 19 | extern int pci_ats_queue_depth(struct pci_dev *dev); |
20 | |||
20 | /** | 21 | /** |
21 | * pci_ats_enabled - query the ATS status | 22 | * pci_ats_enabled - query the ATS status |
22 | * @dev: the PCI device | 23 | * @dev: the PCI device |
@@ -51,4 +52,45 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
51 | 52 | ||
52 | #endif /* CONFIG_PCI_IOV */ | 53 | #endif /* CONFIG_PCI_IOV */ |
53 | 54 | ||
55 | #ifdef CONFIG_PCI_PRI | ||
56 | |||
57 | extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | ||
58 | extern void pci_disable_pri(struct pci_dev *pdev); | ||
59 | extern bool pci_pri_enabled(struct pci_dev *pdev); | ||
60 | extern int pci_reset_pri(struct pci_dev *pdev); | ||
61 | extern bool pci_pri_stopped(struct pci_dev *pdev); | ||
62 | extern int pci_pri_status(struct pci_dev *pdev); | ||
63 | |||
64 | #else /* CONFIG_PCI_PRI */ | ||
65 | |||
66 | static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs) | ||
67 | { | ||
68 | return -ENODEV; | ||
69 | } | ||
70 | |||
71 | static inline void pci_disable_pri(struct pci_dev *pdev) | ||
72 | { | ||
73 | } | ||
74 | |||
75 | static inline bool pci_pri_enabled(struct pci_dev *pdev) | ||
76 | { | ||
77 | return false; | ||
78 | } | ||
79 | |||
80 | static inline int pci_reset_pri(struct pci_dev *pdev) | ||
81 | { | ||
82 | return -ENODEV; | ||
83 | } | ||
84 | |||
85 | static inline bool pci_pri_stopped(struct pci_dev *pdev) | ||
86 | { | ||
87 | return true; | ||
88 | } | ||
89 | |||
90 | static inline int pci_pri_status(struct pci_dev *pdev) | ||
91 | { | ||
92 | return -ENODEV; | ||
93 | } | ||
94 | #endif /* CONFIG_PCI_PRI */ | ||
95 | |||
54 | #endif /* LINUX_PCI_ATS_H*/ | 96 | #endif /* LINUX_PCI_ATS_H*/ |