]>
git.ipfire.org Git - thirdparty/pciutils.git/blob - ls-caps-vendor.c
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 v2+.
8 * SPDX-License-Identifier: GPL-2.0-or-later
17 show_vendor_caps_virtio(struct device
*d
, int where
, int cap
)
19 int length
= BITS(cap
, 0, 8);
20 int type
= BITS(cap
, 8, 8);
25 if (!config_fetch(d
, where
, length
))
47 printf("VirtIO: %s\n", tname
);
52 printf("\t\tBAR=%d offset=%08x size=%08x",
53 get_conf_byte(d
, where
+ 4),
54 get_conf_long(d
, where
+ 8),
55 get_conf_long(d
, where
+ 12));
57 if (type
== 2 && length
>= 20)
58 printf(" multiplier=%08x", get_conf_long(d
, where
+16));
65 do_show_vendor_caps(struct device
*d
, int where
, int cap
)
67 switch (d
->dev
->vendor_id
)
69 case 0x1af4: /* Red Hat */
70 if (d
->dev
->device_id
>= 0x1000 &&
71 d
->dev
->device_id
<= 0x107f)
72 return show_vendor_caps_virtio(d
, where
, cap
);
79 show_vendor_caps(struct device
*d
, int where
, int cap
)
81 printf("Vendor Specific Information: ");
82 if (!do_show_vendor_caps(d
, where
, cap
))
83 printf("Len=%02x <?>\n", BITS(cap
, 0, 8));