Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci if the PCI_CONFIG_DUMP option is defined, set th...
details: https://anonhg.NetBSD.org/src/rev/11a383a15c8e
branches: trunk
changeset: 483966:11a383a15c8e
user: cgd <cgd%NetBSD.org@localhost>
date: Wed Mar 22 00:47:26 2000 +0000
description:
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:
sys/dev/pci/pci.c | 64 ++++++++++++++++++++++++++++++------------------------
1 files changed, 35 insertions(+), 29 deletions(-)
diffs (103 lines):
diff -r fe1eacd63599 -r 11a383a15c8e sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Wed Mar 22 00:43:47 2000 +0000
+++ b/sys/dev/pci/pci.c Wed Mar 22 00:47:26 2000 +0000
@@ -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 @@
{
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);
}
Home |
Main Index |
Thread Index |
Old Index