Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef LINUX_PCI_ATS_H
0003 #define LINUX_PCI_ATS_H
0004 
0005 #include <linux/pci.h>
0006 
0007 #ifdef CONFIG_PCI_ATS
0008 /* Address Translation Service */
0009 bool pci_ats_supported(struct pci_dev *dev);
0010 int pci_enable_ats(struct pci_dev *dev, int ps);
0011 void pci_disable_ats(struct pci_dev *dev);
0012 int pci_ats_queue_depth(struct pci_dev *dev);
0013 int pci_ats_page_aligned(struct pci_dev *dev);
0014 #else /* CONFIG_PCI_ATS */
0015 static inline bool pci_ats_supported(struct pci_dev *d)
0016 { return false; }
0017 static inline int pci_enable_ats(struct pci_dev *d, int ps)
0018 { return -ENODEV; }
0019 static inline void pci_disable_ats(struct pci_dev *d) { }
0020 static inline int pci_ats_queue_depth(struct pci_dev *d)
0021 { return -ENODEV; }
0022 static inline int pci_ats_page_aligned(struct pci_dev *dev)
0023 { return 0; }
0024 #endif /* CONFIG_PCI_ATS */
0025 
0026 #ifdef CONFIG_PCI_PRI
0027 int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
0028 void pci_disable_pri(struct pci_dev *pdev);
0029 int pci_reset_pri(struct pci_dev *pdev);
0030 int pci_prg_resp_pasid_required(struct pci_dev *pdev);
0031 bool pci_pri_supported(struct pci_dev *pdev);
0032 #else
0033 static inline bool pci_pri_supported(struct pci_dev *pdev)
0034 { return false; }
0035 #endif /* CONFIG_PCI_PRI */
0036 
0037 #ifdef CONFIG_PCI_PASID
0038 int pci_enable_pasid(struct pci_dev *pdev, int features);
0039 void pci_disable_pasid(struct pci_dev *pdev);
0040 int pci_pasid_features(struct pci_dev *pdev);
0041 int pci_max_pasids(struct pci_dev *pdev);
0042 #else /* CONFIG_PCI_PASID */
0043 static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
0044 { return -EINVAL; }
0045 static inline void pci_disable_pasid(struct pci_dev *pdev) { }
0046 static inline int pci_pasid_features(struct pci_dev *pdev)
0047 { return -EINVAL; }
0048 static inline int pci_max_pasids(struct pci_dev *pdev)
0049 { return -EINVAL; }
0050 #endif /* CONFIG_PCI_PASID */
0051 
0052 #endif /* LINUX_PCI_ATS_H */