From: Martin Mares Date: Mon, 13 Mar 2006 21:13:14 +0000 (+0000) Subject: Added the -D switch. X-Git-Tag: v3.0.0~71 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=af61eb251351cb2af4a5f06f08ad1ee6f8492914;p=pciutils.git Added the -D switch. git-archimport-id: mj@ucw.cz--public/pciutils--main--2.2--patch-94 --- diff --git a/ChangeLog b/ChangeLog index 6b1c4b8..2f76a15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2006-03-13 Martin Mares + * 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. diff --git a/lspci.c b/lspci.c index 56ec99a..1fc6bfe 100644 --- a/lspci.c +++ b/lspci.c @@ -23,8 +23,9 @@ static struct pci_filter filter; /* Device filter */ 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 []\n\ @@ -40,6 +41,7 @@ Usage: lspci []\n\ -t\t\tShow bus tree\n\ -m\t\tProduce machine-readable output\n\ -i \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 ; @@ -104,6 +106,8 @@ scan_device(struct pci_dev *p) { struct device *d; + if (p->domain) + show_domains = 1; if (!pci_filter_match(&filter, p)) return NULL; d = xmalloc(sizeof(struct device)); @@ -239,7 +243,7 @@ show_slot_name(struct device *d) { 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); } @@ -2317,6 +2321,9 @@ main(int argc, char **argv) case 'M': map_mode++; break; + case 'D': + show_domains = 1; + break; default: if (parse_generic_option(i, pacc, optarg)) break; diff --git a/lspci.man b/lspci.man index a65c679..07f1530 100644 --- a/lspci.man +++ b/lspci.man @@ -101,6 +101,10 @@ as the PCI ID list instead of @IDSDIR@/pci.ids. 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