kernel - disklabel64 - Increase partition start alignment to 1 megabyte.
[dragonfly.git] / sys / dev / raid / twa / twa_ioctl.h
blobe7fc618f2f028216ec095ad4b96caac3c91347db
1 /*-
2 * Copyright (c) 2003-04 3ware, Inc.
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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
24 * SUCH DAMAGE.
26 * $FreeBSD$
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
36 #include <sys/ioccom.h>
38 #define TWA_AEN_NOT_RETRIEVED 0x1
39 #define TWA_AEN_RETRIEVED 0x2
41 #define TWA_ERROR_AEN_NO_EVENTS 0x1003 /* No more events */
42 #define TWA_ERROR_AEN_OVERFLOW 0x1004 /* AEN clobber occurred */
44 #define TWA_ERROR_IOCTL_LOCK_NOT_HELD 0x1001 /* Not locked */
45 #define TWA_ERROR_IOCTL_LOCK_ALREADY_HELD 0x1002 /* Already locked */
48 #pragma pack(1)
49 struct twa_scan_bus_packet {
50 u_int32_t unit;
51 } __attribute__ ((packed));
54 struct twa_event_packet {
55 u_int32_t sequence_id;
56 u_int32_t time_stamp_sec;
57 u_int16_t aen_code;
58 u_int8_t severity;
59 u_int8_t retrieved;
60 u_int8_t repeat_count;
61 u_int8_t parameter_len;
62 u_int8_t parameter_data[98];
63 } __attribute__ ((packed));
66 struct twa_lock_packet {
67 u_int32_t timeout_msec;
68 u_int32_t time_remaining_msec;
69 u_int32_t force_flag;
70 } __attribute__ ((packed));
73 struct twa_compatibility_packet {
74 uint8_t driver_version[32];/* driver version */
75 uint16_t working_srl; /* driver & firmware negotiated srl */
76 uint16_t working_branch; /* branch # of the firmware that the driver is compatible with */
77 uint16_t working_build; /* build # of the firmware that the driver is compatible with */
78 } __attribute__ ((packed));
81 struct twa_driver_packet {
82 u_int32_t control_code;
83 u_int32_t status;
84 u_int32_t unique_id;
85 u_int32_t sequence_id;
86 u_int32_t os_status;
87 u_int32_t buffer_length;
88 } __attribute__ ((packed));
91 struct twa_ioctl_9k {
92 struct twa_driver_packet twa_drvr_pkt;
93 void *pdata; /* points to data_buf */
94 int8_t padding[484];
95 struct twa_command_packet twa_cmd_pkt;
96 int8_t data_buf[1];
97 } __attribute__ ((packed));
101 * We need the structure below to ensure that the first byte of
102 * data_buf is not overwritten by the kernel, after we return
103 * from the ioctl call. Note that twa_cmd_pkt has been reduced
104 * to an array of 1024 bytes even though it's actually 2048 bytes
105 * in size. This is because, we don't expect requests from user
106 * land requiring 2048 (273 sg elements) byte cmd pkts.
108 typedef struct twa_ioctl_no_data_buf {
109 struct twa_driver_packet twa_drvr_pkt;
110 void *pdata; /* points to data_buf */
111 int8_t padding[484];
112 struct twa_command_packet twa_cmd_pkt;
113 } __attribute__ ((packed)) TWA_IOCTL_NO_DATA_BUF;
114 #pragma pack()
117 #define TWA_IOCTL_SCAN_BUS _IOW ('T', 200, u_int32_t)
118 #define TWA_IOCTL_FIRMWARE_PASS_THROUGH _IOWR('T', 202, TWA_IOCTL_NO_DATA_BUF)
119 #define TWA_IOCTL_GET_FIRST_EVENT _IOWR('T', 203, TWA_IOCTL_NO_DATA_BUF)
120 #define TWA_IOCTL_GET_LAST_EVENT _IOWR('T', 204, TWA_IOCTL_NO_DATA_BUF)
121 #define TWA_IOCTL_GET_NEXT_EVENT _IOWR('T', 205, TWA_IOCTL_NO_DATA_BUF)
122 #define TWA_IOCTL_GET_PREVIOUS_EVENT _IOWR('T', 206, TWA_IOCTL_NO_DATA_BUF)
123 #define TWA_IOCTL_GET_LOCK _IOWR('T', 207, TWA_IOCTL_NO_DATA_BUF)
124 #define TWA_IOCTL_RELEASE_LOCK _IOWR('T', 208, TWA_IOCTL_NO_DATA_BUF)
125 #define TWA_IOCTL_GET_COMPATIBILITY_INFO _IOWR('T', 209, TWA_IOCTL_NO_DATA_BUF)