1 #ifndef LINUX_PCI_ATS_H
2 #define LINUX_PCI_ATS_H
6 /* Address Translation Service */
8 int pos; /* capability position */
9 int stu; /* Smallest Translation Unit */
10 int qdep; /* Invalidate Queue Depth */
11 int ref_cnt; /* Physical Function reference count */
12 unsigned int is_enabled:1; /* Enable bit is set */
17 extern int pci_enable_ats(struct pci_dev *dev, int ps);
18 extern void pci_disable_ats(struct pci_dev *dev);
19 extern int pci_ats_queue_depth(struct pci_dev *dev);
22 * pci_ats_enabled - query the ATS status
23 * @dev: the PCI device
25 * Returns 1 if ATS capability is enabled, or 0 if not.
27 static inline int pci_ats_enabled(struct pci_dev *dev)
29 return dev->ats && dev->ats->is_enabled;
32 #else /* CONFIG_PCI_ATS */
34 static inline int pci_enable_ats(struct pci_dev *dev, int ps)
39 static inline void pci_disable_ats(struct pci_dev *dev)
43 static inline int pci_ats_queue_depth(struct pci_dev *dev)
48 static inline int pci_ats_enabled(struct pci_dev *dev)
53 #endif /* CONFIG_PCI_ATS */
57 extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58 extern void pci_disable_pri(struct pci_dev *pdev);
59 extern bool pci_pri_enabled(struct pci_dev *pdev);
60 extern int pci_reset_pri(struct pci_dev *pdev);
61 extern bool pci_pri_stopped(struct pci_dev *pdev);
62 extern int pci_pri_status(struct pci_dev *pdev);
64 #else /* CONFIG_PCI_PRI */
66 static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
71 static inline void pci_disable_pri(struct pci_dev *pdev)
75 static inline bool pci_pri_enabled(struct pci_dev *pdev)
80 static inline int pci_reset_pri(struct pci_dev *pdev)
85 static inline bool pci_pri_stopped(struct pci_dev *pdev)
90 static inline int pci_pri_status(struct pci_dev *pdev)
94 #endif /* CONFIG_PCI_PRI */
96 #ifdef CONFIG_PCI_PASID
98 extern int pci_enable_pasid(struct pci_dev *pdev, int features);
99 extern void pci_disable_pasid(struct pci_dev *pdev);
100 extern int pci_pasid_features(struct pci_dev *pdev);
101 extern int pci_max_pasids(struct pci_dev *pdev);
103 #else /* CONFIG_PCI_PASID */
105 static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
110 static inline void pci_disable_pasid(struct pci_dev *pdev)
114 static inline int pci_pasid_features(struct pci_dev *pdev)
119 static inline int pci_max_pasids(struct pci_dev *pdev)
124 #endif /* CONFIG_PCI_PASID */
127 #endif /* LINUX_PCI_ATS_H*/