Module Name: src
Committed By: matt
Date: Tue Nov 5 18:34:21 UTC 2013
Modified Files:
src/sys/dev/pci [matt-nb5-mips64]: pci_subr.c
Log Message:
Pull in support for pci_aprint_devinfo_fancy
To generate a diff of this commit:
cvs rdiff -u -r1.75.10.1.4.1 -r1.75.10.1.4.2 src/sys/dev/pci/pci_subr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.75.10.1.4.1 src/sys/dev/pci/pci_subr.c:1.75.10.1.4.2
--- src/sys/dev/pci/pci_subr.c:1.75.10.1.4.1 Mon Dec 26 03:44:49 2011
+++ src/sys/dev/pci/pci_subr.c Tue Nov 5 18:34:21 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_subr.c,v 1.75.10.1.4.1 2011/12/26 03:44:49 matt Exp $ */
+/* $NetBSD: pci_subr.c,v 1.75.10.1.4.2 2013/11/05 18:34:21 matt Exp $ */
/*
* Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.75.10.1.4.1 2011/12/26 03:44:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.75.10.1.4.2 2013/11/05 18:34:21 matt Exp $");
#ifdef _KERNEL_OPT
#include "opt_pci.h"
@@ -421,6 +421,32 @@ pci_devinfo(pcireg_t id_reg, pcireg_t cl
}
}
+#ifdef _KERNEL
+void
+pci_aprint_devinfo_fancy(const struct pci_attach_args *pa, const char *naive,
+ const char *known, int addrev)
+{
+ char devinfo[256];
+
+ if (known) {
+ aprint_normal(": %s", known);
+ if (addrev)
+ aprint_normal(" (rev. 0x%02x)",
+ PCI_REVISION(pa->pa_class));
+ aprint_normal("\n");
+ } else {
+ pci_devinfo(pa->pa_id, pa->pa_class, 0,
+ devinfo, sizeof(devinfo));
+ aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
+ PCI_REVISION(pa->pa_class));
+ }
+ if (naive)
+ aprint_naive(": %s\n", naive);
+ else
+ aprint_naive("\n");
+}
+#endif
+
/*
* Print out most of the PCI configuration registers. Typically used
* in a device attach routine like this: