How does this output look (from my laptop): $ ./lspci -nn 00:00.0 Host bridge [0600]: Intel Corporation 82855PM Processor to I/O Controller [8086:3340] (rev 03) 00:01.0 PCI bridge [0604]: Intel Corporation 82855PM Processor to AGP Controller [8086:3341] (rev 03) 00:1d.0 USB Controller [0c03]: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #1 [8086:24c2] (rev 01) 00:1d.1 USB Controller [0c03]: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #2 [8086:24c4] (rev 01) 00:1d.2 USB Controller [0c03]: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 [8086:24c7] (rev 01) 00:1d.7 USB Controller [0c03]: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller [8086:24cd] (rev 01) 00:1e.0 PCI bridge [0604]: Intel Corporation 82801 Mobile PCI Bridge [8086:2448] (rev 81) 00:1f.0 ISA bridge [0601]: Intel Corporation 82801DBM (ICH4-M) LPC Interface Bridge [8086:24cc] (rev 01) 00:1f.1 IDE interface [0101]: Intel Corporation 82801DBM (ICH4-M) IDE Controller [8086:24ca] (rev 01) 00:1f.3 SMBus [0c05]: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) SMBus Controller [8086:24c3] (rev 01) 00:1f.5 Multimedia audio controller [0401]: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller [8086:24c5] (rev 01) 00:1f.6 Modem [0703]: Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Modem Controller [8086:24c6] (rev 01) 01:00.0 VGA compatible controller [0300]: nVidia Corporation NV17 [GeForce4 420 Go 32M] [10de:0176] (rev a3) 02:05.0 Network controller [0280]: Intel Corporation PRO/Wireless LAN 2100 3B Mini PCI Adapter [8086:1043] (rev 04) 02:06.0 CardBus bridge [0607]: Texas Instruments PCI1620 PC Card Controller [104c:ac54] (rev 01) 02:06.1 CardBus bridge [0607]: Texas Instruments PCI1620 PC Card Controller [104c:ac54] (rev 01) 02:06.2 System peripheral [0880]: Texas Instruments PCI1620 Firmware Loading Function [104c:8201] (rev 01) 02:07.0 Ethernet controller [0200]: Broadcom Corporation BCM4401 100Base-T [14e4:4401] (rev 01)
$ ./lspci -nnvvvs 02:07.0 02:07.0 Ethernet controller [0200]: Broadcom Corporation BCM4401 100Base-T [14e4:4401] (rev 01) Subsystem: Hewlett-Packard Company [103c] Unknown device 08b0 Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort+ <TAbort- <MAbort- >SERR- <PERR- Latency: 64 Interrupt: pin A routed to IRQ 12 Region 0: Memory at e0000000 (32-bit, non-prefetchable) [size=8K] [virtual] Expansion ROM at 54000000 [disabled] [size=16K] Capabilities: <access denied> Here's the patch that does this; if it matches your needs, I'll talk to Martin Mares about including it. Index: lspci.c =================================================================== RCS file: /cvsroot/pkg-pciutils/pciutils/lspci.c,v retrieving revision 1.8 diff -u -p -r1.8 lspci.c --- lspci.c 5 May 2006 19:39:37 -0000 1.8 +++ lspci.c 2 Jun 2006 18:19:06 -0000 @@ -2293,7 +2293,7 @@ main(int argc, char **argv) switch (i) { case 'n': - pacc->numeric_ids = 1; + pacc->numeric_ids++; break; case 'v': verbose++; Index: lib/names.c =================================================================== RCS file: /cvsroot/pkg-pciutils/pciutils/lib/names.c,v retrieving revision 1.5 diff -u -p -r1.5 names.c --- lib/names.c 21 Mar 2006 19:44:22 -0000 1.5 +++ lib/names.c 2 Jun 2006 18:19:06 -0000 @@ -326,8 +326,8 @@ pci_lookup_name(struct pci_access *a, ch va_start(args, flags); - num = 0; - if ((flags & PCI_LOOKUP_NUMERIC) || a->numeric_ids) + num = a->numeric_ids; + if ((flags & PCI_LOOKUP_NUMERIC) || a->numeric_ids == 1) { flags &= ~PCI_LOOKUP_NUMERIC; num = 1; @@ -352,20 +352,30 @@ pci_lookup_name(struct pci_access *a, ch { case PCI_LOOKUP_VENDOR: iv = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%04x", iv); else if (v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0)) - return v->name; + { + if (num) + res = snprintf(buf, size, "%s [%04x]", v->name, iv); + else + return v->name; + } else res = snprintf(buf, size, "Unknown vendor %04x", iv); break; case PCI_LOOKUP_DEVICE: iv = va_arg(args, int); id = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%04x", id); else if (d = id_lookup(a, ID_DEVICE, iv, id, 0, 0)) - return d->name; + { + if (num) + res = snprintf(buf, size, "%s [%04x]", d->name, id); + else + return d->name; + } else if (synth) res = snprintf(buf, size, "Unknown device %04x", id); else @@ -374,28 +384,46 @@ pci_lookup_name(struct pci_access *a, ch case PCI_LOOKUP_VENDOR | PCI_LOOKUP_DEVICE: iv = va_arg(args, int); id = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%04x:%04x", iv, id); else { v = id_lookup(a, ID_VENDOR, iv, 0, 0, 0); d = id_lookup(a, ID_DEVICE, iv, id, 0, 0); if (v && d) - res = snprintf(buf, size, "%s %s", v->name, d->name); + { + if (num) + res = snprintf(buf, size, "%s %s [%04x:%04x]", v->name, + d->name, iv, id); + else + res = snprintf(buf, size, "%s %s", v->name, d->name); + } else if (!synth) return NULL; else if (!v) res = snprintf(buf, size, "Unknown device %04x:%04x", iv, id); else /* !d */ - res = snprintf(buf, size, "%s Unknown device %04x", v->name, id); + { + if (num) + res = snprintf(buf, size, "%s [%04x] Unknown device %04x", + v->name, iv, id); + else + res = snprintf(buf, size, "%s Unknown device %04x", v->name, + id); + } } break; case PCI_LOOKUP_SUBSYSTEM | PCI_LOOKUP_VENDOR: isv = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%04x", isv); else if (v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0)) - return v->name; + { + if (num) + res = snprintf(buf, size, "%s [%04x]", v->name, isv); + else + return v->name; + } else if (synth) res = snprintf(buf, size, "Unknown vendor %04x", isv); else @@ -406,10 +434,15 @@ pci_lookup_name(struct pci_access *a, ch id = va_arg(args, int); isv = va_arg(args, int); isd = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%04x", isd); else if (d = id_lookup_subsys(a, iv, id, isv, isd)) - return d->name; + { + if (num) + res = snprintf(buf, size, "%s [%04x]", d->name, isd); + else + return d->name; + } else if (synth) res = snprintf(buf, size, "Unknown device %04x", isd); else @@ -420,28 +453,46 @@ pci_lookup_name(struct pci_access *a, ch id = va_arg(args, int); isv = va_arg(args, int); isd = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%04x:%04x", isv, isd); else { v = id_lookup(a, ID_VENDOR, isv, 0, 0, 0); d = id_lookup_subsys(a, iv, id, isv, isd); if (v && d) - res = snprintf(buf, size, "%s %s", v->name, d->name); + { + if (num) + res = snprintf(buf, size, "%s %s [%04x:%04x]", v->name, + d->name, isv, isd); + else + res = snprintf(buf, size, "%s %s", v->name, d->name); + } else if (!synth) return NULL; else if (!v) res = snprintf(buf, size, "Unknown device %04x:%04x", isv, isd); else /* !d */ - res = snprintf(buf, size, "%s Unknown device %04x", v->name, isd); + { + if (num) + res = snprintf(buf, size, "%s [%04x] Unknown device %04x", + v->name, isv, isd); + else + res = snprintf(buf, size, "%s Unknown device %04x", v->name, + isd); + } } break; case PCI_LOOKUP_CLASS: icls = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%04x", icls); else if (cls = id_lookup(a, ID_SUBCLASS, icls >> 8, icls & 0xff, 0, 0)) - return cls->name; + { + if (num) + res = snprintf(buf, size, "%s [%04x]", cls->name, icls); + else + return cls->name; + } else if (cls = id_lookup(a, ID_CLASS, icls, 0, 0, 0)) res = snprintf(buf, size, "%s [%04x]", cls->name, icls); else if (synth) @@ -452,10 +503,15 @@ pci_lookup_name(struct pci_access *a, ch case PCI_LOOKUP_PROGIF: icls = va_arg(args, int); ipif = va_arg(args, int); - if (num) + if (num == 1) res = snprintf(buf, size, "%02x", ipif); else if (pif = id_lookup(a, ID_PROGIF, icls >> 8, icls & 0xff, ipif, 0)) - return pif->name; + { + if (num) + res = snprintf(buf, size, "%s [%02x]", pif->name, ipif); + else + return pif->name; + } else if (icls == 0x0101 && !(ipif & 0x70)) { /* IDE controllers have complex prog-if semantics */ @@ -465,7 +521,9 @@ pci_lookup_name(struct pci_access *a, ch (ipif & 0x04) ? "SecO " : "", (ipif & 0x02) ? "PriP " : "", (ipif & 0x01) ? "PriO " : ""); - if (res > 0 && res < size) + if (num) + res += snprintf(buf + res, size - res, "[%02x]", ipif); + else if (res > 0 && res < size) buf[--res] = 0; } else if (synth) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]