aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmondson <david.edmondson@oracle.com>2023-07-19 15:16:41 +0100
committerDavid Edmondson <david.edmondson@oracle.com>2023-07-19 15:16:41 +0100
commitadf7de0ec6a1b734c00667879d36c1198670958a (patch)
tree44458e59e0682d6b359566afb698683121260bd3
parent6182921907ef3cc31be3394eb468b24bcd3955a8 (diff)
downloadpciutils-adf7de0ec6a1b734c00667879d36c1198670958a.tar.gz
lspci: Use mangled vendor/device ID when examining vendor caps
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>
-rw-r--r--ls-caps-vendor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ls-caps-vendor.c b/ls-caps-vendor.c
index 829d59f..62ee586 100644
--- a/ls-caps-vendor.c
+++ b/ls-caps-vendor.c
@@ -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;
}