summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c b/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c
index c75045bcab79..19d9630b24c2 100644
--- a/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c
+++ b/tools/testing/selftests/vfio/lib/drivers/dsa/dsa.c
@@ -65,9 +65,20 @@ static bool dsa_int_handle_request_required(struct vfio_pci_device *device)
static int dsa_probe(struct vfio_pci_device *device)
{
- if (!vfio_pci_device_match(device, PCI_VENDOR_ID_INTEL,
- PCI_DEVICE_ID_INTEL_DSA_SPR0))
+ const u16 vendor_id = vfio_pci_config_readw(device, PCI_VENDOR_ID);
+ const u16 device_id = vfio_pci_config_readw(device, PCI_DEVICE_ID);
+
+ if (vendor_id != PCI_VENDOR_ID_INTEL)
+ return -EINVAL;
+
+ switch (device_id) {
+ case PCI_DEVICE_ID_INTEL_DSA_SPR0:
+ case PCI_DEVICE_ID_INTEL_DSA_DMR:
+ case PCI_DEVICE_ID_INTEL_DSA_GNRD:
+ break;
+ default:
return -EINVAL;
+ }
if (dsa_int_handle_request_required(device)) {
dev_err(device, "Device requires requesting interrupt handles\n");