Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-4]: src/sys/dev/pci Pull up revision 1.45 (via patch, requested...



details:   https://anonhg.NetBSD.org/src/rev/b679b2ab50ee
branches:  netbsd-1-4
changeset: 470674:b679b2ab50ee
user:      he <he%NetBSD.org@localhost>
date:      Tue Jun 27 14:32:06 2000 +0000

description:
Pull up revision 1.45 (via patch, requested by cgd):
  If the 'PCI_CONFIG_DUMP' option is defined, print a verbose dump
  of all PCI devices' configuration space.

diffstat:

 sys/dev/pci/pci.c |  62 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 33 insertions(+), 29 deletions(-)

diffs (94 lines):

diff -r be33caf59ff7 -r b679b2ab50ee sys/dev/pci/pci.c
--- a/sys/dev/pci/pci.c Tue Jun 27 14:29:04 2000 +0000
+++ b/sys/dev/pci/pci.c Tue Jun 27 14:32:06 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci.c,v 1.40 1998/11/07 16:47:22 drochner Exp $        */
+/*     $NetBSD: pci.c,v 1.40.6.1 2000/06/27 14:32:06 he Exp $  */
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998
@@ -43,6 +43,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 *));
 
@@ -270,45 +276,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