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