xref: /netbsd/sys/dev/i2o/i2odpt.h (revision bf9ec67e)
1 /*	$NetBSD: i2odpt.h,v 1.1 2001/09/21 23:44:21 ad Exp $	*/
2 
3 /*-
4  * Copyright (c) 2001 The NetBSD Foundation, Inc.
5  * All rights reserved.
6  *
7  * This code is derived from software contributed to The NetBSD Foundation
8  * by Andrew Doran.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  * 3. All advertising materials mentioning features or use of this software
19  *    must display the following acknowledgement:
20  *        This product includes software developed by the NetBSD
21  *        Foundation, Inc. and its contributors.
22  * 4. Neither the name of The NetBSD Foundation nor the names of its
23  *    contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36  * POSSIBILITY OF SUCH DAMAGE.
37  */
38 
39 /*
40  * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
41  * Copyright (c) 2000 Adaptec Corporation.
42  * All rights reserved.
43  *
44  * Redistribution and use in source form, with or without modification, are
45  * permitted provided that redistributions of source code must retain the
46  * above copyright notice, this list of conditions and the following disclaimer.
47  *
48  * This software is provided `as is' by Distributed Processing Technology and
49  * any express or implied warranties, including, but not limited to, the
50  * implied warranties of merchantability and fitness for a particular purpose,
51  * are disclaimed. In no event shall Distributed Processing Technology be
52  * liable for any direct, indirect, incidental, special, exemplary or
53  * consequential damages (including, but not limited to, procurement of
54  * substitute goods or services; loss of use, data, or profits; or business
55  * interruptions) however caused and on any theory of liability, whether in
56  * contract, strict liability, or tort (including negligence or otherwise)
57  * arising in any way out of the use of this driver software, even if advised
58  * of the possibility of such damage.
59  *
60  */
61 
62 #ifndef _I2O_I2ODPT_H_
63 #define	_I2O_I2ODPT_H_
64 
65 /*
66  * ================= Messages =================
67  */
68 
69 #define	I2O_DPT_SCSI_SCB_EXEC		I2O_SCSI_SCB_EXEC
70 struct i2o_dpt_scsi_scb_exec {
71 	u_int32_t	msgflags;
72 	u_int32_t	msgictx;
73 	u_int32_t	msgtctx;
74 	u_int32_t	privfunc;
75 	u_int32_t	tid;		/* bit 16: interpret; bit 17: phys */
76 	u_int32_t	flags;
77 	u_int32_t	scbflags;
78 	u_int8_t	cdb[16];
79 	u_int32_t	bytecount;
80 } __attribute__ ((__packed__));
81 
82 #define	I2O_DPT_FLASH_REGION_SIZE	0x0100
83 #define	I2O_DPT_FLASH_REGION_READ	0x0101
84 #define	I2O_DPT_FLASH_REGION_WRITE	0x0102
85 #define	I2O_DPT_FLASH_REGION_CRC	0x0103
86 struct i2o_dpt_flash_region {
87 	u_int32_t	msgflags;
88 	u_int32_t	msgfunc;
89 	u_int32_t	msgictx;
90 	u_int32_t	msgtctx;
91 	u_int32_t	privfunc;
92 	u_int32_t	region;
93 	u_int32_t	regionoffset;
94 	u_int32_t	bytecount;
95 } __attribute__ ((__packed__));
96 
97 #define	DPT_FLASH_REGION_OP_FIRMWARE	0x00
98 #define	DPT_FLASH_REGION_SOFTWARE	0x01
99 #define	DPT_FLASH_REGION_OEM_NVRAM	0x02
100 #define	DPT_FLASH_REGION_SERIAL		0x03
101 #define	DPT_FLASH_REGION_BOOT_FIRMWARE	0x04
102 
103 #define	I2O_DPT_DRIVER_PRINTF		0x0200
104 struct i2o_dpt_driver_printf {
105 	u_int32_t	msgflags;
106 	u_int32_t	msgfunc;
107 	u_int32_t	msgictx;
108 	u_int32_t	msgtctx;
109 	u_int32_t	privfunc;
110 	u_int32_t	printbuffersize;
111 	u_int8_t	printbuffer[1];
112 } __attribute__ ((__packed__));
113 
114 #define	I2O_DPT_DIAG_ENABLE		0x0201
115 struct i2o_dpt_diag_enable {
116 	u_int32_t	msgflags;
117 	u_int32_t	msgfunc;
118 	u_int32_t	msgictx;
119 	u_int32_t	msgtctx;
120 	u_int32_t	privfunc;
121 } __attribute__ ((__packed__));
122 
123 #define	I2O_DPT_DRIVER_GET		0x0300
124 struct i2o_dpt_driver_get {
125 	u_int32_t	msgflags;
126 	u_int32_t	msgfunc;
127 	u_int32_t	msgictx;
128 	u_int32_t	msgtctx;
129 	u_int32_t	privfunc;
130 	u_int32_t	offset;
131 	u_int32_t	bytecount;
132 
133 	/* SGL follows. */
134 } __attribute__ ((__packed__));
135 
136 #define	I2O_DPT_DRIVER_SET		0x0301
137 struct i2o_dpt_driver_set {
138 	u_int32_t	msgflags;
139 	u_int32_t	msgfunc;
140 	u_int32_t	msgictx;
141 	u_int32_t	msgtctx;
142 	u_int32_t	privfunc;
143 	u_int32_t	offset;
144 	u_int32_t	bytecount;
145 
146 	/* SGL follows. */
147 } __attribute__ ((__packed__));
148 
149 /*
150  * ================= Parameter groups =================
151  */
152 
153 #define	I2O_DPT_PARAM_DEVICE_INFO	0x8000
154 struct i2o_dpt_param_device_info {
155 	u_int8_t	devicetype;	/* as I2O_PARAM_SCSI_DEVICE_INFO */
156 	u_int8_t	flags;		/* as I2O_PARAM_SCSI_DEVICE_INFO */
157 	u_int16_t	bus;
158 	u_int32_t	identifier;
159 	u_int8_t	luninfo[8];
160 } __attribute__ ((__packed__));
161 
162 #define	I2O_DPT_PARAM_EXEC_IOP_BUFFERS	0x8000
163 struct i2o_dpt_param_exec_iop_buffers {
164 	u_int32_t	serialoutputoff;
165 	u_int32_t	serialoutputsize;
166 	u_int32_t	serialheadersize;
167 	u_int32_t	serialflagssupported;
168 } __attribute__ ((__packed__));
169 
170 #endif	/* _I2O_I2ODPT_H_ */
171