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 int pci_enable_ats(struct pci_dev *dev, int ps);
18 void pci_disable_ats(struct pci_dev *dev);
19 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 int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58 void pci_disable_pri(struct pci_dev *pdev);
59 int pci_reset_pri(struct pci_dev *pdev);
61 #else /* CONFIG_PCI_PRI */
63 static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
68 static inline void pci_disable_pri(struct pci_dev *pdev)
72 static inline int pci_reset_pri(struct pci_dev *pdev)
77 #endif /* CONFIG_PCI_PRI */
79 #ifdef CONFIG_PCI_PASID
81 int pci_enable_pasid(struct pci_dev *pdev, int features);
82 void pci_disable_pasid(struct pci_dev *pdev);
83 int pci_pasid_features(struct pci_dev *pdev);
84 int pci_max_pasids(struct pci_dev *pdev);
86 #else /* CONFIG_PCI_PASID */
88 static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
93 static inline void pci_disable_pasid(struct pci_dev *pdev)
97 static inline int pci_pasid_features(struct pci_dev *pdev)
102 static inline int pci_max_pasids(struct pci_dev *pdev)
107 #endif /* CONFIG_PCI_PASID */
110 #endif /* LINUX_PCI_ATS_H*/