use aprint_*_dev and device_xname

This commit is contained in:
cegger 2008-04-05 16:06:12 +00:00
parent 327d0b0912
commit 1344fa8b25
4 changed files with 109 additions and 116 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ie_vme.c,v 1.23 2007/10/19 12:01:23 ad Exp $ */
/* $NetBSD: if_ie_vme.c,v 1.24 2008/04/05 16:06:12 cegger Exp $ */
/*-
* Copyright (c) 1995 Charles D. Cranor
@ -145,7 +145,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ie_vme.c,v 1.23 2007/10/19 12:01:23 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ie_vme.c,v 1.24 2008/04/05 16:06:12 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -306,8 +306,8 @@ ie_vmeintr(sc, where)
* check for parity error
*/
if (read_iev(vsc, status) & IEVME_PERR) {
printf("%s: parity error (ctrl 0x%x @ 0x%02x%04x)\n",
sc->sc_dev.dv_xname, read_iev(vsc, pectrl),
aprint_error_dev(&sc->sc_dev, "parity error (ctrl 0x%x @ 0x%02x%04x)\n",
read_iev(vsc, pectrl),
read_iev(vsc, pectrl) & IEVME_HADDR,
read_iev(vsc, peaddr));
write_iev(vsc, pectrl, read_iev(vsc, pectrl) | IEVME_PARACK);
@ -594,7 +594,7 @@ ie_vme_attach(parent, self, aux)
sc->do_xmitnopchain = 0;
printf("\n%s:", self->dv_xname);
printf("\n%s:", device_xname(self));
#ifdef __sparc__
prom_getether(0, myaddr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: sc_vme.c,v 1.14 2007/10/19 12:01:23 ad Exp $ */
/* $NetBSD: sc_vme.c,v 1.15 2008/04/05 16:06:12 cegger Exp $ */
/*-
* Copyright (c) 1996,2000,2001 The NetBSD Foundation, Inc.
@ -69,7 +69,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sc_vme.c,v 1.14 2007/10/19 12:01:23 ad Exp $");
__KERNEL_RCSID(0, "$NetBSD: sc_vme.c,v 1.15 2008/04/05 16:06:12 cegger Exp $");
#include "opt_ddb.h"
@ -168,7 +168,7 @@ sc_vme_attach(parent, self, aux)
if (vme_space_map(ct, va->r[0].offset, SCREG_BANK_SZ,
mod, VME_D8, 0, &bt, &bh, &resc) != 0)
panic("%s: vme_space_map", sc->sc_dev.dv_xname);
panic("%s: vme_space_map", device_xname(&sc->sc_dev));
sc->sunscpal_regt = bt;
sc->sunscpal_regh = bh;
@ -219,8 +219,7 @@ sc_vme_attach(parent, self, aux)
BUS_DMA_NOWAIT,
&sc->sc_dma_handles[i].dh_dmamap) != 0) {
printf("%s: DMA buffer map create error\n",
sc->sc_dev.dv_xname);
aprint_error_dev(&sc->sc_dev, "DMA buffer map create error\n");
return;
}
}
@ -231,7 +230,7 @@ sc_vme_attach(parent, self, aux)
SUNSCPAL_WRITE_1(sc, sunscpal_intvec, va->ivector & 0xFF);
/* Do the common attach stuff. */
printf("%s", sc->sc_dev.dv_xname);
printf("%s", device_xname(&sc->sc_dev));
sunscpal_attach(sc, (device_cfdata(&sc->sc_dev)->cf_flags ?
device_cfdata(&sc->sc_dev)->cf_flags :
sunsc_vme_options));

View File

@ -1,4 +1,4 @@
/* $NetBSD: xd.c,v 1.74 2008/02/06 12:13:47 elad Exp $ */
/* $NetBSD: xd.c,v 1.75 2008/04/05 16:06:12 cegger Exp $ */
/*
*
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.74 2008/02/06 12:13:47 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: xd.c,v 1.75 2008/04/05 16:06:12 cegger Exp $");
#undef XDC_DEBUG /* full debug */
#define XDC_DIAG /* extra sanity checks */
@ -355,7 +355,7 @@ xdgetdisklabel(xd, b)
xddummystrat,
xd->sc_dk.dk_label, xd->sc_dk.dk_cpulabel);
if (err) {
printf("%s: %s\n", xd->sc_dev.dv_xname, err);
aprint_error_dev(&xd->sc_dev, "%s\n", err);
return(XD_ERR_FAIL);
}
@ -368,11 +368,11 @@ xdgetdisklabel(xd, b)
#endif
{
printf("%s: WARNING: no `pcyl' in disk label.\n",
xd->sc_dev.dv_xname);
device_xname(&xd->sc_dev));
xd->pcyl = xd->sc_dk.dk_label->d_ncylinders +
xd->sc_dk.dk_label->d_acylinders;
printf("%s: WARNING: guessing pcyl=%d (ncyl+acyl)\n",
xd->sc_dev.dv_xname, xd->pcyl);
device_xname(&xd->sc_dev), xd->pcyl);
}
xd->ncyl = xd->sc_dk.dk_label->d_ncylinders;
@ -557,8 +557,8 @@ xdcattach(parent, self, aux)
BUS_DMA_NOWAIT,
&xdc->auxmap)) != 0) {
printf("%s: DMA buffer map create error %d\n",
xdc->sc_dev.dv_xname, error);
aprint_error_dev(&xdc->sc_dev, "DMA buffer map create error %d\n",
error);
return;
}
@ -576,8 +576,8 @@ xdcattach(parent, self, aux)
BUS_DMA_NOWAIT,
&xdc->iopmap)) != 0) {
printf("%s: DMA buffer map create error %d\n",
xdc->sc_dev.dv_xname, error);
aprint_error_dev(&xdc->sc_dev, "DMA buffer map create error %d\n",
error);
return;
}
@ -586,8 +586,8 @@ xdcattach(parent, self, aux)
XDC_MAXIOPB * sizeof(struct xd_iopb),
(void **)&xdc->iopbase,
&busaddr)) != 0) {
printf("%s: DMA buffer alloc error %d\n",
xdc->sc_dev.dv_xname, error);
aprint_error_dev(&xdc->sc_dev, "DMA buffer alloc error %d\n",
error);
return;
}
xdc->dvmaiopb = (struct xd_iopb *)(u_long)BUS_ADDR_PADDR(busaddr);
@ -623,8 +623,8 @@ xdcattach(parent, self, aux)
BUS_DMA_NOWAIT,
&xdc->reqs[lcv].dmamap)) != 0) {
printf("%s: DMA buffer map create error %d\n",
xdc->sc_dev.dv_xname, error);
aprint_error_dev(&xdc->sc_dev, "DMA buffer map create error %d\n",
error);
return;
}
}
@ -668,8 +668,8 @@ xdcattach(parent, self, aux)
rqno = xdc_cmd(xdc, XDCMD_WRP, XDFUN_CTL, 0, 0, 0, 0, XD_SUB_POLL);
XDC_DONE(xdc, rqno, error);
if (error) {
printf("%s: controller config error: %s\n",
xdc->sc_dev.dv_xname, xdc_e2str(error));
aprint_error_dev(&xdc->sc_dev, "controller config error: %s\n",
xdc_e2str(error));
return;
}
@ -677,7 +677,7 @@ xdcattach(parent, self, aux)
vme_intr_map(ct, va->ilevel, va->ivector, &ih);
vme_intr_establish(ct, ih, IPL_BIO, xdcintr, xdc);
evcnt_attach_dynamic(&xdc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
xdc->sc_dev.dv_xname, "intr");
device_xname(&xdc->sc_dev), "intr");
/* now we must look for disks using autoconfig */
@ -768,7 +768,7 @@ xdattach(parent, self, aux)
}
}
printf("%s at %s",
xd->sc_dev.dv_xname, xd->parent->sc_dev.dv_xname);
device_xname(&xd->sc_dev), device_xname(&xd->parent->sc_dev));
}
/* we now have control */
@ -780,8 +780,8 @@ xdattach(parent, self, aux)
XDFM_BPS,
(void **)&buf,
&busaddr)) != 0) {
printf("%s: DMA buffer alloc error %d\n",
xdc->sc_dev.dv_xname, error);
aprint_error_dev(&xdc->sc_dev, "DMA buffer alloc error %d\n",
error);
return;
}
dmaddr = (void *)(u_long)BUS_ADDR_PADDR(busaddr);
@ -805,8 +805,8 @@ xdattach(parent, self, aux)
rqno = xdc_cmd(xdc, XDCMD_WRP, XDFUN_FMT, xd->xd_drive, 0, 0, 0, fmode);
XDC_DONE(xdc, rqno, error);
if (error) {
printf("%s: write format parameters failed: %s\n",
xd->sc_dev.dv_xname, xdc_e2str(error));
aprint_error_dev(&xd->sc_dev, "write format parameters failed: %s\n",
xdc_e2str(error));
goto done;
}
@ -818,8 +818,8 @@ xdattach(parent, self, aux)
}
XDC_DONE(xdc, rqno, error);
if (error) {
printf("%s: read drive parameters failed: %s\n",
xd->sc_dev.dv_xname, xdc_e2str(error));
aprint_error_dev(&xd->sc_dev, "read drive parameters failed: %s\n",
xdc_e2str(error));
goto done;
}
@ -837,8 +837,8 @@ xdattach(parent, self, aux)
rqno = xdc_cmd(xdc, XDCMD_WRP, XDFUN_DRV, xd->xd_drive, 0, 0, 0, fmode);
XDC_DONE(xdc, rqno, error);
if (error) {
printf("%s: write drive parameters failed: %s\n",
xd->sc_dev.dv_xname, xdc_e2str(error));
aprint_error_dev(&xd->sc_dev, "write drive parameters failed: %s\n",
xdc_e2str(error));
goto done;
}
@ -846,26 +846,26 @@ xdattach(parent, self, aux)
rqno = xdc_cmd(xdc, XDCMD_RD, 0, xd->xd_drive, 0, 1, dmaddr, fmode);
XDC_DONE(xdc, rqno, error);
if (error) {
printf("%s: reading disk label failed: %s\n",
xd->sc_dev.dv_xname, xdc_e2str(error));
aprint_error_dev(&xd->sc_dev, "reading disk label failed: %s\n",
xdc_e2str(error));
goto done;
}
newstate = XD_DRIVE_NOLABEL;
xd->hw_spt = spt;
/* Attach the disk: must be before getdisklabel to malloc label */
disk_init(&xd->sc_dk, xd->sc_dev.dv_xname, &xddkdriver);
disk_init(&xd->sc_dk, device_xname(&xd->sc_dev), &xddkdriver);
disk_attach(&xd->sc_dk);
if (xdgetdisklabel(xd, buf) != XD_ERR_AOK)
goto done;
/* inform the user of what is up */
printf("%s: <%s>, pcyl %d, hw_spt %d\n", xd->sc_dev.dv_xname,
printf("%s: <%s>, pcyl %d, hw_spt %d\n", device_xname(&xd->sc_dev),
buf, xd->pcyl, spt);
mb = xd->ncyl * (xd->nhead * xd->nsect) / (1048576 / XDFM_BPS);
printf("%s: %dMB, %d cyl, %d head, %d sec, %d bytes/sec\n",
xd->sc_dev.dv_xname, mb, xd->ncyl, xd->nhead, xd->nsect,
device_xname(&xd->sc_dev), mb, xd->ncyl, xd->nhead, xd->nsect,
XDFM_BPS);
/* now set the real drive parameters! */
@ -873,8 +873,8 @@ xdattach(parent, self, aux)
rqno = xdc_cmd(xdc, XDCMD_WRP, XDFUN_DRV, xd->xd_drive, 0, 0, 0, fmode);
XDC_DONE(xdc, rqno, error);
if (error) {
printf("%s: write real drive parameters failed: %s\n",
xd->sc_dev.dv_xname, xdc_e2str(error));
aprint_error_dev(&xd->sc_dev, "write real drive parameters failed: %s\n",
xdc_e2str(error));
goto done;
}
newstate = XD_DRIVE_ONLINE;
@ -889,8 +889,8 @@ xdattach(parent, self, aux)
rqno = xdc_cmd(xdc, XDCMD_RD, 0, xd->xd_drive, blk, 1, dmaddr, fmode);
XDC_DONE(xdc, rqno, error);
if (error) {
printf("%s: reading bad144 failed: %s\n",
xd->sc_dev.dv_xname, xdc_e2str(error));
aprint_error_dev(&xd->sc_dev, "reading bad144 failed: %s\n",
xdc_e2str(error));
goto done;
}
@ -909,8 +909,7 @@ xdattach(parent, self, aux)
break;
}
if (lcv != 126) {
printf("%s: warning: invalid bad144 sector!\n",
xd->sc_dev.dv_xname);
aprint_error_dev(&xd->sc_dev, "warning: invalid bad144 sector!\n");
} else {
bcopy(buf, &xd->dkb, XDFM_BPS);
}
@ -983,7 +982,7 @@ xddump(dev, blkno, va, size)
xd = xd_cd.cd_devs[unit];
printf("%s%c: crash dump not supported (yet)\n", xd->sc_dev.dv_xname,
printf("%s%c: crash dump not supported (yet)\n", device_xname(&xd->sc_dev),
'a' + part);
return ENXIO;
@ -1650,7 +1649,7 @@ xdc_startbuf(xdcsc, xdsc, bp)
}
partno = DISKPART(bp->b_dev);
#ifdef XDC_DEBUG
printf("xdc_startbuf: %s%c: %s block %d\n", xdsc->sc_dev.dv_xname,
printf("xdc_startbuf: %s%c: %s block %d\n", device_xname(&xdsc->sc_dev),
'a' + partno, (bp->b_flags & B_READ) ? "read" : "write", bp->b_blkno);
printf("xdc_startbuf: b_bcount %d, b_data 0x%x\n",
bp->b_bcount, bp->b_data);
@ -1670,8 +1669,7 @@ xdc_startbuf(xdcsc, xdsc, bp)
error = bus_dmamap_load(xdcsc->dmatag, iorq->dmamap,
bp->b_data, bp->b_bcount, 0, BUS_DMA_NOWAIT);
if (error != 0) {
printf("%s: warning: cannot load DMA map\n",
xdcsc->sc_dev.dv_xname);
aprint_error_dev(&xdcsc->sc_dev, "warning: cannot load DMA map\n");
XDC_FREE(xdcsc, rqno);
BUFQ_PUT(xdcsc->sc_wq, bp);
return (XD_ERR_FAIL); /* XXX: need some sort of
@ -1742,7 +1740,7 @@ xdc_submit_iorq(xdcsc, iorqno, type)
struct xd_iorq *iorq = &xdcsc->reqs[iorqno];
#ifdef XDC_DEBUG
printf("xdc_submit_iorq(%s, no=%d, type=%d)\n", xdcsc->sc_dev.dv_xname,
printf("xdc_submit_iorq(%s, no=%d, type=%d)\n", device_xname(&xdcsc->sc_dev),
iorqno, type);
#endif
@ -1773,7 +1771,7 @@ xdc_submit_iorq(xdcsc, iorqno, type)
u_char *rio = (u_char *) iorq->iopb;
int sz = sizeof(struct xd_iopb), lcv;
printf("%s: aio #%d [",
xdcsc->sc_dev.dv_xname, iorq - xdcsc->reqs);
device_xname(&xdcsc->sc_dev), iorq - xdcsc->reqs);
for (lcv = 0; lcv < sz; lcv++)
printf(" %02x", rio[lcv]);
printf("]\n");
@ -1824,7 +1822,7 @@ xdc_piodriver(xdcsc, iorqno, freeone)
u_long count;
struct xdc *xdc = xdcsc->xdc;
#ifdef XDC_DEBUG
printf("xdc_piodriver(%s, %d, freeone=%d)\n", xdcsc->sc_dev.dv_xname,
printf("xdc_piodriver(%s, %d, freeone=%d)\n", device_xname(&xdcsc->sc_dev),
iorqno, freeone);
#endif
@ -1907,7 +1905,7 @@ xdc_xdreset(xdcsc, xdsc)
XDC_GO(xdcsc->xdc, addr); /* go! */
XDC_WAIT(xdcsc->xdc, del, XDC_RESETUSEC, XDC_REMIOPB);
if (del <= 0 || xdcsc->iopbase->errs) {
printf("%s: off-line: %s\n", xdcsc->sc_dev.dv_xname,
printf("%s: off-line: %s\n", device_xname(&xdcsc->sc_dev),
xdc_e2str(xdcsc->iopbase->errnum));
xdcsc->xdc->xdc_csr = XDC_RESET;
XDC_WAIT(xdcsc->xdc, del, XDC_RESETUSEC, XDC_RESET);
@ -1937,7 +1935,7 @@ xdc_reset(xdcsc, quiet, blastmode, error, xdsc)
/* soft reset hardware */
if (!quiet)
printf("%s: soft reset\n", xdcsc->sc_dev.dv_xname);
printf("%s: soft reset\n", device_xname(&xdcsc->sc_dev));
xdcsc->xdc->xdc_csr = XDC_RESET;
XDC_WAIT(xdcsc->xdc, del, XDC_RESETUSEC, XDC_RESET);
if (del <= 0) {
@ -2014,11 +2012,11 @@ xdc_reset(xdcsc, quiet, blastmode, error, xdsc)
del = xdcsc->nwait + xdcsc->nrun + xdcsc->nfree + xdcsc->ndone;
if (del != XDC_MAXIOPB)
printf("%s: diag: xdc_reset miscount (%d should be %d)!\n",
xdcsc->sc_dev.dv_xname, del, XDC_MAXIOPB);
device_xname(&xdcsc->sc_dev), del, XDC_MAXIOPB);
else
if (xdcsc->ndone > XDC_MAXIOPB - XDC_SUBWAITLIM)
printf("%s: diag: lots of done jobs (%d)\n",
xdcsc->sc_dev.dv_xname, xdcsc->ndone);
device_xname(&xdcsc->sc_dev), xdcsc->ndone);
#endif
printf("RESET DONE\n");
return (retval);
@ -2065,11 +2063,10 @@ xdc_remove_iorq(xdcsc)
* we dump them all.
*/
errnum = xdc->xdc_f_err;
printf("%s: fatal error 0x%02x: %s\n", xdcsc->sc_dev.dv_xname,
aprint_error_dev(&xdcsc->sc_dev, "fatal error 0x%02x: %s\n",
errnum, xdc_e2str(errnum));
if (xdc_reset(xdcsc, 0, XD_RSET_ALL, errnum, 0) != XD_ERR_AOK) {
printf("%s: soft reset failed!\n",
xdcsc->sc_dev.dv_xname);
aprint_error_dev(&xdcsc->sc_dev, "soft reset failed!\n");
panic("xdc_remove_iorq: controller DEAD");
}
return (XD_ERR_AOK);
@ -2104,7 +2101,7 @@ xdc_remove_iorq(xdcsc)
{
u_char *rio = (u_char *) iopb;
int sz = sizeof(struct xd_iopb), lcv;
printf("%s: rio #%d [", xdcsc->sc_dev.dv_xname, rqno);
printf("%s: rio #%d [", device_xname(&xdcsc->sc_dev), rqno);
for (lcv = 0; lcv < sz; lcv++)
printf(" %02x", rio[lcv]);
printf("]\n");
@ -2227,8 +2224,8 @@ xdc_perror(iorq, iopb, still_trying)
int error = iorq->lasterror;
printf("%s", (iorq->xd) ? iorq->xd->sc_dev.dv_xname
: iorq->xdc->sc_dev.dv_xname);
printf("%s", (iorq->xd) ? device_xname(&iorq->xd->sc_dev)
: device_xname(&iorq->xdc->sc_dev));
if (iorq->buf)
printf("%c: ", 'a' + DISKPART(iorq->buf->b_dev));
if (iopb->comm == XDCMD_RD || iopb->comm == XDCMD_WR)
@ -2347,7 +2344,7 @@ xdc_tick(arg)
splx(s);
if (nwait + nrun + nfree + ndone != XDC_MAXIOPB) {
printf("%s: diag: IOPB miscount (got w/f/r/d %d/%d/%d/%d, wanted %d)\n",
xdcsc->sc_dev.dv_xname, nwait, nfree, nrun, ndone,
device_xname(&xdcsc->sc_dev), nwait, nfree, nrun, ndone,
XDC_MAXIOPB);
bzero(mark, sizeof(mark));
printf("FREE: ");
@ -2376,12 +2373,12 @@ xdc_tick(arg)
} else
if (ndone > XDC_MAXIOPB - XDC_SUBWAITLIM)
printf("%s: diag: lots of done jobs (%d)\n",
xdcsc->sc_dev.dv_xname, ndone);
device_xname(&xdcsc->sc_dev), ndone);
#endif
#ifdef XDC_DEBUG
printf("%s: tick: csr 0x%x, w/f/r/d %d/%d/%d/%d\n",
xdcsc->sc_dev.dv_xname,
device_xname(&xdcsc->sc_dev),
xdcsc->xdc->xdc_csr, xdcsc->nwait, xdcsc->nfree, xdcsc->nrun,
xdcsc->ndone);
for (lcv = 0; lcv < XDC_MAXIOPB; lcv++) {
@ -2404,7 +2401,7 @@ xdc_tick(arg)
reset = 1;
}
if (reset) {
printf("%s: watchdog timeout\n", xdcsc->sc_dev.dv_xname);
printf("%s: watchdog timeout\n", device_xname(&xdcsc->sc_dev));
xdc_reset(xdcsc, 0, XD_RSET_NONE, XD_ERR_FAIL, NULL);
}
splx(s);

View File

@ -1,4 +1,4 @@
/* $NetBSD: xy.c,v 1.78 2008/02/06 12:13:47 elad Exp $ */
/* $NetBSD: xy.c,v 1.79 2008/04/05 16:06:12 cegger Exp $ */
/*
*
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.78 2008/02/06 12:13:47 elad Exp $");
__KERNEL_RCSID(0, "$NetBSD: xy.c,v 1.79 2008/04/05 16:06:12 cegger Exp $");
#undef XYC_DEBUG /* full debug */
#undef XYC_DIAG /* extra sanity checks */
@ -271,7 +271,7 @@ xygetdisklabel(xy, b)
xydummystrat,
xy->sc_dk.dk_label, xy->sc_dk.dk_cpulabel);
if (err) {
printf("%s: %s\n", xy->sc_dev.dv_xname, err);
printf("%s: %s\n", device_xname(&xy->sc_dev), err);
return(XY_ERR_FAIL);
}
@ -284,11 +284,11 @@ xygetdisklabel(xy, b)
#endif
{
printf("%s: WARNING: no `pcyl' in disk label.\n",
xy->sc_dev.dv_xname);
device_xname(&xy->sc_dev));
xy->pcyl = xy->sc_dk.dk_label->d_ncylinders +
xy->sc_dk.dk_label->d_acylinders;
printf("%s: WARNING: guessing pcyl=%d (ncyl+acyl)\n",
xy->sc_dev.dv_xname, xy->pcyl);
device_xname(&xy->sc_dev), xy->pcyl);
}
xy->ncyl = xy->sc_dk.dk_label->d_ncylinders;
@ -463,8 +463,8 @@ xycattach(parent, self, aux)
BUS_DMA_NOWAIT,
&xyc->auxmap)) != 0) {
printf("%s: DMA buffer map create error %d\n",
xyc->sc_dev.dv_xname, error);
aprint_error_dev(&xyc->sc_dev, "DMA buffer map create error %d\n",
error);
return;
}
@ -481,8 +481,8 @@ xycattach(parent, self, aux)
BUS_DMA_NOWAIT,
&xyc->iopmap)) != 0) {
printf("%s: DMA buffer map create error %d\n",
xyc->sc_dev.dv_xname, error);
aprint_error_dev(&xyc->sc_dev, "DMA buffer map create error %d\n",
error);
return;
}
@ -491,8 +491,8 @@ xycattach(parent, self, aux)
XYC_MAXIOPB * sizeof(struct xy_iopb),
(void **)&xyc->iopbase,
&busaddr)) != 0) {
printf("%s: DMA buffer alloc error %d\n",
xyc->sc_dev.dv_xname, error);
aprint_error_dev(&xyc->sc_dev, "DMA buffer alloc error %d\n",
error);
return;
}
xyc->dvmaiopb = (struct xy_iopb *)(u_long)BUS_ADDR_PADDR(busaddr);
@ -533,8 +533,8 @@ xycattach(parent, self, aux)
BUS_DMA_NOWAIT,
&xyc->reqs[lcv].dmamap)) != 0) {
printf("%s: DMA buffer map create error %d\n",
xyc->sc_dev.dv_xname, error);
aprint_error_dev(&xyc->sc_dev, "DMA buffer map create error %d\n",
error);
return;
}
}
@ -558,13 +558,13 @@ xycattach(parent, self, aux)
printf(" [OLS disabled]"); /* 450 doesn't overlap seek right */
printf("\n");
if (error) {
printf("%s: error: %s\n", xyc->sc_dev.dv_xname,
aprint_error_dev(&xyc->sc_dev, "error: %s\n",
xyc_e2str(error));
return;
}
if ((xyc->xyc->xyc_csr & XYC_ADRM) == 0) {
printf("%s: 24 bit addressing turned off\n",
xyc->sc_dev.dv_xname);
device_xname(&xyc->sc_dev));
printf("please set hardware jumpers JM1-JM2=in, JM3-JM4=out\n");
printf("to enable 24 bit mode and this driver\n");
return;
@ -574,7 +574,7 @@ xycattach(parent, self, aux)
vme_intr_map(ct, va->ilevel, va->ivector, &ih);
vme_intr_establish(ct, ih, IPL_BIO, xycintr, xyc);
evcnt_attach_dynamic(&xyc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
xyc->sc_dev.dv_xname, "intr");
device_xname(&xyc->sc_dev), "intr");
callout_init(&xyc->sc_tick_ch, 0);
@ -672,7 +672,7 @@ xyattach(parent, self, aux)
}
}
printf("%s at %s",
xy->sc_dev.dv_xname, xy->parent->sc_dev.dv_xname);
device_xname(&xy->sc_dev), device_xname(&xy->parent->sc_dev));
}
/* we now have control */
@ -684,8 +684,8 @@ xyattach(parent, self, aux)
XYFM_BPS,
(void **)&buf,
&busaddr)) != 0) {
printf("%s: DMA buffer alloc error %d\n",
xyc->sc_dev.dv_xname, error);
aprint_error_dev(&xyc->sc_dev, "DMA buffer alloc error %d\n",
error);
return;
}
dmaddr = (void *)(u_long)BUS_ADDR_PADDR(busaddr);
@ -726,8 +726,8 @@ xyattach(parent, self, aux)
}
if (error != XY_ERR_AOK) {
printf("\n%s: reading disk label failed: %s\n",
xy->sc_dev.dv_xname, xyc_e2str(error));
aprint_error_dev(&xy->sc_dev, "\n%s: reading disk label failed: %s\n",
xyc_e2str(error));
goto done;
}
printf(" (drive type %d)\n", xy->drive_type);
@ -736,18 +736,18 @@ xyattach(parent, self, aux)
xy->hw_spt = spt = 0; /* XXX needed ? */
/* Attach the disk: must be before getdisklabel to malloc label */
disk_init(&xy->sc_dk, xy->sc_dev.dv_xname, &xydkdriver);
disk_init(&xy->sc_dk, device_xname(&xy->sc_dev), &xydkdriver);
disk_attach(&xy->sc_dk);
if (xygetdisklabel(xy, buf) != XY_ERR_AOK)
goto done;
/* inform the user of what is up */
printf("%s: <%s>, pcyl %d\n", xy->sc_dev.dv_xname,
printf("%s: <%s>, pcyl %d\n", device_xname(&xy->sc_dev),
buf, xy->pcyl);
mb = xy->ncyl * (xy->nhead * xy->nsect) / (1048576 / XYFM_BPS);
printf("%s: %dMB, %d cyl, %d head, %d sec, %d bytes/sec\n",
xy->sc_dev.dv_xname, mb, xy->ncyl, xy->nhead, xy->nsect,
device_xname(&xy->sc_dev), mb, xy->ncyl, xy->nhead, xy->nsect,
XYFM_BPS);
/*
@ -768,8 +768,8 @@ xyattach(parent, self, aux)
if (xy->nsect != oxy->nsect || xy->pcyl != oxy->pcyl ||
xy->nhead != oxy->nhead) {
printf("%s: %s and %s must be the same size!\n",
xyc->sc_dev.dv_xname, xy->sc_dev.dv_xname,
oxy->sc_dev.dv_xname);
device_xname(&xyc->sc_dev), device_xname(&xy->sc_dev),
device_xname(&oxy->sc_dev));
panic("xy drive size mismatch");
}
}
@ -783,8 +783,8 @@ xyattach(parent, self, aux)
error = xyc_cmd(xyc, XYCMD_SDS, 0, xy->xy_drive, blk, 0, 0, fmode);
XYC_DONE(xyc, error);
if (error) {
printf("%s: write drive size failed: %s\n",
xy->sc_dev.dv_xname, xyc_e2str(error));
aprint_error_dev(&xy->sc_dev, "write drive size failed: %s\n",
xyc_e2str(error));
goto done;
}
newstate = XY_DRIVE_ONLINE;
@ -801,8 +801,8 @@ xyattach(parent, self, aux)
dmaddr, fmode);
XYC_DONE(xyc, error);
if (error) {
printf("%s: reading bad144 failed: %s\n",
xy->sc_dev.dv_xname, xyc_e2str(error));
aprint_error_dev(&xy->sc_dev, "reading bad144 failed: %s\n",
xyc_e2str(error));
goto done;
}
@ -821,8 +821,7 @@ xyattach(parent, self, aux)
break;
}
if (lcv != 126) {
printf("%s: warning: invalid bad144 sector!\n",
xy->sc_dev.dv_xname);
aprint_error_dev(&xy->sc_dev, "warning: invalid bad144 sector!\n");
} else {
bcopy(buf, &xy->dkb, XYFM_BPS);
}
@ -896,7 +895,7 @@ xydump(dev, blkno, va, size)
xy = xy_cd.cd_devs[unit];
printf("%s%c: crash dump not supported (yet)\n", xy->sc_dev.dv_xname,
printf("%s%c: crash dump not supported (yet)\n", device_xname(&xy->sc_dev),
'a' + part);
return ENXIO;
@ -1451,7 +1450,7 @@ start:
if (XY_STATE(iorq->mode) != XY_SUB_FREE) {
DELAY(1000000); /* XY_SUB_POLL: steal the iorq */
iorq->mode = XY_SUB_FREE;
printf("%s: stole control iopb\n", xycsc->sc_dev.dv_xname);
printf("%s: stole control iopb\n", device_xname(&xycsc->sc_dev));
}
/* init iorq/iopb */
@ -1498,7 +1497,7 @@ xyc_startbuf(xycsc, xysc, bp)
partno = DISKPART(bp->b_dev);
#ifdef XYC_DEBUG
printf("xyc_startbuf: %s%c: %s block %d\n", xysc->sc_dev.dv_xname,
printf("xyc_startbuf: %s%c: %s block %d\n", device_xname(&xysc->sc_dev),
'a' + partno, (bp->b_flags & B_READ) ? "read" : "write", bp->b_blkno);
printf("xyc_startbuf: b_bcount %d, b_data 0x%x\n",
bp->b_bcount, bp->b_data);
@ -1516,8 +1515,7 @@ xyc_startbuf(xycsc, xysc, bp)
error = bus_dmamap_load(xycsc->dmatag, iorq->dmamap,
bp->b_data, bp->b_bcount, 0, BUS_DMA_NOWAIT);
if (error != 0) {
printf("%s: warning: cannot load DMA map\n",
xycsc->sc_dev.dv_xname);
aprint_error_dev(&sycsc->sc_dev, "warning: cannot load DMA map\n");
return (XY_ERR_FAIL); /* XXX: need some sort of
* call-back scheme here? */
}
@ -1587,7 +1585,7 @@ xyc_submit_iorq(xycsc, iorq, type)
#ifdef XYC_DEBUG
printf("xyc_submit_iorq(%s, addr=0x%x, type=%d)\n",
xycsc->sc_dev.dv_xname, iorq, type);
device_xname(&xycsc->sc_dev), iorq, type);
#endif
/* first check and see if controller is busy */
@ -1610,7 +1608,7 @@ xyc_submit_iorq(xycsc, iorq, type)
if (xyc_unbusy(xycsc->xyc,XYC_RESETUSEC) == XY_ERR_FAIL)
panic("xyc_submit_iorq: stuck xyc");
printf("%s: stole controller\n",
xycsc->sc_dev.dv_xname);
device_xname(&xycsc->sc_dev));
break;
default:
panic("xyc_submit_iorq adding");
@ -1736,7 +1734,7 @@ xyc_piodriver(xycsc, iorq)
int retval = 0;
u_long res;
#ifdef XYC_DEBUG
printf("xyc_piodriver(%s, 0x%x)\n", xycsc->sc_dev.dv_xname, iorq);
printf("xyc_piodriver(%s, 0x%x)\n", device_xname(&xycsc->sc_dev), iorq);
#endif
while (iorq->iopb->done == 0) {
@ -1818,7 +1816,7 @@ xyc_xyreset(xycsc, xysc)
}
if (del <= 0 || iopb->errs) {
printf("%s: off-line: %s\n", xycsc->sc_dev.dv_xname,
printf("%s: off-line: %s\n", device_xname(&xycsc->sc_dev),
xyc_e2str(iopb->errnum));
del = xycsc->xyc->xyc_rsetup;
if (xyc_unbusy(xycsc->xyc, XYC_RESETUSEC) == XY_ERR_FAIL)
@ -1849,7 +1847,7 @@ xyc_reset(xycsc, quiet, blastmode, error, xysc)
/* soft reset hardware */
if (!quiet)
printf("%s: soft reset\n", xycsc->sc_dev.dv_xname);
printf("%s: soft reset\n", device_xname(&xycsc->sc_dev));
del = xycsc->xyc->xyc_rsetup;
del = xyc_unbusy(xycsc->xyc, XYC_RESETUSEC);
if (del == XY_ERR_FAIL) {
@ -1966,10 +1964,9 @@ xyc_remove_iorq(xycsc)
* we dump them all.
*/
errnum = XY_ERR_DERR;
printf("%s: DOUBLE ERROR!\n", xycsc->sc_dev.dv_xname);
aprint_error_dev(&xycsc->sc_dev, "DOUBLE ERROR!\n");
if (xyc_reset(xycsc, 0, XY_RSET_ALL, errnum, 0) != XY_ERR_AOK) {
printf("%s: soft reset failed!\n",
xycsc->sc_dev.dv_xname);
aprint_error_dev(&xycsc->sc_dev, "soft reset failed!\n");
panic("xyc_remove_iorq: controller DEAD");
}
return (XY_ERR_AOK);
@ -2110,8 +2107,8 @@ xyc_perror(iorq, iopb, still_trying)
int error = iorq->lasterror;
printf("%s", (iorq->xy) ? iorq->xy->sc_dev.dv_xname
: iorq->xyc->sc_dev.dv_xname);
printf("%s", (iorq->xy) ? device_xname(&iorq->xy->sc_dev)
: device_xname(&iorq->xyc->sc_dev));
if (iorq->buf)
printf("%c: ", 'a' + DISKPART(iorq->buf->b_dev));
if (iopb->com == XYCMD_RD || iopb->com == XYCMD_WR)
@ -2225,7 +2222,7 @@ xyc_tick(arg)
reset = 1;
}
if (reset) {
printf("%s: watchdog timeout\n", xycsc->sc_dev.dv_xname);
printf("%s: watchdog timeout\n", device_xname(&xycsc->sc_dev));
xyc_reset(xycsc, 0, XY_RSET_NONE, XY_ERR_FAIL, NULL);
}
splx(s);