xref: /freebsd/sys/dev/isp/isp_ioctl.h (revision 5521ff5a4d1929056e7ffc982fac3341ca54df7c)
1 /* $FreeBSD$ */
2 /*
3  * Copyright (c) 2001 by Matthew Jacob
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * Alternatively, this software may be distributed under the terms of the
16  * the GNU Public License ("GPL", Library, Version 2).
17  *
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
20  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  * Matthew Jacob <mjacob@feral.com)
31  *
32  */
33 /*
34  * ioctl definitions for Qlogic FC/SCSI HBA driver
35  */
36 #define	ISP_IOC		(021)	/* 'Ctrl-Q' */
37 
38 /*
39  * This ioctl sets/retrieves the debugging level for this hba instance.
40  * Note that this is not a simple integer level- see ispvar.h for definitions.
41  *
42  * The arguments is a pointer to an integer with the new debugging level.
43  * The old value is written into this argument.
44  */
45 
46 #define	ISP_SDBLEV	_IOWR(ISP_IOC, 0, int)
47 
48 /*
49  * This ioctl resets the HBA. Use with caution.
50  */
51 #define	ISP_RESETHBA	_IO(ISP_IOC, 1)
52 
53 /*
54  * This ioctl performs a fibre chanel rescan.
55  */
56 #define	ISP_FC_RESCAN	_IO(ISP_IOC, 2)
57 
58 /*
59  * Initiate a LIP
60  */
61 #define	ISP_FC_LIP	_IO(ISP_IOC, 3)
62 
63 /*
64  * Return the Port Database structure for the named device, or ENODEV if none.
65  * Caller fills in virtual loopid (0..255), aka 'target'. The driver returns
66  * ENODEV (if nothing valid there) or the actual loopid (for local loop devices
67  * only), 24 bit Port ID and Node and Port WWNs.
68  */
69 struct isp_fc_device {
70 	u_int32_t	loopid;	/* 0..255 */
71 	u_int32_t	portid;	/* 24 bit Port ID */
72 	u_int64_t	node_wwn;
73 	u_int64_t	port_wwn;
74 };
75 
76 #define	ISP_FC_GETDINFO	_IOWR(ISP_IOC, 4, struct isp_fc_device)
77