aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Williamson <alex.williamson@redhat.com>2011-11-02 16:07:15 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2011-12-05 13:21:45 -0500
commit69166fbf02c7a21745013f2de037bf7af26e4279 (patch)
treed6cc6dbbbcf547c993203dcd4932bddd4f69be08
parentb50cac55bf859d5b2fdcc1803a553a251b703456 (diff)
PCI: Fix PRI and PASID consistency
These are extended capabilities, rename and move to proper group for consistency. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r--drivers/pci/ats.c20
-rw-r--r--include/linux/pci_regs.h4
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
index 7ec56fb0bd78..831e1920386c 100644
--- a/drivers/pci/ats.c
+++ b/drivers/pci/ats.c
@@ -174,7 +174,7 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs)
174 u32 max_requests; 174 u32 max_requests;
175 int pos; 175 int pos;
176 176
177 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 177 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
178 if (!pos) 178 if (!pos)
179 return -EINVAL; 179 return -EINVAL;
180 180
@@ -205,7 +205,7 @@ void pci_disable_pri(struct pci_dev *pdev)
205 u16 control; 205 u16 control;
206 int pos; 206 int pos;
207 207
208 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 208 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
209 if (!pos) 209 if (!pos)
210 return; 210 return;
211 211
@@ -226,7 +226,7 @@ bool pci_pri_enabled(struct pci_dev *pdev)
226 u16 control; 226 u16 control;
227 int pos; 227 int pos;
228 228
229 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 229 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
230 if (!pos) 230 if (!pos)
231 return false; 231 return false;
232 232
@@ -248,7 +248,7 @@ int pci_reset_pri(struct pci_dev *pdev)
248 u16 control; 248 u16 control;
249 int pos; 249 int pos;
250 250
251 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 251 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
252 if (!pos) 252 if (!pos)
253 return -EINVAL; 253 return -EINVAL;
254 254
@@ -281,7 +281,7 @@ bool pci_pri_stopped(struct pci_dev *pdev)
281 u16 control, status; 281 u16 control, status;
282 int pos; 282 int pos;
283 283
284 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 284 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
285 if (!pos) 285 if (!pos)
286 return true; 286 return true;
287 287
@@ -310,7 +310,7 @@ int pci_pri_status(struct pci_dev *pdev)
310 u16 status, control; 310 u16 status, control;
311 int pos; 311 int pos;
312 312
313 pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); 313 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI);
314 if (!pos) 314 if (!pos)
315 return -EINVAL; 315 return -EINVAL;
316 316
@@ -341,7 +341,7 @@ int pci_enable_pasid(struct pci_dev *pdev, int features)
341 u16 control, supported; 341 u16 control, supported;
342 int pos; 342 int pos;
343 343
344 pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); 344 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
345 if (!pos) 345 if (!pos)
346 return -EINVAL; 346 return -EINVAL;
347 347
@@ -375,7 +375,7 @@ void pci_disable_pasid(struct pci_dev *pdev)
375 u16 control = 0; 375 u16 control = 0;
376 int pos; 376 int pos;
377 377
378 pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); 378 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
379 if (!pos) 379 if (!pos)
380 return; 380 return;
381 381
@@ -399,7 +399,7 @@ int pci_pasid_features(struct pci_dev *pdev)
399 u16 supported; 399 u16 supported;
400 int pos; 400 int pos;
401 401
402 pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); 402 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
403 if (!pos) 403 if (!pos)
404 return -EINVAL; 404 return -EINVAL;
405 405
@@ -425,7 +425,7 @@ int pci_max_pasids(struct pci_dev *pdev)
425 u16 supported; 425 u16 supported;
426 int pos; 426 int pos;
427 427
428 pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); 428 pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID);
429 if (!pos) 429 if (!pos)
430 return -EINVAL; 430 return -EINVAL;
431 431
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index b5d9657f3100..090d3a9f5b26 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -537,7 +537,9 @@
537#define PCI_EXT_CAP_ID_ARI 14 537#define PCI_EXT_CAP_ID_ARI 14
538#define PCI_EXT_CAP_ID_ATS 15 538#define PCI_EXT_CAP_ID_ATS 15
539#define PCI_EXT_CAP_ID_SRIOV 16 539#define PCI_EXT_CAP_ID_SRIOV 16
540#define PCI_EXT_CAP_ID_PRI 19
540#define PCI_EXT_CAP_ID_LTR 24 541#define PCI_EXT_CAP_ID_LTR 24
542#define PCI_EXT_CAP_ID_PASID 27
541 543
542/* Advanced Error Reporting */ 544/* Advanced Error Reporting */
543#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */ 545#define PCI_ERR_UNCOR_STATUS 4 /* Uncorrectable Error Status */
@@ -664,7 +666,6 @@
664#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ 666#define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */
665 667
666/* Page Request Interface */ 668/* 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_CONTROL_OFF 0x04 /* Offset of control register */
669#define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */ 670#define PCI_PRI_STATUS_OFF 0x06 /* Offset of status register */
670#define PCI_PRI_ENABLE 0x0001 /* Enable mask */ 671#define PCI_PRI_ENABLE 0x0001 /* Enable mask */
@@ -676,7 +677,6 @@
676#define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */ 677#define PCI_PRI_ALLOC_REQ_OFF 0x0c /* Cap offset for max reqs allowed */
677 678
678/* PASID capability */ 679/* PASID capability */
679#define PCI_PASID_CAP 0x1b /* PASID capability ID */
680#define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */ 680#define PCI_PASID_CAP_OFF 0x04 /* PASID feature register */
681#define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */ 681#define PCI_PASID_CONTROL_OFF 0x06 /* PASID control register */
682#define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */ 682#define PCI_PASID_ENABLE 0x01 /* Enable/Supported bit */