1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef LINUX_PCI_ATS_H
3#define LINUX_PCI_ATS_H
4
5#include <linux/pci.h>
6
7#ifdef CONFIG_PCI_PRI
8
9int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
10void pci_disable_pri(struct pci_dev *pdev);
11void pci_restore_pri_state(struct pci_dev *pdev);
12int pci_reset_pri(struct pci_dev *pdev);
13
14#else /* CONFIG_PCI_PRI */
15
16static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
17{
18 return -ENODEV;
19}
20
21static inline void pci_disable_pri(struct pci_dev *pdev)
22{
23}
24
25static inline void pci_restore_pri_state(struct pci_dev *pdev)
26{
27}
28
29static inline int pci_reset_pri(struct pci_dev *pdev)
30{
31 return -ENODEV;
32}
33
34#endif /* CONFIG_PCI_PRI */
35
36#ifdef CONFIG_PCI_PASID
37
38int pci_enable_pasid(struct pci_dev *pdev, int features);
39void pci_disable_pasid(struct pci_dev *pdev);
40void pci_restore_pasid_state(struct pci_dev *pdev);
41int pci_pasid_features(struct pci_dev *pdev);
42int pci_max_pasids(struct pci_dev *pdev);
43int pci_prg_resp_pasid_required(struct pci_dev *pdev);
44
45#else /* CONFIG_PCI_PASID */
46
47static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
48{
49 return -EINVAL;
50}
51
52static inline void pci_disable_pasid(struct pci_dev *pdev)
53{
54}
55
56static inline void pci_restore_pasid_state(struct pci_dev *pdev)
57{
58}
59
60static inline int pci_pasid_features(struct pci_dev *pdev)
61{
62 return -EINVAL;
63}
64
65static inline int pci_max_pasids(struct pci_dev *pdev)
66{
67 return -EINVAL;
68}
69
70static inline int pci_prg_resp_pasid_required(struct pci_dev *pdev)
71{
72 return 0;
73}
74#endif /* CONFIG_PCI_PASID */
75
76
77#endif /* LINUX_PCI_ATS_H*/
78