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