[BACK]Return to i82596reg.h CVS log [TXT][DIR] Up to [local] / sys / dev / ic

Annotation of sys/dev/ic/i82596reg.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: i82596reg.h,v 1.4 2002/10/13 14:21:49 mickey Exp $    */
                      2: /*     $NetBSD: i82586reg.h,v 1.7 1998/02/28 01:07:45 pk Exp $ */
                      3:
                      4: /*-
                      5:  * Copyright (c) 1998 The NetBSD Foundation, Inc.
                      6:  * All rights reserved.
                      7:  *
                      8:  * This code is derived from software contributed to The NetBSD Foundation
                      9:  * by Paul Kranenburg.
                     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:  * Copyright (c) 1992, University of Vermont and State Agricultural College.
                     42:  * Copyright (c) 1992, Garrett A. Wollman.
                     43:  * All rights reserved.
                     44:  *
                     45:  * Redistribution and use in source and binary forms, with or without
                     46:  * modification, are permitted provided that the following conditions
                     47:  * are met:
                     48:  * 1. Redistributions of source code must retain the above copyright
                     49:  *    notice, this list of conditions and the following disclaimer.
                     50:  * 2. Redistributions in binary form must reproduce the above copyright
                     51:  *    notice, this list of conditions and the following disclaimer in the
                     52:  *    documentation and/or other materials provided with the distribution.
                     53:  * 3. All advertising materials mentioning features or use of this software
                     54:  *    must display the following acknowledgement:
                     55:  *     This product includes software developed by the University of
                     56:  *     Vermont and State Agricultural College and Garrett A. Wollman.
                     57:  * 4. Neither the name of the University nor the name of the author
                     58:  *    may be used to endorse or promote products derived from this software
                     59:  *    without specific prior written permission.
                     60:  *
                     61:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     62:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     63:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     64:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE UNIVERSITY OR AUTHOR BE LIABLE
                     65:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     66:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     67:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     68:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     69:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     70:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     71:  * SUCH DAMAGE.
                     72:  */
                     73:
                     74: /*
                     75:  * Intel 82586/82596 Ethernet chip
                     76:  * Register, bit, and structure definitions.
                     77:  *
                     78:  * Written by GAW with reference to the Clarkson Packet Driver code for this
                     79:  * chip written by Russ Nelson and others.
                     80:  */
                     81:
                     82: /*
                     83:  * NOTE, the structure definitions in here are for reference only.
                     84:  * We use integer offsets exclusively to access the i82586/596 data structures.
                     85:  */
                     86:
                     87: #pragma pack(1)
                     88:
                     89: /*
                     90:  * This is the master configuration block.
                     91:  * It tells the hardware where all the rest of the stuff is.
                     92:  *-
                     93: struct __ie_sys_conf_ptr {
                     94:        u_int16_t       mbz;                    // must be zero
                     95:        u_int8_t        ie_bus_use;             // true if 8-bit only
                     96:        u_int8_t        mbz2[5];                // must be zero
                     97:        u_int32_t       ie_iscp_ptr;            // 24-bit physaddr of ISCP
                     98: };
                     99:  */
                    100: #define IE_SCP_SZ              12      /* keep paragraph alignment */
                    101: #define IE_SCP_BUS_USE(base)   ((base) + 2)
                    102: #define IE_SCP_TEST(base)      ((base) + 4)
                    103: #define IE_SCP_ISCP(base)      ((base) + 8)
                    104:
                    105: /*
                    106:  * Note that this is wired in hardware; the SCP is always located here, no
                    107:  * matter what.
                    108:  */
                    109: #define IE_SCP_ADDR 0xfffff4
                    110:
                    111: /*
                    112:  * The tells the hardware where all the rest of the stuff is, too.
                    113:  * FIXME: some of these should be re-commented after we figure out their
                    114:  * REAL function.
                    115:  *-
                    116: struct __ie_int_sys_conf_ptr {
                    117:        u_int8_t        ie_busy;        // zeroed after init
                    118:        u_int8_t        mbz;
                    119:        u_int16_t       ie_scb_offset;  // 16-bit physaddr of next struct
                    120:        caddr_t         ie_base;        // 24-bit physaddr for all 16-bit vars
                    121: };
                    122:  */
                    123: #define IE_ISCP_SZ             16
                    124: #define IE_ISCP_BUSY(base)     ((base) + 0)
                    125: #define IE_ISCP_SCB(base)      ((base) + 2)
                    126: #define IE_ISCP_BASE(base)     ((base) + 4)
                    127:
                    128: /*
                    129:  * SYSBUS byte definitions
                    130:  * bit0 is not checked
                    131:  * bit6 is always 1
                    132:  */
                    133: #define        IE_SYSBUS_82586         0x00
                    134: #define        IE_SYSBUS_32SEG         0x02
                    135: #define        IE_SYSBUS_LINEAR        0x04
                    136: #define        IE_SYSBUS_TRG           0x08
                    137: #define        IE_SYSBUS_LOCK          0x10
                    138: #define        IE_SYSBUS_INTLOW        0x20
                    139: #define        IE_SYSBUS_BE            0x80
                    140:
                    141: /*
                    142:  * This FINALLY tells the hardware what to do and where to put it.
                    143:  *-
                    144: struct __ie_sys_ctl_block {
                    145:        u_int16_t ie_status;            // status word
                    146:        u_int16_t ie_command;           // command word
                    147:        u_int16_t ie_command_list;      // 16-pointer to command block list
                    148:        u_int16_t ie_recv_list;         // 16-pointer to receive frame list
                    149:        u_int16_t ie_err_crc;           // CRC errors
                    150:        u_int16_t ie_err_align;         // Alignment errors
                    151:        u_int16_t ie_err_resource;      // Resource errors
                    152:        u_int16_t ie_err_overrun;       // Overrun errors
                    153: };
                    154:  */
                    155: #define IE_SCB_SZ              16
                    156: #define IE_SCB_STATUS(base)    ((base) + 0)
                    157: #define IE_SCB_CMD(base)       ((base) + 2)
                    158: #define IE_SCB_CMDLST(base)    ((base) + 4)
                    159: #define IE_SCB_RCVLST(base)    ((base) + 6)
                    160: #define IE_SCB_ERRCRC(base)    ((base) + 8)
                    161: #define IE_SCB_ERRALN(base)    ((base) + 10)
                    162: #define IE_SCB_ERRRES(base)    ((base) + 12)
                    163: #define IE_SCB_ERROVR(base)    ((base) + 14)
                    164:
                    165: /* Command values */
                    166: #define IE_RUC_MASK    0x0070  /* mask for RU command */
                    167: #define IE_RUC_NOP     0       /* for completeness */
                    168: #define IE_RUC_START   0x0010  /* start receive unit command */
                    169: #define IE_RUC_RESUME  0x0020  /* resume a suspended receiver command */
                    170: #define IE_RUC_SUSPEND 0x0030  /* suspend receiver command */
                    171: #define IE_RUC_ABORT   0x0040  /* abort current receive operation */
                    172:
                    173: #define IE_CUC_MASK    0x0700  /* mask for CU command */
                    174: #define IE_CUC_NOP     0       /* included for completeness */
                    175: #define IE_CUC_START   0x0100  /* do-command command */
                    176: #define IE_CUC_RESUME  0x0200  /* resume a suspended cmd list */
                    177: #define IE_CUC_SUSPEND 0x0300  /* suspend current command */
                    178: #define IE_CUC_ABORT   0x0400  /* abort current command */
                    179:
                    180: #define IE_ACK_COMMAND 0xf000  /* mask for ACK command */
                    181: #define IE_ACK_CX      0x8000  /* ack IE_ST_CX */
                    182: #define IE_ACK_FR      0x4000  /* ack IE_ST_FR */
                    183: #define IE_ACK_CNA     0x2000  /* ack IE_ST_CNA */
                    184: #define IE_ACK_RNR     0x1000  /* ack IE_ST_RNR */
                    185:
                    186: #define IE_ACTION_COMMAND(x) (((x) & IE_CUC_MASK) == IE_CUC_START)
                    187:                                /* is this command an action command? */
                    188:
                    189: #define IE_ST_WHENCE   0xf000  /* mask for cause of interrupt */
                    190: #define IE_ST_CX       0x8000  /* command with I bit completed */
                    191: #define IE_ST_FR       0x4000  /* frame received */
                    192: #define IE_ST_CNA      0x2000  /* all commands completed */
                    193: #define IE_ST_RNR      0x1000  /* receive not ready */
                    194:
                    195: #define IE_CUS_MASK    0x0700  /* mask for command unit status */
                    196: #define IE_CUS_ACTIVE  0x0200  /* command unit is active */
                    197: #define IE_CUS_SUSPEND 0x0100  /* command unit is suspended */
                    198:
                    199: #define IE_RUS_MASK    0x0070  /* mask for receiver unit status */
                    200: #define IE_RUS_SUSPEND 0x0010  /* receiver is suspended */
                    201: #define IE_RUS_NOSPACE 0x0020  /* receiver has no resources */
                    202: #define IE_RUS_READY   0x0040  /* receiver is ready */
                    203:
                    204: #define        IE_ST_BITS \
                    205:        "\020\020cx\017fr\016cna\015rnr\012cact\011csusp\07rrdy\06rnsp\05rsusp"
                    206:
                    207: /*
                    208:  * This is filled in partially by the chip, partially by us.
                    209:  *-
                    210: struct __ie_recv_frame_desc {
                    211:        u_int16_t       ie_fd_status;   // status for this frame
                    212:        u_int16_t       ie_fd_last;     // end of frame list flag
                    213:        u_int16_t       ie_fd_next;     // 16-pointer to next RFD
                    214:        u_int16_t       ie_fd_buf_desc; // 16-pointer to list of buffer descs
                    215:        struct __ie_en_addr dest;       // destination ether
                    216:        struct __ie_en_addr src;        // source ether
                    217:        u_int16_t       ie_length;      // 802 length/Ether type
                    218:        u_short         mbz;            // must be zero
                    219: };
                    220:  */
                    221: #define IE_RFRAME_SZ                   24
                    222: #define IE_RFRAME_ADDR(base,i)         ((base) + (i) * 64)
                    223: #define IE_RFRAME_STATUS(b,i)          (IE_RFRAME_ADDR(b,i) + 0)
                    224: #define IE_RFRAME_LAST(b,i)            (IE_RFRAME_ADDR(b,i) + 2)
                    225: #define IE_RFRAME_NEXT(b,i)            (IE_RFRAME_ADDR(b,i) + 4)
                    226: #define IE_RFRAME_BUFDESC(b,i)         (IE_RFRAME_ADDR(b,i) + 6)
                    227: #define IE_RFRAME_EDST(b,i)            (IE_RFRAME_ADDR(b,i) + 8)
                    228: #define IE_RFRAME_ESRC(b,i)            (IE_RFRAME_ADDR(b,i) + 14)
                    229: #define IE_RFRAME_ELEN(b,i)            (IE_RFRAME_ADDR(b,i) + 20)
                    230:
                    231: /* "last" bits */
                    232: #define IE_FD_EOL      0x8000  /* last rfd in list */
                    233: #define IE_FD_SUSP     0x4000  /* suspend RU after receipt */
                    234:
                    235: /* status field bits */
                    236: #define IE_FD_COMPLETE 0x8000  /* frame is complete */
                    237: #define IE_FD_BUSY     0x4000  /* frame is busy */
                    238: #define IE_FD_OK       0x2000  /* frame is ok */
                    239: #define IE_FD_CRC      0x0800  /* CRC error */
                    240: #define IE_FD_ALGN     0x0400  /* Alignment error */
                    241: #define IE_FD_RNR      0x0200  /* receiver out of resources here */
                    242: #define IE_FD_OVR      0x0100  /* DMA overrun */
                    243: #define IE_FD_SHORT    0x0080  /* Short frame */
                    244: #define IE_FD_NOEOF    0x0040  /* no EOF (?) */
                    245: #define IE_FD_ERRMASK          /* all error bits */ \
                    246:        (IE_FD_CRC|IE_FD_ALGN|IE_FD_RNR|IE_FD_OVR|IE_FD_SHORT|IE_FD_NOEOF)
                    247: #define IE_FD_STATUSBITS       \
                    248:        "\20\20complt\17busy\16ok\14crc\13algn\12rnr\11ovr\10short\7noeof"
                    249:
                    250: /*
                    251:  * linked list of buffers...
                    252:  *-
                    253: struct __ie_recv_buf_desc {
                    254:        u_int16_t       ie_rbd_status;  // status for this buffer
                    255:        u_int16_t       ie_rbd_next;    // 16-pointer to next RBD
                    256:        caddr_t         ie_rbd_buffer;  // 24-pointer to buffer for this RBD
                    257:        u_int16_t       ie_rbd_length;  // length of the buffer
                    258:        u_int16_t       mbz;            // must be zero
                    259: };
                    260:  */
                    261: #define IE_RBD_SZ                      12
                    262: #define IE_RBD_ADDR(base,i)            ((base) + (i) * 32)
                    263: #define IE_RBD_STATUS(b,i)             (IE_RBD_ADDR(b,i) + 0)
                    264: #define IE_RBD_NEXT(b,i)               (IE_RBD_ADDR(b,i) + 2)
                    265: #define IE_RBD_BUFADDR(b,i)            (IE_RBD_ADDR(b,i) + 4)
                    266: #define IE_RBD_BUFLEN(b,i)             (IE_RBD_ADDR(b,i) + 8)
                    267:
                    268: /* RBD status fields */
                    269: #define IE_RBD_LAST    0x8000          /* last buffer */
                    270: #define IE_RBD_USED    0x4000          /* this buffer has data */
                    271: #define IE_RBD_CNTMASK 0x3fff          /* byte count of buffer data */
                    272:
                    273: /* RDB `End Of List' flag; encoded in `buffer length' field */
                    274: #define IE_RBD_EOL     0x8000          /* last buffer */
                    275:
                    276:
                    277: /*
                    278:  * All commands share this in common.
                    279:  *-
                    280: struct __ie_cmd_common {
                    281:        u_int16_t ie_cmd_status;        // status of this command
                    282:        u_int16_t ie_cmd_cmd;           // command word
                    283:        u_int16_t ie_cmd_link;          // link to next command
                    284: };
                    285:  */
                    286: #define IE_CMD_COMMON_SZ               6
                    287: #define IE_CMD_COMMON_STATUS(base)     ((base) + 0)
                    288: #define IE_CMD_COMMON_CMD(base)                ((base) + 2)
                    289: #define IE_CMD_COMMON_LINK(base)       ((base) + 4)
                    290:
                    291: #define IE_STAT_COMPL  0x8000  /* command is completed */
                    292: #define IE_STAT_BUSY   0x4000  /* command is running now */
                    293: #define IE_STAT_OK     0x2000  /* command completed successfully */
                    294: #define IE_STAT_ABORT  0x1000  /* command was aborted */
                    295: #define        IE_STAT_BITS    "\020\020complete\017busy\016ok\015abort"
                    296:
                    297: #define IE_CMD_NOP     0x0000  /* NOP */
                    298: #define IE_CMD_IASETUP 0x0001  /* initial address setup */
                    299: #define IE_CMD_CONFIG  0x0002  /* configure command */
                    300: #define IE_CMD_MCAST   0x0003  /* multicast setup command */
                    301: #define IE_CMD_XMIT    0x0004  /* transmit command */
                    302: #define IE_CMD_TDR     0x0005  /* time-domain reflectometer command */
                    303: #define IE_CMD_DUMP    0x0006  /* dump command */
                    304: #define IE_CMD_DIAGNOSE        0x0007  /* diagnostics command */
                    305:
                    306: #define IE_CMD_LAST    0x8000  /* this is the last command in the list */
                    307: #define IE_CMD_SUSPEND 0x4000  /* suspend CU after this command */
                    308: #define IE_CMD_INTR    0x2000  /* post an interrupt after completion */
                    309:
                    310: /*
                    311:  * No-op commands; just like COMMON but "indexable"
                    312:  */
                    313: #define IE_CMD_NOP_SZ                  IE_CMD_COMMON_SZ
                    314: #define IE_CMD_NOP_ADDR(base,i)                ((base) + (i) * 32)
                    315: #define IE_CMD_NOP_STATUS(b,i)         (IE_CMD_NOP_ADDR(b,i) + 0)
                    316: #define IE_CMD_NOP_CMD(b,i)            (IE_CMD_NOP_ADDR(b,i) + 2)
                    317: #define IE_CMD_NOP_LINK(b,i)           (IE_CMD_NOP_ADDR(b,i) + 4)
                    318:
                    319:
                    320: /*
                    321:  * This is the command to transmit a frame.
                    322:  *-
                    323: struct __ie_xmit_cmd {
                    324:        struct __ie_cmd_common  com;            // common part
                    325: #define __ie_xmit_status       com.ie_cmd_status
                    326:
                    327:        u_int16_t       ie_xmit_desc;           // pointer to buffer descriptor
                    328:        struct __ie_en_addr ie_xmit_addr;       // destination address
                    329:        u_int16_t       ie_xmit_length;         // 802.3 length/Ether type field
                    330: };
                    331:  */
                    332: #define IE_CMD_XMIT_SZ                 (IE_CMD_COMMON_SZ + 10)
                    333: #define IE_CMD_XMIT_ADDR(base,i)       ((base) + (i) * 32)
                    334: #define IE_CMD_XMIT_STATUS(b,i)                (IE_CMD_XMIT_ADDR(b,i) + 0)
                    335: #define IE_CMD_XMIT_CMD(b,i)           (IE_CMD_XMIT_ADDR(b,i) + 2)
                    336: #define IE_CMD_XMIT_LINK(b,i)          (IE_CMD_XMIT_ADDR(b,i) + 4)
                    337: #define IE_CMD_XMIT_DESC(b,i)          \
                    338:        (IE_CMD_XMIT_ADDR(b,i) + IE_CMD_COMMON_SZ + 0)
                    339: #define IE_CMD_XMIT_EADDR(b,i)         \
                    340:        (IE_CMD_XMIT_ADDR(b,i) + IE_CMD_COMMON_SZ + 2)
                    341: #define IE_CMD_XMIT_LEN(b,i)           \
                    342:        (IE_CMD_XMIT_ADDR(b,i) + IE_CMD_COMMON_SZ + 8)
                    343:
                    344: #define IE_XS_MAXCOLL          0x000f  /* number of collisions during transmit */
                    345: #define IE_XS_EXCMAX   0x0020  /* exceeded maximum number of collisions */
                    346: #define IE_XS_SQE      0x0040  /* SQE positive */
                    347: #define IE_XS_DEFERRED 0x0080  /* transmission deferred */
                    348: #define IE_XS_UNDERRUN 0x0100  /* DMA underrun */
                    349: #define IE_XS_LOSTCTS  0x0200  /* Lost CTS */
                    350: #define IE_XS_NOCARRIER        0x0400  /* No Carrier */
                    351: #define        IE_XS_LATECOLL  0x0800  /* Late collision */
                    352:
                    353: #define        IE_XS_BITS \
                    354:        "\020\014ltcoll\013nocar\012lostcts\011underrun\010xsdef\07sqe\06excoll"
                    355:
                    356: /*
                    357:  * This is a buffer descriptor for a frame to be transmitted.
                    358:  *-
                    359: struct __ie_xmit_buf {
                    360:        u_int16_t ie_xmit_flags;        // see below
                    361:        u_int16_t ie_xmit_next;         // 16-pointer to next desc
                    362:        caddr_t ie_xmit_buf;            // 24-pointer to the actual buffer
                    363: };
                    364:  */
                    365: #define IE_XBD_SZ                      8
                    366: #define IE_XBD_ADDR(base,i)            ((base) + (i) * 32)
                    367: #define IE_XBD_FLAGS(b,i)              (IE_XBD_ADDR(b,i) + 0)
                    368: #define IE_XBD_NEXT(b,i)               (IE_XBD_ADDR(b,i) + 2)
                    369: #define IE_XBD_BUF(b,i)                        (IE_XBD_ADDR(b,i) + 4)
                    370:
                    371: #define IE_TBD_EOL     0x8000          /* this TBD is the last one */
                    372: #define IE_TBD_CNTMASK 0x3fff          /* The rest of the `flags' word
                    373:                                           is actually the length. */
                    374:
                    375:
                    376: /*
                    377:  * Multicast setup command.
                    378:  *-
                    379: struct __ie_mcast_cmd {
                    380:        struct __ie_cmd_common  com;    // common part
                    381: #define ie_mcast_status                com.ie_cmd_status
                    382:
                    383:        // size (in bytes) of multicast addresses
                    384:        u_int16_t               ie_mcast_bytes;
                    385:        struct __ie_en_addr ie_mcast_addrs[IE_MAXMCAST + 1];// space for them
                    386: };
                    387:  */
                    388: #define IE_CMD_MCAST_SZ                        (IE_CMD_COMMON_SZ + 2 /* + XXX */)
                    389: #define IE_CMD_MCAST_BYTES(base)       ((base) + IE_CMD_COMMON_SZ + 0)
                    390: #define IE_CMD_MCAST_MADDR(base)       ((base) + IE_CMD_COMMON_SZ + 2)
                    391:
                    392: /*
                    393:  * Time Domain Reflectometer command.
                    394:  *-
                    395: struct __ie_tdr_cmd {
                    396:        struct __ie_cmd_common com;     // common part
                    397: #define ie_tdr_status com.ie_cmd_status
                    398:        u_short ie_tdr_time;            // error bits and time
                    399: };
                    400:  */
                    401: #define IE_CMD_TDR_SZ          (IE_CMD_COMMON_SZ + 2)
                    402: #define IE_CMD_TDR_TIME(base)  ((base) + IE_CMD_COMMON_SZ + 0)
                    403:
                    404: #define IE_TDR_SUCCESS 0x8000  /* TDR succeeded without error */
                    405: #define IE_TDR_XCVR    0x4000  /* detected a transceiver problem */
                    406: #define IE_TDR_OPEN    0x2000  /* detected an open */
                    407: #define IE_TDR_SHORT   0x1000  /* TDR detected a short */
                    408: #define IE_TDR_TIME    0x07ff  /* mask for reflection time */
                    409:
                    410: #define        IE_TDR_BITS     "\020\020success\017xcvr\016open\015short"
                    411:
                    412: /*
                    413:  * Initial Address Setup command
                    414:  *-
                    415: struct __ie_iasetup_cmd {
                    416:        struct __ie_cmd_common com;
                    417: #define ie_iasetup_status com.ie_cmd_status
                    418:        struct __ie_en_addr ie_address;
                    419: };
                    420:  */
                    421: #define IE_CMD_IAS_SZ          (IE_CMD_COMMON_SZ + 6)
                    422: #define IE_CMD_IAS_EADDR(base) ((base) + IE_CMD_COMMON_SZ + 0)
                    423:
                    424: /*
                    425:  * Configuration command
                    426:  *-
                    427: struct __ie_config_cmd {
                    428:        struct __ie_cmd_common com;     // common part
                    429: #define ie_config_status com.ie_cmd_status
                    430:
                    431:        u_int8_t ie_config_count;       // byte count (0x0c)
                    432:        u_int8_t ie_fifo;               // fifo (8)
                    433:        u_int8_t ie_save_bad;           // save bad frames (0x40)
                    434:        u_int8_t ie_addr_len;           // address length (0x2e) (AL-LOC == 1)
                    435:        u_int8_t ie_priority;           // priority and backoff (0x0)
                    436:        u_int8_t ie_ifs;                // inter-frame spacing (0x60)
                    437:        u_int8_t ie_slot_low;           // slot time, LSB (0x0)
                    438:        u_int8_t ie_slot_high;          // slot time, MSN, and retries (0xf2)
                    439:        u_int8_t ie_promisc;            // 1 if promiscuous, else 0
                    440:        u_int8_t ie_crs_cdt;            // CSMA/CD parameters (0x0)
                    441:        u_int8_t ie_min_len;            // min frame length (0x40)
                    442:        u_int8_t ie_junk;               // stuff for 82596 (0xff)
                    443: };
                    444:  */
                    445: #define IE_CMD_CFG_SZ                  (IE_CMD_COMMON_SZ + 12)
                    446: #define IE_CMD_CFG_CNT(base)           ((base) + IE_CMD_COMMON_SZ + 0)
                    447: #define IE_CMD_CFG_FIFO(base)          ((base) + IE_CMD_COMMON_SZ + 1)
                    448: #define IE_CMD_CFG_SAVEBAD(base)       ((base) + IE_CMD_COMMON_SZ + 2)
                    449: #define IE_CMD_CFG_ADDRLEN(base)       ((base) + IE_CMD_COMMON_SZ + 3)
                    450: #define IE_CMD_CFG_PRIORITY(base)      ((base) + IE_CMD_COMMON_SZ + 4)
                    451: #define IE_CMD_CFG_IFS(base)           ((base) + IE_CMD_COMMON_SZ + 5)
                    452: #define IE_CMD_CFG_SLOT_LOW(base)      ((base) + IE_CMD_COMMON_SZ + 6)
                    453: #define IE_CMD_CFG_SLOT_HIGH(base)     ((base) + IE_CMD_COMMON_SZ + 7)
                    454: #define IE_CMD_CFG_PROMISC(base)       ((base) + IE_CMD_COMMON_SZ + 8)
                    455: #define IE_CMD_CFG_CRSCDT(base)                ((base) + IE_CMD_COMMON_SZ + 9)
                    456: #define IE_CMD_CFG_MINLEN(base)                ((base) + IE_CMD_COMMON_SZ + 10)
                    457: #define IE_CMD_CFG_JUNK(base)          ((base) + IE_CMD_COMMON_SZ + 11)
                    458:
                    459: #pragma pack()

CVSweb