1e3c97c2cSBryan Venteicher /*- 2e3c97c2cSBryan Venteicher * Copyright (c) 2013 Tsubai Masanari 3e3c97c2cSBryan Venteicher * 4e3c97c2cSBryan Venteicher * Permission to use, copy, modify, and distribute this software for any 5e3c97c2cSBryan Venteicher * purpose with or without fee is hereby granted, provided that the above 6e3c97c2cSBryan Venteicher * copyright notice and this permission notice appear in all copies. 7e3c97c2cSBryan Venteicher * 8e3c97c2cSBryan Venteicher * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9e3c97c2cSBryan Venteicher * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10e3c97c2cSBryan Venteicher * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11e3c97c2cSBryan Venteicher * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12e3c97c2cSBryan Venteicher * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13e3c97c2cSBryan Venteicher * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14e3c97c2cSBryan Venteicher * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15e3c97c2cSBryan Venteicher * 16e3c97c2cSBryan Venteicher * $OpenBSD: src/sys/dev/pci/if_vmxreg.h,v 1.2 2013/06/12 01:07:33 uebayasi Exp $ 17e3c97c2cSBryan Venteicher * 18e3c97c2cSBryan Venteicher * $FreeBSD$ 19e3c97c2cSBryan Venteicher */ 20e3c97c2cSBryan Venteicher 21e3c97c2cSBryan Venteicher #ifndef _IF_VMXREG_H 22e3c97c2cSBryan Venteicher #define _IF_VMXREG_H 23e3c97c2cSBryan Venteicher 24e3c97c2cSBryan Venteicher struct UPT1_TxStats { 25e3c97c2cSBryan Venteicher uint64_t TSO_packets; 26e3c97c2cSBryan Venteicher uint64_t TSO_bytes; 27e3c97c2cSBryan Venteicher uint64_t ucast_packets; 28e3c97c2cSBryan Venteicher uint64_t ucast_bytes; 29e3c97c2cSBryan Venteicher uint64_t mcast_packets; 30e3c97c2cSBryan Venteicher uint64_t mcast_bytes; 31e3c97c2cSBryan Venteicher uint64_t bcast_packets; 32e3c97c2cSBryan Venteicher uint64_t bcast_bytes; 33e3c97c2cSBryan Venteicher uint64_t error; 34e3c97c2cSBryan Venteicher uint64_t discard; 35e3c97c2cSBryan Venteicher } __packed; 36e3c97c2cSBryan Venteicher 37e3c97c2cSBryan Venteicher struct UPT1_RxStats { 38e3c97c2cSBryan Venteicher uint64_t LRO_packets; 39e3c97c2cSBryan Venteicher uint64_t LRO_bytes; 40e3c97c2cSBryan Venteicher uint64_t ucast_packets; 41e3c97c2cSBryan Venteicher uint64_t ucast_bytes; 42e3c97c2cSBryan Venteicher uint64_t mcast_packets; 43e3c97c2cSBryan Venteicher uint64_t mcast_bytes; 44e3c97c2cSBryan Venteicher uint64_t bcast_packets; 45e3c97c2cSBryan Venteicher uint64_t bcast_bytes; 46e3c97c2cSBryan Venteicher uint64_t nobuffer; 47e3c97c2cSBryan Venteicher uint64_t error; 48e3c97c2cSBryan Venteicher } __packed; 49e3c97c2cSBryan Venteicher 50e3c97c2cSBryan Venteicher /* Interrupt moderation levels */ 51e3c97c2cSBryan Venteicher #define UPT1_IMOD_NONE 0 /* No moderation */ 52e3c97c2cSBryan Venteicher #define UPT1_IMOD_HIGHEST 7 /* Least interrupts */ 53e3c97c2cSBryan Venteicher #define UPT1_IMOD_ADAPTIVE 8 /* Adaptive interrupt moderation */ 54e3c97c2cSBryan Venteicher 55e3c97c2cSBryan Venteicher /* Hardware features */ 56e3c97c2cSBryan Venteicher #define UPT1_F_CSUM 0x0001 /* Rx checksum verification */ 57e3c97c2cSBryan Venteicher #define UPT1_F_RSS 0x0002 /* Receive side scaling */ 58e3c97c2cSBryan Venteicher #define UPT1_F_VLAN 0x0004 /* VLAN tag stripping */ 59e3c97c2cSBryan Venteicher #define UPT1_F_LRO 0x0008 /* Large receive offloading */ 60e3c97c2cSBryan Venteicher 61e3c97c2cSBryan Venteicher #define VMXNET3_BAR0_IMASK(irq) (0x000 + (irq) * 8) /* Interrupt mask */ 62e3c97c2cSBryan Venteicher #define VMXNET3_BAR0_TXH(q) (0x600 + (q) * 8) /* Tx head */ 63e3c97c2cSBryan Venteicher #define VMXNET3_BAR0_RXH1(q) (0x800 + (q) * 8) /* Ring1 Rx head */ 64e3c97c2cSBryan Venteicher #define VMXNET3_BAR0_RXH2(q) (0xA00 + (q) * 8) /* Ring2 Rx head */ 65e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_VRRS 0x000 /* VMXNET3 revision report selection */ 66e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_UVRS 0x008 /* UPT version report selection */ 67e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_DSL 0x010 /* Driver shared address low */ 68e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_DSH 0x018 /* Driver shared address high */ 69e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_CMD 0x020 /* Command */ 70e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_MACL 0x028 /* MAC address low */ 71e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_MACH 0x030 /* MAC address high */ 72e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_INTR 0x038 /* Interrupt status */ 73e3c97c2cSBryan Venteicher #define VMXNET3_BAR1_EVENT 0x040 /* Event status */ 74e3c97c2cSBryan Venteicher 75e3c97c2cSBryan Venteicher #define VMXNET3_CMD_ENABLE 0xCAFE0000 /* Enable VMXNET3 */ 76e3c97c2cSBryan Venteicher #define VMXNET3_CMD_DISABLE 0xCAFE0001 /* Disable VMXNET3 */ 77e3c97c2cSBryan Venteicher #define VMXNET3_CMD_RESET 0xCAFE0002 /* Reset device */ 78e3c97c2cSBryan Venteicher #define VMXNET3_CMD_SET_RXMODE 0xCAFE0003 /* Set interface flags */ 79e3c97c2cSBryan Venteicher #define VMXNET3_CMD_SET_FILTER 0xCAFE0004 /* Set address filter */ 80e3c97c2cSBryan Venteicher #define VMXNET3_CMD_VLAN_FILTER 0xCAFE0005 /* Set VLAN filter */ 81e3c97c2cSBryan Venteicher #define VMXNET3_CMD_GET_STATUS 0xF00D0000 /* Get queue errors */ 82e3c97c2cSBryan Venteicher #define VMXNET3_CMD_GET_STATS 0xF00D0001 /* Get queue statistics */ 83e3c97c2cSBryan Venteicher #define VMXNET3_CMD_GET_LINK 0xF00D0002 /* Get link status */ 84e3c97c2cSBryan Venteicher #define VMXNET3_CMD_GET_MACL 0xF00D0003 /* Get MAC address low */ 85e3c97c2cSBryan Venteicher #define VMXNET3_CMD_GET_MACH 0xF00D0004 /* Get MAC address high */ 86e3c97c2cSBryan Venteicher #define VMXNET3_CMD_GET_INTRCFG 0xF00D0008 /* Get interrupt config */ 87e3c97c2cSBryan Venteicher 88e3c97c2cSBryan Venteicher #define VMXNET3_DMADESC_ALIGN 128 89e3c97c2cSBryan Venteicher #define VMXNET3_INIT_GEN 1 90e3c97c2cSBryan Venteicher 91e3c97c2cSBryan Venteicher struct vmxnet3_txdesc { 92e3c97c2cSBryan Venteicher uint64_t addr; 93e3c97c2cSBryan Venteicher 94e3c97c2cSBryan Venteicher uint32_t len:14; 95e3c97c2cSBryan Venteicher uint32_t gen:1; /* Generation */ 96e3c97c2cSBryan Venteicher uint32_t pad1:1; 97e3c97c2cSBryan Venteicher uint32_t dtype:1; /* Descriptor type */ 98e3c97c2cSBryan Venteicher uint32_t pad2:1; 99e3c97c2cSBryan Venteicher uint32_t offload_pos:14; /* Offloading position */ 100e3c97c2cSBryan Venteicher 101e3c97c2cSBryan Venteicher uint32_t hlen:10; /* Header len */ 102e3c97c2cSBryan Venteicher uint32_t offload_mode:2; /* Offloading mode */ 103e3c97c2cSBryan Venteicher uint32_t eop:1; /* End of packet */ 104e3c97c2cSBryan Venteicher uint32_t compreq:1; /* Completion request */ 105e3c97c2cSBryan Venteicher uint32_t pad3:1; 106e3c97c2cSBryan Venteicher uint32_t vtag_mode:1; /* VLAN tag insertion mode */ 107e3c97c2cSBryan Venteicher uint32_t vtag:16; /* VLAN tag */ 108e3c97c2cSBryan Venteicher } __packed; 109e3c97c2cSBryan Venteicher 110e3c97c2cSBryan Venteicher /* Offloading modes */ 111e3c97c2cSBryan Venteicher #define VMXNET3_OM_NONE 0 112e3c97c2cSBryan Venteicher #define VMXNET3_OM_CSUM 2 113e3c97c2cSBryan Venteicher #define VMXNET3_OM_TSO 3 114e3c97c2cSBryan Venteicher 115e3c97c2cSBryan Venteicher struct vmxnet3_txcompdesc { 116e3c97c2cSBryan Venteicher uint32_t eop_idx:12; /* EOP index in Tx ring */ 117e3c97c2cSBryan Venteicher uint32_t pad1:20; 118e3c97c2cSBryan Venteicher 119e3c97c2cSBryan Venteicher uint32_t pad2:32; 120e3c97c2cSBryan Venteicher uint32_t pad3:32; 121e3c97c2cSBryan Venteicher 122e3c97c2cSBryan Venteicher uint32_t rsvd:24; 123e3c97c2cSBryan Venteicher uint32_t type:7; 124e3c97c2cSBryan Venteicher uint32_t gen:1; 125e3c97c2cSBryan Venteicher } __packed; 126e3c97c2cSBryan Venteicher 127e3c97c2cSBryan Venteicher struct vmxnet3_rxdesc { 128e3c97c2cSBryan Venteicher uint64_t addr; 129e3c97c2cSBryan Venteicher 130e3c97c2cSBryan Venteicher uint32_t len:14; 131e3c97c2cSBryan Venteicher uint32_t btype:1; /* Buffer type */ 132e3c97c2cSBryan Venteicher uint32_t dtype:1; /* Descriptor type */ 133e3c97c2cSBryan Venteicher uint32_t rsvd:15; 134e3c97c2cSBryan Venteicher uint32_t gen:1; 135e3c97c2cSBryan Venteicher 136e3c97c2cSBryan Venteicher uint32_t pad1:32; 137e3c97c2cSBryan Venteicher } __packed; 138e3c97c2cSBryan Venteicher 139e3c97c2cSBryan Venteicher /* Buffer types */ 140e3c97c2cSBryan Venteicher #define VMXNET3_BTYPE_HEAD 0 /* Head only */ 141e3c97c2cSBryan Venteicher #define VMXNET3_BTYPE_BODY 1 /* Body only */ 142e3c97c2cSBryan Venteicher 143e3c97c2cSBryan Venteicher struct vmxnet3_rxcompdesc { 144e3c97c2cSBryan Venteicher uint32_t rxd_idx:12; /* Rx descriptor index */ 145e3c97c2cSBryan Venteicher uint32_t pad1:2; 146e3c97c2cSBryan Venteicher uint32_t eop:1; /* End of packet */ 147e3c97c2cSBryan Venteicher uint32_t sop:1; /* Start of packet */ 148e3c97c2cSBryan Venteicher uint32_t qid:10; 149e3c97c2cSBryan Venteicher uint32_t rss_type:4; 150e3c97c2cSBryan Venteicher uint32_t no_csum:1; /* No checksum calculated */ 151e3c97c2cSBryan Venteicher uint32_t pad2:1; 152e3c97c2cSBryan Venteicher 153e3c97c2cSBryan Venteicher uint32_t rss_hash:32; /* RSS hash value */ 154e3c97c2cSBryan Venteicher 155e3c97c2cSBryan Venteicher uint32_t len:14; 156e3c97c2cSBryan Venteicher uint32_t error:1; 157e3c97c2cSBryan Venteicher uint32_t vlan:1; /* 802.1Q VLAN frame */ 158e3c97c2cSBryan Venteicher uint32_t vtag:16; /* VLAN tag */ 159e3c97c2cSBryan Venteicher 160e3c97c2cSBryan Venteicher uint32_t csum:16; 161e3c97c2cSBryan Venteicher uint32_t csum_ok:1; /* TCP/UDP checksum ok */ 162e3c97c2cSBryan Venteicher uint32_t udp:1; 163e3c97c2cSBryan Venteicher uint32_t tcp:1; 164e3c97c2cSBryan Venteicher uint32_t ipcsum_ok:1; /* IP checksum OK */ 165e3c97c2cSBryan Venteicher uint32_t ipv6:1; 166e3c97c2cSBryan Venteicher uint32_t ipv4:1; 167e3c97c2cSBryan Venteicher uint32_t fragment:1; /* IP fragment */ 168e3c97c2cSBryan Venteicher uint32_t fcs:1; /* Frame CRC correct */ 169e3c97c2cSBryan Venteicher uint32_t type:7; 170e3c97c2cSBryan Venteicher uint32_t gen:1; 171e3c97c2cSBryan Venteicher } __packed; 172e3c97c2cSBryan Venteicher 173*e557c1ddSBryan Venteicher #define VMXNET3_RCD_RSS_TYPE_NONE 0 174*e557c1ddSBryan Venteicher #define VMXNET3_RCD_RSS_TYPE_IPV4 1 175*e557c1ddSBryan Venteicher #define VMXNET3_RCD_RSS_TYPE_TCPIPV4 2 176*e557c1ddSBryan Venteicher #define VMXNET3_RCD_RSS_TYPE_IPV6 3 177*e557c1ddSBryan Venteicher #define VMXNET3_RCD_RSS_TYPE_TCPIPV6 4 178*e557c1ddSBryan Venteicher 179e3c97c2cSBryan Venteicher #define VMXNET3_REV1_MAGIC 0XBABEFEE1 180e3c97c2cSBryan Venteicher 181e3c97c2cSBryan Venteicher #define VMXNET3_GOS_UNKNOWN 0x00 182e3c97c2cSBryan Venteicher #define VMXNET3_GOS_LINUX 0x04 183e3c97c2cSBryan Venteicher #define VMXNET3_GOS_WINDOWS 0x08 184e3c97c2cSBryan Venteicher #define VMXNET3_GOS_SOLARIS 0x0C 185e3c97c2cSBryan Venteicher #define VMXNET3_GOS_FREEBSD 0x10 186e3c97c2cSBryan Venteicher #define VMXNET3_GOS_PXE 0x14 187e3c97c2cSBryan Venteicher 188e3c97c2cSBryan Venteicher #define VMXNET3_GOS_32BIT 0x01 189e3c97c2cSBryan Venteicher #define VMXNET3_GOS_64BIT 0x02 190e3c97c2cSBryan Venteicher 191e3c97c2cSBryan Venteicher #define VMXNET3_MAX_TX_QUEUES 8 192e3c97c2cSBryan Venteicher #define VMXNET3_MAX_RX_QUEUES 16 193e3c97c2cSBryan Venteicher #define VMXNET3_MAX_INTRS \ 194e3c97c2cSBryan Venteicher (VMXNET3_MAX_TX_QUEUES + VMXNET3_MAX_RX_QUEUES + 1) 195e3c97c2cSBryan Venteicher 196e3c97c2cSBryan Venteicher #define VMXNET3_ICTRL_DISABLE_ALL 0x01 197e3c97c2cSBryan Venteicher 198e3c97c2cSBryan Venteicher #define VMXNET3_RXMODE_UCAST 0x01 199e3c97c2cSBryan Venteicher #define VMXNET3_RXMODE_MCAST 0x02 200e3c97c2cSBryan Venteicher #define VMXNET3_RXMODE_BCAST 0x04 201e3c97c2cSBryan Venteicher #define VMXNET3_RXMODE_ALLMULTI 0x08 202e3c97c2cSBryan Venteicher #define VMXNET3_RXMODE_PROMISC 0x10 203e3c97c2cSBryan Venteicher 204e3c97c2cSBryan Venteicher #define VMXNET3_EVENT_RQERROR 0x01 205e3c97c2cSBryan Venteicher #define VMXNET3_EVENT_TQERROR 0x02 206e3c97c2cSBryan Venteicher #define VMXNET3_EVENT_LINK 0x04 207e3c97c2cSBryan Venteicher #define VMXNET3_EVENT_DIC 0x08 208e3c97c2cSBryan Venteicher #define VMXNET3_EVENT_DEBUG 0x10 209e3c97c2cSBryan Venteicher 210e3c97c2cSBryan Venteicher #define VMXNET3_MIN_MTU 60 211e3c97c2cSBryan Venteicher #define VMXNET3_MAX_MTU 9000 212e3c97c2cSBryan Venteicher 213e3c97c2cSBryan Venteicher /* Interrupt mask mode. */ 214e3c97c2cSBryan Venteicher #define VMXNET3_IMM_AUTO 0x00 215e3c97c2cSBryan Venteicher #define VMXNET3_IMM_ACTIVE 0x01 216e3c97c2cSBryan Venteicher #define VMXNET3_IMM_LAZY 0x02 217e3c97c2cSBryan Venteicher 218e3c97c2cSBryan Venteicher /* Interrupt type. */ 219e3c97c2cSBryan Venteicher #define VMXNET3_IT_AUTO 0x00 220e3c97c2cSBryan Venteicher #define VMXNET3_IT_LEGACY 0x01 221e3c97c2cSBryan Venteicher #define VMXNET3_IT_MSI 0x02 222e3c97c2cSBryan Venteicher #define VMXNET3_IT_MSIX 0x03 223e3c97c2cSBryan Venteicher 224e3c97c2cSBryan Venteicher struct vmxnet3_driver_shared { 225e3c97c2cSBryan Venteicher uint32_t magic; 226e3c97c2cSBryan Venteicher uint32_t pad1; 227e3c97c2cSBryan Venteicher 228e3c97c2cSBryan Venteicher /* Misc. control */ 229e3c97c2cSBryan Venteicher uint32_t version; /* Driver version */ 230e3c97c2cSBryan Venteicher uint32_t guest; /* Guest OS */ 231e3c97c2cSBryan Venteicher uint32_t vmxnet3_revision; /* Supported VMXNET3 revision */ 232e3c97c2cSBryan Venteicher uint32_t upt_version; /* Supported UPT version */ 233e3c97c2cSBryan Venteicher uint64_t upt_features; 234e3c97c2cSBryan Venteicher uint64_t driver_data; 235e3c97c2cSBryan Venteicher uint64_t queue_shared; 236e3c97c2cSBryan Venteicher uint32_t driver_data_len; 237e3c97c2cSBryan Venteicher uint32_t queue_shared_len; 238e3c97c2cSBryan Venteicher uint32_t mtu; 239e3c97c2cSBryan Venteicher uint16_t nrxsg_max; 240e3c97c2cSBryan Venteicher uint8_t ntxqueue; 241e3c97c2cSBryan Venteicher uint8_t nrxqueue; 242e3c97c2cSBryan Venteicher uint32_t reserved1[4]; 243e3c97c2cSBryan Venteicher 244e3c97c2cSBryan Venteicher /* Interrupt control */ 245e3c97c2cSBryan Venteicher uint8_t automask; 246e3c97c2cSBryan Venteicher uint8_t nintr; 247e3c97c2cSBryan Venteicher uint8_t evintr; 248e3c97c2cSBryan Venteicher uint8_t modlevel[VMXNET3_MAX_INTRS]; 249e3c97c2cSBryan Venteicher uint32_t ictrl; 250e3c97c2cSBryan Venteicher uint32_t reserved2[2]; 251e3c97c2cSBryan Venteicher 252e3c97c2cSBryan Venteicher /* Receive filter parameters */ 253e3c97c2cSBryan Venteicher uint32_t rxmode; 254e3c97c2cSBryan Venteicher uint16_t mcast_tablelen; 255e3c97c2cSBryan Venteicher uint16_t pad2; 256e3c97c2cSBryan Venteicher uint64_t mcast_table; 257e3c97c2cSBryan Venteicher uint32_t vlan_filter[4096 / 32]; 258e3c97c2cSBryan Venteicher 259e3c97c2cSBryan Venteicher struct { 260e3c97c2cSBryan Venteicher uint32_t version; 261e3c97c2cSBryan Venteicher uint32_t len; 262e3c97c2cSBryan Venteicher uint64_t paddr; 263e3c97c2cSBryan Venteicher } rss, pm, plugin; 264e3c97c2cSBryan Venteicher 265e3c97c2cSBryan Venteicher uint32_t event; 266e3c97c2cSBryan Venteicher uint32_t reserved3[5]; 267e3c97c2cSBryan Venteicher } __packed; 268e3c97c2cSBryan Venteicher 269e3c97c2cSBryan Venteicher struct vmxnet3_txq_shared { 270e3c97c2cSBryan Venteicher /* Control */ 271e3c97c2cSBryan Venteicher uint32_t npending; 272e3c97c2cSBryan Venteicher uint32_t intr_threshold; 273e3c97c2cSBryan Venteicher uint64_t reserved1; 274e3c97c2cSBryan Venteicher 275e3c97c2cSBryan Venteicher /* Config */ 276e3c97c2cSBryan Venteicher uint64_t cmd_ring; 277e3c97c2cSBryan Venteicher uint64_t data_ring; 278e3c97c2cSBryan Venteicher uint64_t comp_ring; 279e3c97c2cSBryan Venteicher uint64_t driver_data; 280e3c97c2cSBryan Venteicher uint64_t reserved2; 281e3c97c2cSBryan Venteicher uint32_t cmd_ring_len; 282e3c97c2cSBryan Venteicher uint32_t data_ring_len; 283e3c97c2cSBryan Venteicher uint32_t comp_ring_len; 284e3c97c2cSBryan Venteicher uint32_t driver_data_len; 285e3c97c2cSBryan Venteicher uint8_t intr_idx; 286e3c97c2cSBryan Venteicher uint8_t pad1[7]; 287e3c97c2cSBryan Venteicher 288e3c97c2cSBryan Venteicher /* Queue status */ 289e3c97c2cSBryan Venteicher uint8_t stopped; 290e3c97c2cSBryan Venteicher uint8_t pad2[3]; 291e3c97c2cSBryan Venteicher uint32_t error; 292e3c97c2cSBryan Venteicher 293e3c97c2cSBryan Venteicher struct UPT1_TxStats stats; 294e3c97c2cSBryan Venteicher 295e3c97c2cSBryan Venteicher uint8_t pad3[88]; 296e3c97c2cSBryan Venteicher } __packed; 297e3c97c2cSBryan Venteicher 298e3c97c2cSBryan Venteicher struct vmxnet3_rxq_shared { 299e3c97c2cSBryan Venteicher uint8_t update_rxhead; 300e3c97c2cSBryan Venteicher uint8_t pad1[7]; 301e3c97c2cSBryan Venteicher uint64_t reserved1; 302e3c97c2cSBryan Venteicher 303e3c97c2cSBryan Venteicher uint64_t cmd_ring[2]; 304e3c97c2cSBryan Venteicher uint64_t comp_ring; 305e3c97c2cSBryan Venteicher uint64_t driver_data; 306e3c97c2cSBryan Venteicher uint64_t reserved2; 307e3c97c2cSBryan Venteicher uint32_t cmd_ring_len[2]; 308e3c97c2cSBryan Venteicher uint32_t comp_ring_len; 309e3c97c2cSBryan Venteicher uint32_t driver_data_len; 310e3c97c2cSBryan Venteicher uint8_t intr_idx; 311e3c97c2cSBryan Venteicher uint8_t pad2[7]; 312e3c97c2cSBryan Venteicher 313e3c97c2cSBryan Venteicher uint8_t stopped; 314e3c97c2cSBryan Venteicher uint8_t pad3[3]; 315e3c97c2cSBryan Venteicher uint32_t error; 316e3c97c2cSBryan Venteicher 317e3c97c2cSBryan Venteicher struct UPT1_RxStats stats; 318e3c97c2cSBryan Venteicher 319e3c97c2cSBryan Venteicher uint8_t pad4[88]; 320e3c97c2cSBryan Venteicher } __packed; 321e3c97c2cSBryan Venteicher 322*e557c1ddSBryan Venteicher #define UPT1_RSS_HASH_TYPE_NONE 0x00 323*e557c1ddSBryan Venteicher #define UPT1_RSS_HASH_TYPE_IPV4 0x01 324*e557c1ddSBryan Venteicher #define UPT1_RSS_HASH_TYPE_TCP_IPV4 0x02 325*e557c1ddSBryan Venteicher #define UPT1_RSS_HASH_TYPE_IPV6 0x04 326*e557c1ddSBryan Venteicher #define UPT1_RSS_HASH_TYPE_TCP_IPV6 0x08 327*e557c1ddSBryan Venteicher 328*e557c1ddSBryan Venteicher #define UPT1_RSS_HASH_FUNC_NONE 0x00 329*e557c1ddSBryan Venteicher #define UPT1_RSS_HASH_FUNC_TOEPLITZ 0x01 330*e557c1ddSBryan Venteicher 331*e557c1ddSBryan Venteicher #define UPT1_RSS_MAX_KEY_SIZE 40 332*e557c1ddSBryan Venteicher #define UPT1_RSS_MAX_IND_TABLE_SIZE 128 333*e557c1ddSBryan Venteicher 334*e557c1ddSBryan Venteicher struct vmxnet3_rss_shared { 335*e557c1ddSBryan Venteicher uint16_t hash_type; 336*e557c1ddSBryan Venteicher uint16_t hash_func; 337*e557c1ddSBryan Venteicher uint16_t hash_key_size; 338*e557c1ddSBryan Venteicher uint16_t ind_table_size; 339*e557c1ddSBryan Venteicher uint8_t hash_key[UPT1_RSS_MAX_KEY_SIZE]; 340*e557c1ddSBryan Venteicher uint8_t ind_table[UPT1_RSS_MAX_IND_TABLE_SIZE]; 341*e557c1ddSBryan Venteicher } __packed; 342*e557c1ddSBryan Venteicher 343e3c97c2cSBryan Venteicher #endif /* _IF_VMXREG_H */ 344