From 4fbe23fdd035755aafa5da37c2855219e3651e57 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sat, 1 Dec 2007 04:50:50 +0000 Subject: [PATCH] aprintify --- sys/arch/x86/x86/mpacpi.c | 14 ++++----- sys/dev/acpi/acpi_resource.c | 59 ++++++++++++++++++------------------ sys/dev/acpi/acpi_tz.c | 21 +++++++------ sys/dev/audio.c | 22 ++++++++------ sys/dev/cardbus/cardbus.c | 13 ++++---- sys/dev/cardbus/cardslot.c | 7 +++-- sys/dev/pci/pccbb.c | 27 ++++++++++------- sys/dev/pci/vga_pci.c | 11 ++++--- sys/dev/usb/uhub.c | 30 ++++++++++-------- sys/dev/usb/usb.c | 17 ++++++----- sys/dev/wscons/wskbd.c | 17 ++++++----- sys/dev/wscons/wsmouse.c | 13 ++++---- 12 files changed, 135 insertions(+), 116 deletions(-) diff --git a/sys/arch/x86/x86/mpacpi.c b/sys/arch/x86/x86/mpacpi.c index 3ea7927c4fd6..c07402861f60 100644 --- a/sys/arch/x86/x86/mpacpi.c +++ b/sys/arch/x86/x86/mpacpi.c @@ -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. @@ -36,7 +36,7 @@ */ #include -__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 "opt_acpi.h" @@ -149,8 +149,8 @@ mpacpi_cpuprint(void *aux, const char *pnp) struct cpu_attach_args *caa = aux; if (pnp) - printf("cpu at %s", pnp); - printf(" apid %d", caa->cpu_number); + aprint_normal("cpu at %s", pnp); + aprint_normal(" apid %d", caa->cpu_number); return (UNCONF); } @@ -160,8 +160,8 @@ mpacpi_ioapicprint(void *aux, const char *pnp) struct apic_attach_args *aaa = aux; if (pnp) - printf("ioapic at %s", pnp); - printf(" apid %d", aaa->apic_id); + aprint_normal("ioapic at %s", pnp); + aprint_normal(" apid %d", aaa->apic_id); return (UNCONF); } @@ -633,7 +633,7 @@ mpacpi_pcibus_cb(ACPI_HANDLE handle, UINT32 level, void *p, if (mpacpi_npciroots != 0) panic("mpacpi: ASL is broken"); - printf("mpacpi: could not get bus number, " + aprint_normal("mpacpi: could not get bus number, " "assuming bus 0\n"); mpr->mpr_bus = 0; } diff --git a/sys/dev/acpi/acpi_resource.c b/sys/dev/acpi/acpi_resource.c index c65b51dcaade..5f190f639903 100644 --- a/sys/dev/acpi/acpi_resource.c +++ b/sys/dev/acpi/acpi_resource.c @@ -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. @@ -67,7 +67,7 @@ */ #include -__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 #include @@ -352,8 +352,8 @@ acpi_resource_parse(struct device *dev, ACPI_HANDLE handle, const char *path, rv = AcpiWalkResources(handle, path, acpi_resource_parse_callback, &cbarg); if (ACPI_FAILURE(rv)) { - printf("%s: ACPI: unable to get %s resources: %s\n", - dev->dv_xname, path, AcpiFormatException(rv)); + aprint_error_dev(dev, "ACPI: unable to get %s resources: %s\n", + path, AcpiFormatException(rv)); return_ACPI_STATUS(rv); } @@ -381,17 +381,17 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res) SIMPLEQ_EMPTY(&res->ar_drq)) return; - printf("%s:", dev->dv_xname); + aprint_normal("%s:", dev->dv_xname); if (SIMPLEQ_EMPTY(&res->ar_io) == 0) { struct acpi_io *ar; sep = ""; - printf(" io "); + aprint_normal(" io "); 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) - printf("-0x%x", ar->ar_base + + aprint_normal("-0x%x", ar->ar_base + ar->ar_length - 1); sep = ","; } @@ -403,11 +403,11 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res) struct acpi_mem *ar; sep = ""; - printf(" mem "); + aprint_normal(" mem "); 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) - printf("-0x%x", ar->ar_base + + aprint_normal("-0x%x", ar->ar_base + ar->ar_length - 1); sep = ","; } @@ -419,9 +419,9 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res) struct acpi_irq *ar; sep = ""; - printf(" irq "); + aprint_normal(" irq "); SIMPLEQ_FOREACH(ar, &res->ar_irq, ar_list) { - printf("%s%d", sep, ar->ar_irq); + aprint_normal("%s%d", sep, ar->ar_irq); sep = ","; } } @@ -430,14 +430,14 @@ acpi_resource_print(struct device *dev, struct acpi_resources *res) struct acpi_drq *ar; sep = ""; - printf(" drq "); + aprint_normal(" drq "); SIMPLEQ_FOREACH(ar, &res->ar_drq, ar_list) { - printf("%s%d", sep, ar->ar_drq); + aprint_normal("%s%d", sep, ar->ar_drq); 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)); if (ar == NULL) { - printf("%s: ACPI: unable to allocate I/O resource %d\n", - dev->dv_xname, res->ar_nio); + aprint_error_dev(dev, "ACPI: unable to allocate I/O resource %d\n", + res->ar_nio); res->ar_nio++; return; } @@ -695,8 +695,8 @@ acpi_res_parse_iorange(struct device *dev, void *context, uint32_t low, ar = AcpiOsAllocate(sizeof(*ar)); if (ar == NULL) { - printf("%s: ACPI: unable to allocate I/O range resource %d\n", - dev->dv_xname, res->ar_niorange); + aprint_error_dev(dev, "ACPI: unable to allocate I/O range resource %d\n", + res->ar_niorange); res->ar_niorange++; return; } @@ -719,8 +719,8 @@ acpi_res_parse_memory(struct device *dev, void *context, uint32_t base, ar = AcpiOsAllocate(sizeof(*ar)); if (ar == NULL) { - printf("%s: ACPI: unable to allocate Memory resource %d\n", - dev->dv_xname, res->ar_nmem); + aprint_error_dev(dev, "ACPI: unable to allocate Memory resource %d\n", + res->ar_nmem); res->ar_nmem++; return; } @@ -741,8 +741,8 @@ acpi_res_parse_memrange(struct device *dev, void *context, uint32_t low, ar = AcpiOsAllocate(sizeof(*ar)); if (ar == NULL) { - printf("%s: ACPI: unable to allocate Memory range resource " - "%d\n", dev->dv_xname, res->ar_nmemrange); + aprint_error_dev(dev, "ACPI: unable to allocate Memory range resource %d\n", + res->ar_nmemrange); res->ar_nmemrange++; return; } @@ -764,8 +764,8 @@ acpi_res_parse_irq(struct device *dev, void *context, uint32_t irq, uint32_t typ ar = AcpiOsAllocate(sizeof(*ar)); if (ar == NULL) { - printf("%s: ACPI: unable to allocate IRQ resource %d\n", - dev->dv_xname, res->ar_nirq); + aprint_error_dev(dev, "ACPI: unable to allocate IRQ resource %d\n", + res->ar_nirq); res->ar_nirq++; return; } @@ -785,8 +785,8 @@ acpi_res_parse_drq(struct device *dev, void *context, uint32_t drq) ar = AcpiOsAllocate(sizeof(*ar)); if (ar == NULL) { - printf("%s: ACPI: unable to allocate DRQ resource %d\n", - dev->dv_xname, res->ar_ndrq); + aprint_error_dev(dev, "ACPI: unable to allocate DRQ resource %d\n", + res->ar_ndrq); res->ar_ndrq++; return; } @@ -802,8 +802,7 @@ acpi_res_parse_start_dep(struct device *dev, void *context, int preference) { - printf("%s: ACPI: dependant functions not supported\n", - dev->dv_xname); + aprint_error_dev(dev, "ACPI: dependant functions not supported\n"); } static void diff --git a/sys/dev/acpi/acpi_tz.c b/sys/dev/acpi/acpi_tz.c index abdeb8c211ee..dd3a6c82155a 100644 --- a/sys/dev/acpi/acpi_tz.c +++ b/sys/dev/acpi/acpi_tz.c @@ -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 @@ -30,7 +30,7 @@ */ #include -__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 #include @@ -225,7 +225,8 @@ acpitz_get_status(void *opaque) } 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; } sc->sc_zone.tmp = tmp; @@ -448,7 +449,7 @@ acpitz_get_zone(void *opaque, int verbose) } 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, acpitz_celcius_string(sc->sc_zone.ac[i])); @@ -458,7 +459,7 @@ acpitz_get_zone(void *opaque, int verbose) if (valid_levels == 0) { sc->sc_flags |= ATZ_F_PASSIVEONLY; if (first) - printf("%s: passive cooling mode only\n", + aprint_normal("%s: passive cooling mode only\n", sc->sc_dev.dv_xname); } @@ -478,17 +479,17 @@ acpitz_get_zone(void *opaque, int verbose) acpitz_sane_temp(&sc->sc_zone.psv); 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) - printf(" critical %sC", + aprint_normal(" critical %sC", acpitz_celcius_string(sc->sc_zone.crt)); if (sc->sc_zone.hot != ATZ_TMP_INVALID) - printf(" hot %sC", + aprint_normal(" hot %sC", acpitz_celcius_string(sc->sc_zone.hot)); if (sc->sc_zone.psv != ATZ_TMP_INVALID) - printf(" passive %sC", + aprint_normal(" passive %sC", acpitz_celcius_string(sc->sc_zone.tmp)); - printf("\n"); + aprint_normal("\n"); } for (i = 0; i < ATZ_NLEVELS; i++) diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 06c8dd70665a..27a4b0e655cd 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -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. @@ -61,7 +61,7 @@ */ #include -__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" #if NAUDIO > 0 @@ -299,17 +299,19 @@ audioattach(struct device *parent, struct device *self, void *aux) props = hwp->get_props(hdlp); + aprint_naive("\n"); + if (props & AUDIO_PROP_FULLDUPLEX) - printf(": full duplex"); + aprint_normal(": full duplex"); else - printf(": half duplex"); + aprint_normal(": half duplex"); if (props & AUDIO_PROP_MMAP) - printf(", mmap"); + aprint_normal(", mmap"); if (props & AUDIO_PROP_INDEPENDENT) - printf(", independent"); + aprint_normal(", independent"); - printf("\n"); + aprint_normal("\n"); sc->hw_if = hwp; 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); if (error) { sc->hw_if = NULL; - printf("audio: could not allocate play buffer\n"); + aprint_error("audio: could not allocate play buffer\n"); return; } error = audio_alloc_ring(sc, &sc->sc_rr, AUMODE_RECORD, AU_RING_SIZE); if (error) { audio_free_ring(sc, &sc->sc_pr); sc->hw_if = NULL; - printf("audio: could not allocate record buffer\n"); + aprint_error("audio: could not allocate record buffer\n"); return; } 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; return; } diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 402f4976361e..7251436ab19b 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -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 @@ -33,7 +33,7 @@ */ #include -__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" @@ -124,11 +124,12 @@ cardbusattach(struct device *parent, struct device *self, void *aux) sc->sc_cacheline = cba->cba_cacheline; 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) - printf(" cacheline 0x%x, lattimer 0x%x", sc->sc_cacheline, - sc->sc_max_lattimer); - printf("\n"); + aprint_normal(" cacheline 0x%x, lattimer 0x%x", + sc->sc_cacheline, sc->sc_max_lattimer); + aprint_normal("\n"); sc->sc_iot = cba->cba_iot; /* CardBus I/O space tag */ sc->sc_memt = cba->cba_memt; /* CardBus MEM space tag */ diff --git a/sys/dev/cardbus/cardslot.c b/sys/dev/cardbus/cardslot.c index 5cdeff0f9088..85bb8ab12abc 100644 --- a/sys/dev/cardbus/cardslot.c +++ b/sys/dev/cardbus/cardslot.c @@ -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 @@ -33,7 +33,7 @@ */ #include -__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" @@ -113,7 +113,8 @@ cardslotattach(struct device *parent, struct device *self, SIMPLEQ_INIT(&sc->sc_events); 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); DPRINTF(("%s attaching CardBus bus...\n", sc->sc_dev.dv_xname)); diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index 769f3c800c0c..d9c08f22f7d9 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -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 @@ -31,7 +31,7 @@ */ #include -__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 @@ -429,10 +429,13 @@ pccbbattach(struct device *parent, struct device *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)); - 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)); - printf("\n"); + aprint_normal("\n"); TAILQ_INIT(&sc->sc_memwindow); TAILQ_INIT(&sc->sc_iowindow); @@ -478,7 +481,7 @@ pccbbattach(struct device *parent, struct device *self, void *aux) /* The address must be valid. */ if (pci_mapreg_map(pa, PCI_SOCKBASE, PCI_MAPREG_TYPE_MEM, 0, &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); /* * 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, 0, &sc->sc_base_memt, &sc->sc_base_memh, &sockbase, 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, (unsigned long)sockbase); /* give up... allocate reg space via rbus. */ @@ -629,7 +632,8 @@ pccbb_pci_callback(struct device *self) /* Map and establish the interrupt. */ 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; } 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); 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) { - printf(" at %s", intrstr); + aprint_normal(" at %s", intrstr); } - printf("\n"); + aprint_normal("\n"); 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); { diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index cede4ccdcef5..a2cacffcbf99 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.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. @@ -28,7 +28,7 @@ */ #include -__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 #include @@ -174,7 +174,8 @@ vga_pci_attach(struct device *parent, struct device *self, void *aux) psc->sc_pcitag = pa->pa_tag; 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)); /* @@ -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) == PCI_MAPREG_MEM_TYPE_64BIT) { /* 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); bar++; 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_size, &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); } diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 73659635d9bb..ee93d5213548 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -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 $ */ /* @@ -43,7 +43,7 @@ */ #include -__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 #include @@ -165,11 +165,11 @@ USB_ATTACH(uhub) devinfop = usbd_devinfo_alloc(dev, 1); 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); 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), UHUB_IS_SINGLE_TT(sc) ? "single" : "multiple", UHUB_IS_SINGLE_TT(sc) ? "" : "s"); @@ -183,7 +183,7 @@ USB_ATTACH(uhub) } 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); USB_ATTACH_ERROR_RETURN; } @@ -210,12 +210,13 @@ USB_ATTACH(uhub) for (nremov = 0, port = 1; port <= nports; port++) if (!UHD_NOT_REMOV(&hubdesc, port)) 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" : "", nremov, dev->self_powered ? "self" : "bus"); 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; } @@ -231,24 +232,27 @@ USB_ATTACH(uhub) /* Set up interrupt pipe. */ err = usbd_device2interface_handle(dev, 0, &iface); 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; } if (UHUB_IS_HIGH_SPEED(sc) && !UHUB_IS_SINGLE_TT(sc)) { err = usbd_set_interface(iface, 1); if (err) - printf("%s: can't enable multiple TTs\n", + aprint_error("%s: can't enable multiple TTs\n", USBDEVNAME(sc->sc_dev)); } ed = usbd_interface2endpoint_descriptor(iface, 0); 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; } 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; } @@ -268,7 +272,7 @@ USB_ATTACH(uhub) USBD_SHORT_XFER_OK, &sc->sc_ipipe, sc, sc->sc_statusbuf, sc->sc_statuslen, uhub_intr, USBD_DEFAULT_INTERVAL); if (err) { - printf("%s: cannot open interrupt pipe\n", + aprint_error("%s: cannot open interrupt pipe\n", USBDEVNAME(sc->sc_dev)); goto bad; } @@ -342,7 +346,7 @@ USB_ATTACH(uhub) /* Turn the power on. */ err = usbd_set_port_feature(dev, port, UHF_PORT_POWER); 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, usbd_errstr(err)); DPRINTF(("usb_init_port: turn on port %d power\n", port)); diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index dc14c650ecaf..273c39945c38 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -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. @@ -44,7 +44,7 @@ */ #include -__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" @@ -181,7 +181,8 @@ USB_ATTACH(usb) sc->sc_port.power = USB_MAX_POWER; 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) { case USBREV_1_0: case USBREV_1_1: @@ -191,11 +192,11 @@ USB_ATTACH(usb) speed = USB_SPEED_HIGH; break; default: - printf(", not supported\n"); + aprint_error(", not supported\n"); sc->sc_dying = 1; USB_ATTACH_ERROR_RETURN; } - printf("\n"); + aprint_normal("\n"); /* Make sure not to use tsleep() if we are cold booting. */ if (cold) @@ -210,7 +211,7 @@ USB_ATTACH(usb) sc->sc_bus->soft = softint_establish(SOFTINT_NET, sc->sc_bus->methods->soft_intr, sc->sc_bus); 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; USB_ATTACH_ERROR_RETURN; } @@ -222,7 +223,7 @@ USB_ATTACH(usb) dev = sc->sc_port.device; if (dev->hub == NULL) { 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)); USB_ATTACH_ERROR_RETURN; } @@ -237,7 +238,7 @@ USB_ATTACH(usb) dev->hub->explore(sc->sc_bus->root_hub); #endif } else { - printf("%s: root hub problem, error=%d\n", + aprint_error("%s: root hub problem, error=%d\n", USBDEVNAME(sc->sc_dev), err); sc->sc_dying = 1; } diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index 490ec03f16f6..cc154617c6d9 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -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. @@ -79,7 +79,7 @@ */ #include -__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_kgdb.h" @@ -397,10 +397,10 @@ wskbd_attach(struct device *parent, struct device *self, void *aux) mux = -1; } if (mux >= 0) - printf(" mux %d", mux); + aprint_normal(" mux %d", mux); #else if (device_cfdata(&sc->sc_base.me_dv)->wskbddevcf_mux >= 0) - printf(" (mux ignored)"); + aprint_normal(" (mux ignored)"); #endif if (ap->console) { @@ -443,15 +443,18 @@ wskbd_attach(struct device *parent, struct device *self, void *aux) wskbd_console_device = sc; - printf(": console keyboard"); + aprint_naive(": console keyboard"); + aprint_normal(": console keyboard"); #if NWSDISPLAY > 0 wsdisplay_set_console_kbd(&sc->sc_base); /* sets me_dispv */ 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 } - printf("\n"); + aprint_naive("\n"); + aprint_normal("\n"); #if NWSMUX > 0 if (mux >= 0) { diff --git a/sys/dev/wscons/wsmouse.c b/sys/dev/wscons/wsmouse.c index 2c7e3c003428..05bab1a2ebe4 100644 --- a/sys/dev/wscons/wsmouse.c +++ b/sys/dev/wscons/wsmouse.c @@ -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. @@ -111,7 +111,7 @@ */ #include -__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 "wsdisplay.h" @@ -264,16 +264,17 @@ wsmouse_attach(struct device *parent, struct device *self, void *aux) if (mux >= 0) { error = wsmux_attach_sc(wsmux_getmux(mux), &sc->sc_base); if (error) - printf(" attach error=%d", error); + aprint_error(" attach error=%d", error); else - printf(" mux %d", mux); + aprint_normal(" mux %d", mux); } #else if (device_cfdata(&sc->sc_base.me_dv)->wsmousedevcf_mux >= 0) - printf(" (mux ignored)"); + aprint_normal(" (mux ignored)"); #endif - printf("\n"); + aprint_naive("\n"); + aprint_normal("\n"); } int