From d8e1a7b61a7b52f0b752f20e000a12bdd465c6ca Mon Sep 17 00:00:00 2001 From: drochner Date: Mon, 30 Jan 2012 19:41:18 +0000 Subject: [PATCH] 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 | 11 +++-------- sys/arch/x86/pci/pcib.c | 11 +++-------- sys/dev/pci/ahcisata_pci.c | 9 +++------ sys/dev/pci/amdpm.c | 10 +++------- sys/dev/pci/auixp.c | 13 ++++--------- sys/dev/pci/autri.c | 9 +++------ sys/dev/pci/btvmei.c | 11 +++-------- sys/dev/pci/chipsfb.c | 9 +++------ sys/dev/pci/cmpci.c | 10 +++------- sys/dev/pci/coram.c | 9 +++------ sys/dev/pci/cs4280.c | 10 +++------- sys/dev/pci/cs4281.c | 10 +++------- sys/dev/pci/cxdtv.c | 11 +++-------- sys/dev/pci/ehci_pci.c | 11 +++-------- sys/dev/pci/emuxki.c | 10 ++++------ sys/dev/pci/esa.c | 10 ++++------ sys/dev/pci/esm.c | 11 +++-------- sys/dev/pci/fwohci_pci.c | 11 +++-------- sys/dev/pci/genfb_pci.c | 9 +++------ sys/dev/pci/gtp.c | 11 +++-------- sys/dev/pci/hifn7751.c | 8 +++----- sys/dev/pci/ichsmb.c | 10 +++------- sys/dev/pci/if_an_pci.c | 10 +++------- sys/dev/pci/if_cas.c | 8 +++----- sys/dev/pci/if_dge.c | 9 ++++----- sys/dev/pci/if_epic_pci.c | 9 +++------ sys/dev/pci/if_et.c | 9 +++------ sys/dev/pci/if_fxp_pci.c | 14 +++++--------- sys/dev/pci/if_gem_pci.c | 9 +++------ sys/dev/pci/if_ipw.c | 11 ++++------- sys/dev/pci/if_iwi.c | 11 ++++------- sys/dev/pci/if_iwn.c | 10 +++------- sys/dev/pci/if_mtd_pci.c | 8 +++----- sys/dev/pci/if_nfe.c | 8 +++----- sys/dev/pci/if_ral_pci.c | 11 ++++------- sys/dev/pci/if_re_pci.c | 7 +++---- sys/dev/pci/if_rtk_pci.c | 8 +++----- sys/dev/pci/if_stge.c | 6 +++--- sys/dev/pci/if_vge.c | 7 +++---- sys/dev/pci/if_vr.c | 10 +++------- sys/dev/pci/if_vte.c | 9 +++------ sys/dev/pci/if_wi_pci.c | 12 +++--------- sys/dev/pci/if_wm.c | 7 +++---- sys/dev/pci/if_wpi.c | 11 ++++------- sys/dev/pci/igsfb_pci.c | 8 +++----- sys/dev/pci/iha_pci.c | 9 +++------ sys/dev/pci/jmide.c | 9 +++------ sys/dev/pci/joy_pci.c | 8 +++----- sys/dev/pci/machfb.c | 10 +++------- sys/dev/pci/mpt_pci.c | 10 +++------- sys/dev/pci/mvsata_pci.c | 9 +++------ sys/dev/pci/nca_pci.c | 10 +++------- sys/dev/pci/nfsmb.c | 10 +++------- sys/dev/pci/ohci_pci.c | 10 +++------- sys/dev/pci/pccbb.c | 14 ++++---------- sys/dev/pci/pciide_common.c | 29 ++++++++++++++--------------- sys/dev/pci/pcscp.c | 8 +++----- sys/dev/pci/piixpm.c | 11 +++-------- sys/dev/pci/pm2fb.c | 8 +++----- sys/dev/pci/r128fb.c | 8 +++----- sys/dev/pci/radeonfb.c | 10 +++------- sys/dev/pci/radeonfbvar.h | 4 +--- sys/dev/pci/sdhc_pci.c | 10 +++------- sys/dev/pci/siisata_pci.c | 9 +++------ sys/dev/pci/sisfb.c | 6 ++---- sys/dev/pci/twa.c | 7 +++---- sys/dev/pci/ubsec.c | 8 +++----- sys/dev/pci/uhci_pci.c | 11 +++-------- sys/dev/pci/vga_pci.c | 10 +++------- sys/dev/pci/voodoofb.c | 8 +++----- sys/dev/pci/voyager.c | 8 +++----- sys/dev/pci/wcfb.c | 9 +++------ sys/dev/pci/yds.c | 9 ++++----- 73 files changed, 239 insertions(+), 469 deletions(-) diff --git a/sys/arch/x86/pci/pchb.c b/sys/arch/x86/pci/pchb.c index 12f33b50a371..fd56a0caa3e3 100644 --- a/sys/arch/x86/pci/pchb.c +++ b/sys/arch/x86/pci/pchb.c @@ -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 -__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 #include @@ -155,7 +155,6 @@ pchbattach(device_t parent, device_t self, void *aux) { 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 @@ pchbattach(device_t parent, device_t self, void *aux) pcitag_t tag; int doattach, attachflags, has_agp; - aprint_naive("\n"); - doattach = 0; has_agp = 0; attachflags = pa->pa_flags; @@ -177,9 +174,7 @@ pchbattach(device_t parent, device_t self, void *aux) * 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)) { /* diff --git a/sys/arch/x86/pci/pcib.c b/sys/arch/x86/pci/pcib.c index aeff79d78704..96490830fdf7 100644 --- a/sys/arch/x86/pci/pcib.c +++ b/sys/arch/x86/pci/pcib.c @@ -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 -__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 #include @@ -185,17 +185,12 @@ pcibattach(device_t parent, device_t self, void *aux) { 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; diff --git a/sys/dev/pci/ahcisata_pci.c b/sys/dev/pci/ahcisata_pci.c index 11057713137b..1e3138d1a80a 100644 --- a/sys/dev/pci/ahcisata_pci.c +++ b/sys/dev/pci/ahcisata_pci.c @@ -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 -__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 #include @@ -171,7 +171,6 @@ ahci_pci_attach(device_t parent, device_t self, void *aux) 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 @@ ahci_pci_attach(device_t parent, device_t self, void *aux) 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"); diff --git a/sys/dev/pci/amdpm.c b/sys/dev/pci/amdpm.c index 0f923ddfe732..41e14e2ae6e3 100644 --- a/sys/dev/pci/amdpm.c +++ b/sys/dev/pci/amdpm.c @@ -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 -__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 @@ amdpm_attach(device_t parent, device_t self, void *aux) { 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; diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c index 8b3354aa5c19..b8ad854e65a3 100644 --- a/sys/dev/pci/auixp.c +++ b/sys/dev/pci/auixp.c @@ -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 @@ -50,7 +50,7 @@ */ #include -__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 #include @@ -1100,8 +1100,7 @@ auixp_attach(device_t parent, device_t self, void *aux) 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 @@ auixp_attach(device_t parent, device_t self, void *aux) #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++) diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c index e9d7d4707027..5b73af4b8cec 100644 --- a/sys/dev/pci/autri.c +++ b/sys/dev/pci/autri.c @@ -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 -__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 @@ autri_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/btvmei.c b/sys/dev/pci/btvmei.c index 311f96613b4a..ef0e1fc6bfab 100644 --- a/sys/dev/pci/btvmei.c +++ b/sys/dev/pci/btvmei.c @@ -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 -__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 #include @@ -90,19 +90,14 @@ b3_617_attach(device_t parent, device_t self, void *aux) 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. diff --git a/sys/dev/pci/chipsfb.c b/sys/dev/pci/chipsfb.c index 3c621b3ccee2..f35fdd94a4e7 100644 --- a/sys/dev/pci/chipsfb.c +++ b/sys/dev/pci/chipsfb.c @@ -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 -__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 #include @@ -89,7 +89,6 @@ chipsfb_pci_attach(device_t parent, device_t self, void *aux) 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 @@ chipsfb_pci_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/cmpci.c b/sys/dev/pci/cmpci.c index 7e12cc277de7..bb6022e32508 100644 --- a/sys/dev/pci/cmpci.c +++ b/sys/dev/pci/cmpci.c @@ -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 -__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 @@ cmpci_attach(device_t parent, device_t self, void *aux) 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*/ diff --git a/sys/dev/pci/coram.c b/sys/dev/pci/coram.c index 984d316224ea..a7b4638ad00f 100644 --- a/sys/dev/pci/coram.c +++ b/sys/dev/pci/coram.c @@ -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 -__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 #include @@ -163,7 +163,6 @@ coram_attach(device_t parent, device_t self, void *v) 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 @@ coram_attach(device_t parent, device_t self, void *v) 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)); diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c index f853cffb52bb..7620316eb437 100644 --- a/sys/dev/pci/cs4280.c +++ b/sys/dev/pci/cs4280.c @@ -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 -__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 @@ cs4280_attach(device_t parent, device_t self, void *aux) 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) { diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c index 1bac62c43d54..d48f5dcfa5ef 100644 --- a/sys/dev/pci/cs4281.c +++ b/sys/dev/pci/cs4281.c @@ -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 -__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 #include @@ -189,17 +189,13 @@ cs4281_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/cxdtv.c b/sys/dev/pci/cxdtv.c index 630fd72fec20..25e99584b845 100644 --- a/sys/dev/pci/cxdtv.c +++ b/sys/dev/pci/cxdtv.c @@ -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 -__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 #include @@ -186,7 +186,6 @@ cxdtv_attach(device_t parent, device_t self, void *aux) 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 @@ cxdtv_attach(device_t parent, device_t self, void *aux) 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 @@ cxdtv_attach(device_t parent, device_t self, void *aux) 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)) { diff --git a/sys/dev/pci/ehci_pci.c b/sys/dev/pci/ehci_pci.c index 30164a847e3e..05d1a21c3333 100644 --- a/sys/dev/pci/ehci_pci.c +++ b/sys/dev/pci/ehci_pci.c @@ -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 -__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 #include @@ -120,7 +120,6 @@ ehci_pci_attach(device_t parent, device_t self, void *aux) 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 @@ ehci_pci_attach(device_t parent, device_t self, void *aux) 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), diff --git a/sys/dev/pci/emuxki.c b/sys/dev/pci/emuxki.c index 282b6d84db4f..96926ebc59bd 100644 --- a/sys/dev/pci/emuxki.c +++ b/sys/dev/pci/emuxki.c @@ -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 -__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 #include @@ -404,14 +404,12 @@ emuxki_attach(device_t parent, device_t self, void *aux) { 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 @@ emuxki_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c index 79bbdd56e205..ffc5e8240b45 100644 --- a/sys/dev/pci/esa.c +++ b/sys/dev/pci/esa.c @@ -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 @@ -39,7 +39,7 @@ */ #include -__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 #include @@ -1008,18 +1008,16 @@ esa_attach(device_t parent, device_t self, void *aux) 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 && diff --git a/sys/dev/pci/esm.c b/sys/dev/pci/esm.c index 221590f15743..40aa19fe1838 100644 --- a/sys/dev/pci/esm.c +++ b/sys/dev/pci/esm.c @@ -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 -__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 #include @@ -1588,7 +1588,6 @@ esm_match(device_t dev, cfdata_t match, void *aux) 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 @@ esm_attach(device_t parent, device_t self, void *aux) 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 @@ esm_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/fwohci_pci.c b/sys/dev/pci/fwohci_pci.c index 2db9810ef16d..e703604d57b2 100644 --- a/sys/dev/pci/fwohci_pci.c +++ b/sys/dev/pci/fwohci_pci.c @@ -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 -__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 #include @@ -96,16 +96,11 @@ fwohci_pci_attach(device_t parent, device_t self, void *aux) { 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; diff --git a/sys/dev/pci/genfb_pci.c b/sys/dev/pci/genfb_pci.c index d5e7d3c2c485..ae5a6441b8aa 100644 --- a/sys/dev/pci/genfb_pci.c +++ b/sys/dev/pci/genfb_pci.c @@ -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 -__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 #include @@ -101,11 +101,8 @@ pci_genfb_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/gtp.c b/sys/dev/pci/gtp.c index 6696c32a75a6..f733b109e6aa 100644 --- a/sys/dev/pci/gtp.c +++ b/sys/dev/pci/gtp.c @@ -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 -__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 #include @@ -147,13 +147,8 @@ gtp_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/hifn7751.c b/sys/dev/pci/hifn7751.c index dadbf71da85b..0a2a14653263 100644 --- a/sys/dev/pci/hifn7751.c +++ b/sys/dev/pci/hifn7751.c @@ -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 -__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 #include @@ -254,9 +254,7 @@ hifn_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/ichsmb.c b/sys/dev/pci/ichsmb.c index f464118b6bbb..256c57d21598 100644 --- a/sys/dev/pci/ichsmb.c +++ b/sys/dev/pci/ichsmb.c @@ -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 -__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 #include @@ -124,14 +124,10 @@ ichsmb_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/if_an_pci.c b/sys/dev/pci/if_an_pci.c index e593c7066b66..77c3a542d160 100644 --- a/sys/dev/pci/if_an_pci.c +++ b/sys/dev/pci/if_an_pci.c @@ -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 -__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 #include @@ -118,7 +118,6 @@ an_pci_attach(device_t parent, device_t self, void *aux) 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 @@ an_pci_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/if_cas.c b/sys/dev/pci/if_cas.c index 0e9b705c41c5..c939852ef40f 100644 --- a/sys/dev/pci/if_cas.c +++ b/sys/dev/pci/if_cas.c @@ -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 -__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 @@ cas_attach(device_t parent, device_t self, void *aux) { 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 diff --git a/sys/dev/pci/if_dge.c b/sys/dev/pci/if_dge.c index b269af890c2d..05e9f8d73228 100644 --- a/sys/dev/pci/if_dge.c +++ b/sys/dev/pci/if_dge.c @@ -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 -__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 @@ dge_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/if_epic_pci.c b/sys/dev/pci/if_epic_pci.c index 55825ca890db..90aaff5c3a1b 100644 --- a/sys/dev/pci/if_epic_pci.c +++ b/sys/dev/pci/if_epic_pci.c @@ -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 -__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 #include @@ -167,16 +167,13 @@ epic_pci_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/if_et.c b/sys/dev/pci/if_et.c index 7a234d91015b..0ced050046e5 100644 --- a/sys/dev/pci/if_et.c +++ b/sys/dev/pci/if_et.c @@ -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 -__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 @@ et_attach(device_t parent, device_t self, void *aux) 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 diff --git a/sys/dev/pci/if_fxp_pci.c b/sys/dev/pci/if_fxp_pci.c index e7e9761058c8..9d3c3b86e954 100644 --- a/sys/dev/pci/if_fxp_pci.c +++ b/sys/dev/pci/if_fxp_pci.c @@ -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 -__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 @@ fxp_pci_attach(device_t parent, device_t self, void *aux) sc->sc_dev = self; - aprint_naive(": Ethernet controller\n"); - /* * Map control/status registers. */ @@ -411,8 +409,6 @@ fxp_pci_attach(device_t parent, device_t self, void *aux) 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 @@ fxp_pci_attach(device_t parent, device_t self, void *aux) 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 @@ fxp_pci_attach(device_t parent, device_t self, void *aux) /* 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 @@ fxp_pci_attach(device_t parent, device_t self, void *aux) 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) | diff --git a/sys/dev/pci/if_gem_pci.c b/sys/dev/pci/if_gem_pci.c index 991ca01f594a..6e73ad37e0f5 100644 --- a/sys/dev/pci/if_gem_pci.c +++ b/sys/dev/pci/if_gem_pci.c @@ -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 -__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 #include @@ -148,7 +148,6 @@ gem_pci_attach(device_t parent, device_t self, void *aux) 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 @@ gem_pci_attach(device_t parent, device_t self, void *aux) #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, diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index a58974c3e374..56b8312bfe45 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -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 -__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 @@ ipw_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index b5b74307f105..e7274809e809 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -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 -__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 @@ iwi_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/if_iwn.c b/sys/dev/pci/if_iwn.c index c91eac35ff67..7af735cf09d0 100644 --- a/sys/dev/pci/if_iwn.c +++ b/sys/dev/pci/if_iwn.c @@ -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 -__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 @@ iwn_attach(device_t parent __unused, device_t self, void *aux) 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 @@ iwn_attach(device_t parent __unused, device_t self, void *aux) 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 diff --git a/sys/dev/pci/if_mtd_pci.c b/sys/dev/pci/if_mtd_pci.c index c23d5a85ea2e..f94dce8dee3a 100644 --- a/sys/dev/pci/if_mtd_pci.c +++ b/sys/dev/pci/if_mtd_pci.c @@ -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 -__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 #include @@ -97,10 +97,8 @@ mtd_pci_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/if_nfe.c b/sys/dev/pci/if_nfe.c index 14e3252e66ba..6403da327bb0 100644 --- a/sys/dev/pci/if_nfe.c +++ b/sys/dev/pci/if_nfe.c @@ -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 -__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 @@ nfe_attach(device_t parent, device_t self, void *aux) 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) { diff --git a/sys/dev/pci/if_ral_pci.c b/sys/dev/pci/if_ral_pci.c index feb42466b57e..1f0ae952646d 100644 --- a/sys/dev/pci/if_ral_pci.c +++ b/sys/dev/pci/if_ral_pci.c @@ -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 -__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 @@ -124,15 +124,12 @@ ral_pci_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c index 83353b40ed8e..136afd6c2219 100644 --- a/sys/dev/pci/if_re_pci.c +++ b/sys/dev/pci/if_re_pci.c @@ -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 -__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 @@ -226,8 +226,7 @@ re_pci_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/if_rtk_pci.c b/sys/dev/pci/if_rtk_pci.c index 8e96f08905ee..a19c79a3d53c 100644 --- a/sys/dev/pci/if_rtk_pci.c +++ b/sys/dev/pci/if_rtk_pci.c @@ -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 -__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 #include @@ -169,9 +169,7 @@ rtk_pci_attach(device_t parent, device_t self, void *aux) 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. diff --git a/sys/dev/pci/if_stge.c b/sys/dev/pci/if_stge.c index 44f3f5f37a6c..f5bc3759e377 100644 --- a/sys/dev/pci/if_stge.c +++ b/sys/dev/pci/if_stge.c @@ -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 -__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 @@ -397,7 +397,7 @@ stge_attach(device_t parent, device_t self, void *aux) 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. diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index 67819f07c5c0..b2a6c1085eff 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -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 -__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 @@ vge_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 95bb018d4f51..0e13a61512b2 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -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 -__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 @@ vr_attach(device_t parent, device_t self, void *aux) 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 @@ vr_attach(device_t parent, device_t self, void *aux) 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. diff --git a/sys/dev/pci/if_vte.c b/sys/dev/pci/if_vte.c index 17dcb67559ad..e42268e0e689 100644 --- a/sys/dev/pci/if_vte.c +++ b/sys/dev/pci/if_vte.c @@ -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 -__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 #include @@ -175,12 +175,10 @@ vte_attach(device_t parent, device_t self, void *aux) 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 @@ vte_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/if_wi_pci.c b/sys/dev/pci/if_wi_pci.c index 6ce553861b42..4b386b74e607 100644 --- a/sys/dev/pci/if_wi_pci.c +++ b/sys/dev/pci/if_wi_pci.c @@ -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 -__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 #include @@ -290,13 +290,7 @@ wi_pci_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/if_wm.c b/sys/dev/pci/if_wm.c index ca9b3285c1c7..ad7223bb1012 100644 --- a/sys/dev/pci/if_wm.c +++ b/sys/dev/pci/if_wm.c @@ -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 -__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 @@ wm_attach(device_t parent, device_t self, void *aux) 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) { diff --git a/sys/dev/pci/if_wpi.c b/sys/dev/pci/if_wpi.c index c8d984b88120..e399dce7e72c 100644 --- a/sys/dev/pci/if_wpi.c +++ b/sys/dev/pci/if_wpi.c @@ -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 -__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 @@ wpi_attach(device_t parent __unused, device_t self, void *aux) 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 @@ wpi_attach(device_t parent __unused, device_t self, void *aux) 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); diff --git a/sys/dev/pci/igsfb_pci.c b/sys/dev/pci/igsfb_pci.c index 60d0cc1a9eb0..5e4dae18bd17 100644 --- a/sys/dev/pci/igsfb_pci.c +++ b/sys/dev/pci/igsfb_pci.c @@ -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 -__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 #include @@ -156,12 +156,10 @@ igsfb_pci_attach(device_t parent, device_t self, void *aux) 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 */ diff --git a/sys/dev/pci/iha_pci.c b/sys/dev/pci/iha_pci.c index a7fe3230c12e..9baa666a8c7f 100644 --- a/sys/dev/pci/iha_pci.c +++ b/sys/dev/pci/iha_pci.c @@ -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 -__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 #include @@ -111,13 +111,10 @@ iha_pci_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/jmide.c b/sys/dev/pci/jmide.c index 0e7103ca219c..7245470a2971 100644 --- a/sys/dev/pci/jmide.c +++ b/sys/dev/pci/jmide.c @@ -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 -__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 #include @@ -146,7 +146,6 @@ jmide_attach(device_t parent, device_t self, void *aux) 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 @@ jmide_attach(device_t parent, device_t self, void *aux) 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) diff --git a/sys/dev/pci/joy_pci.c b/sys/dev/pci/joy_pci.c index c741ff0bcfb2..0b8c390e8b08 100644 --- a/sys/dev/pci/joy_pci.c +++ b/sys/dev/pci/joy_pci.c @@ -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 -__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 #include @@ -91,12 +91,10 @@ joy_pci_attach(device_t parent, device_t self, void *aux) 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)) diff --git a/sys/dev/pci/machfb.c b/sys/dev/pci/machfb.c index de020eeb9f81..1e6a979456f4 100644 --- a/sys/dev/pci/machfb.c +++ b/sys/dev/pci/machfb.c @@ -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 __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 #include @@ -505,7 +505,6 @@ mach64_attach(device_t parent, device_t self, void *aux) #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 @@ mach64_attach(device_t parent, device_t self, void *aux) 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 diff --git a/sys/dev/pci/mpt_pci.c b/sys/dev/pci/mpt_pci.c index b02b154e796b..5c5a72ad85ad 100644 --- a/sys/dev/pci/mpt_pci.c +++ b/sys/dev/pci/mpt_pci.c @@ -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 -__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 /* pulls in all headers */ @@ -134,12 +134,8 @@ mpt_pci_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/mvsata_pci.c b/sys/dev/pci/mvsata_pci.c index f0f047308fb7..beb51664173a 100644 --- a/sys/dev/pci/mvsata_pci.c +++ b/sys/dev/pci/mvsata_pci.c @@ -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 -__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 #include @@ -155,7 +155,6 @@ mvsata_pci_attach(device_t parent, device_t self, void *aux) 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 @@ mvsata_pci_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/nca_pci.c b/sys/dev/pci/nca_pci.c index 86222fec2568..618ee134ad33 100644 --- a/sys/dev/pci/nca_pci.c +++ b/sys/dev/pci/nca_pci.c @@ -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 -__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 #include @@ -74,14 +74,10 @@ nca_pci_attach(device_t parent, device_t self, void *aux) { 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)) { diff --git a/sys/dev/pci/nfsmb.c b/sys/dev/pci/nfsmb.c index 351af8122ce1..1dedb586895e 100644 --- a/sys/dev/pci/nfsmb.c +++ b/sys/dev/pci/nfsmb.c @@ -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 -__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 #include @@ -141,12 +141,8 @@ nfsmbc_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/ohci_pci.c b/sys/dev/pci/ohci_pci.c index 745c04ebec3d..8a0294a6ba5a 100644 --- a/sys/dev/pci/ohci_pci.c +++ b/sys/dev/pci/ohci_pci.c @@ -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 -__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 @@ ohci_pci_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index 814708e5b86b..93caacba1611 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -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 -__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 @@ pccbbattach(device_t parent, device_t self, void *aux) 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 @@ pccbbattach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/pciide_common.c b/sys/dev/pci/pciide_common.c index a148f12a198f..d073269a00e0 100644 --- a/sys/dev/pci/pciide_common.c +++ b/sys/dev/pci/pciide_common.c @@ -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 -__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 #include @@ -120,28 +120,27 @@ pciide_common_attach(struct pciide_softc *sc, const struct pci_attach_args *pa, #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; diff --git a/sys/dev/pci/pcscp.c b/sys/dev/pci/pcscp.c index 8814a8c28d48..d210142172b6 100644 --- a/sys/dev/pci/pcscp.c +++ b/sys/dev/pci/pcscp.c @@ -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 -__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 #include @@ -161,11 +161,9 @@ pcscp_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/piixpm.c b/sys/dev/pci/piixpm.c index 63e4cf1cb6f8..f3faaa295e96 100644 --- a/sys/dev/pci/piixpm.c +++ b/sys/dev/pci/piixpm.c @@ -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 -__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 #include @@ -158,7 +158,6 @@ piixpm_attach(device_t parent, device_t self, void *aux) 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 @@ piixpm_attach(device_t parent, device_t self, void *aux) 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"); diff --git a/sys/dev/pci/pm2fb.c b/sys/dev/pci/pm2fb.c index f5840f55a106..4b8a3a895fd7 100644 --- a/sys/dev/pci/pm2fb.c +++ b/sys/dev/pci/pm2fb.c @@ -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 -__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 #include @@ -224,7 +224,6 @@ pm2fb_attach(device_t parent, device_t self, void *aux) 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 @@ pm2fb_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/r128fb.c b/sys/dev/pci/r128fb.c index 99577aceea29..ce024ae916a7 100644 --- a/sys/dev/pci/r128fb.c +++ b/sys/dev/pci/r128fb.c @@ -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 -__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 #include @@ -198,7 +198,6 @@ r128fb_attach(device_t parent, device_t self, void *aux) 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 @@ r128fb_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/radeonfb.c b/sys/dev/pci/radeonfb.c index 783eda15893c..123d018bb8b4 100644 --- a/sys/dev/pci/radeonfb.c +++ b/sys/dev/pci/radeonfb.c @@ -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 -__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 #include @@ -450,11 +450,7 @@ radeonfb_attach(device_t parent, device_t dev, void *aux) 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)))); diff --git a/sys/dev/pci/radeonfbvar.h b/sys/dev/pci/radeonfbvar.h index aa815d6418e5..ba2a3b98890a 100644 --- a/sys/dev/pci/radeonfbvar.h +++ b/sys/dev/pci/radeonfbvar.h @@ -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 @@ struct radeonfb_softc { 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; diff --git a/sys/dev/pci/sdhc_pci.c b/sys/dev/pci/sdhc_pci.c index 46f13e38e5ff..56594d77f3d5 100644 --- a/sys/dev/pci/sdhc_pci.c +++ b/sys/dev/pci/sdhc_pci.c @@ -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 -__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 #include @@ -176,7 +176,6 @@ sdhc_pci_attach(device_t parent, device_t self, void *aux) 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 @@ sdhc_pci_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/siisata_pci.c b/sys/dev/pci/siisata_pci.c index 834aec56f66a..413f5de71f40 100644 --- a/sys/dev/pci/siisata_pci.c +++ b/sys/dev/pci/siisata_pci.c @@ -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 -__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 #include @@ -138,7 +138,6 @@ siisata_pci_attach(device_t parent, device_t self, void *aux) 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 @@ siisata_pci_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/sisfb.c b/sys/dev/pci/sisfb.c index de2c5e474027..0815ecda1fb8 100644 --- a/sys/dev/pci/sisfb.c +++ b/sys/dev/pci/sisfb.c @@ -24,7 +24,7 @@ */ #include -__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 #include @@ -222,7 +222,6 @@ sisfb_attach(device_t parent, device_t self, void *aux) 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 @@ sisfb_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/twa.c b/sys/dev/pci/twa.c index 2cae0ccb86bf..2c67ef802acc 100644 --- a/sys/dev/pci/twa.c +++ b/sys/dev/pci/twa.c @@ -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 -__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 #include @@ -1505,8 +1505,7 @@ twa_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/ubsec.c b/sys/dev/pci/ubsec.c index 28755e95d1dd..e8bd8ecd207f 100644 --- a/sys/dev/pci/ubsec.c +++ b/sys/dev/pci/ubsec.c @@ -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 -__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 @@ ubsec_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/uhci_pci.c b/sys/dev/pci/uhci_pci.c index 49a14002d97f..6c3b04c30a14 100644 --- a/sys/dev/pci/uhci_pci.c +++ b/sys/dev/pci/uhci_pci.c @@ -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 -__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 @@ uhci_pci_attach(device_t parent, device_t self, void *aux) 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, diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index 4f16e8a3ebf3..81f1458ffcc6 100644 --- a/sys/dev/pci/vga_pci.c +++ b/sys/dev/pci/vga_pci.c @@ -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 -__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 #include @@ -186,7 +186,6 @@ vga_pci_attach(device_t parent, device_t self, void *aux) 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 @@ vga_pci_attach(device_t parent, device_t self, void *aux) 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 diff --git a/sys/dev/pci/voodoofb.c b/sys/dev/pci/voodoofb.c index ddae46d735f0..d429df9a90d2 100644 --- a/sys/dev/pci/voodoofb.c +++ b/sys/dev/pci/voodoofb.c @@ -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 -__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 #include @@ -347,7 +347,6 @@ voodoofb_attach(device_t parent, device_t self, void *aux) { 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 @@ voodoofb_attach(device_t parent, device_t self, void *aux) 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; diff --git a/sys/dev/pci/voyager.c b/sys/dev/pci/voyager.c index 54f32ab3340a..9c30e9b58ab3 100644 --- a/sys/dev/pci/voyager.c +++ b/sys/dev/pci/voyager.c @@ -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 -__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 #include @@ -149,7 +149,6 @@ voyager_attach(device_t parent, device_t self, void *aux) 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 @@ voyager_attach(device_t parent, device_t self, void *aux) 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)) { diff --git a/sys/dev/pci/wcfb.c b/sys/dev/pci/wcfb.c index f64b692f5be9..d1780ba0f5b1 100644 --- a/sys/dev/pci/wcfb.c +++ b/sys/dev/pci/wcfb.c @@ -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 -__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 #include @@ -156,14 +156,11 @@ wcfb_attach(device_t parent, device_t self, void *aux) 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); diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c index f34c48610692..21aefdcec0bc 100644 --- a/sys/dev/pci/yds.c +++ b/sys/dev/pci/yds.c @@ -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 -__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 @@ yds_attach(device_t parent, device_t self, void *aux) 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 @@ yds_attach(device_t parent, device_t self, void *aux) 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,