aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/pci-ats.h42
-rw-r--r--include/linux/pci_regs.h12
2 files changed, 54 insertions, 0 deletions
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index 4eab42bf2af9..071395251abf 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -17,6 +17,7 @@ struct pci_ats {
17extern int pci_enable_ats(struct pci_dev *dev, int ps); 17extern int pci_enable_ats(struct pci_dev *dev, int ps);
18extern void pci_disable_ats(struct pci_dev *dev); 18extern void pci_disable_ats(struct pci_dev *dev);
19extern int pci_ats_queue_depth(struct pci_dev *dev); 19extern int pci_ats_queue_depth(struct pci_dev *dev);
20
20/** 21/**
21 * pci_ats_enabled - query the ATS status 22 * pci_ats_enabled - query the ATS status
22 * @dev: the PCI device 23 * @dev: the PCI device
@@ -51,4 +52,45 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
51 52
52#endif /* CONFIG_PCI_IOV */ 53#endif /* CONFIG_PCI_IOV */
53 54
55#ifdef CONFIG_PCI_PRI
56
57extern int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58extern void pci_disable_pri(struct pci_dev *pdev);
59extern bool pci_pri_enabled(struct pci_dev *pdev);
60extern int pci_reset_pri(struct pci_dev *pdev);
61extern bool pci_pri_stopped(struct pci_dev *pdev);
62extern int pci_pri_status(struct pci_dev *pdev);
63
64#else /* CONFIG_PCI_PRI */
65
66static inline int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
67{
68 return -ENODEV;
69}
70
71static inline void pci_disable_pri(struct pci_dev *pdev)
72{
73}
74
75static inline bool pci_pri_enabled(struct pci_dev *pdev)
76{
77 return false;
78}
79
80static inline int pci_reset_pri(struct pci_dev *pdev)
81{
82 return -ENODEV;
83}
84
85static inline bool pci_pri_stopped(struct pci_dev *pdev)
86{
87 return true;
88}
89
90static inline int pci_pri_status(struct pci_dev *pdev)
91{
92 return -ENODEV;
93}
94#endif /* CONFIG_PCI_PRI */
95
54#endif /* LINUX_PCI_ATS_H*/ 96#endif /* LINUX_PCI_ATS_H*/
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index e8840964aca1..7fc32aff94d2 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -663,6 +663,18 @@
663#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ 663#define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */
664#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 664#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
665 665
666/* Page Request Interface */
667#define PCI_PRI_CAP 0x13 /* PRI capability ID */
668#define PCI_PRI_CONTROL_OFF 0x04 /* Offset of control register */
669#define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */
670#define PCI_PRI_ENABLE 0x0001 /* Enable mask */
671#define PCI_PRI_RESET 0x0002 /* Reset bit mask */
672#define PCI_PRI_STATUS_RF 0x0001 /* Request Failure */
673#define PCI_PRI_STATUS_UPRGI 0x0002 /* Unexpected PRG index */
674#define PCI_PRI_STATUS_STOPPED 0x0100 /* PRI Stopped */
675#define PCI_PRI_MAX_REQ_OFF 0x08 /* Cap offset for max reqs supported */
676#define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */
677
666/* Single Root I/O Virtualization */ 678/* Single Root I/O Virtualization */
667#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ 679#define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */
668#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ 680#define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */