Joerg Roedel | 5cdede2 | 2011-04-04 15:55:18 +0200 | [diff] [blame] | 1 | #ifndef LINUX_PCI_ATS_H |
| 2 | #define LINUX_PCI_ATS_H |
| 3 | |
Joerg Roedel | db3c33c | 2011-09-27 15:57:13 +0200 | [diff] [blame] | 4 | #include <linux/pci.h> |
| 5 | |
Joerg Roedel | c320b97 | 2011-09-27 15:57:15 +0200 | [diff] [blame] | 6 | #ifdef CONFIG_PCI_PRI |
| 7 | |
Bjorn Helgaas | f39d5b7 | 2013-04-12 12:02:59 -0600 | [diff] [blame] | 8 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); |
| 9 | void pci_disable_pri(struct pci_dev *pdev); |
CQ Tang | 4ebeb1e | 2017-05-30 09:25:49 -0700 | [diff] [blame] | 10 | void pci_restore_pri_state(struct pci_dev *pdev); |
Bjorn Helgaas | f39d5b7 | 2013-04-12 12:02:59 -0600 | [diff] [blame] | 11 | int pci_reset_pri(struct pci_dev *pdev); |
Joerg Roedel | c320b97 | 2011-09-27 15:57:15 +0200 | [diff] [blame] | 12 | |
| 13 | #else /* CONFIG_PCI_PRI */ |
| 14 | |
| 15 | static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs) |
| 16 | { |
| 17 | return -ENODEV; |
| 18 | } |
| 19 | |
| 20 | static inline void pci_disable_pri(struct pci_dev *pdev) |
| 21 | { |
| 22 | } |
| 23 | |
CQ Tang | 4ebeb1e | 2017-05-30 09:25:49 -0700 | [diff] [blame] | 24 | static inline void pci_restore_pri_state(struct pci_dev *pdev) |
| 25 | { |
| 26 | } |
| 27 | |
Joerg Roedel | c320b97 | 2011-09-27 15:57:15 +0200 | [diff] [blame] | 28 | static inline int pci_reset_pri(struct pci_dev *pdev) |
| 29 | { |
| 30 | return -ENODEV; |
| 31 | } |
| 32 | |
Joerg Roedel | c320b97 | 2011-09-27 15:57:15 +0200 | [diff] [blame] | 33 | #endif /* CONFIG_PCI_PRI */ |
| 34 | |
Joerg Roedel | 086ac11 | 2011-09-27 15:57:16 +0200 | [diff] [blame] | 35 | #ifdef CONFIG_PCI_PASID |
| 36 | |
Bjorn Helgaas | f39d5b7 | 2013-04-12 12:02:59 -0600 | [diff] [blame] | 37 | int pci_enable_pasid(struct pci_dev *pdev, int features); |
| 38 | void pci_disable_pasid(struct pci_dev *pdev); |
CQ Tang | 4ebeb1e | 2017-05-30 09:25:49 -0700 | [diff] [blame] | 39 | void pci_restore_pasid_state(struct pci_dev *pdev); |
Bjorn Helgaas | f39d5b7 | 2013-04-12 12:02:59 -0600 | [diff] [blame] | 40 | int pci_pasid_features(struct pci_dev *pdev); |
| 41 | int pci_max_pasids(struct pci_dev *pdev); |
Joerg Roedel | 086ac11 | 2011-09-27 15:57:16 +0200 | [diff] [blame] | 42 | |
| 43 | #else /* CONFIG_PCI_PASID */ |
| 44 | |
| 45 | static inline int pci_enable_pasid(struct pci_dev *pdev, int features) |
| 46 | { |
| 47 | return -EINVAL; |
| 48 | } |
| 49 | |
| 50 | static inline void pci_disable_pasid(struct pci_dev *pdev) |
| 51 | { |
| 52 | } |
| 53 | |
CQ Tang | 4ebeb1e | 2017-05-30 09:25:49 -0700 | [diff] [blame] | 54 | static inline void pci_restore_pasid_state(struct pci_dev *pdev) |
| 55 | { |
| 56 | } |
| 57 | |
Joerg Roedel | 086ac11 | 2011-09-27 15:57:16 +0200 | [diff] [blame] | 58 | static inline int pci_pasid_features(struct pci_dev *pdev) |
| 59 | { |
| 60 | return -EINVAL; |
| 61 | } |
| 62 | |
| 63 | static inline int pci_max_pasids(struct pci_dev *pdev) |
| 64 | { |
| 65 | return -EINVAL; |
| 66 | } |
| 67 | |
| 68 | #endif /* CONFIG_PCI_PASID */ |
| 69 | |
| 70 | |
Joerg Roedel | 5cdede2 | 2011-04-04 15:55:18 +0200 | [diff] [blame] | 71 | #endif /* LINUX_PCI_ATS_H*/ |