mfiio.h revision 1.1.6.2 1 1.1.6.2 tls /*-
2 1.1.6.2 tls * Copyright (c) 2006 IronPort Systems
3 1.1.6.2 tls * All rights reserved.
4 1.1.6.2 tls *
5 1.1.6.2 tls * Redistribution and use in source and binary forms, with or without
6 1.1.6.2 tls * modification, are permitted provided that the following conditions
7 1.1.6.2 tls * are met:
8 1.1.6.2 tls * 1. Redistributions of source code must retain the above copyright
9 1.1.6.2 tls * notice, this list of conditions and the following disclaimer.
10 1.1.6.2 tls * 2. Redistributions in binary form must reproduce the above copyright
11 1.1.6.2 tls * notice, this list of conditions and the following disclaimer in the
12 1.1.6.2 tls * documentation and/or other materials provided with the distribution.
13 1.1.6.2 tls *
14 1.1.6.2 tls * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 1.1.6.2 tls * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 1.1.6.2 tls * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 1.1.6.2 tls * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 1.1.6.2 tls * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 1.1.6.2 tls * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 1.1.6.2 tls * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 1.1.6.2 tls * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 1.1.6.2 tls * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 1.1.6.2 tls * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 1.1.6.2 tls * SUCH DAMAGE.
25 1.1.6.2 tls */
26 1.1.6.2 tls #include <dev/ic/mfireg.h>
27 1.1.6.2 tls #include <sys/ioctl.h>
28 1.1.6.2 tls
29 1.1.6.2 tls /*
30 1.1.6.2 tls * these structures are used for LSI's MegaCli on both FreeBSD and Linux
31 1.1.6.2 tls * We will also use them in the NetBSD driver.
32 1.1.6.2 tls */
33 1.1.6.2 tls
34 1.1.6.2 tls #define MAX_SPACE_FOR_SENSE_PTR 32
35 1.1.6.2 tls union mfi_sense_ptr {
36 1.1.6.2 tls uint8_t sense_ptr_data[MAX_SPACE_FOR_SENSE_PTR];
37 1.1.6.2 tls void *user_space;
38 1.1.6.2 tls struct {
39 1.1.6.2 tls uint32_t low;
40 1.1.6.2 tls uint32_t high;
41 1.1.6.2 tls } addr;
42 1.1.6.2 tls } __packed;
43 1.1.6.2 tls
44 1.1.6.2 tls
45 1.1.6.2 tls #define MAX_IOCTL_SGE 16
46 1.1.6.2 tls
47 1.1.6.2 tls struct mfi_ioc_packet {
48 1.1.6.2 tls uint16_t mfi_adapter_no;
49 1.1.6.2 tls uint16_t mfi_pad1;
50 1.1.6.2 tls uint32_t mfi_sgl_off;
51 1.1.6.2 tls uint32_t mfi_sge_count;
52 1.1.6.2 tls uint32_t mfi_sense_off;
53 1.1.6.2 tls uint32_t mfi_sense_len;
54 1.1.6.2 tls union {
55 1.1.6.2 tls uint8_t raw[128];
56 1.1.6.2 tls struct mfi_frame_header hdr;
57 1.1.6.2 tls } mfi_frame;
58 1.1.6.2 tls
59 1.1.6.2 tls struct iovec mfi_sgl[MAX_IOCTL_SGE];
60 1.1.6.2 tls } __packed;
61 1.1.6.2 tls
62 1.1.6.2 tls struct mfi_ioc_aen {
63 1.1.6.2 tls uint16_t aen_adapter_no;
64 1.1.6.2 tls uint16_t aen_pad1;
65 1.1.6.2 tls uint32_t aen_seq_num;
66 1.1.6.2 tls uint32_t aen_class_locale;
67 1.1.6.2 tls } __packed;
68 1.1.6.2 tls
69 1.1.6.2 tls #define MFI_CMD _IOWR('M', 1, struct mfi_ioc_packet)
70 1.1.6.2 tls #define MFI_SET_AEN _IOW('M', 3, struct mfi_ioc_aen)
71 1.1.6.2 tls
72 1.1.6.2 tls #ifdef _LP64
73 1.1.6.2 tls struct iovec32 {
74 1.1.6.2 tls u_int32_t iov_base;
75 1.1.6.2 tls int iov_len;
76 1.1.6.2 tls };
77 1.1.6.2 tls
78 1.1.6.2 tls struct mfi_ioc_packet32 {
79 1.1.6.2 tls uint16_t mfi_adapter_no;
80 1.1.6.2 tls uint16_t mfi_pad1;
81 1.1.6.2 tls uint32_t mfi_sgl_off;
82 1.1.6.2 tls uint32_t mfi_sge_count;
83 1.1.6.2 tls uint32_t mfi_sense_off;
84 1.1.6.2 tls uint32_t mfi_sense_len;
85 1.1.6.2 tls union {
86 1.1.6.2 tls uint8_t raw[128];
87 1.1.6.2 tls struct mfi_frame_header hdr;
88 1.1.6.2 tls } mfi_frame;
89 1.1.6.2 tls
90 1.1.6.2 tls struct iovec32 mfi_sgl[MAX_IOCTL_SGE];
91 1.1.6.2 tls } __packed;
92 1.1.6.2 tls #define MFI_CMD32 _IOWR('M', 1, struct mfi_ioc_packet32)
93 1.1.6.2 tls #endif
94