Home | History | Annotate | Line # | Download | only in ic
mlxio.h revision 1.3
      1  1.3  ad /*	$NetBSD: mlxio.h,v 1.3 2002/08/26 17:02:15 ad Exp $	*/
      2  1.1  ad 
      3  1.1  ad /*-
      4  1.1  ad  * Copyright (c) 1999 Michael Smith
      5  1.1  ad  * All rights reserved.
      6  1.1  ad  *
      7  1.1  ad  * Redistribution and use in source and binary forms, with or without
      8  1.1  ad  * modification, are permitted provided that the following conditions
      9  1.1  ad  * are met:
     10  1.1  ad  * 1. Redistributions of source code must retain the above copyright
     11  1.1  ad  *    notice, this list of conditions and the following disclaimer.
     12  1.1  ad  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  ad  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  ad  *    documentation and/or other materials provided with the distribution.
     15  1.1  ad  *
     16  1.1  ad  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     17  1.1  ad  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     18  1.1  ad  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19  1.1  ad  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     20  1.1  ad  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     21  1.1  ad  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     22  1.1  ad  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23  1.1  ad  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     24  1.1  ad  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25  1.1  ad  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  1.1  ad  * SUCH DAMAGE.
     27  1.1  ad  *
     28  1.1  ad  * from FreeBSD: mlxio.h,v 1.1.2.2 2000/04/24 19:40:49 msmith Exp
     29  1.1  ad  */
     30  1.1  ad 
     31  1.1  ad #ifndef _IC_MLXIO_H_
     32  1.1  ad #define	_IC_MLXIO_H_
     33  1.1  ad 
     34  1.1  ad #include <sys/ioccom.h>
     35  1.1  ad 
     36  1.1  ad /*
     37  1.1  ad  * System Disk ioctls
     38  1.1  ad  */
     39  1.1  ad 
     40  1.1  ad /* system disk status values */
     41  1.1  ad #define MLX_SYSD_ONLINE		0x03
     42  1.1  ad #define MLX_SYSD_CRITICAL	0x04
     43  1.1  ad #define MLX_SYSD_OFFLINE	0xff
     44  1.1  ad 
     45  1.1  ad #define MLXD_STATUS		_IOR('M', 100, int)
     46  1.1  ad #define MLXD_CHECKASYNC		_IOR('M', 101, int)
     47  1.1  ad #define MLXD_DETACH		_IOW('M', 102, int)
     48  1.1  ad 
     49  1.1  ad /*
     50  1.1  ad  * Controller ioctls
     51  1.1  ad  */
     52  1.1  ad struct mlx_pause {
     53  1.1  ad 	int		mp_which;
     54  1.1  ad #define MLX_PAUSE_ALL		0xff
     55  1.1  ad #define MLX_PAUSE_CANCEL	0x00
     56  1.1  ad 	int		mp_when;
     57  1.1  ad 	int		mp_howlong;
     58  1.1  ad };
     59  1.1  ad 
     60  1.1  ad struct mlx_usercommand {
     61  1.1  ad 	size_t		mu_datasize;	/* size of buffer */
     62  1.1  ad 	void		*mu_buf;	/* user address of buffer */
     63  1.1  ad 	int		mu_bufptr;	/* offset into command m/b for PA */
     64  1.1  ad 	int		mu_bufdir;	/* transfer is to controller */
     65  1.1  ad 	u_int16_t	mu_status;	/* command status returned */
     66  1.1  ad 	u_int8_t	mu_command[16];	/* command mailbox contents */
     67  1.1  ad };
     68  1.1  ad #define	MU_XFER_IN	0x01
     69  1.1  ad #define	MU_XFER_OUT	0x02
     70  1.1  ad #define	MU_XFER_MASK	0x03
     71  1.1  ad 
     72  1.1  ad struct mlx_rebuild_request {
     73  1.1  ad 	int		rr_channel;
     74  1.1  ad 	int		rr_target;
     75  1.1  ad 	int		rr_status;
     76  1.1  ad };
     77  1.1  ad 
     78  1.1  ad struct mlx_rebuild_status {
     79  1.1  ad 	u_int16_t	rs_code;
     80  1.1  ad #define MLX_REBUILDSTAT_REBUILDCHECK	0x0000
     81  1.1  ad #define MLX_REBUILDSTAT_ADDCAPACITY	0x0400
     82  1.1  ad #define MLX_REBUILDSTAT_ADDCAPACITYINIT	0x0500
     83  1.1  ad #define MLX_REBUILDSTAT_IDLE		0xffff
     84  1.1  ad 	u_int16_t	rs_drive;
     85  1.1  ad 	int		rs_size;
     86  1.1  ad 	int		rs_remaining;
     87  1.1  ad };
     88  1.1  ad 
     89  1.2  ad struct mlx_cinfo {
     90  1.2  ad 	u_int		ci_iftype;
     91  1.2  ad 	u_int		ci_nchan;
     92  1.2  ad 	u_int		ci_max_sg;
     93  1.2  ad 	u_int		ci_max_commands;
     94  1.2  ad 	u_int		ci_mem_size;
     95  1.2  ad 	u_int8_t	ci_firmware_id[4];
     96  1.2  ad 	u_int8_t	ci_hardware_id;
     97  1.2  ad 	u_int8_t	ci_pad[3];
     98  1.2  ad };
     99  1.2  ad 
    100  1.1  ad #define MLX_RESCAN_DRIVES	_IO('M', 0)
    101  1.1  ad #define MLX_PAUSE_CHANNEL	_IOW('M', 1, struct mlx_pause)
    102  1.1  ad #define MLX_COMMAND		_IOWR('M', 2, struct mlx_usercommand)
    103  1.1  ad #define MLX_REBUILDASYNC	_IOWR('M', 3, struct mlx_rebuild_request)
    104  1.1  ad #define MLX_REBUILDSTAT		_IOR('M', 4, struct mlx_rebuild_status)
    105  1.1  ad #define MLX_GET_SYSDRIVE	_IOWR('M', 5, int)
    106  1.3  ad #define	MLX_GET_CINFO		_IOR('M', 6, struct mlx_cinfo)
    107  1.1  ad 
    108  1.1  ad #endif	/* !_IC_MLXIO_H_ */
    109