summaryrefslogtreecommitdiffstats
path: root/sys/dev/amr/amrio.h
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2000-08-30 07:52:50 +0000
committermsmith <msmith@FreeBSD.org>2000-08-30 07:52:50 +0000
commit57e68c62d17b66f459c483b558040d92d60acfd2 (patch)
tree2e6f3cbeb2706d844ab4ae98321cabcafa39f481 /sys/dev/amr/amrio.h
parent4f58969f65082230d9032b09e224be12902dc3a3 (diff)
downloadFreeBSD-src-57e68c62d17b66f459c483b558040d92d60acfd2.zip
FreeBSD-src-57e68c62d17b66f459c483b558040d92d60acfd2.tar.gz
Major update to the AMI MegaRAID driver.
- New support for 40LD firmware found in Series 475 and 471 adapters. - Better support for 8LD firmware adapters - Ioctl passthrough interface for userland utilities. - Improved error handling and queueing. - Several bugfixes (including the 'still open' shutdown bug and closing some small race conditions). - Zone-style command allocator, reducing memory wasted under heavy load conditions. - CAM interface (disabled and not fully working) for SCSI passthrough access to non-disk devices Thanks to AMI for supplying a pile of new adapters and various other help in making this happen.
Diffstat (limited to 'sys/dev/amr/amrio.h')
-rw-r--r--sys/dev/amr/amrio.h54
1 files changed, 49 insertions, 5 deletions
diff --git a/sys/dev/amr/amrio.h b/sys/dev/amr/amrio.h
index 48e6efd..757e81c 100644
--- a/sys/dev/amr/amrio.h
+++ b/sys/dev/amr/amrio.h
@@ -27,10 +27,54 @@
*/
/*
- * Drive status
+ * ioctl interface
*/
-#define AMRD_OFFLINE 0x0
-#define AMRD_DEGRADED 0x1
-#define AMRD_OPTIMAL 0x2
-#define AMRD_DELETED 0x3
+#include <sys/ioccom.h>
+
+/*
+ * Fetch the driver's interface version.
+ */
+#define AMR_IO_VERSION_NUMBER 0x01
+#define AMR_IO_VERSION _IOR('A', 0x200, int)
+
+/*
+ * Pass a command from userspace through to the adapter.
+ *
+ * Note that in order to be code-compatible with the Linux
+ * interface where possible, the formatting of the au_cmd field is
+ * somewhat Interesting.
+ *
+ * For normal commands, the layout is (fields from struct amr_mailbox_ioctl):
+ *
+ * 0 mb_command
+ * 1 mb_channel
+ * 2 mb_param
+ * 3 mb_pad[0]
+ * 4 mb_drive
+ *
+ * For SCSI passthrough commands, the layout is:
+ *
+ * 0 AMR_CMD_PASS (0x3)
+ * 1 reserved, 0
+ * 2 cdb length
+ * 3 cdb data
+ * 3+cdb_len passthrough control byte (timeout, ars, islogical)
+ * 4+cdb_len reserved, 0
+ * 5+cdb_len channel
+ * 6+cdb_len target
+ */
+
+struct amr_user_ioctl {
+ unsigned char au_cmd[32]; /* command text from userspace */
+ void *au_buffer; /* data buffer in userspace */
+ unsigned long au_length; /* data buffer size (0 == no data) */
+ int au_direction; /* data transfer direction */
+#define AMR_IO_NODATA 0
+#define AMR_IO_READ 1
+#define AMR_IO_WRITE 2
+ int au_status; /* command status returned by adapter */
+};
+
+#define AMR_IO_COMMAND _IOWR('A', 0x201, struct amr_user_ioctl)
+
OpenPOWER on IntegriCloud