127da7e6fSSøren Schmidt /*- 2*718cf2ccSPedro F. Giffuni * SPDX-License-Identifier: BSD-3-Clause 3*718cf2ccSPedro F. Giffuni * 49a14aa01SUlrich Spörlein * Copyright (c) 2001,2002,2003 Søren Schmidt <sos@FreeBSD.org> 527da7e6fSSøren Schmidt * All rights reserved. 627da7e6fSSøren Schmidt * 727da7e6fSSøren Schmidt * Redistribution and use in source and binary forms, with or without 827da7e6fSSøren Schmidt * modification, are permitted provided that the following conditions 927da7e6fSSøren Schmidt * are met: 1027da7e6fSSøren Schmidt * 1. Redistributions of source code must retain the above copyright 1127da7e6fSSøren Schmidt * notice, this list of conditions and the following disclaimer, 1227da7e6fSSøren Schmidt * without modification, immediately at the beginning of the file. 1327da7e6fSSøren Schmidt * 2. Redistributions in binary form must reproduce the above copyright 1427da7e6fSSøren Schmidt * notice, this list of conditions and the following disclaimer in the 1527da7e6fSSøren Schmidt * documentation and/or other materials provided with the distribution. 1627da7e6fSSøren Schmidt * 3. The name of the author may not be used to endorse or promote products 1727da7e6fSSøren Schmidt * derived from this software without specific prior written permission. 1827da7e6fSSøren Schmidt * 1927da7e6fSSøren Schmidt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2027da7e6fSSøren Schmidt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2127da7e6fSSøren Schmidt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2227da7e6fSSøren Schmidt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2327da7e6fSSøren Schmidt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2427da7e6fSSøren Schmidt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2527da7e6fSSøren Schmidt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2627da7e6fSSøren Schmidt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2727da7e6fSSøren Schmidt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2827da7e6fSSøren Schmidt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2927da7e6fSSøren Schmidt */ 3027da7e6fSSøren Schmidt 3127da7e6fSSøren Schmidt /* misc defines */ 3227da7e6fSSøren Schmidt MALLOC_DECLARE(M_PSTIOP); 3327da7e6fSSøren Schmidt #define I2O_IOP_OUTBOUND_FRAME_COUNT 32 3427da7e6fSSøren Schmidt #define I2O_IOP_OUTBOUND_FRAME_SIZE 0x20 3527da7e6fSSøren Schmidt 3627da7e6fSSøren Schmidt /* structure defs */ 3727da7e6fSSøren Schmidt struct out_mfa_buf { 3827da7e6fSSøren Schmidt u_int32_t buf[I2O_IOP_OUTBOUND_FRAME_SIZE]; 3927da7e6fSSøren Schmidt }; 4027da7e6fSSøren Schmidt 4127da7e6fSSøren Schmidt struct iop_softc { 4227da7e6fSSøren Schmidt struct resource *r_mem; 4327da7e6fSSøren Schmidt struct resource *r_irq; 4427da7e6fSSøren Schmidt caddr_t ibase; 4527da7e6fSSøren Schmidt caddr_t obase; 4627da7e6fSSøren Schmidt u_int32_t phys_obase; 4727da7e6fSSøren Schmidt struct i2o_registers *reg; 4827da7e6fSSøren Schmidt struct i2o_status_get_reply *status; 4927da7e6fSSøren Schmidt int lct_count; 5027da7e6fSSøren Schmidt struct i2o_lct_entry *lct; 51ac9953bfSSøren Schmidt int ism; 5227da7e6fSSøren Schmidt device_t dev; 53ac9953bfSSøren Schmidt struct mtx mtx; 54ac9953bfSSøren Schmidt int outstanding; 5527da7e6fSSøren Schmidt void *handle; 5627da7e6fSSøren Schmidt struct intr_config_hook *iop_delayed_attach; 5727da7e6fSSøren Schmidt }; 5827da7e6fSSøren Schmidt 5927da7e6fSSøren Schmidt /* structure at start of IOP shared mem */ 6027da7e6fSSøren Schmidt struct i2o_registers { 6127da7e6fSSøren Schmidt volatile u_int32_t apic_select; 6227da7e6fSSøren Schmidt volatile u_int32_t reserved0; 6327da7e6fSSøren Schmidt volatile u_int32_t apic_winreg; 6427da7e6fSSøren Schmidt volatile u_int32_t reserved1; 6527da7e6fSSøren Schmidt volatile u_int32_t iqueue_reg0; 6627da7e6fSSøren Schmidt volatile u_int32_t iqueue_reg1; 6727da7e6fSSøren Schmidt volatile u_int32_t oqueue_reg0; 6827da7e6fSSøren Schmidt volatile u_int32_t oqueue_reg1; 6927da7e6fSSøren Schmidt volatile u_int32_t iqueue_event; 7027da7e6fSSøren Schmidt volatile u_int32_t iqueue_intr_status; 7127da7e6fSSøren Schmidt volatile u_int32_t iqueue_intr_mask; 7227da7e6fSSøren Schmidt volatile u_int32_t oqueue_event; 7327da7e6fSSøren Schmidt volatile u_int32_t oqueue_intr_status; 7427da7e6fSSøren Schmidt volatile u_int32_t oqueue_intr_mask; 7527da7e6fSSøren Schmidt #define I2O_OUT_INTR_QUEUE 0x08 7627da7e6fSSøren Schmidt #define I2O_OUT_INTR_BELL 0x04 7727da7e6fSSøren Schmidt #define I2O_OUT_INTR_MSG1 0x02 7827da7e6fSSøren Schmidt #define I2O_OUT_INTR_MSG0 0x01 7927da7e6fSSøren Schmidt 8027da7e6fSSøren Schmidt volatile u_int64_t reserved2; 8127da7e6fSSøren Schmidt volatile u_int32_t iqueue; 8227da7e6fSSøren Schmidt volatile u_int32_t oqueue; 8327da7e6fSSøren Schmidt volatile u_int64_t reserved3; 8427da7e6fSSøren Schmidt volatile u_int64_t mac_addr; 8527da7e6fSSøren Schmidt volatile u_int32_t ip_addr; 8627da7e6fSSøren Schmidt volatile u_int32_t ip_mask; 8727da7e6fSSøren Schmidt }; 8827da7e6fSSøren Schmidt 8927da7e6fSSøren Schmidt /* Scatter/Gather List management */ 9027da7e6fSSøren Schmidt struct i2o_sgl { 9127da7e6fSSøren Schmidt u_int32_t count:24; 9227da7e6fSSøren Schmidt #define I2O_SGL_CNT_MASK 0xffffff 9327da7e6fSSøren Schmidt 9427da7e6fSSøren Schmidt u_int32_t flags:8; 9527da7e6fSSøren Schmidt #define I2O_SGL_SIMPLE 0x10 9627da7e6fSSøren Schmidt #define I2O_SGL_PAGELIST 0x20 9727da7e6fSSøren Schmidt #define I2O_SGL_CHAIN 0x30 9827da7e6fSSøren Schmidt #define I2O_SGL_ATTRIBUTE 0x7c 9927da7e6fSSøren Schmidt #define I2O_SGL_BC0 0x01 10027da7e6fSSøren Schmidt #define I2O_SGL_BC1 0x02 10127da7e6fSSøren Schmidt #define I2O_SGL_DIR 0x04 10227da7e6fSSøren Schmidt #define I2O_SGL_LA 0x08 10327da7e6fSSøren Schmidt #define I2O_SGL_EOB 0x40 10427da7e6fSSøren Schmidt #define I2O_SGL_END 0x80 10527da7e6fSSøren Schmidt 10627da7e6fSSøren Schmidt u_int32_t phys_addr[1]; 1074f492bfaSAlfred Perlstein } __packed; 10827da7e6fSSøren Schmidt 10927da7e6fSSøren Schmidt #define I2O_SGL_MAX_SEGS ((I2O_IOP_OUTBOUND_FRAME_SIZE - (8 + 2)) + 1) 11027da7e6fSSøren Schmidt 11127da7e6fSSøren Schmidt /* i2o command codes */ 11227da7e6fSSøren Schmidt #define I2O_UTIL_NOP 0x00 11327da7e6fSSøren Schmidt #define I2O_UTIL_PARAMS_GET 0x06 11427da7e6fSSøren Schmidt #define I2O_UTIL_CLAIM 0x09 11527da7e6fSSøren Schmidt #define I2O_UTIL_CONFIG_DIALOG 0x10 11627da7e6fSSøren Schmidt #define I2O_UTIL_EVENT_REGISTER 0x13 11727da7e6fSSøren Schmidt #define I2O_BSA_BLOCK_READ 0x30 11827da7e6fSSøren Schmidt #define I2O_BSA_BLOCK_WRITE 0x31 11927da7e6fSSøren Schmidt #define I2O_BSA_CACHE_FLUSH 0x37 12027da7e6fSSøren Schmidt #define I2O_EXEC_STATUS_GET 0xa0 12127da7e6fSSøren Schmidt #define I2O_EXEC_OUTBOUND_INIT 0xa1 12227da7e6fSSøren Schmidt #define I2O_EXEC_LCT_NOTIFY 0xa2 12327da7e6fSSøren Schmidt #define I2O_EXEC_SYSTAB_SET 0xa3 12427da7e6fSSøren Schmidt #define I2O_EXEC_IOP_RESET 0xbd 12527da7e6fSSøren Schmidt #define I2O_EXEC_SYS_ENABLE 0xd1 126ac9953bfSSøren Schmidt #define I2O_PRIVATE_MESSAGE 0xff 12727da7e6fSSøren Schmidt 12827da7e6fSSøren Schmidt /* basic message layout */ 12927da7e6fSSøren Schmidt struct i2o_basic_message { 13027da7e6fSSøren Schmidt u_int8_t version:4; 13127da7e6fSSøren Schmidt u_int8_t offset:4; 13227da7e6fSSøren Schmidt u_int8_t message_flags; 13327da7e6fSSøren Schmidt u_int16_t message_size; 13427da7e6fSSøren Schmidt u_int32_t target_address:12; 13527da7e6fSSøren Schmidt u_int32_t initiator_address:12; 13627da7e6fSSøren Schmidt u_int32_t function:8; 13727da7e6fSSøren Schmidt u_int32_t initiator_context; 1381652b7bdSSøren Schmidt u_int32_t transaction_context; 1394f492bfaSAlfred Perlstein } __packed; 14027da7e6fSSøren Schmidt 14127da7e6fSSøren Schmidt /* basic reply layout */ 14227da7e6fSSøren Schmidt struct i2o_single_reply { 14327da7e6fSSøren Schmidt u_int8_t version_offset; 14427da7e6fSSøren Schmidt u_int8_t message_flags; 14527da7e6fSSøren Schmidt #define I2O_MESSAGE_FLAGS_STATIC 0x01 14627da7e6fSSøren Schmidt #define I2O_MESSAGE_FLAGS_64BIT 0x02 14727da7e6fSSøren Schmidt #define I2O_MESSAGE_FLAGS_MULTIPLE 0x10 14827da7e6fSSøren Schmidt #define I2O_MESSAGE_FLAGS_FAIL 0x20 14927da7e6fSSøren Schmidt #define I2O_MESSAGE_FLAGS_LAST 0x40 15027da7e6fSSøren Schmidt #define I2O_MESSAGE_FLAGS_REPLY 0x80 15127da7e6fSSøren Schmidt 15227da7e6fSSøren Schmidt u_int16_t message_size; 15327da7e6fSSøren Schmidt u_int32_t target_address:12; 15427da7e6fSSøren Schmidt u_int32_t initiator_address:12; 15527da7e6fSSøren Schmidt u_int32_t function:8; 15627da7e6fSSøren Schmidt u_int32_t initiator_context; 15727da7e6fSSøren Schmidt u_int32_t transaction_context; 15827da7e6fSSøren Schmidt u_int16_t detailed_status; 15927da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_SUCCESS 0x0000 16027da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_BAD_KEY 0x0002 16127da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_TCL_ERROR 0x0003 16227da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_REPLY_BUFFER_FULL 0x0004 16327da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_NO_SUCH_PAGE 0x0005 16427da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_SOFT 0x0006 16527da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_HARD 0x0007 16627da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_CHAIN_BUFFER_TOO_LARGE 0x0009 16727da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_UNSUPPORTED_FUNCTION 0x000a 16827da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_DEVICE_LOCKED 0x000b 16927da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_DEVICE_RESET 0x000c 17027da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INAPPROPRIATE_FUNCTION 0x000d 17127da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INVALID_INITIATOR_ADDRESS 0x000e 17227da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INVALID_MESSAGE_FLAGS 0x000f 17327da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INVALID_OFFSET 0x0010 17427da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INVALID_PARAMETER 0x0011 17527da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INVALID_REQUEST 0x0012 17627da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_INVALID_TARGET_ADDRESS 0x0013 17727da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_MESSAGE_TOO_LARGE 0x0014 17827da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_MESSAGE_TOO_SMALL 0x0015 17927da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_MISSING_PARAMETER 0x0016 18027da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_TIMEOUT 0x0017 18127da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_UNKNOWN_ERROR 0x0018 18227da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_UNKNOWN_FUNCTION 0x0019 18327da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_UNSUPPORTED_VERSION 0x001a 18427da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_DEVICE_BUSY 0x001b 18527da7e6fSSøren Schmidt #define I2O_DETAIL_STATUS_DEVICE_NOT_AVAILABLE 0x001c 18627da7e6fSSøren Schmidt 18727da7e6fSSøren Schmidt u_int8_t retry_count; 18827da7e6fSSøren Schmidt u_int8_t status; 18927da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_SUCCESS 0x00 19027da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_ABORT_DIRTY 0x01 19127da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER 0x02 19227da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER 0x03 19327da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_ERROR_DIRTY 0x04 19427da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER 0x05 19527da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER 0x06 19627da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY 0x08 19727da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER 0x09 19827da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER 0x0a 19927da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_TRANSACTION_ERROR 0x0b 20027da7e6fSSøren Schmidt #define I2O_REPLY_STATUS_PROGRESS_REPORT 0x80 20127da7e6fSSøren Schmidt 20227da7e6fSSøren Schmidt u_int32_t donecount; 2034f492bfaSAlfred Perlstein } __packed; 20427da7e6fSSøren Schmidt 20527da7e6fSSøren Schmidt struct i2o_fault_reply { 20627da7e6fSSøren Schmidt u_int8_t version_offset; 20727da7e6fSSøren Schmidt u_int8_t message_flags; 20827da7e6fSSøren Schmidt u_int16_t message_size; 20927da7e6fSSøren Schmidt u_int32_t target_address:12; 21027da7e6fSSøren Schmidt u_int32_t initiator_address:12; 21127da7e6fSSøren Schmidt u_int32_t function:8; 21227da7e6fSSøren Schmidt u_int32_t initiator_context; 21327da7e6fSSøren Schmidt u_int32_t transaction_context; 21427da7e6fSSøren Schmidt u_int8_t lowest_version; 21527da7e6fSSøren Schmidt u_int8_t highest_version; 21627da7e6fSSøren Schmidt u_int8_t severity; 21727da7e6fSSøren Schmidt #define I2O_SEVERITY_FORMAT_ERROR 0x01 21827da7e6fSSøren Schmidt #define I2O_SEVERITY_PATH_ERROR 0x02 21927da7e6fSSøren Schmidt #define I2O_SEVERITY_PATH_STATE 0x04 22027da7e6fSSøren Schmidt #define I2O_SEVERITY_CONGESTION 0x08 22127da7e6fSSøren Schmidt 22227da7e6fSSøren Schmidt u_int8_t failure_code; 22327da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_SERVICE_SUSPENDED 0x81 22427da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_SERVICE_TERMINATED 0x82 22527da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_CONGESTION 0x83 22627da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_FAIL 0x84 22727da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_STATE_ERROR 0x85 22827da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_TIME_OUT 0x86 22927da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_ROUTING_FAILURE 0x87 23027da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_INVALID_VERSION 0x88 23127da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_INVALID_OFFSET 0x89 23227da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_INVALID_MSG_FLAGS 0x8A 23327da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_SMALL 0x8B 23427da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_LARGE 0x8C 23527da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_INVALID_TARGET_ID 0x8D 23627da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_ID 0x8E 23727da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_CONTEXT 0x8F 23827da7e6fSSøren Schmidt #define I2O_FAILURE_CODE_TRANSPORT_UNKNOWN_FAILURE 0xFF 23927da7e6fSSøren Schmidt 24027da7e6fSSøren Schmidt u_int32_t failing_iop_id:12; 24127da7e6fSSøren Schmidt u_int32_t reserved:4; 24227da7e6fSSøren Schmidt u_int32_t failing_host_unit_id:16; 24327da7e6fSSøren Schmidt u_int32_t age_limit; 24427da7e6fSSøren Schmidt u_int64_t preserved_mfa; 2454f492bfaSAlfred Perlstein } __packed; 24627da7e6fSSøren Schmidt 24727da7e6fSSøren Schmidt struct i2o_exec_iop_reset_message { 24827da7e6fSSøren Schmidt u_int8_t version_offset; 24927da7e6fSSøren Schmidt u_int8_t message_flags; 25027da7e6fSSøren Schmidt u_int16_t message_size; 25127da7e6fSSøren Schmidt u_int32_t target_address:12; 25227da7e6fSSøren Schmidt u_int32_t initiator_address:12; 25327da7e6fSSøren Schmidt u_int32_t function:8; 25427da7e6fSSøren Schmidt u_int8_t reserved[16]; 25527da7e6fSSøren Schmidt u_int32_t status_word_low_addr; 25627da7e6fSSøren Schmidt u_int32_t status_word_high_addr; 2574f492bfaSAlfred Perlstein } __packed; 25827da7e6fSSøren Schmidt 25927da7e6fSSøren Schmidt struct i2o_exec_status_get_message { 26027da7e6fSSøren Schmidt u_int8_t version_offset; 26127da7e6fSSøren Schmidt u_int8_t message_flags; 26227da7e6fSSøren Schmidt u_int16_t message_size; 26327da7e6fSSøren Schmidt u_int32_t target_address:12; 26427da7e6fSSøren Schmidt u_int32_t initiator_address:12; 26527da7e6fSSøren Schmidt u_int32_t function:8; 26627da7e6fSSøren Schmidt u_int8_t reserved[16]; 26727da7e6fSSøren Schmidt u_int32_t reply_buf_low_addr; 26827da7e6fSSøren Schmidt u_int32_t reply_buf_high_addr; 26927da7e6fSSøren Schmidt u_int32_t reply_buf_length; 2704f492bfaSAlfred Perlstein } __packed; 27127da7e6fSSøren Schmidt 27227da7e6fSSøren Schmidt struct i2o_status_get_reply { 27327da7e6fSSøren Schmidt u_int16_t organization_id; 27427da7e6fSSøren Schmidt u_int16_t reserved; 27527da7e6fSSøren Schmidt u_int32_t iop_id:12; 27627da7e6fSSøren Schmidt u_int32_t reserved1:4; 27727da7e6fSSøren Schmidt u_int32_t host_unit_id:16; 27827da7e6fSSøren Schmidt u_int32_t segment_number:12; 27927da7e6fSSøren Schmidt u_int32_t i2o_version:4; 28027da7e6fSSøren Schmidt u_int32_t iop_state:8; 28127da7e6fSSøren Schmidt #define I2O_IOP_STATE_INITIALIZING 0x01 28227da7e6fSSøren Schmidt #define I2O_IOP_STATE_RESET 0x02 28327da7e6fSSøren Schmidt #define I2O_IOP_STATE_HOLD 0x04 28427da7e6fSSøren Schmidt #define I2O_IOP_STATE_READY 0x05 28527da7e6fSSøren Schmidt #define I2O_IOP_STATE_OPERATIONAL 0x08 28627da7e6fSSøren Schmidt #define I2O_IOP_STATE_FAILED 0x10 28727da7e6fSSøren Schmidt #define I2O_IOP_STATE_FAULTED 0x11 28827da7e6fSSøren Schmidt 28927da7e6fSSøren Schmidt u_int32_t messenger_type:8; 29027da7e6fSSøren Schmidt u_int16_t inbound_mframe_size; 29127da7e6fSSøren Schmidt u_int8_t init_code; 29227da7e6fSSøren Schmidt u_int8_t reserved2; 29327da7e6fSSøren Schmidt u_int32_t max_inbound_mframes; 29427da7e6fSSøren Schmidt u_int32_t current_ibound_mframes; 29527da7e6fSSøren Schmidt u_int32_t max_outbound_mframes; 29627da7e6fSSøren Schmidt u_int8_t product_idstring[24]; 29727da7e6fSSøren Schmidt u_int32_t expected_lct_size; 29827da7e6fSSøren Schmidt u_int32_t iop_capabilities; 29927da7e6fSSøren Schmidt u_int32_t desired_private_memsize; 30027da7e6fSSøren Schmidt u_int32_t current_private_memsize; 30127da7e6fSSøren Schmidt u_int32_t current_private_membase; 30227da7e6fSSøren Schmidt u_int32_t desired_private_iosize; 30327da7e6fSSøren Schmidt u_int32_t current_private_iosize; 30427da7e6fSSøren Schmidt u_int32_t current_private_iobase; 30527da7e6fSSøren Schmidt u_int8_t reserved3[3]; 30627da7e6fSSøren Schmidt u_int8_t sync_byte; 3074f492bfaSAlfred Perlstein } __packed; 30827da7e6fSSøren Schmidt 30927da7e6fSSøren Schmidt struct i2o_exec_init_outqueue_message { 31027da7e6fSSøren Schmidt u_int8_t version_offset; 31127da7e6fSSøren Schmidt u_int8_t message_flags; 31227da7e6fSSøren Schmidt u_int16_t message_size; 31327da7e6fSSøren Schmidt u_int32_t target_address:12; 31427da7e6fSSøren Schmidt u_int32_t initiator_address:12; 31527da7e6fSSøren Schmidt u_int32_t function:8; 31627da7e6fSSøren Schmidt u_int32_t initiator_context; 31727da7e6fSSøren Schmidt u_int32_t transaction_context; 31827da7e6fSSøren Schmidt u_int32_t host_pagesize; 31927da7e6fSSøren Schmidt u_int8_t init_code; 32027da7e6fSSøren Schmidt u_int8_t reserved; 32127da7e6fSSøren Schmidt u_int16_t queue_framesize; 32227da7e6fSSøren Schmidt struct i2o_sgl sgl[2]; 3234f492bfaSAlfred Perlstein } __packed; 32427da7e6fSSøren Schmidt 32527da7e6fSSøren Schmidt #define I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS 0x01 32627da7e6fSSøren Schmidt #define I2O_EXEC_OUTBOUND_INIT_REJECTED 0x02 32727da7e6fSSøren Schmidt #define I2O_EXEC_OUTBOUND_INIT_FAILED 0x03 32827da7e6fSSøren Schmidt #define I2O_EXEC_OUTBOUND_INIT_COMPLETE 0x04 32927da7e6fSSøren Schmidt 33027da7e6fSSøren Schmidt struct i2o_exec_systab_set_message { 33127da7e6fSSøren Schmidt u_int8_t version_offset; 33227da7e6fSSøren Schmidt u_int8_t message_flags; 33327da7e6fSSøren Schmidt u_int16_t message_size; 33427da7e6fSSøren Schmidt u_int32_t target_address:12; 33527da7e6fSSøren Schmidt u_int32_t initiator_address:12; 33627da7e6fSSøren Schmidt u_int32_t function:8; 33727da7e6fSSøren Schmidt u_int32_t initiator_context; 33827da7e6fSSøren Schmidt u_int32_t transaction_context; 33927da7e6fSSøren Schmidt u_int32_t iop_id:12; 34027da7e6fSSøren Schmidt #define I2O_EXEC_SYS_TAB_IOP_ID_LOCAL_IOP 0x000 34127da7e6fSSøren Schmidt #define I2O_EXEC_SYS_TAB_IOP_ID_LOCAL_HOST 0x001 34227da7e6fSSøren Schmidt #define I2O_EXEC_SYS_TAB_IOP_ID_UNKNOWN_IOP 0xfff 34327da7e6fSSøren Schmidt 34427da7e6fSSøren Schmidt u_int32_t reserved1:4; 34527da7e6fSSøren Schmidt u_int32_t host_unit_id:16; 34627da7e6fSSøren Schmidt #define I2O_EXEC_SYS_TAB_HOST_UNIT_ID_LOCAL_UNIT 0x0000 34727da7e6fSSøren Schmidt #define I2O_EXEC_SYS_TAB_HOST_UNIT_ID_UNKNOWN_UNIT 0xffff 34827da7e6fSSøren Schmidt 34927da7e6fSSøren Schmidt u_int32_t segment_number:12; 35027da7e6fSSøren Schmidt #define I2O_EXEC_SYS_TAB_SEG_NUMBER_LOCAL_SEGMENT 0x000 35127da7e6fSSøren Schmidt #define I2O_EXEC_SYS_TAB_SEG_NUMBER_UNKNOWN_SEGMENT 0xfff 35227da7e6fSSøren Schmidt 35327da7e6fSSøren Schmidt u_int32_t reserved2:4; 35427da7e6fSSøren Schmidt u_int32_t reserved3:8; 35527da7e6fSSøren Schmidt struct i2o_sgl sgl[3]; 3564f492bfaSAlfred Perlstein } __packed; 35727da7e6fSSøren Schmidt 35827da7e6fSSøren Schmidt struct i2o_exec_systab { 35927da7e6fSSøren Schmidt u_int8_t entries; 36027da7e6fSSøren Schmidt u_int8_t version; 36127da7e6fSSøren Schmidt #define I2O_RESOURCE_MANAGER_VERSION 0 36227da7e6fSSøren Schmidt 36327da7e6fSSøren Schmidt u_int16_t reserved1; 36427da7e6fSSøren Schmidt u_int32_t change_id; 36527da7e6fSSøren Schmidt u_int64_t reserved2; 36627da7e6fSSøren Schmidt u_int16_t organization_id; 36727da7e6fSSøren Schmidt u_int16_t reserved3; 36827da7e6fSSøren Schmidt u_int32_t iop_id:12; 36927da7e6fSSøren Schmidt u_int32_t reserved4:20; 37027da7e6fSSøren Schmidt u_int32_t segment_number:12; 37127da7e6fSSøren Schmidt u_int32_t i2o_version:4; 37227da7e6fSSøren Schmidt u_int32_t iop_state:8; 37327da7e6fSSøren Schmidt u_int32_t messenger_type:8; 37427da7e6fSSøren Schmidt u_int16_t inbound_mframe_size; 37527da7e6fSSøren Schmidt u_int16_t reserved5; 37627da7e6fSSøren Schmidt u_int32_t last_changed; 37727da7e6fSSøren Schmidt u_int32_t iop_capabilities; 37827da7e6fSSøren Schmidt u_int64_t messenger_info; 3794f492bfaSAlfred Perlstein } __packed; 38027da7e6fSSøren Schmidt 38127da7e6fSSøren Schmidt struct i2o_exec_get_lct_message { 38227da7e6fSSøren Schmidt u_int8_t version_offset; 38327da7e6fSSøren Schmidt u_int8_t message_flags; 38427da7e6fSSøren Schmidt u_int16_t message_size; 38527da7e6fSSøren Schmidt u_int32_t target_address:12; 38627da7e6fSSøren Schmidt u_int32_t initiator_address:12; 38727da7e6fSSøren Schmidt u_int32_t function:8; 38827da7e6fSSøren Schmidt u_int32_t initiator_context; 38927da7e6fSSøren Schmidt u_int32_t transaction_context; 39027da7e6fSSøren Schmidt u_int32_t class; 39127da7e6fSSøren Schmidt u_int32_t last_change_id; 39227da7e6fSSøren Schmidt struct i2o_sgl sgl; 3934f492bfaSAlfred Perlstein } __packed; 39427da7e6fSSøren Schmidt 39527da7e6fSSøren Schmidt #define I2O_TID_IOP 0x000 39627da7e6fSSøren Schmidt #define I2O_TID_HOST 0x001 39727da7e6fSSøren Schmidt #define I2O_TID_NONE 0xfff 39827da7e6fSSøren Schmidt 39927da7e6fSSøren Schmidt struct i2o_lct_entry { 40027da7e6fSSøren Schmidt u_int32_t entry_size:16; 40127da7e6fSSøren Schmidt u_int32_t local_tid:12; 40227da7e6fSSøren Schmidt u_int32_t reserved:4; 40327da7e6fSSøren Schmidt u_int32_t change_id; 40427da7e6fSSøren Schmidt u_int32_t device_flags; 40527da7e6fSSøren Schmidt u_int32_t class:12; 40627da7e6fSSøren Schmidt #define I2O_CLASS_EXECUTIVE 0x000 40727da7e6fSSøren Schmidt #define I2O_CLASS_DDM 0x001 40827da7e6fSSøren Schmidt #define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010 40927da7e6fSSøren Schmidt #define I2O_CLASS_SEQUENTIAL_STORAGE 0x011 41027da7e6fSSøren Schmidt #define I2O_CLASS_LAN 0x020 41127da7e6fSSøren Schmidt #define I2O_CLASS_WAN 0x030 41227da7e6fSSøren Schmidt #define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040 41327da7e6fSSøren Schmidt #define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041 41427da7e6fSSøren Schmidt #define I2O_CLASS_SCSI_PERIPHERAL 0x051 41527da7e6fSSøren Schmidt #define I2O_CLASS_ATE_PORT 0x060 41627da7e6fSSøren Schmidt #define I2O_CLASS_ATE_PERIPHERAL 0x061 41727da7e6fSSøren Schmidt #define I2O_CLASS_FLOPPY_CONTROLLER 0x070 41827da7e6fSSøren Schmidt #define I2O_CLASS_FLOPPY_DEVICE 0x071 41927da7e6fSSøren Schmidt #define I2O_CLASS_BUS_ADAPTER_PORT 0x080 42027da7e6fSSøren Schmidt #define I2O_CLASS_MATCH_ANYCLASS 0xffffffff 42127da7e6fSSøren Schmidt 42227da7e6fSSøren Schmidt u_int32_t class_version:4; 42327da7e6fSSøren Schmidt u_int32_t class_org:16; 42427da7e6fSSøren Schmidt u_int32_t sub_class; 42527da7e6fSSøren Schmidt #define I2O_SUBCLASS_i960 0x001 42627da7e6fSSøren Schmidt #define I2O_SUBCLASS_HDM 0x020 42727da7e6fSSøren Schmidt #define I2O_SUBCLASS_ISM 0x021 42827da7e6fSSøren Schmidt 42927da7e6fSSøren Schmidt u_int32_t user_tid:12; 43027da7e6fSSøren Schmidt u_int32_t parent_tid:12; 43127da7e6fSSøren Schmidt u_int32_t bios_info:8; 43227da7e6fSSøren Schmidt u_int8_t identity_tag[8]; 43327da7e6fSSøren Schmidt u_int32_t event_capabilities; 4344f492bfaSAlfred Perlstein } __packed; 43527da7e6fSSøren Schmidt 43627da7e6fSSøren Schmidt #define I2O_LCT_ENTRYSIZE (sizeof(struct i2o_lct_entry)/sizeof(u_int32_t)) 43727da7e6fSSøren Schmidt 43827da7e6fSSøren Schmidt struct i2o_get_lct_reply { 43927da7e6fSSøren Schmidt u_int32_t table_size:16; 44027da7e6fSSøren Schmidt u_int32_t boot_device:12; 44127da7e6fSSøren Schmidt u_int32_t lct_version:4; 44227da7e6fSSøren Schmidt u_int32_t iop_flags; 44327da7e6fSSøren Schmidt u_int32_t current_change_id; 44427da7e6fSSøren Schmidt struct i2o_lct_entry entry[1]; 4454f492bfaSAlfred Perlstein } __packed; 44627da7e6fSSøren Schmidt 44727da7e6fSSøren Schmidt struct i2o_util_get_param_message { 44827da7e6fSSøren Schmidt u_int8_t version_offset; 44927da7e6fSSøren Schmidt u_int8_t message_flags; 45027da7e6fSSøren Schmidt u_int16_t message_size; 45127da7e6fSSøren Schmidt u_int32_t target_address:12; 45227da7e6fSSøren Schmidt u_int32_t initiator_address:12; 45327da7e6fSSøren Schmidt u_int32_t function:8; 45427da7e6fSSøren Schmidt u_int32_t initiator_context; 45527da7e6fSSøren Schmidt u_int32_t transaction_context; 45627da7e6fSSøren Schmidt u_int32_t operation_flags; 45727da7e6fSSøren Schmidt struct i2o_sgl sgl[2]; 4584f492bfaSAlfred Perlstein } __packed; 45927da7e6fSSøren Schmidt 46027da7e6fSSøren Schmidt struct i2o_get_param_template { 46127da7e6fSSøren Schmidt u_int16_t operation; 46227da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_FIELD_GET 0x0001 46327da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_LIST_GET 0x0002 46427da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_MORE_GET 0x0003 46527da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_SIZE_GET 0x0004 46627da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_TABLE_GET 0x0005 46727da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_FIELD_SET 0x0006 46827da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_LIST_SET 0x0007 46927da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_ROW_ADD 0x0008 47027da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_ROW_DELETE 0x0009 47127da7e6fSSøren Schmidt #define I2O_PARAMS_OPERATION_TABLE_CLEAR 0x000A 47227da7e6fSSøren Schmidt 47327da7e6fSSøren Schmidt u_int16_t group; 47427da7e6fSSøren Schmidt #define I2O_BSA_DEVICE_INFO_GROUP_NO 0x0000 47527da7e6fSSøren Schmidt #define I2O_BSA_OPERATIONAL_CONTROL_GROUP_NO 0x0001 47627da7e6fSSøren Schmidt #define I2O_BSA_POWER_CONTROL_GROUP_NO 0x0002 47727da7e6fSSøren Schmidt #define I2O_BSA_CACHE_CONTROL_GROUP_NO 0x0003 47827da7e6fSSøren Schmidt #define I2O_BSA_MEDIA_INFO_GROUP_NO 0x0004 47927da7e6fSSøren Schmidt #define I2O_BSA_ERROR_LOG_GROUP_NO 0x0005 48027da7e6fSSøren Schmidt 48127da7e6fSSøren Schmidt #define I2O_UTIL_PARAMS_DESCRIPTOR_GROUP_NO 0xF000 48227da7e6fSSøren Schmidt #define I2O_UTIL_PHYSICAL_DEVICE_TABLE_GROUP_NO 0xF001 48327da7e6fSSøren Schmidt #define I2O_UTIL_CLAIMED_TABLE_GROUP_NO 0xF002 48427da7e6fSSøren Schmidt #define I2O_UTIL_USER_TABLE_GROUP_NO 0xF003 48527da7e6fSSøren Schmidt #define I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_GROUP_NO 0xF005 48627da7e6fSSøren Schmidt #define I2O_UTIL_AUTHORIZED_USER_TABLE_GROUP_NO 0xF006 48727da7e6fSSøren Schmidt #define I2O_UTIL_DEVICE_IDENTITY_GROUP_NO 0xF100 48827da7e6fSSøren Schmidt #define I2O_UTIL_DDM_IDENTITY_GROUP_NO 0xF101 48927da7e6fSSøren Schmidt #define I2O_UTIL_USER_INFORMATION_GROUP_NO 0xF102 49027da7e6fSSøren Schmidt #define I2O_UTIL_SGL_OPERATING_LIMITS_GROUP_NO 0xF103 49127da7e6fSSøren Schmidt #define I2O_UTIL_SENSORS_GROUP_NO 0xF200 49227da7e6fSSøren Schmidt 49327da7e6fSSøren Schmidt u_int16_t field_count; 49427da7e6fSSøren Schmidt u_int16_t pad; 4954f492bfaSAlfred Perlstein } __packed; 49627da7e6fSSøren Schmidt 49727da7e6fSSøren Schmidt struct i2o_get_param_operation { 49827da7e6fSSøren Schmidt u_int16_t operation_count; 49927da7e6fSSøren Schmidt u_int16_t reserved; 50027da7e6fSSøren Schmidt struct i2o_get_param_template operation[1]; 5014f492bfaSAlfred Perlstein } __packed; 50227da7e6fSSøren Schmidt 50327da7e6fSSøren Schmidt struct i2o_get_param_reply { 504ac9953bfSSøren Schmidt u_int16_t result_count; 50527da7e6fSSøren Schmidt u_int16_t reserved; 50627da7e6fSSøren Schmidt u_int16_t block_size; 50727da7e6fSSøren Schmidt u_int8_t block_status; 50827da7e6fSSøren Schmidt u_int8_t error_info_size; 50927da7e6fSSøren Schmidt u_int32_t result[1]; 5104f492bfaSAlfred Perlstein } __packed; 51127da7e6fSSøren Schmidt 51227da7e6fSSøren Schmidt struct i2o_device_identity { 51327da7e6fSSøren Schmidt u_int32_t class; 51427da7e6fSSøren Schmidt u_int16_t owner; 51527da7e6fSSøren Schmidt u_int16_t parent; 51627da7e6fSSøren Schmidt u_int8_t vendor[16]; 51727da7e6fSSøren Schmidt u_int8_t product[16]; 51827da7e6fSSøren Schmidt u_int8_t description[16]; 51927da7e6fSSøren Schmidt u_int8_t revision[8]; 52027da7e6fSSøren Schmidt u_int8_t sn_format; 52127da7e6fSSøren Schmidt u_int8_t serial[256]; 5224f492bfaSAlfred Perlstein } __packed; 52327da7e6fSSøren Schmidt 52427da7e6fSSøren Schmidt struct i2o_bsa_device { 52527da7e6fSSøren Schmidt u_int8_t device_type; 52627da7e6fSSøren Schmidt u_int8_t path_count; 52727da7e6fSSøren Schmidt u_int16_t power_state; 52827da7e6fSSøren Schmidt u_int32_t block_size; 52927da7e6fSSøren Schmidt u_int64_t capacity; 53027da7e6fSSøren Schmidt u_int32_t capabilities; 53127da7e6fSSøren Schmidt u_int32_t state; 5324f492bfaSAlfred Perlstein } __packed; 53327da7e6fSSøren Schmidt 53427da7e6fSSøren Schmidt struct i2o_util_claim_message { 53527da7e6fSSøren Schmidt u_int8_t version_offset; 53627da7e6fSSøren Schmidt u_int8_t message_flags; 53727da7e6fSSøren Schmidt u_int16_t message_size; 53827da7e6fSSøren Schmidt u_int32_t target_address:12; 53927da7e6fSSøren Schmidt u_int32_t initiator_address:12; 54027da7e6fSSøren Schmidt u_int32_t function:8; 54127da7e6fSSøren Schmidt u_int32_t initiator_context; 54227da7e6fSSøren Schmidt u_int32_t transaction_context; 54327da7e6fSSøren Schmidt u_int16_t claim_flags; 54427da7e6fSSøren Schmidt u_int8_t reserved; 54527da7e6fSSøren Schmidt u_int8_t claim_type; 5464f492bfaSAlfred Perlstein } __packed; 54727da7e6fSSøren Schmidt 54827da7e6fSSøren Schmidt struct i2o_util_event_register_message { 54927da7e6fSSøren Schmidt u_int8_t version_offset; 55027da7e6fSSøren Schmidt u_int8_t message_flags; 55127da7e6fSSøren Schmidt u_int16_t message_size; 55227da7e6fSSøren Schmidt u_int32_t target_address:12; 55327da7e6fSSøren Schmidt u_int32_t initiator_address:12; 55427da7e6fSSøren Schmidt u_int32_t function:8; 55527da7e6fSSøren Schmidt u_int32_t initiator_context; 55627da7e6fSSøren Schmidt u_int32_t transaction_context; 55727da7e6fSSøren Schmidt u_int32_t event_mask; 5584f492bfaSAlfred Perlstein } __packed; 55927da7e6fSSøren Schmidt 56027da7e6fSSøren Schmidt struct i2o_util_event_reply_message { 56127da7e6fSSøren Schmidt u_int8_t version_offset; 56227da7e6fSSøren Schmidt u_int8_t message_flags; 56327da7e6fSSøren Schmidt u_int16_t message_size; 56427da7e6fSSøren Schmidt u_int32_t target_address:12; 56527da7e6fSSøren Schmidt u_int32_t initiator_address:12; 56627da7e6fSSøren Schmidt u_int32_t function:8; 56727da7e6fSSøren Schmidt u_int32_t initiator_context; 56827da7e6fSSøren Schmidt u_int32_t transaction_context; 56927da7e6fSSøren Schmidt u_int32_t event_mask; 57027da7e6fSSøren Schmidt u_int32_t event_data[1]; 5714f492bfaSAlfred Perlstein } __packed; 57227da7e6fSSøren Schmidt 57327da7e6fSSøren Schmidt struct i2o_util_config_dialog_message { 57427da7e6fSSøren Schmidt u_int8_t version_offset; 57527da7e6fSSøren Schmidt u_int8_t message_flags; 57627da7e6fSSøren Schmidt u_int16_t message_size; 57727da7e6fSSøren Schmidt u_int32_t target_address:12; 57827da7e6fSSøren Schmidt u_int32_t initiator_address:12; 57927da7e6fSSøren Schmidt u_int32_t function:8; 58027da7e6fSSøren Schmidt u_int32_t initiator_context; 58127da7e6fSSøren Schmidt u_int32_t transaction_context; 58227da7e6fSSøren Schmidt u_int32_t page_number; 58327da7e6fSSøren Schmidt struct i2o_sgl sgl[2]; 5844f492bfaSAlfred Perlstein } __packed; 58527da7e6fSSøren Schmidt 586ac9953bfSSøren Schmidt struct i2o_private_message { 587ac9953bfSSøren Schmidt u_int8_t version_offset; 588ac9953bfSSøren Schmidt u_int8_t message_flags; 589ac9953bfSSøren Schmidt u_int16_t message_size; 590ac9953bfSSøren Schmidt u_int32_t target_address:12; 591ac9953bfSSøren Schmidt u_int32_t initiator_address:12; 592ac9953bfSSøren Schmidt u_int32_t function:8; 593ac9953bfSSøren Schmidt u_int32_t initiator_context; 594ac9953bfSSøren Schmidt u_int32_t transaction_context; 595ac9953bfSSøren Schmidt u_int16_t function_code; 596ac9953bfSSøren Schmidt u_int16_t organization_id; 597ac9953bfSSøren Schmidt struct i2o_sgl in_sgl; 598ac9953bfSSøren Schmidt struct i2o_sgl out_sgl; 599ac9953bfSSøren Schmidt } __packed; 600ac9953bfSSøren Schmidt 60127da7e6fSSøren Schmidt struct i2o_bsa_rw_block_message { 60227da7e6fSSøren Schmidt u_int8_t version_offset; 60327da7e6fSSøren Schmidt u_int8_t message_flags; 60427da7e6fSSøren Schmidt u_int16_t message_size; 60527da7e6fSSøren Schmidt u_int32_t target_address:12; 60627da7e6fSSøren Schmidt u_int32_t initiator_address:12; 60727da7e6fSSøren Schmidt u_int32_t function:8; 60827da7e6fSSøren Schmidt u_int32_t initiator_context; 60927da7e6fSSøren Schmidt u_int32_t transaction_context; 61027da7e6fSSøren Schmidt u_int16_t control_flags; 61127da7e6fSSøren Schmidt u_int8_t time_multiplier; 61227da7e6fSSøren Schmidt u_int8_t fetch_ahead; 61327da7e6fSSøren Schmidt u_int32_t bytecount; 61427da7e6fSSøren Schmidt u_int64_t lba; 61527da7e6fSSøren Schmidt struct i2o_sgl sgl; 6164f492bfaSAlfred Perlstein } __packed; 61727da7e6fSSøren Schmidt 61827da7e6fSSøren Schmidt struct i2o_bsa_cache_flush_message { 61927da7e6fSSøren Schmidt u_int8_t version_offset; 62027da7e6fSSøren Schmidt u_int8_t message_flags; 62127da7e6fSSøren Schmidt u_int16_t message_size; 62227da7e6fSSøren Schmidt u_int32_t target_address:12; 62327da7e6fSSøren Schmidt u_int32_t initiator_address:12; 62427da7e6fSSøren Schmidt u_int32_t function:8; 62527da7e6fSSøren Schmidt u_int32_t initiator_context; 62627da7e6fSSøren Schmidt u_int32_t transaction_context; 62727da7e6fSSøren Schmidt u_int16_t control_flags; 62827da7e6fSSøren Schmidt u_int8_t time_multiplier; 62927da7e6fSSøren Schmidt u_int8_t reserved; 6304f492bfaSAlfred Perlstein } __packed; 63127da7e6fSSøren Schmidt 63227da7e6fSSøren Schmidt /* prototypes */ 63327da7e6fSSøren Schmidt int iop_init(struct iop_softc *); 634b3fc3d57SStefan Farfeleder void iop_attach(void *); 63527da7e6fSSøren Schmidt void iop_intr(void *); 63627da7e6fSSøren Schmidt int iop_reset(struct iop_softc *); 63727da7e6fSSøren Schmidt int iop_init_outqueue(struct iop_softc *); 63827da7e6fSSøren Schmidt int iop_get_lct(struct iop_softc *); 63927da7e6fSSøren Schmidt struct i2o_get_param_reply *iop_get_util_params(struct iop_softc *,int,int,int); 64027da7e6fSSøren Schmidt u_int32_t iop_get_mfa(struct iop_softc *); 64127da7e6fSSøren Schmidt void iop_free_mfa(struct iop_softc *, int); 64227da7e6fSSøren Schmidt int iop_queue_wait_msg(struct iop_softc *, int, struct i2o_basic_message *); 64327da7e6fSSøren Schmidt int iop_create_sgl(struct i2o_basic_message *, caddr_t, int, int); 64427da7e6fSSøren Schmidt 64527da7e6fSSøren Schmidt /* global prototypes */ 64627da7e6fSSøren Schmidt int pst_add_raid(struct iop_softc *, struct i2o_lct_entry *); 647