2 * Copyright (c) 2003-04 3ware, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * $DragonFly: src/sys/dev/raid/twa/twa_ioctl.h,v 1.1 2004/04/16 20:13:17 drhodus Exp $
31 * 3ware driver for 9000 series storage controllers.
33 * Author: Vinod Kashyap
37 #define TWA_AEN_NOT_RETRIEVED 0x1
38 #define TWA_AEN_RETRIEVED 0x2
40 #define TWA_ERROR_AEN_NO_EVENTS 0x1003 /* No more events */
41 #define TWA_ERROR_AEN_OVERFLOW 0x1004 /* AEN clobber occurred */
43 #define TWA_ERROR_IOCTL_LOCK_NOT_HELD 0x1001 /* Not locked */
44 #define TWA_ERROR_IOCTL_LOCK_ALREADY_HELD 0x1002 /* Already locked */
48 struct twa_scan_bus_packet {
50 } __attribute__ ((packed));
53 struct twa_event_packet {
54 u_int32_t sequence_id;
55 u_int32_t time_stamp_sec;
59 u_int8_t repeat_count;
60 u_int8_t parameter_len;
61 u_int8_t parameter_data[98];
62 } __attribute__ ((packed));
65 struct twa_lock_packet {
66 u_int32_t timeout_msec;
67 u_int32_t time_remaining_msec;
69 } __attribute__ ((packed));
72 struct twa_compatibility_packet {
73 uint8_t driver_version[32];/* driver version */
74 uint16_t working_srl; /* driver & firmware negotiated srl */
75 uint16_t working_branch; /* branch # of the firmware that the driver is compatible with */
76 uint16_t working_build; /* build # of the firmware that the driver is compatible with */
77 } __attribute__ ((packed));
80 struct twa_driver_packet {
81 u_int32_t control_code;
84 u_int32_t sequence_id;
86 u_int32_t buffer_length;
87 } __attribute__ ((packed));
91 struct twa_driver_packet twa_drvr_pkt;
92 void *pdata; /* points to data_buf */
94 struct twa_command_packet twa_cmd_pkt;
96 } __attribute__ ((packed));
100 * We need the structure below to ensure that the first byte of
101 * data_buf is not overwritten by the kernel, after we return
102 * from the ioctl call. Note that twa_cmd_pkt has been reduced
103 * to an array of 1024 bytes even though it's actually 2048 bytes
104 * in size. This is because, we don't expect requests from user
105 * land requiring 2048 (273 sg elements) byte cmd pkts.
107 typedef struct twa_ioctl_no_data_buf {
108 struct twa_driver_packet twa_drvr_pkt;
109 void *pdata; /* points to data_buf */
111 struct twa_command_packet twa_cmd_pkt;
112 } __attribute__ ((packed)) TWA_IOCTL_NO_DATA_BUF;
116 #define TWA_IOCTL_SCAN_BUS _IOW ('T', 200, u_int32_t)
117 #define TWA_IOCTL_FIRMWARE_PASS_THROUGH _IOWR('T', 202, TWA_IOCTL_NO_DATA_BUF)
118 #define TWA_IOCTL_GET_FIRST_EVENT _IOWR('T', 203, TWA_IOCTL_NO_DATA_BUF)
119 #define TWA_IOCTL_GET_LAST_EVENT _IOWR('T', 204, TWA_IOCTL_NO_DATA_BUF)
120 #define TWA_IOCTL_GET_NEXT_EVENT _IOWR('T', 205, TWA_IOCTL_NO_DATA_BUF)
121 #define TWA_IOCTL_GET_PREVIOUS_EVENT _IOWR('T', 206, TWA_IOCTL_NO_DATA_BUF)
122 #define TWA_IOCTL_GET_LOCK _IOWR('T', 207, TWA_IOCTL_NO_DATA_BUF)
123 #define TWA_IOCTL_RELEASE_LOCK _IOWR('T', 208, TWA_IOCTL_NO_DATA_BUF)
124 #define TWA_IOCTL_GET_COMPATIBILITY_INFO _IOWR('T', 209, TWA_IOCTL_NO_DATA_BUF)