tw_cl_ioctl.h revision 144966
1326949Sdim/*
2326949Sdim * Copyright (c) 2004-05 Applied Micro Circuits Corporation.
3353358Sdim * Copyright (c) 2004-05 Vinod Kashyap
4353358Sdim * All rights reserved.
5353358Sdim *
6326949Sdim * Redistribution and use in source and binary forms, with or without
7326949Sdim * modification, are permitted provided that the following conditions
8326949Sdim * are met:
9326949Sdim * 1. Redistributions of source code must retain the above copyright
10326949Sdim *    notice, this list of conditions and the following disclaimer.
11326949Sdim * 2. Redistributions in binary form must reproduce the above copyright
12326949Sdim *    notice, this list of conditions and the following disclaimer in the
13344779Sdim *    documentation and/or other materials provided with the distribution.
14326949Sdim *
15326949Sdim * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16326949Sdim * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17326949Sdim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18353358Sdim * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19353358Sdim * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20326949Sdim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21326949Sdim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22326949Sdim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23326949Sdim * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24326949Sdim * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25326949Sdim * SUCH DAMAGE.
26353358Sdim *
27353358Sdim *	$FreeBSD: head/sys/dev/twa/tw_cl_ioctl.h 144966 2005-04-12 22:07:11Z vkashyap $
28326949Sdim */
29326949Sdim
30326949Sdim/*
31326949Sdim * AMCC'S 3ware driver for 9000 series storage controllers.
32326949Sdim *
33353358Sdim * Author: Vinod Kashyap
34353358Sdim */
35326949Sdim
36326949Sdim
37326949Sdim
38326949Sdim#ifndef TW_CL_IOCTL_H
39353358Sdim
40353358Sdim#define TW_CL_IOCTL_H
41326949Sdim
42326949Sdim
43326949Sdim/*
44326949Sdim * Macros and structures for Common Layer handled ioctls.
45353358Sdim */
46353358Sdim
47326949Sdim
48326949Sdim#define TW_CL_AEN_NOT_RETRIEVED	0x1
49326949Sdim#define TW_CL_AEN_RETRIEVED	0x2
50326949Sdim
51326949Sdim#define TW_CL_ERROR_AEN_NO_EVENTS	0x1003	/* No more events */
52326949Sdim#define TW_CL_ERROR_AEN_OVERFLOW	0x1004	/* AEN overflow occurred */
53326949Sdim
54326949Sdim#define TW_CL_ERROR_IOCTL_LOCK_NOT_HELD		0x1001   /* Not locked */
55326949Sdim#define TW_CL_ERROR_IOCTL_LOCK_ALREADY_HELD	0x1002   /* Already locked */
56326949Sdim
57326949Sdim
58326949Sdim#pragma pack(1)
59326949Sdim
60326949Sdim/* Structure used to handle GET/RELEASE LOCK ioctls. */
61326949Sdimstruct tw_cl_lock_packet {
62326949Sdim	TW_UINT32	timeout_msec;
63326949Sdim	TW_UINT32	time_remaining_msec;
64326949Sdim	TW_UINT32	force_flag;
65326949Sdim};
66326949Sdim
67326949Sdim
68326949Sdim/* Structure used to handle GET COMPATIBILITY INFO ioctl. */
69326949Sdimstruct tw_cl_compatibility_packet {
70326949Sdim	TW_UINT8	driver_version[32];/* driver version */
71326949Sdim	TW_UINT16	working_srl;	/* driver & firmware negotiated srl */
72326949Sdim	TW_UINT16	working_branch;	/* branch # of the firmware that the
73326949Sdim					driver is compatible with */
74326949Sdim	TW_UINT16	working_build;	/* build # of the firmware that the
75326949Sdim					driver is compatible with */
76326949Sdim};
77326949Sdim
78326949Sdim
79326949Sdim/* Driver understandable part of the ioctl packet built by the API. */
80326949Sdimstruct tw_cl_driver_packet {
81326949Sdim	TW_UINT32	control_code;
82326949Sdim	TW_UINT32	status;
83326949Sdim	TW_UINT32	unique_id;
84326949Sdim	TW_UINT32	sequence_id;
85326949Sdim	TW_UINT32	os_status;
86326949Sdim	TW_UINT32	buffer_length;
87326949Sdim};
88326949Sdim
89326949Sdim
90326949Sdim/* ioctl packet built by the API. */
91326949Sdimstruct tw_cl_ioctl_packet {
92326949Sdim	struct tw_cl_driver_packet	driver_pkt;
93326949Sdim	TW_INT8				padding[488];
94326949Sdim	struct tw_cl_command_packet	cmd_pkt;
95326949Sdim	TW_INT8				data_buf[1];
96326949Sdim};
97326949Sdim
98326949Sdim#pragma pack()
99326949Sdim
100326949Sdim
101326949Sdim
102326949Sdim#endif /* TW_CL_IOCTL_H */
103326949Sdim