aprintify

This commit is contained in:
jmcneill 2007-12-01 04:50:50 +00:00
parent 597a6bb9ae
commit 4fbe23fdd0
12 changed files with 135 additions and 116 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mpacpi.c,v 1.53 2007/10/24 10:12:34 joerg Exp $ */ /* $NetBSD: mpacpi.c,v 1.54 2007/12/01 05:12:29 jmcneill Exp $ */
/* /*
* Copyright (c) 2003 Wasabi Systems, Inc. * Copyright (c) 2003 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.53 2007/10/24 10:12:34 joerg Exp $"); __KERNEL_RCSID(0, "$NetBSD: mpacpi.c,v 1.54 2007/12/01 05:12:29 jmcneill Exp $");
#include "acpi.h" #include "acpi.h"
#include "opt_acpi.h" #include "opt_acpi.h"
@ -149,8 +149,8 @@ mpacpi_cpuprint(void *aux, const char *pnp)
struct cpu_attach_args *caa = aux; struct cpu_attach_args *caa = aux;
if (pnp) if (pnp)
printf("cpu at %s", pnp); aprint_normal("cpu at %s", pnp);
printf(" apid %d", caa->cpu_number); aprint_normal(" apid %d", caa->cpu_number);
return (UNCONF); return (UNCONF);
} }
@ -160,8 +160,8 @@ mpacpi_ioapicprint(void *aux, const char *pnp)
struct apic_attach_args *aaa = aux; struct apic_attach_args *aaa = aux;
if (pnp) if (pnp)
printf("ioapic at %s", pnp); aprint_normal("ioapic at %s", pnp);
printf(" apid %d", aaa->apic_id); aprint_normal(" apid %d", aaa->apic_id);
return (UNCONF); return (UNCONF);
} }
@ -633,7 +633,7 @@ mpacpi_pcibus_cb(ACPI_HANDLE handle, UINT32 level, void *p,
if (mpacpi_npciroots != 0) if (mpacpi_npciroots != 0)
panic("mpacpi: ASL is broken"); panic("mpacpi: ASL is broken");
printf("mpacpi: could not get bus number, " aprint_normal("mpacpi: could not get bus number, "
"assuming bus 0\n"); "assuming bus 0\n");
mpr->mpr_bus = 0; mpr->mpr_bus = 0;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_resource.c,v 1.22 2007/09/28 15:16:16 njoly Exp $ */ /* $NetBSD: acpi_resource.c,v 1.23 2007/12/01 04:51:27 jmcneill Exp $ */
/* /*
* Copyright 2001 Wasabi Systems, Inc. * Copyright 2001 Wasabi Systems, Inc.
@ -67,7 +67,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.22 2007/09/28 15:16:16 njoly Exp $"); __KERNEL_RCSID(0, "$NetBSD: acpi_resource.c,v 1.23 2007/12/01 04:51:27 jmcneill Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -352,8 +352,8 @@ acpi_resource_parse(struct device *dev, ACPI_HANDLE handle, const char *path,
rv = AcpiWalkResources(handle, path, acpi_resource_parse_callback, rv = AcpiWalkResources(handle, path, acpi_resource_parse_callback,
&cbarg); &cbarg);
if (ACPI_FAILURE(rv)) { if (ACPI_FAILURE(rv)) {
printf("%s: ACPI: unable to get %s resources: %s\n", aprint_error_dev(dev, "ACPI: unable to get %s resources: %s\n",
dev->dv_xname, path, AcpiFormatException(rv)); path, AcpiFormatException(rv));
return_ACPI_STATUS(rv); return_ACPI_STATUS(rv);
} }
@ -381,17 +381,17 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res)
SIMPLEQ_EMPTY(&res->ar_drq)) SIMPLEQ_EMPTY(&res->ar_drq))
return; return;
printf("%s:", dev->dv_xname); aprint_normal("%s:", dev->dv_xname);
if (SIMPLEQ_EMPTY(&res->ar_io) == 0) { if (SIMPLEQ_EMPTY(&res->ar_io) == 0) {
struct acpi_io *ar; struct acpi_io *ar;
sep = ""; sep = "";
printf(" io "); aprint_normal(" io ");
SIMPLEQ_FOREACH(ar, &res->ar_io, ar_list) { SIMPLEQ_FOREACH(ar, &res->ar_io, ar_list) {
printf("%s0x%x", sep, ar->ar_base); aprint_normal("%s0x%x", sep, ar->ar_base);
if (ar->ar_length > 1) if (ar->ar_length > 1)
printf("-0x%x", ar->ar_base + aprint_normal("-0x%x", ar->ar_base +
ar->ar_length - 1); ar->ar_length - 1);
sep = ","; sep = ",";
} }
@ -403,11 +403,11 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res)
struct acpi_mem *ar; struct acpi_mem *ar;
sep = ""; sep = "";
printf(" mem "); aprint_normal(" mem ");
SIMPLEQ_FOREACH(ar, &res->ar_mem, ar_list) { SIMPLEQ_FOREACH(ar, &res->ar_mem, ar_list) {
printf("%s0x%x", sep, ar->ar_base); aprint_normal("%s0x%x", sep, ar->ar_base);
if (ar->ar_length > 1) if (ar->ar_length > 1)
printf("-0x%x", ar->ar_base + aprint_normal("-0x%x", ar->ar_base +
ar->ar_length - 1); ar->ar_length - 1);
sep = ","; sep = ",";
} }
@ -419,9 +419,9 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res)
struct acpi_irq *ar; struct acpi_irq *ar;
sep = ""; sep = "";
printf(" irq "); aprint_normal(" irq ");
SIMPLEQ_FOREACH(ar, &res->ar_irq, ar_list) { SIMPLEQ_FOREACH(ar, &res->ar_irq, ar_list) {
printf("%s%d", sep, ar->ar_irq); aprint_normal("%s%d", sep, ar->ar_irq);
sep = ","; sep = ",";
} }
} }
@ -430,14 +430,14 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res)
struct acpi_drq *ar; struct acpi_drq *ar;
sep = ""; sep = "";
printf(" drq "); aprint_normal(" drq ");
SIMPLEQ_FOREACH(ar, &res->ar_drq, ar_list) { SIMPLEQ_FOREACH(ar, &res->ar_drq, ar_list) {
printf("%s%d", sep, ar->ar_drq); aprint_normal("%s%d", sep, ar->ar_drq);
sep = ","; sep = ",";
} }
} }
printf("\n"); aprint_normal("\n");
} }
/* /*
@ -673,8 +673,8 @@ acpi_res_parse_ioport(struct device *dev, void *context, uint32_t base,
ar = AcpiOsAllocate(sizeof(*ar)); ar = AcpiOsAllocate(sizeof(*ar));
if (ar == NULL) { if (ar == NULL) {
printf("%s: ACPI: unable to allocate I/O resource %d\n", aprint_error_dev(dev, "ACPI: unable to allocate I/O resource %d\n",
dev->dv_xname, res->ar_nio); res->ar_nio);
res->ar_nio++; res->ar_nio++;
return; return;
} }
@ -695,8 +695,8 @@ acpi_res_parse_iorange(struct device *dev, void *context, uint32_t low,
ar = AcpiOsAllocate(sizeof(*ar)); ar = AcpiOsAllocate(sizeof(*ar));
if (ar == NULL) { if (ar == NULL) {
printf("%s: ACPI: unable to allocate I/O range resource %d\n", aprint_error_dev(dev, "ACPI: unable to allocate I/O range resource %d\n",
dev->dv_xname, res->ar_niorange); res->ar_niorange);
res->ar_niorange++; res->ar_niorange++;
return; return;
} }
@ -719,8 +719,8 @@ acpi_res_parse_memory(struct device *dev, void *context, uint32_t base,
ar = AcpiOsAllocate(sizeof(*ar)); ar = AcpiOsAllocate(sizeof(*ar));
if (ar == NULL) { if (ar == NULL) {
printf("%s: ACPI: unable to allocate Memory resource %d\n", aprint_error_dev(dev, "ACPI: unable to allocate Memory resource %d\n",
dev->dv_xname, res->ar_nmem); res->ar_nmem);
res->ar_nmem++; res->ar_nmem++;
return; return;
} }
@ -741,8 +741,8 @@ acpi_res_parse_memrange(struct device *dev, void *context, uint32_t low,
ar = AcpiOsAllocate(sizeof(*ar)); ar = AcpiOsAllocate(sizeof(*ar));
if (ar == NULL) { if (ar == NULL) {
printf("%s: ACPI: unable to allocate Memory range resource " aprint_error_dev(dev, "ACPI: unable to allocate Memory range resource %d\n",
"%d\n", dev->dv_xname, res->ar_nmemrange); res->ar_nmemrange);
res->ar_nmemrange++; res->ar_nmemrange++;
return; return;
} }
@ -764,8 +764,8 @@ acpi_res_parse_irq(struct device *dev, void *context, uint32_t irq, uint32_t typ
ar = AcpiOsAllocate(sizeof(*ar)); ar = AcpiOsAllocate(sizeof(*ar));
if (ar == NULL) { if (ar == NULL) {
printf("%s: ACPI: unable to allocate IRQ resource %d\n", aprint_error_dev(dev, "ACPI: unable to allocate IRQ resource %d\n",
dev->dv_xname, res->ar_nirq); res->ar_nirq);
res->ar_nirq++; res->ar_nirq++;
return; return;
} }
@ -785,8 +785,8 @@ acpi_res_parse_drq(struct device *dev, void *context, uint32_t drq)
ar = AcpiOsAllocate(sizeof(*ar)); ar = AcpiOsAllocate(sizeof(*ar));
if (ar == NULL) { if (ar == NULL) {
printf("%s: ACPI: unable to allocate DRQ resource %d\n", aprint_error_dev(dev, "ACPI: unable to allocate DRQ resource %d\n",
dev->dv_xname, res->ar_ndrq); res->ar_ndrq);
res->ar_ndrq++; res->ar_ndrq++;
return; return;
} }
@ -802,8 +802,7 @@ acpi_res_parse_start_dep(struct device *dev, void *context,
int preference) int preference)
{ {
printf("%s: ACPI: dependant functions not supported\n", aprint_error_dev(dev, "ACPI: dependant functions not supported\n");
dev->dv_xname);
} }
static void static void

View File

@ -1,4 +1,4 @@
/* $NetBSD: acpi_tz.c,v 1.27 2007/11/16 08:00:13 xtraeme Exp $ */ /* $NetBSD: acpi_tz.c,v 1.28 2007/12/01 05:12:09 jmcneill Exp $ */
/* /*
* Copyright (c) 2003 Jared D. McNeill <jmcneill@invisible.ca> * Copyright (c) 2003 Jared D. McNeill <jmcneill@invisible.ca>
@ -30,7 +30,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.27 2007/11/16 08:00:13 xtraeme Exp $"); __KERNEL_RCSID(0, "$NetBSD: acpi_tz.c,v 1.28 2007/12/01 05:12:09 jmcneill Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -225,7 +225,8 @@ acpitz_get_status(void *opaque)
} }
if (acpitz_get_integer(sc, "_TMP", &tmp)) { if (acpitz_get_integer(sc, "_TMP", &tmp)) {
printf("%s: failed to evaluate _TMP\n", sc->sc_dev.dv_xname); aprint_error("%s: failed to evaluate _TMP\n",
sc->sc_dev.dv_xname);
return; return;
} }
sc->sc_zone.tmp = tmp; sc->sc_zone.tmp = tmp;
@ -448,7 +449,7 @@ acpitz_get_zone(void *opaque, int verbose)
} }
if (first) if (first)
printf("%s: active cooling level %d: %sC\n", aprint_normal("%s: active cooling level %d: %sC\n",
sc->sc_dev.dv_xname, i, sc->sc_dev.dv_xname, i,
acpitz_celcius_string(sc->sc_zone.ac[i])); acpitz_celcius_string(sc->sc_zone.ac[i]));
@ -458,7 +459,7 @@ acpitz_get_zone(void *opaque, int verbose)
if (valid_levels == 0) { if (valid_levels == 0) {
sc->sc_flags |= ATZ_F_PASSIVEONLY; sc->sc_flags |= ATZ_F_PASSIVEONLY;
if (first) if (first)
printf("%s: passive cooling mode only\n", aprint_normal("%s: passive cooling mode only\n",
sc->sc_dev.dv_xname); sc->sc_dev.dv_xname);
} }
@ -478,17 +479,17 @@ acpitz_get_zone(void *opaque, int verbose)
acpitz_sane_temp(&sc->sc_zone.psv); acpitz_sane_temp(&sc->sc_zone.psv);
if (verbose) { if (verbose) {
printf("%s:", sc->sc_dev.dv_xname); aprint_normal("%s:", sc->sc_dev.dv_xname);
if (sc->sc_zone.crt != ATZ_TMP_INVALID) if (sc->sc_zone.crt != ATZ_TMP_INVALID)
printf(" critical %sC", aprint_normal(" critical %sC",
acpitz_celcius_string(sc->sc_zone.crt)); acpitz_celcius_string(sc->sc_zone.crt));
if (sc->sc_zone.hot != ATZ_TMP_INVALID) if (sc->sc_zone.hot != ATZ_TMP_INVALID)
printf(" hot %sC", aprint_normal(" hot %sC",
acpitz_celcius_string(sc->sc_zone.hot)); acpitz_celcius_string(sc->sc_zone.hot));
if (sc->sc_zone.psv != ATZ_TMP_INVALID) if (sc->sc_zone.psv != ATZ_TMP_INVALID)
printf(" passive %sC", aprint_normal(" passive %sC",
acpitz_celcius_string(sc->sc_zone.tmp)); acpitz_celcius_string(sc->sc_zone.tmp));
printf("\n"); aprint_normal("\n");
} }
for (i = 0; i < ATZ_NLEVELS; i++) for (i = 0; i < ATZ_NLEVELS; i++)

View File

@ -1,4 +1,4 @@
/* $NetBSD: audio.c,v 1.224 2007/10/08 16:18:02 ad Exp $ */ /* $NetBSD: audio.c,v 1.225 2007/12/01 05:11:08 jmcneill Exp $ */
/* /*
* Copyright (c) 1991-1993 Regents of the University of California. * Copyright (c) 1991-1993 Regents of the University of California.
@ -61,7 +61,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.224 2007/10/08 16:18:02 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: audio.c,v 1.225 2007/12/01 05:11:08 jmcneill Exp $");
#include "audio.h" #include "audio.h"
#if NAUDIO > 0 #if NAUDIO > 0
@ -299,17 +299,19 @@ audioattach(struct device *parent, struct device *self, void *aux)
props = hwp->get_props(hdlp); props = hwp->get_props(hdlp);
aprint_naive("\n");
if (props & AUDIO_PROP_FULLDUPLEX) if (props & AUDIO_PROP_FULLDUPLEX)
printf(": full duplex"); aprint_normal(": full duplex");
else else
printf(": half duplex"); aprint_normal(": half duplex");
if (props & AUDIO_PROP_MMAP) if (props & AUDIO_PROP_MMAP)
printf(", mmap"); aprint_normal(", mmap");
if (props & AUDIO_PROP_INDEPENDENT) if (props & AUDIO_PROP_INDEPENDENT)
printf(", independent"); aprint_normal(", independent");
printf("\n"); aprint_normal("\n");
sc->hw_if = hwp; sc->hw_if = hwp;
sc->hw_hdl = hdlp; sc->hw_hdl = hdlp;
@ -320,19 +322,19 @@ audioattach(struct device *parent, struct device *self, void *aux)
error = audio_alloc_ring(sc, &sc->sc_pr, AUMODE_PLAY, AU_RING_SIZE); error = audio_alloc_ring(sc, &sc->sc_pr, AUMODE_PLAY, AU_RING_SIZE);
if (error) { if (error) {
sc->hw_if = NULL; sc->hw_if = NULL;
printf("audio: could not allocate play buffer\n"); aprint_error("audio: could not allocate play buffer\n");
return; return;
} }
error = audio_alloc_ring(sc, &sc->sc_rr, AUMODE_RECORD, AU_RING_SIZE); error = audio_alloc_ring(sc, &sc->sc_rr, AUMODE_RECORD, AU_RING_SIZE);
if (error) { if (error) {
audio_free_ring(sc, &sc->sc_pr); audio_free_ring(sc, &sc->sc_pr);
sc->hw_if = NULL; sc->hw_if = NULL;
printf("audio: could not allocate record buffer\n"); aprint_error("audio: could not allocate record buffer\n");
return; return;
} }
if ((error = audio_set_defaults(sc, 0))) { if ((error = audio_set_defaults(sc, 0))) {
printf("audioattach: audio_set_defaults() failed\n"); aprint_error("audioattach: audio_set_defaults() failed\n");
sc->hw_if = NULL; sc->hw_if = NULL;
return; return;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: cardbus.c,v 1.78 2007/11/16 20:25:47 dyoung Exp $ */ /* $NetBSD: cardbus.c,v 1.79 2007/12/01 05:51:16 jmcneill Exp $ */
/* /*
* Copyright (c) 1997, 1998, 1999 and 2000 * Copyright (c) 1997, 1998, 1999 and 2000
@ -33,7 +33,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.78 2007/11/16 20:25:47 dyoung Exp $"); __KERNEL_RCSID(0, "$NetBSD: cardbus.c,v 1.79 2007/12/01 05:51:16 jmcneill Exp $");
#include "opt_cardbus.h" #include "opt_cardbus.h"
@ -124,11 +124,12 @@ cardbusattach(struct device *parent, struct device *self, void *aux)
sc->sc_cacheline = cba->cba_cacheline; sc->sc_cacheline = cba->cba_cacheline;
sc->sc_max_lattimer = MIN(0xf8, cba->cba_max_lattimer); sc->sc_max_lattimer = MIN(0xf8, cba->cba_max_lattimer);
printf(": bus %d", sc->sc_bus); aprint_normal("\n");
aprint_normal(": bus %d", sc->sc_bus);
if (bootverbose) if (bootverbose)
printf(" cacheline 0x%x, lattimer 0x%x", sc->sc_cacheline, aprint_normal(" cacheline 0x%x, lattimer 0x%x",
sc->sc_max_lattimer); sc->sc_cacheline, sc->sc_max_lattimer);
printf("\n"); aprint_normal("\n");
sc->sc_iot = cba->cba_iot; /* CardBus I/O space tag */ sc->sc_iot = cba->cba_iot; /* CardBus I/O space tag */
sc->sc_memt = cba->cba_memt; /* CardBus MEM space tag */ sc->sc_memt = cba->cba_memt; /* CardBus MEM space tag */

