Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive} trunk
authordrochner <drochner@NetBSD.org>
Mon, 30 Jan 2012 19:41:18 +0000
branchtrunk
changeset 208751 be4c5f8a2d59
parent 208750 aaed263899b5
child 208752 221652a8e0f9
Use pci_aprint_devinfo(9) instead of pci_devinfo+aprint_{normal,naive} where it looks straightforward, and pci_aprint_devinfo_fancy in a few others where drivers want to supply their own device names instead of the pcidevs generated one. More complicated cases, where names are composed at runtime, are left alone for now. It certainly makes sense to simplify the drivers here rather than inventing a catch-all API. This should serve as as example for new drivers, and also ensure consistent output in the AB_QUIET ("boot -q") case. Also, it avoids excessive stack usage where drivers attach child devices because the buffer for the device name is not kept on the local stack anymore.
sys/arch/x86/pci/pchb.c
sys/arch/x86/pci/pcib.c
sys/dev/pci/ahcisata_pci.c
sys/dev/pci/amdpm.c
sys/dev/pci/auixp.c
sys/dev/pci/autri.c
sys/dev/pci/btvmei.c
sys/dev/pci/chipsfb.c
sys/dev/pci/cmpci.c
sys/dev/pci/coram.c
sys/dev/pci/cs4280.c
sys/dev/pci/cs4281.c
sys/dev/pci/cxdtv.c
sys/dev/pci/ehci_pci.c
sys/dev/pci/emuxki.c
sys/dev/pci/esa.c
sys/dev/pci/esm.c
sys/dev/pci/fwohci_pci.c
sys/dev/pci/genfb_pci.c
sys/dev/pci/gtp.c
sys/dev/pci/hifn7751.c
sys/dev/pci/ichsmb.c
sys/dev/pci/if_an_pci.c
sys/dev/pci/if_cas.c
sys/dev/pci/if_dge.c
sys/dev/pci/if_epic_pci.c
sys/dev/pci/if_et.c
sys/dev/pci/if_fxp_pci.c
sys/dev/pci/if_gem_pci.c
sys/dev/pci/if_ipw.c
sys/dev/pci/if_iwi.c
sys/dev/pci/if_iwn.c
sys/dev/pci/if_mtd_pci.c
sys/dev/pci/if_nfe.c
sys/dev/pci/if_ral_pci.c
sys/dev/pci/if_re_pci.c
sys/dev/pci/if_rtk_pci.c
sys/dev/pci/if_stge.c
sys/dev/pci/if_vge.c
sys/dev/pci/if_vr.c
sys/dev/pci/if_vte.c
sys/dev/pci/if_wi_pci.c
sys/dev/pci/if_wm.c
sys/dev/pci/if_wpi.c
sys/dev/pci/igsfb_pci.c
sys/dev/pci/iha_pci.c
sys/dev/pci/jmide.c
sys/dev/pci/joy_pci.c
sys/dev/pci/machfb.c
sys/dev/pci/mpt_pci.c
sys/dev/pci/mvsata_pci.c
sys/dev/pci/nca_pci.c
sys/dev/pci/nfsmb.c
sys/dev/pci/ohci_pci.c
sys/dev/pci/pccbb.c
sys/dev/pci/pciide_common.c
sys/dev/pci/pcscp.c
sys/dev/pci/piixpm.c
sys/dev/pci/pm2fb.c
sys/dev/pci/r128fb.c
sys/dev/pci/radeonfb.c
sys/dev/pci/radeonfbvar.h
sys/dev/pci/sdhc_pci.c
sys/dev/pci/siisata_pci.c
sys/dev/pci/sisfb.c
sys/dev/pci/twa.c
sys/dev/pci/ubsec.c
sys/dev/pci/uhci_pci.c
sys/dev/pci/vga_pci.c
sys/dev/pci/voodoofb.c
sys/dev/pci/voyager.c
sys/dev/pci/wcfb.c
sys/dev/pci/yds.c
--- a/sys/arch/x86/pci/pchb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/arch/x86/pci/pchb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pchb.c,v 1.32 2011/08/20 20:01:08 jakllsch Exp $ */
+/*	$NetBSD: pchb.c,v 1.33 2012/01/30 19:41:18 drochner Exp $ */
 
 /*-
  * Copyright (c) 1996, 1998, 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.32 2011/08/20 20:01:08 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pchb.c,v 1.33 2012/01/30 19:41:18 drochner Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -155,7 +155,6 @@
 {
 	struct pchb_softc *sc = device_private(self);
 	const struct pci_attach_args *pa = aux;
-	char devinfo[256];
 	struct pcibus_attach_args pba;
 	struct agpbus_attach_args apa;
 	pcireg_t bcreg;
@@ -163,8 +162,6 @@
 	pcitag_t tag;
 	int doattach, attachflags, has_agp;
 
-	aprint_naive("\n");
-
 	doattach = 0;
 	has_agp = 0;
 	attachflags = pa->pa_flags;
@@ -177,9 +174,7 @@
 	 * have auxiliary PCI buses.
 	 */
 
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	switch (PCI_VENDOR(pa->pa_id)) {
 	/*
--- a/sys/arch/x86/pci/pcib.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/arch/x86/pci/pcib.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcib.c,v 1.13 2011/07/01 18:22:08 dyoung Exp $	*/
+/*	$NetBSD: pcib.c,v 1.14 2012/01/30 19:41:18 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.13 2011/07/01 18:22:08 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcib.c,v 1.14 2012/01/30 19:41:18 drochner Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -185,17 +185,12 @@
 {
 	struct pcib_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
-	char devinfo[256];
-
-	aprint_naive("\n");
 
 	/*
 	 * Just print out a description and defer configuration
 	 * until all PCI devices have been attached.
 	 */
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_tag = pa->pa_tag;
--- a/sys/dev/pci/ahcisata_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/ahcisata_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisata_pci.c,v 1.26 2011/08/06 14:56:33 jakllsch Exp $	*/
+/*	$NetBSD: ahcisata_pci.c,v 1.27 2012/01/30 19:41:18 drochner Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.26 2011/08/06 14:56:33 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.27 2012/01/30 19:41:18 drochner Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -171,7 +171,6 @@
 	struct pci_attach_args *pa = aux;
 	struct ahci_pci_softc *psc = device_private(self);
 	struct ahci_softc *sc = &psc->ah_sc;
-	char devinfo[256];
 	const char *intrstr;
 	bool ahci_cap_64bit;
 	bool ahci_bad_64bit;
@@ -188,9 +187,7 @@
 	psc->sc_pc = pa->pa_pc;
 	psc->sc_pcitag = pa->pa_tag;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_naive(": AHCI disk controller\n");
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, "AHCI disk controller");
 	
 	if (pci_intr_map(pa, &intrhandle) != 0) {
 		aprint_error_dev(self, "couldn't map interrupt\n");
--- a/sys/dev/pci/amdpm.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/amdpm.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdpm.c,v 1.34 2010/02/07 20:55:46 pgoyette Exp $	*/
+/*	$NetBSD: amdpm.c,v 1.35 2012/01/30 19:41:18 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.34 2010/02/07 20:55:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdpm.c,v 1.35 2012/01/30 19:41:18 drochner Exp $");
 
 #include "opt_amdpm.h"
 
@@ -87,15 +87,11 @@
 {
 	struct amdpm_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
-	char devinfo[256];
 	pcireg_t confreg, pmptrreg;
 	u_int32_t pmreg;
 	int i;
 
-	aprint_naive("\n");
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_NVIDIA_XBOX_SMBUS)
 		sc->sc_nforce = 1;
--- a/sys/dev/pci/auixp.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/auixp.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: auixp.c,v 1.37 2011/12/02 11:58:44 jmcneill Exp $ */
+/* $NetBSD: auixp.c,v 1.38 2012/01/30 19:41:18 drochner Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Reinoud Zandijk <reinoud@netbsd.org>
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.37 2011/12/02 11:58:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: auixp.c,v 1.38 2012/01/30 19:41:18 drochner Exp $");
 
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -1100,8 +1100,7 @@
 	const struct auixp_card_type *card;
 	const char *intrstr;
 	uint32_t data;
-	char devinfo[256];
-	int revision, error;
+	int error;
 
 	sc = device_private(self);
 	pa = (struct pci_attach_args *)aux;
@@ -1112,11 +1111,7 @@
 #endif
 
 	/* print information confirming attachment */
-	aprint_naive(": Audio controller\n");
-
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
+	pci_aprint_devinfo(pa, "Audio controller");
 
 	/* set up details from our set of known `cards'/chips */
 	for (card = auixp_card_types; card->pci_vendor_id; card++)
--- a/sys/dev/pci/autri.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/autri.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: autri.c,v 1.48 2011/11/24 03:35:58 mrg Exp $	*/
+/*	$NetBSD: autri.c,v 1.49 2012/01/30 19:41:18 drochner Exp $	*/
 
 /*
  * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autri.c,v 1.48 2011/11/24 03:35:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autri.c,v 1.49 2012/01/30 19:41:18 drochner Exp $");
 
 #include "midi.h"
 
@@ -520,21 +520,18 @@
 	struct autri_codec_softc *codec;
 	pci_intr_handle_t ih;
 	char const *intrstr;
-	char devinfo[256];
 	int r;
 	uint32_t reg;
 
 	sc = device_private(self);
 	pa = (struct pci_attach_args *)aux;
 	pc = pa->pa_pc;
-	aprint_naive(": Audio controller\n");
 
 	sc->sc_devid = pa->pa_id;
 	sc->sc_class = pa->pa_class;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
+	pci_aprint_devinfo(pa, "Audio controller");
 	sc->sc_revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, sc->sc_revision);
 
 	/* map register to memory */
 	if (pci_mapreg_map(pa, AUTRI_PCI_MEMORY_BASE,
--- a/sys/dev/pci/btvmei.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/btvmei.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: btvmei.c,v 1.27 2012/01/27 18:53:08 para Exp $ */
+/* $NetBSD: btvmei.c,v 1.28 2012/01/30 19:41:18 drochner Exp $ */
 
 /*
  * Copyright (c) 1999
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.27 2012/01/27 18:53:08 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: btvmei.c,v 1.28 2012/01/30 19:41:18 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -90,19 +90,14 @@
 	struct pci_attach_args *pa = aux;
 	pci_chipset_tag_t pc = pa->pa_pc;
 
-	int rev;
-
 	pci_intr_handle_t ih;
 	const char *intrstr;
 	struct vmebus_attach_args vaa;
 
-	aprint_naive(": VME bus adapter\n");
-
 	sc->sc_pc = pc;
 	sc->sc_dmat = pa->pa_dmat;
 
-	rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG));
-	aprint_normal(": BIT3 PCI-VME 617 rev %d\n", rev);
+	pci_aprint_devinfo_fancy(pa, "VME bus adapter", "BIT3 PCI-VME 617", 1);
 
 	/*
 	 * Map CSR and mapping table spaces.
--- a/sys/dev/pci/chipsfb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/chipsfb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: chipsfb.c,v 1.30 2011/07/22 14:34:38 njoly Exp $	*/
+/*	$NetBSD: chipsfb.c,v 1.31 2012/01/30 19:41:18 drochner Exp $	*/
 
 /*
  * Copyright (c) 2006 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: chipsfb.c,v 1.30 2011/07/22 14:34:38 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: chipsfb.c,v 1.31 2012/01/30 19:41:18 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -89,7 +89,6 @@
 	struct chipsfb_pci_softc *scp = device_private(self);
 	struct chipsfb_softc *sc = &scp->sc_chips;
 	const struct pci_attach_args *pa = aux;
-	char devinfo[256];
 	pcireg_t screg;
 
 	scp->sc_pc = pa->pa_pc;
@@ -102,9 +101,7 @@
 	pci_conf_write(scp->sc_pc, scp->sc_pcitag, PCI_COMMAND_STATUS_REG, 
 	    screg);
 
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	sc->sc_memt = pa->pa_memt;
 	sc->sc_iot = pa->pa_iot;
--- a/sys/dev/pci/cmpci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/cmpci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cmpci.c,v 1.44 2011/11/24 03:35:58 mrg Exp $	*/
+/*	$NetBSD: cmpci.c,v 1.45 2012/01/30 19:41:18 drochner Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cmpci.c,v 1.44 2011/11/24 03:35:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cmpci.c,v 1.45 2012/01/30 19:41:18 drochner Exp $");
 
 #if defined(AUDIO_DEBUG) || defined(DEBUG)
 #define DPRINTF(x) if (cmpcidebug) printf x
@@ -381,18 +381,14 @@
 	struct audio_attach_args aa;
 	pci_intr_handle_t ih;
 	char const *strintr;
-	char devinfo[256];
 	int i, v;
 
 	sc = device_private(self);
 	pa = (struct pci_attach_args *)aux;
-	aprint_naive(": Audio controller\n");
 
 	sc->sc_id = pa->pa_id;
 	sc->sc_class = pa->pa_class;
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
-	    PCI_REVISION(sc->sc_class));
+	pci_aprint_devinfo(pa, "Audio controller");
 	switch (PCI_PRODUCT(sc->sc_id)) {
 	case PCI_PRODUCT_CMEDIA_CMI8338A:
 		/*FALLTHROUGH*/
--- a/sys/dev/pci/coram.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/coram.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: coram.c,v 1.9 2011/08/29 14:47:08 jmcneill Exp $ */
+/* $NetBSD: coram.c,v 1.10 2012/01/30 19:41:18 drochner Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coram.c,v 1.9 2011/08/29 14:47:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coram.c,v 1.10 2012/01/30 19:41:18 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -163,7 +163,6 @@
 	const struct pci_attach_args *pa = v;
 	pci_intr_handle_t ih;
 	pcireg_t reg;
-	char devinfo[256];
 	const char *intrstr;
 	struct coram_iic_softc *cic;
 	uint32_t value;
@@ -174,9 +173,7 @@
 
 	sc->sc_dev = self;
 
-	aprint_naive("\n");
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
 	sc->sc_board = coram_board_lookup(PCI_VENDOR(reg), PCI_PRODUCT(reg));
--- a/sys/dev/pci/cs4280.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/cs4280.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4280.c,v 1.63 2011/11/24 03:35:58 mrg Exp $	*/
+/*	$NetBSD: cs4280.c,v 1.64 2012/01/30 19:41:18 drochner Exp $	*/
 
 /*
  * Copyright (c) 1999, 2000 Tatoku Ogaito.  All rights reserved.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.63 2011/11/24 03:35:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.64 2012/01/30 19:41:18 drochner Exp $");
 
 #include "midi.h"
 
@@ -243,18 +243,14 @@
 	char const *intrstr;
 	const char *vendor, *product;
 	pcireg_t reg;
-	char devinfo[256];
 	uint32_t mem;
 	int error;
 
 	sc = device_private(self);
 	pa = (struct pci_attach_args *)aux;
 	pc = pa->pa_pc;
-	aprint_naive(": Audio controller\n");
 
-	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));
+	pci_aprint_devinfo(pa, "Audio controller");
 
 	cs_card = cs4280_identify_card(pa);
 	if (cs_card != NULL) {
--- a/sys/dev/pci/cs4281.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/cs4281.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cs4281.c,v 1.46 2011/11/24 03:35:58 mrg Exp $	*/
+/*	$NetBSD: cs4281.c,v 1.47 2012/01/30 19:41:19 drochner Exp $	*/
 
 /*
  * Copyright (c) 2000 Tatoku Ogaito.  All rights reserved.
@@ -43,7 +43,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.46 2011/11/24 03:35:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4281.c,v 1.47 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -189,17 +189,13 @@
 	pci_chipset_tag_t pc;
 	char const *intrstr;
 	pcireg_t reg;
-	char devinfo[256];
 	int error;
 
 	sc = device_private(self);
 	pa = (struct pci_attach_args *)aux;
 	pc = pa->pa_pc;
-	aprint_naive(": Audio controller\n");
 
-	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));
+	pci_aprint_devinfo(pa, "Audio controller");
 
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_pt = pa->pa_tag;
--- a/sys/dev/pci/cxdtv.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/cxdtv.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cxdtv.c,v 1.10 2012/01/16 15:33:50 jmcneill Exp $ */
+/* $NetBSD: cxdtv.c,v 1.11 2012/01/30 19:41:19 drochner Exp $ */
 
 /*
  * Copyright (c) 2008, 2011 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cxdtv.c,v 1.10 2012/01/16 15:33:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cxdtv.c,v 1.11 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -186,7 +186,6 @@
 	pci_intr_handle_t ih;
 	pcireg_t reg;
 	const char *intrstr;
-	char devinfo[76];
 	struct i2cbus_attach_args iba;
 
 	sc = device_private(self);
@@ -194,8 +193,6 @@
 	sc->sc_dev = self;
 	sc->sc_pc = pa->pa_pc;
 
-	aprint_naive("\n");
-
 	reg = pci_conf_read(pa->pa_pc, pa->pa_tag, PCI_SUBSYS_ID_REG);
 
 	sc->sc_vendor = PCI_VENDOR(reg);
@@ -204,9 +201,7 @@
 	sc->sc_board = cxdtv_board_lookup(sc->sc_vendor, sc->sc_product);
 	KASSERT(sc->sc_board != NULL);
 
-
-	pci_devinfo(reg, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo(pa, NULL);
 
 	if (pci_mapreg_map(pa, CXDTV_MMBASE, PCI_MAPREG_TYPE_MEM, 0,
 			   &sc->sc_memt, &sc->sc_memh, NULL, &sc->sc_mems)) {
--- a/sys/dev/pci/ehci_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/ehci_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.53 2011/07/30 13:19:21 jmcneill Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.54 2012/01/30 19:41:19 drochner Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.53 2011/07/30 13:19:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.54 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -120,7 +120,6 @@
 	pci_intr_handle_t ih;
 	pcireg_t csr;
 	const char *vendor;
-	char devinfo[256];
 	usbd_status r;
 	int ncomp;
 	struct usb_pci *up;
@@ -129,11 +128,7 @@
 	sc->sc.sc_dev = self;
 	sc->sc.sc_bus.hci_private = sc;
 
-	aprint_naive(": USB controller\n");
-
-	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));
+	pci_aprint_devinfo(pa, "USB controller");
 
 	/* Check for quirks */
 	quirk = ehci_pci_lookup_quirkdata(PCI_VENDOR(pa->pa_id),
--- a/sys/dev/pci/emuxki.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/emuxki.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: emuxki.c,v 1.61 2011/11/24 03:35:58 mrg Exp $	*/
+/*	$NetBSD: emuxki.c,v 1.62 2012/01/30 19:41:19 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2007 The NetBSD Foundation, Inc.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.61 2011/11/24 03:35:58 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: emuxki.c,v 1.62 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -404,14 +404,12 @@
 {
 	struct emuxki_softc *sc;
 	struct pci_attach_args *pa;
-	char devinfo[256];
 	pci_intr_handle_t ih;
 	const char *intrstr;
 
 	sc = device_private(self);
 	sc->sc_dev = self;
 	pa = aux;
-	aprint_naive(": Audio controller\n");
 
 	mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO);
@@ -424,8 +422,8 @@
 		aprint_error(": can't map iospace\n");
 		return;
 	}
-	pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo, sizeof(devinfo));
-	aprint_normal(": %s\n", devinfo);
+
+	pci_aprint_devinfo(pa, "Audio controller");
 
 	sc->sc_pc   = pa->pa_pc;
 	sc->sc_dmat = pa->pa_dmat;
--- a/sys/dev/pci/esa.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/esa.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: esa.c,v 1.57 2011/12/03 08:20:12 ryo Exp $ */
+/* $NetBSD: esa.c,v 1.58 2012/01/30 19:41:19 drochner Exp $ */
 
 /*
  * Copyright (c) 2001-2008 Jared D. McNeill <jmcneill@invisible.ca>
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.57 2011/12/03 08:20:12 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esa.c,v 1.58 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -1008,18 +1008,16 @@
 	const struct esa_card_type *card;
 	const char *intrstr;
 	uint32_t data;
-	char devinfo[256];
 	int revision, i, error;
 
 	sc = device_private(self);
 	pa = (struct pci_attach_args *)aux;
 	tag = pa->pa_tag;
 	pc = pa->pa_pc;
-	aprint_naive(": Audio controller\n");
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
+	pci_aprint_devinfo(pa, "Audio controller");
+
 	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
 
 	for (card = esa_card_types; card->pci_vendor_id; card++)
 		if (PCI_VENDOR(pa->pa_id) == card->pci_vendor_id &&
--- a/sys/dev/pci/esm.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/esm.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: esm.c,v 1.55 2011/11/24 03:35:59 mrg Exp $      */
+/*      $NetBSD: esm.c,v 1.56 2012/01/30 19:41:19 drochner Exp $      */
 
 /*-
  * Copyright (c) 2002, 2003 Matt Fredette
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.55 2011/11/24 03:35:59 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esm.c,v 1.56 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1588,7 +1588,6 @@
 static void
 esm_attach(device_t parent, device_t self, void *aux)
 {
-	char devinfo[256];
 	struct esm_softc *ess;
 	struct pci_attach_args *pa;
 	const char *intrstr;
@@ -1596,7 +1595,6 @@
 	pcitag_t tag;
 	pci_intr_handle_t ih;
 	pcireg_t csr, data;
-	int revision;
 	uint16_t codec_data;
 	uint16_t pcmbar;
 	int error;
@@ -1606,11 +1604,8 @@
 	pa = (struct pci_attach_args *)aux;
 	pc = pa->pa_pc;
 	tag = pa->pa_tag;
-	aprint_naive(": Audio controller\n");
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
+	pci_aprint_devinfo(pa, "Audio controller");
 
 	mutex_init(&ess->sc_lock, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(&ess->sc_intr_lock, MUTEX_DEFAULT, IPL_AUDIO);
--- a/sys/dev/pci/fwohci_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/fwohci_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $	*/
+/*	$NetBSD: fwohci_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.39 2010/04/29 06:41:27 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwohci_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -96,16 +96,11 @@
 {
 	struct pci_attach_args *pa = (struct pci_attach_args *) aux;
 	struct fwohci_pci_softc *psc = device_private(self);
-	char devinfo[256];
 	char const *intrstr;
 	pci_intr_handle_t ih;
 	uint32_t csr;
 
-	aprint_naive(": IEEE 1394 Controller\n");
-
-	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));
+	pci_aprint_devinfo(pa, "IEEE 1394 Controller");
 
 	psc->psc_sc.fc.dev = self;
 	psc->psc_sc.fc.dmat = pa->pa_dmat;
--- a/sys/dev/pci/genfb_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/genfb_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: genfb_pci.c,v 1.32 2011/03/08 03:22:29 macallan Exp $ */
+/*	$NetBSD: genfb_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.32 2011/03/08 03:22:29 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,11 +101,8 @@
 	struct genfb_ops ops;
 	pcireg_t rom;
 	int idx, bar, type;
-	char devinfo[256];
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_naive("\n");
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	sc->sc_gen.sc_dev = self;
 	sc->sc_memt = pa->pa_memt;
--- a/sys/dev/pci/gtp.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/gtp.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gtp.c,v 1.17 2009/05/12 08:23:00 cegger Exp $ */
+/* $NetBSD: gtp.c,v 1.18 2012/01/30 19:41:19 drochner Exp $ */
 /*	$OpenBSD: gtp.c,v 1.1 2002/06/03 16:13:21 mickey Exp $	*/
 
 /*
@@ -29,7 +29,7 @@
 /* Gemtek PCI Radio Card Device Driver */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gtp.c,v 1.17 2009/05/12 08:23:00 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gtp.c,v 1.18 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -147,13 +147,8 @@
 	pci_chipset_tag_t pc = pa->pa_pc;
 	bus_size_t iosize;
 	pcireg_t csr;
-	char devinfo[256];
 
-	aprint_naive(": Radio controller\n");
-
-	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));
+	pci_aprint_devinfo(pa, "Radio controller");
 
 	/* Map I/O registers */
 	if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, &sc->tea.iot,
--- a/sys/dev/pci/hifn7751.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/hifn7751.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: hifn7751.c,v 1.48 2011/11/29 03:50:31 tls Exp $	*/
+/*	$NetBSD: hifn7751.c,v 1.49 2012/01/30 19:41:19 drochner Exp $	*/
 /*	$FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */
 /*	$OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $	*/
 
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.48 2011/11/29 03:50:31 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.49 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -254,9 +254,7 @@
 		panic("hifn_attach: impossible");
 	}
 
-	aprint_naive(": Crypto processor\n");
-	aprint_normal(": %s, rev. %d\n", hp->hifn_name,
-	    PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo_fancy(pa, "Crypto processor", hp->hifn_name, 1);
 
 	sc->sc_pci_pc = pa->pa_pc;
 	sc->sc_pci_tag = pa->pa_tag;
--- a/sys/dev/pci/ichsmb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/ichsmb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.25 2011/05/15 01:00:52 msaitoh Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.25 2011/05/15 01:00:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.26 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -124,14 +124,10 @@
 	bus_size_t iosize;
 	pci_intr_handle_t ih;
 	const char *intrstr = NULL;
-	char devinfo[256];
 
 	sc->sc_dev = self;
 
-	aprint_naive("\n");
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	/* Read configuration */
 	conf = pci_conf_read(pa->pa_pc, pa->pa_tag, LPCIB_SMB_HOSTC);
--- a/sys/dev/pci/if_an_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_an_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $	*/
+/*	$NetBSD: if_an_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.32 2011/07/26 20:51:23 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_an_pci.c,v 1.33 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -118,7 +118,6 @@
         struct pci_attach_args *pa = (struct pci_attach_args *)aux;
 	struct an_pci_softc *psc = device_private(self);
 	struct an_softc *sc = &psc->sc_an;
-        char devinfo[256];
 	char const *intrstr;
 	pci_intr_handle_t ih;
 	bus_size_t iosize;
@@ -128,10 +127,7 @@
 	psc->sc_pct = pa->pa_pc;
 	psc->sc_pcitag = pa->pa_tag;
 
-	aprint_naive(": 802.11 controller\n");
-
-        pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-        aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, "802.11 controller");
 
         /* Map I/O registers */
         if (pci_mapreg_map(pa, AN_PCI_IOBA, PCI_MAPREG_TYPE_IO, 0,
--- a/sys/dev/pci/if_cas.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_cas.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cas.c,v 1.14 2011/08/29 14:47:08 jmcneill Exp $	*/
+/*	$NetBSD: if_cas.c,v 1.15 2012/01/30 19:41:19 drochner Exp $	*/
 /*	$OpenBSD: if_cas.c,v 1.29 2009/11/29 16:19:38 kettenis Exp $	*/
 
 /*
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.14 2011/08/29 14:47:08 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cas.c,v 1.15 2012/01/30 19:41:19 drochner Exp $");
 
 #ifndef _MODULE
 #include "opt_inet.h"
@@ -321,14 +321,12 @@
 {
 	struct pci_attach_args *pa = aux;
 	struct cas_softc *sc = device_private(self);
-	char devinfo[256];
 	prop_data_t data;
 	uint8_t enaddr[ETHER_ADDR_LEN];
 
 	sc->sc_dev = self;
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
+	pci_aprint_devinfo(pa, NULL);
 	sc->sc_rev = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, sc->sc_rev);
 	sc->sc_dmatag = pa->pa_dmat;
 
 #define PCI_CAS_BASEADDR	0x10
--- a/sys/dev/pci/if_dge.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_dge.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_dge.c,v 1.32 2011/11/19 22:51:23 tls Exp $ */
+/*	$NetBSD: if_dge.c,v 1.33 2012/01/30 19:41:19 drochner Exp $ */
 
 /*
  * Copyright (c) 2004, SUNET, Swedish University Computer Network.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.32 2011/11/19 22:51:23 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_dge.c,v 1.33 2012/01/30 19:41:19 drochner Exp $");
 
 #include "rnd.h"
 
@@ -679,9 +679,8 @@
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_pt = pa->pa_tag;
 
-	preg = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG));
-	aprint_naive(": Ethernet controller\n");
-	aprint_normal(": Intel i82597EX 10GbE-LR Ethernet, rev. %d\n", preg);
+	pci_aprint_devinfo_fancy(pa, "Ethernet controller",
+		"Intel i82597EX 10GbE-LR Ethernet", 1);
 
 	memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, DGE_PCI_BAR);
         if (pci_mapreg_map(pa, DGE_PCI_BAR, memtype, 0,
--- a/sys/dev/pci/if_epic_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_epic_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $	*/
+/*	$NetBSD: if_epic_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.39 2011/07/26 20:51:24 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_epic_pci.c,v 1.40 2012/01/30 19:41:19 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -167,16 +167,13 @@
 
 	sc->sc_dev = self;
 
-	aprint_naive(": Ethernet controller\n");
-
 	epp = epic_pci_lookup(pa);
 	if (epp == NULL) {
 		aprint_normal("\n");
 		panic("%s: impossible", __func__);
 	}
 
-	aprint_normal(": %s, rev. %d\n", epp->epp_name,
-	    PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo_fancy(pa, "Ethernet controller", epp->epp_name, 1);
 
 	/* power up chip */
 	if ((error = pci_activate(pa->pa_pc, pa->pa_tag, self,
--- a/sys/dev/pci/if_et.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_et.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_et.c,v 1.2 2011/05/18 01:02:43 dyoung Exp $	*/
+/*	$NetBSD: if_et.c,v 1.3 2012/01/30 19:41:20 drochner Exp $	*/
 /*	$OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.2 2011/05/18 01:02:43 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.3 2012/01/30 19:41:20 drochner Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -205,13 +205,10 @@
 	struct ifnet *ifp = &sc->sc_ethercom.ec_if;
 	pcireg_t memtype;
 	int error;
-	char devinfo[256];
 
-	aprint_naive(": Ethernet controller\n");
+	pci_aprint_devinfo(pa, "Ethernet controller");
 
 	sc->sc_dev = self;
-	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));
 
 	/*
 	 * Initialize tunables
--- a/sys/dev/pci/if_fxp_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_fxp_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_fxp_pci.c,v 1.77 2011/09/05 04:36:50 msaitoh Exp $	*/
+/*	$NetBSD: if_fxp_pci.c,v 1.78 2012/01/30 19:41:20 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_fxp_pci.c,v 1.77 2011/09/05 04:36:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_fxp_pci.c,v 1.78 2012/01/30 19:41:20 drochner Exp $");
 
 #include "rnd.h"
 
@@ -314,8 +314,6 @@
 
 	sc->sc_dev = self;
 
-	aprint_naive(": Ethernet controller\n");
-
 	/*
 	 * Map control/status registers.
 	 */
@@ -411,8 +409,6 @@
 		if (sc->sc_rev >= FXP_REV_82559_A0)
 			sc->sc_flags |= FXPF_HAS_RESUME_BUG;
 
-		aprint_normal(": %s, rev %d\n", chipname != NULL ? chipname :
-		    fpp->fpp_name, sc->sc_rev);
 		break;
 
 	case PCI_PRODUCT_INTEL_82559ER:
@@ -433,8 +429,6 @@
 		if (sc->sc_rev >= FXP_REV_82551_E)
 			chipname = "Intel i82551ER Ethernet";
 
-		aprint_normal(": %s, rev %d\n", chipname != NULL ? chipname :
-		    fpp->fpp_name, sc->sc_rev);
 		break;
 
 	case PCI_PRODUCT_INTEL_82801BA_LAN:
@@ -453,7 +447,6 @@
 		/* FALLTHROUGH */
 
 	default:
-		aprint_normal(": %s, rev %d\n", fpp->fpp_name, sc->sc_rev);
 		if (sc->sc_rev >= FXP_REV_82558_A4)
 			sc->sc_flags |= FXPF_FC|FXPF_EXT_TXCB;
 		if (sc->sc_rev >= FXP_REV_82559_A0)
@@ -462,6 +455,9 @@
 		break;
 	}
 
+	pci_aprint_devinfo_fancy(pa, "Ethernet controller",
+		(chipname ? chipname : fpp->fpp_name), 1);
+
 	/* Make sure bus-mastering is enabled. */
 	pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
 	    pci_conf_read(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG) |
--- a/sys/dev/pci/if_gem_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_gem_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_gem_pci.c,v 1.43 2010/11/13 13:52:06 uebayasi Exp $ */
+/*	$NetBSD: if_gem_pci.c,v 1.44 2012/01/30 19:41:20 drochner Exp $ */
 
 /*
  *
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.43 2010/11/13 13:52:06 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.44 2012/01/30 19:41:20 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -148,7 +148,6 @@
 	struct pci_attach_args *pa = aux;
 	struct gem_pci_softc *gsc = device_private(self);
 	struct gem_softc *sc = &gsc->gsc_gem;
-	char devinfo[256];
 	prop_data_t data;
 	uint8_t enaddr[ETHER_ADDR_LEN];
 	u_int8_t		*enp;
@@ -171,12 +170,10 @@
 #define PROMDATA_PTR_VPD	0x08
 #define PROMDATA_DATA2		0x0a
 
-	aprint_naive(": Ethernet controller\n");
+	pci_aprint_devinfo(pa, "Ethernet controller");
 
 	sc->sc_dev = self;
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
 	sc->sc_chiprev = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, sc->sc_chiprev);
 
 	/*
 	 * Some Sun GEMs/ERIs do have their intpin register bogusly set to 0,
--- a/sys/dev/pci/if_ipw.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_ipw.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ipw.c,v 1.52 2010/11/15 05:57:07 uebayasi Exp $	*/
+/*	$NetBSD: if_ipw.c,v 1.53 2012/01/30 19:41:20 drochner Exp $	*/
 /*	FreeBSD: src/sys/dev/ipw/if_ipw.c,v 1.15 2005/11/13 17:17:40 damien Exp 	*/
 
 /*-
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.52 2010/11/15 05:57:07 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ipw.c,v 1.53 2012/01/30 19:41:20 drochner Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2100 MiniPCI driver
@@ -178,21 +178,18 @@
 	struct ifnet *ifp = &sc->sc_if;
 	struct pci_attach_args *pa = aux;
 	const char *intrstr;
-	char devinfo[256];
 	bus_space_tag_t memt;
 	bus_space_handle_t memh;
 	bus_addr_t base;
 	pci_intr_handle_t ih;
 	uint32_t data;
 	uint16_t val;
-	int i, revision, error;
+	int i, error;
 
 	sc->sc_pct = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo);
-	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
+	pci_aprint_devinfo(pa, NULL);
 
 	/* enable bus-mastering */
 	data = pci_conf_read(sc->sc_pct, pa->pa_tag, PCI_COMMAND_STATUS_REG);
--- a/sys/dev/pci/if_iwi.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_iwi.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwi.c,v 1.88 2011/11/19 22:51:23 tls Exp $  */
+/*	$NetBSD: if_iwi.c,v 1.89 2012/01/30 19:41:20 drochner Exp $  */
 /*	$OpenBSD: if_iwi.c,v 1.111 2010/11/15 19:11:57 damien Exp $	*/
 
 /*-
@@ -19,7 +19,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.88 2011/11/19 22:51:23 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwi.c,v 1.89 2012/01/30 19:41:20 drochner Exp $");
 
 /*-
  * Intel(R) PRO/Wireless 2200BG/2225BG/2915ABG driver
@@ -203,21 +203,18 @@
 	struct ifnet *ifp = &sc->sc_if;
 	struct pci_attach_args *pa = aux;
 	const char *intrstr;
-	char devinfo[256];
 	bus_space_tag_t memt;
 	bus_space_handle_t memh;
 	pci_intr_handle_t ih;
 	pcireg_t data;
 	uint16_t val;
-	int error, revision, i;
+	int error, i;
 
 	sc->sc_dev = self;
 	sc->sc_pct = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo);
-	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
+	pci_aprint_devinfo(pa, NULL);
 
 	/* clear unit numbers allocated to IBSS */
 	sc->sc_unr = 0;
--- a/sys/dev/pci/if_iwn.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_iwn.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.61 2011/10/08 11:07:09 elric Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.62 2012/01/30 19:41:20 drochner Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.61 2011/10/08 11:07:09 elric Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_iwn.c,v 1.62 2012/01/30 19:41:20 drochner Exp $");
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -339,11 +339,9 @@
 	struct ifnet *ifp = &sc->sc_ec.ec_if;
 	struct pci_attach_args *pa = aux;
 	const char *intrstr;
-	char devinfo[256];
 	pci_intr_handle_t ih;
 	pcireg_t memtype, reg;
 	int i, error;
-	int revision;
 
 	sc->sc_dev = self;
 	sc->sc_pct = pa->pa_pc;
@@ -354,9 +352,7 @@
 	callout_init(&sc->calib_to, 0);
 	callout_setfunc(&sc->calib_to, iwn_calib_timeout, sc);
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo);
-	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
+	pci_aprint_devinfo(pa, NULL);
 
 	/*
 	 * Get the offset of the PCI Express Capability Structure in PCI
--- a/sys/dev/pci/if_mtd_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_mtd_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mtd_pci.c,v 1.16 2011/07/26 20:51:24 dyoung Exp $ */
+/* $NetBSD: if_mtd_pci.c,v 1.17 2012/01/30 19:41:20 drochner Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 /* TODO: Check why in IO space, the MII won't work. Memory mapped works */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mtd_pci.c,v 1.16 2011/07/26 20:51:24 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mtd_pci.c,v 1.17 2012/01/30 19:41:20 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -97,10 +97,8 @@
 	bus_space_tag_t iot, memt;
 	bus_space_handle_t ioh, memh;
 	int io_valid, mem_valid;
-	char devinfo[256];
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo(pa, NULL);
 
 	io_valid = (pci_mapreg_map(pa, PCI_IO_MAP_REG, PCI_MAPREG_TYPE_IO,
 			0, &iot, &ioh, NULL, NULL) == 0);
--- a/sys/dev/pci/if_nfe.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_nfe.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_nfe.c,v 1.54 2011/01/23 03:15:06 tsutsui Exp $	*/
+/*	$NetBSD: if_nfe.c,v 1.55 2012/01/30 19:41:20 drochner Exp $	*/
 /*	$OpenBSD: if_nfe.c,v 1.77 2008/02/05 16:52:50 brad Exp $	*/
 
 /*-
@@ -21,7 +21,7 @@
 /* Driver for NVIDIA nForce MCP Fast Ethernet and Gigabit Ethernet */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.54 2011/01/23 03:15:06 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_nfe.c,v 1.55 2012/01/30 19:41:20 drochner Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -220,13 +220,11 @@
 	const char *intrstr;
 	struct ifnet *ifp;
 	pcireg_t memtype, csr;
-	char devinfo[256];
 	int mii_flags = 0;
 
 	sc->sc_dev = self;
 	sc->sc_pc = pa->pa_pc;
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, NFE_PCI_BA);
 	switch (memtype) {
--- a/sys/dev/pci/if_ral_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_ral_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ral_pci.c,v 1.18 2011/07/26 20:51:24 dyoung Exp $	*/
+/*	$NetBSD: if_ral_pci.c,v 1.19 2012/01/30 19:41:20 drochner Exp $	*/
 /*	$OpenBSD: if_ral_pci.c,v 1.6 2006/01/09 20:03:43 damien Exp $  */
 
 /*-
@@ -22,7 +22,7 @@
  * PCI front-end for the Ralink RT2560/RT2561/RT2561S/RT2661 driver.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.18 2011/07/26 20:51:24 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ral_pci.c,v 1.19 2012/01/30 19:41:20 drochner Exp $");
 
 
 #include <sys/param.h>
@@ -124,15 +124,12 @@
 	struct rt2560_softc *sc = &psc->sc_sc;
 	const struct pci_attach_args *pa = aux;
 	const char *intrstr;
-	char devinfo[256];
 	bus_addr_t base;
 	pci_intr_handle_t ih;
 	pcireg_t reg;
-	int error, revision;
+	int error;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
+	pci_aprint_devinfo(pa, NULL);
 
 	psc->sc_opns = (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_RALINK_RT2560) ?
 	    &ral_rt2560_opns : &ral_rt2661_opns;
--- a/sys/dev/pci/if_re_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_re_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_re_pci.c,v 1.40 2010/07/27 21:48:41 jakllsch Exp $	*/
+/*	$NetBSD: if_re_pci.c,v 1.41 2012/01/30 19:41:20 drochner Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.40 2010/07/27 21:48:41 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.41 2012/01/30 19:41:20 drochner Exp $");
 
 #include <sys/types.h>
 
@@ -226,8 +226,7 @@
 	t = re_pci_lookup(pa);
 	KASSERT(t != NULL);
 
-	aprint_normal(": %s (rev. 0x%02x)\n",
-	    t->rtk_name, PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo_fancy(pa, NULL, t->rtk_name, 1);
 
 	if (t->rtk_basetype == RTK_8139CPLUS)
 		sc->sc_quirk |= RTKQ_8139CPLUS;
--- a/sys/dev/pci/if_rtk_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_rtk_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_rtk_pci.c,v 1.42 2010/11/02 16:54:29 jakllsch Exp $	*/
+/*	$NetBSD: if_rtk_pci.c,v 1.43 2012/01/30 19:41:20 drochner Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -47,7 +47,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rtk_pci.c,v 1.42 2010/11/02 16:54:29 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rtk_pci.c,v 1.43 2012/01/30 19:41:20 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -169,9 +169,7 @@
 	t = rtk_pci_lookup(pa);
 	KASSERT(t != NULL);
 
-	aprint_naive("\n");
-	aprint_normal(": %s (rev. 0x%02x)\n",
-	    t->rtk_name, PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo_fancy(pa, NULL, t->rtk_name, 1);
 
 	/*
 	 * Map control/status registers.
--- a/sys/dev/pci/if_stge.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_stge.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_stge.c,v 1.53 2011/03/12 16:52:05 phx Exp $	*/
+/*	$NetBSD: if_stge.c,v 1.54 2012/01/30 19:41:21 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.53 2011/03/12 16:52:05 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_stge.c,v 1.54 2012/01/30 19:41:21 drochner Exp $");
 
 
 #include <sys/param.h>
@@ -397,7 +397,7 @@
 
 	sc->sc_rev = PCI_REVISION(pa->pa_class);
 
-	aprint_normal(": %s, rev. %d\n", sp->stge_name, sc->sc_rev);
+	pci_aprint_devinfo_fancy(pa, NULL, sp->stge_name, 1);
 
 	/*
 	 * Map the device.
--- a/sys/dev/pci/if_vge.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_vge.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vge.c,v 1.51 2010/04/05 07:20:27 joerg Exp $ */
+/* $NetBSD: if_vge.c,v 1.52 2012/01/30 19:41:21 drochner Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.51 2010/04/05 07:20:27 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.52 2012/01/30 19:41:21 drochner Exp $");
 
 /*
  * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver.
@@ -944,8 +944,7 @@
 
 	sc->sc_dev = self;
 
-	aprint_normal(": VIA VT612X Gigabit Ethernet (rev. %#x)\n",
-	    PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo_fancy(pa, NULL, "VIA VT612X Gigabit Ethernet", 1);
 
 	/* Make sure bus-mastering is enabled */
         pci_conf_write(pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
--- a/sys/dev/pci/if_vr.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_vr.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vr.c,v 1.108 2011/11/19 22:51:23 tls Exp $	*/
+/*	$NetBSD: if_vr.c,v 1.109 2012/01/30 19:41:21 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.108 2011/11/19 22:51:23 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.109 2012/01/30 19:41:21 drochner Exp $");
 
 #include "rnd.h"
 
@@ -1440,7 +1440,6 @@
 	struct ifnet *ifp;
 	uint8_t eaddr[ETHER_ADDR_LEN], mac;
 	int i, rseg, error;
-	char devinfo[256];
 
 #define	PCI_CONF_WRITE(r, v)	pci_conf_write(sc->vr_pc, sc->vr_tag, (r), (v))
 #define	PCI_CONF_READ(r)	pci_conf_read(sc->vr_pc, sc->vr_tag, (r))
@@ -1451,10 +1450,7 @@
 	sc->vr_id = pa->pa_id;
 	callout_init(&sc->vr_tick_ch, 0);
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_naive("\n");
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
-	    PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo(pa, NULL);
 
 	/*
 	 * Handle power management nonsense.
--- a/sys/dev/pci/if_vte.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_vte.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vte.c,v 1.3 2011/04/28 17:32:48 bouyer Exp $	*/
+/*	$NetBSD: if_vte.c,v 1.4 2012/01/30 19:41:21 drochner Exp $	*/
 
 /*
  * Copyright (c) 2011 Manuel Bouyer.  All rights reserved.
@@ -55,7 +55,7 @@
 /* Driver for DM&P Electronics, Inc, Vortex86 RDC R6040 FastEthernet. */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.3 2011/04/28 17:32:48 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vte.c,v 1.4 2012/01/30 19:41:21 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -175,12 +175,10 @@
 	pci_intr_handle_t intrhandle;
 	const char *intrstr;
 	int error;
-	char devinfo[256];
 	const struct sysctlnode *node;
 	int vte_nodenum;
 
 	sc->vte_dev = self;
-	aprint_normal("\n");
 
 	callout_init(&sc->vte_tick_ch, 0);
 
@@ -210,8 +208,7 @@
 	pci_conf_write(pa->pa_pc, pa->pa_tag, PCI_COMMAND_STATUS_REG,
 	    csr | PCI_COMMAND_MASTER_ENABLE);
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal_dev(self, "%s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	/* Reset the ethernet controller. */
 	vte_reset(sc);
--- a/sys/dev/pci/if_wi_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_wi_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: if_wi_pci.c,v 1.53 2011/07/26 20:51:24 dyoung Exp $  */
+/*      $NetBSD: if_wi_pci.c,v 1.54 2012/01/30 19:41:21 drochner Exp $  */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.53 2011/07/26 20:51:24 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wi_pci.c,v 1.54 2012/01/30 19:41:21 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -290,13 +290,7 @@
 		break;
 	}
 
-	{
-		char devinfo[256];
-
-		pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-		printf(": %s (rev. 0x%02x)\n", devinfo,
-		       PCI_REVISION(pa->pa_class));
-	}
+	pci_aprint_devinfo(pa, NULL);
 
 	sc->sc_enabled = 1;
 	sc->sc_enable = wi_pci_enable;
--- a/sys/dev/pci/if_wm.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_wm.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.225 2011/11/28 18:21:46 bouyer Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.226 2012/01/30 19:41:21 drochner Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.225 2011/11/28 18:21:46 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.226 2012/01/30 19:41:21 drochner Exp $");
 
 #include "rnd.h"
 
@@ -1143,8 +1143,7 @@
 		sc->sc_dmat = pa->pa_dmat;
 
 	sc->sc_rev = PCI_REVISION(pci_conf_read(pc, pa->pa_tag, PCI_CLASS_REG));
-	aprint_naive(": Ethernet controller\n");
-	aprint_normal(": %s, rev. %d\n", wmp->wmp_name, sc->sc_rev);
+	pci_aprint_devinfo_fancy(pa, "Ethernet controller", wmp->wmp_name, 1);
 
 	sc->sc_type = wmp->wmp_type;
 	if (sc->sc_type < WM_T_82543) {
--- a/sys/dev/pci/if_wpi.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/if_wpi.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_wpi.c,v 1.49 2011/04/02 08:11:31 mbalmer Exp $    */
+/*  $NetBSD: if_wpi.c,v 1.50 2012/01/30 19:41:21 drochner Exp $    */
 
 /*-
  * Copyright (c) 2006, 2007
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.49 2011/04/02 08:11:31 mbalmer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wpi.c,v 1.50 2012/01/30 19:41:21 drochner Exp $");
 
 /*
  * Driver for Intel PRO/Wireless 3945ABG 802.11 network adapters.
@@ -209,12 +209,11 @@
 	struct ifnet *ifp = &sc->sc_ec.ec_if;
 	struct pci_attach_args *pa = aux;
 	const char *intrstr;
-	char devinfo[256];
 	bus_space_tag_t memt;
 	bus_space_handle_t memh;
 	pci_intr_handle_t ih;
 	pcireg_t data;
-	int error, ac, revision;
+	int error, ac;
 
 	RUN_ONCE(&wpi_firmware_init, wpi_attach_once);
 	sc->fw_used = false;
@@ -226,9 +225,7 @@
 	callout_init(&sc->calib_to, 0);
 	callout_setfunc(&sc->calib_to, wpi_calib_timeout, sc);
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof devinfo);
-	revision = PCI_REVISION(pa->pa_class);
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo, revision);
+	pci_aprint_devinfo(pa, NULL);
 
 	/* enable bus-mastering */
 	data = pci_conf_read(sc->sc_pct, sc->sc_pcitag, PCI_COMMAND_STATUS_REG);
--- a/sys/dev/pci/igsfb_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/igsfb_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: igsfb_pci.c,v 1.22 2011/08/27 20:02:18 martin Exp $ */
+/*	$NetBSD: igsfb_pci.c,v 1.23 2012/01/30 19:41:21 drochner Exp $ */
 
 /*
  * Copyright (c) 2002, 2003 Valeriy E. Ushakov
@@ -31,7 +31,7 @@
  * Integraphics Systems IGA 168x and CyberPro series.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: igsfb_pci.c,v 1.22 2011/08/27 20:02:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: igsfb_pci.c,v 1.23 2012/01/30 19:41:21 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -156,12 +156,10 @@
 	struct igsfb_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
 	int isconsole;
-	char devinfo[256];
 
 	sc->sc_dev = self;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo(pa, NULL);
 
 #if defined(__sparc__) && !defined(KRUPS_FORCE_SERIAL_CONSOLE)
 	/* XXX: this doesn't belong here */
--- a/sys/dev/pci/iha_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/iha_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: iha_pci.c,v 1.17 2010/11/13 13:52:07 uebayasi Exp $ */
+/*	$NetBSD: iha_pci.c,v 1.18 2012/01/30 19:41:21 drochner Exp $ */
 
 /*-
  * Copyright (c) 2001 Izumi Tsutsui.  All rights reserved.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: iha_pci.c,v 1.17 2010/11/13 13:52:07 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iha_pci.c,v 1.18 2012/01/30 19:41:21 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -111,13 +111,10 @@
 	const char *intrstr;
 	pcireg_t command;
 	int ioh_valid;
-	char devinfo[256];
 
 	sc->sc_dev = self;
 
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	command  = pci_conf_read(pa->pa_pc,pa->pa_tag,PCI_COMMAND_STATUS_REG);
 	command |= PCI_COMMAND_MASTER_ENABLE | PCI_COMMAND_PARITY_ENABLE;
--- a/sys/dev/pci/jmide.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/jmide.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: jmide.c,v 1.11 2011/08/13 16:04:09 jakllsch Exp $	*/
+/*	$NetBSD: jmide.c,v 1.12 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*
  * Copyright (c) 2007 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: jmide.c,v 1.11 2011/08/13 16:04:09 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: jmide.c,v 1.12 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -146,7 +146,6 @@
 	struct pci_attach_args *pa = aux;
 	struct jmide_softc *sc = device_private(self);
 	const struct jmide_product *jp;
-        char devinfo[256];
 	const char *intrstr;
         pci_intr_handle_t intrhandle;
 	u_int32_t pcictrl0 = pci_conf_read(pa->pa_pc, pa->pa_tag,
@@ -166,9 +165,7 @@
 	sc->sc_npata = jp->jm_npata;
 	sc->sc_nsata = jp->jm_nsata;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-        aprint_naive(": JMICRON PATA/SATA disk controller\n");
-        aprint_normal(": %s\n", devinfo);
+        pci_aprint_devinfo(pa, "JMICRON PATA/SATA disk controller");
 
 	aprint_normal("%s: ", JM_NAME(sc));
 	if (sc->sc_npata)
--- a/sys/dev/pci/joy_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/joy_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: joy_pci.c,v 1.19 2011/12/05 19:20:55 christos Exp $	*/
+/*	$NetBSD: joy_pci.c,v 1.20 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: joy_pci.c,v 1.19 2011/12/05 19:20:55 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: joy_pci.c,v 1.20 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -91,12 +91,10 @@
 	struct joy_pci_softc *psc = device_private(self);
 	struct joy_softc *sc = &psc->sc_joy;
 	struct pci_attach_args *pa = aux;
-	char devinfo[256];
 	bus_size_t mapsize;
 	int reg;
 
-	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));
+	pci_aprint_devinfo(pa, NULL);
 	
 	for (reg = PCI_MAPREG_START; reg < PCI_MAPREG_END;
 	     reg += sizeof(pcireg_t))
--- a/sys/dev/pci/machfb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/machfb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: machfb.c,v 1.72 2012/01/11 16:02:29 macallan Exp $	*/
+/*	$NetBSD: machfb.c,v 1.73 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*
  * Copyright (c) 2002 Bang Jun-Young
@@ -34,7 +34,7 @@
 
 #include <sys/cdefs.h>
 __KERNEL_RCSID(0, 
-	"$NetBSD: machfb.c,v 1.72 2012/01/11 16:02:29 macallan Exp $");
+	"$NetBSD: machfb.c,v 1.73 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -505,7 +505,6 @@
 #if defined(__sparc__) || defined(__powerpc__)
 	const struct videomode *mode = NULL;
 #endif
-	char devinfo[256];
 	int bar, id, expected_id;
 	int is_gx;
 	const char **memtype_names;
@@ -529,10 +528,7 @@
 	sc->sc_accessops.ioctl = mach64_ioctl;
 	sc->sc_accessops.mmap = mach64_mmap;
 
-	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));
-	aprint_naive(": Graphics processor\n");
+	pci_aprint_devinfo(pa, "Graphics processor");
 #ifdef MACHFB_DEBUG
 	printf(prop_dictionary_externalize(device_properties(self)));
 #endif
--- a/sys/dev/pci/mpt_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/mpt_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpt_pci.c,v 1.20 2009/11/24 15:51:39 njoly Exp $	*/
+/*	$NetBSD: mpt_pci.c,v 1.21 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mpt_pci.c,v 1.20 2009/11/24 15:51:39 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpt_pci.c,v 1.21 2012/01/30 19:41:22 drochner Exp $");
 
 #include <dev/ic/mpt.h>			/* pulls in all headers */
 
@@ -134,12 +134,8 @@
 	bus_space_tag_t memt;
 	bus_space_handle_t memh;
 	int memh_valid;
-	char devinfo[200];
 
-	pci_devinfo(pa->pa_id, 0, 0, devinfo, sizeof (devinfo));
-
-	aprint_naive("\n");
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	psc->sc_pc = pa->pa_pc;
 	psc->sc_tag = pa->pa_tag;
--- a/sys/dev/pci/mvsata_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/mvsata_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvsata_pci.c,v 1.6 2011/01/31 16:30:48 jakllsch Exp $	*/
+/*	$NetBSD: mvsata_pci.c,v 1.7 2012/01/30 19:41:22 drochner Exp $	*/
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvsata_pci.c,v 1.6 2011/01/31 16:30:48 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvsata_pci.c,v 1.7 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -155,7 +155,6 @@
 	bus_size_t size;
 	uint32_t reg, mask;
 	int read_pre_amps, hc, port, rv, i;
-	char devinfo[256];
 	const char *intrstr;
 
 	sc->sc_wdcdev.sc_atac.atac_dev = self;
@@ -164,9 +163,7 @@
 	sc->sc_dmat = pa->pa_dmat;
 	sc->sc_enable_intr = mvsata_pci_enable_intr;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_naive(": Marvell Serial-ATA Host Controller\n");
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, "Marvell Serial-ATA Host Controller");
 	
 	/* Map I/O register */
 	if (pci_mapreg_map(pa, PCI_MAPREG_START,
--- a/sys/dev/pci/nca_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/nca_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nca_pci.c,v 1.1 2010/04/01 04:04:11 jakllsch Exp $  */
+/*	$NetBSD: nca_pci.c,v 1.2 2012/01/30 19:41:22 drochner Exp $  */
 
 /*
  * Copyright (c) 2010 Jonathan A. Kollasch
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nca_pci.c,v 1.1 2010/04/01 04:04:11 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nca_pci.c,v 1.2 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -74,14 +74,10 @@
 {
 	struct ncr5380_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
-	char devinfo[128];
 
 	sc->sc_dev = self;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_naive(": SCSI controller\n");
-	aprint_normal(": %s (rev 0x%02x)\n", devinfo,
-		      PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo(pa, "SCSI controller");
 
 	if (pci_mapreg_map(pa, 0x10, PCI_MAPREG_TYPE_IO, 0,
             &sc->sc_regt, &sc->sc_regh, NULL, NULL)) {
--- a/sys/dev/pci/nfsmb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/nfsmb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfsmb.c,v 1.21 2010/05/08 07:41:44 pgoyette Exp $	*/
+/*	$NetBSD: nfsmb.c,v 1.22 2012/01/30 19:41:22 drochner Exp $	*/
 /*
  * Copyright (c) 2007 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  *
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfsmb.c,v 1.21 2010/05/08 07:41:44 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfsmb.c,v 1.22 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -141,12 +141,8 @@
 	struct nfsmbc_attach_args nfsmbca;
 	pcireg_t reg;
 	int baseregs[2];
-	char devinfo[256];
 
-	aprint_naive("\n");
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	sc->sc_dev = self;
 	sc->sc_pc = pa->pa_pc;
--- a/sys/dev/pci/ohci_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/ohci_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci_pci.c,v 1.47 2011/04/04 22:48:15 dyoung Exp $	*/
+/*	$NetBSD: ohci_pci.c,v 1.48 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.47 2011/04/04 22:48:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci_pci.c,v 1.48 2012/01/30 19:41:22 drochner Exp $");
 
 #include "ehci.h"
 
@@ -88,17 +88,13 @@
 	char const *intrstr;
 	pci_intr_handle_t ih;
 	pcireg_t csr;
-	char devinfo[256];
 	usbd_status r;
 	const char *vendor;
 
 	sc->sc.sc_dev = self;
 	sc->sc.sc_bus.hci_private = sc;
 
-	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));
-	aprint_naive(": USB Controller\n");
+	pci_aprint_devinfo(pa, "USB Controller");
 
 	/* Map I/O registers */
 	if (pci_mapreg_map(pa, PCI_CBMEM, PCI_MAPREG_TYPE_MEM, 0,
--- a/sys/dev/pci/pccbb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/pccbb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pccbb.c,v 1.203 2011/08/01 11:20:26 drochner Exp $	*/
+/*	$NetBSD: pccbb.c,v 1.204 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 and 2000
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.203 2011/08/01 11:20:26 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.204 2012/01/30 19:41:22 drochner Exp $");
 
 /*
 #define CBB_DEBUG
@@ -382,7 +382,6 @@
 	pci_chipset_tag_t pc = pa->pa_pc;
 	pcireg_t busreg, reg, sock_base;
 	bus_addr_t sockbase;
-	char devinfo[256];
 	int flags;
 
 #ifdef __HAVE_PCCBB_ATTACH_HOOK
@@ -399,13 +398,8 @@
 
 	sc->sc_chipset = cb_chipset(pa->pa_id, &flags);
 
-	aprint_naive("\n");
-
-	pci_devinfo(pa->pa_id, 0, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s (rev. 0x%02x)", devinfo,
-	    PCI_REVISION(pa->pa_class));
-	DPRINTF((" (chipflags %x)", flags));
-	aprint_normal("\n");
+	pci_aprint_devinfo(pa, NULL);
+	DPRINTF(("(chipflags %x)", flags));
 
 	TAILQ_INIT(&sc->sc_memwindow);
 	TAILQ_INIT(&sc->sc_iowindow);
--- a/sys/dev/pci/pciide_common.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/pciide_common.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciide_common.c,v 1.51 2011/05/17 17:34:54 dyoung Exp $	*/
+/*	$NetBSD: pciide_common.c,v 1.52 2012/01/30 19:41:22 drochner Exp $	*/
 
 
 /*
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.51 2011/05/17 17:34:54 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pciide_common.c,v 1.52 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/malloc.h>
@@ -120,28 +120,27 @@
 #if NATA_DMA
 	pcireg_t csr;
 #endif
-	char devinfo[256];
-	const char *displaydev;
-
-	aprint_naive(": disk controller\n");
+	const char *displaydev = NULL;
+	int dontprint = 0;
 
 	sc->sc_pci_id = pa->pa_id;
 	if (pp == NULL) {
 		/* should only happen for generic pciide devices */
 		sc->sc_pp = &default_product_desc;
-		pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-		displaydev = devinfo;
 	} else {
 		sc->sc_pp = pp;
-		displaydev = sc->sc_pp->ide_name;
+		/* if ide_name == NULL, printf is done in chip-specific map */
+		if (pp->ide_name)
+			displaydev = pp->ide_name;
+		else
+			dontprint = 1;
 	}
 
-	/* if displaydev == NULL, printf is done in chip-specific map */
-	if (displaydev)
-		aprint_normal(": %s (rev. 0x%02x)\n", displaydev,
-		    PCI_REVISION(pa->pa_class));
-	else
-		aprint_normal("\n");
+	if (dontprint) {
+		aprint_naive("disk controller\n");
+		aprint_normal("\n"); /* ??? */
+	} else
+		pci_aprint_devinfo_fancy(pa, "disk controller", displaydev, 1);
 
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_tag = pa->pa_tag;
--- a/sys/dev/pci/pcscp.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/pcscp.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $	*/
+/*	$NetBSD: pcscp.c,v 1.46 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pcscp.c,v 1.45 2010/11/13 13:52:08 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pcscp.c,v 1.46 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -161,11 +161,9 @@
 	pcireg_t csr;
 	bus_dma_segment_t seg;
 	int error, rseg;
-	char devinfo[256];
 
 	sc->sc_dev = self;
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 	aprint_normal("%s", device_xname(sc->sc_dev));
 
 	if (pci_mapreg_map(pa, IO_MAP_REG, PCI_MAPREG_TYPE_IO, 0,
--- a/sys/dev/pci/piixpm.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/piixpm.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: piixpm.c,v 1.38 2012/01/07 15:59:46 pgoyette Exp $ */
+/* $NetBSD: piixpm.c,v 1.39 2012/01/30 19:41:22 drochner Exp $ */
 /*	$OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.38 2012/01/07 15:59:46 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixpm.c,v 1.39 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -158,7 +158,6 @@
 	pcireg_t base, conf;
 	pcireg_t pmmisc;
 	pci_intr_handle_t ih;
-	char devinfo[256];
 	const char *intrstr = NULL;
 
 	sc->sc_dev = self;
@@ -166,11 +165,7 @@
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 
-	aprint_naive("\n");
-
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	if (!pmf_device_register(self, piixpm_suspend, piixpm_resume))
 		aprint_error_dev(self, "couldn't establish power handler\n");
--- a/sys/dev/pci/pm2fb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/pm2fb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm2fb.c,v 1.11 2012/01/11 16:02:30 macallan Exp $	*/
+/*	$NetBSD: pm2fb.c,v 1.12 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*
  * Copyright (c) 2009 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.11 2012/01/11 16:02:30 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pm2fb.c,v 1.12 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -224,7 +224,6 @@
 	struct pm2fb_softc	*sc = device_private(self);
 	struct pci_attach_args	*pa = aux;
 	struct rasops_info	*ri;
-	char devinfo[256];
 	struct wsemuldisplaydev_attach_args aa;
 	prop_dictionary_t	dict;
 	unsigned long		defattr;
@@ -238,8 +237,7 @@
 	sc->sc_iot = pa->pa_iot;
 	sc->sc_dev = self;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	/* fill in parameters from properties */
 	dict = device_properties(self);
--- a/sys/dev/pci/r128fb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/r128fb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: r128fb.c,v 1.27 2012/01/11 16:02:29 macallan Exp $	*/
+/*	$NetBSD: r128fb.c,v 1.28 2012/01/30 19:41:22 drochner Exp $	*/
 
 /*
  * Copyright (c) 2007 Michael Lorenz
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.27 2012/01/11 16:02:29 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: r128fb.c,v 1.28 2012/01/30 19:41:22 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -198,7 +198,6 @@
 	struct pci_attach_args	*pa = aux;
 	struct rasops_info	*ri;
 	bus_space_tag_t		tag;
-	char devinfo[256];
 	struct wsemuldisplaydev_attach_args aa;
 	prop_dictionary_t	dict;
 	unsigned long		defattr;
@@ -213,8 +212,7 @@
 	sc->sc_iot = pa->pa_iot;
 	sc->sc_dev = self;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	/* fill in parameters from properties */
 	dict = device_properties(self);
--- a/sys/dev/pci/radeonfb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/radeonfb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: radeonfb.c,v 1.52 2012/01/11 16:02:30 macallan Exp $ */
+/*	$NetBSD: radeonfb.c,v 1.53 2012/01/30 19:41:23 drochner Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.52 2012/01/11 16:02:30 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeonfb.c,v 1.53 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -450,11 +450,7 @@
 			break;
 	}
 
-	pci_devinfo(sc->sc_id, pa->pa_class, 0, sc->sc_devinfo,
-	    sizeof(sc->sc_devinfo));
-
-	aprint_naive("\n");
-	aprint_normal(": %s\n", sc->sc_devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	DPRINTF((prop_dictionary_externalize(device_properties(dev))));
 
--- a/sys/dev/pci/radeonfbvar.h	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/radeonfbvar.h	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: radeonfbvar.h,v 1.12 2011/12/30 14:32:31 macallan Exp $ */
+/* $NetBSD: radeonfbvar.h,v 1.13 2012/01/30 19:41:23 drochner Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -214,8 +214,6 @@
 	uint16_t		sc_flags;
 	pcireg_t		sc_id;
 
-	char			sc_devinfo[256];
-
 	bus_space_tag_t		sc_regt;
 	bus_space_handle_t	sc_regh;
 	bus_size_t		sc_regsz;
--- a/sys/dev/pci/sdhc_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/sdhc_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc_pci.c,v 1.4 2011/02/02 04:18:14 jakllsch Exp $	*/
+/*	$NetBSD: sdhc_pci.c,v 1.5 2012/01/30 19:41:23 drochner Exp $	*/
 /*	$OpenBSD: sdhc_pci.c,v 1.7 2007/10/30 18:13:45 chl Exp $	*/
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.4 2011/02/02 04:18:14 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc_pci.c,v 1.5 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -176,7 +176,6 @@
 	pci_intr_handle_t ih;
 	pcireg_t csr;
 	pcireg_t slotinfo;
-	char devinfo[256];
 	char const *intrstr;
 	int nslots;
 	int reg;
@@ -190,10 +189,7 @@
 	sc->sc.sc_dmat = pa->pa_dmat;
 	sc->sc.sc_host = NULL;
 
-	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));
-	aprint_naive("\n");
+	pci_aprint_devinfo(pa, NULL);
 
 	/* Some controllers needs special treatment. */
 	flags = sdhc_pci_lookup_quirk_flags(pa);
--- a/sys/dev/pci/siisata_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/siisata_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata_pci.c,v 1.9 2010/11/13 13:52:08 uebayasi Exp $ */
+/* $NetBSD: siisata_pci.c,v 1.10 2012/01/30 19:41:23 drochner Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.9 2010/11/13 13:52:08 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.10 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -138,7 +138,6 @@
 	struct pci_attach_args *pa = aux;
 	struct siisata_pci_softc *psc = device_private(self);
 	struct siisata_softc *sc = &psc->si_sc;
-	char devinfo[256];
 	const char *intrstr;
 	pcireg_t csr, memtype;
 	const struct siisata_pci_board *spbp;
@@ -154,9 +153,7 @@
 	psc->sc_pc = pa->pa_pc;
 	psc->sc_pcitag = pa->pa_tag;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 1, devinfo, sizeof(devinfo));
-	aprint_naive(": SATA-II HBA\n");
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, "SATA-II HBA");
 
 	/* map BAR 0, global registers */
 	memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, SIISATA_PCI_BAR0);
--- a/sys/dev/pci/sisfb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/sisfb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.1 2011/08/27 13:28:37 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sisfb.c,v 1.2 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -222,7 +222,6 @@
 	struct wsemuldisplaydev_attach_args waa;
 	bus_size_t fbsize, mmiosize, iosize;
 	struct sisfb *fb;
-	char devinfo[256];
 	int console;
 	unsigned long defattr;
 
@@ -238,8 +237,7 @@
 	sc->sc_fb = fb;
 	fb->sc = sc;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	if (!console) {
 		fb->fbt = pa->pa_memt;
--- a/sys/dev/pci/twa.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/twa.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: twa.c,v 1.39 2012/01/27 19:48:39 para Exp $ */
+/*	$NetBSD: twa.c,v 1.40 2012/01/30 19:41:23 drochner Exp $ */
 /*	$wasabi: twa.c,v 1.27 2006/07/28 18:17:21 wrstuden Exp $	*/
 
 /*-
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: twa.c,v 1.39 2012/01/27 19:48:39 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: twa.c,v 1.40 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1505,8 +1505,7 @@
 	sc->pc = pa->pa_pc;
 	sc->tag = pa->pa_tag;
 
-	aprint_naive(": RAID controller\n");
-	aprint_normal(": 3ware Apache\n");
+	pci_aprint_devinfo_fancy(pa, "RAID controller", "3ware Apache", 0);
 
 	sc->sc_quirks = 0;
 		
--- a/sys/dev/pci/ubsec.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/ubsec.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubsec.c,v 1.26 2011/11/19 22:51:24 tls Exp $	*/
+/*	$NetBSD: ubsec.c,v 1.27 2012/01/30 19:41:23 drochner Exp $	*/
 /* $FreeBSD: src/sys/dev/ubsec/ubsec.c,v 1.6.2.6 2003/01/23 21:06:43 sam Exp $ */
 /*	$OpenBSD: ubsec.c,v 1.127 2003/06/04 14:04:58 jason Exp $	*/
 
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.26 2011/11/19 22:51:24 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubsec.c,v 1.27 2012/01/30 19:41:23 drochner Exp $");
 
 #undef UBSEC_DEBUG
 
@@ -313,9 +313,7 @@
 		panic("ubsec_attach: impossible");
 	}
 
-	aprint_naive(": Crypto processor\n");
-	aprint_normal(": %s, rev. %d\n", up->ubsec_name,
-	    PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo_fancy(pa, "Crypto processor", up->ubsec_name, 1);
 
 	SIMPLEQ_INIT(&sc->sc_queue);
 	SIMPLEQ_INIT(&sc->sc_qchip);
--- a/sys/dev/pci/uhci_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/uhci_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci_pci.c,v 1.53 2011/04/04 22:48:15 dyoung Exp $	*/
+/*	$NetBSD: uhci_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.53 2011/04/04 22:48:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $");
 
 #include "ehci.h"
 
@@ -91,18 +91,13 @@
 	pci_intr_handle_t ih;
 	pcireg_t csr;
 	const char *vendor;
-	char devinfo[256];
 	usbd_status r;
 	int s;
 
 	sc->sc.sc_dev = self;
 	sc->sc.sc_bus.hci_private = sc;
 
-	aprint_naive("\n");
-
-	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));
+	pci_aprint_devinfo(pa, NULL);
 
 	/* Map I/O registers */
 	if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0,
--- a/sys/dev/pci/vga_pci.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/vga_pci.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: vga_pci.c,v 1.53 2011/01/22 15:14:28 cegger Exp $	*/
+/*	$NetBSD: vga_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.53 2011/01/22 15:14:28 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.54 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -186,7 +186,6 @@
 	struct vga_pci_softc *psc = device_private(self);
 	struct vga_softc *sc = &psc->sc_vga;
 	struct pci_attach_args *pa = aux;
-	char devinfo[256];
 	int bar, reg;
 
 	sc->sc_dev = self;
@@ -194,10 +193,7 @@
 	psc->sc_pcitag = pa->pa_tag;
 	psc->sc_paa = *pa;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_naive("\n");
-	aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
-	    PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo(pa, NULL);
 
 	/*
 	 * Gather info about all the BARs.  These are used to allow
--- a/sys/dev/pci/voodoofb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/voodoofb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: voodoofb.c,v 1.37 2012/01/25 03:49:12 macallan Exp $	*/
+/*	$NetBSD: voodoofb.c,v 1.38 2012/01/30 19:41:23 drochner Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006 Michael Lorenz
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.37 2012/01/25 03:49:12 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voodoofb.c,v 1.38 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -347,7 +347,6 @@
 {
 	struct voodoofb_softc *sc = device_private(self);	
 	struct pci_attach_args *pa = aux;
-	char devinfo[256];
 	struct wsemuldisplaydev_attach_args aa;
 	struct rasops_info *ri;
 #ifdef VOODOOFB_ENABLE_INTR
@@ -366,8 +365,7 @@
 	sc->sc_pc = pa->pa_pc;
 	sc->sc_pcitag = pa->pa_tag;
 	sc->sc_dacw = -1;
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	printf(": %s (rev. 0x%02x)\n", devinfo, PCI_REVISION(pa->pa_class));
+	pci_aprint_devinfo(pa, NULL);
 
 	sc->sc_memt = pa->pa_memt;
 	sc->sc_iot = pa->pa_iot;
--- a/sys/dev/pci/voyager.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/voyager.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: voyager.c,v 1.8 2011/12/13 14:41:55 macallan Exp $	*/
+/*	$NetBSD: voyager.c,v 1.9 2012/01/30 19:41:23 drochner Exp $	*/
 
 /*
  * Copyright (c) 2009, 2011 Michael Lorenz
@@ -26,7 +26,7 @@
  */
  
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.8 2011/12/13 14:41:55 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: voyager.c,v 1.9 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -149,7 +149,6 @@
 	struct voyager_softc	*sc = device_private(self);
 	struct pci_attach_args	*pa = aux;
 	pci_intr_handle_t ih;
-	char devinfo[256];
 	struct voyager_attach_args vaa;
 	struct i2cbus_attach_args iba;
 	uint32_t reg;
@@ -162,8 +161,7 @@
 	sc->sc_iot = pa->pa_iot;
 	sc->sc_dev = self;
 
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	if (pci_mapreg_map(pa, 0x14, PCI_MAPREG_TYPE_MEM, 0,
 	    &sc->sc_memt, &sc->sc_regh, &sc->sc_reg, &sc->sc_regsize)) {
--- a/sys/dev/pci/wcfb.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/wcfb.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: wcfb.c,v 1.9 2012/01/11 16:02:30 macallan Exp $ */
+/*	$NetBSD: wcfb.c,v 1.10 2012/01/30 19:41:23 drochner Exp $ */
 
 /*-
  * Copyright (c) 2010 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wcfb.c,v 1.9 2012/01/11 16:02:30 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wcfb.c,v 1.10 2012/01/30 19:41:23 drochner Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -156,14 +156,11 @@
 	uint32_t		reg;
 	unsigned long		defattr;
 	bool			is_console = 0;
-	char 			devinfo[256];
 	void *wtf;
 
 	sc->sc_dev = self;
 	sc->putchar = NULL;
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
-	aprint_naive("\n");
-	aprint_normal(": %s\n", devinfo);
+	pci_aprint_devinfo(pa, NULL);
 
 	dict = device_properties(self);
 	prop_dictionary_get_bool(dict, "is_console", &is_console);
--- a/sys/dev/pci/yds.c	Mon Jan 30 19:38:45 2012 +0000
+++ b/sys/dev/pci/yds.c	Mon Jan 30 19:41:18 2012 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: yds.c,v 1.52 2011/11/24 03:35:59 mrg Exp $	*/
+/*	$NetBSD: yds.c,v 1.53 2012/01/30 19:41:23 drochner Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.52 2011/11/24 03:35:59 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: yds.c,v 1.53 2012/01/30 19:41:23 drochner Exp $");
 
 #include "mpu.h"
 
@@ -740,7 +740,6 @@
 	pci_intr_handle_t ih;
 	pcireg_t reg;
 	struct yds_codec_softc *codec;
-	char devinfo[256];
 	int i, r, to;
 	int revision;
 	int ac97_id2;
@@ -749,9 +748,9 @@
 	sc->sc_dev = self;
 	pa = (struct pci_attach_args *)aux;
 	pc = pa->pa_pc;
-	pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
 	revision = PCI_REVISION(pa->pa_class);
-	printf(": %s (rev. 0x%02x)\n", devinfo, revision);
+
+	pci_aprint_devinfo(pa, NULL);
 
 	/* Map register to memory */
 	if (pci_mapreg_map(pa, YDS_PCI_MBA, PCI_MAPREG_TYPE_MEM, 0,