Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/hp300/dev Print rd(4) capacity and geometry info as...



details:   https://anonhg.NetBSD.org/src/rev/fb7713c68d6c
branches:  trunk
changeset: 958546:fb7713c68d6c
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sun Jan 10 00:58:56 2021 +0000

description:
Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks

diffstat:

 sys/arch/hp300/dev/rd.c |  18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diffs (46 lines):

diff -r 62da912aafbc -r fb7713c68d6c sys/arch/hp300/dev/rd.c
--- a/sys/arch/hp300/dev/rd.c   Sun Jan 10 00:12:50 2021 +0000
+++ b/sys/arch/hp300/dev/rd.c   Sun Jan 10 00:58:56 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rd.c,v 1.102 2020/09/29 02:49:56 msaitoh Exp $ */
+/*     $NetBSD: rd.c,v 1.103 2021/01/10 00:58:56 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.102 2020/09/29 02:49:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.103 2021/01/10 00:58:56 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -384,7 +384,7 @@
 {
        struct rd_describe *desc = sc != NULL ? &sc->sc_rddesc : NULL;
        u_char stat, cmd[3];
-       char name[7];
+       char name[7], pbuf[9];
        int i, id, n, ctlr, slave;
 
        ctlr = device_unit(parent);
@@ -487,11 +487,13 @@
         * XXX blocks.  ICK!
         */
        aprint_normal(": %s\n", rdidentinfo[id].ri_desc);
-       aprint_normal_dev(sc->sc_dev, "%d cylinders, %d heads, %d blocks,"
-           " %d bytes/block\n",
-           rdidentinfo[id].ri_ncyl,
-           rdidentinfo[id].ri_ntpc, rdidentinfo[id].ri_nblocks,
-           DEV_BSIZE);
+       format_bytes(pbuf, sizeof(pbuf),
+           rdidentinfo[id].ri_nblocks * DEV_BSIZE);
+       aprint_normal_dev(sc->sc_dev, "%s, %d cyl, %d head, %d sec,"
+           " %d bytes/block x %u blocks\n",
+           pbuf, rdidentinfo[id].ri_ncyl, rdidentinfo[id].ri_ntpc,
+           rdidentinfo[id].ri_nbpt,
+           DEV_BSIZE, rdidentinfo[id].ri_nblocks);
 
        return 1;
 }



Home | Main Index | Thread Index | Old Index