1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef LINUX_PCI_ATS_H
3 #define LINUX_PCI_ATS_H
8 /* Address Translation Service */
9 bool pci_ats_supported(struct pci_dev
*dev
);
10 int pci_enable_ats(struct pci_dev
*dev
, int ps
);
11 int pci_prepare_ats(struct pci_dev
*dev
, int ps
);
12 void pci_disable_ats(struct pci_dev
*dev
);
13 int pci_ats_queue_depth(struct pci_dev
*dev
);
14 int pci_ats_page_aligned(struct pci_dev
*dev
);
15 #else /* CONFIG_PCI_ATS */
16 static inline bool pci_ats_supported(struct pci_dev
*d
)
18 static inline int pci_enable_ats(struct pci_dev
*d
, int ps
)
20 static inline int pci_prepare_ats(struct pci_dev
*dev
, int ps
)
22 static inline void pci_disable_ats(struct pci_dev
*d
) { }
23 static inline int pci_ats_queue_depth(struct pci_dev
*d
)
25 static inline int pci_ats_page_aligned(struct pci_dev
*dev
)
27 #endif /* CONFIG_PCI_ATS */
30 int pci_enable_pri(struct pci_dev
*pdev
, u32 reqs
);
31 void pci_disable_pri(struct pci_dev
*pdev
);
32 int pci_reset_pri(struct pci_dev
*pdev
);
33 int pci_prg_resp_pasid_required(struct pci_dev
*pdev
);
34 bool pci_pri_supported(struct pci_dev
*pdev
);
36 static inline bool pci_pri_supported(struct pci_dev
*pdev
)
38 #endif /* CONFIG_PCI_PRI */
40 #ifdef CONFIG_PCI_PASID
41 int pci_enable_pasid(struct pci_dev
*pdev
, int features
);
42 void pci_disable_pasid(struct pci_dev
*pdev
);
43 int pci_pasid_features(struct pci_dev
*pdev
);
44 int pci_max_pasids(struct pci_dev
*pdev
);
45 #else /* CONFIG_PCI_PASID */
46 static inline int pci_enable_pasid(struct pci_dev
*pdev
, int features
)
48 static inline void pci_disable_pasid(struct pci_dev
*pdev
) { }
49 static inline int pci_pasid_features(struct pci_dev
*pdev
)
51 static inline int pci_max_pasids(struct pci_dev
*pdev
)
53 #endif /* CONFIG_PCI_PASID */
55 #endif /* LINUX_PCI_ATS_H */