1 /* $NetBSD: mlxio.h,v 1.2 2002/08/26 15:27:13 ad Exp $ */
4 * Copyright (c) 1999 Michael Smith
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * from FreeBSD: mlxio.h,v 1.1.2.2 2000/04/24 19:40:49 msmith Exp
34 #include <sys/ioccom.h>
40 /* system disk status values */
41 #define MLX_SYSD_ONLINE 0x03
42 #define MLX_SYSD_CRITICAL 0x04
43 #define MLX_SYSD_OFFLINE 0xff
45 #define MLXD_STATUS _IOR('M', 100, int)
46 #define MLXD_CHECKASYNC _IOR('M', 101, int)
47 #define MLXD_DETACH _IOW('M', 102, int)
54 #define MLX_PAUSE_ALL 0xff
55 #define MLX_PAUSE_CANCEL 0x00
60 struct mlx_usercommand
{
61 size_t mu_datasize
; /* size of buffer */
62 void *mu_buf
; /* user address of buffer */
63 int mu_bufptr
; /* offset into command m/b for PA */
64 int mu_bufdir
; /* transfer is to controller */
65 u_int16_t mu_status
; /* command status returned */
66 u_int8_t mu_command
[16]; /* command mailbox contents */
68 #define MU_XFER_IN 0x01
69 #define MU_XFER_OUT 0x02
70 #define MU_XFER_MASK 0x03
72 struct mlx_rebuild_request
{
78 struct mlx_rebuild_status
{
80 #define MLX_REBUILDSTAT_REBUILDCHECK 0x0000
81 #define MLX_REBUILDSTAT_ADDCAPACITY 0x0400
82 #define MLX_REBUILDSTAT_ADDCAPACITYINIT 0x0500
83 #define MLX_REBUILDSTAT_IDLE 0xffff
93 u_int ci_max_commands
;
95 u_int8_t ci_firmware_id
[4];
96 u_int8_t ci_hardware_id
;
100 #define MLX_RESCAN_DRIVES _IO('M', 0)
101 #define MLX_PAUSE_CHANNEL _IOW('M', 1, struct mlx_pause)
102 #define MLX_COMMAND _IOWR('M', 2, struct mlx_usercommand)
103 #define MLX_REBUILDASYNC _IOWR('M', 3, struct mlx_rebuild_request)
104 #define MLX_REBUILDSTAT _IOR('M', 4, struct mlx_rebuild_status)
105 #define MLX_GET_SYSDRIVE _IOWR('M', 5, int)
106 #define MLX_GET_CINFO _IOR('M', 6, struct mlx_cinfo)
108 #endif /* !_IC_MLXIO_H_ */