summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/mfi.c17
-rw-r--r--sys/dev/ic/mfireg.h26
-rw-r--r--sys/dev/ic/mfivar.h3
3 files changed, 40 insertions, 6 deletions
diff --git a/sys/dev/ic/mfi.c b/sys/dev/ic/mfi.c
index c2356b16ffc..2777305c4e6 100644
--- a/sys/dev/ic/mfi.c
+++ b/sys/dev/ic/mfi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfi.c,v 1.50 2006/05/22 19:50:43 marco Exp $ */
+/* $OpenBSD: mfi.c,v 1.51 2006/05/23 00:43:57 marco Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -671,6 +671,9 @@ mfi_attach(struct mfi_softc *sc)
/* enable interrupts */
mfi_write(sc, MFI_OMSK, MFI_ENABLE_INTR);
+ /* memory for physical disk map */
+ sc->sc_pd_list = malloc(MFI_PD_LIST_SIZE, M_DEVBUF, M_WAITOK);
+
return (0);
noinit:
mfi_freemem(sc, sc->sc_sense);
@@ -1338,7 +1341,17 @@ done:
int
mfi_ioctl_disk(struct mfi_softc *sc, struct bioc_disk *bd)
{
- return (ENOTTY); /* XXX not yet */
+ int i, rv = EINVAL;
+
+ DNPRINTF(MFI_D_IOCTL, "%s: mfi_ioctl_disk %#x\n",
+ DEVNAME(sc), bd->bd_diskid);
+
+ if (mfi_mgmt(sc, MR_DCMD_PD_GET_LIST, MFI_DATA_IN,
+ MFI_PD_LIST_SIZE, sc->sc_pd_list, NULL))
+ goto done;
+ rv = 0;
+done:
+ return (rv);
}
int
diff --git a/sys/dev/ic/mfireg.h b/sys/dev/ic/mfireg.h
index 569fe36ea94..ee2e3f3f936 100644
--- a/sys/dev/ic/mfireg.h
+++ b/sys/dev/ic/mfireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfireg.h,v 1.17 2006/05/22 19:50:43 marco Exp $ */
+/* $OpenBSD: mfireg.h,v 1.18 2006/05/23 00:43:57 marco Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -92,8 +92,10 @@
#define MR_DCMD_CTRL_EVENT_GET_INFO 0x01040100
#define MR_DCMD_CTRL_EVENT_GET 0x01040300
#define MR_DCMD_CTRL_EVENT_WAIT 0x01040500
-#define MR_DCMD_LD_GET_LIST 0x03010000
-#define MR_DCMD_LD_GET_INFO 0x03020000
+#define MR_DCMD_PD_GET_LIST 0x02010000
+#define MR_DCMD_PD_GET_INFO 0x02020000
+#define MR_DCMD_LD_GET_LIST 0x03010000
+#define MR_DCMD_LD_GET_INFO 0x03020000
#define MR_DCMD_LD_GET_PROPERTIES 0x03030000
#define MR_DCMD_CLUSTER 0x08000000
#define MR_DCMD_CLUSTER_RESET_ALL 0x08010100
@@ -767,3 +769,21 @@ struct mfi_ld_details {
uint8_t mld_inq_page83[64];
uint8_t mld_res[16];
} __packed;
+
+/* physical disk info from MR_DCMD_PD_GET_LIST */
+struct mdi_pd_address {
+ uint16_t mpa_pd_id;
+ uint16_t mpa_enc_id;
+ uint8_t mpa_enc_index;
+ uint8_t mpa_enc_slot;
+ uint8_t mpa_scsi_type;
+ uint8_t mpa_port;
+ u_quad_t mpa_sas_address[2];
+} __packed;
+
+struct mfi_pd_list {
+ uint32_t mpl_size;
+ uint32_t mpl_no_pd;
+ struct mdi_pd_address mpl_address[1];
+} __packed;
+#define MFI_PD_LIST_SIZE (256 * sizeof(struct mdi_pd_address) + 8)
diff --git a/sys/dev/ic/mfivar.h b/sys/dev/ic/mfivar.h
index 66a6a472d77..25ecfe38015 100644
--- a/sys/dev/ic/mfivar.h
+++ b/sys/dev/ic/mfivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mfivar.h,v 1.23 2006/05/22 02:24:11 marco Exp $ */
+/* $OpenBSD: mfivar.h,v 1.24 2006/05/23 00:43:57 marco Exp $ */
/*
* Copyright (c) 2006 Marco Peereboom <marco@peereboom.us>
*
@@ -125,6 +125,7 @@ struct mfi_softc {
struct mfi_ctrl_info sc_info;
struct mfi_ld_list sc_ld_list;
struct mfi_ld_details sc_ld_details;
+ struct mfi_pd_list *sc_pd_list;
/* all commands */
struct mfi_ccb *sc_ccb;