]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - include/linux/pci-ats.h
Merge tag 'block-5.15-2021-10-01' of git://git.kernel.dk/linux-block
[mirror_ubuntu-jammy-kernel.git] / include / linux / pci-ats.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
5cdede24
JR
2#ifndef LINUX_PCI_ATS_H
3#define LINUX_PCI_ATS_H
4
db3c33c6
JR
5#include <linux/pci.h>
6
b24d5c20
KW
7#ifdef CONFIG_PCI_ATS
8/* Address Translation Service */
52137674 9bool pci_ats_supported(struct pci_dev *dev);
b24d5c20
KW
10int pci_enable_ats(struct pci_dev *dev, int ps);
11void pci_disable_ats(struct pci_dev *dev);
12int pci_ats_queue_depth(struct pci_dev *dev);
13int pci_ats_page_aligned(struct pci_dev *dev);
14#else /* CONFIG_PCI_ATS */
52137674
JPB
15static inline bool pci_ats_supported(struct pci_dev *d)
16{ return false; }
b24d5c20
KW
17static inline int pci_enable_ats(struct pci_dev *d, int ps)
18{ return -ENODEV; }
19static inline void pci_disable_ats(struct pci_dev *d) { }
20static inline int pci_ats_queue_depth(struct pci_dev *d)
21{ return -ENODEV; }
22static inline int pci_ats_page_aligned(struct pci_dev *dev)
23{ return 0; }
24#endif /* CONFIG_PCI_ATS */
c320b976 25
b24d5c20 26#ifdef CONFIG_PCI_PRI
f39d5b72
BH
27int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
28void pci_disable_pri(struct pci_dev *pdev);
f39d5b72 29int pci_reset_pri(struct pci_dev *pdev);
8cbb8a93 30int pci_prg_resp_pasid_required(struct pci_dev *pdev);
3f9a7a13
AR
31bool pci_pri_supported(struct pci_dev *pdev);
32#else
33static inline bool pci_pri_supported(struct pci_dev *pdev)
34{ return false; }
c320b976
JR
35#endif /* CONFIG_PCI_PRI */
36
086ac11f 37#ifdef CONFIG_PCI_PASID
f39d5b72
BH
38int pci_enable_pasid(struct pci_dev *pdev, int features);
39void pci_disable_pasid(struct pci_dev *pdev);
40int pci_pasid_features(struct pci_dev *pdev);
41int pci_max_pasids(struct pci_dev *pdev);
b24d5c20 42#else /* CONFIG_PCI_PASID */
5a4549fd
JPB
43static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
44{ return -EINVAL; }
45static inline void pci_disable_pasid(struct pci_dev *pdev) { }
086ac11f 46static inline int pci_pasid_features(struct pci_dev *pdev)
b24d5c20 47{ return -EINVAL; }
086ac11f 48static inline int pci_max_pasids(struct pci_dev *pdev)
b24d5c20 49{ return -EINVAL; }
086ac11f
JR
50#endif /* CONFIG_PCI_PASID */
51
b24d5c20 52#endif /* LINUX_PCI_ATS_H */