2 * Copyright (c) 2018 Microsemi Corporation.
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
32 /* IOCTL passthrough macros and structures */
34 #define SENSEINFOBYTES 32 /* note that this value may vary
35 between host implementations */
37 /* transfer direction */
38 #define PQIIOCTL_NONE 0x00
39 #define PQIIOCTL_WRITE 0x01
40 #define PQIIOCTL_READ 0x02
41 #define PQIIOCTL_BIDIRECTIONAL (PQIIOCTL_READ | PQIIOCTL_WRITE)
43 /* Type defs used in the following structs */
46 #define HWORD uint16_t
47 #define DWORD uint32_t
49 /* Command List Structure */
50 typedef union _SCSI3Addr_struct {
54 BYTE Mode:2; /* b00 */
59 BYTE Mode:2; /* b01 */
65 BYTE Mode:2; /* b10 */
68 }OS_ATTRIBUTE_PACKED SCSI3Addr_struct;
70 typedef struct _PhysDevAddr_struct {
74 SCSI3Addr_struct Target[2]; /* 2 level target device addr */
76 }OS_ATTRIBUTE_PACKED PhysDevAddr_struct;
78 typedef struct _LogDevAddr_struct {
83 }OS_ATTRIBUTE_PACKED LogDevAddr_struct;
85 typedef union _LUNAddr_struct {
87 SCSI3Addr_struct SCSI3Lun[4];
88 PhysDevAddr_struct PhysDev;
89 LogDevAddr_struct LogDev;
91 }OS_ATTRIBUTE_PACKED LUNAddr_struct;
93 typedef struct _RequestBlock_struct {
103 }OS_ATTRIBUTE_PACKED RequestBlock_struct;
105 typedef union _MoreErrInfo_struct{
113 BYTE offense_size; /* size of offending entry */
114 BYTE offense_num; /* byte # of offense 0-base */
118 }OS_ATTRIBUTE_PACKED MoreErrInfo_struct;
120 typedef struct _ErrorInfo_struct {
125 MoreErrInfo_struct MoreErrInfo;
126 BYTE SenseInfo[SENSEINFOBYTES];
128 }OS_ATTRIBUTE_PACKED ErrorInfo_struct;
130 typedef struct pqi_ioctl_passthruCmd_struct {
131 LUNAddr_struct LUN_info;
132 RequestBlock_struct Request;
133 ErrorInfo_struct error_info;
134 WORD buf_size; /* size in bytes of the buf */
135 passthru_buf_type_t buf;
137 }OS_ATTRIBUTE_PACKED IOCTL_Command_struct;
139 #endif /* _PQI_IOCTL_H_ */