blob: 1ebb88e7c184c9ce4246b043dfaf08cd00ba9357 [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);
Kuppuswamy Sathyanarayanane5567f52019-02-19 11:04:51 -080043int pci_prg_resp_pasid_required(struct pci_dev *pdev);
Joerg Roedel086ac112011-09-27 15:57:16 +020044
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
CQ Tang4ebeb1e2017-05-30 09:25:49 -070056static inline void pci_restore_pasid_state(struct pci_dev *pdev)
57{
58}
59
Joerg Roedel086ac112011-09-27 15:57:16 +020060static 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
Kuppuswamy Sathyanarayananfff42922019-02-27 11:26:46 -080070static inline int pci_prg_resp_pasid_required(struct pci_dev *pdev)
Kuppuswamy Sathyanarayanane5567f52019-02-19 11:04:51 -080071{
72 return 0;
73}
Joerg Roedel086ac112011-09-27 15:57:16 +020074#endif /* CONFIG_PCI_PASID */
75
76
Joerg Roedel5cdede22011-04-04 15:55:18 +020077#endif /* LINUX_PCI_ATS_H*/