--- /dev/null
+Sat Feb 7 15:15:46 1998 Martin Mares <mj@albireo.ucw.cz>
+
+ * README: Updated.
+
+ * lspci.8: Created a man page.
+
+ * Releasing as version 1.0.
+
+Tue Feb 3 20:56:00 1998 Martin Mares <mj@albireo.ucw.cz>
+
+ * Makefile: Recognize architecture by calling uname and pass it as ARCH_xxx
+ to all the C sources. This should eliminate problems with 32-bit compilers
+ on sparc64.
+
+ * lspci.c (show_verbose): Recognize CardBus bridge header type.
+ (show_htype2): Stub routine.
+ (scan_config): Write sensible error message if the kernel denies reading of
+ upper part of the PCI config space.
+
-# $Id: Makefile,v 1.4 1998/01/27 11:50:07 mj Exp $
+# $Id: Makefile,v 1.5 1998/02/08 10:58:52 mj Exp $
# Makefile for Linux PCI Utilities
-# (c) 1997 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+# (c) 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+ARCH=$(shell uname -m | sed -e 's/i.86/i386/' -e 's/sun4u/sparc64/' | tr 'a-z' 'A-Z')
OPT=-O2 -fomit-frame-pointer
-CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wno-unused -Werror
+CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes -Wno-unused -Werror -DARCH_$(ARCH)
PREFIX=/
install: all
install -o root -g root -m 755 -s lspci $(PREFIX)/sbin
install -o root -g root -m 644 pci.ids $(PREFIX)/etc
+ install -o root -g root -m 644 lspci.8 $(PREFIX)/man/man8
dist: clean
sh -c 'X=`pwd` ; X=`basename $$X` ; cd .. ; tar czvvf /tmp/$$X.tar.gz $$X --exclude CVS --exclude tmp'
-This is an experimental version of the Linux PCI Utilities package.
-Maintained by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+This package contains the Linux PCI Utilities, version 1.0.
+
+Copyright (c) 1998 Martin Mares <mj@atrey.karlin.mff.cuni.cz>
+
+All files in this package can be freely distributed and used according
+to the terms of the GNU General Public License, either version 2 or
+(at your opinion) any newer version. This is the same distribution
+policy as for the Linux kernel itself -- see /usr/src/linux/COPYING
+for details.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ The Linux PCI Utilities currently contain only one utility -- lspci,
+indented for displaying of detailed information about all PCI busses and
+devices in the system, replacing the original /proc/pci interface. See
+the manual page (lspci.8) for more details.
+
+ If you have any bug reports or suggestions, send them to the author.
+
+ If you want, subscribe to linux-pci@atrey.karlin.mff.cuni.cz (send
+"subscribe linux-pci Your Full Name" to listproc@atrey.karlin.mff.cuni.cz).
+Release notes about new versions will be send to the list and problems with
+the Linux PCI support will be probably discussed there, too.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TODO:
+
+ - Work-around the PIIX4 ACPI crash?
+
+ - Better displaying of IRQ's generated by both PCI and CardBus bridges.
+
+ - Full displaying of CardBus bridge configuration. (Has anyone seen
+ full specs of the CardBus bridge / header type 2?)
--- /dev/null
+.TH lspci 8 "7 February 98" "pciutils-0.92" "Linux PCI Utilities"
+.IX lspci
+.SH NAME
+lspci \- list all PCI devices
+.SH SYNOPSIS
+.B lspci
+.RB [ options ]
+.SH DESCRIPTION
+.B lspci
+is a utility for displaying information about all PCI busses in the system and
+all devices connected to them. It requires Linux kernel 2.1.82 or newer and
+supersedes the original /proc/pci interface found in earlier kernels.
+
+If you are going to report bugs in PCI device drivers or in
+.I lspci
+itself, please include output of "lspci -vvx".
+
+.SH OPTIONS
+.TP
+.B -v
+Tells
+.I lspci
+to be verbose and display detailed information about all devices.
+.TP
+.B -vv
+Tells
+.I lspci
+to be very verbose and display even more information (actually everything the
+PCI device is able to tell). The exact meaning of these data is not explained
+in this manual page, if you want to know more, consult
+.B /usr/include/linux/pci.h
+or the PCI specs.
+.TP
+.B -n
+Show PCI vendor and device codes as numbers instead of looking them up in the
+PCI ID database.
+.TP
+.B -x
+Show hexadecimal dump of first 64 bytes of the PCI configuration space (the standard
+header). Useful for debugging of drivers and
+.I lspci
+itself.
+.TP
+.B -xx
+Show hexadecimal dump of whole PCI configuration space. Available only for root
+as several PCI devices crash when you try to read undefined portions of the config
+space (although this directly violates the PCI standard).
+.TP
+.B -b
+Bus-centric view. Show all IRQ numbers and addresses as seen by the cards on the
+PCI bus instead of as seen by the kernel.
+.TP
+.B -t
+Show a tree-like diagram containing all busses, bridges, devices and connections
+between them.
+.TP
+.B -B <bus>
+Show only devices on specified bus.
+.TP
+.B -S <slot>
+Show only devices in specified slot number.
+.TP
+.B -F <func>
+Show only specified function number of all devices (you can mix it with
+.B -B
+and
+.B -S
+to select single device).
+.TP
+.B -V <vendor>
+Show only devices having specified vendor ID.
+.TP
+.B -D <devid>
+Show only devices having specified device ID.
+.TP
+.B -i <file>
+Use
+.B
+<file>
+as PCI ID database instead of /etc/pci.ids.
+.TP
+.B -p <dir>
+Use
+.B <dir>
+as directory containing PCI bus information instead of /proc/bus/pci.
+
+.SH FILES
+.TP
+.B /etc/pci.ids
+A list of all known PCI ID's (vendors, devices, classes and subclasses).
+.TP
+.B /proc/bus/pci
+An interface to PCI bus configuration space provided by the kernel. Contains
+per-bus subdirectories with per-card config space files and a
+.I
+devices
+file containing a list of all PCI devices.
+
+.SH AUTHOR
+The Linux PCI Utilities are maintained by Martin Mares <mj@atrey.karlin.mff.cuni.cz>.
/*
- * $Id: lspci.c,v 1.5 1998/01/27 11:50:08 mj Exp $
+ * $Id: lspci.c,v 1.6 1998/02/08 10:58:54 mj Exp $
*
* Linux PCI Utilities -- List All PCI Devices
*
/* Format strings used for IRQ numbers */
-#ifdef __sparc_v9__
+#ifdef ARCH_SPARC64
#define IRQ_FORMAT "%08x"
#else
#define IRQ_FORMAT "%d"
{
struct device *d;
char name[64];
- int fd;
+ int fd, res;
int how_much = (show_hex > 1) ? 256 : 64;
for(d=first_dev; d; d=d->next)
fprintf(stderr, "lspci: Unable to open %s: %m\n", name);
exit(1);
}
- if (read(fd, d->config, how_much) != how_much)
+ res = read(fd, d->config, how_much);
+ if (res < 0)
{
fprintf(stderr, "lspci: Error reading %s: %m\n", name);
exit(1);
}
+ if (res != how_much)
+ {
+ fprintf(stderr, "lspci: Only %d bytes of config space available to you\n", res);
+ exit(1);
+ }
close(fd);
}
}
(brc & PCI_BRIDGE_CTL_FAST_BACK) ? '+' : '-');
}
+static void
+show_htype2(struct device *d)
+{
+}
+
static void
show_verbose(struct device *d)
{
byte max_lat, min_gnt;
byte int_pin = get_conf_byte(d, PCI_INTERRUPT_PIN);
byte int_line = get_conf_byte(d, PCI_INTERRUPT_LINE);
- unsigned int irq, ex_htype;
+ unsigned int irq;
word subsys_v, subsys_d;
show_terse(d);
- switch (class)
- {
- case PCI_CLASS_BRIDGE_PCI:
- ex_htype = 1;
- break;
- default:
- ex_htype = 0;
- }
- if (ex_htype != htype)
- {
- printf("\t!!! Header type %02x doesn't match class code %04x\n", htype, class);
- return;
- }
-
switch (htype)
{
- case 0:
+ case PCI_HEADER_TYPE_NORMAL:
+ if (class == PCI_CLASS_BRIDGE_PCI)
+ {
+ badhdr:
+ printf("\t!!! Header type %02x doesn't match class code %04x\n", htype, class);
+ return;
+ }
max_lat = get_conf_byte(d, PCI_MAX_LAT);
min_gnt = get_conf_byte(d, PCI_MIN_GNT);
subsys_v = get_conf_word(d, PCI_SUBSYSTEM_VENDOR_ID);
subsys_d = get_conf_word(d, PCI_SUBSYSTEM_ID);
break;
- case 1:
+ case PCI_HEADER_TYPE_BRIDGE:
+ if (class != PCI_CLASS_BRIDGE_PCI)
+ goto badhdr;
+ irq = int_line = int_pin = min_gnt = max_lat = 0;
+ subsys_v = subsys_d = 0;
+ break;
+ case PCI_HEADER_TYPE_CARDBUS:
+ if ((class >> 8) != PCI_BASE_CLASS_BRIDGE)
+ goto badhdr;
irq = int_line = int_pin = min_gnt = max_lat = 0;
subsys_v = subsys_d = 0;
break;
switch (htype)
{
- case 0:
+ case PCI_HEADER_TYPE_NORMAL:
show_htype0(d);
break;
- case 1:
+ case PCI_HEADER_TYPE_BRIDGE:
show_htype1(d);
break;
+ case PCI_HEADER_TYPE_CARDBUS:
+ show_htype2(d);
+ break;
}
}
Begin3
Title: Linux PCI Utilities
-Version: 0.91
-Entered-date: 980127
+Version: 1.0
+Entered-date: 980207
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
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/pciutils-0.91.tar.gz
+Primary-site: atrey.karlin.mff.cuni.cz pub/local/mj/linux/pciutils-1.0.tar.gz
Alternate-site: sunsite.unc.edu pub/Linux/system/hardware
Copying-policy: GPL
End