]> mj.ucw.cz Git - pciutils.git/commitdiff
Added machine-readable dump format.
authorMartin Mares <mj@ucw.cz>
Sun, 15 Feb 1998 09:30:37 +0000 (09:30 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 5 May 2006 12:09:49 +0000 (14:09 +0200)
pci.ids updates from Jens Maurer.

Released as version 1.02.

ChangeLog
README
lspci.8
lspci.c
pci.ids
pciutils.lsm

index 7206cedcfd7f06150f74b884475a06d2d93f34de..e0c8bd045e1c31464fb4b836945b2b1904992c16 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Sun Feb 15 10:12:25 1998  Martin Mares  <mj@albireo.ucw.cz>
+
+       * lspci.c (show_machine): Added non-verbose mode of machine-readable
+       dump.
+
+       * pci.ids: Updates from Jens Maurer.
+
+       * Released as version 1.02.
+
+Thu Feb 12 16:53:28 1998  Martin Mares  <mj@lomikel.karlin.mff.cuni.cz>
+
+       * lspci.c: Added a "-m" switch for dumping machine-readable
+       configuration data (requested by Bjoern Kriews <bkr@cut.de>).
+
 Mon Feb  9 13:17:43 1998  Martin Mares  <mj@albireo.ucw.cz>
 
        * Makefile, pciutils.h: Include local pci.h instead of <linux/pci.h>
diff --git a/README b/README
index 0c506849d0011a4b97c0e11c605ff259f8e128b0..eb5ce0b10de81d69dedb701cc62842ecf130f66f 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This package contains the Linux PCI Utilities, version 1.01.
+This package contains the Linux PCI Utilities, version 1.02.
 
 Copyright (c) 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
 
@@ -32,3 +32,5 @@ TODO:
 
        - Full displaying of CardBus bridge configuration. (Has anyone seen
          full specs of the CardBus bridge / header type 2?)
+
+       - Subsystem vendor and device ID?
diff --git a/lspci.8 b/lspci.8
index 954f7e8f1345d975c369e3f883e1391381053aa2..def285952d49e88d0a26797dd97b93cf0e981b95 100644 (file)
--- a/lspci.8
+++ b/lspci.8
@@ -1,4 +1,4 @@
-.TH lspci 8 "9 February 98" "pciutils-1.01" "Linux PCI Utilities"
+.TH lspci 8 "15 February 98" "pciutils-1.02" "Linux PCI Utilities"
 .IX lspci
 .SH NAME
 lspci \- list all PCI devices
@@ -83,6 +83,10 @@ as PCI ID database instead of /etc/pci.ids.
 Use
 .B <dir>
 as directory containing PCI bus information instead of /proc/bus/pci.
+.TP
+.B -m
+Dump PCI device data in machine readable form (both normal and verbose format supported)
+for easy parsing by scripts.
 
 .SH FILES
 .TP
diff --git a/lspci.c b/lspci.c
index fc2db61e02602c570f3cbdd65bfe9091f8c8d258..ae061a3b63b3f568e742789e654ca93a48b6a974 100644 (file)
--- a/lspci.c
+++ b/lspci.c
@@ -1,5 +1,5 @@
 /*
- *     $Id: lspci.c,v 1.7 1998/02/09 12:32:54 mj Exp $
+ *     $Id: lspci.c,v 1.8 1998/02/15 09:30:39 mj Exp $
  *
  *     Linux PCI Utilities -- List All PCI Devices
  *
@@ -27,9 +27,10 @@ static int func_filter = -1;
 static int vend_filter = -1;
 static int dev_filter = -1;
 static int show_tree;                  /* Show bus tree */
+static int machine_readable;           /* Generate machine-readable output */
 static char *pci_dir = PROC_BUS_PCI;
 
-static char options[] = "nvbxB:S:F:V:D:ti:p:";
+static char options[] = "nvbxB:S:F:V:D:ti:p:m";
 
 static char help_msg[] = "\
 Usage: lspci [<switches>]\n\
@@ -40,6 +41,7 @@ Usage: lspci [<switches>]\n\
 -x\tShow hex-dump of config space (-xx shows full 256 bytes)\n\
 -B <bus>, -S <slot>, -F <func>, -V <vendor>, -D <device>  Show only selected devices\n\
 -t\tShow bus tree\n\
+-m\tProduce machine-readable output\n\
 -i <file>\tUse specified ID database instead of " ETC_PCI_IDS "\n\
 -p <dir>\tUse specified bus directory instead of " PROC_BUS_PCI "\n\
 ";
@@ -593,6 +595,37 @@ show_hex_dump(struct device *d)
     }
 }
 
