2 * Copyright (c) 2014, LSI Corp.
5 * Support: freebsdraid@lsi.com
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * 3. Neither the name of the <ORGANIZATION> nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
34 * The views and conclusions contained in the software and documentation
35 * are those of the authors and should not be interpreted as representing
36 * official policies,either expressed or implied, of the FreeBSD Project.
38 * Send feedback to: <megaraidfbsd@lsi.com>
39 * Mail to: LSI Corporation, 1621 Barber Lane, Milpitas, CA 95035
40 * ATTN: MegaRaid FreeBSD
42 * $FreeBSD: head/sys/dev/mrsas/mrsas_ioctl.h 265555 2014-05-07 16:16:49Z ambrisko $
49 #include <sys/ioccom.h>
53 * We need to use the same values as the mfi driver until MegaCli adds
54 * support for this (mrsas) driver:
55 * M is for MegaRAID. (This is typically the vendor or product initial)
56 * 1 arbitrary. (This may be used to segment kinds of commands.
57 * (1-9 status, 10-20 policy, etc.)
58 * struct mrsas_iocpacket (sizeof() this parameter will be used.)
59 * These three values are encoded into a somewhat unique, 32-bit value.
62 #define MRSAS_IOC_FIRMWARE_PASS_THROUGH _IOWR('M', 1, struct mrsas_iocpacket)
64 #define MRSAS_IOC_SCAN_BUS _IO('M', 10)
66 #define MAX_IOCTL_SGE 16
67 #define MFI_FRAME_DIR_READ 0x0010
68 #define MFI_CMD_LD_SCSI_IO 0x03
70 #define INQUIRY_CMD 0x12
71 #define INQUIRY_CMDLEN 6
72 #define INQUIRY_REPLY_LEN 96
73 #define INQUIRY_VENDOR 8 /* Offset in reply data to vendor name */
74 #define SCSI_SENSE_BUFFERSIZE 96
76 #define MEGAMFI_RAW_FRAME_SIZE 128
80 struct mrsas_iocpacket {
88 u_int8_t raw[MEGAMFI_RAW_FRAME_SIZE];
89 struct mrsas_header hdr;
91 struct iovec sgl[MAX_IOCTL_SGE];
95 #endif /* MRSAS_IOCTL_H */