View File

@ -1,4 +1,4 @@
/* $NetBSD: cardslot.c,v 1.36 2007/10/19 11:59:38 ad Exp $ */ /* $NetBSD: cardslot.c,v 1.37 2007/12/01 05:51:16 jmcneill Exp $ */
/* /*
* Copyright (c) 1999 and 2000 * Copyright (c) 1999 and 2000
@ -33,7 +33,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.36 2007/10/19 11:59:38 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: cardslot.c,v 1.37 2007/12/01 05:51:16 jmcneill Exp $");
#include "opt_cardslot.h" #include "opt_cardslot.h"
@ -113,7 +113,8 @@ cardslotattach(struct device *parent, struct device *self,
SIMPLEQ_INIT(&sc->sc_events); SIMPLEQ_INIT(&sc->sc_events);
sc->sc_th_enable = 0; sc->sc_th_enable = 0;
printf(" slot %d flags %x\n", sc->sc_slot, aprint_naive("\n");
aprint_normal(" slot %d flags %x\n", sc->sc_slot,
device_cfdata(&sc->sc_dev)->cf_flags); device_cfdata(&sc->sc_dev)->cf_flags);
DPRINTF(("%s attaching CardBus bus...\n", sc->sc_dev.dv_xname)); DPRINTF(("%s attaching CardBus bus...\n", sc->sc_dev.dv_xname));

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccbb.c,v 1.154 2007/11/24 07:59:21 dyoung Exp $ */ /* $NetBSD: pccbb.c,v 1.155 2007/12/01 05:41:53 jmcneill Exp $ */
/* /*
* Copyright (c) 1998, 1999 and 2000 * Copyright (c) 1998, 1999 and 2000
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.154 2007/11/24 07:59:21 dyoung Exp $"); __KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.155 2007/12/01 05:41:53 jmcneill Exp $");
/* /*
#define CBB_DEBUG #define CBB_DEBUG
@ -429,10 +429,13 @@ pccbbattach(struct device *parent, struct device *self, void *aux)
sc->sc_chipset = cb_chipset(pa->pa_id, &flags); sc->sc_chipset = cb_chipset(pa->pa_id, &flags);
aprint_naive("\n");
pci_devinfo(pa->pa_id, 0, 0, devinfo, sizeof(devinfo)); pci_devinfo(pa->pa_id, 0, 0, devinfo, sizeof(devinfo));
printf(": %s (rev. 0x%02x)", devinfo, PCI_REVISION(pa->pa_class)); aprint_normal(": %s (rev. 0x%02x)", devinfo,
PCI_REVISION(pa->pa_class));
DPRINTF((" (chipflags %x)", flags)); DPRINTF((" (chipflags %x)", flags));
printf("\n"); aprint_normal("\n");
TAILQ_INIT(&sc->sc_memwindow); TAILQ_INIT(&sc->sc_memwindow);
TAILQ_INIT(&sc->sc_iowindow); TAILQ_INIT(&sc->sc_iowindow);
@ -478,7 +481,7 @@ pccbbattach(struct device *parent, struct device *self, void *aux)
/* The address must be valid. */ /* The address must be valid. */
if (pci_mapreg_map(pa, PCI_SOCKBASE, PCI_MAPREG_TYPE_MEM, 0, if (pci_mapreg_map(pa, PCI_SOCKBASE, PCI_MAPREG_TYPE_MEM, 0,
&sc->sc_base_memt, &sc->sc_base_memh, &sockbase, NULL)) { &sc->sc_base_memt, &sc->sc_base_memh, &sockbase, NULL)) {
printf("%s: can't map socket base address 0x%lx\n", aprint_error("%s: can't map socket base address 0x%lx\n",
sc->sc_dev.dv_xname, (unsigned long)sock_base); sc->sc_dev.dv_xname, (unsigned long)sock_base);
/* /*
* I think it's funny: socket base registers must be * I think it's funny: socket base registers must be
@ -487,7 +490,7 @@ pccbbattach(struct device *parent, struct device *self, void *aux)
if (pci_mapreg_map(pa, PCI_SOCKBASE, PCI_MAPREG_TYPE_IO, if (pci_mapreg_map(pa, PCI_SOCKBASE, PCI_MAPREG_TYPE_IO,
0, &sc->sc_base_memt, &sc->sc_base_memh, &sockbase, 0, &sc->sc_base_memt, &sc->sc_base_memh, &sockbase,
NULL)) { NULL)) {
printf("%s: can't map socket base address" aprint_error("%s: can't map socket base address"
" 0x%lx: io mode\n", sc->sc_dev.dv_xname, " 0x%lx: io mode\n", sc->sc_dev.dv_xname,
(unsigned long)sockbase); (unsigned long)sockbase);
/* give up... allocate reg space via rbus. */ /* give up... allocate reg space via rbus. */
@ -629,7 +632,8 @@ pccbb_pci_callback(struct device *self)
/* Map and establish the interrupt. */ /* Map and establish the interrupt. */
if (pci_intr_map(&sc->sc_pa, &ih)) { if (pci_intr_map(&sc->sc_pa, &ih)) {
printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname); aprint_error("%s: couldn't map interrupt\n",
sc->sc_dev.dv_xname);
return; return;
} }
intrstr = pci_intr_string(pc, ih); intrstr = pci_intr_string(pc, ih);
@ -641,15 +645,16 @@ pccbb_pci_callback(struct device *self)
sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, pccbbintr, sc); sc->sc_ih = pci_intr_establish(pc, ih, IPL_BIO, pccbbintr, sc);
if (sc->sc_ih == NULL) { if (sc->sc_ih == NULL) {
printf("%s: couldn't establish interrupt", sc->sc_dev.dv_xname); aprint_error("%s: couldn't establish interrupt",
sc->sc_dev.dv_xname);
if (intrstr != NULL) { if (intrstr != NULL) {
printf(" at %s", intrstr); aprint_normal(" at %s", intrstr);
} }
printf("\n"); aprint_normal("\n");
return; return;
} }
printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr); aprint_normal("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);
powerhook_establish(sc->sc_dev.dv_xname, pccbb_powerhook, sc); powerhook_establish(sc->sc_dev.dv_xname, pccbb_powerhook, sc);
{ {

View File

@ -1,4 +1,4 @@
/* $NetBSD: vga_pci.c,v 1.33 2007/08/26 19:52:06 martin Exp $ */ /* $NetBSD: vga_pci.c,v 1.34 2007/12/01 05:22:27 jmcneill Exp $ */
/* /*
* Copyright (c) 1995, 1996 Carnegie-Mellon University. * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@ -28,7 +28,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.33 2007/08/26 19:52:06 martin Exp $"); __KERNEL_RCSID(0, "$NetBSD: vga_pci.c,v 1.34 2007/12/01 05:22:27 jmcneill Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -174,7 +174,8 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux)
psc->sc_pcitag = pa->pa_tag; psc->sc_pcitag = pa->pa_tag;
pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo)); pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
printf(": %s (rev. 0x%02x)\n", devinfo, aprint_naive("\n");
aprint_normal(": %s (rev. 0x%02x)\n", devinfo,
PCI_REVISION(pa->pa_class)); PCI_REVISION(pa->pa_class));
/* /*
@ -197,7 +198,7 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux)
if (PCI_MAPREG_MEM_TYPE(psc->sc_bars[bar].vb_type) == if (PCI_MAPREG_MEM_TYPE(psc->sc_bars[bar].vb_type) ==
PCI_MAPREG_MEM_TYPE_64BIT) { PCI_MAPREG_MEM_TYPE_64BIT) {
/* XXX */ /* XXX */
printf("%s: WARNING: ignoring 64-bit BAR @ 0x%02x\n", aprint_error("%s: WARNING: ignoring 64-bit BAR @ 0x%02x\n",
sc->sc_dev.dv_xname, reg); sc->sc_dev.dv_xname, reg);
bar++; bar++;
continue; continue;
@ -208,7 +209,7 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux)
&psc->sc_bars[bar].vb_base, &psc->sc_bars[bar].vb_base,
&psc->sc_bars[bar].vb_size, &psc->sc_bars[bar].vb_size,
&psc->sc_bars[bar].vb_flags)) &psc->sc_bars[bar].vb_flags))
printf("%s: WARNING: strange BAR @ 0x%02x\n", aprint_error("%s: WARNING: strange BAR @ 0x%02x\n",
sc->sc_dev.dv_xname, reg); sc->sc_dev.dv_xname, reg);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhub.c,v 1.90 2007/10/19 12:01:22 ad Exp $ */ /* $NetBSD: uhub.c,v 1.91 2007/12/01 04:50:50 jmcneill Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */
/* /*
@ -43,7 +43,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.90 2007/10/19 12:01:22 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.91 2007/12/01 04:50:50 jmcneill Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -165,11 +165,11 @@ USB_ATTACH(uhub)
devinfop = usbd_devinfo_alloc(dev, 1); devinfop = usbd_devinfo_alloc(dev, 1);
USB_ATTACH_SETUP; USB_ATTACH_SETUP;
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfop); aprint_normal("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfop);
usbd_devinfo_free(devinfop); usbd_devinfo_free(devinfop);
if (dev->depth > 0 && UHUB_IS_HIGH_SPEED(sc)) { if (dev->depth > 0 && UHUB_IS_HIGH_SPEED(sc)) {
printf("%s: %s transaction translator%s\n", aprint_normal("%s: %s transaction translator%s\n",
USBDEVNAME(sc->sc_dev), USBDEVNAME(sc->sc_dev),
UHUB_IS_SINGLE_TT(sc) ? "single" : "multiple", UHUB_IS_SINGLE_TT(sc) ? "single" : "multiple",
UHUB_IS_SINGLE_TT(sc) ? "" : "s"); UHUB_IS_SINGLE_TT(sc) ? "" : "s");
@ -183,7 +183,7 @@ USB_ATTACH(uhub)
} }
if (dev->depth > USB_HUB_MAX_DEPTH) { if (dev->depth > USB_HUB_MAX_DEPTH) {
printf("%s: hub depth (%d) exceeded, hub ignored\n", aprint_error("%s: hub depth (%d) exceeded, hub ignored\n",
USBDEVNAME(sc->sc_dev), USB_HUB_MAX_DEPTH); USBDEVNAME(sc->sc_dev), USB_HUB_MAX_DEPTH);
USB_ATTACH_ERROR_RETURN; USB_ATTACH_ERROR_RETURN;
} }
@ -210,12 +210,13 @@ USB_ATTACH(uhub)
for (nremov = 0, port = 1; port <= nports; port++) for (nremov = 0, port = 1; port <= nports; port++)
if (!UHD_NOT_REMOV(&hubdesc, port)) if (!UHD_NOT_REMOV(&hubdesc, port))
nremov++; nremov++;
printf("%s: %d port%s with %d removable, %s powered\n", aprint_verbose("%s: %d port%s with %d removable, %s powered\n",
USBDEVNAME(sc->sc_dev), nports, nports != 1 ? "s" : "", USBDEVNAME(sc->sc_dev), nports, nports != 1 ? "s" : "",
nremov, dev->self_powered ? "self" : "bus"); nremov, dev->self_powered ? "self" : "bus");
if (nports == 0) { if (nports == 0) {
printf("%s: no ports, hub ignored\n", USBDEVNAME(sc->sc_dev)); aprint_debug("%s: no ports, hub ignored\n",
USBDEVNAME(sc->sc_dev));
goto bad; goto bad;
} }
@ -231,24 +232,27 @@ USB_ATTACH(uhub)
/* Set up interrupt pipe. */ /* Set up interrupt pipe. */
err = usbd_device2interface_handle(dev, 0, &iface); err = usbd_device2interface_handle(dev, 0, &iface);
if (err) { if (err) {
printf("%s: no interface handle\n", USBDEVNAME(sc->sc_dev)); aprint_error("%s: no interface handle\n",
USBDEVNAME(sc->sc_dev));
goto bad; goto bad;
} }
if (UHUB_IS_HIGH_SPEED(sc) && !UHUB_IS_SINGLE_TT(sc)) { if (UHUB_IS_HIGH_SPEED(sc) && !UHUB_IS_SINGLE_TT(sc)) {
err = usbd_set_interface(iface, 1); err = usbd_set_interface(iface, 1);
if (err) if (err)
printf("%s: can't enable multiple TTs\n", aprint_error("%s: can't enable multiple TTs\n",
USBDEVNAME(sc->sc_dev)); USBDEVNAME(sc->sc_dev));
} }
ed = usbd_interface2endpoint_descriptor(iface, 0); ed = usbd_interface2endpoint_descriptor(iface, 0);
if (ed == NULL) { if (ed == NULL) {
printf("%s: no endpoint descriptor\n", USBDEVNAME(sc->sc_dev)); aprint_error("%s: no endpoint descriptor\n",
USBDEVNAME(sc->sc_dev));
goto bad; goto bad;
} }
if ((ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) { if ((ed->bmAttributes & UE_XFERTYPE) != UE_INTERRUPT) {
printf("%s: bad interrupt endpoint\n", USBDEVNAME(sc->sc_dev)); aprint_error("%s: bad interrupt endpoint\n",
USBDEVNAME(sc->sc_dev));
goto bad; goto bad;
} }
@ -268,7 +272,7 @@ USB_ATTACH(uhub)
USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_statusbuf, USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_statusbuf,
sc->sc_statuslen, uhub_intr, USBD_DEFAULT_INTERVAL); sc->sc_statuslen, uhub_intr, USBD_DEFAULT_INTERVAL);
if (err) { if (err) {
printf("%s: cannot open interrupt pipe\n", aprint_error("%s: cannot open interrupt pipe\n",
USBDEVNAME(sc->sc_dev)); USBDEVNAME(sc->sc_dev));
goto bad; goto bad;
} }
@ -342,7 +346,7 @@ USB_ATTACH(uhub)
/* Turn the power on. */ /* Turn the power on. */
err = usbd_set_port_feature(dev, port, UHF_PORT_POWER); err = usbd_set_port_feature(dev, port, UHF_PORT_POWER);
if (err) if (err)
printf("%s: port %d power on failed, %s\n", aprint_error("%s: port %d power on failed, %s\n",
USBDEVNAME(sc->sc_dev), port, USBDEVNAME(sc->sc_dev), port,
usbd_errstr(err)); usbd_errstr(err));
DPRINTF(("usb_init_port: turn on port %d power\n", port)); DPRINTF(("usb_init_port: turn on port %d power\n", port));

