+ struct pci_dev *p = d->dev;
+ char classbuf[256], devbuf[256];
+
+ show_slot_name(d);
+ printf(" %s: %s",
+ pci_lookup_name(pacc, classbuf, sizeof(classbuf),
+ PCI_LOOKUP_CLASS,
+ p->device_class),
+ pci_lookup_name(pacc, devbuf, sizeof(devbuf),
+ PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
+ p->vendor_id, p->device_id));
+ if ((p->known_fields & PCI_FILL_CLASS_EXT) && p->rev_id)
+ printf(" (rev %02x)", p->rev_id);
+ if (verbose)
+ {
+ char *x;
+ c = (p->known_fields & PCI_FILL_CLASS_EXT) ? p->prog_if : 0;
+ x = pci_lookup_name(pacc, devbuf, sizeof(devbuf),
+ PCI_LOOKUP_PROGIF | PCI_LOOKUP_NO_NUMBERS,
+ p->device_class, c);
+ if (c || x)
+ {
+ printf(" (prog-if %02x", c);
+ if (x)
+ printf(" [%s]", x);
+ putchar(')');
+ }
+ }
+ putchar('\n');
+
+ if (verbose || opt_kernel)
+ {
+ char ssnamebuf[256];
+
+ pci_fill_info(p, PCI_FILL_LABEL);
+
+ if (p->label)
+ printf("\tDeviceName: %s", p->label);
+ if ((p->known_fields & PCI_FILL_SUBSYS) &&
+ p->subsys_vendor_id && p->subsys_vendor_id != 0xffff)
+ printf("\tSubsystem: %s\n",
+ pci_lookup_name(pacc, ssnamebuf, sizeof(ssnamebuf),
+ PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE,
+ p->vendor_id, p->device_id, p->subsys_vendor_id, p->subsys_id));
+ }
+}
+
+/*** Verbose output ***/
+
+static void
+show_size(u64 x)
+{
+ static const char suffix[][2] = { "", "K", "M", "G", "T" };
+ unsigned i;
+ if (!x)
+ return;
+ for (i = 0; i < (sizeof(suffix) / sizeof(*suffix) - 1); i++) {
+ if (x % 1024)
+ break;
+ x /= 1024;
+ }
+ printf(" [size=%u%s]", (unsigned)x, suffix[i]);
+}