summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-11-02 03:24:09 +0000
committermsmith <msmith@FreeBSD.org>1999-11-02 03:24:09 +0000
commit0581a055e6545d6be327ec8a349e5af82beba6aa (patch)
tree4833288d6bd891b7988134d0a860632ee9a162fd
parentc4b43b216f2f130fdc58a759240356f18083f002 (diff)
downloadFreeBSD-src-0581a055e6545d6be327ec8a349e5af82beba6aa.zip
FreeBSD-src-0581a055e6545d6be327ec8a349e5af82beba6aa.tar.gz
Don't print the chipset value; it's not useful.
Now we know what some of the state values are, print the current array state.
-rw-r--r--sys/dev/amr/amr.c4
-rw-r--r--sys/dev/amr/amr_disk.c22
-rw-r--r--sys/dev/amr/amrio.h8
3 files changed, 30 insertions, 4 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c
index 69c8d2b..bdb3c02 100644
--- a/sys/dev/amr/amr.c
+++ b/sys/dev/amr/amr.c
@@ -692,9 +692,9 @@ amr_query_controller(struct amr_softc *sc)
}
/* first-time enquiry? */
if (sc->amr_maxdrives == 0) {
- device_printf(sc->amr_dev, "firmware %.4s bios %.4s %dMB memory, chipset %x\n",
+ device_printf(sc->amr_dev, "firmware %.4s bios %.4s %dMB memory\n",
ae->ae_adapter.aa_firmware, ae->ae_adapter.aa_bios,
- ae->ae_adapter.aa_memorysize, ae->ae_adapter.aa_chipsetvalue);
+ ae->ae_adapter.aa_memorysize);
}
sc->amr_maxdrives = 8;
sc->amr_maxio = ae->ae_adapter.aa_maxio;
diff --git a/sys/dev/amr/amr_disk.c b/sys/dev/amr/amr_disk.c
index 7b66f4f..54d1213 100644
--- a/sys/dev/amr/amr_disk.c
+++ b/sys/dev/amr/amr_disk.c
@@ -255,6 +255,7 @@ amrd_attach(device_t dev)
{
struct amrd_softc *sc = (struct amrd_softc *)device_get_softc(dev);
device_t parent;
+ char *state;
debug("called");
@@ -264,9 +265,26 @@ amrd_attach(device_t dev)
sc->amrd_drive = device_get_ivars(dev);
sc->amrd_dev = dev;
- device_printf(dev, "%uMB (%u sectors), state 0x%x properties 0x%x\n",
+ switch(sc->amrd_drive->al_state) {
+ case AMRD_OFFLINE:
+ state = "offline";
+ break;
+ case AMRD_DEGRADED:
+ state = "degraded";
+ break;
+ case AMRD_OPTIMAL:
+ state = "optimal";
+ break;
+ case AMRD_DELETED:
+ state = "deleted";
+ break;
+ default:
+ state = "unknown state";
+ }
+
+ device_printf(dev, "%uMB (%u sectors) RAID %d (%s)\n",
sc->amrd_drive->al_size / ((1024 * 1024) / AMR_BLKSIZE),
- sc->amrd_drive->al_size, sc->amrd_drive->al_state, sc->amrd_drive->al_properties);
+ sc->amrd_drive->al_size, sc->amrd_drive->al_properties & 0xf, state);
devstat_add_entry(&sc->amrd_stats, "amrd", sc->amrd_unit, AMR_BLKSIZE,
DEVSTAT_NO_ORDERED_TAGS,
diff --git a/sys/dev/amr/amrio.h b/sys/dev/amr/amrio.h
index c35a133..48e6efd 100644
--- a/sys/dev/amr/amrio.h
+++ b/sys/dev/amr/amrio.h
@@ -26,3 +26,11 @@
* $FreeBSD$
*/
+/*
+ * Drive status
+ */
+
+#define AMRD_OFFLINE 0x0
+#define AMRD_DEGRADED 0x1
+#define AMRD_OPTIMAL 0x2
+#define AMRD_DELETED 0x3
OpenPOWER on IntegriCloud