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 | |
Krzysztof Wilczynski | b24d5c2 | 2019-09-14 23:30:32 +0200 | [diff] [blame] | 7 | #ifdef CONFIG_PCI_ATS |
| 8 | /* Address Translation Service */ |
| 9 | int pci_enable_ats(struct pci_dev *dev, int ps); |
| 10 | void pci_disable_ats(struct pci_dev *dev); |
| 11 | int pci_ats_queue_depth(struct pci_dev *dev); |
| 12 | int pci_ats_page_aligned(struct pci_dev *dev); |
| 13 | #else /* CONFIG_PCI_ATS */ |
| 14 | static inline int pci_enable_ats(struct pci_dev *d, int ps) |
| 15 | { return -ENODEV; } |
| 16 | static inline void pci_disable_ats(struct pci_dev *d) { } |
| 17 | static inline int pci_ats_queue_depth(struct pci_dev *d) |
| 18 | { return -ENODEV; } |
| 19 | static inline int pci_ats_page_aligned(struct pci_dev *dev) |
| 20 | { return 0; } |
| 21 | #endif /* CONFIG_PCI_ATS */ |
Joerg Roedel | c320b97 | 2011-09-27 15:57:15 +0200 | [diff] [blame] | 22 | |
Krzysztof Wilczynski | b24d5c2 | 2019-09-14 23:30:32 +0200 | [diff] [blame] | 23 | #ifdef CONFIG_PCI_PRI |
Bjorn Helgaas | f39d5b7 | 2013-04-12 12:02:59 -0600 | [diff] [blame] | 24 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); |
| 25 | void pci_disable_pri(struct pci_dev *pdev); |
Bjorn Helgaas | f39d5b7 | 2013-04-12 12:02:59 -0600 | [diff] [blame] | 26 | int pci_reset_pri(struct pci_dev *pdev); |
Bjorn Helgaas | 8cbb8a9 | 2019-10-09 14:54:01 -0500 | [diff] [blame] | 27 | int pci_prg_resp_pasid_required(struct pci_dev *pdev); |
Joerg Roedel | c320b97 | 2011-09-27 15:57:15 +0200 | [diff] [blame] | 28 | #endif /* CONFIG_PCI_PRI */ |
| 29 | |
Joerg Roedel | 086ac11 | 2011-09-27 15:57:16 +0200 | [diff] [blame] | 30 | #ifdef CONFIG_PCI_PASID |
Bjorn Helgaas | f39d5b7 | 2013-04-12 12:02:59 -0600 | [diff] [blame] | 31 | int pci_enable_pasid(struct pci_dev *pdev, int features); |
| 32 | void pci_disable_pasid(struct pci_dev *pdev); |
| 33 | int pci_pasid_features(struct pci_dev *pdev); |
| 34 | int pci_max_pasids(struct pci_dev *pdev); |
Krzysztof Wilczynski | b24d5c2 | 2019-09-14 23:30:32 +0200 | [diff] [blame] | 35 | #else /* CONFIG_PCI_PASID */ |
Jean-Philippe Brucker | 5a4549f | 2020-01-15 13:52:38 +0100 | [diff] [blame] | 36 | static inline int pci_enable_pasid(struct pci_dev *pdev, int features) |
| 37 | { return -EINVAL; } |
| 38 | static inline void pci_disable_pasid(struct pci_dev *pdev) { } |
Joerg Roedel | 086ac11 | 2011-09-27 15:57:16 +0200 | [diff] [blame] | 39 | static inline int pci_pasid_features(struct pci_dev *pdev) |
Krzysztof Wilczynski | b24d5c2 | 2019-09-14 23:30:32 +0200 | [diff] [blame] | 40 | { return -EINVAL; } |
Joerg Roedel | 086ac11 | 2011-09-27 15:57:16 +0200 | [diff] [blame] | 41 | static inline int pci_max_pasids(struct pci_dev *pdev) |
Krzysztof Wilczynski | b24d5c2 | 2019-09-14 23:30:32 +0200 | [diff] [blame] | 42 | { return -EINVAL; } |
Joerg Roedel | 086ac11 | 2011-09-27 15:57:16 +0200 | [diff] [blame] | 43 | #endif /* CONFIG_PCI_PASID */ |
| 44 | |
Krzysztof Wilczynski | b24d5c2 | 2019-09-14 23:30:32 +0200 | [diff] [blame] | 45 | #endif /* LINUX_PCI_ATS_H */ |