View File

@ -1,4 +1,4 @@
/* $NetBSD: usb.c,v 1.101 2007/10/19 12:01:22 ad Exp $ */ /* $NetBSD: usb.c,v 1.102 2007/12/01 05:12:48 jmcneill Exp $ */
/* /*
* Copyright (c) 1998, 2002 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.101 2007/10/19 12:01:22 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: usb.c,v 1.102 2007/12/01 05:12:48 jmcneill Exp $");
#include "opt_compat_netbsd.h" #include "opt_compat_netbsd.h"
@ -181,7 +181,8 @@ USB_ATTACH(usb)
sc->sc_port.power = USB_MAX_POWER; sc->sc_port.power = USB_MAX_POWER;
usbrev = sc->sc_bus->usbrev; usbrev = sc->sc_bus->usbrev;
printf(": USB revision %s", usbrev_str[usbrev]); aprint_naive("\n");
aprint_normal(": USB revision %s", usbrev_str[usbrev]);
switch (usbrev) { switch (usbrev) {
case USBREV_1_0: case USBREV_1_0:
case USBREV_1_1: case USBREV_1_1:
@ -191,11 +192,11 @@ USB_ATTACH(usb)
speed = USB_SPEED_HIGH; speed = USB_SPEED_HIGH;
break; break;
default: default:
printf(", not supported\n"); aprint_error(", not supported\n");
sc->sc_dying = 1; sc->sc_dying = 1;
USB_ATTACH_ERROR_RETURN; USB_ATTACH_ERROR_RETURN;
} }
printf("\n"); aprint_normal("\n");
/* Make sure not to use tsleep() if we are cold booting. */ /* Make sure not to use tsleep() if we are cold booting. */
if (cold) if (cold)
@ -210,7 +211,7 @@ USB_ATTACH(usb)
sc->sc_bus->soft = softint_establish(SOFTINT_NET, sc->sc_bus->soft = softint_establish(SOFTINT_NET,
sc->sc_bus->methods->soft_intr, sc->sc_bus); sc->sc_bus->methods->soft_intr, sc->sc_bus);
if (sc->sc_bus->soft == NULL) { if (sc->sc_bus->soft == NULL) {
printf("%s: can't register softintr\n", USBDEVNAME(sc->sc_dev)); aprint_error("%s: can't register softintr\n", USBDEVNAME(sc->sc_dev));
sc->sc_dying = 1; sc->sc_dying = 1;
USB_ATTACH_ERROR_RETURN; USB_ATTACH_ERROR_RETURN;
} }
@ -222,7 +223,7 @@ USB_ATTACH(usb)
dev = sc->sc_port.device; dev = sc->sc_port.device;
if (dev->hub == NULL) { if (dev->hub == NULL) {
sc->sc_dying = 1; sc->sc_dying = 1;
printf("%s: root device is not a hub\n", aprint_error("%s: root device is not a hub\n",
USBDEVNAME(sc->sc_dev)); USBDEVNAME(sc->sc_dev));
USB_ATTACH_ERROR_RETURN; USB_ATTACH_ERROR_RETURN;
} }
@ -237,7 +238,7 @@ USB_ATTACH(usb)
dev->hub->explore(sc->sc_bus->root_hub); dev->hub->explore(sc->sc_bus->root_hub);
#endif #endif
} else { } else {
printf("%s: root hub problem, error=%d\n", aprint_error("%s: root hub problem, error=%d\n",
USBDEVNAME(sc->sc_dev), err); USBDEVNAME(sc->sc_dev), err);
sc->sc_dying = 1; sc->sc_dying = 1;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: wskbd.c,v 1.107 2007/10/18 14:51:25 joerg Exp $ */ /* $NetBSD: wskbd.c,v 1.108 2007/12/01 05:22:02 jmcneill Exp $ */
/* /*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -79,7 +79,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.107 2007/10/18 14:51:25 joerg Exp $"); __KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.108 2007/12/01 05:22:02 jmcneill Exp $");
#include "opt_ddb.h" #include "opt_ddb.h"
#include "opt_kgdb.h" #include "opt_kgdb.h"
@ -397,10 +397,10 @@ wskbd_attach(struct device *parent, struct device *self, void *aux)
mux = -1; mux = -1;
} }
if (mux >= 0) if (mux >= 0)
printf(" mux %d", mux); aprint_normal(" mux %d", mux);
#else #else
if (device_cfdata(&sc->sc_base.me_dv)->wskbddevcf_mux >= 0) if (device_cfdata(&sc->sc_base.me_dv)->wskbddevcf_mux >= 0)
printf(" (mux ignored)"); aprint_normal(" (mux ignored)");
#endif #endif
if (ap->console) { if (ap->console) {
@ -443,15 +443,18 @@ wskbd_attach(struct device *parent, struct device *self, void *aux)
wskbd_console_device = sc; wskbd_console_device = sc;
printf(": console keyboard"); aprint_naive(": console keyboard");
aprint_normal(": console keyboard");
#if NWSDISPLAY > 0 #if NWSDISPLAY > 0
wsdisplay_set_console_kbd(&sc->sc_base); /* sets me_dispv */ wsdisplay_set_console_kbd(&sc->sc_base); /* sets me_dispv */
if (sc->sc_base.me_dispdv != NULL) if (sc->sc_base.me_dispdv != NULL)
printf(", using %s", sc->sc_base.me_dispdv->dv_xname); aprint_normal(", using %s",
sc->sc_base.me_dispdv->dv_xname);
#endif #endif
} }
printf("\n"); aprint_naive("\n");
aprint_normal("\n");
#if NWSMUX > 0 #if NWSMUX > 0
if (mux >= 0) { if (mux >= 0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsmouse.c,v 1.53 2007/10/16 21:06:10 joerg Exp $ */ /* $NetBSD: wsmouse.c,v 1.54 2007/12/01 05:40:44 jmcneill Exp $ */
/*- /*-
* Copyright (c) 2006 The NetBSD Foundation, Inc. * Copyright (c) 2006 The NetBSD Foundation, Inc.
@ -111,7 +111,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.53 2007/10/16 21:06:10 joerg Exp $"); __KERNEL_RCSID(0, "$NetBSD: wsmouse.c,v 1.54 2007/12/01 05:40:44 jmcneill Exp $");
#include "wsmouse.h" #include "wsmouse.h"
#include "wsdisplay.h" #include "wsdisplay.h"
@ -264,16 +264,17 @@ wsmouse_attach(struct device *parent, struct device *self, void *aux)
if (mux >= 0) { if (mux >= 0) {
error = wsmux_attach_sc(wsmux_getmux(mux), &sc->sc_base); error = wsmux_attach_sc(wsmux_getmux(mux), &sc->sc_base);
if (error) if (error)
printf(" attach error=%d", error); aprint_error(" attach error=%d", error);
else else
printf(" mux %d", mux); aprint_normal(" mux %d", mux);
} }
#else #else
if (device_cfdata(&sc->sc_base.me_dv)->wsmousedevcf_mux >= 0) if (device_cfdata(&sc->sc_base.me_dv)->wsmousedevcf_mux >= 0)
printf(" (mux ignored)"); aprint_normal(" (mux ignored)");
#endif #endif
printf("\n"); aprint_naive("\n");
aprint_normal("\n");
} }
int int