diff options
Diffstat (limited to 'include/linux/pci-ats.h')
| -rw-r--r-- | include/linux/pci-ats.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 655824fa4c76..e3d0b3890249 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | #ifndef LINUX_PCI_ATS_H | 1 | #ifndef LINUX_PCI_ATS_H |
| 2 | #define LINUX_PCI_ATS_H | 2 | #define LINUX_PCI_ATS_H |
| 3 | 3 | ||
| 4 | #include <linux/pci.h> | ||
| 5 | |||
| 4 | /* Address Translation Service */ | 6 | /* Address Translation Service */ |
| 5 | struct pci_ats { | 7 | struct pci_ats { |
| 6 | int pos; /* capability position */ | 8 | int pos; /* capability position */ |
| @@ -15,6 +17,7 @@ struct pci_ats { | |||
| 15 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | 17 | extern int pci_enable_ats(struct pci_dev *dev, int ps); |
| 16 | extern void pci_disable_ats(struct pci_dev *dev); | 18 | extern void pci_disable_ats(struct pci_dev *dev); |
| 17 | extern int pci_ats_queue_depth(struct pci_dev *dev); | 19 | extern int pci_ats_queue_depth(struct pci_dev *dev); |
| 20 | |||
| 18 | /** | 21 | /** |
| 19 | * pci_ats_enabled - query the ATS status | 22 | * pci_ats_enabled - query the ATS status |
| 20 | * @dev: the PCI device | 23 | * @dev: the PCI device |
| @@ -49,4 +52,76 @@ static inline int pci_ats_enabled(struct pci_dev *dev) | |||
| 49 | 52 | ||
| 50 | #endif /* CONFIG_PCI_IOV */ | 53 | #endif /* CONFIG_PCI_IOV */ |
| 51 | 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 | |||
| 96 | #ifdef CONFIG_PCI_PASID | ||
| 97 | |||
| 98 | extern int pci_enable_pasid(struct pci_dev *pdev, int features); | ||
| 99 | extern void pci_disable_pasid(struct pci_dev *pdev); | ||
| 100 | extern int pci_pasid_features(struct pci_dev *pdev); | ||
| 101 | extern int pci_max_pasids(struct pci_dev *pdev); | ||
| 102 | |||
| 103 | #else /* CONFIG_PCI_PASID */ | ||
| 104 | |||
| 105 | static inline int pci_enable_pasid(struct pci_dev *pdev, int features) | ||
| 106 | { | ||
| 107 | return -EINVAL; | ||
| 108 | } | ||
| 109 | |||
| 110 | static inline void pci_disable_pasid(struct pci_dev *pdev) | ||
| 111 | { | ||
| 112 | } | ||
| 113 | |||
| 114 | static inline int pci_pasid_features(struct pci_dev *pdev) | ||
| 115 | { | ||
| 116 | return -EINVAL; | ||
| 117 | } | ||
| 118 | |||
| 119 | static inline int pci_max_pasids(struct pci_dev *pdev) | ||
| 120 | { | ||
| 121 | return -EINVAL; | ||
| 122 | } | ||
| 123 | |||
| 124 | #endif /* CONFIG_PCI_PASID */ | ||
| 125 | |||
| 126 | |||
| 52 | #endif /* LINUX_PCI_ATS_H*/ | 127 | #endif /* LINUX_PCI_ATS_H*/ |
