pci-ats.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef LINUX_PCI_ATS_H
  3. #define LINUX_PCI_ATS_H
  4. #include <linux/pci.h>
  5. #ifdef CONFIG_PCI_PRI
  6. int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
  7. void pci_disable_pri(struct pci_dev *pdev);
  8. void pci_restore_pri_state(struct pci_dev *pdev);
  9. int pci_reset_pri(struct pci_dev *pdev);
  10. #else /* CONFIG_PCI_PRI */
  11. static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
  12. {
  13. return -ENODEV;
  14. }
  15. static inline void pci_disable_pri(struct pci_dev *pdev)
  16. {
  17. }
  18. static inline void pci_restore_pri_state(struct pci_dev *pdev)
  19. {
  20. }
  21. static inline int pci_reset_pri(struct pci_dev *pdev)
  22. {
  23. return -ENODEV;
  24. }
  25. #endif /* CONFIG_PCI_PRI */
  26. #ifdef CONFIG_PCI_PASID
  27. int pci_enable_pasid(struct pci_dev *pdev, int features);
  28. void pci_disable_pasid(struct pci_dev *pdev);
  29. void pci_restore_pasid_state(struct pci_dev *pdev);
  30. int pci_pasid_features(struct pci_dev *pdev);
  31. int pci_max_pasids(struct pci_dev *pdev);
  32. #else /* CONFIG_PCI_PASID */
  33. static inline int pci_enable_pasid(struct pci_dev *pdev, int features)
  34. {
  35. return -EINVAL;
  36. }
  37. static inline void pci_disable_pasid(struct pci_dev *pdev)
  38. {
  39. }
  40. static inline void pci_restore_pasid_state(struct pci_dev *pdev)
  41. {
  42. }
  43. static inline int pci_pasid_features(struct pci_dev *pdev)
  44. {
  45. return -EINVAL;
  46. }
  47. static inline int pci_max_pasids(struct pci_dev *pdev)
  48. {
  49. return -EINVAL;
  50. }
  51. #endif /* CONFIG_PCI_PASID */
  52. #endif /* LINUX_PCI_ATS_H*/