summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>2000-03-22 00:47:26 +0000
committercgd <cgd@NetBSD.org>2000-03-22 00:47:26 +0000
commit00f7a2d476aaf59e27bb775a392c25a6aa56cf25 (patch)
treefe764f09b1f1dbf4d062646e0ce80ba5b195590b /sys/dev
parent9c93a8b8ffedef1b186b0c314aeb9e1a882ae965 (diff)
if the PCI_CONFIG_DUMP option is defined, set the patchable
pci_config_dump variable to 1. otherwise, it gets set to 0. If that's set, when configuring PCI devices spew the very verbose configuration space header dump that was previously "#if 0"'d. If you use this option, or patch the variable to 1, it's strongly encouraged that you have used the MSGBUFSIZE option to enlarge the kernel message buffer.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/pci.c64
1 files changed, 35 insertions, 29 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index a06f9d80825..3aa5abd5350 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pci.c,v 1.44 1999/11/04 19:03:00 thorpej Exp $ */
+/* $NetBSD: pci.c,v 1.45 2000/03/22 00:47:26 cgd Exp $ */
/*
* Copyright (c) 1995, 1996, 1997, 1998
@@ -35,6 +35,8 @@
* PCI bus autoconfiguration.
*/
+#include "opt_pci.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
@@ -43,6 +45,12 @@
#include <dev/pci/pcivar.h>
#include <dev/pci/pcidevs.h>
+#ifdef PCI_CONFIG_DUMP
+int pci_config_dump = 1;
+#else
+int pci_config_dump = 0;
+#endif
+
int pcimatch __P((struct device *, struct cfdata *, void *));
void pciattach __P((struct device *, struct device *, void *));
@@ -289,45 +297,43 @@ pciprint(aux, pnp)
{
register struct pci_attach_args *pa = aux;
char devinfo[256];
-#if 0
const struct pci_quirkdata *qd;
-#endif
if (pnp) {
pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo);
printf("%s at %s", devinfo, pnp);
}
printf(" dev %d function %d", pa->pa_device, pa->pa_function);
-#if 0
- printf(": ");
- pci_conf_print(pa->pa_pc, pa->pa_tag, NULL);
- if (!pnp)
- pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo);
- printf("%s at %s", devinfo, pnp ? pnp : "?");
- printf(" dev %d function %d (", pa->pa_device, pa->pa_function);
+ if (pci_config_dump) {
+ printf(": ");
+ pci_conf_print(pa->pa_pc, pa->pa_tag, NULL);
+ if (!pnp)
+ pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo);
+ printf("%s at %s", devinfo, pnp ? pnp : "?");
+ printf(" dev %d function %d (", pa->pa_device, pa->pa_function);
#ifdef __i386__
- printf("tag %#lx, intrtag %#lx, intrswiz %#lx, intrpin %#lx",
- *(long *)&pa->pa_tag, *(long *)&pa->pa_intrtag,
- (long)pa->pa_intrswiz, (long)pa->pa_intrpin);
+ printf("tag %#lx, intrtag %#lx, intrswiz %#lx, intrpin %#lx",
+ *(long *)&pa->pa_tag, *(long *)&pa->pa_intrtag,
+ (long)pa->pa_intrswiz, (long)pa->pa_intrpin);
#else
- printf("tag %#lx, intrtag %#lx, intrswiz %#lx, intrpin %#lx",
- (long)pa->pa_tag, (long)pa->pa_intrtag, (long)pa->pa_intrswiz,
- (long)pa->pa_intrpin);
+ printf("tag %#lx, intrtag %#lx, intrswiz %#lx, intrpin %#lx",
+ (long)pa->pa_tag, (long)pa->pa_intrtag, (long)pa->pa_intrswiz,
+ (long)pa->pa_intrpin);
#endif
- printf(", i/o %s, mem %s,",
- pa->pa_flags & PCI_FLAGS_IO_ENABLED ? "on" : "off",
- pa->pa_flags & PCI_FLAGS_MEM_ENABLED ? "on" : "off");
- qd = pci_lookup_quirkdata(PCI_VENDOR(pa->pa_id),
- PCI_PRODUCT(pa->pa_id));
- if (qd == NULL) {
- printf(" no quirks");
- } else {
- bitmask_snprintf(qd->quirks,
- "\20\1multifn", devinfo, sizeof (devinfo));
- printf(" quirks %s", devinfo);
+ printf(", i/o %s, mem %s,",
+ pa->pa_flags & PCI_FLAGS_IO_ENABLED ? "on" : "off",
+ pa->pa_flags & PCI_FLAGS_MEM_ENABLED ? "on" : "off");
+ qd = pci_lookup_quirkdata(PCI_VENDOR(pa->pa_id),
+ PCI_PRODUCT(pa->pa_id));
+ if (qd == NULL) {
+ printf(" no quirks");
+ } else {
+ bitmask_snprintf(qd->quirks,
+ "\20\1multifn", devinfo, sizeof (devinfo));
+ printf(" quirks %s", devinfo);
+ }
+ printf(")");
}
- printf(")");
-#endif
return (UNCONF);
}