From cf417aad7e918f5a0ecdb3f9554e06590dfc0b75 Mon Sep 17 00:00:00 2001 From: cegger Date: Tue, 8 Apr 2008 20:08:49 +0000 Subject: [PATCH] use aprint_*_dev and device_xname --- sys/dev/isa/ad1848_isa.c | 12 ++--- sys/dev/isa/addcom_isa.c | 9 ++-- sys/dev/isa/adv_isa.c | 14 +++-- sys/dev/isa/aha_isa.c | 14 +++-- sys/dev/isa/aic_isa.c | 11 ++-- sys/dev/isa/aria.c | 6 +-- sys/dev/isa/ast.c | 7 ++- sys/dev/isa/atppc_isa.c | 8 +-- sys/dev/isa/atppc_isadma.c | 6 +-- sys/dev/isa/aztech.c | 6 +-- sys/dev/isa/bha_isa.c | 16 +++--- sys/dev/isa/boca.c | 9 ++-- sys/dev/isa/cec.c | 15 +++--- sys/dev/isa/cs89x0isa.c | 31 +++++------ sys/dev/isa/esp_isa.c | 25 +++++---- sys/dev/isa/ess.c | 28 +++++----- sys/dev/isa/ess_isa.c | 6 +-- sys/dev/isa/gus.c | 46 ++++++++--------- sys/dev/isa/i82365_isasubr.c | 28 +++++----- sys/dev/isa/if_ai.c | 12 ++--- sys/dev/isa/if_ate.c | 7 ++- sys/dev/isa/if_cs_isa.c | 14 +++-- sys/dev/isa/if_ef.c | 18 +++---- sys/dev/isa/if_eg.c | 66 ++++++++++-------------- sys/dev/isa/if_el.c | 20 ++++---- sys/dev/isa/if_fmv_isa.c | 9 ++-- sys/dev/isa/if_hp.c | 6 +-- sys/dev/isa/if_ix.c | 16 +++--- sys/dev/isa/if_iy.c | 66 ++++++++++++------------ sys/dev/isa/if_lc_isa.c | 13 ++--- sys/dev/isa/if_ntwoc_isa.c | 27 +++++----- sys/dev/isa/if_sm_isa.c | 7 ++- sys/dev/isa/if_tscs_isa.c | 9 ++-- sys/dev/isa/ioat66.c | 10 ++-- sys/dev/isa/isadma.c | 44 ++++++++-------- sys/dev/isa/isic_isa.c | 7 ++- sys/dev/isa/isic_isa_itk_ix1.c | 8 +-- sys/dev/isa/mcd.c | 56 ++++++++++---------- sys/dev/isa/moxa_isa.c | 7 ++- sys/dev/isa/radiotrack.c | 6 +-- sys/dev/isa/rtfps.c | 11 ++-- sys/dev/isa/satlink.c | 19 ++++--- sys/dev/isa/seagate.c | 48 ++++++++--------- sys/dev/isa/tcic2_isa.c | 22 ++++---- sys/dev/isa/tcom.c | 9 ++-- sys/dev/isa/toaster.c | 30 +++++------ sys/dev/isa/toasterlcd.c | 8 +-- sys/dev/isa/tsdio.c | 6 +-- sys/dev/isa/uha_isa.c | 21 ++++---- sys/dev/isa/wds.c | 74 +++++++++++---------------- sys/dev/isa/weasel_isa.c | 17 +++--- sys/dev/isa/wss_isa.c | 6 +-- sys/dev/isa/wt.c | 22 ++++---- sys/dev/isa/ym.c | 6 +-- sys/dev/isapnp/aha_isapnp.c | 22 ++++---- sys/dev/isapnp/aic_isapnp.c | 12 ++--- sys/dev/isapnp/atppc_isapnp.c | 7 ++- sys/dev/isapnp/ess_isapnp.c | 10 ++-- sys/dev/isapnp/gus_isapnp.c | 25 +++++---- sys/dev/isapnp/i82365_isapnp.c | 11 ++-- sys/dev/isapnp/if_an_isapnp.c | 15 +++--- sys/dev/isapnp/if_cs_isapnp.c | 6 +-- sys/dev/isapnp/if_ep_isapnp.c | 8 +-- sys/dev/isapnp/if_fmv_isapnp.c | 7 ++- sys/dev/isapnp/if_tr_isapnp.c | 8 +-- sys/dev/isapnp/isic_isapnp.c | 10 ++-- sys/dev/isapnp/isic_isapnp_dynalink.c | 10 ++-- sys/dev/isapnp/isic_isapnp_sws.c | 10 ++-- sys/dev/isapnp/wss_isapnp.c | 12 ++--- sys/dev/isapnp/ym_isapnp.c | 10 ++-- sys/dev/mii/acphy.c | 6 +-- sys/dev/mii/amhphy.c | 6 +-- sys/dev/mii/bmtphy.c | 6 +-- sys/dev/mii/brgphy.c | 21 +++----- sys/dev/mii/ciphy.c | 13 +++-- sys/dev/mii/dmphy.c | 6 +-- sys/dev/mii/exphy.c | 9 ++-- sys/dev/mii/gentbi.c | 6 +-- sys/dev/mii/glxtphy.c | 6 +-- sys/dev/mii/gphyter.c | 8 +-- sys/dev/mii/icsphy.c | 6 +-- sys/dev/mii/igphy.c | 6 +-- sys/dev/mii/ikphy.c | 6 +-- sys/dev/mii/inphy.c | 6 +-- sys/dev/mii/iophy.c | 6 +-- sys/dev/mii/lxtphy.c | 6 +-- sys/dev/mii/makphy.c | 6 +-- sys/dev/mii/mii.c | 6 +-- sys/dev/mii/mvphy.c | 8 +-- sys/dev/mii/nsphy.c | 6 +-- sys/dev/mii/nsphyter.c | 6 +-- sys/dev/mii/pnaphy.c | 6 +-- sys/dev/mii/qsphy.c | 6 +-- sys/dev/mii/rgephy.c | 6 +-- sys/dev/mii/rlphy.c | 6 +-- sys/dev/mii/sqphy.c | 9 ++-- sys/dev/mii/tlphy.c | 8 +-- sys/dev/mii/tqphy.c | 6 +-- sys/dev/mii/ukphy.c | 14 ++--- sys/dev/mii/urlphy.c | 17 +++--- sys/dev/mscp/mscp.c | 16 +++--- sys/dev/mscp/mscp_disk.c | 30 ++++++----- sys/dev/mscp/mscp_subr.c | 20 ++++---- sys/dev/mscp/mscp_tape.c | 12 ++--- sys/dev/ofisa/atppc_ofisa.c | 17 +++--- sys/dev/ofisa/com_ofisa.c | 8 +-- sys/dev/ofisa/ess_ofisa.c | 6 +-- sys/dev/ofisa/if_cs_ofisa.c | 12 ++--- sys/dev/ofisa/lpt_ofisa.c | 8 +-- sys/dev/ofw/ofdisk.c | 14 ++--- sys/dev/ofw/ofnet.c | 8 +-- sys/dev/onewire/onewire.c | 13 +++-- sys/dev/onewire/owtemp.c | 11 ++-- 113 files changed, 761 insertions(+), 854 deletions(-) diff --git a/sys/dev/isa/ad1848_isa.c b/sys/dev/isa/ad1848_isa.c index bb3da0db51ee..3a3f56bec225 100644 --- a/sys/dev/isa/ad1848_isa.c +++ b/sys/dev/isa/ad1848_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: ad1848_isa.c,v 1.33 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: ad1848_isa.c,v 1.34 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -102,7 +102,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ad1848_isa.c,v 1.33 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ad1848_isa.c,v 1.34 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -458,8 +458,8 @@ ad1848_isa_attach(struct ad1848_isa_softc *isc) error = isa_dmamap_create(isc->sc_ic, isc->sc_playdrq, isc->sc_play_maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW); if (error) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, isc->sc_playdrq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + isc->sc_playdrq); return; } } @@ -469,8 +469,8 @@ ad1848_isa_attach(struct ad1848_isa_softc *isc) error = isa_dmamap_create(isc->sc_ic, isc->sc_recdrq, isc->sc_rec_maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW); if (error) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, isc->sc_recdrq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + isc->sc_recdrq); isa_dmamap_destroy(isc->sc_ic, isc->sc_playdrq); return; } diff --git a/sys/dev/isa/addcom_isa.c b/sys/dev/isa/addcom_isa.c index bbf44e96c56f..8315d8001f83 100644 --- a/sys/dev/isa/addcom_isa.c +++ b/sys/dev/isa/addcom_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: addcom_isa.c,v 1.16 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: addcom_isa.c,v 1.17 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright (c) 2000 Michael Graff. All rights reserved. @@ -55,7 +55,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: addcom_isa.c,v 1.16 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: addcom_isa.c,v 1.17 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -200,7 +200,7 @@ addcomattach(struct device *parent, struct device *self, void *aux) if (bus_space_map(iot, STATUS_IOADDR, STATUS_SIZE, 0, &sc->sc_statusioh)) { - printf("%s: can't map status space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map status space\n"); return; } @@ -211,8 +211,7 @@ addcomattach(struct device *parent, struct device *self, void *aux) if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) && bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_slaveioh[i])) { - printf("%s: can't map i/o space for slave %d\n", - sc->sc_dev.dv_xname, i); + aprint_error_dev(&sc->sc_dev, "can't map i/o space for slave %d\n", i); return; } } diff --git a/sys/dev/isa/adv_isa.c b/sys/dev/isa/adv_isa.c index 61d094de14cc..562508e25e80 100644 --- a/sys/dev/isa/adv_isa.c +++ b/sys/dev/isa/adv_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: adv_isa.c,v 1.14 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: adv_isa.c,v 1.15 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: adv_isa.c,v 1.14 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: adv_isa.c,v 1.15 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -221,7 +221,7 @@ adv_isa_attach(struct device *parent, struct device *self, void *aux) sc->sc_flags = 0x0; if (bus_space_map(iot, ia->ia_io[0].ir_addr, ASC_IOADR_GAP, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } @@ -240,21 +240,19 @@ adv_isa_attach(struct device *parent, struct device *self, void *aux) * Initialize the board */ if (adv_init(sc)) { - printf("%s: adv_init failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "adv_init failed\n"); return; } if ((error = isa_dmacascade(ic, ia->ia_drq[0].ir_drq)) != 0) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "unable to cascade DRQ, error = %d\n", error); return; } sc->sc_ih = isa_intr_establish(ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_BIO, adv_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } diff --git a/sys/dev/isa/aha_isa.c b/sys/dev/isa/aha_isa.c index 0d431fbb94b6..280b73017015 100644 --- a/sys/dev/isa/aha_isa.c +++ b/sys/dev/isa/aha_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: aha_isa.c,v 1.23 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: aha_isa.c,v 1.24 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aha_isa.c,v 1.23 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aha_isa.c,v 1.24 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -139,7 +139,7 @@ aha_isa_attach(struct device *parent, struct device *self, void *aux) printf("\n"); if (bus_space_map(iot, ia->ia_io[0].ir_addr, AHA_ISA_IOSIZE, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } @@ -147,14 +147,13 @@ aha_isa_attach(struct device *parent, struct device *self, void *aux) sc->sc_ioh = ioh; sc->sc_dmat = ia->ia_dmat; if (!aha_find(iot, ioh, &apd)) { - printf("%s: aha_find failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "aha_find failed\n"); return; } if (apd.sc_drq != -1) { if ((error = isa_dmacascade(ic, apd.sc_drq)) != 0) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "unable to cascade DRQ, error = %d\n", error); return; } } @@ -162,8 +161,7 @@ aha_isa_attach(struct device *parent, struct device *self, void *aux) sc->sc_ih = isa_intr_establish(ic, apd.sc_irq, IST_EDGE, IPL_BIO, aha_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } diff --git a/sys/dev/isa/aic_isa.c b/sys/dev/isa/aic_isa.c index efa3d872847d..2c85d0e8268f 100644 --- a/sys/dev/isa/aic_isa.c +++ b/sys/dev/isa/aic_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: aic_isa.c,v 1.20 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: aic_isa.c,v 1.21 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Charles M. Hannum. All rights reserved. @@ -51,7 +51,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aic_isa.c,v 1.20 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aic_isa.c,v 1.21 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -154,22 +154,21 @@ aic_isa_attach(struct device *parent, struct device *self, void *aux) printf("\n"); if (bus_space_map(iot, ia->ia_io[0].ir_addr, AIC_ISA_IOSIZE, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } sc->sc_iot = iot; sc->sc_ioh = ioh; if (!aic_find(iot, ioh)) { - printf("%s: aic_find failed", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "aic_find failed"); return; } isc->sc_ih = isa_intr_establish(ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_BIO, aicintr, sc); if (isc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } diff --git a/sys/dev/isa/aria.c b/sys/dev/isa/aria.c index fee6c33a074c..26edbb8e6dd2 100644 --- a/sys/dev/isa/aria.c +++ b/sys/dev/isa/aria.c @@ -1,4 +1,4 @@ -/* $NetBSD: aria.c,v 1.28 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: aria.c,v 1.29 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1995, 1996, 1998 Roland C. Dowdeswell. All rights reserved. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aria.c,v 1.28 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aria.c,v 1.29 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -406,7 +406,7 @@ ariaattach(struct device *parent, struct device *self, void *aux) ia = aux; if (bus_space_map(ia->ia_iot, ia->ia_io[0].ir_addr, ARIADSP_NPORT, 0, &ioh)) - panic("%s: can map io port range", self->dv_xname); + panic("%s: can map io port range", device_xname(self)); sc->sc_iot = ia->ia_iot; sc->sc_ioh = ioh; diff --git a/sys/dev/isa/ast.c b/sys/dev/isa/ast.c index ce7c430ebbef..bf271f291cfa 100644 --- a/sys/dev/isa/ast.c +++ b/sys/dev/isa/ast.c @@ -1,4 +1,4 @@ -/* $NetBSD: ast.c,v 1.59 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: ast.c,v 1.60 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.59 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ast.c,v 1.60 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -161,8 +161,7 @@ astattach(struct device *parent, struct device *self, void *aux) if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) && bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_slaveioh[i])) { - printf("%s: can't map i/o space for slave %d\n", - sc->sc_dev.dv_xname, i); + aprint_error_dev(&sc->sc_dev, "can't map i/o space for slave %d\n", i); return; } } diff --git a/sys/dev/isa/atppc_isa.c b/sys/dev/isa/atppc_isa.c index 0feff5c2fc9a..4b223a024ea5 100644 --- a/sys/dev/isa/atppc_isa.c +++ b/sys/dev/isa/atppc_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: atppc_isa.c,v 1.11 2007/10/19 12:00:14 ad Exp $ */ +/* $NetBSD: atppc_isa.c,v 1.12 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 2001 Alcove - Nicolas Souchu @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atppc_isa.c,v 1.11 2007/10/19 12:00:14 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atppc_isa.c,v 1.12 2008/04/08 20:08:49 cegger Exp $"); #include "opt_atppc.h" @@ -146,8 +146,8 @@ atppc_isa_attach(struct device *parent, struct device *self, void *aux) if (bus_space_map(lsc->sc_iot, sc->sc_iobase, IO_LPTSIZE, 0, &lsc->sc_ioh) != 0) { - printf("%s: attempt to map bus space failed, device not " - "properly attached.\n", self->dv_xname); + aprint_error_dev(self, "attempt to map bus space failed, device not " + "properly attached.\n"); lsc->sc_dev_ok = ATPPC_NOATTACH; return; } diff --git a/sys/dev/isa/atppc_isadma.c b/sys/dev/isa/atppc_isadma.c index 64d44af9fe18..57da12bfb0ef 100644 --- a/sys/dev/isa/atppc_isadma.c +++ b/sys/dev/isa/atppc_isadma.c @@ -1,4 +1,4 @@ -/* $NetBSD: atppc_isadma.c,v 1.5 2007/10/19 12:00:15 ad Exp $ */ +/* $NetBSD: atppc_isadma.c,v 1.6 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 2001 Alcove - Nicolas Souchu @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atppc_isadma.c,v 1.5 2007/10/19 12:00:15 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atppc_isadma.c,v 1.6 2008/04/08 20:08:49 cegger Exp $"); #include "opt_atppc.h" @@ -61,7 +61,7 @@ atppc_isadma_setup(struct atppc_softc * lsc, isa_chipset_tag_t ic, int drq) /* Reserve DRQ */ if (isa_drq_alloc(ic, drq)) { ATPPC_DPRINTF(("%s(%s): cannot reserve DRQ line.\n", __func__, - lsc->sc_dev.dv_xname)); + device_xname(&lsc->sc_dev))); return error; } diff --git a/sys/dev/isa/aztech.c b/sys/dev/isa/aztech.c index 94e3b5b5036b..c0f5c179f8e0 100644 --- a/sys/dev/isa/aztech.c +++ b/sys/dev/isa/aztech.c @@ -1,4 +1,4 @@ -/* $NetBSD: aztech.c,v 1.13 2007/10/19 12:00:15 ad Exp $ */ +/* $NetBSD: aztech.c,v 1.14 2008/04/08 20:08:49 cegger Exp $ */ /* $OpenBSD: aztech.c,v 1.2 2001/12/05 10:27:06 mickey Exp $ */ /* $RuOBSD: aztech.c,v 1.11 2001/10/20 13:23:47 pva Exp $ */ @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aztech.c,v 1.13 2007/10/19 12:00:15 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aztech.c,v 1.14 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -176,7 +176,7 @@ az_attach(struct device *parent, struct device *self, void *aux) /* remap I/O */ if (bus_space_map(sc->lm.iot, ia->ia_io[0].ir_addr, ia->ia_io[0].ir_size, 0, &sc->lm.ioh)) - panic(": bus_space_map() of %s failed", sc->sc_dev.dv_xname); + panic(": bus_space_map() of %s failed", device_xname(&sc->sc_dev)); printf(": Aztech/PackardBell\n"); diff --git a/sys/dev/isa/bha_isa.c b/sys/dev/isa/bha_isa.c index 3b028925345c..f44dca88cd75 100644 --- a/sys/dev/isa/bha_isa.c +++ b/sys/dev/isa/bha_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: bha_isa.c,v 1.30 2007/10/19 12:00:15 ad Exp $ */ +/* $NetBSD: bha_isa.c,v 1.31 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bha_isa.c,v 1.30 2007/10/19 12:00:15 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bha_isa.c,v 1.31 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -139,7 +139,7 @@ bha_isa_attach(struct device *parent, struct device *self, printf("\n"); if (bus_space_map(iot, ia->ia_io[0].ir_addr, BHA_ISA_IOSIZE, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } @@ -147,15 +147,14 @@ bha_isa_attach(struct device *parent, struct device *self, sc->sc_ioh = ioh; sc->sc_dmat = ia->ia_dmat; if (!bha_probe_inquiry(iot, ioh, &bpd)) { - printf("%s: bha_isa_attach failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "bha_isa_attach failed\n"); return; } sc->sc_dmaflags = 0; if (bpd.sc_drq != -1) { if ((error = isa_dmacascade(ic, bpd.sc_drq)) != 0) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, " unable to cascade DRQ, error = %d\n", error); return; } } else { @@ -168,7 +167,7 @@ bha_isa_attach(struct device *parent, struct device *self, (void) bha_info(sc); if (strcmp(sc->sc_firmware, "3.37") < 0) printf("%s: buggy VLB controller, disabling 32-bit DMA\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); else sc->sc_dmaflags = ISABUS_DMA_32BIT; } @@ -176,8 +175,7 @@ bha_isa_attach(struct device *parent, struct device *self, sc->sc_ih = isa_intr_establish(ic, bpd.sc_irq, IST_EDGE, IPL_BIO, bha_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } diff --git a/sys/dev/isa/boca.c b/sys/dev/isa/boca.c index 49e298772d2b..d72942ab37a0 100644 --- a/sys/dev/isa/boca.c +++ b/sys/dev/isa/boca.c @@ -1,4 +1,4 @@ -/* $NetBSD: boca.c,v 1.49 2007/10/19 12:00:15 ad Exp $ */ +/* $NetBSD: boca.c,v 1.50 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.49 2007/10/19 12:00:15 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: boca.c,v 1.50 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -166,8 +166,7 @@ bocaattach(struct device *parent, struct device *self, void *aux) if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) && bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_slaveioh[i])) { - printf("%s: can't map i/o space for slave %d\n", - sc->sc_dev.dv_xname, i); + aprint_error_dev(&sc->sc_dev, "can't map i/o space for slave %d\n", i); return; } } @@ -209,7 +208,7 @@ bocaintr(arg) if (bits & (1 << (n))) { \ if (comintr(sc->sc_slaves[n]) == 0) { \ printf("%s: bogus intr for port %d\n", \ - sc->sc_dev.dv_xname, n); \ + device_xname(&sc->sc_dev), n); \ } \ } TRY(0); diff --git a/sys/dev/isa/cec.c b/sys/dev/isa/cec.c index 24e86814bb36..21340132a0e1 100644 --- a/sys/dev/isa/cec.c +++ b/sys/dev/isa/cec.c @@ -1,4 +1,4 @@ -/* $NetBSD: cec.c,v 1.7 2007/10/19 12:00:15 ad Exp $ */ +/* $NetBSD: cec.c,v 1.8 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cec.c,v 1.7 2007/10/19 12:00:15 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cec.c,v 1.8 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -199,7 +199,7 @@ cecattach(struct device *parent, struct device *self, void *aux) if (bus_space_map(sc->sc_iot, ia->ia_io[0].ir_addr, CEC_IOSIZE, 0, &sc->sc_ioh) != 0) { - printf("%s: unable to map I/O space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to map I/O space\n"); return; } @@ -211,8 +211,8 @@ cecattach(struct device *parent, struct device *self, void *aux) maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_drq); if (isa_dmamap_create(sc->sc_ic, sc->sc_drq, maxsize, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW)) { - printf("%s: unable to create map for drq %d\n", - sc->sc_dev.dv_xname, sc->sc_drq); + aprint_error_dev(&sc->sc_dev, "unable to create map for drq %d\n", + sc->sc_drq); sc->sc_flags &= ~CECF_USEDMA; } } @@ -225,8 +225,7 @@ cecattach(struct device *parent, struct device *self, void *aux) sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_BIO, cecintr, sc); if (sc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } @@ -706,7 +705,7 @@ cectimeout(void *v) bus_space_write_1(iot, ioh, NEC7210_AUXMR, AUXCMD_TCA); sc->sc_flags &= ~(CECF_IO | CECF_READ | CECF_TIMO); isa_dmaabort(sc->sc_ic, sc->sc_drq); - printf("%s: %s timeout\n", sc->sc_dev.dv_xname, + aprint_error_dev(&sc->sc_dev, "%s timeout\n", sc->sc_flags & CECF_READ ? "read" : "write"); gpibintr(sc->sc_gpib); } diff --git a/sys/dev/isa/cs89x0isa.c b/sys/dev/isa/cs89x0isa.c index 73aa53116b69..f59af751e915 100644 --- a/sys/dev/isa/cs89x0isa.c +++ b/sys/dev/isa/cs89x0isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: cs89x0isa.c,v 1.13 2007/10/19 12:00:15 ad Exp $ */ +/* $NetBSD: cs89x0isa.c,v 1.14 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright 1997 @@ -36,7 +36,7 @@ /* isa DMA routines for cs89x0 */ #include -__KERNEL_RCSID(0, "$NetBSD: cs89x0isa.c,v 1.13 2007/10/19 12:00:15 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cs89x0isa.c,v 1.14 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -73,10 +73,10 @@ cs_isa_dma_attach(struct cs_softc *sc) if (isc->sc_drq == ISA_UNKNOWN_DRQ) printf("%s: DMA channel unspecified, not using DMA\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); else if (isc->sc_drq < 5 || isc->sc_drq > 7) printf("%s: invalid DMA channel, not using DMA\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); else { bus_size_t maxsize; bus_addr_t dma_addr; @@ -84,34 +84,31 @@ cs_isa_dma_attach(struct cs_softc *sc) maxsize = isa_dmamaxsize(isc->sc_ic, isc->sc_drq); if (maxsize < CS8900_DMASIZE) { printf("%s: max DMA size %lu is less than required %d\n", - sc->sc_dev.dv_xname, (u_long)maxsize, + device_xname(&sc->sc_dev), (u_long)maxsize, CS8900_DMASIZE); goto after_dma_block; } if (isa_drq_alloc(isc->sc_ic, isc->sc_drq) != 0) { - printf("%s: unable to reserve drq %d\n", - sc->sc_dev.dv_xname, isc->sc_drq); + aprint_error_dev(&sc->sc_dev, "unable to reserve drq %d\n", + isc->sc_drq); goto after_dma_block; } if (isa_dmamap_create(isc->sc_ic, isc->sc_drq, CS8900_DMASIZE, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW) != 0) { - printf("%s: unable to create ISA DMA map\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to create ISA DMA map\n"); goto after_dma_block; } if (isa_dmamem_alloc(isc->sc_ic, isc->sc_drq, CS8900_DMASIZE, &dma_addr, BUS_DMA_NOWAIT) != 0) { - printf("%s: unable to allocate DMA buffer\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to allocate DMA buffer\n"); goto after_dma_block; } if (isa_dmamem_map(isc->sc_ic, isc->sc_drq, dma_addr, CS8900_DMASIZE, (void **)&isc->sc_dmabase, BUS_DMA_NOWAIT | BUS_DMA_COHERENT /* XXX */ ) != 0) { - printf("%s: unable to map DMA buffer\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to map DMA buffer\n"); isa_dmamem_free(isc->sc_ic, isc->sc_drq, dma_addr, CS8900_DMASIZE); goto after_dma_block; @@ -139,7 +136,7 @@ void cs_isa_dma_chipinit(struct cs_softc *sc) isc->sc_dmasize, NULL, DMAMODE_READ | DMAMODE_LOOPDEMAND, BUS_DMA_NOWAIT)) { /* XXX XXX XXX */ - panic("%s: unable to start DMA", sc->sc_dev.dv_xname); + panic("%s: unable to start DMA", device_xname(&sc->sc_dev)); } isc->sc_dmacur = isc->sc_dmabase; @@ -226,7 +223,7 @@ void cs_process_rx_dma(struct cs_softc *sc) * the DMA operation. */ printf("%s: cs_process_rx_dma: DMA buffer out of sync about to reset\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); ifp->if_ierrors++; /* skip the rest of the DMA buffer */ @@ -242,7 +239,7 @@ void cs_process_rx_dma(struct cs_softc *sc) MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == 0) { printf("%s: cs_process_rx_dma: unable to allocate mbuf\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); ifp->if_ierrors++; /* * couldn't allocate an mbuf so @@ -270,7 +267,7 @@ void cs_process_rx_dma(struct cs_softc *sc) if ((m->m_flags & M_EXT) == 0) { /* couldn't allocate an mbuf cluster */ printf("%s: cs_process_rx_dma: unable to allocate a cluster\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); m_freem(m); /* skip the frame */ diff --git a/sys/dev/isa/esp_isa.c b/sys/dev/isa/esp_isa.c index 8140b1c0b09e..f04b34baaee8 100644 --- a/sys/dev/isa/esp_isa.c +++ b/sys/dev/isa/esp_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: esp_isa.c,v 1.33 2007/10/19 12:00:16 ad Exp $ */ +/* $NetBSD: esp_isa.c,v 1.34 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -113,7 +113,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: esp_isa.c,v 1.33 2007/10/19 12:00:16 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: esp_isa.c,v 1.34 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -301,7 +301,7 @@ esp_isa_init(esc, epd) { #ifdef DIAGNOSTIC printf("%s: sync requested, but not supported; will do async\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); #endif epd->sc_sync = 0; } @@ -389,19 +389,19 @@ esp_isa_attach(parent, self, aux) ESP_TRACE(("[esp_isa_attach] ")); if (bus_space_map(iot, ia->ia_io[0].ir_addr, ESP_ISA_IOSIZE, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } if (!esp_isa_find(iot, ioh, &epd)) { - printf("%s: esp_isa_find failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "esp_isa_find failed\n"); return; } if (ia->ia_drq[0].ir_drq != ISA_UNKNOWN_DRQ) { if ((error = isa_dmacascade(ic, ia->ia_drq[0].ir_drq)) != 0) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "unable to cascade DRQ, error = %d\n", + error); return; } } @@ -409,8 +409,7 @@ esp_isa_attach(parent, self, aux) esc->sc_ih = isa_intr_establish(ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_BIO, ncr53c9x_intr, esc); if (esc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } @@ -418,9 +417,9 @@ esp_isa_attach(parent, self, aux) esc->sc_iot = iot; esp_isa_init(esc, &epd); - printf("%s:%ssync,%sparity\n", sc->sc_dev.dv_xname, + printf("%s:%ssync,%sparity\n", device_xname(&sc->sc_dev), epd.sc_sync ? " " : " no ", epd.sc_parity ? " " : " no "); - printf("%s", sc->sc_dev.dv_xname); + printf("%s", device_xname(&sc->sc_dev)); /* * Now try to attach all the sub-devices @@ -503,7 +502,7 @@ esp_isa_dma_intr(sc) ESP_TRACE(("[esp_isa_dma_intr] ")); if (esc->sc_active == 0) { - printf("%s: dma_intr--inactive DMA\n", sc->sc_dev.dv_xname); + printf("%s: dma_intr--inactive DMA\n", device_xname(&sc->sc_dev)); return -1; } @@ -515,7 +514,7 @@ esp_isa_dma_intr(sc) cnt = *esc->sc_pdmalen; if (*esc->sc_pdmalen == 0) { printf("%s: data interrupt, but no count left\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); } p = *esc->sc_dmaaddr; diff --git a/sys/dev/isa/ess.c b/sys/dev/isa/ess.c index 9c8d42c4fe75..01287fe8bb5d 100644 --- a/sys/dev/isa/ess.c +++ b/sys/dev/isa/ess.c @@ -1,4 +1,4 @@ -/* $NetBSD: ess.c,v 1.75 2007/10/19 12:00:16 ad Exp $ */ +/* $NetBSD: ess.c,v 1.76 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright 1997 @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ess.c,v 1.75 2007/10/19 12:00:16 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess.c,v 1.76 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -931,21 +931,21 @@ essattach(struct ess_softc *sc, int enablejoy) sc->sc_audio1.irq, sc->sc_audio1.ist, IPL_AUDIO, ess_audio1_intr, sc); printf("%s: audio1 interrupting at irq %d\n", - sc->sc_dev.dv_xname, sc->sc_audio1.irq); + device_xname(&sc->sc_dev), sc->sc_audio1.irq); } else - printf("%s: audio1 polled\n", sc->sc_dev.dv_xname); + printf("%s: audio1 polled\n", device_xname(&sc->sc_dev)); sc->sc_audio1.maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_audio1.drq); if (isa_drq_alloc(sc->sc_ic, sc->sc_audio1.drq) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->sc_audio1.drq); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->sc_audio1.drq); return; } if (isa_dmamap_create(sc->sc_ic, sc->sc_audio1.drq, sc->sc_audio1.maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, sc->sc_audio1.drq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + sc->sc_audio1.drq); return; } @@ -956,22 +956,22 @@ essattach(struct ess_softc *sc, int enablejoy) sc->sc_audio2.irq, sc->sc_audio2.ist, IPL_AUDIO, ess_audio2_intr, sc); printf("%s: audio2 interrupting at irq %d\n", - sc->sc_dev.dv_xname, sc->sc_audio2.irq); + device_xname(&sc->sc_dev), sc->sc_audio2.irq); } else - printf("%s: audio2 polled\n", sc->sc_dev.dv_xname); + printf("%s: audio2 polled\n", device_xname(&sc->sc_dev)); sc->sc_audio2.maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_audio2.drq); if (isa_drq_alloc(sc->sc_ic, sc->sc_audio2.drq) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->sc_audio2.drq); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->sc_audio2.drq); return; } if (isa_dmamap_create(sc->sc_ic, sc->sc_audio2.drq, sc->sc_audio2.maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, sc->sc_audio2.drq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + sc->sc_audio2.drq); return; } } diff --git a/sys/dev/isa/ess_isa.c b/sys/dev/isa/ess_isa.c index 1fc6c42e4f60..8e7b69d0d400 100644 --- a/sys/dev/isa/ess_isa.c +++ b/sys/dev/isa/ess_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: ess_isa.c,v 1.19 2007/10/19 12:00:16 ad Exp $ */ +/* $NetBSD: ess_isa.c,v 1.20 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ess_isa.c,v 1.19 2007/10/19 12:00:16 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess_isa.c,v 1.20 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -164,7 +164,7 @@ ess_isa_attach(struct device *parent, struct device *self, void *aux) } #endif - printf("%s", sc->sc_dev.dv_xname); + printf("%s", device_xname(&sc->sc_dev)); essattach(sc, enablejoy); } diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c index fbd3b8a0ef51..e6ea959d83f4 100644 --- a/sys/dev/isa/gus.c +++ b/sys/dev/isa/gus.c @@ -1,4 +1,4 @@ -/* $NetBSD: gus.c,v 1.100 2007/10/19 12:00:16 ad Exp $ */ +/* $NetBSD: gus.c,v 1.101 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1996, 1999 The NetBSD Foundation, Inc. @@ -95,7 +95,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.100 2007/10/19 12:00:16 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gus.c,v 1.101 2008/04/08 20:08:49 cegger Exp $"); #include "gus.h" #if NGUS > 0 @@ -842,20 +842,20 @@ gusattach(struct device *parent, struct device *self, void *aux) /* Map i/o space */ if (bus_space_map(iot, iobase, GUS_NPORT1, 0, &ioh1)) - panic("%s: can't map io port range 1", self->dv_xname); + panic("%s: can't map io port range 1", device_xname(self)); sc->sc_ioh1 = ioh1; if (bus_space_map(iot, iobase+GUS_IOH2_OFFSET, GUS_NPORT2, 0, &ioh2)) - panic("%s: can't map io port range 2", self->dv_xname); + panic("%s: can't map io port range 2", device_xname(self)); sc->sc_ioh2 = ioh2; /* XXX Maybe we shouldn't fail on mapping this, but just assume * the card is of revision 0? */ if (bus_space_map(iot, iobase+GUS_IOH3_OFFSET, GUS_NPORT3, 0, &ioh3)) - panic("%s: can't map io port range 3", self->dv_xname); + panic("%s: can't map io port range 3", device_xname(self)); sc->sc_ioh3 = ioh3; if (bus_space_map(iot, iobase+GUS_IOH4_OFFSET, GUS_NPORT4, 0, &ioh4)) - panic("%s: can't map io port range 4", self->dv_xname); + panic("%s: can't map io port range 4", device_xname(self)); sc->sc_ioh4 = ioh4; sc->sc_iobase = iobase; @@ -906,7 +906,7 @@ gusattach(struct device *parent, struct device *self, void *aux) } if (d == -1) printf("%s: WARNING: Cannot initialize drq\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); /* * Program the IRQ and DMA channels on the GUS. Note that we hardwire @@ -953,14 +953,14 @@ gusattach(struct device *parent, struct device *self, void *aux) sc->sc_play_maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_playdrq); if (isa_drq_alloc(sc->sc_ic, sc->sc_playdrq) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->sc_playdrq); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->sc_playdrq); return; } if (isa_dmamap_create(sc->sc_ic, sc->sc_playdrq, sc->sc_play_maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, sc->sc_playdrq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + sc->sc_playdrq); return; } } @@ -968,14 +968,14 @@ gusattach(struct device *parent, struct device *self, void *aux) sc->sc_req_maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_recdrq); if (isa_drq_alloc(sc->sc_ic, sc->sc_recdrq) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->sc_recdrq); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->sc_recdrq); return; } if (isa_dmamap_create(sc->sc_ic, sc->sc_recdrq, sc->sc_req_maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, sc->sc_recdrq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + sc->sc_recdrq); return; } } @@ -1027,7 +1027,7 @@ gusattach(struct device *parent, struct device *self, void *aux) snprintf(gus_device.version, sizeof(gus_device.version), "%d", sc->sc_revision); - printf("\n%s: Gravis UltraSound", sc->sc_dev.dv_xname); + printf("\n%s: Gravis UltraSound", device_xname(&sc->sc_dev)); if (sc->sc_revision >= 10) printf(" MAX"); else { @@ -1041,7 +1041,7 @@ gusattach(struct device *parent, struct device *self, void *aux) /* A GUS MAX should always have a CODEC installed */ if ((sc->sc_revision >= 10) & !(HAS_CODEC(sc))) printf("%s: WARNING: did not attach CODEC on MAX\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); /* * Setup a default interrupt handler @@ -1472,7 +1472,7 @@ gus_dmaout_timeout(void *arg) sc = arg; iot = sc->sc_iot; ioh2 = sc->sc_ioh2; - printf("%s: dmaout timeout\n", sc->sc_dev.dv_xname); + printf("%s: dmaout timeout\n", device_xname(&sc->sc_dev)); /* * Stop any DMA. */ @@ -1586,7 +1586,7 @@ gus_dmaout_dointr(struct gus_softc *sc) if (sc->sc_voc[GUS_VOICE_LEFT].voccntl & GUSMASK_VOICE_STOPPED) { if (sc->sc_flags & GUS_PLAYING) { - printf("%s: playing yet stopped?\n", sc->sc_dev.dv_xname); + printf("%s: playing yet stopped?\n", device_xname(&sc->sc_dev)); } sc->sc_bufcnt++; /* another yet to be played */ gus_start_playing(sc, sc->sc_dmabuf); @@ -1733,7 +1733,7 @@ gus_voice_intr(struct gus_softc *sc) if (status & GUSMASK_VOICE_STOPPED) { if (voice != GUS_VOICE_LEFT) { DMAPRINTF(("%s: spurious voice %d stop?\n", - sc->sc_dev.dv_xname, voice)); + device_xname(&sc->sc_dev), voice)); gus_stop_voice(sc, voice, 0); continue; } @@ -1749,14 +1749,14 @@ gus_voice_intr(struct gus_softc *sc) * in place. Start the voice again. */ printf("%s: stopped voice not drained? (%x)\n", - sc->sc_dev.dv_xname, sc->sc_bufcnt); + device_xname(&sc->sc_dev), sc->sc_bufcnt); gus_falsestops++; sc->sc_playbuf = ++sc->sc_playbuf % sc->sc_nbufs; gus_start_playing(sc, sc->sc_playbuf); } else if (sc->sc_bufcnt < 0) { panic("%s: negative bufcnt in stopped voice", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); } else { sc->sc_playbuf = -1; /* none are active */ gus_stops++; @@ -1936,7 +1936,7 @@ gus_continue_playing(struct gus_softc *sc, int voice) DPRINTF(("gus: bufcnt 0 on continuing voice?\n")); } if (sc->sc_playbuf == sc->sc_dmabuf && (sc->sc_flags & GUS_LOCKED)) { - printf("%s: continue into active dmabuf?\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "continue into active dmabuf?\n"); return 1; } diff --git a/sys/dev/isa/i82365_isasubr.c b/sys/dev/isa/i82365_isasubr.c index 344d34017f83..e5dbc6ab9c62 100644 --- a/sys/dev/isa/i82365_isasubr.c +++ b/sys/dev/isa/i82365_isasubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82365_isasubr.c,v 1.39 2007/10/19 12:00:17 ad Exp $ */ +/* $NetBSD: i82365_isasubr.c,v 1.40 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright (c) 2000 Christian E. Hopps. All rights reserved. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i82365_isasubr.c,v 1.39 2007/10/19 12:00:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82365_isasubr.c,v 1.40 2008/04/08 20:08:49 cegger Exp $"); #define PCICISADEBUG @@ -189,7 +189,7 @@ pcic_isa_probe_interrupts(sc, h) ic = isc->sc_ic; printf("%s: controller %d detecting irqs with mask 0x%04x:", - sc->dev.dv_xname, h->chip, sc->intr_mask[h->chip]); + device_xname(&sc->dev), h->chip, sc->intr_mask[h->chip]); DPRINTF(("\n")); /* clear any current interrupt */ @@ -332,18 +332,17 @@ pcic_isa_config_interrupts(self) if ((chipmask & (1 << sc->irq)) == 0) printf("%s: warning: configured irq %d not " "detected as available\n", - sc->dev.dv_xname, sc->irq); + device_xname(&sc->dev), sc->irq); } else if (chipmask == 0 || isa_intr_alloc(ic, chipmask, IST_EDGE, &sc->irq)) { - printf("%s: no available irq; ", sc->dev.dv_xname); + aprint_error_dev(&sc->dev, "no available irq; "); sc->irq = ISA_UNKNOWN_IRQ; } else if ((chipmask & ~(1 << sc->irq)) == 0 && chipuniq == 0) { - printf("%s: can't share irq with cards; ", - sc->dev.dv_xname); + aprint_error_dev(&sc->dev, "can't share irq with cards; "); sc->irq = ISA_UNKNOWN_IRQ; } } else { - printf("%s: ", sc->dev.dv_xname); + printf("%s: ", device_xname(&sc->dev)); sc->irq = ISA_UNKNOWN_IRQ; } @@ -351,15 +350,14 @@ pcic_isa_config_interrupts(self) sc->ih = isa_intr_establish(ic, sc->irq, IST_EDGE, IPL_TTY, pcic_intr, sc); if (sc->ih == NULL) { - printf("%s: can't establish interrupt", - sc->dev.dv_xname); + aprint_error_dev(&sc->dev, "can't establish interrupt"); sc->irq = ISA_UNKNOWN_IRQ; } } if (sc->irq == ISA_UNKNOWN_IRQ) printf("polling for socket events\n"); else - printf("%s: using irq %d for socket events\n", sc->dev.dv_xname, + printf("%s: using irq %d for socket events\n", device_xname(&sc->dev), sc->irq); pcic_attach_sockets_finish(sc); @@ -397,7 +395,7 @@ void pcic_isa_bus_width_probe (sc, iot, ioh, base, length) /* Map i/o space. */ if (bus_space_map(iot, base + 0x400, length, 0, &ioh_high)) { - printf("%s: can't map high i/o space\n", sc->dev.dv_xname); + aprint_error_dev(&sc->dev, "can't map high i/o space\n"); return; } @@ -442,7 +440,7 @@ void pcic_isa_bus_width_probe (sc, iot, ioh, base, length) } DPRINTF(("%s: bus_space_alloc range 0x%04lx-0x%04lx (probed)\n", - sc->dev.dv_xname, (long) sc->iobase, + device_xname(&sc->dev), (long) sc->iobase, (long) sc->iobase + sc->iosize)); @@ -451,7 +449,7 @@ void pcic_isa_bus_width_probe (sc, iot, ioh, base, length) sc->iosize = pcic_isa_alloc_iosize; DPRINTF(("%s: bus_space_alloc range 0x%04lx-0x%04lx " - "(config override)\n", sc->dev.dv_xname, (long) sc->iobase, + "(config override)\n", device_xname(&sc->dev), (long) sc->iobase, (long) sc->iobase + sc->iosize)); } } @@ -502,7 +500,7 @@ pcic_isa_chip_intr_establish(pch, pf, ipl, fct, arg) if ((ih = isa_intr_establish(ic, irq, ist, ipl, fct, arg)) == NULL) return (NULL); - printf("%s: card irq %d\n", h->pcmcia->dv_xname, irq); + printf("%s: card irq %d\n", device_xname(h->pcmcia), irq); return (ih); } diff --git a/sys/dev/isa/if_ai.c b/sys/dev/isa/if_ai.c index 4db8a69790f3..e040bfbb18af 100644 --- a/sys/dev/isa/if_ai.c +++ b/sys/dev/isa/if_ai.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ai.c,v 1.26 2007/10/19 12:00:17 ad Exp $ */ +/* $NetBSD: if_ai.c,v 1.27 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ai.c,v 1.26 2007/10/19 12:00:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ai.c,v 1.27 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -340,7 +340,7 @@ ai_attach(struct device *parent, struct device *self, void *aux) if (bus_space_map(ia->ia_iot, ia->ia_io[0].ir_addr, ia->ia_io[0].ir_size, 0, &ioh) != 0) { DPRINTF(("\n%s: can't map i/o space 0x%x-0x%x\n", - sc->sc_dev.dv_xname, + device_xname(&sc->sc_dev), ia->ia_io[0].ir_addr, ia->ia_io[0].ir_addr + ia->ia_io[0].ir_size - 1)); return; @@ -349,7 +349,7 @@ ai_attach(struct device *parent, struct device *self, void *aux) if (bus_space_map(ia->ia_memt, ia->ia_iomem[0].ir_addr, ia->ia_iomem[0].ir_size, 0, &memh) != 0) { DPRINTF(("\n%s: can't map iomem space 0x%x-0x%x\n", - sc->sc_dev.dv_xname, + device_xname(&sc->sc_dev), ia->ia_iomem[0].ir_addr, ia->ia_iomem[0].ir_addr + ia->ia_iomem[0].ir_size - 1)); bus_space_unmap(ia->ia_iot, ioh, ia->ia_io[0].ir_size); @@ -410,7 +410,7 @@ ai_attach(struct device *parent, struct device *self, void *aux) BUS_SPACE_BARRIER_WRITE); if (!i82586_proberam(sc)) { DPRINTF(("\n%s: can't talk to i82586!\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); bus_space_unmap(ia->ia_iot, ioh, ia->ia_io[0].ir_size); bus_space_unmap(ia->ia_memt, memh, ia->ia_iomem[0].ir_size); return; @@ -428,7 +428,7 @@ ai_attach(struct device *parent, struct device *self, void *aux) IST_EDGE, IPL_NET, i82586_intr, sc); if (asc->sc_ih == NULL) { DPRINTF(("\n%s: can't establish interrupt\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); } } diff --git a/sys/dev/isa/if_ate.c b/sys/dev/isa/if_ate.c index 85fc576a0843..e8d1fd9e4823 100644 --- a/sys/dev/isa/if_ate.c +++ b/sys/dev/isa/if_ate.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ate.c,v 1.48 2007/10/19 12:00:17 ad Exp $ */ +/* $NetBSD: if_ate.c,v 1.49 2008/04/08 20:08:49 cegger Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ate.c,v 1.48 2007/10/19 12:00:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ate.c,v 1.49 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -406,6 +406,5 @@ ate_attach(struct device *parent, struct device *self, void *aux) isc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NET, mb86960_intr, sc); if (isc->sc_ih == NULL) - printf("%s: couldn't establish interrupt handler\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt handler\n"); } diff --git a/sys/dev/isa/if_cs_isa.c b/sys/dev/isa/if_cs_isa.c index 10d077933a68..548f248ca29d 100644 --- a/sys/dev/isa/if_cs_isa.c +++ b/sys/dev/isa/if_cs_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cs_isa.c,v 1.19 2007/10/19 12:00:17 ad Exp $ */ +/* $NetBSD: if_cs_isa.c,v 1.20 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright 1997 @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cs_isa.c,v 1.19 2007/10/19 12:00:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cs_isa.c,v 1.20 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -238,7 +238,7 @@ cs_isa_attach(struct device *parent, struct device *self, void *aux) */ if (bus_space_map(sc->sc_iot, ia->ia_io[0].ir_addr, CS8900_IOSIZE, 0, &sc->sc_ioh)) { - printf("%s: unable to map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to map i/o space\n"); return; } @@ -246,7 +246,7 @@ cs_isa_attach(struct device *parent, struct device *self, void *aux) * Validate IRQ. */ if (CS8900_IRQ_ISVALID(sc->sc_irq) == 0) { - printf("%s: invalid IRQ %d\n", sc->sc_dev.dv_xname, sc->sc_irq); + aprint_error_dev(&sc->sc_dev, "invalid IRQ %d\n", sc->sc_irq); return; } @@ -260,8 +260,7 @@ cs_isa_attach(struct device *parent, struct device *self, void *aux) CS8900_MEMBASE_ISVALID(ia->ia_iomem[0].ir_addr)) { if (bus_space_map(sc->sc_memt, ia->ia_iomem[0].ir_addr, CS8900_MEMSIZE, 0, &sc->sc_memh)) { - printf("%s: unable to map memory space\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to map memory space\n"); } else { sc->sc_cfgflags |= CFGFLG_MEM_MODE; sc->sc_pktpgaddr = ia->ia_iomem[0].ir_addr; @@ -271,8 +270,7 @@ cs_isa_attach(struct device *parent, struct device *self, void *aux) sc->sc_ih = isa_intr_establish(ia->ia_ic, sc->sc_irq, IST_EDGE, IPL_NET, cs_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: unable to establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to establish interrupt\n"); return; } diff --git a/sys/dev/isa/if_ef.c b/sys/dev/isa/if_ef.c index 435b9b9270a3..fcbc79d2652f 100644 --- a/sys/dev/isa/if_ef.c +++ b/sys/dev/isa/if_ef.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ef.c,v 1.24 2007/10/19 12:00:17 ad Exp $ */ +/* $NetBSD: if_ef.c,v 1.25 2008/04/08 20:08:49 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.24 2007/10/19 12:00:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ef.c,v 1.25 2008/04/08 20:08:49 cegger Exp $"); #include #include @@ -386,7 +386,7 @@ ef_match(struct device *parent, struct cfdata *cf, void *aux) malloc(sizeof(struct ef_isabus), M_DEVBUF, M_NOWAIT); if (bus == NULL) panic("ef_isa_probe: can't allocate state storage for %s", - parent->dv_xname); + device_xname(parent)); bus->bus_state = 0; /* nothing done yet */ bus->isa_bus = parent; @@ -550,14 +550,14 @@ ef_attach(parent, self, aux) } if (bus == NULL) - panic("%s: Can't find parent bus!", sc->sc_dev.dv_xname); + panic("%s: Can't find parent bus!", device_xname(&sc->sc_dev)); /* If the bus hasn't been transitioned to the RUN state, do so now */ if (bus->bus_state == 1) { if (bus_space_map(iot, ELINK_ID_PORT, 1, 0, &ioh) != 0) { DPRINTF(("\n%s: Can't map Elink ID port!\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); return; } @@ -574,7 +574,7 @@ ef_attach(parent, self, aux) ia->ia_io[0].ir_size, 0, &ioh) != 0) { DPRINTF(("\n%s: can't map i/o space 0x%x-0x%x\n", - sc->sc_dev.dv_xname, ia->ia_io[0].ir_addr, + device_xname(&sc->sc_dev), ia->ia_io[0].ir_addr, ia->ia_io[0].ir_addr + ia->ia_io[0].ir_size - 1)); return; } @@ -586,7 +586,7 @@ ef_attach(parent, self, aux) ia->ia_iomem[0].ir_size, 0, &memh) != 0) { DPRINTF(("\n%s: can't map iomem space 0x%x-0x%x\n", - sc->sc_dev.dv_xname, ia->ia_maddr, + device_xname(&sc->sc_dev), ia->ia_maddr, ia->ia_maddr + ia->ia_msize - 1)); bus_space_unmap(ia->ia_iot, ioh, ia->ia_io[0].ir_size); return; @@ -624,7 +624,7 @@ ef_attach(parent, self, aux) BUS_SPACE_BARRIER_WRITE); if (!i82586_proberam(sc)) { DPRINTF(("\n%s: can't talk to i82586!\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); bus_space_unmap(ia->ia_iot, ioh, ia->ia_io[0].ir_size); bus_space_unmap(ia->ia_memt, memh, ia->ia_iomem[0].ir_size); return; @@ -676,7 +676,7 @@ ef_attach(parent, self, aux) IST_EDGE, IPL_NET, i82586_intr, sc); if (esc->sc_ih == NULL) { DPRINTF(("\n%s: can't establish interrupt\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); } } diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c index edfc28499e5f..60ff5f48a67c 100644 --- a/sys/dev/isa/if_eg.c +++ b/sys/dev/isa/if_eg.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_eg.c,v 1.75 2008/03/30 15:27:24 ad Exp $ */ +/* $NetBSD: if_eg.c,v 1.76 2008/04/08 20:08:49 cegger Exp $ */ /* * Copyright (c) 1993 Dean Huxley @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.75 2008/03/30 15:27:24 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.76 2008/04/08 20:08:49 cegger Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -412,7 +412,7 @@ egattach(struct device *parent, struct device *self, void *aux) /* Map i/o space. */ if (bus_space_map(iot, ia->ia_io[0].ir_addr, 0x08, 0, &ioh)) { - printf("%s: can't map i/o space\n", self->dv_xname); + aprint_error_dev(self, "can't map i/o space\n"); return; } @@ -422,19 +422,19 @@ egattach(struct device *parent, struct device *self, void *aux) sc->eg_pcb[0] = EG_CMD_GETINFO; /* Get Adapter Info */ sc->eg_pcb[1] = 0; if (egwritePCB(iot, ioh, sc->eg_pcb) != 0) { - printf("%s: error requesting adapter info\n", self->dv_xname); + aprint_error_dev(self, "error requesting adapter info\n"); return; } if (egreadPCB(iot, ioh, sc->eg_pcb) != 0) { egprintpcb(sc->eg_pcb); - printf("%s: error reading adapter info\n", self->dv_xname); + aprint_error_dev(self, "error reading adapter info\n"); return; } if (sc->eg_pcb[0] != EG_RSP_GETINFO || /* Get Adapter Info Response */ sc->eg_pcb[1] != 0x0a) { egprintpcb(sc->eg_pcb); - printf("%s: bogus adapter info\n", self->dv_xname); + aprint_error_dev(self, "bogus adapter info\n"); return; } @@ -447,49 +447,46 @@ egattach(struct device *parent, struct device *self, void *aux) sc->eg_pcb[0] = EG_CMD_GETEADDR; /* Get Station address */ sc->eg_pcb[1] = 0; if (egwritePCB(iot, ioh, sc->eg_pcb) != 0) { - printf("%s: can't send Get Station Address\n", self->dv_xname); + aprint_error_dev(self, "can't send Get Station Address\n"); return; } if (egreadPCB(iot, ioh, sc->eg_pcb) != 0) { - printf("%s: can't read station address\n", self->dv_xname); + aprint_error_dev(self, "can't read station address\n"); egprintpcb(sc->eg_pcb); return; } /* check Get station address response */ if (sc->eg_pcb[0] != EG_RSP_GETEADDR || sc->eg_pcb[1] != 0x06) { - printf("%s: card responded with garbage (1)\n", - self->dv_xname); + aprint_error_dev(self, "card responded with garbage (1)\n"); egprintpcb(sc->eg_pcb); return; } memcpy(myaddr, &sc->eg_pcb[2], ETHER_ADDR_LEN); - printf("%s: ROM v%d.%02d %dk address %s\n", self->dv_xname, + printf("%s: ROM v%d.%02d %dk address %s\n", device_xname(self), sc->eg_rom_major, sc->eg_rom_minor, sc->eg_ram, ether_sprintf(myaddr)); sc->eg_pcb[0] = EG_CMD_SETEADDR; /* Set station address */ if (egwritePCB(iot, ioh, sc->eg_pcb) != 0) { - printf("%s: can't send Set Station Address\n", self->dv_xname); + printf("%s: can't send Set Station Address\n", device_xname(self)); return; } if (egreadPCB(iot, ioh, sc->eg_pcb) != 0) { - printf("%s: can't read Set Station Address status\n", - self->dv_xname); + aprint_error_dev(self, "can't read Set Station Address status\n"); egprintpcb(sc->eg_pcb); return; } if (sc->eg_pcb[0] != EG_RSP_SETEADDR || sc->eg_pcb[1] != 0x02 || sc->eg_pcb[2] != 0 || sc->eg_pcb[3] != 0) { - printf("%s: card responded with garbage (2)\n", - self->dv_xname); + aprint_error_dev(self, "card responded with garbage (2)\n"); egprintpcb(sc->eg_pcb); return; } /* Initialize ifnet structure. */ - strcpy(ifp->if_xname, sc->sc_dev.dv_xname); + strlcpy(ifp->if_xname, device_xname(&sc->sc_dev), IFNAMSIZ); ifp->if_softc = sc; ifp->if_start = egstart; ifp->if_ioctl = egioctl; @@ -505,7 +502,7 @@ egattach(struct device *parent, struct device *self, void *aux) IST_EDGE, IPL_NET, egintr, sc); #if NRND > 0 - rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, + rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dev), RND_TYPE_NET, 0); #endif } @@ -531,22 +528,18 @@ eginit(sc) sc->eg_pcb[2] = 3; /* receive broadcast & multicast */ sc->eg_pcb[3] = 0; if (egwritePCB(iot, ioh, sc->eg_pcb) != 0) - printf("%s: can't send Configure 82586\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't send Configure 82586\n"); if (egreadPCB(iot, ioh, sc->eg_pcb) != 0) { - printf("%s: can't read Configure 82586 status\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't read Configure 82586 status\n"); egprintpcb(sc->eg_pcb); } else if (sc->eg_pcb[2] != 0 || sc->eg_pcb[3] != 0) - printf("%s: configure card command failed\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "configure card command failed\n"); if (sc->eg_inbuf == NULL) { sc->eg_inbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT); if (sc->eg_inbuf == NULL) { - printf("%s: can't allocate inbuf\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't allocate inbuf\n"); panic("eginit"); } } @@ -555,8 +548,7 @@ eginit(sc) if (sc->eg_outbuf == NULL) { sc->eg_outbuf = malloc(EG_BUFLEN, M_TEMP, M_NOWAIT); if (sc->eg_outbuf == NULL) { - printf("%s: can't allocate outbuf\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't allocate outbuf\n"); panic("eginit"); } } @@ -622,7 +614,7 @@ loop: /* We need to use m->m_pkthdr.len, so require the header */ if ((m0->m_flags & M_PKTHDR) == 0) { - printf("%s: no header mbuf\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "no header mbuf\n"); panic("egstart"); } len = max(m0->m_pkthdr.len, ETHER_MIN_LEN - ETHER_CRC_LEN); @@ -641,8 +633,7 @@ loop: sc->eg_pcb[6] = len; /* length of packet */ sc->eg_pcb[7] = len >> 8; if (egwritePCB(iot, ioh, sc->eg_pcb) != 0) { - printf("%s: can't send Send Packet command\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't send Send Packet command\n"); ifp->if_oerrors++; ifp->if_flags &= ~IFF_OACTIVE; m_freem(m0); @@ -711,7 +702,7 @@ egintr(arg) case EG_RSP_SENDPACKET: if (sc->eg_pcb[6] || sc->eg_pcb[7]) { DPRINTF(("%s: packet dropped\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); sc->sc_ethercom.ec_if.if_oerrors++; } else sc->sc_ethercom.ec_if.if_opackets++; @@ -725,7 +716,7 @@ egintr(arg) /* XXX byte-order and type-size bugs here... */ case EG_RSP_GETSTATS: DPRINTF(("%s: Card Statistics\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); memcpy(&i, &sc->eg_pcb[2], sizeof(i)); DPRINTF(("Receive Packets %d\n", i)); memcpy(&i, &sc->eg_pcb[6], sizeof(i)); @@ -743,7 +734,7 @@ egintr(arg) default: printf("%s: egintr: Unknown response %x??\n", - sc->sc_dev.dv_xname, sc->eg_pcb[0]); + device_xname(&sc->sc_dev), sc->eg_pcb[0]); egprintpcb(sc->eg_pcb); break; } @@ -770,8 +761,7 @@ egread(sc, buf, len) if (len <= sizeof(struct ether_header) || len > ETHER_MAX_LEN) { - printf("%s: invalid packet size %d; dropping\n", - sc->sc_dev.dv_xname, len); + aprint_error_dev(&sc->sc_dev, "invalid packet size %d; dropping\n", len); ifp->if_ierrors++; return; } @@ -922,7 +912,7 @@ egreset(sc) { int s; - DPRINTF(("%s: egreset()\n", sc->sc_dev.dv_xname)); + DPRINTF(("%s: egreset()\n", device_xname(&sc->sc_dev))); s = splnet(); egstop(sc); eginit(sc); @@ -935,7 +925,7 @@ egwatchdog(ifp) { struct eg_softc *sc = ifp->if_softc; - log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname); + log(LOG_ERR, "%s: device timeout\n", device_xname(&sc->sc_dev)); sc->sc_ethercom.ec_if.if_oerrors++; egreset(sc); diff --git a/sys/dev/isa/if_el.c b/sys/dev/isa/if_el.c index 0885a3bbf524..e5a66d720af8 100644 --- a/sys/dev/isa/if_el.c +++ b/sys/dev/isa/if_el.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_el.c,v 1.79 2007/10/19 12:00:17 ad Exp $ */ +/* $NetBSD: if_el.c,v 1.80 2008/04/08 20:08:50 cegger Exp $ */ /* * Copyright (c) 1994, Matthew E. Kimmel. Permission is hereby granted @@ -19,7 +19,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_el.c,v 1.79 2007/10/19 12:00:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_el.c,v 1.80 2008/04/08 20:08:50 cegger Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -215,11 +215,11 @@ elattach(struct device *parent, struct device *self, void *aux) printf("\n"); - DPRINTF(("Attaching %s...\n", sc->sc_dev.dv_xname)); + DPRINTF(("Attaching %s...\n", device_xname(&sc->sc_dev))); /* Map i/o space. */ if (bus_space_map(iot, ia->ia_io[0].ir_addr, 16, 0, &ioh)) { - printf("%s: can't map i/o space\n", self->dv_xname); + aprint_error_dev(self, "can't map i/o space\n"); return; } @@ -241,7 +241,7 @@ elattach(struct device *parent, struct device *self, void *aux) elstop(sc); /* Initialize ifnet structure. */ - strcpy(ifp->if_xname, sc->sc_dev.dv_xname); + strlcpy(ifp->if_xname, device_xname(&sc->sc_dev), IFNAMSIZ); ifp->if_softc = sc; ifp->if_start = elstart; ifp->if_ioctl = elioctl; @@ -255,14 +255,14 @@ elattach(struct device *parent, struct device *self, void *aux) ether_ifattach(ifp, myaddr); /* Print out some information for the user. */ - printf("%s: address %s\n", self->dv_xname, ether_sprintf(myaddr)); + printf("%s: address %s\n", device_xname(self), ether_sprintf(myaddr)); sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NET, elintr, sc); #if NRND > 0 DPRINTF(("Attaching to random...\n")); - rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, + rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dev), RND_TYPE_NET, 0); #endif @@ -414,7 +414,7 @@ elstart(ifp) #ifdef DIAGNOSTIC if ((off & 0xffff) != off) printf("%s: bogus off 0x%x\n", - sc->sc_dev.dv_xname, off); + device_xname(&sc->sc_dev), off); #endif bus_space_write_1(iot, ioh, EL_GPBL, off & 0xff); bus_space_write_1(iot, ioh, EL_GPBH, (off >> 8) & 0xff); @@ -594,7 +594,7 @@ elread(sc, len) if (len <= sizeof(struct ether_header) || len > ETHER_MAX_LEN) { printf("%s: invalid packet size %d; dropping\n", - sc->sc_dev.dv_xname, len); + device_xname(&sc->sc_dev), len); ifp->if_ierrors++; return; } @@ -754,7 +754,7 @@ elwatchdog(ifp) { struct el_softc *sc = ifp->if_softc; - log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname); + log(LOG_ERR, "%s: device timeout\n", device_xname(&sc->sc_dev)); sc->sc_ethercom.ec_if.if_oerrors++; elreset(sc); diff --git a/sys/dev/isa/if_fmv_isa.c b/sys/dev/isa/if_fmv_isa.c index 00ca7f56ed1d..6a6c9bcdf215 100644 --- a/sys/dev/isa/if_fmv_isa.c +++ b/sys/dev/isa/if_fmv_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_fmv_isa.c,v 1.10 2007/10/19 12:00:17 ad Exp $ */ +/* $NetBSD: if_fmv_isa.c,v 1.11 2008/04/08 20:08:50 cegger Exp $ */ /* * All Rights Reserved, Copyright (C) Fujitsu Limited 1995 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_fmv_isa.c,v 1.10 2007/10/19 12:00:17 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_fmv_isa.c,v 1.11 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -272,7 +272,7 @@ fmv_isa_attach(struct device *parent, struct device *self, /* Map i/o space. */ if (bus_space_map(iot, ia->ia_io[0].ir_addr, FMV_NPORTS, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } @@ -285,6 +285,5 @@ fmv_isa_attach(struct device *parent, struct device *self, isc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NET, mb86960_intr, sc); if (isc->sc_ih == NULL) - printf("%s: couldn't establish interrupt handler\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt handler\n"); } diff --git a/sys/dev/isa/if_hp.c b/sys/dev/isa/if_hp.c index c3901791ea27..7356a39eb8ee 100644 --- a/sys/dev/isa/if_hp.c +++ b/sys/dev/isa/if_hp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_hp.c,v 1.43 2007/12/05 18:23:23 dyoung Exp $ */ +/* $NetBSD: if_hp.c,v 1.44 2008/04/08 20:08:50 cegger Exp $ */ /* XXX THIS DRIVER IS BROKEN. IT WILL NOT EVEN COMPILE. */ @@ -80,7 +80,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_hp.c,v 1.43 2007/12/05 18:23:23 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_hp.c,v 1.44 2008/04/08 20:08:50 cegger Exp $"); #include "hp.h" #if NHP > 0 @@ -456,7 +456,7 @@ hpattach(dvp) #endif #if NRND > 0 - rnd_attach_source(&ns->rnd_source, ns->sc_dev.dv_xname, + rnd_attach_source(&ns->rnd_source, device_xname(&ns->sc_dev), RND_TYPE_NET, 0); #endif diff --git a/sys/dev/isa/if_ix.c b/sys/dev/isa/if_ix.c index 726c473a1d9b..f54948c735e8 100644 --- a/sys/dev/isa/if_ix.c +++ b/sys/dev/isa/if_ix.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ix.c,v 1.27 2007/10/19 12:00:18 ad Exp $ */ +/* $NetBSD: if_ix.c,v 1.28 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.27 2007/10/19 12:00:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ix.c,v 1.28 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -744,7 +744,7 @@ ix_attach(struct device *parent, struct device *self, void *aux) ia->ia_io[0].ir_size, 0, &ioh) != 0) { DPRINTF(("\n%s: can't map i/o space 0x%x-0x%x\n", - sc->sc_dev.dv_xname, ia->ia_[0].ir_addr, + device_xname(&sc->sc_dev), ia->ia_[0].ir_addr, ia->ia_io[0].ir_addr + ia->ia_io[0].ir_size - 1)); return; } @@ -754,7 +754,7 @@ ix_attach(struct device *parent, struct device *self, void *aux) if (bus_space_map(ia->ia_memt, ia->ia_iomem[0].ir_addr, ia->ia_iomem[0].ir_size, 0, &memh) != 0) { DPRINTF(("\n%s: can't map iomem space 0x%x-0x%x\n", - sc->sc_dev.dv_xname, ia->ia_iomem[0].ir_addr, + device_xname(&sc->sc_dev), ia->ia_iomem[0].ir_addr, ia->ia_iomem[0].ir_addr + ia->ia_iomem[0].ir_size - 1)); bus_space_unmap(iot, ioh, ia->ia_io[0].ir_size); return; @@ -892,7 +892,7 @@ ix_attach(struct device *parent, struct device *self, void *aux) /* Memory tests failed, punt... */ if (memsize == 0) { DPRINTF(("\n%s: can't determine size of on-card RAM\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); bus_space_unmap(iot, ioh, ia->ia_io[0].ir_size); return; } @@ -956,7 +956,7 @@ ix_attach(struct device *parent, struct device *self, void *aux) if (!i82586_proberam(sc)) { DPRINTF(("\n%s: Can't talk to i82586!\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); bus_space_unmap(iot, ioh, ia->ia_io[0].ir_size); if (ia->ia_iomem[0].ir_size) @@ -1000,13 +1000,13 @@ ix_attach(struct device *parent, struct device *self, void *aux) ix_media, NIX_MEDIA, media); if (isc->use_pio) - printf("%s: unsupported memory config, using PIO to access %d bytes of memory\n", sc->sc_dev.dv_xname, sc->sc_msize); + aprint_error_dev(&sc->sc_dev, "unsupported memory config, using PIO to access %d bytes of memory\n", sc->sc_msize); isc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NET, i82586_intr, sc); if (isc->sc_ih == NULL) { DPRINTF(("\n%s: can't establish interrupt\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); } } diff --git a/sys/dev/isa/if_iy.c b/sys/dev/isa/if_iy.c index 0820457dcc55..3f4edd88503c 100644 --- a/sys/dev/isa/if_iy.c +++ b/sys/dev/isa/if_iy.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_iy.c,v 1.78 2007/10/19 12:00:18 ad Exp $ */ +/* $NetBSD: if_iy.c,v 1.79 2008/04/08 20:08:50 cegger Exp $ */ /* #define IYDEBUG */ /* #define IYMEMDEBUG */ @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.78 2007/10/19 12:00:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_iy.c,v 1.79 2008/04/08 20:08:50 cegger Exp $"); #include "opt_inet.h" #include "bpfilter.h" @@ -323,7 +323,7 @@ iyattach(struct device *parent, struct device *self, void *aux) iyprobemem(sc); - strcpy(ifp->if_xname, sc->sc_dev.dv_xname); + strlcpy(ifp->if_xname, device_xname(&sc->sc_dev), IFNAMSIZ); ifp->if_softc = sc; ifp->if_start = iystart; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_NOTRAILERS @@ -373,13 +373,13 @@ iyattach(struct device *parent, struct device *self, void *aux) eirq = eepro_irqmap[eaddr[EEPPW1] & EEPP_Int]; if (eirq != ia->ia_irq[0].ir_irq) printf("%s: EEPROM irq setting %d ignored\n", - sc->sc_dev.dv_xname, eirq); + device_xname(&sc->sc_dev), eirq); sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NET, iyintr, sc); #if NRND > 0 - rnd_attach_source(&sc->rnd_source, sc->sc_dev.dv_xname, + rnd_attach_source(&sc->rnd_source, device_xname(&sc->sc_dev), RND_TYPE_NET, 0); #endif @@ -409,7 +409,7 @@ struct iy_softc *sc; delay(200); #ifdef IYDEBUG printf("%s: dumping tx chain (st 0x%x end 0x%x last 0x%x)\n", - sc->sc_dev.dv_xname, sc->tx_start, sc->tx_end, sc->tx_last); + device_xname(&sc->sc_dev), sc->tx_start, sc->tx_end, sc->tx_last); p = sc->tx_last; if (!p) p = sc->tx_start; @@ -497,7 +497,7 @@ struct iy_softc *sc; bitmask_snprintf(temp, "\020\1PRMSC\2NOBRDST\3SEECRC\4LENGTH\5NOSaIns\6MultiIA", sbuf, sizeof(sbuf)); - printf("%s: RECV_MODES set to %s\n", sc->sc_dev.dv_xname, sbuf); + printf("%s: RECV_MODES set to %s\n", device_xname(&sc->sc_dev), sbuf); } #endif /* XXX VOODOO */ @@ -515,7 +515,7 @@ struct iy_softc *sc; bitmask_snprintf(temp, "\020\1LnkInDis\2PolCor\3TPE\4JabberDis\5NoAport\6BNC", sbuf, sizeof(sbuf)); - printf("%s: media select was 0x%s ", sc->sc_dev.dv_xname, sbuf); + printf("%s: media select was 0x%s ", device_xname(&sc->sc_dev), sbuf); } #endif temp = (temp & TEST_MODE_MASK); @@ -571,12 +571,12 @@ struct iy_softc *sc; bitmask_snprintf(temp, "\020\4bad_irq\010flash/boot present", sbuf, sizeof(sbuf)); - printf("%s: int no was %s\n", sc->sc_dev.dv_xname, sbuf); + printf("%s: int no was %s\n", device_xname(&sc->sc_dev), sbuf); temp = bus_space_read_1(iot, ioh, INT_NO_REG); bitmask_snprintf(temp, "\020\4bad_irq\010flash/boot present", sbuf, sizeof(sbuf)); - printf("%s: int no now %s\n", sc->sc_dev.dv_xname, sbuf); + printf("%s: int no now %s\n", device_xname(&sc->sc_dev), sbuf); } #endif @@ -592,7 +592,7 @@ struct iy_softc *sc; bitmask_snprintf(temp, "\020\2WORD_WIDTH\010INT_ENABLE", sbuf, sizeof(sbuf)); - printf("%s: HW access is %s\n", sc->sc_dev.dv_xname, sbuf); + printf("%s: HW access is %s\n", device_xname(&sc->sc_dev), sbuf); } #endif bus_space_write_1(iot, ioh, REG1, temp | INT_ENABLE); /* XXX what about WORD_WIDTH? */ @@ -604,7 +604,7 @@ struct iy_softc *sc; temp = bus_space_read_1(iot, ioh, REG1); bitmask_snprintf(temp, "\020\2WORD_WIDTH\010INT_ENABLE", sbuf, sizeof(sbuf)); - printf("%s: HW access is %s\n", sc->sc_dev.dv_xname, sbuf); + printf("%s: HW access is %s\n", device_xname(&sc->sc_dev), sbuf); } #endif @@ -669,7 +669,7 @@ struct ifnet *ifp; break; #ifdef IYDEBUG printf("%s: trying to write another packet to the hardware\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); #endif /* We need to use m->m_pkthdr.len, so require the header */ @@ -680,7 +680,7 @@ struct ifnet *ifp; pad = len & 1; #ifdef IYDEBUG - printf("%s: length is %d.\n", sc->sc_dev.dv_xname, len); + printf("%s: length is %d.\n", device_xname(&sc->sc_dev), len); #endif if (len < (ETHER_MIN_LEN - ETHER_CRC_LEN)) { pad = ETHER_MIN_LEN - ETHER_CRC_LEN - len; @@ -704,7 +704,7 @@ struct ifnet *ifp; avail += sc->tx_size; #ifdef IYDEBUG - printf("%s: avail is %d.\n", sc->sc_dev.dv_xname, avail); + printf("%s: avail is %d.\n", device_xname(&sc->sc_dev), avail); #endif /* * we MUST RUN at splnet here --- @@ -716,7 +716,7 @@ struct ifnet *ifp; if ((len+pad+2*I595_XMT_HDRLEN) > avail) { #ifdef IYDEBUG printf("%s: len = %d, avail = %d, setting OACTIVE\n", - sc->sc_dev.dv_xname, len, avail); + device_xname(&sc->sc_dev), len, avail); #endif /* mark interface as full ... */ ifp->if_flags |= IFF_OACTIVE; @@ -766,7 +766,7 @@ struct ifnet *ifp; if (residual) { #ifdef IYDEBUG printf("%s: merging residual with next mbuf.\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); #endif resval |= *data << 8; bus_space_write_stream_2(iot, ioh, @@ -786,7 +786,7 @@ struct ifnet *ifp; resval = *(data + llen - 1); #ifdef IYDEBUG printf("%s: got odd mbuf to send.\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); #endif } @@ -803,9 +803,9 @@ struct ifnet *ifp; #ifdef IYDEBUG printf("%s: new last = 0x%x, end = 0x%x.\n", - sc->sc_dev.dv_xname, last, end); + device_xname(&sc->sc_dev), last, end); printf("%s: old start = 0x%x, end = 0x%x, last = 0x%x\n", - sc->sc_dev.dv_xname, sc->tx_start, sc->tx_end, sc->tx_last); + device_xname(&sc->sc_dev), sc->tx_start, sc->tx_end, sc->tx_last); #endif if (sc->tx_start != sc->tx_end) { @@ -828,7 +828,7 @@ struct ifnet *ifp; stat | htole16(CHAIN)); #ifdef IYDEBUG printf("%s: setting 0x%x to 0x%x\n", - sc->sc_dev.dv_xname, sc->tx_last + XMT_COUNT, + device_xname(&sc->sc_dev), sc->tx_last + XMT_COUNT, le16toh(stat) | CHAIN); #endif } @@ -844,13 +844,13 @@ struct ifnet *ifp; sc->tx_start = last; #ifdef IYDEBUG printf("%s: writing 0x%x to XAR and giving XCMD\n", - sc->sc_dev.dv_xname, last); + device_xname(&sc->sc_dev), last); #endif } else { bus_space_write_1(iot, ioh, 0, RESUME_XMT_CMD); #ifdef IYDEBUG printf("%s: giving RESUME_XCMD\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); #endif } sc->tx_last = last; @@ -946,7 +946,7 @@ iywatchdog(ifp) { struct iy_softc *sc = ifp->if_softc; - log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname); + log(LOG_ERR, "%s: device timeout\n", device_xname(&sc->sc_dev)); ++sc->sc_ethercom.ec_if.if_oerrors; iyreset(sc); } @@ -978,7 +978,7 @@ iyintr(arg) bitmask_snprintf(status, "\020\1RX_STP\2RX\3TX\4EXEC", sbuf, sizeof(sbuf)); - printf("%s: got interrupt %s", sc->sc_dev.dv_xname, sbuf); + printf("%s: got interrupt %s", device_xname(&sc->sc_dev), sbuf); if (status & EXEC_INT) { bitmask_snprintf(bus_space_read_1(iot, ioh, 0), @@ -1061,7 +1061,7 @@ iyget(sc, iot, ioh, rxlen) mtod(m, u_int16_t *), len/2); } else { #ifdef IYDEBUG - printf("%s: received odd mbuf\n", sc->sc_dev.dv_xname); + printf("%s: received odd mbuf\n", device_xname(&sc->sc_dev)); #endif *(mtod(m, char *)) = bus_space_read_stream_2(iot, ioh, MEM_PORT_REG); @@ -1122,7 +1122,7 @@ struct iy_softc *sc; bitmask_snprintf(rxstatus, "\020\1RCLD\2IA_MCH\010SHORT\011OVRN\013ALGERR\014CRCERR\015LENERR\016RCVOK\020TYP", sbuf, sizeof(sbuf)); printf("%s: pck at 0x%04x stat %s next 0x%x len 0x%x\n", - sc->sc_dev.dv_xname, rxadrs, sbuf, rxnext, rxlen); + device_xname(&sc->sc_dev), rxadrs, sbuf, rxnext, rxlen); } #endif iyget(sc, iot, ioh, rxlen); @@ -1399,12 +1399,12 @@ iy_mc_setup(sc) bus_space_write_1(iot, ioh, STATUS_REG, EXEC_INT); #ifdef DIAGNOSTIC if (temp & 0x20) { - printf("%s: mc setup failed, %d usec\n", - sc->sc_dev.dv_xname, timeout * 2); + aprint_error_dev(&sc->sc_dev, "mc setup failed, %d usec\n", + timeout * 2); } else if (((temp & 0x0f) == 0x03) && (ifp->if_flags & IFF_DEBUG)) { printf("%s: mc setup done, %d usec\n", - sc->sc_dev.dv_xname, timeout * 2); + device_xname(&sc->sc_dev), timeout * 2); } #endif break; @@ -1514,7 +1514,7 @@ iyprobemem(sc) if (bus_space_read_2(iot, ioh, MEM_PORT_REG) != 0xdead) { #ifdef IYMEMDEBUG printf("%s: Didn't keep 0xdead at 0x%x\n", - sc->sc_dev.dv_xname, testing-2); + device_xname(&sc->sc_dev), testing-2); #endif continue; } @@ -1525,7 +1525,7 @@ iyprobemem(sc) if (bus_space_read_2(iot, ioh, MEM_PORT_REG) != 0xbeef) { #ifdef IYMEMDEBUG printf("%s: Didn't keep 0xbeef at 0x%x\n", - sc->sc_dev.dv_xname, testing-2); + device_xname(&sc->sc_dev), testing-2); #endif continue; } @@ -1538,7 +1538,7 @@ iyprobemem(sc) if (bus_space_read_2(iot, ioh, MEM_PORT_REG) == (testing >> 1)) { #ifdef IYMEMDEBUG printf("%s: 0x%x alias of 0x0\n", - sc->sc_dev.dv_xname, testing >> 1); + device_xname(&sc->sc_dev), testing >> 1); #endif continue; } diff --git a/sys/dev/isa/if_lc_isa.c b/sys/dev/isa/if_lc_isa.c index 2d7a1e0f2066..8b343bd9b29e 100644 --- a/sys/dev/isa/if_lc_isa.c +++ b/sys/dev/isa/if_lc_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_lc_isa.c,v 1.28 2007/10/19 12:00:18 ad Exp $ */ +/* $NetBSD: if_lc_isa.c,v 1.29 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1994, 1995, 1997 Matt Thomas @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_lc_isa.c,v 1.28 2007/10/19 12:00:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_lc_isa.c,v 1.29 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -145,14 +145,15 @@ lemac_isa_find(sc, ia, attach) */ if (ia->ia_irq[0].ir_irq != ISA_UNKNOWN_IRQ && ia->ia_irq[0].ir_irq != irq) - printf("%s: overriding IRQ %d to %d\n", sc->sc_dv.dv_xname, + printf("%s: overriding IRQ %d to %d\n", device_xname(&sc->sc_dv), ia->ia_irq[0].ir_irq, irq); if (attach) { sc->sc_ats = shutdownhook_establish(lemac_shutdown, sc); - if (sc->sc_ats == NULL) - printf("\n%s: warning: can't establish shutdown hook\n", - sc->sc_dv.dv_xname); + if (sc->sc_ats == NULL) { + aprint_normal("\n"); + aprint_error_dev(&sc->sc_dv, "warning: can't establish shutdown hook\n"); + } lemac_ifattach(sc); diff --git a/sys/dev/isa/if_ntwoc_isa.c b/sys/dev/isa/if_ntwoc_isa.c index 5aed41206b2d..fd29e01a7a34 100644 --- a/sys/dev/isa/if_ntwoc_isa.c +++ b/sys/dev/isa/if_ntwoc_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ntwoc_isa.c,v 1.16 2007/10/19 12:00:18 ad Exp $ */ +/* $NetBSD: if_ntwoc_isa.c,v 1.17 2008/04/08 20:08:50 cegger Exp $ */ /* * Copyright (c) 1999 Christian E. Hopps * Copyright (c) 1996 John Hay. @@ -29,11 +29,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: if_ntwoc_isa.c,v 1.16 2007/10/19 12:00:18 ad Exp $ + * $Id: if_ntwoc_isa.c,v 1.17 2008/04/08 20:08:50 cegger Exp $ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_isa.c,v 1.16 2007/10/19 12:00:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ntwoc_isa.c,v 1.17 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -419,8 +419,8 @@ ntwoc_isa_attach(struct device *parent, struct device *self, void *aux) sca->sc_iot = ia->ia_iot; if ((rv = bus_space_map(ia->ia_iot, ia->ia_io[0].ir_addr, NTWOC_SRC_IOPORT_SIZE, 0, &sca->sc_ioh))) { - printf("%s: can't map io 0x%x sz %d, %d\n", - sc->sc_dev.dv_xname, ia->ia_io[0].ir_addr, + aprint_error_dev(&sc->sc_dev, "can't map io 0x%x sz %d, %d\n", + ia->ia_io[0].ir_addr, NTWOC_SRC_IOPORT_SIZE, rv); return; } @@ -431,8 +431,8 @@ ntwoc_isa_attach(struct device *parent, struct device *self, void *aux) /* map the isa io addresses */ if ((tmp = bus_space_map(ia->ia_iot, ioport, 16, 0, &sca->scu_sca_ioh[i]))) { - printf("%s: mapping sca 0x%x sz %d failed: %d\n", - sc->sc_dev.dv_xname, ioport, 16, tmp); + aprint_error_dev(&sc->sc_dev, "mapping sca 0x%x sz %d failed: %d\n", + ioport, 16, tmp); return; } } @@ -463,8 +463,8 @@ ntwoc_isa_attach(struct device *parent, struct device *self, void *aux) sca->scu_pagemask = sca->scu_pagesize - 1; if ((rv = bus_space_map(ia->ia_memt, ia->ia_iomem[0].ir_addr, sca->scu_pagesize, 0, &sca->scu_memh))) { - printf("%s: can't map mem 0x%x sz %ld, %d\n", - sc->sc_dev.dv_xname, ia->ia_iomem[0].ir_addr, + aprint_error_dev(&sc->sc_dev, "can't map mem 0x%x sz %ld, %d\n", + ia->ia_iomem[0].ir_addr, sca->scu_pagesize, rv); return; } @@ -542,13 +542,13 @@ ntwoc_isa_attach(struct device *parent, struct device *self, void *aux) #if 0 printf("%s: sca port 0x%x-0x%x dpram %ldk %d serial port%s\n", - sc->sc_dev.dv_xname, ia->ia_io[0].ir_addr | 0x8000, + device_xname(&sc->sc_dev), ia->ia_io[0].ir_addr | 0x8000, (ia->ia_io[0].ir_addr | 0x8000) + NTWOC_SRC_ASIC_SIZE - 1, pgs * (sca->scu_pagesize / 1024), sca->sc_numports, (sca->sc_numports > 1 ? "s" : "")); #else printf("%s: dpram %ldk %d serial port%s\n", - sc->sc_dev.dv_xname, pgs * (sca->scu_pagesize / 1024), + device_xname(&sc->sc_dev), pgs * (sca->scu_pagesize / 1024), sca->sc_numports, (sca->sc_numports > 1 ? "s" : "")); #endif @@ -564,15 +564,14 @@ ntwoc_isa_attach(struct device *parent, struct device *self, void *aux) sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NET, ntwoc_isa_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: can't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't establish interrupt\n"); return; } /* make sure we have 2 pages for each port */ if (pgs < 2 * sca->sc_numports) { printf("%s: %d less than required pages of memory of %d\n", - sc->sc_dev.dv_xname, pgs, 2 * sca->sc_numports); + device_xname(&sc->sc_dev), pgs, 2 * sca->sc_numports); return; } diff --git a/sys/dev/isa/if_sm_isa.c b/sys/dev/isa/if_sm_isa.c index 6b56a9a9d451..49c09f279f98 100644 --- a/sys/dev/isa/if_sm_isa.c +++ b/sys/dev/isa/if_sm_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_sm_isa.c,v 1.18 2007/10/19 12:00:18 ad Exp $ */ +/* $NetBSD: if_sm_isa.c,v 1.19 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_sm_isa.c,v 1.18 2007/10/19 12:00:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_sm_isa.c,v 1.19 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -188,6 +188,5 @@ sm_isa_attach(struct device *parent, struct device *self, void *aux) isc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq[0].ir_irq, IST_EDGE, IPL_NET, smc91cxx_intr, sc); if (isc->sc_ih == NULL) - printf("%s: couldn't establish interrupt handler\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt handler\n"); } diff --git a/sys/dev/isa/if_tscs_isa.c b/sys/dev/isa/if_tscs_isa.c index 1f95d11a7e18..7fc9cd86ddbc 100644 --- a/sys/dev/isa/if_tscs_isa.c +++ b/sys/dev/isa/if_tscs_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tscs_isa.c,v 1.5 2007/10/19 12:00:18 ad Exp $ */ +/* $NetBSD: if_tscs_isa.c,v 1.6 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tscs_isa.c,v 1.5 2007/10/19 12:00:18 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tscs_isa.c,v 1.6 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -200,15 +200,14 @@ tscs_isa_attach(parent, self, aux) */ if (bus_space_map(sc->sc_iot, ia->ia_io[0].ir_addr, CS8900_IOSIZE, 0, &sc->sc_ioh)) { - printf("%s: unable to map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to map i/o space\n"); return; } sc->sc_ih = isa_intr_establish(ia->ia_ic, sc->sc_irq, IST_EDGE, IPL_NET, cs_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: unable to establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to establish interrupt\n"); return; } diff --git a/sys/dev/isa/ioat66.c b/sys/dev/isa/ioat66.c index 02c95d9f0530..536a979138c6 100644 --- a/sys/dev/isa/ioat66.c +++ b/sys/dev/isa/ioat66.c @@ -1,4 +1,4 @@ -/* $NetBSD: ioat66.c,v 1.16 2007/10/19 12:00:19 ad Exp $ */ +/* $NetBSD: ioat66.c,v 1.17 2008/04/08 20:08:50 cegger Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ioat66.c,v 1.16 2007/10/19 12:00:19 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ioat66.c,v 1.17 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -162,15 +162,13 @@ ioat66attach(struct device *parent, struct device *self, void *aux) if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) && bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_slaveioh[i])) { - printf("%s: can't map i/o space for slave %d\n", - sc->sc_dev.dv_xname, i); + aprint_error_dev(&sc->sc_dev, "can't map i/o space for slave %d\n", i); return; } } if(bus_space_map(iot, IOAT66SHARED, 1, 0, &sc->sc_intmasq)) { - printf("%s: can't map shared interrupt mask\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map shared interrupt mask\n"); return; } diff --git a/sys/dev/isa/isadma.c b/sys/dev/isa/isadma.c index 65b3f2830fa6..20a75f54833e 100644 --- a/sys/dev/isa/isadma.c +++ b/sys/dev/isa/isadma.c @@ -1,4 +1,4 @@ -/* $NetBSD: isadma.c,v 1.56 2007/10/19 12:00:19 ad Exp $ */ +/* $NetBSD: isadma.c,v 1.57 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1997, 1998, 2000 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: isadma.c,v 1.56 2007/10/19 12:00:19 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isadma.c,v 1.57 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -228,12 +228,12 @@ _isa_dmacascade(ids, chan) int ochan = chan & 3; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); return (EINVAL); } if (ISA_DMA_DRQ_ISFREE(ids, chan) == 0) { - printf("%s: DRQ %d is not free\n", ids->ids_dev->dv_xname, + printf("%s: DRQ %d is not free\n", device_xname(ids->ids_dev), chan); return (EAGAIN); } @@ -281,7 +281,7 @@ _isa_dmamaxsize(ids, chan) { if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); return (0); } @@ -298,7 +298,7 @@ _isa_dmamap_create(ids, chan, size, flags) int error; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); return (EINVAL); } @@ -318,7 +318,7 @@ _isa_dmamap_destroy(ids, chan) { if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); goto lose; } @@ -350,7 +350,7 @@ _isa_dmastart(ids, chan, addr, nbytes, p, flags, busdmaflags) int error; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); goto lose; } @@ -362,21 +362,21 @@ _isa_dmastart(ids, chan, addr, nbytes, p, flags, busdmaflags) if (ISA_DMA_DRQ_ISFREE(ids, chan)) { printf("%s: dma start on free channel %d\n", - ids->ids_dev->dv_xname, chan); + device_xname(ids->ids_dev), chan); goto lose; } if (chan & 4) { if (nbytes > (1 << 17) || nbytes & 1 || (u_long)addr & 1) { printf("%s: drq %d, nbytes 0x%lx, addr %p\n", - ids->ids_dev->dv_xname, chan, + device_xname(ids->ids_dev), chan, (unsigned long) nbytes, addr); goto lose; } } else { if (nbytes > (1 << 16)) { printf("%s: drq %d, nbytes 0x%lx\n", - ids->ids_dev->dv_xname, chan, + device_xname(ids->ids_dev), chan, (unsigned long) nbytes); goto lose; } @@ -475,7 +475,7 @@ _isa_dmaabort(ids, chan) { if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmaabort"); } @@ -494,7 +494,7 @@ _isa_dmacount(ids, chan) int ochan = chan & 3; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("isa_dmacount"); } @@ -539,7 +539,7 @@ _isa_dmafinished(ids, chan) { if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmafinished"); } @@ -562,7 +562,7 @@ _isa_dmadone(ids, chan) bus_dmamap_t dmam; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmadone"); } @@ -572,7 +572,7 @@ _isa_dmadone(ids, chan) if (_isa_dmafinished(ids, chan) == 0) printf("%s: _isa_dmadone: channel %d not finished\n", - ids->ids_dev->dv_xname, chan); + device_xname(ids->ids_dev), chan); bus_dmamap_sync(ids->ids_dmat, dmam, 0, dmam->dm_mapsize, (ids->ids_dmareads & (1 << chan)) ? BUS_DMASYNC_POSTREAD : @@ -638,7 +638,7 @@ _isa_dmamem_alloc(ids, chan, size, addrp, flags) int error, boundary, rsegs; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmamem_alloc"); } @@ -665,7 +665,7 @@ _isa_dmamem_free(ids, chan, addr, size) bus_dma_segment_t seg; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmamem_free"); } @@ -687,7 +687,7 @@ _isa_dmamem_map(ids, chan, addr, size, kvap, flags) bus_dma_segment_t seg; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmamem_map"); } @@ -706,7 +706,7 @@ _isa_dmamem_unmap(ids, chan, kva, size) { if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmamem_unmap"); } @@ -725,7 +725,7 @@ _isa_dmamem_mmap(ids, chan, addr, size, off, prot, flags) bus_dma_segment_t seg; if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_dmamem_mmap"); } @@ -745,7 +745,7 @@ _isa_drq_isfree(ids, chan) { if (chan < 0 || chan > 7) { - printf("%s: bogus drq %d\n", ids->ids_dev->dv_xname, chan); + printf("%s: bogus drq %d\n", device_xname(ids->ids_dev), chan); panic("_isa_drq_isfree"); } diff --git a/sys/dev/isa/isic_isa.c b/sys/dev/isa/isic_isa.c index 933e10ebc002..6a9fc78466f0 100644 --- a/sys/dev/isa/isic_isa.c +++ b/sys/dev/isa/isic_isa.c @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.29 2007/10/19 12:00:19 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isa.c,v 1.30 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -94,7 +94,7 @@ CFATTACH_DECL(isic_isa, sizeof(struct isic_softc), isic_isa_probe, isic_isa_attach, NULL, NULL); #define ISIC_FMT "%s: " -#define ISIC_PARM sc->sc_dev.dv_xname +#define ISIC_PARM device_xname(&sc->sc_dev) #define TERMFMT "\n" /* @@ -543,8 +543,7 @@ isicattach(int flags, struct isic_softc *sc) break; default: - printf("%s: Error, IPAC version %d unknown!\n", - sc->sc_dev.dv_xname, ret); + aprint_error_dev(&sc->sc_dev, "Error, IPAC version %d unknown!\n", ret); return(0); break; } diff --git a/sys/dev/isa/isic_isa_itk_ix1.c b/sys/dev/isa/isic_isa_itk_ix1.c index 015c33024931..c0860ed3b937 100644 --- a/sys/dev/isa/isic_isa_itk_ix1.c +++ b/sys/dev/isa/isic_isa_itk_ix1.c @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: isic_isa_itk_ix1.c,v 1.15 2007/10/19 12:00:19 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isa_itk_ix1.c,v 1.16 2008/04/08 20:08:50 cegger Exp $"); #include "opt_isicisa.h" @@ -317,11 +317,11 @@ int isic_attach_itkix1(struct isic_softc *sc) if((hv1 != 0x05 && hv1 != 0x04) || (hv2 != 0x05 && hv2 != 0x04)) { printf("%s: HSCX VSTR test failed for ITK ix1 micro\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); printf("%s: HSC0: VSTR: %#x\n", - sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR)); + device_xname(&sc->sc_dev), HSCX_READ(0, H_VSTR)); printf("%s: HSC1: VSTR: %#x\n", - sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR)); + device_xname(&sc->sc_dev), HSCX_READ(1, H_VSTR)); return 0; } diff --git a/sys/dev/isa/mcd.c b/sys/dev/isa/mcd.c index 3360c00cb694..30ef1345f83e 100644 --- a/sys/dev/isa/mcd.c +++ b/sys/dev/isa/mcd.c @@ -1,4 +1,4 @@ -/* $NetBSD: mcd.c,v 1.103 2007/12/05 07:58:30 ad Exp $ */ +/* $NetBSD: mcd.c,v 1.104 2008/04/08 20:08:50 cegger Exp $ */ /* * Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved. @@ -56,7 +56,7 @@ /*static char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";*/ #include -__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.103 2007/12/05 07:58:30 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.104 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -86,7 +86,7 @@ __KERNEL_RCSID(0, "$NetBSD: mcd.c,v 1.103 2007/12/05 07:58:30 ad Exp $"); #ifndef MCDDEBUG #define MCD_TRACE(fmt,...) #else -#define MCD_TRACE(fmt,...) {if (sc->debug) {printf("%s: st=%02x: ", sc->sc_dev.dv_xname, sc->status); printf(fmt,__VA_ARGS__);}} +#define MCD_TRACE(fmt,...) {if (sc->debug) {printf("%s: st=%02x: ", device_xname(&sc->sc_dev), sc->status); printf(fmt,__VA_ARGS__);}} #endif #define MCDPART(dev) DISKPART(dev) @@ -268,7 +268,7 @@ mcdattach(struct device *parent, struct device *self, void *aux) /* * Initialize and attach the disk structure. */ - disk_init(&sc->sc_dk, sc->sc_dev.dv_xname, &mcddkdriver); + disk_init(&sc->sc_dk, device_xname(&sc->sc_dev), &mcddkdriver); disk_attach(&sc->sc_dk); printf(": model %s\n", sc->type != 0 ? sc->type : "unknown"); @@ -434,7 +434,7 @@ mcdstrategy(bp) if (bp->b_blkno < 0 || (bp->b_bcount % sc->blksize) != 0) { printf("%s: strategy: blkno = %" PRId64 " bcount = %d\n", - sc->sc_dev.dv_xname, bp->b_blkno, bp->b_bcount); + device_xname(&sc->sc_dev), bp->b_blkno, bp->b_bcount); bp->b_error = EINVAL; goto done; } @@ -903,7 +903,7 @@ mcd_find(iot, ioh, sc) #ifdef MCDDEBUG printf("%s: unrecognized drive version %c%02x; will try to use it anyway\n", - sc->sc_dev.dv_xname, + device_xname(&sc->sc_dev), mbx.res.data.continfo.code, mbx.res.data.continfo.version); #endif sc->type = 0; @@ -1004,14 +1004,14 @@ mcd_getresult(sc, res) int i, x; if (sc->debug) - printf("%s: mcd_getresult: %d", sc->sc_dev.dv_xname, + printf("%s: mcd_getresult: %d", device_xname(&sc->sc_dev), res->length); if ((x = mcd_getreply(sc)) < 0) { if (sc->debug) printf(" timeout\n"); else if (!sc->probe) - printf("%s: timeout in getresult\n", sc->sc_dev.dv_xname); + printf("%s: timeout in getresult\n", device_xname(&sc->sc_dev)); return EIO; } if (sc->debug) @@ -1027,7 +1027,7 @@ mcd_getresult(sc, res) if (sc->debug) printf(" timeout\n"); else - printf("%s: timeout in getresult\n", sc->sc_dev.dv_xname); + printf("%s: timeout in getresult\n", device_xname(&sc->sc_dev)); return EIO; } if (sc->debug) @@ -1044,7 +1044,7 @@ mcd_getresult(sc, res) MCD_XF_STATUSUNAVAIL) == 0) { x = bus_space_read_1(sc->sc_iot, sc->sc_ioh, MCD_STATUS); printf("%s: got extra byte %02x during getstatus\n", - sc->sc_dev.dv_xname, (u_int)x); + device_xname(&sc->sc_dev), (u_int)x); delay(10); } #endif @@ -1062,11 +1062,11 @@ mcd_setflags(sc) (sc->status & (MCD_ST_DSKCHNG | MCD_ST_DSKIN | MCD_ST_DOOROPEN)) != MCD_ST_DSKIN) { if ((sc->status & MCD_ST_DOOROPEN) != 0) - printf("%s: door open\n", sc->sc_dev.dv_xname); + printf("%s: door open\n", device_xname(&sc->sc_dev)); else if ((sc->status & MCD_ST_DSKIN) == 0) - printf("%s: no disk present\n", sc->sc_dev.dv_xname); + printf("%s: no disk present\n", device_xname(&sc->sc_dev)); else if ((sc->status & MCD_ST_DSKCHNG) != 0) - printf("%s: media change\n", sc->sc_dev.dv_xname); + printf("%s: media change\n", device_xname(&sc->sc_dev)); sc->flags &= ~MCDF_LOADED; } @@ -1088,7 +1088,7 @@ mcd_send(sc, mbx, diskin) bus_space_handle_t ioh = sc->sc_ioh; if (sc->debug) { - printf("%s: mcd_send: %d %02x", sc->sc_dev.dv_xname, + printf("%s: mcd_send: %d %02x", device_xname(&sc->sc_dev), mbx->cmd.length, (u_int)mbx->cmd.opcode); for (i = 0; i < mbx->cmd.length; i++) printf(" %02x", (u_int)mbx->cmd.data.raw.data[i]); @@ -1263,7 +1263,7 @@ mcdintr(arg) goto changed; #if 0 printf("%s: got status byte %02x during read\n", - sc->sc_dev.dv_xname, (u_int)sc->status); + device_xname(&sc->sc_dev), (u_int)sc->status); #endif goto loop; @@ -1294,12 +1294,12 @@ mcdintr(arg) hold: if (mbx->count-- < 0) { printf("%s: timeout in state %d", - sc->sc_dev.dv_xname, mbx->state); + device_xname(&sc->sc_dev), mbx->state); goto readerr; } #if 0 - printf("%s: sleep in state %d\n", sc->sc_dev.dv_xname, + printf("%s: sleep in state %d\n", device_xname(&sc->sc_dev), mbx->state); #endif callout_reset(&sc->sc_pintr_ch, hz / 100, @@ -1326,7 +1326,7 @@ changed: return -1; #ifdef notyet - printf("%s: unit timeout; resetting\n", sc->sc_dev.dv_xname); + printf("%s: unit timeout; resetting\n", device_xname(&sc->sc_dev)); bus_space_write_1(iot, ioh, MCD_RESET, MCD_CMDRESET); delay(300000); (void) mcd_getstat(sc, 1); @@ -1374,7 +1374,7 @@ mcd_setmode(sc, mode) if (sc->lastmode == mode) return 0; if (sc->debug) - printf("%s: setting mode to %d\n", sc->sc_dev.dv_xname, mode); + printf("%s: setting mode to %d\n", device_xname(&sc->sc_dev), mode); sc->lastmode = MCD_MD_UNKNOWN; mbx.cmd.opcode = MCD_CMDSETMODE; @@ -1399,7 +1399,7 @@ mcd_setupc(sc, upc) if (sc->lastupc == upc) return 0; if (sc->debug) - printf("%s: setting upc to %d\n", sc->sc_dev.dv_xname, upc); + printf("%s: setting upc to %d\n", device_xname(&sc->sc_dev), upc); sc->lastupc = MCD_UPC_UNKNOWN; mbx.cmd.opcode = MCD_CMDCONFIGDRIVE; @@ -1422,7 +1422,7 @@ mcd_toc_header(sc, th) if (sc->debug) printf("%s: mcd_toc_header: reading toc header\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); th->len = msf2hsg(sc->volinfo.vol_msf, 0); th->starting_track = bcd2bin(sc->volinfo.trk_low); @@ -1447,7 +1447,7 @@ mcd_read_toc(sc) if (sc->debug) printf("%s: read_toc: reading qchannel info\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); for (trk = th.starting_track; trk <= th.ending_track; trk++) sc->toc[trk].toc.idx_no = 0x00; @@ -1556,7 +1556,7 @@ mcd_stop(sc) int error; if (sc->debug) - printf("%s: mcd_stop: stopping play\n", sc->sc_dev.dv_xname); + printf("%s: mcd_stop: stopping play\n", device_xname(&sc->sc_dev)); mbx.cmd.opcode = MCD_CMDSTOPAUDIO; mbx.cmd.length = 0; @@ -1614,7 +1614,7 @@ mcd_read_subchannel(sc, ch, info) int error; if (sc->debug) - printf("%s: subchan: af=%d df=%d\n", sc->sc_dev.dv_xname, + printf("%s: subchan: af=%d df=%d\n", device_xname(&sc->sc_dev), ch->address_format, ch->data_format); if (len > sizeof(*info) || len < sizeof(info->header)) @@ -1692,7 +1692,7 @@ mcd_playtracks(sc, p) if (sc->debug) printf("%s: playtracks: from %d:%d to %d:%d\n", - sc->sc_dev.dv_xname, + device_xname(&sc->sc_dev), a, p->start_index, z, p->end_index); if (a < bcd2bin(sc->volinfo.trk_low) || @@ -1728,7 +1728,7 @@ mcd_playmsf(sc, p) if (sc->debug) printf("%s: playmsf: from %d:%d.%d to %d:%d.%d\n", - sc->sc_dev.dv_xname, + device_xname(&sc->sc_dev), p->start_m, p->start_s, p->start_f, p->end_m, p->end_s, p->end_f); @@ -1762,7 +1762,7 @@ mcd_playblocks(sc, p) if (sc->debug) printf("%s: playblocks: blkno %d length %d\n", - sc->sc_dev.dv_xname, p->blk, p->len); + device_xname(&sc->sc_dev), p->blk, p->len); if (p->blk > sc->disksize || p->len > sc->disksize || (p->blk + p->len) > sc->disksize) @@ -1790,7 +1790,7 @@ mcd_pause(sc) /* Verify current status. */ if (sc->audio_status != CD_AS_PLAY_IN_PROGRESS) { printf("%s: pause: attempted when not playing\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); return EINVAL; } diff --git a/sys/dev/isa/moxa_isa.c b/sys/dev/isa/moxa_isa.c index ec877ca15f5b..425f0aa3c618 100644 --- a/sys/dev/isa/moxa_isa.c +++ b/sys/dev/isa/moxa_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: moxa_isa.c,v 1.15 2007/10/19 12:00:20 ad Exp $ */ +/* $NetBSD: moxa_isa.c,v 1.16 2008/04/08 20:08:50 cegger Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: moxa_isa.c,v 1.15 2007/10/19 12:00:20 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: moxa_isa.c,v 1.16 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -160,8 +160,7 @@ moxa_isaattach(struct device *parent, struct device *self, void *aux) if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) && bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_slaveioh[i])) { - printf("%s: can't map i/o space for slave %d\n", - sc->sc_dev.dv_xname, i); + aprint_error_dev(&sc->sc_dev, "can't map i/o space for slave %d\n", i); return; } } diff --git a/sys/dev/isa/radiotrack.c b/sys/dev/isa/radiotrack.c index eed5790597d7..6f85db5255d6 100644 --- a/sys/dev/isa/radiotrack.c +++ b/sys/dev/isa/radiotrack.c @@ -1,4 +1,4 @@ -/* $NetBSD: radiotrack.c,v 1.15 2007/10/19 12:00:22 ad Exp $ */ +/* $NetBSD: radiotrack.c,v 1.16 2008/04/08 20:08:50 cegger Exp $ */ /* $OpenBSD: radiotrack.c,v 1.1 2001/12/05 10:27:06 mickey Exp $ */ /* $RuOBSD: radiotrack.c,v 1.3 2001/10/18 16:51:36 pva Exp $ */ @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: radiotrack.c,v 1.15 2007/10/19 12:00:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: radiotrack.c,v 1.16 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -189,7 +189,7 @@ rt_attach(struct device *parent, struct device *self, void *aux) /* remap I/O */ if (bus_space_map(sc->lm.iot, ia->ia_io[0].ir_addr, ia->ia_io[0].ir_size, 0, &sc->lm.ioh)) - panic(": bus_space_map() of %s failed", sc->sc_dev.dv_xname); + panic(": bus_space_map() of %s failed", device_xname(&sc->sc_dev)); switch (ia->ia_io[0].ir_addr) { case 0x20C: diff --git a/sys/dev/isa/rtfps.c b/sys/dev/isa/rtfps.c index 4853ed3873a5..8ad275835349 100644 --- a/sys/dev/isa/rtfps.c +++ b/sys/dev/isa/rtfps.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtfps.c,v 1.53 2007/10/19 12:00:22 ad Exp $ */ +/* $NetBSD: rtfps.c,v 1.54 2008/04/08 20:08:50 cegger Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtfps.c,v 1.53 2007/10/19 12:00:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtfps.c,v 1.54 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -160,7 +160,7 @@ rtfpsattach(struct device *parent, struct device *self, void *aux) irq = ia->ia_irq[0].ir_irq; if (irq >= 16 || irqport[irq] == -1) { - printf("%s: invalid irq\n", sc->sc_dev.dv_xname); + printf("%s: invalid irq\n", device_xname(&sc->sc_dev)); return; } sc->sc_irqport = irqport[irq]; @@ -170,13 +170,12 @@ rtfpsattach(struct device *parent, struct device *self, void *aux) if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) && bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_slaveioh[i])) { - printf("%s: can't map i/o space for slave %d\n", - sc->sc_dev.dv_xname, i); + aprint_error_dev(&sc->sc_dev, "can't map i/o space for slave %d\n", i); return; } } if (bus_space_map(iot, sc->sc_irqport, 1, 0, &sc->sc_irqioh)) { - printf("%s: can't map irq port at 0x%x\n", sc->sc_dev.dv_xname, + aprint_error_dev(&sc->sc_dev, "can't map irq port at 0x%x\n", sc->sc_irqport); return; } diff --git a/sys/dev/isa/satlink.c b/sys/dev/isa/satlink.c index 3c33179c147f..85be8ccfdc9c 100644 --- a/sys/dev/isa/satlink.c +++ b/sys/dev/isa/satlink.c @@ -1,4 +1,4 @@ -/* $NetBSD: satlink.c,v 1.36 2008/03/01 14:16:50 rmind Exp $ */ +/* $NetBSD: satlink.c,v 1.37 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -45,7 +45,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: satlink.c,v 1.36 2008/03/01 14:16:50 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: satlink.c,v 1.37 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -178,7 +178,7 @@ satlinkattach(struct device *parent, struct device *self, void *aux) /* Map the card. */ if (bus_space_map(iot, ia->ia_io[0].ir_addr, SATLINK_IOSIZE, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } @@ -205,7 +205,7 @@ satlinkattach(struct device *parent, struct device *self, void *aux) (bus_space_read_1(iot, ioh, SATLINK_SER_H) << 24); printf("%s: mfrid 0x%x, grpid 0x%x, userid 0x%x, serial %d\n", - sc->sc_dev.dv_xname, sc->sc_id.sid_mfrid, + device_xname(&sc->sc_dev), sc->sc_id.sid_mfrid, sc->sc_id.sid_grpid, sc->sc_id.sid_userid, sc->sc_id.sid_serial); @@ -217,21 +217,20 @@ satlinkattach(struct device *parent, struct device *self, void *aux) /* Allocate and map the ring buffer. */ if (isa_dmamem_alloc(sc->sc_ic, sc->sc_drq, sc->sc_bufsize, &ringaddr, BUS_DMA_NOWAIT)) { - printf("%s: can't allocate ring buffer\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't allocate ring buffer\n"); return; } if (isa_dmamem_map(sc->sc_ic, sc->sc_drq, ringaddr, sc->sc_bufsize, &sc->sc_buf, BUS_DMA_NOWAIT|BUS_DMA_COHERENT)) { - printf("%s: can't map ring buffer\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map ring buffer\n"); isa_dmamem_free(sc->sc_ic, sc->sc_drq, ringaddr, sc->sc_bufsize); return; } if (isa_drq_alloc(sc->sc_ic, sc->sc_drq) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->sc_drq); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->sc_drq); isa_dmamem_unmap(sc->sc_ic, sc->sc_drq, sc->sc_buf, sc->sc_bufsize); isa_dmamem_free(sc->sc_ic, sc->sc_drq, ringaddr, @@ -242,7 +241,7 @@ satlinkattach(struct device *parent, struct device *self, void *aux) /* Create the DMA map. */ if (isa_dmamap_create(sc->sc_ic, sc->sc_drq, sc->sc_bufsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't create DMA map\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't create DMA map\n"); isa_dmamem_unmap(sc->sc_ic, sc->sc_drq, sc->sc_buf, sc->sc_bufsize); isa_dmamem_free(sc->sc_ic, sc->sc_drq, ringaddr, diff --git a/sys/dev/isa/seagate.c b/sys/dev/isa/seagate.c index 6c2ff9c77e43..bafa981c08f0 100644 --- a/sys/dev/isa/seagate.c +++ b/sys/dev/isa/seagate.c @@ -1,4 +1,4 @@ -/* $NetBSD: seagate.c,v 1.63 2007/10/19 12:00:22 ad Exp $ */ +/* $NetBSD: seagate.c,v 1.64 2008/04/08 20:08:50 cegger Exp $ */ /* * ST01/02, Future Domain TMC-885, TMC-950 SCSI driver @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: seagate.c,v 1.63 2007/10/19 12:00:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: seagate.c,v 1.64 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -315,7 +315,7 @@ sea_queue_length(sea) scb = scb->chain.tqe_next, issued++); for (scb = sea->nexus_list.tqh_first, disconnected = 0; scb; scb = scb->chain.tqe_next, disconnected++); - printf("%s: length: %d/%d/%d\n", sea->sc_dev.dv_xname, connected, + printf("%s: length: %d/%d/%d\n", device_xname(&sea->sc_dev), connected, issued, disconnected); } #endif @@ -423,7 +423,7 @@ seaattach(struct device *parent, struct device *self, void *aux) default: #ifdef DEBUG printf("%s: board type unknown at address %p\n", - sea->sc_dev.dv_xname, sea->maddr); + device_xname(&sea->sc_dev), sea->maddr); #endif return; } @@ -434,7 +434,7 @@ seaattach(struct device *parent, struct device *self, void *aux) if ((*((u_char *)sea->maddr + SEA_RAMOFFSET) != 0xa5) || (*((u_char *)sea->maddr + SEA_RAMOFFSET + 1) != 0x5a)) { - printf("%s: board RAM failure\n", sea->sc_dev.dv_xname); + aprint_error_dev(&sea->sc_dev, "board RAM failure\n"); return; } @@ -495,7 +495,7 @@ loop: if (STATUS & STAT_PARITY) { /* Parity error interrupt */ - printf("%s: parity error\n", sea->sc_dev.dv_xname); + aprint_error_dev(&sea->sc_dev, "parity error\n"); return 1; } @@ -579,7 +579,7 @@ sea_scsipi_request(chan, req, arg) /* XXX Reset not implemented. */ if (flags & XS_CTL_RESET) { - printf("%s: resetting\n", sea->sc_dev.dv_xname); + printf("%s: resetting\n", device_xname(&sea->sc_dev)); xs->error = XS_DRIVER_STUFFUP; scsipi_done(xs); return; @@ -886,7 +886,7 @@ sea_reselect(sea) int abort = 0; if (!((target_mask = STATUS) & STAT_SEL)) { - printf("%s: wrong state 0x%x\n", sea->sc_dev.dv_xname, + printf("%s: wrong state 0x%x\n", device_xname(&sea->sc_dev), target_mask); return; } @@ -901,7 +901,7 @@ sea_reselect(sea) /* see that we really are the initiator */ if (!(target_mask & sea->our_id_mask)) { printf("%s: polled reselection was not for me: 0x%x\n", - sea->sc_dev.dv_xname, target_mask); + device_xname(&sea->sc_dev), target_mask); return; } /* find target who won */ @@ -923,7 +923,7 @@ sea_reselect(sea) if (!MSG_ISIDENTIFY(msg[0])) { printf("%s: expecting IDENTIFY message, got 0x%x\n", - sea->sc_dev.dv_xname, msg[0]); + device_xname(&sea->sc_dev), msg[0]); abort = 1; scb = NULL; } else { @@ -944,7 +944,7 @@ sea_reselect(sea) } if (!scb) { printf("%s: target %02x lun %d not disconnected\n", - sea->sc_dev.dv_xname, target_mask, lun); + device_xname(&sea->sc_dev), target_mask, lun); /* * Since we have an established nexus that we can't do * anything with, we must abort it. @@ -991,7 +991,7 @@ sea_transfer_pio(sea, phase, count, data) break; if (!(tmp & STAT_REQ)) { printf("%s: timeout waiting for STAT_REQ\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); break; } @@ -1032,7 +1032,7 @@ sea_transfer_pio(sea, phase, count, data) break; if (STATUS & STAT_REQ) printf("%s: timeout on wait for !STAT_REQ", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); #endif } while (--c); @@ -1075,11 +1075,11 @@ sea_select(sea, scb) break; if (!(STATUS & STAT_ARB_CMPL)) { if (STATUS & STAT_SEL) { - printf("%s: arbitration lost\n", sea->sc_dev.dv_xname); + printf("%s: arbitration lost\n", device_xname(&sea->sc_dev)); scb->flags |= SCB_ERROR; } else { printf("%s: arbitration timeout\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); scb->flags |= SCB_TIMEOUT; } CONTROL = BASE_CMD; @@ -1139,7 +1139,7 @@ sea_select(sea, scb) } if (!(STATUS & STAT_BSY)) printf("%s: after successful arbitrate: no STAT_BSY!\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); sea->nexus = scb; sea->busy[scb->xs->xs_periph->periph_target] |= @@ -1281,14 +1281,14 @@ sea_information_transfer(sea) tmp = STATUS; if (tmp & STAT_PARITY) printf("%s: parity error detected\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); if (!(tmp & STAT_BSY)) { for (loop = 0; loop < 20; loop++) if ((tmp = STATUS) & STAT_BSY) break; if (!(tmp & STAT_BSY)) { printf("%s: !STAT_BSY unit in data transfer!\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); s = splbio(); sea->nexus = NULL; scb->flags = SCB_ERROR; @@ -1314,7 +1314,7 @@ sea_information_transfer(sea) case PH_DATAOUT: #ifdef SEA_NODATAOUT printf("%s: SEA_NODATAOUT set, attempted DATAOUT aborted\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); msgout = MSG_ABORT; CONTROL = BASE_CMD | CMD_ATTN; break; @@ -1330,7 +1330,7 @@ sea_information_transfer(sea) break; if (!(tmp & STAT_REQ)) { printf("%s: timeout waiting for STAT_REQ\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); /* XXX Do something? */ } if (sea->type == FDOMAIN840) @@ -1407,7 +1407,7 @@ sea_information_transfer(sea) return; case MSG_MESSAGE_REJECT: printf("%s: message_reject received\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); break; case MSG_DISCONNECT: s = splbio(); @@ -1429,7 +1429,7 @@ sea_information_transfer(sea) * message. */ printf("%s: unknown message in: %x\n", - sea->sc_dev.dv_xname, tmp); + device_xname(&sea->sc_dev), tmp); break; } /* switch (tmp) */ break; @@ -1440,7 +1440,7 @@ sea_information_transfer(sea) sea_transfer_pio(sea, &phase, &len, &data); if (msgout == MSG_ABORT) { printf("%s: sent message abort to target\n", - sea->sc_dev.dv_xname); + device_xname(&sea->sc_dev)); s = splbio(); sea->busy[scb->xs->xs_periph->periph_target] &= ~(1 << scb->xs->xs_periph->periph_lun); @@ -1470,7 +1470,7 @@ sea_information_transfer(sea) } /* for (...) */ /* If we get here we have got a timeout! */ - printf("%s: timeout in data transfer\n", sea->sc_dev.dv_xname); + printf("%s: timeout in data transfer\n", device_xname(&sea->sc_dev)); scb->flags = SCB_TIMEOUT; /* XXX Should I clear scsi-bus state? */ sea_done(sea, scb); diff --git a/sys/dev/isa/tcic2_isa.c b/sys/dev/isa/tcic2_isa.c index 6b5462771fbc..f8bd6899f2b2 100644 --- a/sys/dev/isa/tcic2_isa.c +++ b/sys/dev/isa/tcic2_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcic2_isa.c,v 1.19 2008/03/29 17:36:45 ad Exp $ */ +/* $NetBSD: tcic2_isa.c,v 1.20 2008/04/08 20:08:50 cegger Exp $ */ /* * @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcic2_isa.c,v 1.19 2008/03/29 17:36:45 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcic2_isa.c,v 1.20 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -271,8 +271,8 @@ tcic_isa_attach(struct device *parent, struct device *self, void *aux) if (isa_intr_alloc(ic, sc->validirqs & (tcic_isa_intr_alloc_mask & 0xff00), IST_EDGE, &sc->irq)) { - printf("\n%s: can't allocate interrupt\n", - sc->dev.dv_xname); + aprint_normal("\n"); + aprint_error_dev(&sc->dev, "can't allocate interrupt\n"); return; } printf(": using irq %d", sc->irq); @@ -314,7 +314,7 @@ tcic_isa_attach(struct device *parent, struct device *self, void *aux) #endif DPRINTF(("%s: bus_space_alloc range 0x%04lx-0x%04lx)\n", - sc->dev.dv_xname, (long) sc->iobase, + device_xname(&sc->dev), (long) sc->iobase, (long) sc->iobase + sc->iosize)); if (tcic_isa_alloc_iobase && tcic_isa_alloc_iosize) { @@ -322,13 +322,13 @@ tcic_isa_attach(struct device *parent, struct device *self, void *aux) sc->iosize = tcic_isa_alloc_iosize; DPRINTF(("%s: bus_space_alloc range 0x%04lx-0x%04lx " - "(config override)\n", sc->dev.dv_xname, (long) sc->iobase, + "(config override)\n", device_xname(&sc->dev), (long) sc->iobase, (long) sc->iobase + sc->iosize)); } sc->ih = isa_intr_establish(ic, sc->irq, IST_EDGE, IPL_TTY, tcic_intr, sc); if (sc->ih == NULL) { - printf("%s: can't establish interrupt\n", sc->dev.dv_xname); + printf("%s: can't establish interrupt\n", device_xname(&sc->dev)); return; } @@ -347,7 +347,7 @@ tcic_isa_chip_intr_establish(pch, pf, ipl, fct, arg) int irq, ist; void *ih; - DPRINTF(("%s: tcic_isa_chip_intr_establish\n", h->sc->dev.dv_xname)); + DPRINTF(("%s: tcic_isa_chip_intr_establish\n", device_xname(&h->sc->dev))); /* XXX should we convert level to pulse? -chb */ if (pf->cfe->flags & PCMCIA_CFE_IRQLEVEL) @@ -364,11 +364,11 @@ tcic_isa_chip_intr_establish(pch, pf, ipl, fct, arg) fct, arg)) == NULL) return (NULL); - DPRINTF(("%s: intr estrablished\n", h->sc->dev.dv_xname)); + DPRINTF(("%s: intr estrablished\n", device_xname(&h->sc->dev))); h->ih_irq = irq; - printf("%s: card irq %d\n", h->pcmcia->dv_xname, irq); + printf("%s: card irq %d\n", device_xname(h->pcmcia), irq); return (ih); } @@ -381,7 +381,7 @@ tcic_isa_chip_intr_disestablish(pch, ih) struct tcic_handle *h = (struct tcic_handle *) pch; int val, reg; - DPRINTF(("%s: tcic_isa_chip_intr_disestablish\n", h->sc->dev.dv_xname)); + DPRINTF(("%s: tcic_isa_chip_intr_disestablish\n", device_xname(&h->sc->dev))); h->ih_irq = 0; diff --git a/sys/dev/isa/tcom.c b/sys/dev/isa/tcom.c index 52ce8e970488..557152955f4b 100644 --- a/sys/dev/isa/tcom.c +++ b/sys/dev/isa/tcom.c @@ -1,4 +1,4 @@ -/* $NetBSD: tcom.c,v 1.14 2007/10/19 12:00:23 ad Exp $ */ +/* $NetBSD: tcom.c,v 1.15 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tcom.c,v 1.14 2007/10/19 12:00:23 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tcom.c,v 1.15 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -206,15 +206,14 @@ tcomattach(struct device *parent, struct device *self, void *aux) if (!com_is_console(iot, iobase, &sc->sc_slaveioh[i]) && bus_space_map(iot, iobase, COM_NPORTS, 0, &sc->sc_slaveioh[i])) { - printf("%s: can't map i/o space for slave %d\n", - sc->sc_dev.dv_xname, i); + aprint_error_dev(&sc->sc_dev, "can't map i/o space for slave %d\n", i); return; } } if (bus_space_map(iot, sc->sc_iobase + STATUS_OFFSET, STATUS_SIZE, 0, &sc->sc_statusioh)) { - printf("%s: can't map status space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map status space\n"); return; } diff --git a/sys/dev/isa/toaster.c b/sys/dev/isa/toaster.c index ea32f74a3b4e..ff6efaf2adb9 100644 --- a/sys/dev/isa/toaster.c +++ b/sys/dev/isa/toaster.c @@ -1,4 +1,4 @@ -/* $NetBSD: toaster.c,v 1.5 2007/10/19 12:00:23 ad Exp $ */ +/* $NetBSD: toaster.c,v 1.6 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: toaster.c,v 1.5 2007/10/19 12:00:23 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: toaster.c,v 1.6 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -247,9 +247,9 @@ toaster_attach(parent, self, aux) TSDIO_SETBITS(PBDR, 0xf0); /* Turn off LED's */ aprint_normal(": internal toaster control outputs\n"); - aprint_normal("%s: using port B, bits 4-7 for front panel LEDs\n", sc->sc_dev.dv_xname); - aprint_normal("%s: using port A, bit 0 for magnetic latch\n", sc->sc_dev.dv_xname); - aprint_normal("%s: using port A, bit 1 for burner element\n", sc->sc_dev.dv_xname); + aprint_normal_dev(&sc->sc_dev, "using port B, bits 4-7 for front panel LEDs\n"); + aprint_normal_dev(&sc->sc_dev, "using port A, bit 0 for magnetic latch\n"); + aprint_normal_dev(&sc->sc_dev, "using port A, bit 1 for burner element\n"); callout_init(&sc->led_callout[0], 0); callout_init(&sc->led_callout[1], 0); @@ -267,17 +267,15 @@ toaster_attach(parent, self, aux) CTLFLAG_PERMANENT, CTLTYPE_NODE, "hw", NULL, NULL, 0, NULL, 0, CTL_HW, CTL_EOL) != 0) { - printf("%s: could not create sysctl\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "could not create sysctl\n"); return; } if (sysctl_createv(NULL, 0, NULL, &node, - 0, CTLTYPE_NODE, sc->sc_dev.dv_xname, + 0, CTLTYPE_NODE, device_xname(&sc->sc_dev), NULL, NULL, 0, NULL, 0, CTL_HW, CTL_CREATE, CTL_EOL) != 0) { - printf("%s: could not create sysctl\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "could not create sysctl\n"); return; } @@ -292,8 +290,7 @@ toaster_attach(parent, self, aux) CTL_HW, node->sysctl_num, \ CTL_CREATE, CTL_EOL)) \ != 0) { \ - printf("%s: could not create sysctl\n", \ - sc->sc_dev.dv_xname); \ + aprint_error_dev(&sc->sc_dev, "could not create sysctl\n"); \ return; \ } \ sc->led_duty_sysctl[(x)] = datnode->sysctl_num; \ @@ -308,8 +305,7 @@ toaster_attach(parent, self, aux) CTL_HW, node->sysctl_num, \ CTL_CREATE, CTL_EOL)) \ != 0) { \ - printf("%s: could not create sysctl\n", \ - sc->sc_dev.dv_xname); \ + aprint_error_dev(&sc->sc_dev, "could not create sysctl\n"); \ return; \ } \ sc->led_width_sysctl[(x)] = datnode->sysctl_num; @@ -329,8 +325,7 @@ toaster_attach(parent, self, aux) CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL)) != 0) { - printf("%s: could not create sysctl\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "could not create sysctl\n"); return; } @@ -343,8 +338,7 @@ toaster_attach(parent, self, aux) CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL)) != 0) { - printf("%s: could not create sysctl\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "could not create sysctl\n"); return; } diff --git a/sys/dev/isa/toasterlcd.c b/sys/dev/isa/toasterlcd.c index 8e6114b4872d..58d233e9f586 100644 --- a/sys/dev/isa/toasterlcd.c +++ b/sys/dev/isa/toasterlcd.c @@ -1,4 +1,4 @@ -/* $NetBSD: toasterlcd.c,v 1.4 2007/10/19 12:00:23 ad Exp $ */ +/* $NetBSD: toasterlcd.c,v 1.5 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: toasterlcd.c,v 1.4 2007/10/19 12:00:23 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: toasterlcd.c,v 1.5 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -146,8 +146,8 @@ toasterlcd_attach(parent, self, aux) TSDIO_CLEARBITS(PBDR, 0xd); /* De-assert EN, De-assert RS */ aprint_normal(": 4x40 text-mode hd44780 LCD\n"); - aprint_normal("%s: using port C, bits 0-7 as DB0-DB7\n", sc->sc_dev.dv_xname); - aprint_normal("%s: using port B, bits 0-3 as RS, WR, EN1, EN2\n", sc->sc_dev.dv_xname); + aprint_normal_dev(&sc->sc_dev, "using port C, bits 0-7 as DB0-DB7\n"); + aprint_normal_dev(&sc->sc_dev, "using port B, bits 0-3 as RS, WR, EN1, EN2\n"); hd44780_attach_subr(&sc->sc_hlcd); diff --git a/sys/dev/isa/tsdio.c b/sys/dev/isa/tsdio.c index 2168e4b9f60a..7bc4db4216e1 100644 --- a/sys/dev/isa/tsdio.c +++ b/sys/dev/isa/tsdio.c @@ -1,4 +1,4 @@ -/* $NetBSD: tsdio.c,v 1.4 2007/10/19 12:00:23 ad Exp $ */ +/* $NetBSD: tsdio.c,v 1.5 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tsdio.c,v 1.4 2007/10/19 12:00:23 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tsdio.c,v 1.5 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -127,7 +127,7 @@ tsdio_attach(parent, self, aux) */ if (bus_space_map(sc->sc_iot, ia->ia_io[0].ir_addr, 8, 0, &sc->sc_ioh)) { - aprint_error("%s: unable to map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to map i/o space\n"); return; } diff --git a/sys/dev/isa/uha_isa.c b/sys/dev/isa/uha_isa.c index f5f49b876493..3992b43ac7a3 100644 --- a/sys/dev/isa/uha_isa.c +++ b/sys/dev/isa/uha_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: uha_isa.c,v 1.32 2007/10/19 12:00:23 ad Exp $ */ +/* $NetBSD: uha_isa.c,v 1.33 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uha_isa.c,v 1.32 2007/10/19 12:00:23 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uha_isa.c,v 1.33 2008/04/08 20:08:50 cegger Exp $"); #include "opt_ddb.h" @@ -155,7 +155,7 @@ uha_isa_attach(struct device *parent, struct device *self, void *aux) printf("\n"); if (bus_space_map(iot, ia->ia_io[0].ir_addr, UHA_ISA_IOSIZE, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } @@ -163,15 +163,14 @@ uha_isa_attach(struct device *parent, struct device *self, void *aux) sc->sc_ioh = ioh; sc->sc_dmat = dmat; if (!u14_find(iot, ioh, &upd)) { - printf("%s: u14_find failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "u14_find failed\n"); return; } if (upd.sc_drq != -1) { sc->sc_dmaflags = 0; if ((error = isa_dmacascade(ic, upd.sc_drq)) != 0) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "unable to cascade DRQ, error = %d\n", error); return; } } else { @@ -184,8 +183,7 @@ uha_isa_attach(struct device *parent, struct device *self, void *aux) sc->sc_ih = isa_intr_establish(ic, upd.sc_irq, IST_EDGE, IPL_BIO, u14_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } @@ -304,8 +302,7 @@ u14_start_mbox(sc, mscp) delay(100); } if (!spincount) { - printf("%s: uha_start_mbox, board not responding\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "uha_start_mbox, board not responding\n"); Debugger(); } @@ -365,7 +362,7 @@ u14_intr(arg) u_long mboxval; #ifdef UHADEBUG - printf("%s: uhaintr ", sc->sc_dev.dv_xname); + printf("%s: uhaintr ", device_xname(&sc->sc_dev)); #endif /*UHADEBUG */ if ((bus_space_read_1(iot, ioh, U14_SINT) & U14_SDIP) == 0) @@ -391,7 +388,7 @@ u14_intr(arg) mscp = uha_mscp_phys_kv(sc, mboxval); if (!mscp) { printf("%s: BAD MSCP RETURNED!\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); continue; /* whatever it was, it'll timeout */ } diff --git a/sys/dev/isa/wds.c b/sys/dev/isa/wds.c index d3bf2c7204c2..0414129e89d8 100644 --- a/sys/dev/isa/wds.c +++ b/sys/dev/isa/wds.c @@ -1,4 +1,4 @@ -/* $NetBSD: wds.c,v 1.67 2007/10/19 12:00:24 ad Exp $ */ +/* $NetBSD: wds.c,v 1.68 2008/04/08 20:08:50 cegger Exp $ */ /* * XXX @@ -86,7 +86,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wds.c,v 1.67 2007/10/19 12:00:24 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wds.c,v 1.68 2008/04/08 20:08:50 cegger Exp $"); #include "opt_ddb.h" @@ -337,7 +337,7 @@ wdsattach(struct device *parent, struct device *self, void *aux) printf("\n"); if (bus_space_map(iot, ia->ia_io[0].ir_addr, WDS_ISA_IOSIZE, 0, &ioh)) { - printf("%s: can't map i/o space\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map i/o space\n"); return; } @@ -345,7 +345,7 @@ wdsattach(struct device *parent, struct device *self, void *aux) sc->sc_ioh = ioh; sc->sc_dmat = ia->ia_dmat; if (!wds_find(iot, ioh, &wpd)) { - printf("%s: wds_find failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "wds_find failed\n"); return; } @@ -353,8 +353,7 @@ wdsattach(struct device *parent, struct device *self, void *aux) #ifdef notyet if (wpd.sc_drq != -1) { if ((error = isa_dmacascade(ic, wpd.sc_drq)) != 0) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "unable to cascade DRQ, error = %d\n", error); return; } } @@ -363,8 +362,7 @@ wdsattach(struct device *parent, struct device *self, void *aux) wdsintr, sc); #else if ((error = isa_dmacascade(ic, ia->ia_drq[0].ir_drq)) != 0) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "unable to cascade DRQ, error = %d\n", error); return; } @@ -372,8 +370,7 @@ wdsattach(struct device *parent, struct device *self, void *aux) IPL_BIO, wdsintr, sc); #endif if (sc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } @@ -439,14 +436,14 @@ wds_finish_scbs(sc) for (i = 0; i < WDS_MBX_SIZE; i++) { if (wmbi->stat != WDS_MBI_FREE) { printf("%s: mbi not in round-robin order\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); goto AGAIN; } wds_nextmbx(wmbi, wmbx, mbi); } #ifdef WDSDIAGnot printf("%s: mbi interrupt with no full mailboxes\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); #endif return; } @@ -456,7 +453,7 @@ AGAIN: scb = wds_scb_phys_kv(sc, phystol(wmbi->scb_addr)); if (!scb) { printf("%s: bad mbi scb pointer; skipping\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); goto next; } @@ -514,8 +511,7 @@ wdsintr(arg) break; default: - printf("%s: unrecognized interrupt type %02x", - sc->sc_dev.dv_xname, c); + aprint_error_dev(&sc->sc_dev, "unrecognized interrupt type %02x", c); break; } @@ -566,16 +562,14 @@ wds_init_scb(sc, scb) error = bus_dmamap_create(dmat, sizeof(struct wds_scb), 1, sizeof(struct wds_scb), 0, BUS_DMA_NOWAIT, &scb->dmamap_self); if (error) { - printf("%s: can't create scb dmamap_self\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't create scb dmamap_self\n"); return (error); } error = bus_dmamap_create(dmat, WDS_MAXXFER, WDS_NSEG, WDS_MAXXFER, 0, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, &scb->dmamap_xfer); if (error) { - printf("%s: can't create scb dmamap_xfer\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't create scb dmamap_xfer\n"); bus_dmamap_destroy(dmat, scb->dmamap_self); return (error); } @@ -586,8 +580,7 @@ wds_init_scb(sc, scb) error = bus_dmamap_load(dmat, scb->dmamap_self, scb, sizeof(struct wds_scb), NULL, BUS_DMA_NOWAIT); if (error) { - printf("%s: can't load scb dmamap_self\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't load scb dmamap_self\n"); bus_dmamap_destroy(dmat, scb->dmamap_self); bus_dmamap_destroy(dmat, scb->dmamap_xfer); return (error); @@ -628,16 +621,14 @@ wds_create_scbs(sc, mem, size) error = bus_dmamem_alloc(sc->sc_dmat, size, PAGE_SIZE, 0, &seg, 1, &rseg, BUS_DMA_NOWAIT); if (error) { - printf("%s: can't allocate memory for scbs\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't allocate memory for scbs\n"); return (error); } error = bus_dmamem_map(sc->sc_dmat, &seg, rseg, size, (void *)&scb, BUS_DMA_NOWAIT|BUS_DMA_COHERENT); if (error) { - printf("%s: can't map memory for scbs\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't map memory for scbs\n"); bus_dmamem_free(sc->sc_dmat, &seg, rseg); return (error); } @@ -647,8 +638,7 @@ wds_create_scbs(sc, mem, size) while (size > sizeof(struct wds_scb) && sc->sc_numscbs < WDS_SCB_MAX) { error = wds_init_scb(sc, scb); if (error) { - printf("%s: can't initialize scb\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't initialize scb\n"); return (error); } TAILQ_INSERT_TAIL(&sc->sc_free_scb, scb, chain); @@ -843,17 +833,15 @@ wds_done(sc, scb, stat) */ switch (scb->cmd.venderr) { case 0x00: - printf("%s: Is this " - "an error?\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "Is this " + "an error?\n"); /* Experiment. */ xs->error = XS_DRIVER_STUFFUP; break; case 0x01: #if 0 - printf("%s: OK, see SCSI " - "error field.\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "OK, see SCSI " + "error field.\n"); #endif if (scb->cmd.stat == SCSI_CHECK || scb->cmd.stat == SCSI_BUSY) { @@ -864,7 +852,7 @@ wds_done(sc, scb, stat) case 0x40: #if 0 printf("%s: DMA underrun!\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); #endif /* * Hits this if the target @@ -879,7 +867,7 @@ wds_done(sc, scb, stat) default: printf("%s: VENDOR ERROR " "%02x, scsi %02x\n", - sc->sc_dev.dv_xname, + device_xname(&sc->sc_dev), scb->cmd.venderr, scb->cmd.stat); /* Experiment. */ @@ -1077,7 +1065,7 @@ wds_inquire_setup_information(sc) goto out; /* Print the version number. */ - printf("%s: version %x.%02x ", sc->sc_dev.dv_xname, + printf("%s: version %x.%02x ", device_xname(&sc->sc_dev), scb->cmd.targ, scb->cmd.scb[0]); sc->sc_revision = (scb->cmd.targ << 8) | scb->cmd.scb[0]; /* Print out the version string. */ @@ -1135,7 +1123,7 @@ wds_scsipi_request(chan, req, arg) if (xs->xs_control & XS_CTL_RESET) { /* XXX Fix me! */ - printf("%s: reset!\n", sc->sc_dev.dv_xname); + printf("%s: reset!\n", device_xname(&sc->sc_dev)); wds_init(sc, 1); scsipi_done(xs); return; @@ -1147,8 +1135,7 @@ wds_scsipi_request(chan, req, arg) * Let's not worry about UIO. There isn't any code * for the non-SG boards anyway! */ - printf("%s: UIO is untested and disabled!\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "UIO is untested and disabled!\n"); xs->error = XS_DRIVER_STUFFUP; scsipi_done(xs); return; @@ -1175,8 +1162,8 @@ wds_scsipi_request(chan, req, arg) /* Zero out the command structure. */ if (xs->cmdlen > sizeof(scb->cmd.scb)) { - printf("%s: cmdlen %d too large for SCB\n", - sc->sc_dev.dv_xname, xs->cmdlen); + aprint_error_dev(&sc->sc_dev, "cmdlen %d too large for SCB\n", + xs->cmdlen); xs->error = XS_DRIVER_STUFFUP; goto out_bad; } @@ -1225,8 +1212,7 @@ wds_scsipi_request(chan, req, arg) default: xs->error = XS_DRIVER_STUFFUP; - printf("%s: error %d loading DMA map\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "error %d loading DMA map\n", error); out_bad: wds_free_scb(sc, scb); scsipi_done(xs); @@ -1398,7 +1384,7 @@ wds_timeout(arg) */ wds_collect_mbo(sc); if (scb->flags & SCB_SENDING) { - printf("%s: not taking commands!\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "not taking commands!\n"); Debugger(); } #endif diff --git a/sys/dev/isa/weasel_isa.c b/sys/dev/isa/weasel_isa.c index 56dd16e4125b..e82f17c2c116 100644 --- a/sys/dev/isa/weasel_isa.c +++ b/sys/dev/isa/weasel_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: weasel_isa.c,v 1.4 2007/10/19 12:00:24 ad Exp $ */ +/* $NetBSD: weasel_isa.c,v 1.5 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: weasel_isa.c,v 1.4 2007/10/19 12:00:24 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: weasel_isa.c,v 1.5 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -132,7 +132,7 @@ weasel_isa_init(struct weasel_handle *wh) * or something is wrong with it. */ printf("%s: PC-Weasel config block checksum mismatch " - "0x%02x != 0x%02x\n", wh->wh_parent->dv_xname, + "0x%02x != 0x%02x\n", device_xname(wh->wh_parent), sum, cfg.cksum); return; } @@ -178,14 +178,14 @@ weasel_isa_init(struct weasel_handle *wh) vers = mode = NULL; } - printf("%s: PC-Weasel, ", wh->wh_parent->dv_xname); + printf("%s: PC-Weasel, ", device_xname(wh->wh_parent)); if (vers != NULL) printf("version %s, %s mode", vers, mode); else printf("unknown version 0x%x", cfg.cfg_version); printf("\n"); - printf("%s: break passthrough %s", wh->wh_parent->dv_xname, + printf("%s: break passthrough %s", device_xname(wh->wh_parent), cfg.break_passthru ? "enabled" : "disabled"); if (cfg.wdt_msec == 0) { /* @@ -212,8 +212,8 @@ weasel_isa_init(struct weasel_handle *wh) wh->wh_smw.smw_period = wh->wh_wdog_period; if (sysmon_wdog_register(&wh->wh_smw) != 0) - printf("%s: unable to register PC-Weasel watchdog " - "with sysmon\n", wh->wh_parent->dv_xname); + aprint_error_dev(wh->wh_parent, "unable to register PC-Weasel watchdog " + "with sysmon\n"); } int @@ -266,8 +266,7 @@ weasel_isa_wdog_tickle(struct sysmon_wdog *smw) if (x == 1) { error = 0; } else { - printf("%s: Watchdog timer disabled on PC/Weasel! Disarming wdog.\n", - wh->wh_parent->dv_xname); + aprint_error_dev(wh->wh_parent, "Watchdog timer disabled on PC/Weasel! Disarming wdog.\n"); wh->wh_wdog_armed = 0; error = 1; } diff --git a/sys/dev/isa/wss_isa.c b/sys/dev/isa/wss_isa.c index dfe323f0a9b3..3a45102591e5 100644 --- a/sys/dev/isa/wss_isa.c +++ b/sys/dev/isa/wss_isa.c @@ -1,4 +1,4 @@ -/* $NetBSD: wss_isa.c,v 1.24 2007/10/19 12:00:24 ad Exp $ */ +/* $NetBSD: wss_isa.c,v 1.25 2008/04/08 20:08:50 cegger Exp $ */ /* * Copyright (c) 1994 John Brezak @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wss_isa.c,v 1.24 2007/10/19 12:00:24 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wss_isa.c,v 1.25 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -242,7 +242,7 @@ wss_isa_attach(struct device *parent, struct device *self, void *aux) ac = (struct ad1848_softc *)&sc->sc_ad1848; ia = (struct isa_attach_args *)aux; if (!wssfind(parent, sc, 0, ia)) { - printf("%s: wssfind failed\n", ac->sc_dev.dv_xname); + aprint_error_dev(&ac->sc_dev, "wssfind failed\n"); return; } diff --git a/sys/dev/isa/wt.c b/sys/dev/isa/wt.c index 1d932f4a7f2f..12b4d23ac7e8 100644 --- a/sys/dev/isa/wt.c +++ b/sys/dev/isa/wt.c @@ -1,4 +1,4 @@ -/* $NetBSD: wt.c,v 1.78 2007/10/19 12:00:24 ad Exp $ */ +/* $NetBSD: wt.c,v 1.79 2008/04/08 20:08:50 cegger Exp $ */ /* * Streamer tape driver. @@ -51,7 +51,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wt.c,v 1.78 2007/10/19 12:00:24 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wt.c,v 1.79 2008/04/08 20:08:50 cegger Exp $"); #include #include @@ -297,7 +297,7 @@ wtattach(struct device *parent, struct device *self, void *aux) } /* what happened? */ - printf("%s: lost controller\n", self->dv_xname); + aprint_error_dev(self, "lost controller\n"); return; ok: @@ -307,21 +307,20 @@ ok: sc->chan = ia->ia_drq[0].ir_drq; if ((maxsize = isa_dmamaxsize(sc->sc_ic, sc->chan)) < MAXPHYS) { - printf("%s: max DMA size %lu is less than required %d\n", - sc->sc_dev.dv_xname, (u_long)maxsize, MAXPHYS); + aprint_error_dev(&sc->sc_dev, "max DMA size %lu is less than required %d\n", + (u_long)maxsize, MAXPHYS); return; } if (isa_drq_alloc(sc->sc_ic, sc->chan) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->chan); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->chan); return; } if (isa_dmamap_create(sc->sc_ic, sc->chan, MAXPHYS, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't set up ISA DMA map\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't set up ISA DMA map\n"); return; } @@ -409,8 +408,7 @@ wtopen(dev_t dev, int flag, int mode, struct lwp *l) /* Check the status of the controller. */ if (sc->error & TP_ILL) { - printf("%s: invalid tape density\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "invalid tape density\n"); return ENODEV; } } @@ -1082,7 +1080,7 @@ wtsense(struct wt_softc *sc, int verbose, int ignore) else if (error & TP_ILL) msg = "Illegal command"; if (msg) - printf("%s: %s\n", sc->sc_dev.dv_xname, msg); + printf("%s: %s\n", device_xname(&sc->sc_dev), msg); return 0; } diff --git a/sys/dev/isa/ym.c b/sys/dev/isa/ym.c index bf5dfcca5f0e..23fd391f0085 100644 --- a/sys/dev/isa/ym.c +++ b/sys/dev/isa/ym.c @@ -1,4 +1,4 @@ -/* $NetBSD: ym.c,v 1.33 2008/04/01 20:44:29 xtraeme Exp $ */ +/* $NetBSD: ym.c,v 1.34 2008/04/08 20:08:50 cegger Exp $ */ /*- * Copyright (c) 1999-2002 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ym.c,v 1.33 2008/04/01 20:44:29 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ym.c,v 1.34 2008/04/08 20:08:50 cegger Exp $"); #include "mpu_ym.h" #include "opt_ym.h" @@ -145,7 +145,7 @@ int ymdebug = 0; #else #define DPRINTF(x) #endif -#define DVNAME(softc) ((softc)->sc_ad1848.sc_ad1848.sc_dev.dv_xname) +#define DVNAME(softc) (device_xname(&(softc)->sc_ad1848.sc_ad1848.sc_dev)) int ym_getdev(void *, struct audio_device *); int ym_mixer_set_port(void *, mixer_ctrl_t *); diff --git a/sys/dev/isapnp/aha_isapnp.c b/sys/dev/isapnp/aha_isapnp.c index 0e4ddeb0bc47..8a60047e339e 100644 --- a/sys/dev/isapnp/aha_isapnp.c +++ b/sys/dev/isapnp/aha_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: aha_isapnp.c,v 1.13 2007/10/19 12:00:30 ad Exp $ */ +/* $NetBSD: aha_isapnp.c,v 1.14 2008/04/08 20:09:27 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aha_isapnp.c,v 1.13 2007/10/19 12:00:30 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aha_isapnp.c,v 1.14 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -89,8 +89,7 @@ aha_isapnp_attach(struct device *parent, struct device *self, printf("\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } @@ -99,32 +98,32 @@ aha_isapnp_attach(struct device *parent, struct device *self, sc->sc_dmat = ipa->ipa_dmat; if (!aha_find(sc->sc_iot, sc->sc_ioh, &apd)) { - printf("%s: aha_find failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "aha_find failed\n"); return; } if (ipa->ipa_ndrq == 0) { if (apd.sc_drq != -1) { printf("%s: no PnP drq, but card has one\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); return; } } else if (apd.sc_drq != ipa->ipa_drq[0].num) { printf("%s: card drq # (%d) != PnP # (%d)\n", - sc->sc_dev.dv_xname, apd.sc_drq, ipa->ipa_drq[0].num); + device_xname(&sc->sc_dev), apd.sc_drq, ipa->ipa_drq[0].num); return; } else { int error = isa_dmacascade(ipa->ipa_ic, ipa->ipa_drq[0].num); if (error) { - printf("%s: unable to cascade DRQ, error = %d\n", - sc->sc_dev.dv_xname, error); + aprint_error_dev(&sc->sc_dev, "unable to cascade DRQ, error = %d\n", + error); return; } } if (apd.sc_irq != ipa->ipa_irq[0].num) { printf("%s: card irq # (%d) != PnP # (%d)\n", - sc->sc_dev.dv_xname, apd.sc_irq, ipa->ipa_irq[0].num); + device_xname(&sc->sc_dev), apd.sc_irq, ipa->ipa_irq[0].num); return; } @@ -133,8 +132,7 @@ aha_isapnp_attach(struct device *parent, struct device *self, ipa->ipa_irq[0].type, IPL_BIO, aha_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); return; } diff --git a/sys/dev/isapnp/aic_isapnp.c b/sys/dev/isapnp/aic_isapnp.c index 7f1c59fb0f00..f14cc2371f18 100644 --- a/sys/dev/isapnp/aic_isapnp.c +++ b/sys/dev/isapnp/aic_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: aic_isapnp.c,v 1.15 2007/10/19 12:00:30 ad Exp $ */ +/* $NetBSD: aic_isapnp.c,v 1.16 2008/04/08 20:09:27 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: aic_isapnp.c,v 1.15 2007/10/19 12:00:30 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: aic_isapnp.c,v 1.16 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -93,8 +93,7 @@ aic_isapnp_attach(struct device *parent, struct device *self, printf("\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } @@ -102,7 +101,7 @@ aic_isapnp_attach(struct device *parent, struct device *self, sc->sc_ioh = ipa->ipa_io[0].h; if (!aic_find(sc->sc_iot, sc->sc_ioh)) { - printf("%s: couldn't find device\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't find device\n"); return; } @@ -112,6 +111,5 @@ aic_isapnp_attach(struct device *parent, struct device *self, isc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num, ipa->ipa_irq[0].type, IPL_BIO, aicintr, sc); if (isc->sc_ih == NULL) - printf("%s: couldn't establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt\n"); } diff --git a/sys/dev/isapnp/atppc_isapnp.c b/sys/dev/isapnp/atppc_isapnp.c index f537f06662cc..dc4aa9712159 100644 --- a/sys/dev/isapnp/atppc_isapnp.c +++ b/sys/dev/isapnp/atppc_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: atppc_isapnp.c,v 1.7 2007/10/19 12:00:30 ad Exp $ */ +/* $NetBSD: atppc_isapnp.c,v 1.8 2008/04/08 20:09:27 cegger Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atppc_isapnp.c,v 1.7 2007/10/19 12:00:30 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atppc_isapnp.c,v 1.8 2008/04/08 20:09:27 cegger Exp $"); #include "opt_atppc.h" @@ -109,8 +109,7 @@ atppc_isapnp_attach(struct device *parent, struct device *self, void *aux) printf(": AT Parallel Port\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } diff --git a/sys/dev/isapnp/ess_isapnp.c b/sys/dev/isapnp/ess_isapnp.c index 4f564946963c..93d80d38eefc 100644 --- a/sys/dev/isapnp/ess_isapnp.c +++ b/sys/dev/isapnp/ess_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ess_isapnp.c,v 1.18 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: ess_isapnp.c,v 1.19 2008/04/08 20:09:27 cegger Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ess_isapnp.c,v 1.18 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess_isapnp.c,v 1.19 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -103,7 +103,7 @@ ess_isapnp_attach(struct device *parent, struct device *self, printf("\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } @@ -120,11 +120,11 @@ ess_isapnp_attach(struct device *parent, struct device *self, sc->sc_audio2.drq = ipa->ipa_drq[1].num; if (!essmatch(sc)) { - printf("%s: essmatch failed\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "essmatch failed\n"); return; } - printf("%s", sc->sc_dev.dv_xname); + printf("%s", device_xname(&sc->sc_dev)); essattach(sc, 0); } diff --git a/sys/dev/isapnp/gus_isapnp.c b/sys/dev/isapnp/gus_isapnp.c index f8d386efcf8f..b89acc899481 100644 --- a/sys/dev/isapnp/gus_isapnp.c +++ b/sys/dev/isapnp/gus_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: gus_isapnp.c,v 1.31 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: gus_isapnp.c,v 1.32 2008/04/08 20:09:27 cegger Exp $ */ /* * Copyright (c) 1997, 1999 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gus_isapnp.c,v 1.31 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gus_isapnp.c,v 1.32 2008/04/08 20:09:27 cegger Exp $"); #include "guspnp.h" #if NGUSPNP > 0 @@ -157,8 +157,7 @@ gus_isapnp_attach(struct device *parent, struct device *self, gus_0 = 0; if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } @@ -188,14 +187,14 @@ gus_isapnp_attach(struct device *parent, struct device *self, sc->sc_play_maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_playdrq); if (isa_drq_alloc(sc->sc_ic, sc->sc_playdrq) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->sc_playdrq); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->sc_playdrq); return; } if (isa_dmamap_create(sc->sc_ic, sc->sc_playdrq, sc->sc_play_maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, sc->sc_playdrq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + sc->sc_playdrq); return; } } @@ -203,14 +202,14 @@ gus_isapnp_attach(struct device *parent, struct device *self, sc->sc_rec_maxsize = isa_dmamaxsize(sc->sc_ic, sc->sc_recdrq); if (isa_drq_alloc(sc->sc_ic, sc->sc_recdrq) != 0) { - printf("%s: can't reserve drq %d\n", - sc->sc_dev.dv_xname, sc->sc_recdrq); + aprint_error_dev(&sc->sc_dev, "can't reserve drq %d\n", + sc->sc_recdrq); return; } if (isa_dmamap_create(sc->sc_ic, sc->sc_recdrq, sc->sc_rec_maxsize, BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW)) { - printf("%s: can't create map for drq %d\n", - sc->sc_dev.dv_xname, sc->sc_recdrq); + aprint_error_dev(&sc->sc_dev, "can't create map for drq %d\n", + sc->sc_recdrq); return; } } @@ -222,7 +221,7 @@ gus_isapnp_attach(struct device *parent, struct device *self, sc->iw_cd = &guspnp_cd; sc->iw_hw_if = &guspnp_hw_if; - printf("%s: %s %s", sc->sc_dev.dv_xname, ipa->ipa_devident, + printf("%s: %s %s", device_xname(&sc->sc_dev), ipa->ipa_devident, ipa->ipa_devclass); iwattach(sc); diff --git a/sys/dev/isapnp/i82365_isapnp.c b/sys/dev/isapnp/i82365_isapnp.c index 11fdcb0feaca..cb9d07796629 100644 --- a/sys/dev/isapnp/i82365_isapnp.c +++ b/sys/dev/isapnp/i82365_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82365_isapnp.c,v 1.24 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: i82365_isapnp.c,v 1.25 2008/04/08 20:09:27 cegger Exp $ */ /* * Copyright (c) 1998 Bill Sommerfeld. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i82365_isapnp.c,v 1.24 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82365_isapnp.c,v 1.25 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -122,17 +122,16 @@ pcic_isapnp_attach(struct device *parent, struct device *self, printf("\n"); if (isapnp_config(iot, memt, ipa)) { - printf("%s: error in region allocation\n", sc->dev.dv_xname); + aprint_error_dev(&sc->dev, "error in region allocation\n"); return; } - printf("%s: %s %s", sc->dev.dv_xname, ipa->ipa_devident, + printf("%s: %s %s", device_xname(&sc->dev), ipa->ipa_devident, ipa->ipa_devclass); /* sanity check that we get at least one hunk of IO space.. */ if (ipa->ipa_nio < 1) { - printf("%s: failed to get one chunk of i/o space\n", - sc->dev.dv_xname); + aprint_error_dev(&sc->dev, "failed to get one chunk of i/o space\n"); return; } diff --git a/sys/dev/isapnp/if_an_isapnp.c b/sys/dev/isapnp/if_an_isapnp.c index 1543971b1253..7851e607520d 100644 --- a/sys/dev/isapnp/if_an_isapnp.c +++ b/sys/dev/isapnp/if_an_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_an_isapnp.c,v 1.16 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: if_an_isapnp.c,v 1.17 2008/04/08 20:09:27 cegger Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_an_isapnp.c,v 1.16 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_an_isapnp.c,v 1.17 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -111,15 +111,14 @@ an_isapnp_attach(struct device *parent, struct device *self, void *aux) printf("\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: can't configure isapnp resources\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "can't configure isapnp resources\n"); return; } sc->sc_iot = ipa->ipa_iot; sc->sc_ioh = ipa->ipa_io[0].h; - printf("%s: %s %s\n", sc->sc_dev.dv_xname, ipa->ipa_devident, + printf("%s: %s %s\n", device_xname(&sc->sc_dev), ipa->ipa_devident, ipa->ipa_devclass); /* This interface is always enabled. */ @@ -129,14 +128,12 @@ an_isapnp_attach(struct device *parent, struct device *self, void *aux) isc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num, ipa->ipa_irq[0].type, IPL_NET, an_intr, sc); if (isc->sc_ih == NULL) { - printf("%s: couldn't establish interrupt handler\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt handler\n"); return; } if (an_attach(sc) != 0) { - printf("%s: failed to attach controller\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "failed to attach controller\n"); isa_intr_disestablish(ipa->ipa_ic, isc->sc_ih); isc->sc_ih = NULL; } diff --git a/sys/dev/isapnp/if_cs_isapnp.c b/sys/dev/isapnp/if_cs_isapnp.c index 088555916066..3ea70322a7f8 100644 --- a/sys/dev/isapnp/if_cs_isapnp.c +++ b/sys/dev/isapnp/if_cs_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cs_isapnp.c,v 1.10 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: if_cs_isapnp.c,v 1.11 2008/04/08 20:09:27 cegger Exp $ */ /*- * Copyright (c)2001 YAMAMOTO Takashi, @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cs_isapnp.c,v 1.10 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cs_isapnp.c,v 1.11 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -55,7 +55,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_cs_isapnp.c,v 1.10 2007/10/19 12:00:31 ad Exp $") #include #include -#define DEVNAME(sc) (sc)->sc_dev.dv_xname +#define DEVNAME(sc) device_xname(&((sc)->sc_dev)) int cs_isapnp_match(struct device *, struct cfdata *, void *); void cs_isapnp_attach(struct device *, struct device *, void *); diff --git a/sys/dev/isapnp/if_ep_isapnp.c b/sys/dev/isapnp/if_ep_isapnp.c index c5df7e17bb0a..beadd1d84f9c 100644 --- a/sys/dev/isapnp/if_ep_isapnp.c +++ b/sys/dev/isapnp/if_ep_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_ep_isapnp.c,v 1.32 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: if_ep_isapnp.c,v 1.33 2008/04/08 20:09:27 cegger Exp $ */ /* * Copyright (c) 1997 Jonathan Stone @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_ep_isapnp.c,v 1.32 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ep_isapnp.c,v 1.33 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -91,11 +91,11 @@ ep_isapnp_attach(struct device *parent, struct device *self, void *aux) printf("\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } - printf("%s: %s %s\n", sc->sc_dev.dv_xname, ipa->ipa_devident, + printf("%s: %s %s\n", device_xname(&sc->sc_dev), ipa->ipa_devident, ipa->ipa_devclass); sc->sc_iot = ipa->ipa_iot; diff --git a/sys/dev/isapnp/if_fmv_isapnp.c b/sys/dev/isapnp/if_fmv_isapnp.c index dd815eb8ce91..06949879e39a 100644 --- a/sys/dev/isapnp/if_fmv_isapnp.c +++ b/sys/dev/isapnp/if_fmv_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_fmv_isapnp.c,v 1.9 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: if_fmv_isapnp.c,v 1.10 2008/04/08 20:09:27 cegger Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_fmv_isapnp.c,v 1.9 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_fmv_isapnp.c,v 1.10 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -109,6 +109,5 @@ fmv_isapnp_attach(struct device *parent, struct device *self, isc->sc_ih = isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num, ipa->ipa_irq[0].type, IPL_NET, mb86960_intr, sc); if (isc->sc_ih == NULL) - printf("%s: couldn't establish interrupt handler\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt handler\n"); } diff --git a/sys/dev/isapnp/if_tr_isapnp.c b/sys/dev/isapnp/if_tr_isapnp.c index a0e9dba2ad64..5de06003476a 100644 --- a/sys/dev/isapnp/if_tr_isapnp.c +++ b/sys/dev/isapnp/if_tr_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_tr_isapnp.c,v 1.16 2007/10/19 12:00:31 ad Exp $ */ +/* $NetBSD: if_tr_isapnp.c,v 1.17 2008/04/08 20:09:27 cegger Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tr_isapnp.c,v 1.16 2007/10/19 12:00:31 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tr_isapnp.c,v 1.17 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -98,11 +98,11 @@ tr_isapnp_attach(struct device *parent, struct device *self, printf("\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } - printf("%s: %s %s\n", sc->sc_dev.dv_xname, ipa->ipa_devident, + printf("%s: %s %s\n", device_xname(&sc->sc_dev), ipa->ipa_devident, ipa->ipa_devclass); sc->sc_piot = ipa->ipa_iot; diff --git a/sys/dev/isapnp/isic_isapnp.c b/sys/dev/isapnp/isic_isapnp.c index e3b24e6e5c64..6c96616434ca 100644 --- a/sys/dev/isapnp/isic_isapnp.c +++ b/sys/dev/isapnp/isic_isapnp.c @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.27 2007/10/19 12:00:32 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isapnp.c,v 1.28 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -187,7 +187,7 @@ isic_isapnp_probe(struct device *parent, #define TERMFMT " " #else #define ISIC_FMT "%s: " -#define ISIC_PARM sc->sc_dev.dv_xname +#define ISIC_PARM device_xname(&sc->sc_dev) #define TERMFMT "\n" #endif @@ -219,8 +219,7 @@ isic_isapnp_attach(struct device *parent, int i; if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "error in region allocation\n"); return; } @@ -241,8 +240,7 @@ isic_isapnp_attach(struct device *parent, /* establish interrupt handler */ if (isa_intr_establish(ipa->ipa_ic, ipa->ipa_irq[0].num, ipa->ipa_irq[0].type, IPL_NET, isicintr, sc) == NULL) - printf("%s: couldn't establish interrupt handler\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "couldn't establish interrupt handler\n"); /* init card */ desc->attach(sc); diff --git a/sys/dev/isapnp/isic_isapnp_dynalink.c b/sys/dev/isapnp/isic_isapnp_dynalink.c index 9e4cb00ab21f..deadd4e20715 100644 --- a/sys/dev/isapnp/isic_isapnp_dynalink.c +++ b/sys/dev/isapnp/isic_isapnp_dynalink.c @@ -33,7 +33,7 @@ * isdn4bsd layer1 driver for Dynalink IS64PH isdn TA * ================================================== * - * $Id: isic_isapnp_dynalink.c,v 1.9 2007/10/19 12:00:32 ad Exp $ + * $Id: isic_isapnp_dynalink.c,v 1.10 2008/04/08 20:09:27 cegger Exp $ * * last edit-date: [Fri Jan 5 11:38:29 2001] * @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: isic_isapnp_dynalink.c,v 1.9 2007/10/19 12:00:32 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isapnp_dynalink.c,v 1.10 2008/04/08 20:09:27 cegger Exp $"); #include "opt_isicpnp.h" #ifdef ISICPNP_DYNALINK @@ -431,11 +431,11 @@ void isic_attach_Dyn(struct isic_softc *sc) if( ((HSCX_READ(0, H_VSTR) & 0xf) != 0x5) || ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) ) { printf("%s: HSCX VSTR test failed for Dynalink PnP\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); printf("%s: HSC0: VSTR: %#x\n", - sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR)); + device_xname(&sc->sc_dev), HSCX_READ(0, H_VSTR)); printf("%s: HSC1: VSTR: %#x\n", - sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR)); + device_xname(&sc->sc_dev), HSCX_READ(1, H_VSTR)); return; } diff --git a/sys/dev/isapnp/isic_isapnp_sws.c b/sys/dev/isapnp/isic_isapnp_sws.c index 70b85a9be04e..5070d6575d75 100644 --- a/sys/dev/isapnp/isic_isapnp_sws.c +++ b/sys/dev/isapnp/isic_isapnp_sws.c @@ -47,7 +47,7 @@ * EXPERIMENTAL !!!! * ================= * - * $Id: isic_isapnp_sws.c,v 1.12 2007/10/19 12:00:32 ad Exp $ + * $Id: isic_isapnp_sws.c,v 1.13 2008/04/08 20:09:27 cegger Exp $ * * last edit-date: [Fri Jan 5 11:38:29 2001] * @@ -57,7 +57,7 @@ *---------------------------------------------------------------------------*/ #include -__KERNEL_RCSID(0, "$NetBSD: isic_isapnp_sws.c,v 1.12 2007/10/19 12:00:32 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_isapnp_sws.c,v 1.13 2008/04/08 20:09:27 cegger Exp $"); #include "opt_isicpnp.h" #ifdef ISICPNP_SEDLBAUER @@ -366,11 +366,11 @@ isic_attach_sws(struct isic_softc *sc) ((HSCX_READ(1, H_VSTR) & 0xf) != 0x5) ) { printf("%s: HSCX VSTR test failed for SWS PnP\n", - sc->sc_dev.dv_xname); + device_xname(&sc->sc_dev)); printf("%s: HSC0: VSTR: %#x\n", - sc->sc_dev.dv_xname, HSCX_READ(0, H_VSTR)); + device_xname(&sc->sc_dev), HSCX_READ(0, H_VSTR)); printf("%s: HSC1: VSTR: %#x\n", - sc->sc_dev.dv_xname, HSCX_READ(1, H_VSTR)); + device_xname(&sc->sc_dev), HSCX_READ(1, H_VSTR)); return; } diff --git a/sys/dev/isapnp/wss_isapnp.c b/sys/dev/isapnp/wss_isapnp.c index 94020b5b0ab9..6869761b184d 100644 --- a/sys/dev/isapnp/wss_isapnp.c +++ b/sys/dev/isapnp/wss_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: wss_isapnp.c,v 1.21 2007/10/19 12:00:33 ad Exp $ */ +/* $NetBSD: wss_isapnp.c,v 1.22 2008/04/08 20:09:27 cegger Exp $ */ /* * Copyright (c) 1997, 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wss_isapnp.c,v 1.21 2007/10/19 12:00:33 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wss_isapnp.c,v 1.22 2008/04/08 20:09:27 cegger Exp $"); #include #include @@ -106,12 +106,12 @@ wss_isapnp_attach(struct device *parent, struct device *self, printf("\n"); if (!isapnp_devmatch(aux, &isapnp_wss_devinfo, &variant)) { - printf("%s: match failed?\n", self->dv_xname); + aprint_error_dev(self, "match failed?\n"); return; } if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", self->dv_xname); + aprint_error_dev(self, "error in region allocation\n"); return; } @@ -163,11 +163,11 @@ wss_isapnp_attach(struct device *parent, struct device *self, ipa->ipa_ndrq > 1 ? ipa->ipa_drq[1].num : ipa->ipa_drq[0].num; if (!ad1848_isa_probe(&sc->sc_ad1848)) { - printf("%s: ad1848_probe failed\n", self->dv_xname); + aprint_error_dev(self, "ad1848_probe failed\n"); return; } - printf("%s: %s %s", self->dv_xname, ipa->ipa_devident, + aprint_error_dev(self, "%s %s", ipa->ipa_devident, ipa->ipa_devclass); wssattach(sc); diff --git a/sys/dev/isapnp/ym_isapnp.c b/sys/dev/isapnp/ym_isapnp.c index 1c637f97d0d9..7a88f418800c 100644 --- a/sys/dev/isapnp/ym_isapnp.c +++ b/sys/dev/isapnp/ym_isapnp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ym_isapnp.c,v 1.21 2006/11/16 01:33:05 christos Exp $ */ +/* $NetBSD: ym_isapnp.c,v 1.22 2008/04/08 20:09:27 cegger Exp $ */ /* * Copyright (c) 1991-1993 Regents of the University of California. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ym_isapnp.c,v 1.21 2006/11/16 01:33:05 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ym_isapnp.c,v 1.22 2008/04/08 20:09:27 cegger Exp $"); #include "mpu_ym.h" @@ -113,7 +113,7 @@ ym_isapnp_attach(struct device *parent, struct device *self, void *aux) printf("\n"); if (isapnp_config(ipa->ipa_iot, ipa->ipa_memt, ipa)) { - printf("%s: error in region allocation\n", self->dv_xname); + aprint_error_dev(self, "error in region allocation\n"); return; } @@ -135,7 +135,7 @@ ym_isapnp_attach(struct device *parent, struct device *self, void *aux) ac->sc_iot = sc->sc_iot; if (bus_space_subregion(sc->sc_iot, sc->sc_ioh, WSS_CODEC, AD1848_NPORT, &ac->sc_ioh)) { - printf("%s: bus_space_subregion failed\n", self->dv_xname); + aprint_error_dev(self, "bus_space_subregion failed\n"); return; } ac->mode = 2; @@ -143,7 +143,7 @@ ym_isapnp_attach(struct device *parent, struct device *self, void *aux) sc->sc_ad1848.sc_ic = sc->sc_ic; - printf("%s: %s %s", self->dv_xname, ipa->ipa_devident, + printf("%s: %s %s", device_xname(self), ipa->ipa_devident, ipa->ipa_devclass); ym_attach(sc); diff --git a/sys/dev/mii/acphy.c b/sys/dev/mii/acphy.c index 8e2f6997e144..497139a8b064 100644 --- a/sys/dev/mii/acphy.c +++ b/sys/dev/mii/acphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: acphy.c,v 1.20 2007/12/09 20:28:02 jmcneill Exp $ */ +/* $NetBSD: acphy.c,v 1.21 2008/04/08 20:10:20 cegger Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.20 2007/12/09 20:28:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.21 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -128,7 +128,7 @@ acphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) if (sc->mii_flags & MIIF_HAVEFIBER) { diff --git a/sys/dev/mii/amhphy.c b/sys/dev/mii/amhphy.c index 0ad58bc13c2d..cfa2b0996686 100644 --- a/sys/dev/mii/amhphy.c +++ b/sys/dev/mii/amhphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: amhphy.c,v 1.16 2007/12/09 20:28:02 jmcneill Exp $ */ +/* $NetBSD: amhphy.c,v 1.17 2008/04/08 20:10:20 cegger Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.16 2007/12/09 20:28:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.17 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -114,7 +114,7 @@ amhphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/bmtphy.c b/sys/dev/mii/bmtphy.c index 08c9764d921b..df1f16cf8a88 100644 --- a/sys/dev/mii/bmtphy.c +++ b/sys/dev/mii/bmtphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: bmtphy.c,v 1.24 2008/01/05 20:33:29 jdc Exp $ */ +/* $NetBSD: bmtphy.c,v 1.25 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: bmtphy.c,v 1.24 2008/01/05 20:33:29 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bmtphy.c,v 1.25 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -165,7 +165,7 @@ bmtphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 0abefe21cfea..d1326ec34755 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.36 2008/02/20 11:26:03 markd Exp $ */ +/* $NetBSD: brgphy.c,v 1.37 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.36 2008/02/20 11:26:03 markd Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.37 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -235,37 +235,32 @@ brgphyattach(struct device *parent, struct device *self, void *aux) switch (MII_MODEL(ma->mii_id2)) { case MII_MODEL_BROADCOM_BCM5400: sc->mii_funcs = &brgphy_5401_funcs; - aprint_normal("%s: using BCM5401 DSP patch\n", - sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, "using BCM5401 DSP patch\n"); break; case MII_MODEL_BROADCOM_BCM5401: if (MII_REV(ma->mii_id2) == 1 || MII_REV(ma->mii_id2) == 3) { sc->mii_funcs = &brgphy_5401_funcs; - aprint_normal("%s: using BCM5401 DSP patch\n", - sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, "using BCM5401 DSP patch\n"); } else sc->mii_funcs = &brgphy_funcs; break; case MII_MODEL_BROADCOM_BCM5411: sc->mii_funcs = &brgphy_5411_funcs; - aprint_normal("%s: using BCM5411 DSP patch\n", - sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, "using BCM5411 DSP patch\n"); break; #ifdef notyet /* unverified, untested */ case MII_MODEL_BROADCOM_BCM5703: sc->mii_funcs = &brgphy_5703_funcs; - aprint_normal("%s: using BCM5703 DSP patch\n", - sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, "using BCM5703 DSP patch\n"); break; #endif case MII_MODEL_BROADCOM_BCM5704: sc->mii_funcs = &brgphy_5704_funcs; - aprint_normal("%s: using BCM5704 DSP patch\n", - sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, "using BCM5704 DSP patch\n"); break; case MII_MODEL_BROADCOM_BCM5705: @@ -297,7 +292,7 @@ brgphyattach(struct device *parent, struct device *self, void *aux) if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); diff --git a/sys/dev/mii/ciphy.c b/sys/dev/mii/ciphy.c index 4b09c5a32e4b..00da39ebb7c4 100644 --- a/sys/dev/mii/ciphy.c +++ b/sys/dev/mii/ciphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.13 2007/12/09 20:28:02 jmcneill Exp $ */ +/* $NetBSD: ciphy.c,v 1.14 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.13 2007/12/09 20:28:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.14 2008/04/08 20:10:20 cegger Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -135,7 +135,7 @@ ciphyattach(struct device *parent, struct device *self, void *aux) PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else @@ -341,8 +341,7 @@ ciphy_status(sc) mii->mii_media_active |= IFM_1000_T; break; default: - printf("%s: unknown PHY speed %x\n", - sc->mii_dev.dv_xname, + aprint_error_dev(&sc->mii_dev, "unknown PHY speed %x\n", bmsr & CIPHY_AUXCSR_SPEED); break; } @@ -421,8 +420,8 @@ ciphy_fixup(struct mii_softc *sc) break; default: - printf("%s: unknown CICADA PHY model %x\n", - sc->mii_dev.dv_xname, model); + aprint_error_dev(&sc->mii_dev, "unknown CICADA PHY model %x\n", + model); break; } diff --git a/sys/dev/mii/dmphy.c b/sys/dev/mii/dmphy.c index 798c87f5ee14..3d1c0d0188f2 100644 --- a/sys/dev/mii/dmphy.c +++ b/sys/dev/mii/dmphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.29 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: dmphy.c,v 1.30 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.29 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.30 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -152,7 +152,7 @@ dmphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/exphy.c b/sys/dev/mii/exphy.c index 5330e51c7709..a3ed0e1377d3 100644 --- a/sys/dev/mii/exphy.c +++ b/sys/dev/mii/exphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: exphy.c,v 1.46 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: exphy.c,v 1.47 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: exphy.c,v 1.46 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exphy.c,v 1.47 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -142,8 +142,7 @@ exphyattach(struct device *parent, struct device *self, void *aux) * instances! */ if (mii->mii_instance != 0) { - aprint_error("%s: ignoring this PHY, non-zero instance\n", - sc->mii_dev.dv_xname); + aprint_error_dev(&sc->mii_dev, "ignoring this PHY, non-zero instance\n"); return; } sc->mii_flags |= MIIF_NOISOLATE; @@ -152,7 +151,7 @@ exphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/gentbi.c b/sys/dev/mii/gentbi.c index 70f1afecaf18..efe45c085dbe 100644 --- a/sys/dev/mii/gentbi.c +++ b/sys/dev/mii/gentbi.c @@ -1,4 +1,4 @@ -/* $NetBSD: gentbi.c,v 1.19 2007/12/09 20:28:02 jmcneill Exp $ */ +/* $NetBSD: gentbi.c,v 1.20 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -74,7 +74,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gentbi.c,v 1.19 2007/12/09 20:28:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gentbi.c,v 1.20 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -165,7 +165,7 @@ gentbiattach(struct device *parent, struct device *self, void *aux) if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); diff --git a/sys/dev/mii/glxtphy.c b/sys/dev/mii/glxtphy.c index 089f71443c90..62f57e2e2a32 100644 --- a/sys/dev/mii/glxtphy.c +++ b/sys/dev/mii/glxtphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: glxtphy.c,v 1.18 2007/12/09 20:28:02 jmcneill Exp $ */ +/* $NetBSD: glxtphy.c,v 1.19 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.18 2007/12/09 20:28:02 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.19 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -151,7 +151,7 @@ glxtphyattach(struct device *parent, struct device *self, void *aux) if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); diff --git a/sys/dev/mii/gphyter.c b/sys/dev/mii/gphyter.c index ffd4bae24e09..2c2598e7384e 100644 --- a/sys/dev/mii/gphyter.c +++ b/sys/dev/mii/gphyter.c @@ -1,4 +1,4 @@ -/* $NetBSD: gphyter.c,v 1.21 2008/01/20 07:58:19 msaitoh Exp $ */ +/* $NetBSD: gphyter.c,v 1.22 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.21 2008/01/20 07:58:19 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.22 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -170,7 +170,7 @@ gphyterattach(struct device *parent, struct device *self, void *aux) if (anar & ANAR_10_FD) sc->mii_capabilities |= (BMSR_10TFDX & ma->mii_capmask); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); @@ -179,7 +179,7 @@ gphyterattach(struct device *parent, struct device *self, void *aux) aprint_normal("\n"); strap = PHY_READ(sc, MII_GPHYTER_STRAP); - aprint_normal("%s: strapped to %s mode", sc->mii_dev.dv_xname, + aprint_normal_dev(&sc->mii_dev, "strapped to %s mode", (strap & STRAP_MS_VAL) ? "master" : "slave"); if (strap & STRAP_NC_MODE) aprint_normal(", pre-C5 BCM5400 compat enabled"); diff --git a/sys/dev/mii/icsphy.c b/sys/dev/mii/icsphy.c index 8856f93e1d04..5bb91a95e9a0 100644 --- a/sys/dev/mii/icsphy.c +++ b/sys/dev/mii/icsphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: icsphy.c,v 1.43 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: icsphy.c,v 1.44 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.43 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.44 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -156,7 +156,7 @@ icsphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/igphy.c b/sys/dev/mii/igphy.c index 83e223187c19..528af7f83f7f 100644 --- a/sys/dev/mii/igphy.c +++ b/sys/dev/mii/igphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: igphy.c,v 1.13 2007/12/09 20:28:03 jmcneill Exp $ */ +/* $NetBSD: igphy.c,v 1.14 2008/04/08 20:10:20 cegger Exp $ */ /* * The Intel copyright applies to the analog register setup, and the @@ -77,7 +77,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.13 2007/12/09 20:28:03 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.14 2008/04/08 20:10:20 cegger Exp $"); #include "opt_mii.h" @@ -167,7 +167,7 @@ igphyattach(struct device *parent, struct device *self, void *aux) PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); diff --git a/sys/dev/mii/ikphy.c b/sys/dev/mii/ikphy.c index 27a8de3786cb..e23b3c871690 100644 --- a/sys/dev/mii/ikphy.c +++ b/sys/dev/mii/ikphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: ikphy.c,v 1.5 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: ikphy.c,v 1.6 2008/04/08 20:10:20 cegger Exp $ */ /******************************************************************************* Copyright (c) 2001-2005, Intel Corporation @@ -64,7 +64,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.5 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.6 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -141,7 +141,7 @@ ikphyattach(struct device *parent, struct device *self, void *aux) PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); diff --git a/sys/dev/mii/inphy.c b/sys/dev/mii/inphy.c index 00aafe9babc0..4f0ccb77c279 100644 --- a/sys/dev/mii/inphy.c +++ b/sys/dev/mii/inphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: inphy.c,v 1.45 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: inphy.c,v 1.46 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.45 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.46 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -158,7 +158,7 @@ inphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/iophy.c b/sys/dev/mii/iophy.c index 01d3a1229bb6..bdcd9a9403bd 100644 --- a/sys/dev/mii/iophy.c +++ b/sys/dev/mii/iophy.c @@ -1,4 +1,4 @@ -/* $NetBSD: iophy.c,v 1.30 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: iophy.c,v 1.31 2008/04/08 20:10:20 cegger Exp $ */ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: iophy.c,v 1.30 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iophy.c,v 1.31 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -147,7 +147,7 @@ iophyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/lxtphy.c b/sys/dev/mii/lxtphy.c index 3713f707dc3a..529ae01320f8 100644 --- a/sys/dev/mii/lxtphy.c +++ b/sys/dev/mii/lxtphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: lxtphy.c,v 1.43 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: lxtphy.c,v 1.44 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.43 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.44 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -160,7 +160,7 @@ lxtphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if (sc->mii_flags & MIIF_HAVEFIBER) { #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) diff --git a/sys/dev/mii/makphy.c b/sys/dev/mii/makphy.c index 11ee8d73bd23..42a9e01de4d1 100644 --- a/sys/dev/mii/makphy.c +++ b/sys/dev/mii/makphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.25 2007/12/29 13:09:36 wiz Exp $ */ +/* $NetBSD: makphy.c,v 1.26 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.25 2007/12/29 13:09:36 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.26 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -161,7 +161,7 @@ makphyattach(struct device *parent, struct device *self, void *aux) if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 2fa3df095a5c..6574b979b40f 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -1,4 +1,4 @@ -/* $NetBSD: mii.c,v 1.44 2008/01/10 07:29:41 dyoung Exp $ */ +/* $NetBSD: mii.c,v 1.45 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -43,7 +43,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.44 2008/01/10 07:29:41 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mii.c,v 1.45 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -185,7 +185,7 @@ mii_activate(struct mii_data *mii, enum devact act, int phyloc, int offloc) case DVACT_DEACTIVATE: if (config_deactivate(&child->mii_dev) != 0) panic("%s: config_activate(%d) failed", - child->mii_dev.dv_xname, act); + device_xname(&child->mii_dev), act); } } } diff --git a/sys/dev/mii/mvphy.c b/sys/dev/mii/mvphy.c index dca87bf389e8..1068b8ceed76 100644 --- a/sys/dev/mii/mvphy.c +++ b/sys/dev/mii/mvphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: mvphy.c,v 1.5 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: mvphy.c,v 1.6 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 2006 Sam Leffler, Errno Consulting @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mvphy.c,v 1.5 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mvphy.c,v 1.6 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -206,7 +206,7 @@ mvphyattach(struct device *parent, struct device *self, void *aux) PHY_RESET(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else @@ -349,5 +349,5 @@ mvphy_flushatu(struct mii_softc *sc) MV_ATU_OP_FLUSH_ALL | MV_ATU_BUSY); } /*else printf("%s: timeout waiting for ATU flush\n", - sc->mii_dev.dv_xname);*/ + device_xname(&sc->mii_dev));*/ } diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c index 13ad7d2ee6ef..e5d2bff8243c 100644 --- a/sys/dev/mii/nsphy.c +++ b/sys/dev/mii/nsphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: nsphy.c,v 1.51 2007/12/29 19:34:55 dyoung Exp $ */ +/* $NetBSD: nsphy.c,v 1.52 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nsphy.c,v 1.51 2007/12/29 19:34:55 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsphy.c,v 1.52 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -147,7 +147,7 @@ nsphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/nsphyter.c b/sys/dev/mii/nsphyter.c index 8507f148c089..3c55b0a8f167 100644 --- a/sys/dev/mii/nsphyter.c +++ b/sys/dev/mii/nsphyter.c @@ -1,4 +1,4 @@ -/* $NetBSD: nsphyter.c,v 1.28 2008/01/20 07:58:19 msaitoh Exp $ */ +/* $NetBSD: nsphyter.c,v 1.29 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.28 2008/01/20 07:58:19 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.29 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -156,7 +156,7 @@ nsphyterattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/pnaphy.c b/sys/dev/mii/pnaphy.c index c23ba94abdc6..65df2940f240 100644 --- a/sys/dev/mii/pnaphy.c +++ b/sys/dev/mii/pnaphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: pnaphy.c,v 1.17 2007/12/09 20:28:04 jmcneill Exp $ */ +/* $NetBSD: pnaphy.c,v 1.18 2008/04/08 20:10:20 cegger Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -47,7 +47,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pnaphy.c,v 1.17 2007/12/09 20:28:04 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pnaphy.c,v 1.18 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -124,7 +124,7 @@ pnaphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/qsphy.c b/sys/dev/mii/qsphy.c index 6ee8d60f0518..d6576fe55304 100644 --- a/sys/dev/mii/qsphy.c +++ b/sys/dev/mii/qsphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: qsphy.c,v 1.42 2007/12/29 19:34:56 dyoung Exp $ */ +/* $NetBSD: qsphy.c,v 1.43 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.42 2007/12/29 19:34:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.43 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -146,7 +146,7 @@ qsphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c index 5374ebc6cb05..770d96381797 100644 --- a/sys/dev/mii/rgephy.c +++ b/sys/dev/mii/rgephy.c @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.19 2008/04/05 07:52:08 tsutsui Exp $ */ +/* $NetBSD: rgephy.c,v 1.20 2008/04/08 20:10:20 cegger Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.19 2008/04/05 07:52:08 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.20 2008/04/08 20:10:20 cegger Exp $"); /* @@ -149,7 +149,7 @@ rgephy_attach(struct device *parent, struct device *self, void *aux) * FreeBSD does not check EXSTAT, but instead adds gigabit * media explicitly. Why? */ - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if (sc->mii_capabilities & BMSR_EXTSTAT) { sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); } diff --git a/sys/dev/mii/rlphy.c b/sys/dev/mii/rlphy.c index 900900436b6a..69b095e0202c 100644 --- a/sys/dev/mii/rlphy.c +++ b/sys/dev/mii/rlphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: rlphy.c,v 1.20 2007/12/29 19:34:56 dyoung Exp $ */ +/* $NetBSD: rlphy.c,v 1.21 2008/04/08 20:10:20 cegger Exp $ */ /* $OpenBSD: rlphy.c,v 1.20 2005/07/31 05:27:30 pvalchev Exp $ */ /* @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.20 2007/12/29 19:34:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.21 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -134,7 +134,7 @@ rlphyattach(struct device *parent, struct device *self, void *aux) PHY_RESET(sc); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_MEDIAMASK) diff --git a/sys/dev/mii/sqphy.c b/sys/dev/mii/sqphy.c index 295311e15f2a..2aaecaf15de9 100644 --- a/sys/dev/mii/sqphy.c +++ b/sys/dev/mii/sqphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: sqphy.c,v 1.44 2007/12/29 19:34:56 dyoung Exp $ */ +/* $NetBSD: sqphy.c,v 1.45 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sqphy.c,v 1.44 2007/12/29 19:34:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sqphy.c,v 1.45 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -155,8 +155,7 @@ sqphyattach(struct device *parent, struct device *self, void *aux) switch (MII_MODEL(ma->mii_id2)) { case MII_MODEL_SEEQ_84220: sc->mii_funcs = &sqphy_84220_funcs; - aprint_normal("%s: using Seeq 84220 isolate/reset hack\n", - sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, "using Seeq 84220 isolate/reset hack\n"); break; default: @@ -167,7 +166,7 @@ sqphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c index bd28afca3203..4503afa44f47 100644 --- a/sys/dev/mii/tlphy.c +++ b/sys/dev/mii/tlphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: tlphy.c,v 1.53 2007/12/29 19:34:56 dyoung Exp $ */ +/* $NetBSD: tlphy.c,v 1.54 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.53 2007/12/29 19:34:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.54 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -179,7 +179,7 @@ tlphyattach(struct device *parent, struct device *self, void *aux) #define ADD(m, c) ifmedia_add(&mii->mii_media, (m), (c), NULL) #define PRINT(str) aprint_normal("%s%s", sep, str); sep = ", " - aprint_normal("%s: ", sc->sc_mii.mii_dev.dv_xname); + aprint_normal_dev(&sc->sc_mii.mii_dev, ""); if (sc->sc_tlphycap) { if (sc->sc_tlphycap & TLPHY_MEDIA_10_2) { ADD(IFM_MAKEWORD(IFM_ETHER, IFM_10_2, 0, @@ -328,7 +328,7 @@ tlphy_status(struct mii_softc *physc) mii->mii_media_active |= IFM_10_5; else printf("%s: AUI selected with no matching media !\n", - sc->sc_mii.mii_dev.dv_xname); + device_xname(&sc->sc_mii.mii_dev)); mii->mii_media_status |= IFM_ACTIVE; return; } diff --git a/sys/dev/mii/tqphy.c b/sys/dev/mii/tqphy.c index 1cfcdb2f84cd..4d751f2638ce 100644 --- a/sys/dev/mii/tqphy.c +++ b/sys/dev/mii/tqphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: tqphy.c,v 1.33 2007/12/29 19:34:56 dyoung Exp $ */ +/* $NetBSD: tqphy.c,v 1.34 2008/04/08 20:10:20 cegger Exp $ */ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tqphy.c,v 1.33 2007/12/29 19:34:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tqphy.c,v 1.34 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -159,7 +159,7 @@ tqphyattach(struct device *parent, struct device *self, void *aux) sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(self, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else diff --git a/sys/dev/mii/ukphy.c b/sys/dev/mii/ukphy.c index 7c89fc7ff1a4..15739fd1f400 100644 --- a/sys/dev/mii/ukphy.c +++ b/sys/dev/mii/ukphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: ukphy.c,v 1.32 2007/12/29 19:34:56 dyoung Exp $ */ +/* $NetBSD: ukphy.c,v 1.33 2008/04/08 20:10:20 cegger Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ukphy.c,v 1.32 2007/12/29 19:34:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ukphy.c,v 1.33 2008/04/08 20:10:20 cegger Exp $"); #include "opt_mii.h" @@ -142,13 +142,13 @@ ukphyattach(struct device *parent, struct device *self, void *aux) mii_knowndevs[i].model == model) break; if (mii_knowndevs[i].descr != NULL) - aprint_normal("%s: %s (OUI 0x%06x, model 0x%04x), rev. %d\n", - sc->mii_dev.dv_xname, mii_knowndevs[i].descr, + aprint_normal_dev(&sc->mii_dev, "%s (OUI 0x%06x, model 0x%04x), rev. %d\n", + mii_knowndevs[i].descr, oui, model, rev); else #endif - aprint_normal("%s: OUI 0x%06x, model 0x%04x, rev. %d\n", - sc->mii_dev.dv_xname, oui, model, rev); + aprint_normal_dev(&sc->mii_dev, "OUI 0x%06x, model 0x%04x, rev. %d\n", + oui, model, rev); sc->mii_inst = mii->mii_instance; sc->mii_phy = ma->mii_phyno; @@ -168,7 +168,7 @@ ukphyattach(struct device *parent, struct device *self, void *aux) PHY_READ(sc, MII_BMSR) & ma->mii_capmask; if (sc->mii_capabilities & BMSR_EXTSTAT) sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR); - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0 && (sc->mii_extcapabilities & EXTSR_MEDIAMASK) == 0) aprint_error("no media present"); diff --git a/sys/dev/mii/urlphy.c b/sys/dev/mii/urlphy.c index 1ea5410a1eac..3d72d0a095bd 100644 --- a/sys/dev/mii/urlphy.c +++ b/sys/dev/mii/urlphy.c @@ -1,4 +1,4 @@ -/* $NetBSD: urlphy.c,v 1.21 2007/12/29 19:34:56 dyoung Exp $ */ +/* $NetBSD: urlphy.c,v 1.22 2008/04/08 20:10:20 cegger Exp $ */ /* * Copyright (c) 2001, 2002 * Shingo WATANABE . All rights reserved. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.21 2007/12/29 19:34:56 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: urlphy.c,v 1.22 2008/04/08 20:10:20 cegger Exp $"); #include #include @@ -103,7 +103,7 @@ urlphy_attach(struct device *parent, struct device *self, void *aux) aprint_naive(": Media interface\n"); aprint_normal(": Realtek RTL8150L internal media interface\n"); - DPRINTF(("%s: %s: enter\n", sc->mii_dev.dv_xname, __func__)); + DPRINTF(("%s: %s: enter\n", device_xname(&sc->mii_dev), __func__)); sc->mii_inst = mii->mii_instance; sc->mii_phy = ma->mii_phyno; @@ -118,14 +118,13 @@ urlphy_attach(struct device *parent, struct device *self, void *aux) sc->mii_flags |= MIIF_NOISOLATE; if (mii->mii_instance != 0) { - aprint_error("%s: ignoring this PHY, non-zero instance\n", - sc->mii_dev.dv_xname); + aprint_error_dev(&sc->mii_dev, "ignoring this PHY, non-zero instance\n"); return; } PHY_RESET(sc); sc->mii_capabilities = PHY_READ(sc, MII_BMSR) & ma->mii_capmask; - aprint_normal("%s: ", sc->mii_dev.dv_xname); + aprint_normal_dev(&sc->mii_dev, ""); if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) aprint_error("no media present"); else @@ -142,7 +141,7 @@ urlphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; - DPRINTF(("%s: %s: enter\n", sc->mii_dev.dv_xname, __func__)); + DPRINTF(("%s: %s: enter\n", device_xname(&sc->mii_dev), __func__)); switch (cmd) { case MII_POLLSTAT: @@ -228,7 +227,7 @@ urlphy_status(struct mii_softc *sc) struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int msr, bmsr, bmcr; - DPRINTF(("%s: %s: enter\n", sc->mii_dev.dv_xname, __func__)); + DPRINTF(("%s: %s: enter\n", device_xname(&sc->mii_dev), __func__)); mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; @@ -241,7 +240,7 @@ urlphy_status(struct mii_softc *sc) if (msr & URLPHY_MSR_LINK) mii->mii_media_status |= IFM_ACTIVE; - DPRINTF(("%s: %s: link %s\n", sc->mii_dev.dv_xname, __func__, + DPRINTF(("%s: %s: link %s\n", device_xname(&sc->mii_dev), __func__, mii->mii_media_status & IFM_ACTIVE ? "up" : "down")); bmcr = PHY_READ(sc, MII_BMCR); diff --git a/sys/dev/mscp/mscp.c b/sys/dev/mscp/mscp.c index 3b40fbff5759..b1ebd7f4e5c0 100644 --- a/sys/dev/mscp/mscp.c +++ b/sys/dev/mscp/mscp.c @@ -1,4 +1,4 @@ -/* $NetBSD: mscp.c,v 1.28 2008/01/04 21:48:05 ad Exp $ */ +/* $NetBSD: mscp.c,v 1.29 2008/04/08 20:10:44 cegger Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mscp.c,v 1.28 2008/01/04 21:48:05 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mscp.c,v 1.29 2008/04/08 20:10:44 cegger Exp $"); #include #include @@ -205,7 +205,7 @@ loop: mi->mi_flags |= MSC_READY; } else { printf("%s: SETCTLRC failed: %d ", - mi->mi_dev.dv_xname, mp->mscp_status); + device_xname(&mi->mi_dev), mp->mscp_status); mscp_printevent(mp); } goto done; @@ -245,7 +245,7 @@ loop: case MSCPT_MAINTENANCE: default: printf("%s: unit %d: unknown message type 0x%x ignored\n", - mi->mi_dev.dv_xname, mp->mscp_unit, + device_xname(&mi->mi_dev), mp->mscp_unit, MSCP_MSGTYPE(mp->mscp_msgtc)); goto done; } @@ -266,7 +266,7 @@ loop: * invalid commands), but that is the way of it. */ if (st == M_ST_INVALCMD && mp->mscp_cmdref != 0) { - printf("%s: bad lbn (%d)?\n", drive->dv_xname, + printf("%s: bad lbn (%d)?\n", device_xname(drive), (int)mp->mscp_seq.seq_lbn); error = EIO; goto rwend; @@ -350,7 +350,7 @@ rwend: * No buffer means there is a bug somewhere! */ printf("%s: io done, but bad xfer number?\n", - drive->dv_xname); + device_xname(drive)); mscp_hexdump(mp); break; } @@ -417,7 +417,7 @@ out: * handle it (if it does replaces). */ if (me->me_replace == NULL) - printf("%s: bogus REPLACE end\n", drive->dv_xname); + printf("%s: bogus REPLACE end\n", device_xname(drive)); else (*me->me_replace)(drive, mp); break; @@ -429,7 +429,7 @@ out: */ unknown: printf("%s: unknown opcode 0x%x status 0x%x ignored\n", - drive->dv_xname, mp->mscp_opcode, mp->mscp_status); + device_xname(drive), mp->mscp_opcode, mp->mscp_status); #ifdef DIAGNOSTIC mscp_hexdump(mp); #endif diff --git a/sys/dev/mscp/mscp_disk.c b/sys/dev/mscp/mscp_disk.c index 79fdce097423..0b215c8543c8 100644 --- a/sys/dev/mscp/mscp_disk.c +++ b/sys/dev/mscp/mscp_disk.c @@ -1,4 +1,4 @@ -/* $NetBSD: mscp_disk.c,v 1.58 2007/10/19 12:00:36 ad Exp $ */ +/* $NetBSD: mscp_disk.c,v 1.59 2008/04/08 20:10:44 cegger Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -81,7 +81,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.58 2007/10/19 12:00:36 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mscp_disk.c,v 1.59 2008/04/08 20:10:44 cegger Exp $"); #include #include @@ -206,7 +206,7 @@ ra_putonline(ra) dl = ra->ra_disk.dk_label; ra->ra_state = DK_RDLABEL; - printf("%s", ra->ra_dev.dv_xname); + printf("%s", device_xname(&ra->ra_dev)); maj = cdevsw_lookup_major(&ra_cdevsw); if ((msg = readdisklabel(MAKEDISKDEV(maj, device_unit(&ra->ra_dev), RAW_PART), rastrategy, dl, NULL)) != NULL) @@ -540,7 +540,8 @@ raioctl(dev, cmd, data, flag, l) return (EBADF); /* If the ioctl happens here, the parent is us. */ - strcpy(dkw->dkw_parent, ra->ra_dev.dv_xname); + strlcpy(dkw->dkw_parent, device_xname(&ra->ra_dev), + sizeof(dkw->dkw_parent)); return (dkwedge_add(dkw)); } @@ -552,7 +553,8 @@ raioctl(dev, cmd, data, flag, l) return (EBADF); /* If the ioctl happens here, the parent is us. */ - strcpy(dkw->dkw_parent, ra->ra_dev.dv_xname); + strlcpy(dkw->dkw_parent, device_xname(&ra->ra_dev), + sizeof(dkw->dkw_parent)); return (dkwedge_del(dkw)); } @@ -686,12 +688,12 @@ rxattach(parent, self, aux) #if NRX if (MSCP_MID_ECH(1, mp->mscp_guse.guse_mediaid) == 'X' - '@') - disk_init((struct disk *)&rx->ra_disk, rx->ra_dev.dv_xname, + disk_init((struct disk *)&rx->ra_disk, device_xname(&rx->ra_dev), &rxdkdriver); #endif #if NRA if (MSCP_MID_ECH(1, mp->mscp_guse.guse_mediaid) != 'X' - '@') - disk_init((struct disk *)&rx->ra_disk, rx->ra_dev.dv_xname, + disk_init((struct disk *)&rx->ra_disk, device_xname(&rx->ra_dev), &radkdriver); #endif disk_attach((struct disk *)&rx->ra_disk); @@ -706,7 +708,7 @@ rxattach(parent, self, aux) disk_printtype(mp->mscp_unit, mp->mscp_guse.guse_mediaid); #ifdef DEBUG printf("%s: nspt %d group %d ngpc %d rct %d nrpt %d nrct %d\n", - self->dv_xname, mp->mscp_guse.guse_nspt, mp->mscp_guse.guse_group, + device_xname(self), mp->mscp_guse.guse_nspt, mp->mscp_guse.guse_group, mp->mscp_guse.guse_ngpc, mp->mscp_guse.guse_rctsize, mp->mscp_guse.guse_nrpt, mp->mscp_guse.guse_nrct); #endif @@ -953,7 +955,7 @@ rrdgram(usc, mp, mi) struct mscp *mp; struct mscp_softc *mi; { - if (mscp_decodeerror(usc == NULL?"unconf disk" : usc->dv_xname, mp, mi)) + if (mscp_decodeerror(usc == NULL?"unconf disk" : device_xname(usc), mp, mi)) return; /* * SDI status information bytes 10 and 11 are the microprocessor @@ -1009,7 +1011,7 @@ rronline(usc, mp) wakeup((void *)&rx->ra_state); if ((mp->mscp_status & M_ST_MASK) != M_ST_SUCCESS) { - printf("%s: attempt to bring on line failed: ", usc->dv_xname); + aprint_error_dev(usc, "attempt to bring on line failed: "); mscp_printevent(mp); return (MSCP_FAILED); } @@ -1076,7 +1078,7 @@ rrgotstatus(usc, mp) struct mscp *mp; { if ((mp->mscp_status & M_ST_MASK) != M_ST_SUCCESS) { - printf("%s: attempt to get status failed: ", usc->dv_xname); + aprint_error_dev(usc, "attempt to get status failed: "); mscp_printevent(mp); return (MSCP_FAILED); } @@ -1120,9 +1122,9 @@ rrioerror(usc, mp, bp) bp->b_error = EIO; ra->ra_state = DK_CLOSED; if (code & M_OFFLINE_UNMOUNTED) - printf("%s: not mounted/spun down\n", usc->dv_xname); + aprint_error_dev(usc, "not mounted/spun down\n"); if (code & M_OFFLINE_DUPLICATE) - printf("%s: duplicate unit number!!!\n", usc->dv_xname); + aprint_error_dev(usc, "duplicate unit number!!!\n"); return MSCP_DONE; case M_ST_AVAILABLE: @@ -1130,7 +1132,7 @@ rrioerror(usc, mp, bp) return MSCP_DONE; default: - printf("%s:", usc->dv_xname); + printf("%s:", device_xname(usc)); break; } return (MSCP_FAILED); diff --git a/sys/dev/mscp/mscp_subr.c b/sys/dev/mscp/mscp_subr.c index fce674725290..cc6648d58cbb 100644 --- a/sys/dev/mscp/mscp_subr.c +++ b/sys/dev/mscp/mscp_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mscp_subr.c,v 1.34 2007/10/19 12:00:36 ad Exp $ */ +/* $NetBSD: mscp_subr.c,v 1.35 2008/04/08 20:10:44 cegger Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -75,7 +75,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.34 2007/10/19 12:00:36 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mscp_subr.c,v 1.35 2008/04/08 20:10:44 cegger Exp $"); #include #include @@ -199,8 +199,7 @@ mscp_attach(parent, self, aux) bufq_alloc(&mi->mi_resq, "fcfs", 0); if (mscp_init(mi)) { - printf("%s: can't init, controller hung\n", - mi->mi_dev.dv_xname); + aprint_error_dev(&mi->mi_dev, "can't init, controller hung\n"); return; } for (i = 0; i < NCMD; i++) { @@ -250,7 +249,7 @@ findunit: goto gotit; } printf("%s: no response to Get Unit Status request\n", - mi->mi_dev.dv_xname); + device_xname(&mi->mi_dev)); return; gotit: /* @@ -296,7 +295,7 @@ gotit: /* /* * In service, or something else equally unusable. */ - printf("%s: unit %d off line: ", mi->mi_dev.dv_xname, + printf("%s: unit %d off line: ", device_xname(&mi->mi_dev), mp->mscp_unit); mp2 = __UNVOLATILE(mp); mscp_printevent(mp2); @@ -306,7 +305,7 @@ gotit: /* break; default: - printf("%s: unable to get unit status: ", mi->mi_dev.dv_xname); + aprint_error_dev(&mi->mi_dev, "unable to get unit status: "); mscp_printevent(__UNVOLATILE(mp)); return; } @@ -391,7 +390,7 @@ mscp_init(mi) if (mi->mi_type & MSCPBUS_UDA) { WRITE_SW(MP_GO | (BURST - 1) << 2); printf("%s: DMA burst size set to %d\n", - mi->mi_dev.dv_xname, BURST); + device_xname(&mi->mi_dev), BURST); } WRITE_SW(MP_GO); @@ -426,8 +425,7 @@ mscp_init(mi) } if (count == DELAYTEN) { out: - printf("%s: couldn't set ctlr characteristics, sa=%x\n", - mi->mi_dev.dv_xname, j); + aprint_error_dev(&mi->mi_dev, "couldn't set ctlr characteristics, sa=%x\n", j); return 1; } return 0; @@ -544,7 +542,7 @@ mscp_kickaway(mi) if ((mp = mscp_getcp(mi, MSCP_DONTWAIT)) == NULL) { if (mi->mi_credits > MSCP_MINCREDITS) printf("%s: command ring too small\n", - device_parent(&mi->mi_dev)->dv_xname); + device_xname(device_parent(&mi->mi_dev))); /* * By some (strange) reason we didn't get a MSCP packet. * Just return and wait for free packets. diff --git a/sys/dev/mscp/mscp_tape.c b/sys/dev/mscp/mscp_tape.c index 79b7a8883327..8429d9ecc3bf 100644 --- a/sys/dev/mscp/mscp_tape.c +++ b/sys/dev/mscp/mscp_tape.c @@ -1,4 +1,4 @@ -/* $NetBSD: mscp_tape.c,v 1.32 2007/10/19 12:00:36 ad Exp $ */ +/* $NetBSD: mscp_tape.c,v 1.33 2008/04/08 20:10:44 cegger Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.32 2007/10/19 12:00:36 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mscp_tape.c,v 1.33 2008/04/08 20:10:44 cegger Exp $"); #include #include @@ -345,7 +345,7 @@ mtdgram(usc, mp, mi) struct mscp *mp; struct mscp_softc *mi; { - if (mscp_decodeerror(usc == NULL?"unconf mt" : usc->dv_xname, mp, mi)) + if (mscp_decodeerror(usc == NULL?"unconf mt" : device_xname(usc), mp, mi)) return; } @@ -417,10 +417,10 @@ mtioerror(usc, mp, bp) mt->mt_serex = 2; else { if (st && st < 17) - printf("%s: error %d (%s)\n", mt->mt_dev.dv_xname, st, + printf("%s: error %d (%s)\n", device_xname(&mt->mt_dev), st, mt_ioerrs[st-1]); else - printf("%s: error %d\n", mt->mt_dev.dv_xname, st); + printf("%s: error %d\n", device_xname(&mt->mt_dev), st); bp->b_error = EROFS; } @@ -570,7 +570,7 @@ mtcmddone(usc, mp) if (mp->mscp_status) { mt->mt_ioctlerr = EIO; - printf("%s: bad status %x\n", mt->mt_dev.dv_xname, + printf("%s: bad status %x\n", device_xname(&mt->mt_dev), mp->mscp_status); } wakeup(&mt->mt_inuse); diff --git a/sys/dev/ofisa/atppc_ofisa.c b/sys/dev/ofisa/atppc_ofisa.c index 5de19666010e..d0e1e46ef7fd 100644 --- a/sys/dev/ofisa/atppc_ofisa.c +++ b/sys/dev/ofisa/atppc_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: atppc_ofisa.c,v 1.6 2007/10/19 12:00:37 ad Exp $ */ +/* $NetBSD: atppc_ofisa.c,v 1.7 2008/04/08 20:11:36 cegger Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atppc_ofisa.c,v 1.6 2007/10/19 12:00:37 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atppc_ofisa.c,v 1.7 2008/04/08 20:11:36 cegger Exp $"); #include "opt_atppc.h" @@ -120,8 +120,7 @@ atppc_ofisa_attach(struct device *parent, struct device *self, void *aux) n = lpt_ofisa_md_reg_fixup(parent, self, aux, ®, 1, n); #endif if (n != 1) { - printf("%s: unable to find i/o register resource\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to find i/o register resource\n"); return; } @@ -131,15 +130,13 @@ atppc_ofisa_attach(struct device *parent, struct device *self, void *aux) n = lpt_ofisa_md_intr_fixup(parent, self, aux, &intr, 1, n); #endif if (n != 1) { - printf("%s: unable to find irq resource\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to find irq resource\n"); return; } /* find our DRQ */ if (ofisa_dma_get(aa->oba.oba_phandle, &dma, 1) != 1) { - printf("%s: unable to find DMA data\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to find DMA data\n"); return; } asc->sc_drq = dma.drq; @@ -153,8 +150,8 @@ atppc_ofisa_attach(struct device *parent, struct device *self, void *aux) if (bus_space_map(sc->sc_iot, reg.addr, reg.len, 0, &sc->sc_ioh) != 0) { - printf("%s: attempt to map bus space failed, device not " - "properly attached.\n", self->dv_xname); + aprint_error_dev(self, "attempt to map bus space failed, device not " + "properly attached.\n"); return; } diff --git a/sys/dev/ofisa/com_ofisa.c b/sys/dev/ofisa/com_ofisa.c index 2d93ecdab8eb..7d5e34990cda 100644 --- a/sys/dev/ofisa/com_ofisa.c +++ b/sys/dev/ofisa/com_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_ofisa.c,v 1.13 2008/03/14 15:09:11 cube Exp $ */ +/* $NetBSD: com_ofisa.c,v 1.14 2008/04/08 20:11:36 cegger Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: com_ofisa.c,v 1.13 2008/03/14 15:09:11 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_ofisa.c,v 1.14 2008/04/08 20:11:36 cegger Exp $"); #include #include @@ -155,10 +155,10 @@ com_ofisa_attach(device_t parent, device_t self, void *aux) com_attach_subr(sc); #if 0 - printf("%s: registers: ", sc->sc_dev.dv_xname); + printf("%s: registers: ", device_xname(&sc->sc_dev)); ofisa_reg_print(®, 1); printf("\n"); - printf("%s: interrupts: ", sc->sc_dev.dv_xname); + printf("%s: interrupts: ", device_xname(&sc->sc_dev)); ofisa_intr_print(&intr, 1); printf("\n"); #endif diff --git a/sys/dev/ofisa/ess_ofisa.c b/sys/dev/ofisa/ess_ofisa.c index f42b677deaf0..6dfa8644a311 100644 --- a/sys/dev/ofisa/ess_ofisa.c +++ b/sys/dev/ofisa/ess_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: ess_ofisa.c,v 1.18 2007/10/19 12:00:37 ad Exp $ */ +/* $NetBSD: ess_ofisa.c,v 1.19 2008/04/08 20:11:36 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.18 2007/10/19 12:00:37 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ess_ofisa.c,v 1.19 2008/04/08 20:11:36 cegger Exp $"); #include #include @@ -176,7 +176,7 @@ ess_ofisa_attach(parent, self, aux) if (n > 0) { model = alloca(n); if (OF_getprop(aa->oba.oba_phandle, "model", model, n) == n) - printf(": %s\n%s", model, sc->sc_dev.dv_xname); + printf(": %s\n%s", model, device_xname(&sc->sc_dev)); } essattach(sc, 0); diff --git a/sys/dev/ofisa/if_cs_ofisa.c b/sys/dev/ofisa/if_cs_ofisa.c index 51a9d6602430..78ee465da191 100644 --- a/sys/dev/ofisa/if_cs_ofisa.c +++ b/sys/dev/ofisa/if_cs_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_cs_ofisa.c,v 1.16 2007/10/19 12:00:37 ad Exp $ */ +/* $NetBSD: if_cs_ofisa.c,v 1.17 2008/04/08 20:11:36 cegger Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa.c,v 1.16 2007/10/19 12:00:37 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_cs_ofisa.c,v 1.17 2008/04/08 20:11:36 cegger Exp $"); #include #include @@ -244,19 +244,17 @@ cs_ofisa_attach(parent, self, aux) printf("\n"); if (message != NULL) - printf("%s: %s\n", sc->sc_dev.dv_xname, message); + printf("%s: %s\n", device_xname(&sc->sc_dev), message); if (defmedia == -1) { - printf("%s: unable to get default media\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to get default media\n"); defmedia = media[0]; /* XXX What to do? */ } sc->sc_ih = isa_intr_establish(isc->sc_ic, sc->sc_irq, intr.share, IPL_NET, cs_intr, sc); if (sc->sc_ih == NULL) { - printf("%s: unable to establish interrupt\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to establish interrupt\n"); return; } diff --git a/sys/dev/ofisa/lpt_ofisa.c b/sys/dev/ofisa/lpt_ofisa.c index acfbb61974f5..768d1bb36d79 100644 --- a/sys/dev/ofisa/lpt_ofisa.c +++ b/sys/dev/ofisa/lpt_ofisa.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt_ofisa.c,v 1.13 2008/03/07 17:15:52 cube Exp $ */ +/* $NetBSD: lpt_ofisa.c,v 1.14 2008/04/08 20:11:36 cegger Exp $ */ /* * Copyright 1997, 1998 @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lpt_ofisa.c,v 1.13 2008/03/07 17:15:52 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lpt_ofisa.c,v 1.14 2008/04/08 20:11:36 cegger Exp $"); #include #include @@ -140,10 +140,10 @@ lpt_ofisa_attach(device_t parent, device_t self, void *aux) lpt_attach_subr(sc); #if 0 - printf("%s: registers: ", sc->sc_dev.dv_xname); + printf("%s: registers: ", device_xname(&sc->sc_dev)); ofisa_reg_print(®, 1); printf("\n"); - printf("%s: interrupts: ", sc->sc_dev.dv_xname); + printf("%s: interrupts: ", device_xname(&sc->sc_dev)); ofisa_intr_print(&intr, 1); printf("\n"); #endif diff --git a/sys/dev/ofw/ofdisk.c b/sys/dev/ofw/ofdisk.c index 91bfc3196bbc..46648d5627b0 100644 --- a/sys/dev/ofw/ofdisk.c +++ b/sys/dev/ofw/ofdisk.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofdisk.c,v 1.39 2007/10/17 17:57:11 he Exp $ */ +/* $NetBSD: ofdisk.c,v 1.40 2008/04/08 20:11:57 cegger Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.39 2007/10/17 17:57:11 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofdisk.c,v 1.40 2008/04/08 20:11:57 cegger Exp $"); #include #include @@ -134,7 +134,7 @@ ofdisk_attach(struct device *parent, struct device *self, void *aux) of->sc_phandle = oba->oba_phandle; of->sc_unit = oba->oba_unit; of->sc_ihandle = 0; - disk_init(&of->sc_dk, of->sc_dev.dv_xname, &ofdisk_dkdriver); + disk_init(&of->sc_dk, device_xname(&of->sc_dev), &ofdisk_dkdriver); disk_attach(&of->sc_dk); printf("\n"); @@ -423,7 +423,8 @@ ofdisk_ioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) return (EBADF); /* If the ioctl happens here, the parent is us. */ - strcpy(dkw->dkw_parent, of->sc_dev.dv_xname); + strlcpy(dkw->dkw_parent, device_xname(&of->sc_dev), + sizeof(dkw->dkw_parent)); return (dkwedge_add(dkw)); } @@ -438,7 +439,8 @@ ofdisk_ioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) return (EBADF); /* If the ioctl happens here, the parent is us. */ - strcpy(dkw->dkw_parent, of->sc_dev.dv_xname); + strlcpy(dkw->dkw_parent, device_xname(&of->sc_dev), + sizeof(dkw->dkw_parent)); return (dkwedge_del(dkw)); } @@ -560,6 +562,6 @@ ofdisk_getdisklabel(dev) unit, RAW_PART), ofdisk_strategy, lp, of->sc_dk.dk_cpulabel); if (errmes != NULL) - printf("%s: %s\n", of->sc_dev.dv_xname, errmes); + printf("%s: %s\n", device_xname(&of->sc_dev), errmes); } } diff --git a/sys/dev/ofw/ofnet.c b/sys/dev/ofw/ofnet.c index f70b47b20e41..cad542738956 100644 --- a/sys/dev/ofw/ofnet.c +++ b/sys/dev/ofw/ofnet.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofnet.c,v 1.40 2007/07/09 21:00:52 ad Exp $ */ +/* $NetBSD: ofnet.c,v 1.41 2008/04/08 20:11:58 cegger Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.40 2007/07/09 21:00:52 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofnet.c,v 1.41 2008/04/08 20:11:58 cegger Exp $"); #include "ofnet.h" #include "opt_inet.h" @@ -154,7 +154,7 @@ ofnet_attach(struct device *parent, struct device *self, void *aux) callout_init(&of->sc_callout, 0); - bcopy(of->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ); + strlcpy(ifp->if_xname, device_xname(&of->sc_dev), IFNAMSIZ); ifp->if_softc = of; ifp->if_start = ofnet_start; ifp->if_ioctl = ofnet_ioctl; @@ -413,7 +413,7 @@ ofnet_watchdog(struct ifnet *ifp) { struct ofnet_softc *of = ifp->if_softc; - log(LOG_ERR, "%s: device timeout\n", of->sc_dev.dv_xname); + log(LOG_ERR, "%s: device timeout\n", device_xname(&of->sc_dev)); ifp->if_oerrors++; ofnet_stop(of); ofnet_init(of); diff --git a/sys/dev/onewire/onewire.c b/sys/dev/onewire/onewire.c index 4f833a6acb9a..3435557875ab 100644 --- a/sys/dev/onewire/onewire.c +++ b/sys/dev/onewire/onewire.c @@ -1,4 +1,4 @@ -/* $NetBSD: onewire.c,v 1.7 2007/09/05 15:24:07 xtraeme Exp $ */ +/* $NetBSD: onewire.c,v 1.8 2008/04/08 20:14:02 cegger Exp $ */ /* $OpenBSD: onewire.c,v 1.1 2006/03/04 16:27:03 grange Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.7 2007/09/05 15:24:07 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: onewire.c,v 1.8 2008/04/08 20:14:02 cegger Exp $"); /* * 1-Wire bus driver. @@ -105,9 +105,8 @@ onewire_attach(struct device *parent, struct device *self, void *aux) aprint_normal("\n"); if (kthread_create(PRI_NONE, 0, NULL, onewire_thread, sc, - &sc->sc_thread, "%s", sc->sc_dev.dv_xname) != 0) - aprint_error("%s: can't create kernel thread\n", - sc->sc_dev.dv_xname); + &sc->sc_thread, "%s", device_xname(&sc->sc_dev)) != 0) + aprint_error_dev(&sc->sc_dev, "can't create kernel thread\n"); } int @@ -343,7 +342,7 @@ onewire_scan(struct onewire_softc *sc) onewire_lock(sc); if (onewire_reset(sc) != 0) { DPRINTF(("%s: scan: no presence pulse\n", - sc->sc_dev.dv_xname)); + device_xname(&sc->sc_dev))); onewire_unlock(sc); break; } @@ -383,7 +382,7 @@ onewire_scan(struct onewire_softc *sc) default: DPRINTF(("%s: scan: triplet error 0x%x, " "step %d\n", - sc->sc_dev.dv_xname, rv, i)); + device_xname(&sc->sc_dev), rv, i)); onewire_unlock(sc); return; } diff --git a/sys/dev/onewire/owtemp.c b/sys/dev/onewire/owtemp.c index 6babffb5c49f..e51b7e0afcea 100644 --- a/sys/dev/onewire/owtemp.c +++ b/sys/dev/onewire/owtemp.c @@ -1,4 +1,4 @@ -/* $NetBSD: owtemp.c,v 1.12 2007/11/16 08:00:15 xtraeme Exp $ */ +/* $NetBSD: owtemp.c,v 1.13 2008/04/08 20:14:02 cegger Exp $ */ /* $OpenBSD: owtemp.c,v 1.1 2006/03/04 16:27:03 grange Exp $ */ /* @@ -22,7 +22,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: owtemp.c,v 1.12 2007/11/16 08:00:15 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: owtemp.c,v 1.13 2008/04/08 20:14:02 cegger Exp $"); #include #include @@ -107,20 +107,19 @@ owtemp_attach(struct device *parent, struct device *self, void *aux) /* Initialize sensor */ sc->sc_sensor.units = ENVSYS_STEMP; (void)strlcpy(sc->sc_sensor.desc, - sc->sc_dev.dv_xname, sizeof(sc->sc_sensor.desc)); + device_xname(&sc->sc_dev), sizeof(sc->sc_sensor.desc)); if (sysmon_envsys_sensor_attach(sc->sc_sme, &sc->sc_sensor)) { sysmon_envsys_destroy(sc->sc_sme); return; } /* Hook into system monitor. */ - sc->sc_sme->sme_name = sc->sc_dev.dv_xname; + sc->sc_sme->sme_name = device_xname(&sc->sc_dev); sc->sc_sme->sme_cookie = sc; sc->sc_sme->sme_refresh = owtemp_refresh; if (sysmon_envsys_register(sc->sc_sme)) { - aprint_error("%s: unable to register with sysmon\n", - sc->sc_dev.dv_xname); + aprint_error_dev(&sc->sc_dev, "unable to register with sysmon\n"); sysmon_envsys_destroy(sc->sc_sme); return; }