1 /* $NetBSD: icp_ioctl.h,v 1.5 2005/12/11 12:21:27 christos Exp $ */
4 * Copyright (c) 2000-03 Intel Corporation
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 * without modification, immediately at the beginning of the file.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * ioctl interface to ICP-Vortex RAID controllers. Facilitates use of
34 * ICP's configuration tools.
37 #ifndef _DEV_IC_ICP_IOCTL_H_
38 #define _DEV_IC_ICP_IOCTL_H_
40 #include <sys/ioccom.h>
41 #include <dev/ic/icpreg.h>
43 #define GDT_SCRATCH_SZ 3072 /* 3KB scratch buffer */
46 typedef struct gdt_ucmd
{
54 u_int32_t cmd_boardnode
;
55 u_int32_t cmd_cmdindex
;
60 struct icp_ioctlcmd ic
;
61 struct icp_cachecmd cc
;
65 u_int8_t data
[GDT_SCRATCH_SZ
];
66 } __packed gdt_ucmd_t
;
67 #define GDT_IOCTL_GENERAL _IOWR('J', 0, gdt_ucmd_t)
69 /* get driver version */
70 #define GDT_IOCTL_DRVERS _IOR('J', 1, int)
72 /* get controller type */
73 typedef struct gdt_ctrt
{
82 u_int16_t sub_device_id
;
83 } __packed gdt_ctrt_t
;
84 #define GDT_IOCTL_CTRTYPE _IOWR('J', 2, gdt_ctrt_t)
87 typedef struct gdt_osv
{
94 #define GDT_IOCTL_OSVERS _IOR('J', 3, gdt_osv_t)
96 /* get controller count */
97 #define GDT_IOCTL_CTRCNT _IOR('J', 5, int)
99 /* 6 -- lock host drive? */
100 /* 7 -- lock channel? */
103 #define GDT_ES_ASYNC 1
104 #define GDT_ES_DRIVER 2
105 #define GDT_ES_TEST 3
106 #define GDT_ES_SYNC 4
108 u_int16_t size
; /* size of structure */
121 u_int8_t scsi_coord
[3];
129 u_int8_t scsi_coord
[3];
140 u_int8_t event_string
[256];
141 } __packed gdt_evt_data
;
144 u_int32_t first_stamp
;
145 u_int32_t last_stamp
;
146 u_int16_t same_count
;
147 u_int16_t event_source
;
149 u_int8_t application
;
151 gdt_evt_data event_data
;
152 } __packed gdt_evt_str
;
154 typedef struct gdt_event
{
158 } __packed gdt_event_t
;
159 #define GDT_IOCTL_EVENT _IOWR('J', 7, gdt_event_t)
162 typedef struct gdt_statist
{
163 u_int16_t io_count_act
;
164 u_int16_t io_count_max
;
165 u_int16_t req_queue_act
;
166 u_int16_t req_queue_max
;
167 u_int16_t cmd_index_act
;
168 u_int16_t cmd_index_max
;
169 u_int16_t sg_count_act
;
170 u_int16_t sg_count_max
;
171 } __packed gdt_statist_t
;
172 #define GDT_IOCTL_STATIST _IOR('J', 9, gdt_statist_t)
174 /* rescan host drives */
175 typedef struct gdt_rescan
{
183 u_int8_t cluster_type
;
184 } __packed hdr_list
[ICP_MAX_HDRIVES
];
185 } __packed gdt_rescan_t
;
186 #define GDT_IOCTL_RESCAN _IOWR('J', 11, gdt_rescan_t)
188 #endif /* _DEV_IC_ICP_IOCTL_H_ */