提交 cfa4d8cc 编写于 作者: A Alex Williamson 提交者: Jesse Barnes

PCI: Fix PRI and PASID consistency

These are extended capabilities, rename and move to proper
group for consistency.
Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
上级 da8d1c8b
...@@ -175,7 +175,7 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs) ...@@ -175,7 +175,7 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
u32 max_requests; u32 max_requests;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos) if (!pos)
return -EINVAL; return -EINVAL;
...@@ -206,7 +206,7 @@ void pci_disable_pri(struct pci_dev *pdev) ...@@ -206,7 +206,7 @@ void pci_disable_pri(struct pci_dev *pdev)
u16 control; u16 control;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos) if (!pos)
return; return;
...@@ -227,7 +227,7 @@ bool pci_pri_enabled(struct pci_dev *pdev) ...@@ -227,7 +227,7 @@ bool pci_pri_enabled(struct pci_dev *pdev)
u16 control; u16 control;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos) if (!pos)
return false; return false;
...@@ -249,7 +249,7 @@ int pci_reset_pri(struct pci_dev *pdev) ...@@ -249,7 +249,7 @@ int pci_reset_pri(struct pci_dev *pdev)
u16 control; u16 control;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos) if (!pos)
return -EINVAL; return -EINVAL;
...@@ -282,7 +282,7 @@ bool pci_pri_stopped(struct pci_dev *pdev) ...@@ -282,7 +282,7 @@ bool pci_pri_stopped(struct pci_dev *pdev)
u16 control, status; u16 control, status;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos) if (!pos)
return true; return true;
...@@ -311,7 +311,7 @@ int pci_pri_status(struct pci_dev *pdev) ...@@ -311,7 +311,7 @@ int pci_pri_status(struct pci_dev *pdev)
u16 status, control; u16 status, control;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
if (!pos) if (!pos)
return -EINVAL; return -EINVAL;
...@@ -342,7 +342,7 @@ int pci_enable_pasid(struct pci_dev *pdev, int features) ...@@ -342,7 +342,7 @@ int pci_enable_pasid(struct pci_dev *pdev, int features)
u16 control, supported; u16 control, supported;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
if (!pos) if (!pos)
return -EINVAL; return -EINVAL;
...@@ -376,7 +376,7 @@ void pci_disable_pasid(struct pci_dev *pdev) ...@@ -376,7 +376,7 @@ void pci_disable_pasid(struct pci_dev *pdev)
u16 control = 0; u16 control = 0;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
if (!pos) if (!pos)
return; return;
...@@ -400,7 +400,7 @@ int pci_pasid_features(struct pci_dev *pdev) ...@@ -400,7 +400,7 @@ int pci_pasid_features(struct pci_dev *pdev)
u16 supported; u16 supported;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
if (!pos) if (!pos)
return -EINVAL; return -EINVAL;
...@@ -426,7 +426,7 @@ int pci_max_pasids(struct pci_dev *pdev) ...@@ -426,7 +426,7 @@ int pci_max_pasids(struct pci_dev *pdev)
u16 supported; u16 supported;
int pos; int pos;
pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
if (!pos) if (!pos)
return -EINVAL; return -EINVAL;
......
...@@ -537,7 +537,9 @@ ...@@ -537,7 +537,9 @@
#define PCI_EXT_CAP_ID_ARI 14 #define PCI_EXT_CAP_ID_ARI 14
#define PCI_EXT_CAP_ID_ATS 15 #define PCI_EXT_CAP_ID_ATS 15
#define PCI_EXT_CAP_ID_SRIOV 16 #define PCI_EXT_CAP_ID_SRIOV 16
#define PCI_EXT_CAP_ID_PRI 19
#define PCI_EXT_CAP_ID_LTR 24 #define PCI_EXT_CAP_ID_LTR 24
#define PCI_EXT_CAP_ID_PASID 27
/* Advanced Error Reporting */ /* Advanced Error Reporting */
#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ #define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
...@@ -664,7 +666,6 @@ ...@@ -664,7 +666,6 @@
#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
/* Page Request Interface */ /* Page Request Interface */
#define PCI_PRI_CAP 0x13 /* PRI capability ID */
#define PCI_PRI_CONTROL_OFF 0x04 /* Offset of control register */ #define PCI_PRI_CONTROL_OFF 0x04 /* Offset of control register */
#define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */ #define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */
#define PCI_PRI_ENABLE 0x0001 /* Enable mask */ #define PCI_PRI_ENABLE 0x0001 /* Enable mask */
...@@ -676,7 +677,6 @@ ...@@ -676,7 +677,6 @@
#define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */ #define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */
/* PASID capability */ /* PASID capability */
#define PCI_PASID_CAP 0x1b /* PASID capability ID */
#define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */ #define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */
#define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */ #define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */
#define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */ #define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册