OMAPDSS: VENC: fix NULL pointer dereference in DSS2 VENC sysfs debug attr on OMAP4
[zen-stable.git] / include / linux / pci-ats.h
blob7ef68724f0f054f88427d2dbc18c63b962a16394
1 #ifndef LINUX_PCI_ATS_H
2 #define LINUX_PCI_ATS_H
4 #include <linux/pci.h>
6 /* Address Translation Service */
7 struct pci_ats {
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 */
15 #ifdef CONFIG_PCI_ATS
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);
21 /**
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)
36 return -ENODEV;
39 static inline void pci_disable_ats(struct pci_dev *dev)
43 static inline int pci_ats_queue_depth(struct pci_dev *dev)
45 return -ENODEV;
48 static inline int pci_ats_enabled(struct pci_dev *dev)
50 return 0;
53 #endif /* CONFIG_PCI_ATS */
55 #ifdef CONFIG_PCI_PRI
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)
68 return -ENODEV;
71 static inline void pci_disable_pri(struct pci_dev *pdev)
75 static inline bool pci_pri_enabled(struct pci_dev *pdev)
77 return false;
80 static inline int pci_reset_pri(struct pci_dev *pdev)
82 return -ENODEV;
85 static inline bool pci_pri_stopped(struct pci_dev *pdev)
87 return true;
90 static inline int pci_pri_status(struct pci_dev *pdev)
92 return -ENODEV;
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)
107 return -EINVAL;
110 static inline void pci_disable_pasid(struct pci_dev *pdev)
114 static inline int pci_pasid_features(struct pci_dev *pdev)
116 return -EINVAL;
119 static inline int pci_max_pasids(struct pci_dev *pdev)
121 return -EINVAL;
124 #endif /* CONFIG_PCI_PASID */
127 #endif /* LINUX_PCI_ATS_H*/