2 * The PCI Utilities -- Show Vendor-specific Capabilities
4 * Copyright (c) 2014 Gerd Hoffmann <kraxel@redhat.com>
6 * Can be freely distributed and used under the terms of the GNU GPL.
15 show_vendor_caps_virtio(struct device *d, int where, int cap)
17 int length = BITS(cap, 0, 8);
18 int type = BITS(cap, 8, 8);
23 if (!config_fetch(d, where, length))
45 printf("VirtIO: %s\n", tname);
50 printf("\t\tBAR=%d offset=%08x size=%08x",
51 get_conf_byte(d, where + 4),
52 get_conf_long(d, where + 8),
53 get_conf_long(d, where + 12));
55 if (type == 2 && length >= 20)
56 printf(" multiplier=%08x", get_conf_long(d, where+16));
63 do_show_vendor_caps(struct device *d, int where, int cap)
65 switch (get_conf_word(d, PCI_VENDOR_ID))
67 case 0x1af4: /* Red Hat */
68 if (get_conf_word(d, PCI_DEVICE_ID) >= 0x1000 &&
69 get_conf_word(d, PCI_DEVICE_ID) <= 0x107f)
70 return show_vendor_caps_virtio(d, where, cap);
77 show_vendor_caps(struct device *d, int where, int cap)
79 printf("Vendor Specific Information: ");
80 if (!do_show_vendor_caps(d, where, cap))
81 printf("Len=%02x <?>\n", BITS(cap, 0, 8));