root/dev/i2o/i2o.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


    1 /*      $OpenBSD: i2o.h,v 1.7 2004/04/12 22:12:32 jmc Exp $     */
    2 /*      $NetBSD: i2o.h,v 1.3 2001/03/20 13:01:48 ad Exp $       */
    3 
    4 /*-
    5  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
    6  * All rights reserved.
    7  *
    8  * This code is derived from software contributed to The NetBSD Foundation
    9  * by Andrew Doran.
   10  *
   11  * Redistribution and use in source and binary forms, with or without
   12  * modification, are permitted provided that the following conditions
   13  * are met:
   14  * 1. Redistributions of source code must retain the above copyright
   15  *    notice, this list of conditions and the following disclaimer.
   16  * 2. Redistributions in binary form must reproduce the above copyright
   17  *    notice, this list of conditions and the following disclaimer in the
   18  *    documentation and/or other materials provided with the distribution.
   19  * 3. All advertising materials mentioning features or use of this software
   20  *    must display the following acknowledgement:
   21  *        This product includes software developed by the NetBSD
   22  *        Foundation, Inc. and its contributors.
   23  * 4. Neither the name of The NetBSD Foundation nor the names of its
   24  *    contributors may be used to endorse or promote products derived
   25  *    from this software without specific prior written permission.
   26  *
   27  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
   28  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
   29  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   30  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
   31  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   37  * POSSIBILITY OF SUCH DAMAGE.
   38  */
   39 
   40 /*
   41  * Structures and constants, as presented by the I2O specification revision
   42  * 1.5 (obtainable from http://www.intelligent-io.com/).  Currently, only
   43  * what's useful to us is defined in this file.
   44  */
   45 
   46 #ifndef _I2O_I2O_H_
   47 #define _I2O_I2O_H_
   48 
   49 /*
   50  * ================= Miscellaneous definitions =================
   51  */
   52 
   53 /* Organisation IDs */
   54 #define I2O_ORG_DPT                     0x001b
   55 #define I2O_ORG_INTEL                   0x0028
   56 #define I2O_ORG_AMI                     0x1000
   57 
   58 /* Macros to assist in building message headers */
   59 #define I2O_MSGFLAGS(s)         (I2O_VERSION_11 | (sizeof(struct s) << 14))
   60 #define I2O_MSGFUNC(t, f)       ((t) | (I2O_TID_HOST << 12) | ((f) << 24))
   61 
   62 /* Common message function codes with no payload or an undefined payload */
   63 #define I2O_UTIL_NOP                    0x00
   64 #define I2O_EXEC_IOP_CLEAR              0xbe
   65 #define I2O_EXEC_SYS_QUIESCE            0xc3
   66 #define I2O_EXEC_SYS_ENABLE             0xd1
   67 #define I2O_PRIVATE_MESSAGE             0xff
   68 
   69 /* Device class codes */
   70 #define I2O_CLASS_EXECUTIVE                     0x00
   71 #define I2O_CLASS_DDM                           0x01
   72 #define I2O_CLASS_RANDOM_BLOCK_STORAGE          0x10
   73 #define I2O_CLASS_SEQUENTIAL_STORAGE            0x11
   74 #define I2O_CLASS_LAN                           0x20
   75 #define I2O_CLASS_WAN                           0x30
   76 #define I2O_CLASS_FIBRE_CHANNEL_PORT            0x40
   77 #define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL      0x41
   78 #define I2O_CLASS_SCSI_PERIPHERAL               0x51
   79 #define I2O_CLASS_ATE_PORT                      0x60
   80 #define I2O_CLASS_ATE_PERIPHERAL                0x61
   81 #define I2O_CLASS_FLOPPY_CONTROLLER             0x70
   82 #define I2O_CLASS_FLOPPY_DEVICE                 0x71
   83 #define I2O_CLASS_BUS_ADAPTER_PORT              0x80
   84 #define I2O_CLASS_MASK                          0xfff
   85 
   86 #define I2O_CLASS_ANY                           0xffffffff
   87 
   88 /* Reply status codes */
   89 #define I2O_STATUS_SUCCESS                      0x00
   90 #define I2O_STATUS_ABORT_DIRTY                  0x01
   91 #define I2O_STATUS_ABORT_NO_DATA_XFER           0x02
   92 #define I2O_STATUS_ABORT_PARTIAL_XFER           0x03
   93 #define I2O_STATUS_ERROR_DIRTY                  0x04
   94 #define I2O_STATUS_ERROR_NO_DATA_XFER           0x05
   95 #define I2O_STATUS_ERROR_PARTIAL_XFER           0x06
   96 #define I2O_STATUS_PROCESS_ABORT_DIRTY          0x08
   97 #define I2O_STATUS_PROCESS_ABORT_NO_DATA_XFER   0x09
   98 #define I2O_STATUS_PROCESS_ABORT_PARTIAL_XFER   0x0a
   99 #define I2O_STATUS_TRANSACTION_ERROR            0x0b
  100 #define I2O_STATUS_PROGRESS_REPORT              0x80
  101 
  102 /* Detailed status codes */
  103 #define I2O_DSC_SUCCESS                         0x00
  104 #define I2O_DSC_BAD_KEY                         0x02
  105 #define I2O_DSC_TCL_ERROR                       0x03
  106 #define I2O_DSC_REPLY_BUFFER_FULL               0x04
  107 #define I2O_DSC_NO_SUCH_PAGE                    0x05
  108 #define I2O_DSC_INSUFFICIENT_RESOURCE_SOFT      0x06
  109 #define I2O_DSC_INSUFFICIENT_RESOURCE_HARD      0x07
  110 #define I2O_DSC_CHAIN_BUFFER_TOO_LARGE          0x09
  111 #define I2O_DSC_UNSUPPORTED_FUNCTION            0x0a
  112 #define I2O_DSC_DEVICE_LOCKED                   0x0b
  113 #define I2O_DSC_DEVICE_RESET                    0x0c
  114 #define I2O_DSC_INAPPROPRIATE_FUNCTION          0x0d
  115 #define I2O_DSC_INVALID_INITIATOR_ADDRESS       0x0e
  116 #define I2O_DSC_INVALID_MESSAGE_FLAGS           0x0f
  117 #define I2O_DSC_INVALID_OFFSET                  0x10
  118 #define I2O_DSC_INVALID_PARAMETER               0x11
  119 #define I2O_DSC_INVALID_REQUEST                 0x12
  120 #define I2O_DSC_INVALID_TARGET_ADDRESS          0x13
  121 #define I2O_DSC_MESSAGE_TOO_LARGE               0x14
  122 #define I2O_DSC_MESSAGE_TOO_SMALL               0x15
  123 #define I2O_DSC_MISSING_PARAMETER               0x16
  124 #define I2O_DSC_TIMEOUT                         0x17
  125 #define I2O_DSC_UNKNOWN_ERROR                   0x18
  126 #define I2O_DSC_UNKNOWN_FUNCTION                0x19
  127 #define I2O_DSC_UNSUPPORTED_VERSION             0x1a
  128 #define I2O_DSC_DEVICE_BUSY                     0x1b
  129 #define I2O_DSC_DEVICE_NOT_AVAILABLE            0x1c
  130 
  131 /* Message versions */
  132 #define I2O_VERSION_10                  0x00
  133 #define I2O_VERSION_11                  0x01
  134 #define I2O_VERSION_20                  0x02
  135 
  136 /* Commonly used TIDs */
  137 #define I2O_TID_IOP                     0
  138 #define I2O_TID_HOST                    1
  139 #define I2O_TID_NONE                    4095
  140 
  141 /* SGL flags.  This list covers only a fraction of the possibilities. */
  142 #define I2O_SGL_IGNORE                  0x00000000
  143 #define I2O_SGL_SIMPLE                  0x10000000
  144 #define I2O_SGL_PAGE_LIST               0x20000000
  145 
  146 #define I2O_SGL_BC_32BIT                0x01000000
  147 #define I2O_SGL_BC_64BIT                0x02000000
  148 #define I2O_SGL_BC_96BIT                0x03000000
  149 #define I2O_SGL_DATA_OUT                0x04000000
  150 #define I2O_SGL_END_BUFFER              0x40000000
  151 #define I2O_SGL_END                     0x80000000
  152 
  153 /* Serial number formats */
  154 #define I2O_SNFMT_UNKNOWN               0
  155 #define I2O_SNFMT_BINARY                1
  156 #define I2O_SNFMT_ASCII                 2
  157 #define I2O_SNFMT_UNICODE               3
  158 #define I2O_SNFMT_LAN_MAC               4
  159 #define I2O_SNFMT_WAN_MAC               5
  160 
  161 /*
  162  * ================= Common structures =================
  163  */
  164 
  165 /*
  166  * Standard I2O message frame.  All message frames begin with this.
  167  *
  168  * Bits  Field          Meaning
  169  * ----  -------------  ----------------------------------------------------
  170  * 0-2   msgflags       Message header version. Must be 001 (little endian).
  171  * 3     msgflags       Reserved.
  172  * 4-7   msgflags       Offset to SGLs expressed as # of 32-bit words.
  173  * 8-15  msgflags       Control flags.
  174  * 16-31 msgflags       Message frame size expressed as # of 32-bit words.
  175  * 0-11  msgfunc        TID of target.
  176  * 12-23 msgfunc        TID of initiator.
  177  * 24-31 msgfunc        Function (i.e., type of message).
  178  */
  179 struct i2o_msg {
  180         u_int32_t       msgflags;
  181         u_int32_t       msgfunc;
  182         u_int32_t       msgictx;        /* Initiator context */
  183         u_int32_t       msgtctx;        /* Transaction context */
  184 
  185         /* Message payload */
  186 
  187 } __attribute__ ((__packed__));
  188 
  189 #define I2O_MSGFLAGS_STATICMF           0x0100
  190 #define I2O_MSGFLAGS_64BIT              0x0200
  191 #define I2O_MSGFLAGS_MULTI              0x1000
  192 #define I2O_MSGFLAGS_FAIL               0x2000
  193 #define I2O_MSGFLAGS_LAST_REPLY         0x4000
  194 #define I2O_MSGFLAGS_REPLY              0x8000
  195 
  196 /*
  197  * Standard reply frame.  msgflags, msgfunc, msgictx and msgtctx have the
  198  * same meaning as in `struct i2o_msg'.
  199  */
  200 struct i2o_reply {
  201         u_int32_t       msgflags;
  202         u_int32_t       msgfunc;
  203         u_int32_t       msgictx;
  204         u_int32_t       msgtctx;
  205         u_int16_t       detail;         /* Detailed status code */
  206         u_int8_t        reserved;
  207         u_int8_t        reqstatus;      /* Request status code */
  208 
  209         /* Reply payload */
  210 
  211 } __attribute__ ((__packed__));
  212 
  213 /*
  214  * Fault notification reply, returned when a message frame can not be
  215  * processed (i.e I2O_MSGFLAGS_FAIL is set in the reply).
  216  */
  217 struct i2o_fault_notify {
  218         u_int32_t       msgflags;
  219         u_int32_t       msgfunc;
  220         u_int32_t       msgictx;
  221         u_int32_t       msgtctx;        /* Not valid! */
  222         u_int8_t        lowestver;
  223         u_int8_t        highestver;
  224         u_int8_t        severity;
  225         u_int8_t        failurecode;
  226         u_int16_t       failingiop;     /* Bits 0-12 only */
  227         u_int16_t       failinghostunit;
  228         u_int32_t       agelimit;
  229         u_int32_t       lowmfa;
  230         u_int32_t       highmfa;
  231 };
  232 
  233 /*
  234  * Hardware resource table.  Not documented here.
  235  */
  236 struct i2o_hrt_entry {
  237         u_int32_t       adapterid;
  238         u_int16_t       controllingtid;
  239         u_int8_t        busnumber;
  240         u_int8_t        bustype;
  241         u_int8_t        businfo[8];
  242 } __attribute__ ((__packed__));
  243 
  244 struct i2o_hrt {
  245         u_int16_t       numentries;
  246         u_int8_t        entrysize;
  247         u_int8_t        hrtversion;
  248         u_int32_t       changeindicator;
  249         struct i2o_hrt_entry    entry[1];
  250 } __attribute__ ((__packed__));
  251 
  252 /*
  253  * Logical configuration table entry.  Bitfields are broken down as follows:
  254  *
  255  * Bits   Field           Meaning
  256  * -----  --------------  ---------------------------------------------------
  257  *  0-11  classid         Class ID.
  258  * 12-15  classid         Class version.
  259  *  0-11  usertid         User TID
  260  * 12-23  usertid         Parent TID.
  261  * 24-31  usertid         BIOS info.
  262  */
  263 struct i2o_lct_entry {
  264         u_int16_t       entrysize;
  265         u_int16_t       localtid;               /* Bits 0-12 only */
  266 #define I2O_LCT_ENTRY_TID_MASK  0xfff
  267         u_int32_t       changeindicator;
  268         u_int32_t       deviceflags;
  269         u_int16_t       classid;
  270         u_int16_t       orgid;
  271         u_int32_t       subclassinfo;
  272         u_int32_t       usertid;
  273         u_int8_t        identitytag[8];
  274         u_int32_t       eventcaps;
  275 } __attribute__ ((__packed__));
  276 
  277 /*
  278  * Logical configuration table header.
  279  */
  280 struct i2o_lct {
  281         u_int16_t       tablesize;
  282         u_int16_t       flags;
  283         u_int32_t       iopflags;
  284         u_int32_t       changeindicator;
  285         struct i2o_lct_entry    entry[1];
  286 } __attribute__ ((__packed__));
  287 
  288 /*
  289  * IOP system table.  Bitfields are broken down as follows:
  290  *
  291  * Bits   Field           Meaning
  292  * -----  --------------  ---------------------------------------------------
  293  *  0-11  iopid           IOP ID.
  294  * 12-31  iopid           Reserved.
  295  *  0-11  segnumber       Segment number.
  296  * 12-15  segnumber       I2O version.
  297  * 16-23  segnumber       IOP state.
  298  * 24-31  segnumber       Messenger type.
  299  */
  300 struct i2o_systab_entry {
  301         u_int16_t       orgid;
  302         u_int16_t       reserved0;
  303         u_int32_t       iopid;
  304         u_int32_t       segnumber;
  305         u_int16_t       inboundmsgframesize;
  306         u_int16_t       reserved1;
  307         u_int32_t       lastchanged;
  308         u_int32_t       iopcaps;
  309         u_int32_t       inboundmsgportaddresslow;
  310         u_int32_t       inboundmsgportaddresshigh;
  311 } __attribute__ ((__packed__));
  312 
  313 struct i2o_systab {
  314         u_int8_t        numentries;
  315         u_int8_t        version;
  316         u_int16_t       reserved0;
  317         u_int32_t       changeindicator;
  318         u_int32_t       reserved1[2];
  319         struct  i2o_systab_entry entry[1];
  320 } __attribute__ ((__packed__));
  321 
  322 /*
  323  * IOP status record.  Bitfields are broken down as follows:
  324  *
  325  * Bits   Field           Meaning
  326  * -----  --------------  ---------------------------------------------------
  327  *  0-11  iopid           IOP ID.
  328  * 12-15  iopid           Reserved.
  329  * 16-31  iopid           Host unit ID.
  330  *  0-11  segnumber       Segment number.
  331  * 12-15  segnumber       I2O version.
  332  * 16-23  segnumber       IOP state.
  333  * 24-31  segnumber       Messenger type.
  334  */
  335 struct i2o_status {
  336         u_int16_t       orgid;
  337         u_int16_t       reserved0;
  338         u_int32_t       iopid;
  339         u_int32_t       segnumber;
  340         u_int16_t       inboundmframesize;
  341         u_int8_t        initcode;
  342         u_int8_t        reserved1;
  343         u_int32_t       maxinboundmframes;
  344         u_int32_t       currentinboundmframes;
  345         u_int32_t       maxoutboundmframes;
  346         u_int8_t        productid[24];
  347         u_int32_t       expectedlctsize;
  348         u_int32_t       iopcaps;
  349         u_int32_t       desiredprivmemsize;
  350         u_int32_t       currentprivmemsize;
  351         u_int32_t       currentprivmembase;
  352         u_int32_t       desiredpriviosize;
  353         u_int32_t       currentpriviosize;
  354         u_int32_t       currentpriviobase;
  355         u_int8_t        reserved2[3];
  356         u_int8_t        syncbyte;
  357 } __attribute__ ((__packed__));
  358 
  359 #define I2O_IOP_STATE_INITIALIZING              0x01
  360 #define I2O_IOP_STATE_RESET                     0x02
  361 #define I2O_IOP_STATE_HOLD                      0x04
  362 #define I2O_IOP_STATE_READY                     0x05
  363 #define I2O_IOP_STATE_OPERATIONAL               0x08
  364 #define I2O_IOP_STATE_FAILED                    0x10
  365 #define I2O_IOP_STATE_FAULTED                   0x11
  366 
  367 /*
  368  * ================= Executive class messages =================
  369  */
  370 
  371 #define I2O_EXEC_STATUS_GET             0xa0
  372 struct i2o_exec_status_get {
  373         u_int32_t       msgflags;
  374         u_int32_t       msgfunc;
  375         u_int32_t       reserved[4];
  376         u_int32_t       addrlow;
  377         u_int32_t       addrhigh;
  378         u_int32_t       length;
  379 } __attribute__ ((__packed__));
  380 
  381 #define I2O_EXEC_OUTBOUND_INIT          0xa1
  382 struct i2o_exec_outbound_init {
  383         u_int32_t       msgflags;
  384         u_int32_t       msgfunc;
  385         u_int32_t       msgictx;
  386         u_int32_t       msgtctx;
  387         u_int32_t       pagesize;
  388         u_int32_t       flags;          /* init code, outbound msg size */
  389 } __attribute__ ((__packed__));
  390 
  391 #define I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS      1
  392 #define I2O_EXEC_OUTBOUND_INIT_REJECTED         2
  393 #define I2O_EXEC_OUTBOUND_INIT_FAILED           3
  394 #define I2O_EXEC_OUTBOUND_INIT_COMPLETE         4
  395 
  396 #define I2O_EXEC_LCT_NOTIFY             0xa2
  397 struct i2o_exec_lct_notify {
  398         u_int32_t       msgflags;
  399         u_int32_t       msgfunc;
  400         u_int32_t       msgictx;
  401         u_int32_t       msgtctx;
  402         u_int32_t       classid;
  403         u_int32_t       changeindicator;
  404 } __attribute__ ((__packed__));
  405 
  406 #define I2O_EXEC_SYS_TAB_SET            0xa3
  407 struct i2o_exec_sys_tab_set {
  408         u_int32_t       msgflags;
  409         u_int32_t       msgfunc;
  410         u_int32_t       msgictx;
  411         u_int32_t       msgtctx;
  412         u_int32_t       iopid;
  413         u_int32_t       segnumber;
  414 } __attribute__ ((__packed__));
  415 
  416 #define I2O_EXEC_HRT_GET                0xa8
  417 struct i2o_exec_hrt_get {
  418         u_int32_t       msgflags;
  419         u_int32_t       msgfunc;
  420         u_int32_t       msgictx;
  421         u_int32_t       msgtctx;
  422 } __attribute__ ((__packed__));
  423 
  424 #define I2O_EXEC_IOP_RESET              0xbd
  425 struct i2o_exec_iop_reset {
  426         u_int32_t       msgflags;
  427         u_int32_t       msgfunc;
  428         u_int32_t       reserved[4];
  429         u_int32_t       statuslow;
  430         u_int32_t       statushigh;
  431 } __attribute__ ((__packed__));
  432 
  433 #define I2O_RESET_IN_PROGRESS           0x01
  434 #define I2O_RESET_REJECTED              0x02
  435 
  436 /*
  437  * ================= Executive class parameter groups =================
  438  */
  439  
  440 #define I2O_PARAM_EXEC_LCT_SCALAR       0x0101
  441 #define I2O_PARAM_EXEC_LCT_TABLE        0x0102
  442 
  443 /*
  444  * ================= HBA class messages =================
  445  */
  446 
  447 #define I2O_HBA_BUS_SCAN                0x89
  448 struct i2o_hba_bus_scan {
  449         u_int32_t       msgflags;
  450         u_int32_t       msgfunc;
  451         u_int32_t       msgictx;
  452         u_int32_t       msgtctx;
  453 } __attribute__ ((__packed__));
  454 
  455 /*
  456  * ================= HBA class parameter groups =================
  457  */
  458 
  459 #define I2O_PARAM_HBA_CTLR_INFO         0x0000
  460 struct i2o_param_hba_ctlr_info {
  461         u_int8_t        bustype;
  462         u_int8_t        busstate;
  463         u_int16_t       reserved;
  464         u_int8_t        busname[12];
  465 } __attribute__ ((__packed__));
  466 
  467 #define I2O_HBA_BUS_GENERIC             0x00
  468 #define I2O_HBA_BUS_SCSI                0x01
  469 #define I2O_HBA_BUS_FCA                 0x10
  470 
  471 #define I2O_PARAM_HBA_SCSI_PORT_INFO    0x0001
  472 struct i2o_param_hba_scsi_port_info {
  473         u_int8_t        physicalif;
  474 #define I2O_PARAM_HBA_SCSI_PORT_GENERIC 0x01
  475 #define I2O_PARAM_HBA_SCSI_PORT_UNKNOWN 0x02
  476 #define I2O_PARAM_HBA_SCSI_PORT_PARINTF 0x03
  477 #define I2O_PARAM_HBA_SCSI_PORT_FCL     0x04
  478 #define I2O_PARAM_HBA_SCSI_PORT_1394    0x05
  479 #define I2O_PARAM_HBA_SCSI_PORT_SSA     0x06
  480         u_int8_t        electricalif;
  481 #define I2O_PARAM_HBA_SCSI_PORT_SE      0x03
  482 #define I2O_PARAM_HBA_SCSI_PORT_DIFF    0x04
  483 #define I2O_PARAM_HBA_SCSI_PORT_LVD     0x05
  484 #define I2O_PARAM_HBA_SCSI_PORT_OPTCL   0x06
  485         u_int8_t        isosynchonrous;
  486         u_int8_t        connectortype;
  487 #define I2O_PARAM_HBA_SCSI_PORT_HDBS50  0x04
  488 #define I2O_PARAM_HBA_SCSI_PORT_HDBU50  0x05
  489 #define I2O_PARAM_HBA_SCSI_PORT_DBS50   0x06
  490 #define I2O_PARAM_HBA_SCSI_PORT_DBU50   0x07
  491 #define I2O_PARAM_HBA_SCSI_PORT_HDBS68  0x08
  492 #define I2O_PARAM_HBA_SCSI_PORT_HDBU68  0x09
  493 #define I2O_PARAM_HBA_SCSI_PORT_SCA1    0x0a
  494 #define I2O_PARAM_HBA_SCSI_PORT_SCA2    0x0b
  495 #define I2O_PARAM_HBA_SCSI_PORT_FCDB9   0x0c
  496 #define I2O_PARAM_HBA_SCSI_PORT_FC      0x0d
  497 #define I2O_PARAM_HBA_SCSI_PORT_FCSCA40 0x0e
  498 #define I2O_PARAM_HBA_SCSI_PORT_FCSCA20 0x0f
  499 #define I2O_PARAM_HBA_SCSI_PORT_FCBNC   0x10
  500         u_int8_t        connectorgender;
  501 #define I2O_PARAM_HBA_SCSI_PORT_FEMALE  0x03
  502 #define I2O_PARAM_HBA_SCSI_PORT_MALE    0x04
  503         u_int8_t        reserved1;
  504         u_int16_t       reserved2;
  505         u_int32_t       maxnumberofdevices;
  506 } __attribute__ ((__packed__));
  507 
  508 #define I2O_PARAM_HBA_SCSI_CTLR_INFO    0x0200
  509 struct i2o_param_hba_scsi_ctlr_info {
  510         u_int8_t        scsitype;
  511 #define I2O_PARAM_HBA_SCSI_CTRL_SCSI0   0x00
  512 #define I2O_PARAM_HBA_SCSI_CTRL_SCSI1   0x01
  513 #define I2O_PARAM_HBA_SCSI_CTRL_SCSI2   0x02
  514 #define I2O_PARAM_HBA_SCSI_CTRL_SCSI3   0x03
  515         u_int8_t        protection;
  516         u_int8_t        settings;
  517         u_int8_t        reserved;
  518         u_int32_t       initiatorid;
  519         u_int64_t       scanlun0only;
  520         u_int16_t       disabledevice;
  521         u_int8_t        maxoffset;
  522         u_int8_t        maxdatawidth;
  523         u_int64_t       maxsyncrate;
  524 } __attribute__ ((__packed__));
  525 
  526 
  527 /*
  528  * ================= Utility messages =================
  529  */
  530 
  531 #define I2O_UTIL_ABORT                  0x01
  532 struct i2o_util_abort {
  533         u_int32_t       msgflags;
  534         u_int32_t       msgfunc;
  535         u_int32_t       msgictx;
  536         u_int32_t       msgtctx;
  537         u_int32_t       flags;          /* abort type and function type */
  538         u_int32_t       tctxabort;
  539 } __attribute__ ((__packed__));
  540 
  541 #define I2O_UTIL_ABORT_EXACT            0x00000000
  542 #define I2O_UTIL_ABORT_FUNCTION         0x00010000
  543 #define I2O_UTIL_ABORT_TRANSACTION      0x00020000
  544 #define I2O_UTIL_ABORT_WILD             0x00030000
  545 
  546 #define I2O_UTIL_ABORT_CLEAN            0x00040000
  547 
  548 struct i2o_util_abort_reply {
  549         u_int32_t       msgflags;
  550         u_int32_t       msgfunc;
  551         u_int32_t       msgictx;
  552         u_int32_t       msgtctx;
  553         u_int32_t       count;
  554 } __attribute__ ((__packed__));
  555 
  556 #define I2O_UTIL_PARAMS_SET             0x05 
  557 #define I2O_UTIL_PARAMS_GET             0x06
  558 struct i2o_util_params_op {
  559         u_int32_t       msgflags;
  560         u_int32_t       msgfunc;
  561         u_int32_t       msgictx;
  562         u_int32_t       msgtctx;
  563         u_int32_t       flags;
  564 } __attribute__ ((__packed__));
  565 
  566 #define I2O_PARAMS_OP_FIELD_GET         1
  567 #define I2O_PARAMS_OP_LIST_GET          2
  568 #define I2O_PARAMS_OP_MORE_GET          3
  569 #define I2O_PARAMS_OP_SIZE_GET          4
  570 #define I2O_PARAMS_OP_TABLE_GET         5
  571 #define I2O_PARAMS_OP_FIELD_SET         6
  572 #define I2O_PARAMS_OP_LIST_SET          7
  573 #define I2O_PARAMS_OP_ROW_ADD           8
  574 #define I2O_PARAMS_OP_ROW_DELETE        9
  575 #define I2O_PARAMS_OP_TABLE_CLEAR       10
  576 
  577 struct i2o_param_op_list_header {
  578         u_int16_t       count;
  579         u_int16_t       reserved;
  580 } __attribute__ ((__packed__));
  581 
  582 struct i2o_param_op_all_template {
  583         u_int16_t       operation;
  584         u_int16_t       group;
  585         u_int16_t       fieldcount;
  586         u_int16_t       fields[1];
  587 } __attribute__ ((__packed__));
  588 
  589 struct i2o_param_op_results {
  590         u_int16_t       count;
  591         u_int16_t       reserved;
  592 } __attribute__ ((__packed__));
  593 
  594 struct i2o_param_read_results {
  595         u_int16_t       blocksize;
  596         u_int8_t        blockstatus;
  597         u_int8_t        errorinfosize;
  598 } __attribute__ ((__packed__));
  599 
  600 struct i2o_param_table_results {
  601         u_int16_t       blocksize;
  602         u_int8_t        blockstatus;
  603         u_int8_t        errorinfosize;
  604         u_int16_t       rowcount;
  605         u_int16_t       moreflag;
  606 } __attribute__ ((__packed__));
  607 
  608 #define I2O_UTIL_CLAIM                  0x09
  609 struct i2o_util_claim {
  610         u_int32_t       msgflags;
  611         u_int32_t       msgfunc;
  612         u_int32_t       msgictx;
  613         u_int32_t       msgtctx;
  614         u_int32_t       flags;
  615 } __attribute__ ((__packed__));
  616 
  617 #define I2O_UTIL_CLAIM_RESET_SENSITIVE          0x00000002
  618 #define I2O_UTIL_CLAIM_STATE_SENSITIVE          0x00000004
  619 #define I2O_UTIL_CLAIM_CAPACITY_SENSITIVE       0x00000008
  620 #define I2O_UTIL_CLAIM_NO_PEER_SERVICE          0x00000010
  621 #define I2O_UTIL_CLAIM_NO_MANAGEMENT_SERVICE    0x00000020
  622 
  623 #define I2O_UTIL_CLAIM_PRIMARY_USER             0x01000000
  624 #define I2O_UTIL_CLAIM_AUTHORIZED_USER          0x02000000
  625 #define I2O_UTIL_CLAIM_SECONDARY_USER           0x03000000
  626 #define I2O_UTIL_CLAIM_MANAGEMENT_USER          0x04000000
  627 
  628 #define I2O_UTIL_CLAIM_RELEASE          0x0b
  629 struct i2o_util_claim_release {
  630         u_int32_t       msgflags;
  631         u_int32_t       msgfunc;
  632         u_int32_t       msgictx;
  633         u_int32_t       msgtctx;
  634         u_int32_t       flags;          /* User flags as per I2O_UTIL_CLAIM */
  635 } __attribute__ ((__packed__));
  636 
  637 #define I2O_UTIL_CLAIM_RELEASE_CONDITIONAL      0x00000001
  638 
  639 #define I2O_UTIL_CONFIG_DIALOG          0x10
  640 struct i2o_util_config_dialog {
  641         u_int32_t       msgflags;
  642         u_int32_t       msgfunc;
  643         u_int32_t       msgictx;
  644         u_int32_t       msgtctx;
  645         u_int32_t       pageno;
  646 } __attribute__ ((__packed__));
  647 
  648 #define I2O_UTIL_EVENT_REGISTER         0x13
  649 struct i2o_util_event_register {
  650         u_int32_t       msgflags;
  651         u_int32_t       msgfunc;
  652         u_int32_t       msgictx;
  653         u_int32_t       msgtctx;
  654         u_int32_t       eventmask;
  655 } __attribute__ ((__packed__));
  656 
  657 struct i2o_util_event_register_reply {
  658         u_int32_t       msgflags;
  659         u_int32_t       msgfunc;
  660         u_int32_t       msgictx;
  661         u_int32_t       msgtctx;
  662         u_int32_t       event;
  663         u_int32_t       eventdata[1];
  664 } __attribute__ ((__packed__));
  665 
  666 /* Generic events. */
  667 #define I2O_EVENT_GEN_DEVICE_STATE              0x00400000
  668 #define I2O_EVENT_GEN_VENDOR_EVENT              0x00800000
  669 #define I2O_EVENT_GEN_FIELD_MODIFIED            0x01000000
  670 #define I2O_EVENT_GEN_EVENT_MASK_MODIFIED       0x02000000
  671 #define I2O_EVENT_GEN_DEVICE_RESET              0x04000000
  672 #define I2O_EVENT_GEN_CAPABILITY_CHANGE         0x08000000
  673 #define I2O_EVENT_GEN_LOCK_RELEASE              0x10000000
  674 #define I2O_EVENT_GEN_NEED_CONFIGURATION        0x20000000
  675 #define I2O_EVENT_GEN_GENERAL_WARNING           0x40000000
  676 #define I2O_EVENT_GEN_STATE_CHANGE              0x80000000
  677 
  678 /* Executive class events. */
  679 #define I2O_EVENT_EXEC_RESOURCE_LIMITS          0x00000001
  680 #define I2O_EVENT_EXEC_CONNECTION_FAIL          0x00000002
  681 #define I2O_EVENT_EXEC_ADAPTER_FAULT            0x00000004
  682 #define I2O_EVENT_EXEC_POWER_FAIL               0x00000008
  683 #define I2O_EVENT_EXEC_RESET_PENDING            0x00000010
  684 #define I2O_EVENT_EXEC_RESET_IMMINENT           0x00000020
  685 #define I2O_EVENT_EXEC_HARDWARE_FAIL            0x00000040
  686 #define I2O_EVENT_EXEC_XCT_CHANGE               0x00000080
  687 #define I2O_EVENT_EXEC_NEW_LCT_ENTRY            0x00000100
  688 #define I2O_EVENT_EXEC_MODIFIED_LCT             0x00000200
  689 #define I2O_EVENT_EXEC_DDM_AVAILIBILITY         0x00000400
  690 
  691 /* LAN class events. */
  692 #define I2O_EVENT_LAN_LINK_DOWN                 0x00000001
  693 #define I2O_EVENT_LAN_LINK_UP                   0x00000002
  694 #define I2O_EVENT_LAN_MEDIA_CHANGE              0x00000004
  695 
  696 /*
  697  * ================= Utility parameter groups =================
  698  */
  699 
  700 #define I2O_PARAM_DEVICE_IDENTITY       0xf100
  701 struct i2o_param_device_identity {
  702         u_int32_t       classid;
  703         u_int16_t       ownertid;
  704         u_int16_t       parenttid;
  705         u_int8_t        vendorinfo[16];
  706         u_int8_t        productinfo[16];
  707         u_int8_t        description[16];
  708         u_int8_t        revlevel[8];
  709         u_int8_t        snformat;
  710         u_int8_t        serialnumber[1];
  711 } __attribute__ ((__packed__));
  712 
  713 #define I2O_PARAM_DDM_IDENTITY          0xf101
  714 struct i2o_param_ddm_identity {
  715         u_int16_t       ddmtid;
  716         u_int8_t        name[24];
  717         u_int8_t        revlevel[8];
  718         u_int8_t        snformat;
  719         u_int8_t        serialnumber[12];
  720 } __attribute__ ((__packed__));
  721 
  722 /*
  723  * ================= Block storage class messages =================
  724  */
  725 
  726 #define I2O_RBS_BLOCK_READ              0x30
  727 struct i2o_rbs_block_read {
  728         u_int32_t       msgflags;
  729         u_int32_t       msgfunc;
  730         u_int32_t       msgictx;
  731         u_int32_t       msgtctx;
  732         u_int32_t       flags;          /* flags, time multipler, read ahead */
  733         u_int32_t       datasize;
  734         u_int32_t       lowoffset;
  735         u_int32_t       highoffset;
  736 } __attribute__ ((__packed__));
  737 
  738 #define I2O_RBS_BLOCK_READ_NO_RETRY     0x01
  739 #define I2O_RBS_BLOCK_READ_SOLO         0x02
  740 #define I2O_RBS_BLOCK_READ_CACHE_READ   0x04
  741 #define I2O_RBS_BLOCK_READ_PREFETCH     0x08
  742 #define I2O_RBS_BLOCK_READ_CACHE_ONLY   0x10
  743 
  744 #define I2O_RBS_BLOCK_WRITE             0x31
  745 struct i2o_rbs_block_write {
  746         u_int32_t       msgflags;
  747         u_int32_t       msgfunc;
  748         u_int32_t       msgictx;
  749         u_int32_t       msgtctx;
  750         u_int32_t       flags;          /* flags, time multipler */
  751         u_int32_t       datasize;
  752         u_int32_t       lowoffset;
  753         u_int32_t       highoffset;
  754 } __attribute__ ((__packed__));
  755 
  756 #define I2O_RBS_BLOCK_WRITE_NO_RETRY    0x01
  757 #define I2O_RBS_BLOCK_WRITE_SOLO        0x02
  758 #define I2O_RBS_BLOCK_WRITE_CACHE_NONE  0x04
  759 #define I2O_RBS_BLOCK_WRITE_CACHE_WT    0x08
  760 #define I2O_RBS_BLOCK_WRITE_CACHE_WB    0x10
  761 
  762 #define I2O_RBS_CACHE_FLUSH             0x37
  763 struct i2o_rbs_cache_flush {
  764         u_int32_t       msgflags;
  765         u_int32_t       msgfunc;
  766         u_int32_t       msgictx;
  767         u_int32_t       msgtctx;
  768         u_int32_t       flags;          /* flags, time multipler */
  769 } __attribute__ ((__packed__));
  770 
  771 #define I2O_RBS_MEDIA_MOUNT             0x41
  772 struct i2o_rbs_media_mount {
  773         u_int32_t       msgflags;
  774         u_int32_t       msgfunc;
  775         u_int32_t       msgictx;
  776         u_int32_t       msgtctx;
  777         u_int32_t       mediaid;
  778         u_int32_t       loadflags;
  779 } __attribute__ ((__packed__));
  780 
  781 #define I2O_RBS_MEDIA_EJECT             0x43
  782 struct i2o_rbs_media_eject {
  783         u_int32_t       msgflags;
  784         u_int32_t       msgfunc;
  785         u_int32_t       msgictx;
  786         u_int32_t       msgtctx;
  787         u_int32_t       mediaid;
  788 } __attribute__ ((__packed__));
  789 
  790 #define I2O_RBS_MEDIA_LOCK              0x49
  791 struct i2o_rbs_media_lock {
  792         u_int32_t       msgflags;
  793         u_int32_t       msgfunc;
  794         u_int32_t       msgictx;
  795         u_int32_t       msgtctx;
  796         u_int32_t       mediaid;
  797 } __attribute__ ((__packed__));
  798 
  799 #define I2O_RBS_MEDIA_UNLOCK            0x4b
  800 struct i2o_rbs_media_unlock {
  801         u_int32_t       msgflags;
  802         u_int32_t       msgfunc;
  803         u_int32_t       msgictx;
  804         u_int32_t       msgtctx;
  805         u_int32_t       mediaid;
  806 } __attribute__ ((__packed__));
  807 
  808 /* Standard RBS reply frame. */
  809 struct i2o_rbs_reply {
  810         u_int32_t       msgflags;
  811         u_int32_t       msgfunc;
  812         u_int32_t       msgictx;
  813         u_int32_t       msgtctx;
  814         u_int16_t       detail;
  815         u_int8_t        retrycount;
  816         u_int8_t        reqstatus;
  817         u_int32_t       transfercount;
  818         u_int64_t       offset;         /* Error replies only */
  819 } __attribute__ ((__packed__));
  820 
  821 /*
  822  * ================= Block storage class parameter groups =================
  823  */
  824 
  825 #define I2O_PARAM_RBS_DEVICE_INFO       0x0000
  826 struct i2o_param_rbs_device_info {
  827         u_int8_t        type;
  828         u_int8_t        npaths;
  829         u_int16_t       powerstate;
  830         u_int32_t       blocksize;
  831         u_int64_t       capacity;
  832         u_int32_t       capabilities;
  833         u_int32_t       state;
  834 } __attribute__ ((__packed__));
  835 
  836 #define I2O_RBS_TYPE_DIRECT             0x00
  837 #define I2O_RBS_TYPE_WORM               0x04
  838 #define I2O_RBS_TYPE_CDROM              0x05
  839 #define I2O_RBS_TYPE_OPTICAL            0x07
  840 
  841 #define I2O_RBS_CAP_CACHING             0x00000001
  842 #define I2O_RBS_CAP_MULTI_PATH          0x00000002
  843 #define I2O_RBS_CAP_DYNAMIC_CAPACITY    0x00000004
  844 #define I2O_RBS_CAP_REMOVABLE_MEDIA     0x00000008
  845 #define I2O_RBS_CAP_REMOVABLE_DEVICE    0x00000010
  846 #define I2O_RBS_CAP_READ_ONLY           0x00000020
  847 #define I2O_RBS_CAP_LOCKOUT             0x00000040
  848 #define I2O_RBS_CAP_BOOT_BYPASS         0x00000080
  849 #define I2O_RBS_CAP_COMPRESSION         0x00000100
  850 #define I2O_RBS_CAP_DATA_SECURITY       0x00000200
  851 #define I2O_RBS_CAP_RAID                0x00000400
  852 
  853 #define I2O_RBS_STATE_CACHING           0x00000001
  854 #define I2O_RBS_STATE_POWERED_ON        0x00000002
  855 #define I2O_RBS_STATE_READY             0x00000004
  856 #define I2O_RBS_STATE_MEDIA_LOADED      0x00000008
  857 #define I2O_RBS_STATE_DEVICE_LOADED     0x00000010
  858 #define I2O_RBS_STATE_READ_ONLY         0x00000020
  859 #define I2O_RBS_STATE_LOCKOUT           0x00000040
  860 #define I2O_RBS_STATE_BOOT_BYPASS       0x00000080
  861 #define I2O_RBS_STATE_COMPRESSION       0x00000100
  862 #define I2O_RBS_STATE_DATA_SECURITY     0x00000200
  863 #define I2O_RBS_STATE_RAID              0x00000400
  864 
  865 #define I2O_PARAM_RBS_OPERATION         0x0001
  866 struct i2o_param_rbs_operation {
  867         u_int8_t        autoreass;
  868         u_int8_t        reasstolerance;
  869         u_int8_t        numretries;
  870         u_int8_t        reserved0;
  871         u_int32_t       reasssize;
  872         u_int32_t       expectedtimeout;
  873         u_int32_t       rwvtimeout;
  874         u_int32_t       rwvtimeoutbase;
  875         u_int32_t       timeoutbase;
  876         u_int32_t       orderedreqdepth;
  877         u_int32_t       atomicwritesize;
  878 } __attribute__ ((__packed__));
  879 
  880 #define I2O_PARAM_RBS_CACHE_CONTROL     0x0003
  881 struct i2o_param_rbs_cache_control {
  882         u_int32_t       totalcachesize;
  883         u_int32_t       readcachesize;
  884         u_int32_t       writecachesize;
  885         u_int8_t        writepolicy;
  886         u_int8_t        readpolicy;
  887         u_int8_t        errorcorrection;
  888         u_int8_t        reserved;
  889 } __attribute__ ((__packed__));
  890 
  891 /*
  892  * ================= SCSI peripheral class messages =================
  893  */
  894 
  895 #define I2O_SCSI_DEVICE_RESET           0x27
  896 struct i2o_scsi_device_reset {
  897         u_int32_t       msgflags;
  898         u_int32_t       msgfunc;
  899         u_int32_t       msgictx;
  900         u_int32_t       msgtctx;
  901 } __attribute__ ((__packed__));
  902 
  903 #define I2O_SCSI_SCB_EXEC               0x81
  904 struct i2o_scsi_scb_exec {
  905         u_int32_t       msgflags;
  906         u_int32_t       msgfunc;
  907         u_int32_t       msgictx;
  908         u_int32_t       msgtctx;
  909         u_int32_t       flags;          /* CDB length and flags */
  910         u_int8_t        cdb[16];
  911         u_int32_t       datalen;
  912 } __attribute__ ((__packed__));
  913 
  914 #define I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE  0x00200000
  915 #define I2O_SCB_FLAG_SENSE_DATA_IN_BUFFER   0x00600000
  916 #define I2O_SCB_FLAG_SIMPLE_QUEUE_TAG       0x00800000
  917 #define I2O_SCB_FLAG_HEAD_QUEUE_TAG         0x01000000
  918 #define I2O_SCB_FLAG_ORDERED_QUEUE_TAG      0x01800000
  919 #define I2O_SCB_FLAG_ACA_QUEUE_TAG          0x02000000
  920 #define I2O_SCB_FLAG_ENABLE_DISCONNECT      0x20000000
  921 #define I2O_SCB_FLAG_XFER_FROM_DEVICE       0x40000000
  922 #define I2O_SCB_FLAG_XFER_TO_DEVICE         0x80000000
  923 
  924 #define I2O_SCSI_SCB_ABORT              0x83
  925 struct i2o_scsi_scb_abort {
  926         u_int32_t       msgflags;
  927         u_int32_t       msgfunc;
  928         u_int32_t       msgictx;
  929         u_int32_t       msgtctx;
  930         u_int32_t       tctxabort;
  931 } __attribute__ ((__packed__));
  932 
  933 struct i2o_scsi_reply {
  934         u_int32_t       msgflags;
  935         u_int32_t       msgfunc;
  936         u_int32_t       msgictx;
  937         u_int32_t       msgtctx;
  938         u_int8_t        scsistatus;
  939         u_int8_t        hbastatus;
  940         u_int8_t        reserved;
  941         u_int8_t        reqstatus;
  942         u_int32_t       datalen;
  943         u_int32_t       senselen;
  944         u_int8_t        sense[40];
  945 } __attribute__ ((__packed__));
  946 
  947 #define I2O_SCSI_DSC_SUCCESS                0x00
  948 #define I2O_SCSI_DSC_REQUEST_ABORTED        0x02
  949 #define I2O_SCSI_DSC_UNABLE_TO_ABORT        0x03
  950 #define I2O_SCSI_DSC_COMPLETE_WITH_ERROR    0x04
  951 #define I2O_SCSI_DSC_ADAPTER_BUSY           0x05
  952 #define I2O_SCSI_DSC_REQUEST_INVALID        0x06
  953 #define I2O_SCSI_DSC_PATH_INVALID           0x07
  954 #define I2O_SCSI_DSC_DEVICE_NOT_PRESENT     0x08
  955 #define I2O_SCSI_DSC_UNABLE_TO_TERMINATE    0x09
  956 #define I2O_SCSI_DSC_SELECTION_TIMEOUT      0x0a
  957 #define I2O_SCSI_DSC_COMMAND_TIMEOUT        0x0b
  958 #define I2O_SCSI_DSC_MR_MESSAGE_RECEIVED    0x0d
  959 #define I2O_SCSI_DSC_SCSI_BUS_RESET         0x0e
  960 #define I2O_SCSI_DSC_PARITY_ERROR_FAILURE   0x0f
  961 #define I2O_SCSI_DSC_AUTOSENSE_FAILED       0x10
  962 #define I2O_SCSI_DSC_NO_ADAPTER             0x11
  963 #define I2O_SCSI_DSC_DATA_OVERRUN           0x12
  964 #define I2O_SCSI_DSC_UNEXPECTED_BUS_FREE    0x13
  965 #define I2O_SCSI_DSC_SEQUENCE_FAILURE       0x14
  966 #define I2O_SCSI_DSC_REQUEST_LENGTH_ERROR   0x15
  967 #define I2O_SCSI_DSC_PROVIDE_FAILURE        0x16
  968 #define I2O_SCSI_DSC_BDR_MESSAGE_SENT       0x17
  969 #define I2O_SCSI_DSC_REQUEST_TERMINATED     0x18
  970 #define I2O_SCSI_DSC_IDE_MESSAGE_SENT       0x33
  971 #define I2O_SCSI_DSC_RESOURCE_UNAVAILABLE   0x34
  972 #define I2O_SCSI_DSC_UNACKNOWLEDGED_EVENT   0x35
  973 #define I2O_SCSI_DSC_MESSAGE_RECEIVED       0x36
  974 #define I2O_SCSI_DSC_INVALID_CDB            0x37
  975 #define I2O_SCSI_DSC_LUN_INVALID            0x38
  976 #define I2O_SCSI_DSC_SCSI_TID_INVALID       0x39
  977 #define I2O_SCSI_DSC_FUNCTION_UNAVAILABLE   0x3a
  978 #define I2O_SCSI_DSC_NO_NEXUS               0x3b
  979 #define I2O_SCSI_DSC_SCSI_IID_INVALID       0x3c
  980 #define I2O_SCSI_DSC_CDB_RECEIVED           0x3d
  981 #define I2O_SCSI_DSC_LUN_ALREADY_ENABLED    0x3e
  982 #define I2O_SCSI_DSC_BUS_BUSY               0x3f
  983 #define I2O_SCSI_DSC_QUEUE_FROZEN           0x40
  984 
  985 /*
  986  * ================= SCSI peripheral class parameter groups =================
  987  */
  988 
  989 #define I2O_PARAM_SCSI_DEVICE_INFO      0x0000
  990 struct i2o_param_scsi_device_info {
  991         u_int8_t        devicetype;
  992         u_int8_t        flags;
  993         u_int16_t       reserved0;
  994         u_int32_t       identifier;
  995         u_int8_t        luninfo[8];
  996         u_int32_t       queuedepth;
  997         u_int8_t        reserved1;
  998         u_int8_t        negoffset;
  999         u_int8_t        negdatawidth;
 1000         u_int8_t        reserved2;
 1001         u_int64_t       negsyncrate;
 1002 } __attribute__ ((__packed__));
 1003 
 1004 /*
 1005  * ================= LAN class messages =================
 1006  */
 1007 
 1008 #define I2O_LAN_PACKET_SEND             0x3b
 1009 struct i2o_lan_packet_send {
 1010         u_int32_t       msgflags;
 1011         u_int32_t       msgfunc;
 1012         u_int32_t       msgictx;
 1013         u_int32_t       tcw;
 1014 
 1015         /* SGL follows */
 1016 };
 1017 
 1018 #define I2O_LAN_TCW_ACCESS_PRI_MASK     0x00000007
 1019 #define I2O_LAN_TCW_SUPPRESS_CRC        0x00000008
 1020 #define I2O_LAN_TCW_SUPPRESS_LOOPBACK   0x00000010
 1021 #define I2O_LAN_TCW_CKSUM_NETWORK       0x00000020
 1022 #define I2O_LAN_TCW_CKSUM_TRANSPORT     0x00000040
 1023 #define I2O_LAN_TCW_REPLY_BATCH         0x00000000
 1024 #define I2O_LAN_TCW_REPLY_IMMEDIATELY   0x40000000
 1025 #define I2O_LAN_TCW_REPLY_UNSUCCESSFUL  0x80000000
 1026 #define I2O_LAN_TCW_REPLY_NONE          0xc0000000
 1027 
 1028 #define I2O_LAN_SDU_SEND                0x3d
 1029 struct i2o_lan_sdu_send {
 1030         u_int32_t       msgflags;
 1031         u_int32_t       msgfunc;
 1032         u_int32_t       msgictx;
 1033         u_int32_t       tcw;            /* As per PACKET_SEND. */
 1034 
 1035         /* SGL follows */
 1036 };
 1037 
 1038 struct i2o_lan_send_reply {
 1039         u_int32_t       msgflags;
 1040         u_int32_t       msgfunc;
 1041         u_int32_t       msgictx;
 1042         u_int32_t       trl;
 1043         u_int16_t       detail;
 1044         u_int8_t        reserved;
 1045         u_int8_t        reqstatus;
 1046         u_int32_t       tctx[1];
 1047 };
 1048 
 1049 #define I2O_LAN_RECEIVE_POST            0x3e
 1050 struct i2o_lan_receive_post {
 1051         u_int32_t       msgflags;
 1052         u_int32_t       msgfunc;
 1053         u_int32_t       msgictx;
 1054         u_int32_t       bktcnt;
 1055 
 1056         /* SGL follows */
 1057 };
 1058 
 1059 struct i2o_lan_pdb {
 1060         u_int32_t       bctx;
 1061         u_int32_t       pktoff;
 1062         u_int32_t       pktlen;
 1063 };
 1064 
 1065 #define I2O_LAN_FRAG_VALID              0x00
 1066 #define I2O_LAN_FRAG_VALID_MASK         foo
 1067 
 1068 struct i2o_lan_receive_reply {
 1069         u_int32_t       msgflags;
 1070         u_int32_t       msgfunc;
 1071         u_int32_t       msgictx;
 1072         u_int8_t        trlcount;
 1073         u_int8_t        trlesize;
 1074         u_int8_t        reserved;
 1075         u_int8_t        trlflags;
 1076         u_int32_t       bucketsleft;
 1077         struct i2o_lan_pdb      pdb[1];
 1078 };
 1079 
 1080 #define I2O_LAN_RESET                   0x35
 1081 struct i2o_lan_reset {
 1082         u_int32_t       msgflags;
 1083         u_int32_t       msgfunc;
 1084         u_int32_t       msgictx;
 1085         u_int16_t       reserved;
 1086         u_int16_t       resrcflags;
 1087 };
 1088 
 1089 #define I2O_LAN_RESRC_RETURN_BUCKETS    0x0001
 1090 #define I2O_LAN_RESRC_RETURN_XMITS      0x0002
 1091 
 1092 #define I2O_LAN_SUSPEND                 0x37
 1093 struct i2o_lan_suspend {
 1094         u_int32_t       msgflags;
 1095         u_int32_t       msgfunc;
 1096         u_int32_t       msgictx;
 1097         u_int16_t       reserved;
 1098         u_int16_t       resrcflags;     /* As per RESET. */
 1099 };
 1100 
 1101 #define I2O_LAN_DSC_SUCCESS                     0x00
 1102 #define I2O_LAN_DSC_DEVICE_FAILURE              0x01
 1103 #define I2O_LAN_DSC_DESTINATION_NOT_FOUND       0x02
 1104 #define I2O_LAN_DSC_TRANSMIT_ERROR              0x03
 1105 #define I2O_LAN_DSC_TRANSMIT_ABORTED            0x04
 1106 #define I2O_LAN_DSC_RECEIVE_ERROR               0x05
 1107 #define I2O_LAN_DSC_RECEIVE_ABORTED             0x06
 1108 #define I2O_LAN_DSC_DMA_ERROR                   0x07
 1109 #define I2O_LAN_DSC_BAD_PACKET_DETECTED         0x08
 1110 #define I2O_LAN_DSC_OUT_OF_MEMORY               0x09
 1111 #define I2O_LAN_DSC_BUCKET_OVERRUN              0x0a
 1112 #define I2O_LAN_DSC_IOP_INTERNAL_ERROR          0x0b
 1113 #define I2O_LAN_DSC_CANCELED                    0x0c
 1114 #define I2O_LAN_DSC_INVALID_TRANSACTION_CONTEXT 0x0d
 1115 #define I2O_LAN_DSC_DEST_ADDRESS_DETECTED       0x0e
 1116 #define I2O_LAN_DSC_DEST_ADDRESS_OMITTED        0x0f
 1117 #define I2O_LAN_DSC_PARTIAL_PACKET_RETURNED     0x10
 1118 #define I2O_LAN_DSC_TEMP_SUSPENDED_STATE        0x11
 1119 
 1120 /*
 1121  * ================= LAN class parameter groups =================
 1122  */
 1123 
 1124 #define I2O_PARAM_LAN_DEVICE_INFO       0x0000
 1125 struct i2o_param_lan_device_info {
 1126         u_int16_t       lantype;
 1127         u_int16_t       flags;
 1128         u_int8_t        addrfmt;
 1129         u_int8_t        reserved1;
 1130         u_int16_t       reserved2;
 1131         u_int32_t       minpktsize;
 1132         u_int32_t       maxpktsize;
 1133         u_int8_t        hwaddr[8];
 1134         u_int64_t       maxtxbps;
 1135         u_int64_t       maxrxbps;
 1136 };
 1137 
 1138 #define I2O_LAN_TYPE_ETHERNET           0x0030
 1139 #define I2O_LAN_TYPE_100BASEVG          0x0040
 1140 #define I2O_LAN_TYPE_TOKEN_RING         0x0050
 1141 #define I2O_LAN_TYPE_FDDI               0x0060
 1142 #define I2O_LAN_TYPE_FIBRECHANNEL       0x0070
 1143 
 1144 #define I2O_PARAM_LAN_MAC_ADDRESS       0x0001
 1145 struct i2o_param_lan_mac_address {
 1146         u_int8_t        activeaddr[8];
 1147         u_int8_t        localaddr[8];
 1148         u_int8_t        addrmask[8];
 1149         u_int8_t        filtermask[4];
 1150         u_int8_t        hwfiltermask[4];
 1151         u_int32_t       maxmcastaddr;
 1152         u_int32_t       maxfilterperfect;
 1153         u_int32_t       maxfilterimperfect;
 1154 };
 1155 
 1156 #define I2O_PARAM_LAN_MCAST_MAC_ADDRESS 0x0002
 1157 /*
 1158  * This one's a table, not a scalar.
 1159  */
 1160 
 1161 #define I2O_PARAM_LAN_BATCH_CONTROL     0x0003
 1162 struct i2o_param_lan_batch_control {
 1163         u_int32_t       batchflags;
 1164         u_int32_t       risingloaddly;
 1165         u_int32_t       risingloadthresh;
 1166         u_int32_t       fallingloaddly;
 1167         u_int32_t       fallingloadthresh;
 1168         u_int32_t       maxbatchcount;
 1169         u_int32_t       maxbatchdelay;
 1170         u_int32_t       transcompdelay;
 1171 };
 1172 
 1173 #define I2O_PARAM_LAN_OPERATION         0x0004
 1174 struct i2o_param_lan_operation {
 1175         u_int32_t       pktprepad;
 1176         u_int32_t       userflags;
 1177         u_int32_t       pktorphanlimit;
 1178 };
 1179 
 1180 #define I2O_PARAM_LAN_MEDIA_OPERATION   0x0005
 1181 struct i2o_param_lan_media_operation {
 1182         u_int32_t       connectortype;
 1183         u_int32_t       connectiontype;
 1184         u_int32_t       curtxbps;
 1185         u_int32_t       currxbps;
 1186         u_int8_t        fullduplex;
 1187         u_int8_t        linkstatus;
 1188         u_int8_t        badpkthandling;
 1189 };
 1190 
 1191 #define I2O_LAN_CONNECTOR_OTHER         0x00
 1192 #define I2O_LAN_CONNECTOR_UNKNOWN       0x01
 1193 #define I2O_LAN_CONNECTOR_AUI           0x02
 1194 #define I2O_LAN_CONNECTOR_UTP           0x03
 1195 #define I2O_LAN_CONNECTOR_BNC           0x04
 1196 #define I2O_LAN_CONNECTOR_RJ45          0x05
 1197 #define I2O_LAN_CONNECTOR_STP_DB9       0x06
 1198 #define I2O_LAN_CONNECTOR_FIBER_MIC     0x07
 1199 #define I2O_LAN_CONNECTOR_APPLE_AUI     0x08
 1200 #define I2O_LAN_CONNECTOR_MII           0x09
 1201 #define I2O_LAN_CONNECTOR_COPPER_DB9    0x0a
 1202 #define I2O_LAN_CONNECTOR_COPPER_AW     0x0b
 1203 #define I2O_LAN_CONNECTOR_OPTICAL_LW    0x0c
 1204 #define I2O_LAN_CONNECTOR_SIP           0x0d
 1205 #define I2O_LAN_CONNECTOR_OPTICAL_SW    0x0e
 1206 
 1207 #define I2O_LAN_CONNECTION_UNKNOWN              0x0000
 1208 
 1209 #define I2O_LAN_CONNECTION_ETHERNET_AUI         0x0301
 1210 #define I2O_LAN_CONNECTION_ETHERNET_10BASE5     0x0302
 1211 #define I2O_LAN_CONNECTION_ETHERNET_FOIRL       0x0303
 1212 #define I2O_LAN_CONNECTION_ETHERNET_10BASE2     0x0304
 1213 #define I2O_LAN_CONNECTION_ETHERNET_10BROAD36   0x0305
 1214 #define I2O_LAN_CONNECTION_ETHERNET_10BASET     0x0306
 1215 #define I2O_LAN_CONNECTION_ETHERNET_10BASEFP    0x0307
 1216 #define I2O_LAN_CONNECTION_ETHERNET_10BASEFB    0x0308
 1217 #define I2O_LAN_CONNECTION_ETHERNET_10BASEFL    0x0309
 1218 #define I2O_LAN_CONNECTION_ETHERNET_100BASETX   0x030a
 1219 #define I2O_LAN_CONNECTION_ETHERNET_100BASEFX   0x030b
 1220 #define I2O_LAN_CONNECTION_ETHERNET_100BASET4   0x030c
 1221 
 1222 #define I2O_LAN_CONNECTION_100BASEVG_100BASEVG  0x0401
 1223 
 1224 #define I2O_LAN_CONNECTION_TOKEN_RING_4MBIT     0x0501
 1225 #define I2O_LAN_CONNECTION_TOKEN_RING_16MBIT    0x0502
 1226 
 1227 #define I2O_LAN_CONNECTION_FDDI_125MBIT         0x0601
 1228 
 1229 #define I2O_LAN_CONNECTION_FIBRECHANNEL_P2P     0x0701
 1230 #define I2O_LAN_CONNECTION_FIBRECHANNEL_AL      0x0702
 1231 #define I2O_LAN_CONNECTION_FIBRECHANNEL_PL      0x0703
 1232 #define I2O_LAN_CONNECTION_FIBRECHANNEL_F       0x0704
 1233 
 1234 #define I2O_LAN_CONNECTION_OTHER_EMULATED       0x0f00
 1235 #define I2O_LAN_CONNECTION_OTHER_OTHER          0x0f01
 1236 
 1237 #endif  /* !defined _I2O_I2O_H_ */

/* [<][>][^][v][top][bottom][index][help] */