2006-03-13 Martin Mares <mj@ucw.cz>
+ * lspci.man: Documented the -D switch.
+
+ * lspci.c (show_slot_name, scan_device): If there are multiple PCI
+ domains or if the `-D' switch is used, show the domain number for
+ all devices.
+
* lspci.c (show_verbose): Report cache line size in bytes.
* update-pciids.sh: Use curl if available. Patch by Matthew Wilcox.
static int show_tree; /* Show bus tree */
static int machine_readable; /* Generate machine-readable output */
static int map_mode; /* Bus mapping mode enabled */
+static int show_domains; /* Show domain numbers */
-static char options[] = "nvbxs:d:ti:mgM" GENERIC_OPTIONS ;
+static char options[] = "nvbxs:d:ti:mgMD" GENERIC_OPTIONS ;
static char help_msg[] = "\
Usage: lspci [<switches>]\n\
-t\t\tShow bus tree\n\
-m\t\tProduce machine-readable output\n\
-i <file>\tUse specified ID database instead of %s\n\
+-D\t\tAlways show domain numbers\n\
-M\t\tEnable `bus mapping' mode (dangerous; root only)\n"
GENERIC_HELP
;
{
struct device *d;
+ if (p->domain)
+ show_domains = 1;
if (!pci_filter_match(&filter, p))
return NULL;
d = xmalloc(sizeof(struct device));
{
struct pci_dev *p = d->dev;
- if (p->domain)
+ if (show_domains)
printf("%04x:", p->domain);
printf("%02x:%02x.%d", p->bus, p->dev, p->func);
}
case 'M':
map_mode++;
break;
+ case 'D':
+ show_domains = 1;
+ break;
default:
if (parse_generic_option(i, pacc, optarg))
break;
Dump PCI device data in machine readable form (both normal and verbose format supported)
for easy parsing by scripts.
.TP
+.B -D
+Always show PCI domain numbers. By default, lspci suppresses them on machines which
+have only domain 0.
+.TP
.B -M
Invoke bus mapping mode which performs a thorough scan of all PCI devices, including
those behind misconfigured bridges etc. This option is available only to root and it