summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pciconf
diff options
context:
space:
mode:
authorse <se@FreeBSD.org>1996-11-16 22:05:52 +0000
committerse <se@FreeBSD.org>1996-11-16 22:05:52 +0000
commitddd974cb4235fbe33dca8657bd071bb8a853567e (patch)
treeac633c46f5765c77fab53e393b5b6869b912bd4f /usr.sbin/pciconf
parentf0c019885aa60e31c36721c1c903be9faf56ae86 (diff)
downloadFreeBSD-src-ddd974cb4235fbe33dca8657bd071bb8a853567e.zip
FreeBSD-src-ddd974cb4235fbe33dca8657bd071bb8a853567e.tar.gz
Fix core dump after printing usage message (pointed out by BDE).
Add printing of PCI header type register. (This makes the output 80 columns wide. Ughh. I'm looking for a better way to put the information on one line ...)
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r--usr.sbin/pciconf/pciconf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 2b26842..d16d88e 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -53,6 +53,7 @@ usage(const char *argv0) {
fprintf(stderr, "usage:\n\t%s -l\n"
"\t%s [-r|-w] [-bh] sel addr [value]\n",
argv0, argv0);
+ exit (1);
}
int
@@ -131,10 +132,10 @@ list_devs(void)
close(fd);
for (p = conf; p < &conf[pc.pci_len / sizeof conf[0]]; p++) {
- printf("pci%d:%d:%d:\tclass=0x%06x card=0x%08lx chip=0x%08lx rev=0x%02x\n",
+ printf("pci%d:%d:%d:\tclass=0x%06x card=0x%08lx chip=0x%08lx rev=0x%02x hdr=0x%02x\n",
p->pc_sel.pc_bus, p->pc_sel.pc_dev, p->pc_sel.pc_func,
p->pc_class >> 8, p->pc_subid,
- p->pc_devid, p->pc_class & 0xff);
+ p->pc_devid, p->pc_class & 0xff, p->pc_hdr);
}
}
OpenPOWER on IntegriCloud