The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/ic/pdqreg.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*      $NetBSD: pdqreg.h,v 1.16 2005/02/27 00:27:02 perry Exp $        */
    2 
    3 /*-
    4  * Copyright (c) 1995, 1996 Matt Thomas <matt@3am-software.com>
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions
    9  * are met:
   10  * 1. Redistributions of source code must retain the above copyright
   11  *    notice, this list of conditions and the following disclaimer.
   12  * 2. The name of the author may not be used to endorse or promote products
   13  *    derived from this software without specific prior written permission
   14  *
   15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
   18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
   19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
   20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
   24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   25  *
   26  * Id: pdqreg.h,v 1.11 1997/03/21 21:16:04 thomas Exp
   27  *
   28  */
   29 
   30 /*
   31  * DEC PDQ FDDI Controller; PDQ port driver definitions
   32  *
   33  */
   34 
   35 #ifndef _PDQREG_H
   36 #define _PDQREG_H
   37 
   38 #if !defined(KERNEL) && !defined(_KERNEL)
   39 #include <stddef.h>
   40 #elif !defined(offsetof)
   41 #define offsetof(t, m)  ((char *) (&((t *)0L)->m) - (char *) 0L)
   42 #endif
   43 #if defined(PDQTEST) && !defined(PDQ_NDEBUG)
   44 #include <assert.h>
   45 #define PDQ_ASSERT      assert
   46 #else
   47 #define PDQ_ASSERT(x)   do { } while(0)
   48 #endif
   49 
   50 #define PDQ_RING_SIZE(array)    ((sizeof(array) / sizeof(array[0])))
   51 #define PDQ_ARRAY_SIZE(array)   ((sizeof(array) / sizeof(array[0])))
   52 #define PDQ_RING_MASK(array)    (PDQ_RING_SIZE(array) - 1)
   53 #define PDQ_BITMASK(n)          (1L << (pdq_uint32_t) (n))
   54 
   55 #define PDQ_FDDI_MAX            4495
   56 #define PDQ_FDDI_LLC_MIN        20
   57 #define PDQ_FDDI_SMT_MIN        37
   58 
   59 #define PDQ_FDDI_SMT            0x40
   60 #define PDQ_FDDI_LLC_ASYNC      0x50
   61 #define PDQ_FDDI_LLC_SYNC       0xD0
   62 #define PDQ_FDDI_IMP_ASYNC      0x60
   63 #define PDQ_FDDI_IMP_SYNC       0xE0
   64 
   65 #define PDQ_FDDIFC_C            0x80
   66 #define PDQ_FDDIFC_L            0x40
   67 #define PDQ_FDDIFC_F            0x30
   68 #define PDQ_FDDIFC_Z            0x0F
   69 
   70 #define PDQ_FDDI_PH0            0x20
   71 #define PDQ_FDDI_PH1            0x38
   72 #define PDQ_FDDI_PH2            0x00
   73 
   74 typedef pdq_uint32_t pdq_physaddr_t;
   75 
   76 struct _pdq_lanaddr_t {
   77     pdq_uint8_t lanaddr_bytes[8];
   78 };
   79 
   80 typedef struct {
   81     pdq_uint8_t fwrev_bytes[4];
   82 } pdq_fwrev_t;
   83 
   84 enum _pdq_state_t {
   85     PDQS_RESET=0,
   86     PDQS_UPGRADE=1,
   87     PDQS_DMA_UNAVAILABLE=2,
   88     PDQS_DMA_AVAILABLE=3,
   89     PDQS_LINK_AVAILABLE=4,
   90     PDQS_LINK_UNAVAILABLE=5,
   91     PDQS_HALTED=6,
   92     PDQS_RING_MEMBER=7
   93 };
   94 
   95 struct _pdq_csrs_t {
   96     pdq_bus_memoffset_t csr_port_reset;                 /* 0x00 [RW] */
   97     pdq_bus_memoffset_t csr_host_data;                  /* 0x04 [R]  */
   98     pdq_bus_memoffset_t csr_port_control;               /* 0x08 [RW] */
   99     pdq_bus_memoffset_t csr_port_data_a;                /* 0x0C [RW] */
  100     pdq_bus_memoffset_t csr_port_data_b;                /* 0x10 [RW] */
  101     pdq_bus_memoffset_t csr_port_status;                /* 0x14 [R]  */
  102     pdq_bus_memoffset_t csr_host_int_type_0;            /* 0x18 [RW] */
  103     pdq_bus_memoffset_t csr_host_int_enable;            /* 0x1C [RW] */
  104     pdq_bus_memoffset_t csr_type_2_producer;            /* 0x20 [RW] */
  105     pdq_bus_memoffset_t csr_cmd_response_producer;      /* 0x28 [RW] */
  106     pdq_bus_memoffset_t csr_cmd_request_producer;       /* 0x2C [RW] */
  107     pdq_bus_memoffset_t csr_host_smt_producer;          /* 0x30 [RW] */
  108     pdq_bus_memoffset_t csr_unsolicited_producer;       /* 0x34 [RW] */
  109     pdq_bus_t csr_bus;
  110     pdq_bus_memaddr_t csr_base;
  111 };
  112 
  113 struct _pdq_pci_csrs_t {
  114     pdq_bus_memoffset_t csr_pfi_mode_control;           /* 0x40 [RW] */
  115     pdq_bus_memoffset_t csr_pfi_status;                 /* 0x44 [RW] */
  116     pdq_bus_memoffset_t csr_fifo_write;                 /* 0x48 [RW] */
  117     pdq_bus_memoffset_t csr_fifo_read;                  /* 0x4C [RW] */
  118     pdq_bus_t csr_bus;
  119     pdq_bus_memaddr_t csr_base;
  120 };
  121 
  122 #define PDQ_PFI_MODE_DMA_ENABLE         0x01    /* DMA Enable */
  123 #define PDQ_PFI_MODE_PFI_PCI_INTR       0x02    /* PFI-to-PCI Int Enable */
  124 #define PDQ_PFI_MODE_PDQ_PCI_INTR       0x04    /* PDQ-to-PCI Int Enable */
  125 
  126 #define PDQ_PFI_STATUS_PDQ_INTR         0x10    /* PDQ Int received */
  127 #define PDQ_PFI_STATUS_DMA_ABORT        0x08    /* PDQ DMA Abort asserted */
  128 
  129 #define PDQ_EISA_BURST_HOLDOFF                  0x0040
  130 #define PDQ_EISA_SLOT_ID                        0x0C80
  131 #define PDQ_EISA_SLOT_CTRL                      0x0C84
  132 #define PDQ_EISA_MEM_ADD_CMP_0                  0x0C85
  133 #define PDQ_EISA_MEM_ADD_CMP_1                  0x0C86
  134 #define PDQ_EISA_MEM_ADD_CMP_2                  0x0C87
  135 #define PDQ_EISA_MEM_ADD_HI_CMP_0               0x0C88
  136 #define PDQ_EISA_MEM_ADD_HI_CMP_1               0x0C89
  137 #define PDQ_EISA_MEM_ADD_HI_CMP_2               0x0C8A
  138 #define PDQ_EISA_MEM_ADD_MASK_0                 0x0C8B
  139 #define PDQ_EISA_MEM_ADD_MASK_1                 0x0C8C
  140 #define PDQ_EISA_MEM_ADD_MASK_2                 0x0C8D
  141 #define PDQ_EISA_MEM_ADD_LO_CMP_0               0x0C8E
  142 #define PDQ_EISA_MEM_ADD_LO_CMP_1               0x0C8F
  143 #define PDQ_EISA_MEM_ADD_LO_CMP_2               0x0C90
  144 #define PDQ_EISA_IO_CMP_0_0                     0x0C91
  145 #define PDQ_EISA_IO_CMP_0_1                     0x0C92
  146 #define PDQ_EISA_IO_CMP_1_0                     0x0C93
  147 #define PDQ_EISA_IO_CMP_1_1                     0x0C94
  148 #define PDQ_EISA_IO_CMP_2_0                     0x0C95
  149 #define PDQ_EISA_IO_CMP_2_1                     0x0C96
  150 #define PDQ_EISA_IO_CMP_3_0                     0x0C97
  151 #define PDQ_EISA_IO_CMP_3_1                     0x0C98
  152 #define PDQ_EISA_IO_ADD_MASK_0_0                0x0C99
  153 #define PDQ_EISA_IO_ADD_MASK_0_1                0x0C9A
  154 #define PDQ_EISA_IO_ADD_MASK_1_0                0x0C9B
  155 #define PDQ_EISA_IO_ADD_MASK_1_1                0x0C9C
  156 #define PDQ_EISA_IO_ADD_MASK_2_0                0x0C9D
  157 #define PDQ_EISA_IO_ADD_MASK_2_1                0x0C9E
  158 #define PDQ_EISA_IO_ADD_MASK_3_0                0x0C9F
  159 #define PDQ_EISA_IO_ADD_MASK_3_1                0x0CA0
  160 #define PDQ_EISA_MOD_CONFIG_1                   0x0CA1
  161 #define PDQ_EISA_MOD_CONFIG_2                   0x0CA2
  162 #define PDQ_EISA_MOD_CONFIG_3                   0x0CA3
  163 #define PDQ_EISA_MOD_CONFIG_4                   0x0CA4
  164 #define PDQ_EISA_MOD_CONFIG_5                   0x0CA5
  165 #define PDQ_EISA_MOD_CONFIG_6                   0x0CA6
  166 #define PDQ_EISA_MOD_CONFIG_7                   0x0CA7
  167 #define PDQ_EISA_DIP_SWITCH                     0x0CA8
  168 #define PDQ_EISA_IO_CONFIG_STAT_0               0x0CA9
  169 #define PDQ_EISA_IO_CONFIG_STAT_1               0x0CAA
  170 #define PDQ_EISA_DMA_CONFIG                     0x0CAB
  171 #define PDQ_EISA_INPUT_PORT                     0x0CAC
  172 #define PDQ_EISA_OUTPUT_PORT                    0x0CAD
  173 #define PDQ_EISA_FUNCTION_CTRL                  0x0CAE
  174 
  175 #define PDQ_TC_CSR_OFFSET                       0x00100000
  176 #define PDQ_TC_CSR_SPACE                        0x0040
  177 #define PDQ_FBUS_CSR_OFFSET                     0x00200000
  178 #define PDQ_FBUS_CSR_SPACE                      0x0080
  179 
  180 /*
  181  * Port Reset Data A Definitions
  182  */
  183 #define PDQ_PRESET_SKIP_SELFTEST        0x0004
  184 #define PDQ_PRESET_SOFT_RESET           0x0002
  185 #define PDQ_PRESET_UPGRADE              0x0001
  186 /*
  187  * Port Control Register Definitions
  188  */
  189 #define PDQ_PCTL_CMD_ERROR              0x8000
  190 #define PDQ_PCTL_FLASH_BLAST            0x4000
  191 #define PDQ_PCTL_HALT                   0x2000
  192 #define PDQ_PCTL_COPY_DATA              0x1000
  193 #define PDQ_PCTL_ERROR_LOG_START        0x0800
  194 #define PDQ_PCTL_ERROR_LOG_READ         0x0400
  195 #define PDQ_PCTL_XMT_DATA_FLUSH_DONE    0x0200
  196 #define PDQ_PCTL_DMA_INIT               0x0100
  197 #define PDQ_DMA_INIT_LW_BSWAP_DATA      0x02
  198 #define PDQ_DMA_INIT_LW_BSWAP_LITERAL   0x01
  199 #define PDQ_PCTL_INIT_START             0x0080
  200 #define PDQ_PCTL_CONSUMER_BLOCK         0x0040
  201 #define PDQ_PCTL_DMA_UNINIT             0x0020
  202 #define PDQ_PCTL_RING_MEMBER            0x0010
  203 #define PDQ_PCTL_MLA_READ               0x0008
  204 #define PDQ_PCTL_FW_REV_READ            0x0004
  205 #define PDQ_PCTL_DEVICE_SPECIFIC        0x0002
  206 #define PDQ_PCTL_SUB_CMD                0x0001
  207 
  208 typedef enum {
  209     PDQ_SUB_CMD_LINK_UNINIT=1,
  210     PDQ_SUB_CMD_DMA_BURST_SIZE_SET=2,
  211     PDQ_SUB_CMD_PDQ_REV_GET=4
  212 } pdq_sub_cmd_t;
  213 
  214 typedef enum {
  215     PDQ_DMA_BURST_4LW=0,
  216     PDQ_DMA_BURST_8LW=1,
  217     PDQ_DMA_BURST_16LW=2,
  218     PDQ_DMA_BURST_32LW=3
  219 } pdq_dma_burst_size_t;
  220 
  221 typedef enum {
  222     PDQ_CHIP_REV_A_B_OR_C=0,
  223     PDQ_CHIP_REV_D=2,
  224     PDQ_CHIP_REV_E=4
  225 } pdq_chip_rev_t;
  226 /*
  227  * Port Status Register Definitions
  228  */
  229 #define PDQ_PSTS_RCV_DATA_PENDING       0x80000000ul
  230 #define PDQ_PSTS_XMT_DATA_PENDING       0x40000000ul
  231 #define PDQ_PSTS_HOST_SMT_PENDING       0x20000000ul
  232 #define PDQ_PSTS_UNSOL_PENDING          0x10000000ul
  233 #define PDQ_PSTS_CMD_RSP_PENDING        0x08000000ul
  234 #define PDQ_PSTS_CMD_REQ_PENDING        0x04000000ul
  235 #define PDQ_PSTS_TYPE_0_PENDING         0x02000000ul
  236 #define PDQ_PSTS_INTR_PENDING           0xFE000000ul
  237 #define PDQ_PSTS_ADAPTER_STATE(sts)     ((pdq_state_t) (((sts) >> 8) & 0x07))
  238 #define PDQ_PSTS_HALT_ID(sts)           ((pdq_halt_code_t) ((sts) & 0xFF))
  239 /*
  240  * Host Interrupt Register Definitions
  241  */
  242 #define PDQ_HOST_INT_TX_ENABLE                  0x80000000ul
  243 #define PDQ_HOST_INT_RX_ENABLE                  0x40000000ul
  244 #define PDQ_HOST_INT_UNSOL_ENABLE               0x20000000ul
  245 #define PDQ_HOST_INT_HOST_SMT_ENABLE            0x10000000ul
  246 #define PDQ_HOST_INT_CMD_RSP_ENABLE             0x08000000ul
  247 #define PDQ_HOST_INT_CMD_RQST_ENABLE            0x04000000ul
  248 
  249 #define PDQ_HOST_INT_1MS                        0x80
  250 #define PDQ_HOST_INT_20MS                       0x40
  251 #define PDQ_HOST_INT_CSR_CMD_DONE               0x20
  252 #define PDQ_HOST_INT_STATE_CHANGE               0x10
  253 #define PDQ_HOST_INT_XMT_DATA_FLUSH             0x08
  254 #define PDQ_HOST_INT_NXM                        0x04
  255 #define PDQ_HOST_INT_PM_PARITY_ERROR            0x02
  256 #define PDQ_HOST_INT_HOST_BUS_PARITY_ERROR      0x01
  257 #define PDQ_HOST_INT_FATAL_ERROR                0x07
  258 
  259 typedef enum {
  260     PDQH_SELFTEST_TIMEOUT=0,
  261     PDQH_HOST_BUS_PARITY_ERROR=1,
  262     PDQH_HOST_DIRECTED_HALT=2,
  263     PDQH_SOFTWARE_FAULT=3,
  264     PDQH_HARDWARE_FAULT=4,
  265     PDQH_PC_TRACE_PATH_TEST=5,
  266     PDQH_DMA_ERROR=6,
  267     PDQH_IMAGE_CRC_ERROR=7,
  268     PDQH_ADAPTER_PROCESSOR_ERROR=8,
  269     PDQH_MAX=9
  270 } pdq_halt_code_t;
  271 
  272 typedef struct {
  273     pdq_uint16_t pdqcb_receives;
  274     pdq_uint16_t pdqcb_transmits;
  275     pdq_uint32_t pdqcb__filler1;
  276     pdq_uint32_t pdqcb_host_smt;
  277     pdq_uint32_t pdqcb__filler2;
  278     pdq_uint32_t pdqcb_unsolicited_event;
  279     pdq_uint32_t pdqcb__filler3;
  280     pdq_uint32_t pdqcb_command_response;
  281     pdq_uint32_t pdqcb__filler4;
  282     pdq_uint32_t pdqcb_command_request;
  283     pdq_uint32_t pdqcb__filler5[7];
  284 } pdq_consumer_block_t;
  285 
  286 typedef struct {
  287     pdq_uint32_t rxd_pa_hi;
  288 #define PDQ_RXDESC_PA_HI(x)     (((x) & 0xffff) <<  0)  /* : 16 */
  289 #define PDQ_RXDESC_SEG_CNT(x)   (((x) & 0x000f) << 16)  /* :  4 */
  290 #define PDQ_RXDESC_SEG_LEN(x)   ((((x) & 0xc) << 27) | (((x) & 0x1ff0) << 16))
  291 #define PDQ_RXDESC_SOP          0x80000000              /* :  1 */
  292     pdq_uint32_t rxd_pa_lo;
  293 } pdq_rxdesc_t;
  294 
  295 #define PDQ_RXS_LEN(x)          (((x) >>  0) & 0x1fff)  /* : 13 */
  296 #define PDQ_RXS_RCC_SS(x)       (((x) >> 13) & 0x0003)  /* :  2 */
  297 #define PDQ_RXS_RCC_DD(x)       (((x) >> 15) & 0x0003)  /* :  2 */
  298 #define PDQ_RXS_RCC_REASON(x)   (((x) >> 17) & 0x0007)  /* :  3 */
  299 #define PDQ_RXS_RCC_BADCRC(x)   (((x) >> 20) & 0x0001)  /* :  1 */
  300 #define PDQ_RXS_RCC_BADPDU(x)   (((x) >> 21) & 0x0001)  /* :  1 */
  301 #define PDQ_RXS_FSB__RSVD(x)    (((x) >> 22) & 0x0003)  /* :  2 */
  302 #define PDQ_RXS_FSB_C(x)        (((x) >> 24) & 0x0001)  /* :  1 */
  303 #define PDQ_RXS_FSB_A(x)        (((x) >> 25) & 0x0001)  /* :  1 */
  304 #define PDQ_RXS_FSB_E(x)        (((x) >> 26) & 0x0001)  /* :  1 */
  305 #define PDQ_RXS_FSC(x)          (((x) >> 27) & 0x0007)  /* :  3 */
  306 #define PDQ_RXS__RSVD(x)        (((x) >> 30) & 0x0003)  /* :  2 */
  307 
  308 #define PDQ_RXS_RCC_DD_NO_MATCH         0x00
  309 #define PDQ_RXS_RCC_DD_PROMISC_MATCH    0x01
  310 #define PDQ_RXS_RCC_DD_CAM_MATCH        0x02
  311 #define PDQ_RXS_RCC_DD_MLA_MATCH        0x03
  312 
  313 typedef struct {
  314     pdq_uint32_t txd_pa_hi;
  315 #define PDQ_TXDESC_PA_HI(x)             (((x) & 0xffff) <<  0)
  316 #define PDQ_TXDESC_SEG_LEN(x)           (((x) & 0x1fff) << 16)
  317 #define PDQ_TXDESC_MBZ                  0x20000000
  318 #define PDQ_TXDESC_EOP                  0x40000000
  319 #define PDQ_TXDESC_SOP                  0x80000000
  320     pdq_uint32_t txd_pa_lo;
  321 } pdq_txdesc_t;
  322 
  323 typedef struct {
  324     pdq_rxdesc_t pdqdb_receives[256];           /* 2048;        0x0000..0x07FF */
  325     pdq_txdesc_t pdqdb_transmits[256];          /* 2048;        0x0800..0x0FFF */
  326     pdq_rxdesc_t pdqdb_host_smt[64];            /*  512;        0x1000..0x11FF */
  327     pdq_rxdesc_t pdqdb_unsolicited_events[16];  /*  128;        0x1200..0x127F */
  328     pdq_rxdesc_t pdqdb_command_responses[16];   /*  128;        0x1280..0x12FF */
  329     pdq_txdesc_t pdqdb_command_requests[16];    /*  128;        0x1300..0x137F */
  330     /*
  331      * The rest of the descriptor block is unused.
  332      * As such we could use it for other things.
  333      */
  334     pdq_uint32_t pdqdb__filler1[16];            /*   64;        0x1380..0x13BF */
  335     pdq_consumer_block_t pdqdb_consumer;        /*   64;        0x13C0..0x13FF */
  336     /*
  337      * The maximum command size is 512 so as long as thes
  338      * command is at least that long all will be fine.
  339      */
  340     pdq_uint32_t pdqdb__filler2[64];            /*  256;        0x1400..0x14FF */
  341     pdq_uint8_t pdqdb_cmd_request_buf[1024];    /* 1024;        0x1500..0x18FF */
  342     pdq_uint8_t pdqdb_cmd_response_buf[1024];   /* 1024;        0x1900..0x1CFF */
  343     pdq_uint32_t pdqdb__filler3[128];           /*  512;        0x1D00..0x1EFF */
  344     pdq_uint8_t pdqdb_tx_hdr[4];                /*    4;        0x1F00..0x1F03 */
  345     pdq_uint32_t pdqdb__filler4[63];            /*  252;        0x1F04..0x1FFF */
  346 } pdq_descriptor_block_t;
  347 
  348 #define PDQ_SIZE_COMMAND_RESPONSE       512
  349 
  350 typedef enum {
  351     PDQC_START=0,
  352     PDQC_FILTER_SET=1,
  353     PDQC_FILTER_GET=2,
  354     PDQC_CHARS_SET=3,
  355     PDQC_STATUS_CHARS_GET=4,
  356     PDQC_COUNTERS_GET=5,
  357     PDQC_COUNTERS_SET=6,
  358     PDQC_ADDR_FILTER_SET=7,
  359     PDQC_ADDR_FILTER_GET=8,
  360     PDQC_ERROR_LOG_CLEAR=9,
  361     PDQC_ERROR_LOG_GET=10,
  362     PDQC_FDDI_MIB_GET=11,
  363     PDQC_DEC_EXT_MIB_GET=12,
  364     PDQC_DEV_SPECIFIC_GET=13,
  365     PDQC_SNMP_SET=14,
  366     PDQC_SMT_MIB_GET=16,
  367     PDQC_SMT_MIB_SET=17,
  368     PDQC_BOGUS_CMD=18
  369 } pdq_cmd_code_t;
  370 
  371 typedef struct {
  372     /*
  373      * These value manage the available space in command/response
  374      * buffer area.
  375      */
  376     pdq_physaddr_t ci_pa_request_bufstart;
  377     pdq_uint8_t *ci_request_bufstart;
  378     pdq_physaddr_t ci_pa_response_bufstart;
  379     pdq_uint8_t *ci_response_bufstart;
  380     /*
  381      * Bitmask of commands to sent to the PDQ
  382      */
  383     pdq_uint32_t ci_pending_commands;
  384     /*
  385      * Variables to maintain the PDQ queues.
  386      */
  387     pdq_uint32_t ci_command_active;
  388     pdq_uint32_t ci_request_producer;
  389     pdq_uint32_t ci_response_producer;
  390     pdq_uint32_t ci_request_completion;
  391     pdq_uint32_t ci_response_completion;
  392     /*
  393      *
  394      */
  395     pdq_physaddr_t ci_pa_request_descriptors;
  396     pdq_physaddr_t ci_pa_response_descriptors;
  397 
  398     pdq_cmd_code_t ci_queued_commands[16];
  399 } pdq_command_info_t;
  400 
  401 #define PDQ_SIZE_UNSOLICITED_EVENT      512
  402 #define PDQ_NUM_UNSOLICITED_EVENTS      (PDQ_OS_PAGESIZE / PDQ_SIZE_UNSOLICITED_EVENT)
  403 
  404 typedef struct _pdq_unsolicited_event_t pdq_unsolicited_event_t;
  405 
  406 typedef struct {
  407     pdq_physaddr_t ui_pa_bufstart;
  408     pdq_physaddr_t ui_pa_descriptors;
  409     pdq_unsolicited_event_t *ui_events;
  410 
  411     pdq_uint32_t ui_free;
  412     pdq_uint32_t ui_producer;
  413     pdq_uint32_t ui_completion;
  414 } pdq_unsolicited_info_t;
  415 
  416 #define PDQ_RX_FC_OFFSET        (sizeof(pdq_uint32_t) + 3)
  417 #define PDQ_RX_SEGCNT           ((PDQ_FDDI_MAX + PDQ_OS_DATABUF_SIZE - 1) / PDQ_OS_DATABUF_SIZE)
  418 #define PDQ_DO_TYPE2_PRODUCER(pdq) \
  419     PDQ_CSR_WRITE(&(pdq)->pdq_csrs, csr_type_2_producer, \
  420           ((pdq)->pdq_rx_info.rx_producer << 0) \
  421         | ((pdq)->pdq_tx_info.tx_producer << 8) \
  422         | ((pdq)->pdq_rx_info.rx_completion << 16) \
  423         | ((pdq)->pdq_tx_info.tx_completion << 24))
  424 
  425 #define PDQ_DO_HOST_SMT_PRODUCER(pdq) \
  426     PDQ_CSR_WRITE(&(pdq)->pdq_csrs, csr_host_smt_producer, \
  427           ((pdq)->pdq_host_smt_info.rx_producer   << 0) \
  428         | ((pdq)->pdq_host_smt_info.rx_completion << 8))\
  429 
  430 #define PDQ_ADVANCE(n, a, m)    ((n) = ((n) + (a)) & (m))
  431 
  432 typedef struct {
  433     void *q_head;
  434     void *q_tail;
  435 } pdq_databuf_queue_t;
  436 
  437 typedef struct {
  438     void *rx_buffers;
  439     pdq_physaddr_t rx_pa_descriptors;
  440 
  441     pdq_uint32_t rx_target;
  442     pdq_uint32_t rx_free;
  443     pdq_uint32_t rx_producer;
  444     pdq_uint32_t rx_completion;
  445 } pdq_rx_info_t;
  446 
  447 typedef struct {
  448     pdq_databuf_queue_t tx_txq;
  449     pdq_txdesc_t tx_hdrdesc;
  450     pdq_uint8_t tx_descriptor_count[256];
  451     pdq_physaddr_t tx_pa_descriptors;
  452 
  453     pdq_uint32_t tx_free;
  454     pdq_uint32_t tx_producer;
  455     pdq_uint32_t tx_completion;
  456 } pdq_tx_info_t;
  457 
  458 typedef struct _pdq_os_ctx_t pdq_os_ctx_t;
  459 struct _pdq_t {
  460     pdq_csrs_t pdq_csrs;
  461     pdq_pci_csrs_t pdq_pci_csrs;
  462     pdq_type_t pdq_type;
  463     pdq_chip_rev_t pdq_chip_rev;
  464     pdq_lanaddr_t pdq_hwaddr;
  465     pdq_fwrev_t pdq_fwrev;
  466     pdq_descriptor_block_t *pdq_dbp;
  467     volatile pdq_consumer_block_t *pdq_cbp;
  468     pdq_uint32_t pdq_intrmask;
  469     pdq_uint32_t pdq_flags;
  470 #define PDQ_PROMISC     0x0001
  471 #define PDQ_ALLMULTI    0x0002
  472 #define PDQ_PASS_SMT    0x0004
  473 #define PDQ_RUNNING     0x0008
  474 #define PDQ_PRINTCHARS  0x0010
  475 #define PDQ_TXOK        0x0020
  476 #define PDQ_WANT_FDX    0x0040
  477 #define PDQ_IS_FDX      0x0080
  478 #define PDQ_IS_ONRING   0x0100
  479     const char *pdq_os_name;
  480     pdq_os_ctx_t *pdq_os_ctx;
  481     pdq_uint32_t pdq_unit;
  482     pdq_command_info_t pdq_command_info;
  483     pdq_unsolicited_info_t pdq_unsolicited_info;
  484     pdq_tx_info_t pdq_tx_info;
  485     pdq_rx_info_t pdq_rx_info;
  486     pdq_rx_info_t pdq_host_smt_info;
  487     void *pdq_receive_buffers[256];
  488     void *pdq_host_smt_buffers[64];
  489     pdq_physaddr_t pdq_pa_consumer_block;
  490     pdq_physaddr_t pdq_pa_descriptor_block;
  491 };
  492 
  493 #define PDQ_DB_BUSPA(pdq, m) \
  494         ((pdq)->pdq_pa_descriptor_block + \
  495                 ((u_int8_t *) (m) - (u_int8_t *) (pdq)->pdq_dbp))
  496 
  497 
  498 typedef enum {
  499     PDQR_SUCCESS=0,
  500     PDQR_FAILURE=1,
  501     PDQR_WARNING=2,
  502     PDQR_LOOP_MODE_BAD=3,
  503     PDQR_ITEM_CODE_BAD=4,
  504     PDQR_TVX_BAD=5,
  505     PDQR_TREQ_BAD=6,
  506     PDQR_RESTRICTED_TOKEN_BAD=7,
  507     PDQR_NO_EOL=12,
  508     PDQR_FILTER_STATE_BAD=13,
  509     PDQR_CMD_TYPE_BAD=14,
  510     PDQR_ADAPTER_STATE_BAD=15,
  511     PDQR_RING_PURGER_BAD=16,
  512     PDQR_LEM_THRESHOLD_BAD=17,
  513     PDQR_LOOP_NOT_SUPPORTED=18,
  514     PDQR_FLUSH_TIME_BAD=19,
  515     PDQR_NOT_YET_IMPLEMENTED=20,
  516     PDQR_CONFIG_POLICY_BAD=21,
  517     PDQR_STATION_ACTION_BAD=22,
  518     PDQR_MAC_ACTION_BAD=23,
  519     PDQR_CON_POLICIES_BAD=24,
  520     PDQR_MAC_LOOP_TIME_BAD=25,
  521     PDQR_TB_MAX_BAD=26,
  522     PDQR_LER_CUTOFF_BAD=27,
  523     PDQR_LER_ALARM_BAD=28,
  524     PDQR_MAC_PATHS_REQ_BAD=29,
  525     PDQR_MAC_T_REQ_BAD=30,
  526     PDQR_EMAC_RING_PURGER_BAD=31,
  527     PDQR_EMAC_RTOKEN_TIMOUT_AD=32,
  528     PDQR_NO_SUCH_ENTRY=33,
  529     PDQR_T_NOTIFY_BAD=34,
  530     PDQR_TR_MAX_EXP_BAD=35,
  531     PDQR_FRAME_ERR_THRESHOLD_BAD=36,
  532     PDQR_MAX_TREQ_BAD=37,
  533     PDQR_FULL_DUPLEX_ENABLE_BAD=38,
  534     PDQR_ITEM_INDEX_BAD=39
  535 } pdq_response_code_t;
  536 
  537 typedef enum {
  538     PDQI_EOL=0,
  539     PDQI_T_REQ=1,
  540     PDQI_TVX=2,
  541     PDQI_RESTRICTED_TOKEN=3,
  542     PDQI_LEM_THRESHOLD=4,
  543     PDQI_RING_PURGER=5,
  544     PDQI_COUNTER_INTERVAL=6,
  545     PDQI_IND_GROUP_PROM=7,
  546     PDQI_GROUP_PROM=8,
  547     PDQI_BROADCAST=9,
  548     PDQI_SMT_PROM=10,
  549     PDQI_SMT_USER=11,
  550     PDQI_RESERVED=12,
  551     PDQI_IMPLEMENTOR=13,
  552     PDQI_LOOPBACK_MODE=14,
  553     PDQI_SMT_CONFIG_POLICY=16,
  554     PDQI_SMT_CONNECTION_POLICY=17,
  555     PDQI_SMT_T_NOTIFY=18,
  556     PDQI_SMT_STATION_ACTION=19,
  557     PDQI_MAC_PATHS_REQUESTED=21,
  558     PDQI_MAC_ACTION=23,
  559     PDQI_PORT_CONNECTION_POLICIES=24,
  560     PDQI_PORT_PATHS_REQUESTED=25,
  561     PDQI_PORT_MAC_LOOP_TIME=26,
  562     PDQI_PORT_TB_MAX=27,
  563     PDQI_PORT_LER_CUTOFF=28,
  564     PDQI_PORT_LER_ALARM=29,
  565     PDQI_PORT_ACTION=30,
  566     PDQI_FLUSH_TIME=32,
  567     PDQI_SMT_USER_DATA=33,
  568     PDQI_SMT_STATUS_REPORT_POLICY=34,
  569     PDQI_SMT_TRACE_MAX_EXPIRATION=35,
  570     PDQI_MAC_FRAME_ERR_THRESHOLD=36,
  571     PDQI_MAC_UNIT_DATA_ENABLE=37,
  572     PDQI_PATH_TVX_LOWER_BOUND=38,
  573     PDQI_PATH_TMAX_LOWER_BOUND=39,
  574     PDQI_PATH_MAX_TREQ=40,
  575     PDQI_MAC_TREQ=41,
  576     PDQI_EMAC_RING_PURGER=42,
  577     PDQI_EMAC_RTOKEN_TIMEOUT=43,
  578     PDQI_FULL_DUPLEX_ENABLE=44
  579 } pdq_item_code_t;
  580 
  581 typedef enum {
  582     PDQSNMP_EOL=0,
  583     PDQSNMP_FULL_DUPLEX_ENABLE=0x2F11
  584 } pdq_snmp_item_code_t;
  585 
  586 enum _pdq_boolean_t {
  587     PDQ_FALSE=0,
  588     PDQ_TRUE=1
  589 };
  590 
  591 typedef enum {
  592     PDQ_FILTER_BLOCK=0,
  593     PDQ_FILTER_PASS=1
  594 } pdq_filter_state_t;
  595 
  596 typedef enum {
  597     PDQ_STATION_TYPE_SAS=0,
  598     PDQ_STATION_TYPE_DAC=1,
  599     PDQ_STATION_TYPE_SAC=2,
  600     PDQ_STATION_TYPE_NAC=3,
  601     PDQ_STATION_TYPE_DAS=4
  602 } pdq_station_type_t;
  603 
  604 typedef enum {
  605     PDQ_STATION_STATE_OFF=0,
  606     PDQ_STATION_STATE_ON=1,
  607     PDQ_STATION_STATE_LOOPBACK=2
  608 } pdq_station_state_t;
  609 
  610 typedef enum {
  611     PDQ_LINK_STATE_OFF_READY=1,
  612     PDQ_LINK_STATE_OFF_FAULT_RECOVERY=2,
  613     PDQ_LINK_STATE_ON_RING_INIT=3,
  614     PDQ_LINK_STATE_ON_RING_RUN=4,
  615     PDQ_LINK_STATE_BROKEN=5
  616 } pdq_link_state_t;
  617 
  618 typedef enum {
  619     PDQ_DA_TEST_STATE_UNKNOWN=0,
  620     PDQ_DA_TEST_STATE_SUCCESS=1,
  621     PDQ_DA_TEST_STATE_DUPLICATE=2
  622 } pdq_da_test_state_t;
  623 
  624 typedef enum {
  625     PDQ_RING_PURGER_STATE_OFF=0,
  626     PDQ_RING_PURGER_STATE_CANDIDATE=1,
  627     PDQ_RING_PURGER_STATE_NON_PURGER=2,
  628     PDQ_RING_PURGER_STATE_PURGER=3
  629 } pdq_ring_purger_state_t;
  630 
  631 typedef enum {
  632     PDQ_FRAME_STRING_MODE_SA_MATCH=0,
  633     PDQ_FRAME_STRING_MODE_FCI_STRIP=1
  634 } pdq_frame_strip_mode_t;
  635 
  636 typedef enum {
  637     PDQ_RING_ERROR_REASON_NO_ERROR=0,
  638     PDQ_RING_ERROR_REASON_RING_INIT_INITIATED=5,
  639     PDQ_RING_ERROR_REASON_RING_INIT_RECEIVED=6,
  640     PDQ_RING_ERROR_REASON_RING_BEACONING_INITIATED=7,
  641     PDQ_RING_ERROR_REASON_DUPLICATE_ADDRESS_DETECTED=8,
  642     PDQ_RING_ERROR_REASON_DUPLICATE_TOKEN_DETECTED=9,
  643     PDQ_RING_ERROR_REASON_RING_PURGER_ERROR=10,
  644     PDQ_RING_ERROR_REASON_FCI_STRIP_ERROR=11,
  645     PDQ_RING_ERROR_REASON_RING_OP_OSCILLATION=12,
  646     PDQ_RING_ERROR_REASON_DIRECTED_BEACON_RECEVIED=13,
  647     PDQ_RING_ERROR_REASON_PC_TRACE_INITIATED=14,
  648     PDQ_RING_ERROR_REASON_PC_TRACE_RECEVIED=15
  649 } pdq_ring_error_reason_t;
  650 
  651 typedef enum {
  652     PDQ_STATION_MODE_NORMAL=0,
  653     PDQ_STATION_MODE_INTERNAL_LOOPBACK=1
  654 } pdq_station_mode_t;
  655 
  656 typedef enum {
  657     PDQ_PHY_TYPE_A=0,
  658     PDQ_PHY_TYPE_B=1,
  659     PDQ_PHY_TYPE_S=2,
  660     PDQ_PHY_TYPE_M=3,
  661     PDQ_PHY_TYPE_UNKNOWN=4
  662 } pdq_phy_type_t;
  663 
  664 typedef enum {
  665     PDQ_PMD_TYPE_ANSI_MUTLI_MODE=0,
  666     PDQ_PMD_TYPE_ANSI_SINGLE_MODE_TYPE_1=1,
  667     PDQ_PMD_TYPE_ANSI_SIGNLE_MODE_TYPE_2=2,
  668     PDQ_PMD_TYPE_ANSI_SONET=3,
  669     PDQ_PMD_TYPE_LOW_POWER=100,
  670     PDQ_PMD_TYPE_THINWIRE=101,
  671     PDQ_PMD_TYPE_SHIELDED_TWISTED_PAIR=102,
  672     PDQ_PMD_TYPE_UNSHIELDED_TWISTED_PAIR=103
  673 } pdq_pmd_type_t;
  674 
  675 typedef enum {
  676     PDQ_PMD_CLASS_ANSI_MULTI_MODE=0,
  677     PDQ_PMD_CLASS_SINGLE_MODE_TYPE_1=1,
  678     PDQ_PMD_CLASS_SINGLE_MODE_TYPE_2=2,
  679     PDQ_PMD_CLASS_SONET=3,
  680     PDQ_PMD_CLASS_LOW_COST_POWER_FIBER=4,
  681     PDQ_PMD_CLASS_TWISTED_PAIR=5,
  682     PDQ_PMD_CLASS_UNKNOWN=6,
  683     PDQ_PMD_CLASS_UNSPECIFIED=7
  684 } pdq_pmd_class_t;
  685 
  686 typedef enum {
  687     PDQ_PHY_STATE_INTERNAL_LOOPBACK=0,
  688     PDQ_PHY_STATE_BROKEN=1,
  689     PDQ_PHY_STATE_OFF_READY=2,
  690     PDQ_PHY_STATE_WAITING=3,
  691     PDQ_PHY_STATE_STARTING=4,
  692     PDQ_PHY_STATE_FAILED=5,
  693     PDQ_PHY_STATE_WATCH=6,
  694     PDQ_PHY_STATE_INUSE=7
  695 } pdq_phy_state_t;
  696 
  697 typedef enum {
  698     PDQ_REJECT_REASON_NONE=0,
  699     PDQ_REJECT_REASON_LOCAL_LCT=1,
  700     PDQ_REJECT_REASON_REMOTE_LCT=2,
  701     PDQ_REJECT_REASON_LCT_BOTH_SIDES=3,
  702     PDQ_REJECT_REASON_LEM_REJECT=4,
  703     PDQ_REJECT_REASON_TOPOLOGY_ERROR=5,
  704     PDQ_REJECT_REASON_NOISE_REJECT=6,
  705     PDQ_REJECT_REASON_REMOTE_REJECT=7,
  706     PDQ_REJECT_REASON_TRACE_IN_PROGRESS=8,
  707     PDQ_REJECT_REASON_TRACE_RECEIVED_DISABLED=9,
  708     PDQ_REJECT_REASON_STANDBY=10,
  709     PDQ_REJECT_REASON_LCT_PROTOCOL_ERROR=11
  710 } pdq_reject_reason_t;
  711 
  712 typedef enum {
  713     PDQ_BROKEN_REASON_NONE=0
  714 } pdq_broken_reason_t;
  715 
  716 typedef enum {
  717     PDQ_RI_REASON_TVX_EXPIRED=0,
  718     PDQ_RI_REASON_TRT_EXPIRED=1,
  719     PDQ_RI_REASON_RING_PURGER_ELECTION_ATTEMPT_LIMIT_EXCEEDED=2,
  720     PDQ_RI_REASON_PURGE_ERROR_LIMIT_EXCEEDED=3,
  721     PDQ_RI_REASON_RESTRICTED_TOKEN_TIMEOUT=4
  722 } pdq_ri_reason_t;
  723 
  724 typedef enum {
  725     PDQ_LCT_DIRECTION_LOCAL_LCT=0,
  726     PDQ_LCT_DIRECTION_REMOTE_LCT=1,
  727     PDQ_LCT_DIRECTION_LCT_BOTH_SIDES=2
  728 } pdq_lct_direction_t;
  729 
  730 typedef enum {
  731     PDQ_PORT_A=0,
  732     PDQ_PORT_B=1
  733 } pdq_port_type_t;
  734 
  735 typedef struct {
  736     pdq_uint8_t station_id_bytes[8];
  737 } pdq_station_id_t;
  738 
  739 typedef pdq_uint32_t pdq_fdditimer_t;
  740 /*
  741  * Command format for Start, Filter_Get, ... commands
  742  */
  743 typedef struct {
  744     pdq_cmd_code_t generic_op;
  745 } pdq_cmd_generic_t;
  746 
  747 /*
  748  * Response format for Start, Filter_Set, ... commands
  749  */
  750 typedef struct {
  751     pdq_uint32_t generic_reserved;
  752     pdq_cmd_code_t generic_op;
  753     pdq_response_code_t generic_status;
  754 } pdq_response_generic_t;
  755 
  756 /*
  757  * Command format for Filter_Set command
  758  */
  759 typedef struct {
  760     pdq_cmd_code_t filter_set_op;
  761     struct {
  762         pdq_item_code_t item_code;
  763         pdq_filter_state_t filter_state;
  764     } filter_set_items[7];
  765     pdq_item_code_t filter_set_eol_item_code;
  766 } pdq_cmd_filter_set_t;
  767 
  768 /*
  769  * Response format for Filter_Get command.
  770  */
  771 typedef struct {
  772     pdq_uint32_t filter_get_reserved;
  773     pdq_cmd_code_t filter_get_op;
  774     pdq_response_code_t filter_get_status;
  775     pdq_filter_state_t filter_get_ind_group_prom;
  776     pdq_filter_state_t filter_get_group_prom;
  777     pdq_filter_state_t filter_get_broadcast_all;
  778     pdq_filter_state_t filter_get_smt_prom;
  779     pdq_filter_state_t filter_get_smt_user;
  780     pdq_filter_state_t filter_get_reserved_all;
  781     pdq_filter_state_t filter_get_implementor_all;
  782 } pdq_response_filter_get_t;
  783 
  784 #define PDQ_SIZE_RESPONSE_FILTER_GET    0x28
  785 
  786 typedef struct {
  787     pdq_cmd_code_t chars_set_op;
  788     struct {
  789         pdq_item_code_t item_code;
  790         pdq_uint32_t item_value;
  791         pdq_port_type_t item_port;
  792     } chars_set_items[1];
  793     pdq_item_code_t chars_set_eol_item_code;
  794 } pdq_cmd_chars_set_t;
  795 
  796 typedef struct {
  797     pdq_cmd_code_t addr_filter_set_op;
  798     pdq_lanaddr_t addr_filter_set_addresses[62];
  799 } pdq_cmd_addr_filter_set_t;
  800 
  801 #define PDQ_SIZE_CMD_ADDR_FILTER_SET    0x1F4
  802 
  803 typedef struct {
  804     pdq_uint32_t addr_filter_get_reserved;
  805     pdq_cmd_code_t addr_filter_get_op;
  806     pdq_response_code_t addr_filter_get_status;
  807     pdq_lanaddr_t addr_filter_get_addresses[62];
  808 } pdq_response_addr_filter_get_t;
  809 
  810 #define PDQ_SIZE_RESPONSE_ADDR_FILTER_GET       0x1FC
  811 
  812 typedef struct {
  813     pdq_uint32_t status_chars_get_reserved;
  814     pdq_cmd_code_t status_chars_get_op;
  815     pdq_response_code_t status_chars_get_status;
  816     struct {
  817         /* Station Characteristic Attributes */
  818         pdq_station_id_t station_id;
  819         pdq_station_type_t station_type;
  820         pdq_uint32_t smt_version_id;
  821         pdq_uint32_t smt_max_version_id;
  822         pdq_uint32_t smt_min_version_id;
  823         /* Station Status Attributes */
  824         pdq_station_state_t station_state;
  825         /* Link Characteristic Attributes */
  826         pdq_lanaddr_t link_address;
  827         pdq_fdditimer_t t_req;
  828         pdq_fdditimer_t tvx;
  829         pdq_fdditimer_t restricted_token_timeout;
  830         pdq_boolean_t ring_purger_enable;
  831         pdq_link_state_t link_state;
  832         pdq_fdditimer_t negotiated_trt;
  833         pdq_da_test_state_t dup_addr_flag;
  834         /* Link Status Attributes */
  835         pdq_lanaddr_t upstream_neighbor;
  836         pdq_lanaddr_t old_upstream_neighbor;
  837         pdq_boolean_t upstream_neighbor_dup_addr_flag;
  838         pdq_lanaddr_t downstream_neighbor;
  839         pdq_lanaddr_t old_downstream_neighbor;
  840         pdq_ring_purger_state_t ring_purger_state;
  841         pdq_frame_strip_mode_t frame_strip_mode;
  842         pdq_ring_error_reason_t ring_error_reason;
  843         pdq_boolean_t loopback;
  844         pdq_fdditimer_t ring_latency;
  845         pdq_lanaddr_t last_dir_beacon_sa;
  846         pdq_lanaddr_t last_dir_beacon_una;
  847         /* Phy Characteristic Attributes */
  848         pdq_phy_type_t phy_type[2];
  849         pdq_pmd_type_t pmd_type[2];
  850         pdq_uint32_t lem_threshold[2];
  851         /* Phy Status Attributes */
  852         pdq_phy_state_t phy_state[2];
  853         pdq_phy_type_t neighbor_phy_type[2];
  854         pdq_uint32_t link_error_estimate[2];
  855         pdq_broken_reason_t broken_reason[2];
  856         pdq_reject_reason_t reject_reason[2];
  857         /* Miscellaneous */
  858         pdq_uint32_t counter_interval;
  859         pdq_fwrev_t module_rev;
  860         pdq_fwrev_t firmware_rev;
  861         pdq_uint32_t mop_device_type;
  862         pdq_uint32_t fddi_led[2];
  863         pdq_uint32_t flush;
  864     } status_chars_get;
  865 } pdq_response_status_chars_get_t;
  866 
  867 #define PDQ_SIZE_RESPONSE_STATUS_CHARS_GET      0xF0
  868 
  869 typedef struct {
  870     pdq_uint32_t fddi_mib_get_reserved;
  871     pdq_cmd_code_t fddi_mib_get_op;
  872     pdq_response_code_t fddi_mib_get_status;
  873     struct {
  874         /* SMT Objects */
  875         pdq_station_id_t smt_station_id;
  876         pdq_uint32_t smt_op_version_id;
  877         pdq_uint32_t smt_hi_version_id;
  878         pdq_uint32_t smt_lo_version_id;
  879         pdq_uint32_t smt_mac_ct;
  880         pdq_uint32_t smt_non_master_ct;
  881         pdq_uint32_t smt_master_ct;
  882         pdq_uint32_t smt_paths_available;
  883         pdq_uint32_t smt_config_capabilities;
  884         pdq_uint32_t smt_config_policy;
  885         pdq_uint32_t smt_connection_policy;
  886         pdq_uint32_t smt_t_notify;
  887         pdq_uint32_t smt_status_reporting;
  888         pdq_uint32_t smt_ecm_state;
  889         pdq_uint32_t smt_cf_state;
  890         pdq_uint32_t smt_hold_state;
  891         pdq_uint32_t smt_remote_disconnect_flag;
  892         pdq_uint32_t smt_station_action;
  893         /* MAC Objects */
  894         pdq_uint32_t mac_frame_status_capabilities;
  895         pdq_uint32_t mac_t_max_greatest_lower_bound;
  896         pdq_uint32_t mac_tvx_greatest_lower_bound;
  897         pdq_uint32_t mac_paths_available;
  898         pdq_uint32_t mac_current_path;
  899         pdq_lanaddr_t mac_upstream_neighbor;
  900         pdq_lanaddr_t mac_old_upstream_neighbor;
  901         pdq_uint32_t mac_dup_addr_test;
  902         pdq_uint32_t mac_paths_requested;
  903         pdq_uint32_t mac_downstream_port_type;
  904         pdq_lanaddr_t mac_smt_address;
  905         pdq_uint32_t mac_t_req;
  906         pdq_uint32_t mac_t_neg;
  907         pdq_uint32_t mac_t_max;
  908         pdq_uint32_t mac_tvx_value;
  909         pdq_uint32_t mac_t_min;
  910         pdq_uint32_t mac_current_frame_status;
  911         pdq_uint32_t mac_frame_error_threshold;
  912         pdq_uint32_t mac_frame_error_ratio;
  913         pdq_uint32_t mac_rmt_state;
  914         pdq_uint32_t mac_da_flag;
  915         pdq_uint32_t mac_una_da_flag;
  916         pdq_uint32_t mac_frame_condition;
  917         pdq_uint32_t mac_chip_set;
  918         pdq_uint32_t mac_action;
  919         /* Port Objects */
  920         pdq_uint32_t port_pc_type[2];
  921         pdq_uint32_t port_pc_neighbor[2];
  922         pdq_uint32_t port_connection_policies[2];
  923         pdq_uint32_t port_remote_mac_indicated[2];
  924         pdq_uint32_t port_ce_state[2];
  925         pdq_uint32_t port_paths_requested[2];
  926         pdq_uint32_t port_mac_placement[2];
  927         pdq_uint32_t port_available_paths[2];
  928         pdq_uint32_t port_mac_loop_time[2];
  929         pdq_uint32_t port_tb_max[2];
  930         pdq_uint32_t port_bs_flag[2];
  931         pdq_uint32_t port_ler_estimate[2];
  932         pdq_uint32_t port_ler_cutoff[2];
  933         pdq_uint32_t port_ler_alarm[2];
  934         pdq_uint32_t port_connect_state[2];
  935         pdq_uint32_t port_pcm_state[2];
  936         pdq_uint32_t port_pc_withhold[2];
  937         pdq_uint32_t port_ler_condition[2];
  938         pdq_uint32_t port_chip_set[2];
  939         pdq_uint32_t port_action[2];
  940         /* Attachment Objects */
  941         pdq_uint32_t attachment_class;
  942         pdq_uint32_t attachment_optical_bypass_present;
  943         pdq_uint32_t attachment_imax_expiration;
  944         pdq_uint32_t attachment_inserted_status;
  945         pdq_uint32_t attachment_insert_policy;
  946     } fddi_mib_get;
  947 } pdq_response_fddi_mib_get_t;
  948 
  949 #define PDQ_SIZE_RESPONSE_FDDI_MIB_GET  0x17C
  950 
  951 typedef enum {
  952     PDQ_FDX_STATE_IDLE=0,
  953     PDQ_FDX_STATE_REQUEST=1,
  954     PDQ_FDX_STATE_CONFIRM=2,
  955     PDQ_FDX_STATE_OPERATION=3
  956 } pdq_fdx_state_t;
  957 
  958 typedef struct {
  959     pdq_uint32_t dec_ext_mib_get_reserved;
  960     pdq_cmd_code_t dec_ext_mib_get_op;
  961     pdq_response_code_t dec_ext_mib_get_response;
  962     struct {
  963         /* SMT Objects */
  964         pdq_uint32_t esmt_station_type;
  965         /* MAC Objects */
  966         pdq_uint32_t emac_link_state;
  967         pdq_uint32_t emac_ring_purger_state;
  968         pdq_uint32_t emac_ring_purger_enable;
  969         pdq_uint32_t emac_frame_strip_mode;
  970         pdq_uint32_t emac_ring_error_reason;
  971         pdq_uint32_t emac_upstream_nbr_dupl_address_flag;
  972         pdq_uint32_t emac_restricted_token_timeout;
  973         /* Port Objects */
  974         pdq_uint32_t eport_pmd_type[2];
  975         pdq_uint32_t eport_phy_state[2];
  976         pdq_uint32_t eport_reject_reason[2];
  977         /* Full Duplex Objects */
  978         pdq_boolean_t fdx_enable;
  979         pdq_boolean_t fdx_operational;
  980         pdq_fdx_state_t fdx_state;
  981     } dec_ext_mib_get;
  982 } pdq_response_dec_ext_mib_get_t;
  983 
  984 #define PDQ_SIZE_RESPONSE_DEC_EXT_MIB_GET       0x50
  985 
  986 typedef struct {
  987     pdq_cmd_code_t snmp_set_op;
  988     struct {
  989         pdq_item_code_t item_code;
  990         pdq_uint32_t item_value;
  991         pdq_port_type_t item_port;
  992     } snmp_set_items[7];
  993     pdq_item_code_t snmp_set_eol_item_code;
  994 } pdq_cmd_snmp_set_t;
  995 
  996 typedef enum {
  997     PDQ_CALLER_ID_NONE=0,
  998     PDQ_CALLER_ID_SELFTEST=1,
  999     PDQ_CALLER_ID_MFG=2,
 1000     PDQ_CALLER_ID_FIRMWARE=5,
 1001     PDQ_CALLER_ID_CONSOLE=8
 1002 } pdq_caller_id_t;
 1003 
 1004 typedef struct {
 1005     pdq_uint32_t error_log_get__reserved;
 1006     pdq_cmd_code_t error_log_get_op;
 1007     pdq_response_code_t error_log_get_status;
 1008     /* Error Header */
 1009     pdq_uint32_t error_log_get_event_status;
 1010     /* Event Information Block */
 1011     pdq_caller_id_t error_log_get_caller_id;
 1012     pdq_uint32_t error_log_get_timestamp[2];
 1013     pdq_uint32_t error_log_get_write_count;
 1014     /* Diagnostic Information */
 1015     pdq_uint32_t error_log_get_fru_implication_mask;
 1016     pdq_uint32_t error_log_get_test_id;
 1017     pdq_uint32_t error_log_get_diag_reserved[6];
 1018     /* Firmware Information */
 1019     pdq_uint32_t error_log_get_fw_reserved[112];
 1020 } pdq_response_error_log_get_t;
 1021 
 1022 
 1023 /*
 1024  * Definitions for the Unsolicited Event Queue.
 1025  */
 1026 typedef enum {
 1027     PDQ_UNSOLICITED_EVENT=0,
 1028     PDQ_UNSOLICITED_COUNTERS=1
 1029 } pdq_event_t;
 1030 
 1031 typedef enum {
 1032     PDQ_ENTITY_STATION=0,
 1033     PDQ_ENTITY_LINK=1,
 1034     PDQ_ENTITY_PHY_PORT=2,
 1035     PDQ_ENTITY_MAX=3
 1036 } pdq_entity_t;
 1037 
 1038 typedef enum {
 1039     PDQ_STATION_EVENT_TRACE_RECEIVED=1,
 1040     PDQ_STATION_EVENT_MAX=2
 1041 } pdq_station_event_t;
 1042 
 1043 typedef enum {
 1044     PDQ_STATION_EVENT_ARGUMENT_REASON=0,        /* pdq_uint32_t */
 1045     PDQ_STATION_EVENT_ARGUMENT_EOL=0xFF
 1046 } pdq_station_event_argument_t;
 1047 
 1048 typedef enum {
 1049     PDQ_LINK_EVENT_TRANSMIT_UNDERRUN=0,
 1050     PDQ_LINK_EVENT_TRANSMIT_FAILED=1,
 1051     PDQ_LINK_EVENT_BLOCK_CHECK_ERROR=2,
 1052     PDQ_LINK_EVENT_FRAME_STATUS_ERROR=3,
 1053     PDQ_LINK_EVENT_PDU_LENGTH_ERROR=4,
 1054     PDQ_LINK_EVENT_RECEIVE_DATA_OVERRUN=7,
 1055     PDQ_LINK_EVENT_NO_USER_BUFFER=9,
 1056     PDQ_LINK_EVENT_RING_INITIALIZATION_INITIATED=10,
 1057     PDQ_LINK_EVENT_RING_INITIALIZATION_RECEIVED=11,
 1058     PDQ_LINK_EVENT_RING_BEACON_INITIATED=12,
 1059     PDQ_LINK_EVENT_DUPLICATE_ADDRESS_FAILURE=13,
 1060     PDQ_LINK_EVENT_DUPLICATE_TOKEN_DETECTED=14,
 1061     PDQ_LINK_EVENT_RING_PURGE_ERROR=15,
 1062     PDQ_LINK_EVENT_FCI_STRIP_ERROR=16,
 1063     PDQ_LINK_EVENT_TRACE_INITIATED=17,
 1064     PDQ_LINK_EVENT_DIRECTED_BEACON_RECEIVED=18,
 1065     PDQ_LINK_EVENT_MAX=19
 1066 } pdq_link_event_t;
 1067 
 1068 typedef enum {
 1069     PDQ_LINK_EVENT_ARGUMENT_REASON=0,           /* pdq_rireason_t */
 1070     PDQ_LINK_EVENT_ARGUMENT_DATA_LINK_HEADER=1, /* pdq_dlhdr_t */
 1071     PDQ_LINK_EVENT_ARGUMENT_SOURCE=2,           /* pdq_lanaddr_t */
 1072     PDQ_LINK_EVENT_ARGUMENT_UPSTREAM_NEIGHBOR=3,/* pdq_lanaddr_t */
 1073     PDQ_LINK_EVENT_ARGUMENT_EOL=0xFF
 1074 } pdq_link_event_argument_t;
 1075 
 1076 typedef enum {
 1077     PDQ_PHY_EVENT_LEM_ERROR_MONITOR_REJECT=0,
 1078     PDQ_PHY_EVENT_ELASTICITY_BUFFER_ERROR=1,
 1079     PDQ_PHY_EVENT_LINK_CONFIDENCE_TEST_REJECT=2,
 1080     PDQ_PHY_EVENT_MAX=3
 1081 } pdq_phy_event_t;
 1082 
 1083 typedef enum {
 1084     PDQ_PHY_EVENT_ARGUMENT_DIRECTION=0,         /* pdq_lct_direction_t */
 1085     PDQ_PHY_EVENT_ARGUMENT_EOL=0xFF
 1086 } pdq_phy_event_arguments;
 1087 
 1088 struct _pdq_unsolicited_event_t {
 1089     pdq_uint32_t rvent_reserved;
 1090     pdq_event_t event_type;
 1091     pdq_entity_t event_entity;
 1092     pdq_uint32_t event_index;
 1093     union {
 1094         pdq_station_event_t station_event;
 1095         pdq_link_event_t link_event;
 1096         pdq_phy_event_t phy_event;
 1097         pdq_uint32_t value;
 1098     } event_code;
 1099     /*
 1100      * The remainder of this event is an argument list.
 1101      */
 1102     pdq_uint32_t event__filler[123];
 1103 };
 1104 
 1105 #endif /* _PDQREG_H */

Cache object: 3da1716fc536e20febea95985a8c5ba8


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.