blob: d08f0869f1213e3d5df4c65ad9259d280aac4342 [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
Krzysztof Wilczynskib24d5c22019-09-14 23:30:32 +02007#ifdef CONFIG_PCI_ATS
8/* Address Translation Service */
9int pci_enable_ats(struct pci_dev *dev, int ps);
10void pci_disable_ats(struct pci_dev *dev);
11int pci_ats_queue_depth(struct pci_dev *dev);
12int pci_ats_page_aligned(struct pci_dev *dev);
13#else /* CONFIG_PCI_ATS */
14static inline int pci_enable_ats(struct pci_dev *d, int ps)
15{ return -ENODEV; }
16static inline void pci_disable_ats(struct pci_dev *d) { }
17static inline int pci_ats_queue_depth(struct pci_dev *d)
18{ return -ENODEV; }
19static inline int pci_ats_page_aligned(struct pci_dev *dev)
20{ return 0; }
21#endif /* CONFIG_PCI_ATS */
Joerg Roedelc320b972011-09-27 15:57:15 +020022
Krzysztof Wilczynskib24d5c22019-09-14 23:30:32 +020023#ifdef CONFIG_PCI_PRI
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060024int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
25void pci_disable_pri(struct pci_dev *pdev);
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060026int pci_reset_pri(struct pci_dev *pdev);
Bjorn Helgaas8cbb8a92019-10-09 14:54:01 -050027int pci_prg_resp_pasid_required(struct pci_dev *pdev);
Joerg Roedelc320b972011-09-27 15:57:15 +020028#endif /* CONFIG_PCI_PRI */
29
Joerg Roedel086ac112011-09-27 15:57:16 +020030#ifdef CONFIG_PCI_PASID
Bjorn Helgaasf39d5b72013-04-12 12:02:59 -060031int pci_enable_pasid(struct pci_dev *pdev, int features);
32void pci_disable_pasid(struct pci_dev *pdev);
33int pci_pasid_features(struct pci_dev *pdev);
34int pci_max_pasids(struct pci_dev *pdev);
Krzysztof Wilczynskib24d5c22019-09-14 23:30:32 +020035#else /* CONFIG_PCI_PASID */
Jean-Philippe Brucker5a4549f2020-01-15 13:52:38 +010036static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
37{ return -EINVAL; }
38static inline void pci_disable_pasid(struct pci_dev *pdev) { }
Joerg Roedel086ac112011-09-27 15:57:16 +020039static inline int pci_pasid_features(struct pci_dev *pdev)
Krzysztof Wilczynskib24d5c22019-09-14 23:30:32 +020040{ return -EINVAL; }
Joerg Roedel086ac112011-09-27 15:57:16 +020041static inline int pci_max_pasids(struct pci_dev *pdev)
Krzysztof Wilczynskib24d5c22019-09-14 23:30:32 +020042{ return -EINVAL; }
Joerg Roedel086ac112011-09-27 15:57:16 +020043#endif /* CONFIG_PCI_PASID */
44
Krzysztof Wilczynskib24d5c22019-09-14 23:30:32 +020045#endif /* LINUX_PCI_ATS_H */