Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mpt2sas_ctl.h
Go to the documentation of this file.
1 /*
2  * Management Module Support for MPT (Message Passing Technology) based
3  * controllers
4  *
5  * This code is based on drivers/scsi/mpt2sas/mpt2_ctl.h
6  * Copyright (C) 2007-2012 LSI Corporation
7  * (mailto:[email protected])
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * NO WARRANTY
20  * THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
21  * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
22  * LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
23  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
24  * solely responsible for determining the appropriateness of using and
25  * distributing the Program and assumes all risks associated with its
26  * exercise of rights under this Agreement, including but not limited to
27  * the risks and costs of program errors, damage to or loss of data,
28  * programs or equipment, and unavailability or interruption of operations.
29 
30  * DISCLAIMER OF LIABILITY
31  * NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
32  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33  * DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
34  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
35  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
36  * USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
37  * HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
38 
39  * You should have received a copy of the GNU General Public License
40  * along with this program; if not, write to the Free Software
41  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
42  * USA.
43  */
44 
45 #ifndef MPT2SAS_CTL_H_INCLUDED
46 #define MPT2SAS_CTL_H_INCLUDED
47 
48 #ifdef __KERNEL__
49 #include <linux/miscdevice.h>
50 #endif
51 
52 #define MPT2SAS_DEV_NAME "mpt2ctl"
53 #define MPT2_MAGIC_NUMBER 'L'
54 #define MPT2_IOCTL_DEFAULT_TIMEOUT (10) /* in seconds */
55 
59 #define MPT2IOCINFO _IOWR(MPT2_MAGIC_NUMBER, 17, \
60  struct mpt2_ioctl_iocinfo)
61 #define MPT2COMMAND _IOWR(MPT2_MAGIC_NUMBER, 20, \
62  struct mpt2_ioctl_command)
63 #ifdef CONFIG_COMPAT
64 #define MPT2COMMAND32 _IOWR(MPT2_MAGIC_NUMBER, 20, \
65  struct mpt2_ioctl_command32)
66 #endif
67 #define MPT2EVENTQUERY _IOWR(MPT2_MAGIC_NUMBER, 21, \
68  struct mpt2_ioctl_eventquery)
69 #define MPT2EVENTENABLE _IOWR(MPT2_MAGIC_NUMBER, 22, \
70  struct mpt2_ioctl_eventenable)
71 #define MPT2EVENTREPORT _IOWR(MPT2_MAGIC_NUMBER, 23, \
72  struct mpt2_ioctl_eventreport)
73 #define MPT2HARDRESET _IOWR(MPT2_MAGIC_NUMBER, 24, \
74  struct mpt2_ioctl_diag_reset)
75 #define MPT2BTDHMAPPING _IOWR(MPT2_MAGIC_NUMBER, 31, \
76  struct mpt2_ioctl_btdh_mapping)
77 
78 /* diag buffer support */
79 #define MPT2DIAGREGISTER _IOWR(MPT2_MAGIC_NUMBER, 26, \
80  struct mpt2_diag_register)
81 #define MPT2DIAGRELEASE _IOWR(MPT2_MAGIC_NUMBER, 27, \
82  struct mpt2_diag_release)
83 #define MPT2DIAGUNREGISTER _IOWR(MPT2_MAGIC_NUMBER, 28, \
84  struct mpt2_diag_unregister)
85 #define MPT2DIAGQUERY _IOWR(MPT2_MAGIC_NUMBER, 29, \
86  struct mpt2_diag_query)
87 #define MPT2DIAGREADBUFFER _IOWR(MPT2_MAGIC_NUMBER, 30, \
88  struct mpt2_diag_read_buffer)
89 
100 };
101 
108 };
109 
110 
119  union {
120  struct {
122  uint32_t function:3;
124  } bits;
126  } u;
128 };
129 
130 
131 #define MPT2_IOCTL_INTERFACE_SCSI (0x00)
132 #define MPT2_IOCTL_INTERFACE_FC (0x01)
133 #define MPT2_IOCTL_INTERFACE_FC_IP (0x02)
134 #define MPT2_IOCTL_INTERFACE_SAS (0x03)
135 #define MPT2_IOCTL_INTERFACE_SAS2 (0x04)
136 #define MPT2_IOCTL_INTERFACE_SAS2_SSS6200 (0x05)
137 #define MPT2_IOCTL_VERSION_LENGTH (32)
138 
173 };
174 
175 
176 /* number of event log entries */
177 #define MPT2SAS_CTL_EVENT_LOG_SIZE (50)
178 
191 };
192 
201 };
202 
203 #define MPT2_EVENT_DATA_SIZE (192)
204 
214 };
215 
224 };
225 
256 };
257 
258 #ifdef CONFIG_COMPAT
259 struct mpt2_ioctl_command32 {
260  struct mpt2_ioctl_header hdr;
262  uint32_t reply_frame_buf_ptr;
263  uint32_t data_in_buf_ptr;
264  uint32_t data_out_buf_ptr;
265  uint32_t sense_data_ptr;
266  uint32_t max_reply_bytes;
267  uint32_t data_in_size;
268  uint32_t data_out_size;
269  uint32_t max_sense_bytes;
270  uint32_t data_sge_offset;
271  uint8_t mf[1];
272 };
273 #endif
274 
295 };
296 
297 
298 /* status bits for ioc->diag_buffer_status */
299 #define MPT2_DIAG_BUFFER_IS_REGISTERED (0x01)
300 #define MPT2_DIAG_BUFFER_IS_RELEASED (0x02)
301 #define MPT2_DIAG_BUFFER_IS_DIAG_RESET (0x04)
302 
303 /* application flags for mpt2_diag_register, mpt2_diag_query */
304 #define MPT2_APP_FLAGS_APP_OWNED (0x0001)
305 #define MPT2_APP_FLAGS_BUFFER_VALID (0x0002)
306 #define MPT2_APP_FLAGS_FW_BUFFER_ACCESS (0x0004)
307 
308 /* flags for mpt2_diag_read_buffer */
309 #define MPT2_FLAGS_REREGISTER (0x0001)
310 
311 #define MPT2_PRODUCT_SPECIFIC_DWORDS 23
312 
337 };
338 
350 };
351 
378 };
379 
392 };
393 
416 };
417 
418 #endif /* MPT2SAS_CTL_H_INCLUDED */