+static void
+show_machine(struct device *d)
+{
+  int c;
+
+  if (verbose)
+    {
+      printf("Device:\t%02x:%02x.%x\n", d->bus, PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
+      printf("Class:\t%s\n", lookup_class(get_conf_word(d, PCI_CLASS_DEVICE)));
+      printf("Vendor:\t%s\n", lookup_vendor(d->vendid));
+      printf("Device:\t%s\n", lookup_device(d->vendid, d->devid));
+      if (c = get_conf_byte(d, PCI_REVISION_ID))
+       printf("Rev:\t%02x\n", c);
+      if (c = get_conf_byte(d, PCI_CLASS_PROG))
+       printf("ProgIf:\t%02x\n", c);
+    }
+  else
+    {
+      printf("%02x:%02x.%x ", d->bus, PCI_SLOT(d->devfn), PCI_FUNC(d->devfn));
+      printf("\"%s\" \"%s\" \"%s\"",
+            lookup_class(get_conf_word(d, PCI_CLASS_DEVICE)),
+            lookup_vendor(d->vendid),
+            lookup_device(d->vendid, d->devid));
+      if (c = get_conf_byte(d, PCI_REVISION_ID))
+       printf(" -r%02x", c);
+      if (c = get_conf_byte(d, PCI_CLASS_PROG))
+       printf(" -p%02x", c);
+      putchar('\n');
+    }
+}
+
 static void
 show(void)
 {
@@ -600,7 +633,9 @@ show(void)
 
   for(d=first_dev; d; d=d->next)
     {
-      if (verbose)
+      if (machine_readable)
+       show_machine(d);
+      else if (verbose)
        show_verbose(d);
       else
        show_terse(d);
@@ -876,6 +911,9 @@ main(int argc, char **argv)
       case 'p':
        pci_dir = optarg;
        break;
+      case 'm':
+       machine_readable++;
+       break;
       default:
       bad:
        fprintf(stderr, help_msg);
diff --git a/pci.ids b/pci.ids
index 713f593f8c279b44d31d4b313b7dc10fd3b092b6..86e3ce145e1520e7f0635e3ae3b4fdc8ae20d413 100644 (file)
--- a/pci.ids
+++ b/pci.ids
@@ -1,10 +1,10 @@
 #
 #      List of PCI ID's
 #
-#      Maintained by Jens Maurer <jmaurer@cck.uni-kl.de>
+#      Maintained by Jens Maurer <linux-pcisupport@cck.uni-kl.de>
 #      If you have any new entries, send them to the maintainer.
 #
-#      $Id: pci.ids,v 1.4 1998/02/08 12:47:07 ecd Exp $
+#      $Id: pci.ids,v 1.5 1998/02/15 09:30:40 mj Exp $
 #
 
 # Vendors and devices. Please keep sorted.
        0016  DGLPB [OPPO]
        0019  DECchip 21142/43
        0021  DECchip 21052
+       0022  DECchip 21150
        0024  DECchip 21152
 1012  Micronics Computers Inc
 1013  Cirrus Logic
        001d  82G2675
        0020  MCA
        0022  IBM27-82351
+       002e  ServeRAID controller
        0036  Miami
+       007d  MPEG2
 1015  LSI Logic Corp of Canada
 1016  ICL Personal Systems
 1017  SPEA Software AG
        2040  79c974
 1023  Trident Microsystems
        9320  TGUI 9320
+       9397  Cyber9397
        9420  TGUI 9420
        9430  TGUI 9430
        9440  TGUI 9440
        0001  SG86C201
        0002  SG86C202
        0008  85C503
+       0200  5598
        0204  82C204
        0205  SG86C205
        0406  85C501/2
        3020  Samurai_IDE
 1043  Asustek Computer, Inc.
 1044  Distributed Processing Technology
-       a400  PM2124A [SmartCache/Raid]
+       a400  SmartCache/Raid III or IV
 1045  OPTi Inc.
        c178  92C178
        c557  82C557 [Viper-M]
        ac12  PCI1130
        ac13  PCI1031
        ac15  PCI1131
+       ac16  PCI-1250
 104d  Sony Corporation
 104e  Oak Technology, Inc
        0107  OTI107
 109e  Brooktree Corporation
        0350  Bt848
        0351  Bt849A
+       8474  Bt8474
 109f  Trigem Computer Inc.
 10a0  Meidensha Corporation
 10a1  Juko Electronics Ind. Co. Ltd
        0585  VT82C585VP [Apollo VP1/VPX]
        0586  VT82C586 ISA [Apollo VP]
        0595  VT82C595 [Apollo VP2]
+       0597  VT82C597 [Apollo VP3]
        0926  VT82C926 [Amazon]
        1000  82C570MV
        1106  82C570MV
        1571  VT 82C416MV
        1595  VT82C595/97 [Apollo VP2/97]
-       3038  82C586_2 [VT82C586B USB]
-       3040  82C586_3 [VT82C586B ACPI]
+       3038  VT82C586B USB
+       3040  VT82C586B ACPI
+       8597  VT82C597 [Apollo VP3 AGP]
 1107  Stratus Computers
 1108  Proteon, Inc.
        0100  p1690plus_AA
 113a  FWB Inc
 113b  Network Computing Devices
 113c  Cyclone Microsystems, Inc.
+       0001  PCI-SDK [PCI i960 Evaluation Platform]
        0911  PCI-911 [PCI-based i960Jx Intelligent I/O Controller]
        0912  PCI-912 [i960CF-based Intelligent I/O Controller]
        0913  PCI-913
 1179  Toshiba America Info Systems
        0601  601
        060a  ToPIC95
+       060f  ToPIC97
+       0701  Lucent DSP1645 [Mars]
 117b  L G Electronics, Inc.
 117c  Atto Technology
 117d  Becton & Dickinson
 11be  International Microcircuits Inc
 11bf  Astrodesign, Inc.
 11c0  Hewlett Packard
-11c1  AT&T Microelectronics
+11c1  Lucent Microelectronics
+       0440  L56xMF
 11c2  Sand Microelectronics
 11c4  Document Technologies, Inc
 11c5  Shiva Corporation
index 7cada1b9584d703745fcfbcb8891e3e8d40ebb31..48a7904e5eac116153b24c9f032f1a4227538a7d 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title:          Linux PCI Utilities
-Version:        1.01
-Entered-date:   980209
+Version:        1.02
+Entered-date:   980215
 Description:    This package contains various utilities for inspecting and
                setting of devices connected to the PCI bus. Requires
                kernel version 2.1.82 or newer (supporting the /proc/bus/pci
@@ -9,7 +9,7 @@ Description:    This package contains various utilities for inspecting and
 Keywords:       kernel, pci, proc, lspci
 Author:         mj@atrey.karlin.mff.cuni.cz (Martin Mares)
 Maintained-by:  mj@atrey.karlin.mff.cuni.cz (Martin Mares)
-Primary-site:   atrey.karlin.mff.cuni.cz pub/local/mj/linux/pciutils-1.01.tar.gz
-Alternate-site: sunsite.unc.edu pub/Linux/system/hardware/pciutils-1.01.tar.gz
+Primary-site:   atrey.karlin.mff.cuni.cz pub/local/mj/linux/pciutils-1.02.tar.gz
+Alternate-site: sunsite.unc.edu pub/Linux/system/hardware/pciutils-1.02.tar.gz
 Copying-policy: GPL
 End