summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2006-05-25 04:23:58 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2006-05-25 04:23:58 +0000
commit6f86c3321e251a4425a23cff379544d3ab3910b2 (patch)
tree001874342df1a4235a787fcce20a25cea1f303bf
parent0b4f611b3584b38ae53d4423f744f0189cfbbccc (diff)
And add time and percentage to builds and check consistencies.
-rw-r--r--sys/dev/ic/mfi.c28
-rw-r--r--sys/dev/ic/mfireg.h3
2 files changed, 27 insertions, 4 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index 62c56653b94..aec2068866e 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.55 2006/05/25 02:15:47 marco Exp $ */
+/* $OpenBSD: mfi.c,v 1.56 2006/05/25 04:23:57 marco Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -1261,7 +1261,7 @@ mfi_ioctl_inq(struct mfi_softc *sc, struct bioc_inq *bi)
int
mfi_ioctl_vol(struct mfi_softc *sc, struct bioc_vol *bv)
{
- int i, rv = EINVAL;
+ int i, per, rv = EINVAL;
uint8_t mbox[MFI_MBOX_SIZE];
DNPRINTF(MFI_D_IOCTL, "%s: mfi_ioctl_vol %#x\n",
@@ -1308,6 +1308,30 @@ mfi_ioctl_vol(struct mfi_softc *sc, struct bioc_vol *bv)
sc->sc_ld_list.mll_list[i].mll_state);
}
+ /* additional status can modify MFI status */
+ switch (sc->sc_ld_details.mld_progress.mlp_in_prog) {
+ case MFI_LD_PROG_CC:
+ bv->bv_status = BIOC_SVSCRUB;
+ per = (int)sc->sc_ld_details.mld_progress.mlp_cc.mp_progress;
+ bv->bv_percent = (per * 100) / 0xffff;
+ bv->bv_seconds =
+ sc->sc_ld_details.mld_progress.mlp_cc.mp_elapsed_seconds;
+ break;
+
+ case MFI_LD_PROG_BGI:
+ bv->bv_status = BIOC_SVBUILDING;
+ per = (int)sc->sc_ld_details.mld_progress.mlp_bgi.mp_progress;
+ bv->bv_percent = (per * 100) / 0xffff;
+ bv->bv_seconds =
+ sc->sc_ld_details.mld_progress.mlp_bgi.mp_elapsed_seconds;
+ break;
+
+ case MFI_LD_PROG_FGI:
+ case MFI_LD_PROG_RECONSTRUCT:
+ /* nothing yet */
+ break;
+ }
+
/*
* The RAID levels are determined per the SNIA DDF spec, this is only
* a subset that is valid for the MFI contrller.
diff --git a/sys/dev/ic/mfireg.h b/sys/dev/ic/mfireg.h
index e33c2ef78f2..4500b4b4158 100644
--- a/sys/dev/ic/mfireg.h
+++ b/sys/dev/ic/mfireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfireg.h,v 1.21 2006/05/25 03:01:38 marco Exp $ */
+/* $OpenBSD: mfireg.h,v 1.22 2006/05/25 04:23:57 marco Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -384,7 +384,6 @@ struct mfi_evt_log_info {
struct mfi_progress {
uint16_t mp_progress;
uint16_t mp_elapsed_seconds;
-
} __packed;
struct mfi_evtarg_ld {