i2omsg.h revision 91e1058474884b4b6f1d3665a96ddeb9a30cd489
/*
* Copyright (c) 1998-1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* *************************************************************************
* All software on this website is made available under the following
* terms and conditions. By downloading this software, you agree to
* abide by these terms and conditions with respect to this software.
*
* I2O SIG All rights reserved.
*
* These header files are provided, pursuant to your I2O SIG membership
* agreement, free of charge on an as-is basis without warranty of any
* kind, either express or implied, including but not limited to,
* implied warranties or merchantability and fitness for a particular
* purpose. I2O SIG does not warrant that this program will meet the
* user's requirements or that the operation of these programs will be
* uninterrupted or error-free. Acceptance and use of this program
* constitutes the user's understanding that he will have no recourse
* to I2O SIG for any actual or consequential damages including, but
* not limited to, loss profits arising out of use or inability to use
* this program.
*
* Member is permitted to create deriavative works to this header-file
* program. However, all copies of the program and its derivative
* works must contain the I2O SIG copyright notice.
* *************************************************************************
*/
/*
* *************************************************************************
* i2omsg.h -- I2O Message defintion file
*
* This file contains information presented in Chapter 3, 4 and 6 of
* the I2O(tm) Specification and most of the I2O Global defines and
* Typedefs.
* *************************************************************************
*/
#ifndef _SYS_I2OMSG_H
#define _SYS_I2OMSG_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* *************************************************************************
* NOTES:
*
* Gets, reads, receives, etc. are all even numbered functions.
* Sets, writes, sends, etc. are all odd numbered functions.
* Functions that both send and receive data can be either but an attempt is
* made to use the function number that indicates the greater transfer amount.
* Functions that do not send or receive data use odd function numbers.
*
* Some functions are synonyms like read, receive and send, write.
*
* All common functions will have a code of less than 0x80.
* Unique functions to a class will start at 0x80.
* Executive Functions start at 0xA0.
*
* Utility Message function codes range from 0 - 0x1f
* Base Message function codes range from 0x20 - 0xfe
* Private Message function code is 0xff.
* *************************************************************************
*/
#include <sys/dditypes.h>
/* Set to 1 for 64 bit Context Fields */
#define I2O_64BIT_CONTEXT 0
/* ************************************************************************** */
/* Common functions accross all classes. */
#define I2O_PRIVATE_MESSAGE 0xFF
/* ************************************************************************** */
/* Class ID and Code Assignments */
#define I2O_CLASS_VERSION_10 0x00
#define I2O_CLASS_VERSION_11 0x01
/* Class Code Names: Table 6-1 Class Code Assignments. */
#define I2O_CLASS_EXECUTIVE 0x000
#define I2O_CLASS_DDM 0x001
#define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x010
#define I2O_CLASS_SEQUENTIAL_STORAGE 0x011
#define I2O_CLASS_LAN 0x020
#define I2O_CLASS_WAN 0x030
#define I2O_CLASS_FIBRE_CHANNEL_PORT 0x040
#define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x041
#define I2O_CLASS_SCSI_PERIPHERAL 0x051
#define I2O_CLASS_ATE_PORT 0x060
#define I2O_CLASS_ATE_PERIPHERAL 0x061
#define I2O_CLASS_FLOPPY_CONTROLLER 0x070
#define I2O_CLASS_FLOPPY_DEVICE 0x071
#define I2O_CLASS_BUS_ADAPTER_PORT 0x080
/* Class Codes 0x090 - 0x09f are reserved for Peer-to-Peer classes */
#define I2O_CLASS_MATCH_ANYCLASS 0xffffffff
#define I2O_SUBCLASS_i960 0x001
#define I2O_SUBCLASS_HDM 0x020
#define I2O_SUBCLASS_ISM 0x021
/* ************************************************************************** */
/* Message Frame defines and structures */
/* Defines for the Version_Status field. */
#define I2O_VERSION_10 0x00
#define I2O_VERSION_11 0x01
#define I2O_VERSION_OFFSET_NUMBER_MASK 0x07
#define I2O_VERSION_OFFSET_SGL_TRL_OFFSET_MASK 0xF0
/*
* Defines for the Message Flags Field.
* Please Note that the FAIL bit is only set in the Transport Fail Message.
*/
#define I2O_MESSAGE_FLAGS_STATIC 0x01
#define I2O_MESSAGE_FLAGS_64BIT_CONTEXT 0x02
#define I2O_MESSAGE_FLAGS_MULTIPLE 0x10
#define I2O_MESSAGE_FLAGS_FAIL 0x20
#define I2O_MESSAGE_FLAGS_LAST 0x40
#define I2O_MESSAGE_FLAGS_REPLY 0x80
/* Defines for Request Status Codes: Table 3-1 Reply Status Codes. */
#define I2O_REPLY_STATUS_SUCCESS 0x00
#define I2O_REPLY_STATUS_ABORT_DIRTY 0x01
#define I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER 0x02
#define I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER 0x03
#define I2O_REPLY_STATUS_ERROR_DIRTY 0x04
#define I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER 0x05
#define I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER 0x06
#define I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY 0x08
#define I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER 0x09
#define I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER 0x0A
#define I2O_REPLY_STATUS_TRANSACTION_ERROR 0x0B
#define I2O_REPLY_STATUS_PROGRESS_REPORT 0x80
/*
* DetailedStatusCode defines for ALL messages: Table 3-2 Detailed Status Codes.
*/
#define I2O_DETAIL_STATUS_SUCCESS 0x0000
#define I2O_DETAIL_STATUS_BAD_KEY 0x0002
#define I2O_DETAIL_STATUS_TCL_ERROR 0x0003
#define I2O_DETAIL_STATUS_REPLY_BUFFER_FULL 0x0004
#define I2O_DETAIL_STATUS_NO_SUCH_PAGE 0x0005
#define I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_SOFT 0x0006
#define I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_HARD 0x0007
#define I2O_DETAIL_STATUS_CHAIN_BUFFER_TOO_LARGE 0x0009
#define I2O_DETAIL_STATUS_UNSUPPORTED_FUNCTION 0x000A
#define I2O_DETAIL_STATUS_DEVICE_LOCKED 0x000B
#define I2O_DETAIL_STATUS_DEVICE_RESET 0x000C
#define I2O_DETAIL_STATUS_INAPPROPRIATE_FUNCTION 0x000D
#define I2O_DETAIL_STATUS_INVALID_INITIATOR_ADDRESS 0x000E
#define I2O_DETAIL_STATUS_INVALID_MESSAGE_FLAGS 0x000F
#define I2O_DETAIL_STATUS_INVALID_OFFSET 0x0010
#define I2O_DETAIL_STATUS_INVALID_PARAMETER 0x0011
#define I2O_DETAIL_STATUS_INVALID_REQUEST 0x0012
#define I2O_DETAIL_STATUS_INVALID_TARGET_ADDRESS 0x0013
#define I2O_DETAIL_STATUS_MESSAGE_TOO_LARGE 0x0014
#define I2O_DETAIL_STATUS_MESSAGE_TOO_SMALL 0x0015
#define I2O_DETAIL_STATUS_MISSING_PARAMETER 0x0016
#define I2O_DETAIL_STATUS_TIMEOUT 0x0017
#define I2O_DETAIL_STATUS_UNKNOWN_ERROR 0x0018
#define I2O_DETAIL_STATUS_UNKNOWN_FUNCTION 0x0019
#define I2O_DETAIL_STATUS_UNSUPPORTED_VERSION 0x001A
#define I2O_DEATIL_STATUS_DEVICE_BUSY 0x001B
#define I2O_DETAIL_STATUS_DEVICE_NOT_AVAILABLE 0x001C
/* Common I2O Field sizes */
#define I2O_TID_SZ 12
#define I2O_FUNCTION_SZ 8
#define I2O_UNIT_ID_SZ 16
#define I2O_SEGMENT_NUMBER_SZ 12
#define I2O_IOP_ID_SZ 12
#define I2O_GROUP_ID_SZ 16
#define I2O_IOP_STATE_SZ 8
#define I2O_MESSENGER_TYPE_SZ 8
#define I2O_CLASS_ID_SZ 12
#define I2O_CLASS_ORGANIZATION_ID_SZ 16
#define I2O_4BIT_VERSION_SZ 4
#define I2O_8BIT_FLAGS_SZ 8
#define I2O_COMMON_LENGTH_FIELD_SZ 16
#define I2O_DEVID_DESCRIPTION_SZ 16
#define I2O_DEVID_VENDOR_INFO_SZ 16
#define I2O_DEVID_PRODUCT_INFO_SZ 16
#define I2O_DEVID_REV_LEVEL_SZ 8
#define I2O_MODULE_NAME_SZ 24
#define I2O_BIOS_INFO_SZ 8
#define I2O_RESERVED_4BITS 4
#define I2O_RESERVED_8BITS 8
#define I2O_RESERVED_12BITS 12
#define I2O_RESERVED_16BITS 16
#define I2O_RESERVED_20BITS 20
#define I2O_RESERVED_24BITS 24
#define I2O_RESERVED_28BITS 28
typedef uint32_t I2O_PARAMETER_TID;
typedef union {
void (* i2o_msg_complete)(void *, ddi_acc_handle_t);
typedef uint64_t i2o_transaction_context_t;
#else
typedef union {
void (* i2o_msg_complete)(void *, ddi_acc_handle_t);
typedef uint32_t i2o_transaction_context_t;
#endif
/* Serial Number format defines */
#define I2O_SERIAL_FORMAT_UNKNOWN 0
#define I2O_SERIAL_FORMAT_BINARY 1
#define I2O_SERIAL_FORMAT_ASCII 2
#define I2O_SERIAL_FORMAT_UNICODE 3
#define I2O_SERIAL_FORMAT_LAN_MAC 4
#define I2O_SERIAL_FORMAT_WAN 5
/* Special TID Assignments */
#define I2O_IOP_TID 0
#define I2O_HOST_TID 1
/* ************************************************************************** */
/* I2O Message Frame common for all messages */
#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)
typedef struct i2o_message_frame {
union {
struct {
} s2;
} u2;
/* macros to access the bit fields in Message Frame */
#endif
#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)
typedef struct i2o_message_frame {
union {
struct {
} s2;
} u2;
/* macros to access the bit fields in Message Frame */
#endif
/* ************************************************************************** */
/* Transaction Reply Lists (TRL) Control Word structure */
#define I2O_TRL_FLAGS_SINGLE_FIXED_LENGTH 0x00
#define I2O_TRL_FLAGS_SINGLE_VARIABLE_LENGTH 0x40
#define I2O_TRL_FLAGS_MULTIPLE_FIXED_LENGTH 0x80
typedef struct i2o_trl_control_word {
#endif
/* ************************************************************************** */
/* I2O Successful Single Transaction Reply Message Frame structure. */
typedef struct i2o_single_reply_message_frame {
/* ReplyPayload */
/* ************************************************************************** */
/* I2O Successful Multiple Transaction Reply Message Frame structure. */
typedef struct i2o_multiple_reply_message_frame {
/* TransactionDetails[] */
/* ************************************************************************** */
/* I2O Private Message Frame structure. */
typedef struct i2o_private_message_frame {
/* PrivatePayload[] */
/* ************************************************************************** */
/* Message Failure Severity Codes */
#define I2O_SEVERITY_FORMAT_ERROR 0x1
#define I2O_SEVERITY_PATH_ERROR 0x2
#define I2O_SEVERITY_PATH_STATE 0x4
#define I2O_SEVERITY_CONGESTION 0x8
/* Transport Failure Codes: Table 3-3 Mesasge Failure Codes */
#define I2O_FAILURE_CODE_TRANSPORT_SERVICE_SUSPENDED 0x81
#define I2O_FAILURE_CODE_TRANSPORT_SERVICE_TERMINATED 0x82
#define I2O_FAILURE_CODE_TRANSPORT_CONGESTION 0x83
#define I2O_FAILURE_CODE_TRANSPORT_FAIL 0x84
#define I2O_FAILURE_CODE_TRANSPORT_STATE_ERROR 0x85
#define I2O_FAILURE_CODE_TRANSPORT_TIME_OUT 0x86
#define I2O_FAILURE_CODE_TRANSPORT_ROUTING_FAILURE 0x87
#define I2O_FAILURE_CODE_TRANSPORT_INVALID_VERSION 0x88
#define I2O_FAILURE_CODE_TRANSPORT_INVALID_OFFSET 0x89
#define I2O_FAILURE_CODE_TRANSPORT_INVALID_MSG_FLAGS 0x8A
#define I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_SMALL 0x8B
#define I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_LARGE 0x8C
#define I2O_FAILURE_CODE_TRANSPORT_INVALID_TARGET_ID 0x8D
#define I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_ID 0x8E
#define I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_CONTEXT 0x8F
#define I2O_FAILURE_CODE_TRANSPORT_UNKNOWN_FAILURE 0xFF
/* IOP_ID and Severity sizes */
#define I2O_FAILCODE_SEVERITY_SZ 8
#define I2O_FAILCODE_CODE_SZ 8
/* I2O Transport Message Reply for Message Failure. */
#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)
typedef struct i2o_failure_reply_message_frame {
union {
struct {
} s;
uint16_t h;
} u1;
/* macros to access the bit field(s) */
#define get_reply_msg_FailingIOP_ID(p, hdl) \
((p)->u1.s.FailingIOP_ID)
#endif
#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)
typedef struct i2o_failure_reply_message_frame {
union {
struct {
} s;
uint16_t h;
} u1;
/* macros to access the bit field(s) */
#define get_reply_msg_FailingIOP_ID(p, hdl) \
#endif
/* I2O Transport Message Reply for Transaction Error. */
typedef struct i2o_transaction_error_reply_message_frame {
/* ************************************************************************** */
/* Misc. commonly used structures */
#define I2O_MAX_SERIAL_NUMBER_SZ 256
typedef struct i2o_serial_info {
/* ************************************************************************** */
/* Hardware Resource Table (HRT) and Logical Configuration Table (LCT) */
/* ************************************************************************** */
/* Bus Type Code defines */
#define I2O_LOCAL_BUS 0
#define I2O_ISA_BUS 1
#define I2O_EISA_BUS 2
#define I2O_PCI_BUS 4
#define I2O_PCMCIA_BUS 5
#define I2O_NUBUS_BUS 6
#define I2O_CARDBUS_BUS 7
#define I2O_OTHER_BUS 0x80
#define I2O_HRT_STATE_SZ 4
#define I2O_HRT_BUS_NUMBER_SZ 8
#define I2O_HRT_BUS_TYPE_SZ 8
/* Bus Structures */
/* PCI Bus */
typedef struct i2o_pci_bus_info {
/* Local Bus */
typedef struct i2o_local_bus_info {
/* ISA Bus */
typedef struct i2o_isa_bus_info {
/* EISA Bus */
typedef struct i2o_eisa_bus_info {
/* Other Bus */
typedef struct i2o_other_bus_info {
/* HRT Entry Block */
#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)
typedef struct i2o_hrt_entry {
union {
struct {
} s2;
} u2;
union {
/* PCI Bus */
/* Local Bus */
/* ISA Bus */
/* EISA Bus */
/* Other. */
} uBus;
/* macros to access the bit fields */
#endif
#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)
typedef struct i2o_hrt_entry {
union {
struct {
} s2;
} u2;
union {
/* PCI Bus */
/* Local Bus */
/* ISA Bus */
/* EISA Bus */
/* Other. */
} uBus;
/* macros to access the bit fields */
#define get_hrt_entry_ControllingTID(p, hdl) \
#define get_hrt_entry_AdapterState(p, hdl) \
#endif
/* I2O Hardware Resource Table structure. */
typedef struct i2o_hrt {
} i2o_hrt_t;
/* ************************************************************************** */
/* Logical Configuration Table */
/* ************************************************************************** */
/* I2O Logical Configuration Table structures. */
#define I2O_IDENTITY_TAG_SZ 8
/* I2O Logical Configuration Table Device Flags */
#define I2O_LCT_DEVICE_FLAGS_CONF_DIALOG_REQUEST 0x01
#define I2O_LCT_DEVICE_FLAGS_MORE_THAN_1_USER 0x02
#define I2O_LCT_DEVICE_FLAGS_PEER_SERVICE_DISABLED 0x10
#define I2O_LCT_DEVICE_FLAGS_MANAGEMENT_SERVICE_DISABLED 0x20
/* LCT Entry Block */
#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)
typedef struct i2o_lct_entry {
union {
struct {
} s1;
} u1;
union {
struct i2o_class_id {
} s4;
} u4;
union {
struct {
} s6;
} u6;
/* macros to access the bit fields */
#endif
#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)
typedef struct i2o_lct_entry {
union {
struct {
} s1;
} u1;
union {
struct i2o_class_id {
} s4;
} u4;
union {
struct {
} s6;
} u6;
/* macros to access the bit fields */
#define get_lct_entry_TableEntrySize(p, hdl) \
#define get_lct_entry_LocalTID(p, hdl) \
#define get_lct_entry_OrganizationID(p, hdl) \
#define get_lct_entry_Version(p, hdl) \
#define get_lct_entry_Class(p, hdl) \
#define get_lct_entry_ParentTID(p, hdl) \
#define get_lct_entry_UserTID(p, hdl) \
#endif
/* I2O Logical Configuration Table structure. */
#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)
typedef struct i2o_lct {
union {
struct {
} s1;
} u1;
} i2o_lct_t;
/* macros to access the bit fields */
#endif
#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)
typedef struct i2o_lct {
union {
struct {
} s1;
} u1;
} i2o_lct_t;
/* macros to access the bit fields */
#define get_lct_BootDeviceTID(p, hdl) \
#define get_lct_LctVer(p, hdl) \
#endif
/* ************************************************************************** */
/* Memory Addressing structures and defines. */
/* SglFlags defines. */
#define I2O_SGL_FLAGS_LAST_ELEMENT 0x80
#define I2O_SGL_FLAGS_END_OF_BUFFER 0x40
#define I2O_SGL_FLAGS_IGNORE_ELEMENT 0x00
#define I2O_SGL_FLAGS_TRANSPORT_ELEMENT 0x04
#define I2O_SGL_FLAGS_BIT_BUCKET_ELEMENT 0x08
#define I2O_SGL_FLAGS_IMMEDIATE_DATA_ELEMENT 0x0C
#define I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT 0x10
#define I2O_SGL_FLAGS_PAGE_LIST_ADDRESS_ELEMENT 0x20
#define I2O_SGL_FLAGS_CHAIN_POINTER_ELEMENT 0x30
#define I2O_SGL_FLAGS_LONG_TRANSACTION_ELEMENT 0x40
#define I2O_SGL_FLAGS_SHORT_TRANSACTION_ELEMENT 0x70
#define I2O_SGL_FLAGS_SGL_ATTRIBUTES_ELEMENT 0x7C
#define I2O_SGL_FLAGS_BC0 0x01
#define I2O_SGL_FLAGS_BC1 0x02
#define I2O_SGL_FLAGS_DIR 0x04
#define I2O_SGL_FLAGS_LOCAL_ADDRESS 0x08
#define I2O_SGL_FLAGS_CONTEXT_COUNT_MASK 0x03
#define I2O_SGL_FLAGS_ADDRESS_MODE_MASK 0x3C
#define I2O_SGL_FLAGS_NO_CONTEXT 0x00
/*
*
* typedef enum _SG_TYPE {
* INVALID,
* Ignore,
* TransportDetails,
* BitBucket,
* ImmediateData,
* Simple,
* PageList,
* ChainPointer,
* ShortTransaction,
* LongTransaction,
* SGLAttributes,
* } SG_TYPE, *PSG_TYPE;
*
*
* 0x00 Ignore;
* 0x04 TransportDetails;
* 0x08 BitBucket;
* 0x0C ImmediateData;
* 0x10 Simple;
* 0x14 Simple;
* 0x18 Simple;
* 0x1C Simple;
* 0x20 PageList;
* 0x24 PageList;
* 0x28 PageList;
* 0x2C PageList;
* 0x30 ChainPointer;
* 0x34 INVALID;
* 0x38 ChainPointer;
* 0x3C INVALID;
* 0x40 LongTransaction;
* 0x44 INVALID/ReservedLongFormat;
* 0x48 BitBucket;
* 0x4C ImmediateData;
* 0x50 Simple;
* 0x54 Simple;
* 0x58 Simple;
* 0x5C Simple;
* 0x60 PageList;
* 0x64 PageList;
* 0x68 PageList;
* 0x6C PageList;
* 0x70 ShortTransaction;
* 0x74 INVALID/ReservedShortFormat;
* 0x78 INVALID/ReservedShortFormat;
* 0X7C SGLATTRIBUTES;
*/
/* 32 Bit Context Field defines */
#define I2O_SGL_FLAGS_CONTEXT32_NULL 0x00
#define I2O_SGL_FLAGS_CONTEXT32_U32 0x01
#define I2O_SGL_FLAGS_CONTEXT32_U64 0x02
#define I2O_SGL_FLAGS_CONTEXT32_U96 0x03
#define I2O_SGL_FLAGS_CONTEXT32_NULL_SZ 0x00
#define I2O_SGL_FLAGS_CONTEXT32_U32_SZ 0x04
#define I2O_SGL_FLAGS_CONTEXT32_U64_SZ 0x08
#define I2O_SGL_FLAGS_CONTEXT32_U96_SZ 0x0C
/* 64 Bit Context Field defines */
#define I2O_SGL_FLAGS_CONTEXT64_NULL 0x00
#define I2O_SGL_FLAGS_CONTEXT64_U64 0x01
#define I2O_SGL_FLAGS_CONTEXT64_U128 0x02
#define I2O_SGL_FLAGS_CONTEXT64_U192 0x03
#define I2O_SGL_FLAGS_CONTEXT64_NULL_SZ 0x00
#define I2O_SGL_FLAGS_CONTEXT64_U64_SZ 0x08
#define I2O_SGL_FLAGS_CONTEXT64_U128_SZ 0x10
#define I2O_SGL_FLAGS_CONTEXT64_U192_SZ 0x18
/* SGL Attribute Element defines */
#define I2O_SGL_ATTRIBUTE_FLAGS_BIT_BUCKET_HINT 0x0400
#define I2O_SGL_ATTRIBUTE_FLAGS_IMMEDIATE_DATA_HINT 0x0200
#define I2O_SGL_ATTRIBUTE_FLAGS_LOCAL_ADDRESS_HINT 0x0100
#define I2O_SGL_ATTRIBUTE_FLAGS_32BIT_TRANSACTION 0x0000
#define I2O_SGL_ATTRIBUTE_FLAGS_64BIT_TRANSACTION 0x0004
#define I2O_SGL_ATTRIBUTE_FLAGS_32BIT_LOCAL_ADDRESS 0x0000
/* SG Size defines */
#define I2O_SG_COUNT_SZ 24
#define I2O_SG_FLAGS_SZ 8
/* Standard Flags and Count fields for SG Elements */
#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)
typedef union i2o_flags_count {
struct {
} flags_count;
#endif
#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)
typedef union i2o_flags_count {
struct {
} flags_count;
#define get_flags_count_Count(p, hdl) \
#define put_flags_count_Count(p, v, hdl) \
((uint32_t)(v) & 0xFFFFFF))
#define get_flags_count_Flags(p, hdl) \
#define put_flags_count_Flags(p, v, hdl) \
#endif
/* Bit Bucket Element */
typedef struct i2o_sge_bit_bucket_element {
/* Chain Addressing Scatter-Gather Element */
typedef struct i2o_sge_chain_element {
/* Chain Addressing with Context Scatter-Gather Element */
typedef struct i2o_sge_chain_context_element {
/* Ignore Scatter-Gather Element */
typedef struct i2o_sge_ignore_element {
/* Immediate Data Element */
typedef struct i2o_sge_immediate_data_element {
/* Immediate Data with Context Element */
typedef struct i2o_sge_immediate_data_context_element {
/* Long Transaction Parameters Element */
#if defined(_BIT_FIELDS_LTOH) && defined(_LITTLE_ENDIAN)
typedef struct i2o_sge_long_transaction_element {
union {
struct {
} s1;
} u1;
#define get_sge_long_LongElementLength(p, hdl) \
#define put_sge_long_LongElementLength(p, v, hdl) \
#define get_sge_long_Flags(p, hdl) \
#define put_sge_long_Flags(p, v, hdl) \
#endif
#if defined(_BIT_FIELDS_HTOL) && defined(_BIG_ENDIAN)
typedef struct i2o_sge_long_transaction_element {
union {
struct {
} s1;
} u1;
#define get_sge_long_LongElementLength(p, hdl) \
#define put_sge_long_LongElementLength(p, v, hdl) \
((uint32_t)(v) & 0xFFFFFF))
#define get_sge_long_Flags(p, hdl) \
#define put_sge_long_Flags(p, v, hdl) \
((uint32_t)(v) << 24))
#endif
/* Page List Scatter-Gather Element */
typedef struct i2o_sge_page_element {
/* Page List with Context Scatter-Gather Element */
typedef struct i2o_sge_page_context_element {
/* SGL Attribute Element */
typedef struct i2o_sge_sgl_attributes_element {
/* Short Transaction Parameters Element */
typedef struct i2o_sge_short_transaction_element {
/* Simple Addressing Scatter-Gather Element */
typedef struct i2o_sge_simple_element {
/* Simple Addressing with Context Scatter-Gather Element */
typedef struct i2o_sge_simple_context_element {
/* Transport Detail Element */
typedef struct i2o_sge_transport_element {
typedef struct i2o_sg_element {
union {
/* Bit Bucket Element */
/* Chain Addressing Element */
/* Chain Addressing with Context Element */
/* Ignore Scatter-Gather Element */
/* Immediate Data Element */
/* Immediate Data with Context Element */
/* Long Transaction Parameters Element */
/* Page List Element */
/* Page List with Context Element */
/* SGL Attribute Element */
/* Short Transaction Parameters Element */
/* Simple Addressing Element */
/* Simple Addressing with Context Element */
/* Transport Detail Element */
} u1;
/* ************************************************************************** */
/* Basic Parameter Group Access */
/* ************************************************************************** */
/* Operation Function Numbers */
#define I2O_PARAMS_OPERATION_FIELD_GET 0x0001
#define I2O_PARAMS_OPERATION_LIST_GET 0x0002
#define I2O_PARAMS_OPERATION_MORE_GET 0x0003
#define I2O_PARAMS_OPERATION_SIZE_GET 0x0004
#define I2O_PARAMS_OPERATION_TABLE_GET 0x0005
#define I2O_PARAMS_OPERATION_FIELD_SET 0x0006
#define I2O_PARAMS_OPERATION_LIST_SET 0x0007
#define I2O_PARAMS_OPERATION_ROW_ADD 0x0008
#define I2O_PARAMS_OPERATION_ROW_DELETE 0x0009
#define I2O_PARAMS_OPERATION_TABLE_CLEAR 0x000A
/* Operations List Header */
typedef struct i2o_param_operations_list_header {
/* Results List Header */
typedef struct i2o_param_results_list_header {
/* Read Operation Result Block Template Structure */
typedef struct i2o_param_read_operation_result {
/* Operations Results */
/* Pad (if any) */
/* ErrorInformation (if any) */
typedef struct i2o_table_read_operation_result {
/* Operations Results */
/* Pad (if any) */
/* ErrorInformation (if any) */
/* Error Information Template Structure */
typedef struct i2o_param_error_info_template {
/* List of Key Values (variable) */
/* Pad (if any) */
/* Operation Template for Specific Fields */
typedef struct i2o_param_operation_specific_template {
/* Pad (if any) */
/* Operation Template for All Fields */
typedef struct i2o_param_operation_all_template {
/* Pad (if any) */
/* Operation Template for All List Fields */
typedef struct i2o_param_operation_all_list_template {
/* Pad (if any) */
/* Modify Operation Result Block Template Structure */
typedef struct i2o_param_modify_operation_result {
/* ErrorInformation (if any) */
/* Operation Template for Row Delete */
typedef struct i2o_param_operation_row_delete_template {
/* Operation Template for Table Clear */
typedef struct i2o_param_operation_table_clear_template {
/* Status codes and Error Information for Parameter functions */
#define I2O_PARAMS_STATUS_SUCCESS 0x00
#define I2O_PARAMS_STATUS_BAD_KEY_ABORT 0x01
#define I2O_PARAMS_STATUS_BAD_KEY_CONTINUE 0x02
#define I2O_PARAMS_STATUS_BUFFER_FULL 0x03
#define I2O_PARAMS_STATUS_BUFFER_TOO_SMALL 0x04
#define I2O_PARAMS_STATUS_FIELD_UNREADABLE 0x05
#define I2O_PARAMS_STATUS_FIELD_UNWRITEABLE 0x06
#define I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS 0x07
#define I2O_PARAMS_STATUS_INVALID_GROUP_ID 0x08
#define I2O_PARAMS_STATUS_INVALID_OPERATION 0x09
#define I2O_PARAMS_STATUS_NO_KEY_FIELD 0x0A
#define I2O_PARAMS_STATUS_NO_SUCH_FIELD 0x0B
#define I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP 0x0C
#define I2O_PARAMS_STATUS_OPERATION_ERROR 0x0D
#define I2O_PARAMS_STATUS_SCALAR_ERROR 0x0E
#define I2O_PARAMS_STATUS_TABLE_ERROR 0x0F
#define I2O_PARAMS_STATUS_WRONG_GROUP_TYPE 0x10
/* ************************************************************************** */
/* GROUP Parameter Groups */
/* ************************************************************************** */
/* GROUP Configuration and Operating Structures and Defines */
/* Groups Numbers */
#define I2O_UTIL_PARAMS_DESCRIPTOR_GROUP_NO 0xF000
#define I2O_UTIL_PHYSICAL_DEVICE_TABLE_GROUP_NO 0xF001
#define I2O_UTIL_CLAIMED_TABLE_GROUP_NO 0xF002
#define I2O_UTIL_USER_TABLE_GROUP_NO 0xF003
#define I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_GROUP_NO 0xF005
#define I2O_UTIL_AUTHORIZED_USER_TABLE_GROUP_NO 0xF006
#define I2O_UTIL_DEVICE_IDENTITY_GROUP_NO 0xF100
#define I2O_UTIL_DDM_IDENTITY_GROUP_NO 0xF101
#define I2O_UTIL_USER_INFORMATION_GROUP_NO 0xF102
#define I2O_UTIL_SGL_OPERATING_LIMITS_GROUP_NO 0xF103
#define I2O_UTIL_SENSORS_GROUP_NO 0xF200
/* UTIL Group F000h - GROUP DESCRIPTORS Parameter Group */
#define I2O_UTIL_GROUP_PROPERTIES_GROUP_TABLE 0x01
#define I2O_UTIL_GROUP_PROPERTIES_ROW_ADDITION 0x02
#define I2O_UTIL_GROUP_PROPERTIES_ROW_DELETION 0x04
#define I2O_UTIL_GROUP_PROPERTIES_CLEAR_OPERATION 0x08
typedef struct i2o_util_group_descriptor_table {
/* UTIL Group F001h - Physical Device Table Parameter Group */
typedef struct i2o_util_physical_device_table {
/* UTIL Group F002h - Claimed Table Parameter Group */
typedef struct i2o_util_claimed_table {
/* UTIL Group F003h - User Table Parameter Group */
typedef struct i2o_util_user_table {
/* UTIL Group F005h - Private Message Extensions Parameter Group */
typedef struct i2o_util_private_message_extensions_table {
/* UTIL Group F006h - Authorized User Table Parameter Group */
typedef struct i2o_util_authorized_user_table {
/* UTIL Group F100h - Device Identity Parameter Group */
typedef struct i2o_util_device_identity_scalar {
/* UTIL Group F101h - DDM Identity Parameter Group */
typedef struct i2o_util_ddm_identity_scalar {
/* UTIL Group F102h - User Information Parameter Group */
#define I2O_USER_DEVICE_NAME_SZ 64
#define I2O_USER_SERVICE_NAME_SZ 64
#define I2O_USER_PHYSICAL_LOCATION_SZ 64
typedef struct i2o_util_user_information_scalar {
/* UTIL Group F103h - SGL Operating Limits Parameter Group */
typedef struct i2o_util_sgl_operating_limits_scalar {
/* UTIL Group F200h - Sensors Parameter Group */
#define I2O_SENSOR_COMPONENT_OTHER 0x00
#define I2O_SENSOR_COMPONENT_PLANAR_LOGIC_BOARD 0x01
#define I2O_SENSOR_COMPONENT_CPU 0x02
#define I2O_SENSOR_COMPONENT_CHASSIS 0x03
#define I2O_SENSOR_COMPONENT_POWER_SUPPLY 0x04
#define I2O_SENSOR_COMPONENT_STORAGE 0x05
#define I2O_SENSOR_COMPONENT_EXTERNAL 0x06
#define I2O_SENSOR_SENSOR_CLASS_ANALOG 0x00
#define I2O_SENSOR_SENSOR_CLASS_DIGITAL 0x01
#define I2O_SENSOR_SENSOR_TYPE_OTHER 0x00
#define I2O_SENSOR_SENSOR_TYPE_THERMAL 0x01
#define I2O_SENSOR_SENSOR_TYPE_DC_VOLTAGE 0x02
#define I2O_SENSOR_SENSOR_TYPE_AC_VOLTAGE 0x03
#define I2O_SENSOR_SENSOR_TYPE_DC_CURRENT 0x04
#define I2O_SENSOR_SENSOR_TYPE_AC_CURRENT 0x05
#define I2O_SENSOR_SENSOR_TYPE_DOOR_OPEN 0x06
#define I2O_SENSOR_SENSOR_TYPE_FAN_OPERATIONAL 0x07
#define I2O_SENSOR_SENSOR_STATE_NORMAL 0x00
#define I2O_SENSOR_SENSOR_STATE_ABNORMAL 0x01
#define I2O_SENSOR_SENSOR_STATE_UNKNOWN 0x02
#define I2O_SENSOR_SENSOR_STATE_LOW_CAT 0x03
#define I2O_SENSOR_SENSOR_STATE_LOW 0x04
#define I2O_SENSOR_SENSOR_STATE_LOW_WARNING 0x05
#define I2O_SENSOR_SENSOR_STATE_HIGH_WARNING 0x06
#define I2O_SENSOR_SENSOR_STATE_HIGH 0x07
#define I2O_SENSOR_SENSOR_STATE_HIGH_CAT 0x08
#define I2O_SENSOR_EVENT_ENABLE_STATE_CHANGE 0x0001
#define I2O_SENSOR_EVENT_ENABLE_LOW_CATASTROPHIC 0x0002
#define I2O_SENSOR_EVENT_ENABLE_LOW_READING 0x0004
#define I2O_SENSOR_EVENT_ENABLE_LOW_WARNING 0x0008
#define I2O_SENSOR_EVENT_ENABLE_CHANGE_TO_NORMAL 0x0010
#define I2O_SENSOR_EVENT_ENABLE_HIGH_WARNING 0x0020
#define I2O_SENSOR_EVENT_ENABLE_HIGH_READING 0x0040
#define I2O_SENSOR_EVENT_ENABLE_HIGH_CATASTROPHIC 0x0080
typedef struct i2o_util_sensors_table {
/*
* *************************************************************************
* Definitions used in Solaris for I2O Framework support.
*
* (NOTE: Current commitment level is PROJECT PRIVATE.)
* *************************************************************************
*/
#define I2O_MSG_SLEEP DDI_DMA_SLEEP
#define I2O_MSG_DONTWAIT DDI_DMA_DONTWAIT
typedef void *i2o_iop_handle_t;
typedef void *i2o_msg_handle_t;
/*
* PCI Extensions to I2O Spec 1.5.
*
* (Note: Should these definitons go into pci.h?)
*/
#define PCI_I2O_BASE_CLASS 0x0E
#define PCI_I2O_SUB_CLASS 0x00
/* Offset definitions for FIFO registers in IOP's shared memory */
#define PCI_IOP_INBOUND_FREELIST_FIFO 0x40
#define PCI_IOP_INBOUND_POSTLIST_FIFO 0x40
#define PCI_IOP_OUTBOUND_FREELIST_FIFO 0x44
#define PCI_IOP_OUTBOUND_POSTLIST_FIFO 0x44
/* Offset definitions for Interrupt Control registers in IOP's shared memory */
#define PCI_IOP_INTR_MASK_REG 0x34
#define PCI_IOP_INTR_STATUS_REG 0x30
/* Bit definitions in Interrupt Mask Register */
#define I2O_OUTBOUND_POSTLIST_SERVICE_INTR_MASK 0x08
#ifdef __cplusplus
}
#endif
#endif /* _SYS_I2OMSG_H */