]> mj.ucw.cz Git - pciutils.git/commitdiff
lspci: Use mangled vendor/device ID when examining vendor caps
authorDavid Edmondson <david.edmondson@oracle.com>
Wed, 19 Jul 2023 14:16:41 +0000 (15:16 +0100)
committerDavid Edmondson <david.edmondson@oracle.com>
Wed, 19 Jul 2023 14:16:41 +0000 (15:16 +0100)
Given that PCI VFs are expected to have a vendor and device ID of
0xffff, when examining vendor capabilities use the mangled vendor and
device IDs (typically copied from the PF) rather than those read from
the VF configuration space.

Signed-off-by: David Edmondson <david.edmondson@oracle.com>
ls-caps-vendor.c

index 829d59f5b66bb8a5670221516c3109efb265c548..62ee586dcd6de978162cb8e5c7b813fe7fe4df96 100644 (file)
@@ -64,11 +64,11 @@ show_vendor_caps_virtio(struct device *d, int where, int cap)
 static int
 do_show_vendor_caps(struct device *d, int where, int cap)
 {
-  switch (get_conf_word(d, PCI_VENDOR_ID))
+  switch (d->dev->vendor_id)
     {
     case 0x1af4: /* Red Hat */
-      if (get_conf_word(d, PCI_DEVICE_ID) >= 0x1000 &&
-         get_conf_word(d, PCI_DEVICE_ID) <= 0x107f)
+      if (d->dev->device_id >= 0x1000 &&
+         d->dev->device_id <= 0x107f)
        return show_vendor_caps_virtio(d, where, cap);
       break;
     }