Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Use aprint*().



details:   https://anonhg.NetBSD.org/src/rev/9f30356e3e07
branches:  trunk
changeset: 547081:9f30356e3e07
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue May 13 03:00:07 2003 +0000

description:
Use aprint*().

diffstat:

 sys/dev/scsipi/scsiconf.c |  19 +++++++++++--------
 sys/dev/scsipi/sd.c       |  19 ++++++++++---------
 2 files changed, 21 insertions(+), 17 deletions(-)

diffs (144 lines):

diff -r 88296189ebcc -r 9f30356e3e07 sys/dev/scsipi/scsiconf.c
--- a/sys/dev/scsipi/scsiconf.c Tue May 13 02:56:13 2003 +0000
+++ b/sys/dev/scsipi/scsiconf.c Tue May 13 03:00:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsiconf.c,v 1.204 2003/05/02 12:27:49 fvdl Exp $      */
+/*     $NetBSD: scsiconf.c,v 1.205 2003/05/13 03:02:36 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.204 2003/05/02 12:27:49 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.205 2003/05/13 03:02:36 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -175,7 +175,8 @@
        sc->sc_channel = chan;
        chan->chan_name = sc->sc_dev.dv_xname;
 
-       printf(": %d target%s, %d lun%s per target\n",
+       aprint_naive(": SCSI bus\n");
+       aprint_normal(": %d target%s, %d lun%s per target\n",
            chan->chan_ntargets,
            chan->chan_ntargets == 1 ? "" : "s",
            chan->chan_nluns,
@@ -190,10 +191,10 @@
        TAILQ_INSERT_TAIL(&scsi_initq_head, scsi_initq, scsi_initq);
         config_pending_incr();
        if (scsipi_channel_init(chan)) {
-               printf(": failed to init channel\n");
+               aprint_error("%s: failed to init channel\n",
+                   sc->sc_dev.dv_xname);
                return;
        }
-
 }
 
 void
@@ -209,7 +210,8 @@
 #endif
        if ((chan->chan_flags & SCSIPI_CHAN_NOSETTLE) == 0 &&
            SCSI_DELAY > 0) {
-               printf("%s: waiting %d seconds for devices to settle...\n",
+               aprint_normal(
+                   "%s: waiting %d seconds for devices to settle...\n",
                    sc->sc_dev.dv_xname, SCSI_DELAY);
                /* ...an identifier we know no one will use... */
                (void) tsleep(scsibus_config, PRIBIO,
@@ -734,7 +736,8 @@
        periph = scsipi_alloc_periph(M_NOWAIT);
        if (periph == NULL) {
 #ifdef DIAGNOSTIC
-               printf("%s: cannot allocate periph for target %d lun %d\n",
+               aprint_error(
+                   "%s: cannot allocate periph for target %d lun %d\n",
                    sc->sc_dev.dv_xname, target, lun);
 #endif
                return (ENOMEM);
@@ -950,7 +953,7 @@
                (void) config_attach(&sc->sc_dev, cf, &sa, scsibusprint);
        } else {
                scsibusprint(&sa, sc->sc_dev.dv_xname);
-               printf(" not configured\n");
+               aprint_normal(" not configured\n");
                goto bad;
        }
 
diff -r 88296189ebcc -r 9f30356e3e07 sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Tue May 13 02:56:13 2003 +0000
+++ b/sys/dev/scsipi/sd.c       Tue May 13 03:00:07 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.199 2003/05/10 23:12:47 thorpej Exp $ */
+/*     $NetBSD: sd.c,v 1.200 2003/05/13 03:00:07 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.199 2003/05/10 23:12:47 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.200 2003/05/13 03:00:07 thorpej Exp $");
 
 #include "opt_scsi.h"
 #include "opt_bufq.h"
@@ -187,7 +187,8 @@
        /*
         * Use the subdriver to request information regarding the drive.
         */
-       printf("\n");
+       aprint_naive("\n");
+       aprint_normal("\n");
 
        error = scsipi_start(periph, SSS_START,
            XS_CTL_DISCOVERY | XS_CTL_IGNORE_ILLEGAL_REQUEST |
@@ -198,23 +199,23 @@
        else
                result = (*sd->sc_ops->sdo_get_parms)(sd, &sd->params,
                    XS_CTL_DISCOVERY);
-       printf("%s: ", sd->sc_dev.dv_xname);
+       aprint_normal("%s: ", sd->sc_dev.dv_xname);
        switch (result) {
        case SDGP_RESULT_OK:
                format_bytes(pbuf, sizeof(pbuf),
                    (u_int64_t)dp->disksize * dp->blksize);
-               printf(
+               aprint_normal(
                "%s, %ld cyl, %ld head, %ld sec, %ld bytes/sect x %llu sectors",
                    pbuf, dp->cyls, dp->heads, dp->sectors, dp->blksize,
                    (unsigned long long)dp->disksize);
                break;
 
        case SDGP_RESULT_OFFLINE:
-               printf("drive offline");
+               aprint_normal("drive offline");
                break;
 
        case SDGP_RESULT_UNFORMATTED:
-               printf("unformatted media");
+               aprint_normal("unformatted media");
                break;
 
 #ifdef DIAGNOSTIC
@@ -223,7 +224,7 @@
                break;
 #endif
        }
-       printf("\n");
+       aprint_normal("\n");
 
        /*
         * Establish a shutdown hook so that we can ensure that
@@ -235,7 +236,7 @@
         */
        if ((sd->sc_sdhook =
            shutdownhook_establish(sd_shutdown, sd)) == NULL)
-               printf("%s: WARNING: unable to establish shutdown hook\n",
+               aprint_error("%s: WARNING: unable to establish shutdown hook\n",
                    sd->sc_dev.dv_xname);
 
 #if NRND > 0



Home | Main Index | Thread Index | Old Index