File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change 9
9
* Copyright (C) 2011 Advanced Micro Devices,
10
10
*/
11
11
12
+ #include <linux/bitfield.h>
12
13
#include <linux/export.h>
13
14
#include <linux/pci-ats.h>
14
15
#include <linux/pci.h>
@@ -480,8 +481,6 @@ int pci_pasid_features(struct pci_dev *pdev)
480
481
}
481
482
EXPORT_SYMBOL_GPL (pci_pasid_features );
482
483
483
- #define PASID_NUMBER_SHIFT 8
484
- #define PASID_NUMBER_MASK (0x1f << PASID_NUMBER_SHIFT)
485
484
/**
486
485
* pci_max_pasids - Get maximum number of PASIDs supported by device
487
486
* @pdev: PCI device structure
@@ -503,9 +502,7 @@ int pci_max_pasids(struct pci_dev *pdev)
503
502
504
503
pci_read_config_word (pdev , pasid + PCI_PASID_CAP , & supported );
505
504
506
- supported = (supported & PASID_NUMBER_MASK ) >> PASID_NUMBER_SHIFT ;
507
-
508
- return (1 << supported );
505
+ return (1 << FIELD_GET (PCI_PASID_CAP_WIDTH , supported ));
509
506
}
510
507
EXPORT_SYMBOL_GPL (pci_max_pasids );
511
508
#endif /* CONFIG_PCI_PASID */
Original file line number Diff line number Diff line change 932
932
#define PCI_PASID_CAP 0x04 /* PASID feature register */
933
933
#define PCI_PASID_CAP_EXEC 0x0002 /* Exec permissions Supported */
934
934
#define PCI_PASID_CAP_PRIV 0x0004 /* Privilege Mode Supported */
935
+ #define PCI_PASID_CAP_WIDTH 0x1f00
935
936
#define PCI_PASID_CTRL 0x06 /* PASID control register */
936
937
#define PCI_PASID_CTRL_ENABLE 0x0001 /* Enable bit */
937
938
#define PCI_PASID_CTRL_EXEC 0x0002 /* Exec permissions Enable */
You can’t perform that action at this time.
0 commit comments