diff options
author | Alex Williamson <alex.williamson@redhat.com> | 2011-11-02 16:07:15 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2012-01-06 15:10:26 -0500 |
commit | cfa4d8cc56853ec945956d182ecb4c99102b110a (patch) | |
tree | ca29cfe3fa5b15f70ff65d0598a34b17c46ff19e | |
parent | da8d1c8ba4dcb16d60be54b233deca9a7cac98dc (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.c | 20 | ||||
-rw-r--r-- | include/linux/pci_regs.h | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c index b0dd08e6a9da..e11ebafaf774 100644 --- a/drivers/pci/ats.c +++ b/drivers/pci/ats.c | |||
@@ -175,7 +175,7 @@ int pci_enable_pri(struct pci_dev *pdev, u32 reqs) | |||
175 | u32 max_requests; | 175 | u32 max_requests; |
176 | int pos; | 176 | int pos; |
177 | 177 | ||
178 | pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); | 178 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); |
179 | if (!pos) | 179 | if (!pos) |
180 | return -EINVAL; | 180 | return -EINVAL; |
181 | 181 | ||
@@ -206,7 +206,7 @@ void pci_disable_pri(struct pci_dev *pdev) | |||
206 | u16 control; | 206 | u16 control; |
207 | int pos; | 207 | int pos; |
208 | 208 | ||
209 | pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); | 209 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); |
210 | if (!pos) | 210 | if (!pos) |
211 | return; | 211 | return; |
212 | 212 | ||
@@ -227,7 +227,7 @@ bool pci_pri_enabled(struct pci_dev *pdev) | |||
227 | u16 control; | 227 | u16 control; |
228 | int pos; | 228 | int pos; |
229 | 229 | ||
230 | pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); | 230 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); |
231 | if (!pos) | 231 | if (!pos) |
232 | return false; | 232 | return false; |
233 | 233 | ||
@@ -249,7 +249,7 @@ int pci_reset_pri(struct pci_dev *pdev) | |||
249 | u16 control; | 249 | u16 control; |
250 | int pos; | 250 | int pos; |
251 | 251 | ||
252 | pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); | 252 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); |
253 | if (!pos) | 253 | if (!pos) |
254 | return -EINVAL; | 254 | return -EINVAL; |
255 | 255 | ||
@@ -282,7 +282,7 @@ bool pci_pri_stopped(struct pci_dev *pdev) | |||
282 | u16 control, status; | 282 | u16 control, status; |
283 | int pos; | 283 | int pos; |
284 | 284 | ||
285 | pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); | 285 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); |
286 | if (!pos) | 286 | if (!pos) |
287 | return true; | 287 | return true; |
288 | 288 | ||
@@ -311,7 +311,7 @@ int pci_pri_status(struct pci_dev *pdev) | |||
311 | u16 status, control; | 311 | u16 status, control; |
312 | int pos; | 312 | int pos; |
313 | 313 | ||
314 | pos = pci_find_ext_capability(pdev, PCI_PRI_CAP); | 314 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PRI); |
315 | if (!pos) | 315 | if (!pos) |
316 | return -EINVAL; | 316 | return -EINVAL; |
317 | 317 | ||
@@ -342,7 +342,7 @@ int pci_enable_pasid(struct pci_dev *pdev, int features) | |||
342 | u16 control, supported; | 342 | u16 control, supported; |
343 | int pos; | 343 | int pos; |
344 | 344 | ||
345 | pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); | 345 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); |
346 | if (!pos) | 346 | if (!pos) |
347 | return -EINVAL; | 347 | return -EINVAL; |
348 | 348 | ||
@@ -376,7 +376,7 @@ void pci_disable_pasid(struct pci_dev *pdev) | |||
376 | u16 control = 0; | 376 | u16 control = 0; |
377 | int pos; | 377 | int pos; |
378 | 378 | ||
379 | pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); | 379 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); |
380 | if (!pos) | 380 | if (!pos) |
381 | return; | 381 | return; |
382 | 382 | ||
@@ -400,7 +400,7 @@ int pci_pasid_features(struct pci_dev *pdev) | |||
400 | u16 supported; | 400 | u16 supported; |
401 | int pos; | 401 | int pos; |
402 | 402 | ||
403 | pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); | 403 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); |
404 | if (!pos) | 404 | if (!pos) |
405 | return -EINVAL; | 405 | return -EINVAL; |
406 | 406 | ||
@@ -426,7 +426,7 @@ int pci_max_pasids(struct pci_dev *pdev) | |||
426 | u16 supported; | 426 | u16 supported; |
427 | int pos; | 427 | int pos; |
428 | 428 | ||
429 | pos = pci_find_ext_capability(pdev, PCI_PASID_CAP); | 429 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_PASID); |
430 | if (!pos) | 430 | if (!pos) |
431 | return -EINVAL; | 431 | return -EINVAL; |
432 | 432 | ||
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 */ |