diff options
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/amr/amr.c | 4 | ||||
| -rw-r--r-- | sys/dev/amr/amr_disk.c | 22 | ||||
| -rw-r--r-- | sys/dev/amr/amrio.h | 8 |
3 files changed, 30 insertions, 4 deletions
diff --git a/sys/dev/amr/amr.c b/sys/dev/amr/amr.c index 69c8d2b3aa9b1..bdb3c02384875 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 7b66f4f8c930c..54d12134d577c 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 c35a133e0abd8..48e6efda467d0 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 |
