summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2006-08-24 13:59:37 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2006-08-24 13:59:37 +0000
commitc924ffe0358b90c98b0aaafd2f34f16f03a94844 (patch)
tree9cf891fd2508b423eb3a30ddbe01650777d18e65 /sys
parent237440d972d10f7da6c749549937b47bb6e6558f (diff)
show the firmware revision of the disks.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/arc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/pci/arc.c b/sys/dev/pci/arc.c
index d98bb94cfd3..261a0f519a9 100644
--- a/sys/dev/pci/arc.c
+++ b/sys/dev/pci/arc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arc.c,v 1.40 2006/08/24 13:43:47 dlg Exp $ */
+/* $OpenBSD: arc.c,v 1.41 2006/08/24 13:59:36 dlg Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -1194,7 +1194,9 @@ arc_bio_disk(struct arc_softc *sc, struct bioc_disk *bd)
struct arc_fw_raidinfo *raidinfo;
struct arc_fw_diskinfo *diskinfo;
int error = 0;
- char string[128];
+ char model[81];
+ char serial[41];
+ char rev[17];
volinfo = malloc(sizeof(struct arc_fw_volinfo), M_TEMP, M_WAITOK);
if (volinfo == NULL)
@@ -1254,10 +1256,14 @@ arc_bio_disk(struct arc_softc *sc, struct bioc_disk *bd)
bd->bd_status = BIOC_SDONLINE;
bd->bd_size = (u_int64_t)letoh32(diskinfo->capacity) * ARC_BLOCKSIZE;
- scsi_strvis(string, diskinfo->model, sizeof(diskinfo->model));
- strlcpy(bd->bd_vendor, string, sizeof(bd->bd_vendor));
- scsi_strvis(string, diskinfo->serial, sizeof(diskinfo->serial));
- strlcpy(bd->bd_serial, string, sizeof(bd->bd_serial));
+ scsi_strvis(model, diskinfo->model, sizeof(diskinfo->model));
+ scsi_strvis(serial, diskinfo->serial, sizeof(diskinfo->serial));
+ scsi_strvis(rev, diskinfo->firmware_rev,
+ sizeof(diskinfo->firmware_rev));
+
+ snprintf(bd->bd_vendor, sizeof(bd->bd_vendor), "%s %s",
+ model, rev);
+ strlcpy(bd->bd_serial, serial, sizeof(bd->bd_serial));
out:
arc_unlock(sc);