diff options
Diffstat (limited to 'drivers/pci/pci.h')
-rw-r--r-- | drivers/pci/pci.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index d03f6b99f292..f73bcbedf37c 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -229,6 +229,15 @@ struct pci_sriov { | |||
229 | u8 __iomem *mstate; /* VF Migration State Array */ | 229 | u8 __iomem *mstate; /* VF Migration State Array */ |
230 | }; | 230 | }; |
231 | 231 | ||
232 | /* Address Translation Service */ | ||
233 | struct pci_ats { | ||
234 | int pos; /* capability position */ | ||
235 | int stu; /* Smallest Translation Unit */ | ||
236 | int qdep; /* Invalidate Queue Depth */ | ||
237 | int ref_cnt; /* Physical Function reference count */ | ||
238 | int is_enabled:1; /* Enable bit is set */ | ||
239 | }; | ||
240 | |||
232 | #ifdef CONFIG_PCI_IOV | 241 | #ifdef CONFIG_PCI_IOV |
233 | extern int pci_iov_init(struct pci_dev *dev); | 242 | extern int pci_iov_init(struct pci_dev *dev); |
234 | extern void pci_iov_release(struct pci_dev *dev); | 243 | extern void pci_iov_release(struct pci_dev *dev); |
@@ -236,6 +245,20 @@ extern int pci_iov_resource_bar(struct pci_dev *dev, int resno, | |||
236 | enum pci_bar_type *type); | 245 | enum pci_bar_type *type); |
237 | extern void pci_restore_iov_state(struct pci_dev *dev); | 246 | extern void pci_restore_iov_state(struct pci_dev *dev); |
238 | extern int pci_iov_bus_range(struct pci_bus *bus); | 247 | extern int pci_iov_bus_range(struct pci_bus *bus); |
248 | |||
249 | extern int pci_enable_ats(struct pci_dev *dev, int ps); | ||
250 | extern void pci_disable_ats(struct pci_dev *dev); | ||
251 | extern int pci_ats_queue_depth(struct pci_dev *dev); | ||
252 | /** | ||
253 | * pci_ats_enabled - query the ATS status | ||
254 | * @dev: the PCI device | ||
255 | * | ||
256 | * Returns 1 if ATS capability is enabled, or 0 if not. | ||
257 | */ | ||
258 | static inline int pci_ats_enabled(struct pci_dev *dev) | ||
259 | { | ||
260 | return dev->ats && dev->ats->is_enabled; | ||
261 | } | ||
239 | #else | 262 | #else |
240 | static inline int pci_iov_init(struct pci_dev *dev) | 263 | static inline int pci_iov_init(struct pci_dev *dev) |
241 | { | 264 | { |
@@ -257,6 +280,22 @@ static inline int pci_iov_bus_range(struct pci_bus *bus) | |||
257 | { | 280 | { |
258 | return 0; | 281 | return 0; |
259 | } | 282 | } |
283 | |||
284 | static inline int pci_enable_ats(struct pci_dev *dev, int ps) | ||
285 | { | ||
286 | return -ENODEV; | ||
287 | } | ||
288 | static inline void pci_disable_ats(struct pci_dev *dev) | ||
289 | { | ||
290 | } | ||
291 | static inline int pci_ats_queue_depth(struct pci_dev *dev) | ||
292 | { | ||
293 | return -ENODEV; | ||
294 | } | ||
295 | static inline int pci_ats_enabled(struct pci_dev *dev) | ||
296 | { | ||
297 | return 0; | ||
298 | } | ||
260 | #endif /* CONFIG_PCI_IOV */ | 299 | #endif /* CONFIG_PCI_IOV */ |
261 | 300 | ||
262 | #endif /* DRIVERS_PCI_H */ | 301 | #endif /* DRIVERS_PCI_H */ |