summaryrefslogtreecommitdiffstats
path: root/sys/dev/mlx/mlxreg.h
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1999-12-11 00:00:13 +0000
committermsmith <msmith@FreeBSD.org>1999-12-11 00:00:13 +0000
commit7f4d10be2c9eee66e10cec38c7bb014cb2a957cc (patch)
tree1e89a5e0931480d2f932d56a1d4607adf70f40ec /sys/dev/mlx/mlxreg.h
parent73feefc8af6d4a943bff813f0455b846f4d75978 (diff)
downloadFreeBSD-src-7f4d10be2c9eee66e10cec38c7bb014cb2a957cc.zip
FreeBSD-src-7f4d10be2c9eee66e10cec38c7bb014cb2a957cc.tar.gz
Major update to the Mylex DAC960 driver adding new hardware support
and fixing some major bugs. - Add support for the v5 firmware interface, used by the DAC1164P (tested) and AcceleRAID 352 (untested but should work). We now cover all of the Mylex family's protocols except for v2 (used by EISA and Alpha-compatible cards). - Fix an accounting bug which resulted in endless 'poll still busy' messages. In situations of high controller load the count of poll commands could be incremented without actually successfully launching a command. This totally removes the accounting for status poll commnads; it was its own worst enemy. - Add some simple reentry prevention locks to processing of the waiting and completed command queues to prevent races which could result in I/O being done or completed twice (both are fatal). This highlights a need for simple locking primitives in both the UP and SMP kernels. - Streamline the handling of command completion to reduce the amount of redundant work being done. Remove the code which tests for commands that have gone missing in action; nobody has ever seen one of these and it wouldn't have worked properly anyhow. - Handle disconnection of drives from the controller in the detach, not shutdown method. This avoids problems flushing the cache in a panic when a drive is mounted. - Don't call bus_generic_detach when disconnecting drives; it doesn't actually do anything useful. - Increment the log message index regardless of whether we actually retrieved one or not. If we run into a message that we can't fetch, we don't want to spin endlessly complaining about the fact. - Don't assume that interrupts will work when we're flushing the controller. We may think they are enabled, but in eg. a panic situation the controller may not be able to deliver an interrupt.
Diffstat (limited to 'sys/dev/mlx/mlxreg.h')
-rw-r--r--sys/dev/mlx/mlxreg.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/sys/dev/mlx/mlxreg.h b/sys/dev/mlx/mlxreg.h
index 6843b3e..f50e202 100644
--- a/sys/dev/mlx/mlxreg.h
+++ b/sys/dev/mlx/mlxreg.h
@@ -53,6 +53,7 @@
#define MLX_STATUS_OK 0x0000
#define MLX_STATUS_RDWROFFLINE 0x0002 /* read/write claims drive is offline */
#define MLX_STATUS_WEDGED 0xdead /* controller not listening */
+#define MLX_STATUS_LOST 0xbeef /* never came back */
#define MLX_STATUS_BUSY 0xffff /* command is in controller */
/*
@@ -115,6 +116,40 @@
#define MLX_V4_IER_DISINT (1<<2) /* interrupt disable bit */
/*
+ * Accessor defines for the V5 interface
+ */
+#define MLX_V5_MAILBOX 0x50
+#define MLX_V5_STATUS_IDENT 0x5d
+#define MLX_V5_STATUS 0x5e
+#define MLX_V5_IDBR 0x60
+#define MLX_V5_ODBR 0x61
+#define MLX_V5_IER 0x34
+
+#define MLX_V5_PUT_MAILBOX(sc, idx, val) bus_space_write_1(sc->mlx_btag, sc->mlx_bhandle, MLX_V5_MAILBOX + idx, val)
+#define MLX_V5_GET_STATUS_IDENT(sc) bus_space_read_1 (sc->mlx_btag, sc->mlx_bhandle, MLX_V5_STATUS_IDENT)
+#define MLX_V5_GET_STATUS(sc) bus_space_read_2 (sc->mlx_btag, sc->mlx_bhandle, MLX_V5_STATUS)
+#define MLX_V5_GET_IDBR(sc) bus_space_read_1 (sc->mlx_btag, sc->mlx_bhandle, MLX_V5_IDBR)
+#define MLX_V5_PUT_IDBR(sc, val) bus_space_write_1(sc->mlx_btag, sc->mlx_bhandle, MLX_V5_IDBR, val)
+#define MLX_V5_GET_ODBR(sc) bus_space_read_1 (sc->mlx_btag, sc->mlx_bhandle, MLX_V5_ODBR)
+#define MLX_V5_PUT_ODBR(sc, val) bus_space_write_1(sc->mlx_btag, sc->mlx_bhandle, MLX_V5_ODBR, val)
+#define MLX_V5_PUT_IER(sc, val) bus_space_write_1(sc->mlx_btag, sc->mlx_bhandle, MLX_V5_IER, val)
+
+#define MLX_V5_IDB_EMPTY (1<<0) /* mailbox is empty */
+
+#define MLX_V5_IDB_HWMBOX_CMD (1<<0) /* posted hardware mailbox command */
+#define MLX_V5_IDB_SACK (1<<1) /* acknowledge status read */
+#define MLX_V5_IDB_MEMMBOX_CMD (1<<4) /* posted memory mailbox command */
+
+#define MLX_V5_ODB_HWSAVAIL (1<<0) /* status is available for hardware mailbox */
+#define MLX_V5_ODB_MEMSAVAIL (1<<1) /* status is available for memory mailbox */
+
+#define MLX_V5_ODB_HWMBOX_ACK (1<<0) /* ack status read from hardware mailbox */
+#define MLX_V5_ODB_MEMMBOX_ACK (1<<1) /* ack status read from memory mailbox */
+
+#define MLX_V5_IER_DISINT (1<<2) /* interrupt disable bit */
+
+
+/*
* Scatter-gather list format, type 1, kind 00.
*/
struct mlx_sgentry
OpenPOWER on IntegriCloud