]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
lspci: Clarify unknown capability IDs
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 19 Apr 2018 20:16:26 +0000 (15:16 -0500)
committerMartin Mares <mj@ucw.cz>
Fri, 20 Apr 2018 08:23:03 +0000 (10:23 +0200)
For capabilities we don't know how to decode, we print the config address,
version, and capability ID:

  Capabilities: [220 v1] #19

This doesn't clearly identify the capability ID ("19"), whether it is a
PCI-compatible Capability ID or an Extended Capability ID (although you can
infer this by whether the address is 2 or 3 digits), or the fact that the
ID is printed in hex, which makes it hard to parse this manually.

Add a label ("Capability ID" or "Extended Capability ID") and print a "0x"
prefix so it's clear the value is in hex:

  Capabilities: [220 v1] Extended Capability ID 0x19

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
ls-caps.c
ls-ecaps.c

index 31352249e7b953e69ca39ff482f81012fd533de5..bc7829c120e59844b104107920cda10e430d5d7e 100644 (file)
--- a/ls-caps.c
+++ b/ls-caps.c
@@ -1599,7 +1599,7 @@ show_caps(struct device *d, int where)
              cap_ea(d, where, cap);
              break;
            default:
-             printf("#%02x [%04x]\n", id, cap);
+             printf("Capability ID %#02x [%04x]\n", id, cap);
            }
          where = next;
        }
index 800a0322e1b77076bd2b8a28b12e56bf85762e97..cb3d46dd1be6c0e4ae79b56ab0ec145923c7e7cd 100644 (file)
@@ -802,7 +802,7 @@ show_ext_caps(struct device *d, int type)
            cap_ptm(d, where);
            break;
          default:
-           printf("#%02x\n", id);
+           printf("Extended Capability ID %#02x\n", id);
            break;
        }
       where = (header >> 20) & ~3;