1 /* $FreeBSD: src/sys/dev/isp/isp_ioctl.h,v 1.1.2.5 2003/11/14 05:13:43 mjacob Exp $ */
2 /* $DragonFly: src/sys/dev/disk/isp/isp_ioctl.h,v 1.3 2004/02/10 15:51:56 hmp Exp $ */
4 * Copyright (c) 2001 by Matthew Jacob
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * Alternatively, this software may be distributed under the terms of the
17 * the GNU Public License ("GPL", Library, Version 2).
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 * Matthew Jacob <mjacob@feral.com)
35 #include <sys/ioccom.h>
38 * ioctl definitions for Qlogic FC/SCSI HBA driver
40 #define ISP_IOC (021) /* 'Ctrl-Q' */
43 * This ioctl sets/retrieves the debugging level for this hba instance.
44 * Note that this is not a simple integer level- see ispvar.h for definitions.
46 * The arguments is a pointer to an integer with the new debugging level.
47 * The old value is written into this argument.
50 #define ISP_SDBLEV _IOWR(ISP_IOC, 1, int)
53 * This ioctl resets the HBA. Use with caution.
55 #define ISP_RESETHBA _IO(ISP_IOC, 2)
58 * This ioctl performs a fibre chanel rescan.
60 #define ISP_RESCAN _IO(ISP_IOC, 3)
63 * This ioctl performs a reset and then will set the adapter to the
64 * role that was passed in (the old role will be returned). It almost
65 * goes w/o saying: use with caution.
67 #define ISP_SETROLE _IOWR(ISP_IOC, 4, int)
69 #define ISP_ROLE_NONE 0x0
70 #define ISP_ROLE_INITIATOR 0x1
71 #define ISP_ROLE_TARGET 0x2
72 #define ISP_ROLE_BOTH (ISP_ROLE_TARGET|ISP_ROLE_INITIATOR)
73 #ifndef ISP_DEFAULT_ROLES
74 #define ISP_DEFAULT_ROLES ISP_ROLE_BOTH
78 * Get the current adapter role
80 #define ISP_GETROLE _IOR(ISP_IOC, 5, int)
85 #define ISP_STATS_VERSION 0
87 u_int8_t isp_stat_version;
88 u_int8_t isp_type; /* (ro) reflects chip type */
89 u_int8_t isp_revision; /* (ro) reflects chip version */
97 #define ISP_INTBOGUS 1
98 #define ISP_INTMBOXC 2
99 #define ISP_INGOASYNC 3
100 #define ISP_RSLTCCMPLT 4
101 #define ISP_FPHCCMCPLT 5
102 #define ISP_RSCCHIWAT 6
103 #define ISP_FPCCHIWAT 7
104 u_int64_t isp_stats[ISP_NSTATS];
107 #define ISP_GET_STATS _IOR(ISP_IOC, 6, isp_stats_t)
108 #define ISP_CLR_STATS _IO(ISP_IOC, 7)
113 #define ISP_FC_LIP _IO(ISP_IOC, 8)
116 * Return the Port Database structure for the named device, or ENODEV if none.
117 * Caller fills in virtual loopid (0..255), aka 'target'. The driver returns
118 * ENODEV (if nothing valid there) or the actual loopid (for local loop devices
119 * only), 24 bit Port ID and Node and Port WWNs.
121 struct isp_fc_device {
122 u_int32_t loopid; /* 0..255 */
123 u_int32_t portid; /* 24 bit Port ID */
127 #define ISP_FC_GETDINFO _IOWR(ISP_IOC, 9, struct isp_fc_device)
132 #define ISP_GET_FW_CRASH_DUMP _IO(ISP_IOC, 10)
133 #define ISP_FORCE_CRASH_DUMP _IO(ISP_IOC, 11)
136 * Get information about this Host Adapter, including current connection
137 * topology and capabilities.
139 struct isp_hba_device {
143 fc_speed : 4, /* Gbps */
147 fc_scsi_supported : 1,
150 u_int64_t nvram_node_wwn;
151 u_int64_t nvram_port_wwn;
152 u_int64_t active_node_wwn;
153 u_int64_t active_port_wwn;
156 #define ISP_TOPO_UNKNOWN 0 /* connection topology unknown */
157 #define ISP_TOPO_FCAL 1 /* private or PL_DA */
158 #define ISP_TOPO_LPORT 2 /* public loop */
159 #define ISP_TOPO_NPORT 3 /* N-port */
160 #define ISP_TOPO_FPORT 4 /* F-port */
162 #define ISP_FC_GETHINFO _IOR(ISP_IOC, 12, struct isp_hba_device)
164 * Set some internal parameters. This doesn't take effect until
167 * Each parameter is generalized to be a name string with an integer value.
169 * Known parameters are:
173 * "framelength" 512,1024,2048
174 * "exec_throttle" 16..255
179 struct isp_fc_param {
180 char param_name[16]; /* null terminated */
184 #define ISP_GET_FC_PARAM _IOWR(ISP_IOC, 98, struct isp_fc_param)
185 #define ISP_SET_FC_PARAM _IOWR(ISP_IOC, 99, struct isp_fc_param)