blob: 7c4b8e27268c7455c9f13234d0d2790dfb46dfc4 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Joerg Roedel5cdede22011-04-04 15:55:18 +02002#ifndef LINUX_PCI_ATS_H
3#define LINUX_PCI_ATS_H
4
Joerg Roedeldb3c33c2011-09-27 15:57:13 +02005#include <linux/pci.h>
6
Joerg Roedelc320b972011-09-27 15:57:15 +02007#ifdef CONFIG_PCI_PRI
8
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -06009int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
10void pci_disable_pri(struct pci_dev *pdev);
CQ Tang4ebeb1e2017-05-30 09:25:49 -070011void pci_restore_pri_state(struct pci_dev *pdev);
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060012int pci_reset_pri(struct pci_dev *pdev);
Joerg Roedelc320b972011-09-27 15:57:15 +020013
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
CQ Tang4ebeb1e2017-05-30 09:25:49 -070025static inline void pci_restore_pri_state(struct pci_dev *pdev)
26{
27}
28
Joerg Roedelc320b972011-09-27 15:57:15 +020029static inline int pci_reset_pri(struct pci_dev *pdev)
30{
31 return -ENODEV;
32}
33
Joerg Roedelc320b972011-09-27 15:57:15 +020034#endif /* CONFIG_PCI_PRI */
35
Joerg Roedel086ac112011-09-27 15:57:16 +020036#ifdef CONFIG_PCI_PASID
37
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060038int pci_enable_pasid(struct pci_dev *pdev, int features);
39void pci_disable_pasid(struct pci_dev *pdev);
CQ Tang4ebeb1e2017-05-30 09:25:49 -070040void pci_restore_pasid_state(struct pci_dev *pdev);
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060041int pci_pasid_features(struct pci_dev *pdev);
42int pci_max_pasids(struct pci_dev *pdev);
Joerg Roedel086ac112011-09-27 15:57:16 +020043
44#else /* CONFIG_PCI_PASID */
45
46static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
47{
48 return -EINVAL;
49}
50
51static inline void pci_disable_pasid(struct pci_dev *pdev)
52{
53}
54
CQ Tang4ebeb1e2017-05-30 09:25:49 -070055static inline void pci_restore_pasid_state(struct pci_dev *pdev)
56{
57}
58
Joerg Roedel086ac112011-09-27 15:57:16 +020059static inline int pci_pasid_features(struct pci_dev *pdev)
60{
61 return -EINVAL;
62}
63
64static inline int pci_max_pasids(struct pci_dev *pdev)
65{
66 return -EINVAL;
67}
68
69#endif /* CONFIG_PCI_PASID */
70
71
Joerg Roedel5cdede22011-04-04 15:55:18 +020072#endif /* LINUX_PCI_ATS_H*/