a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#ifndef _VMXNET3_H
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define _VMXNET3_H
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/*
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Copyright (C) 2008 Michael Brown <mbrown@fensystems.co.uk>.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * This program is free software; you can redistribute it and/or
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * modify it under the terms of the GNU General Public License as
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * published by the Free Software Foundation; either version 2 of the
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * License, or any later version.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * This program is distributed in the hope that it will be useful, but
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * WITHOUT ANY WARRANTY; without even the implied warranty of
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * General Public License for more details.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * You should have received a copy of the GNU General Public License
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * along with this program; if not, write to the Free Software
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncFILE_LICENCE ( GPL2_OR_LATER );
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/**
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * @file
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * VMware vmxnet3 virtual NIC driver
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#include <ipxe/pci.h>
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Maximum number of TX queues */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_MAX_TX_QUEUES 8
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Maximum number of RX queues */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_MAX_RX_QUEUES 16
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Maximum number of interrupts */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_MAX_INTRS 25
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Maximum packet size */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_MAX_PACKET_LEN 0x4000
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** "PT" PCI BAR address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_PT_BAR PCI_BASE_ADDRESS_0
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** "PT" PCI BAR size */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_PT_LEN 0x1000
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Interrupt Mask Register */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_PT_IMR 0x0
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit producer index */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_PT_TXPROD 0x600
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Rx producer index for ring 1 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_PT_RXPROD 0x800
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Rx producer index for ring 2 */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_PT_RXPROD2 0xa00
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** "VD" PCI BAR address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_BAR PCI_BASE_ADDRESS_1
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** "VD" PCI BAR size */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_LEN 0x1000
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** vmxnet3 Revision Report Selection */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_VRRS 0x0
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** UPT Version Report Selection */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_UVRS 0x8
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Driver Shared Address Low */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_DSAL 0x10
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Driver Shared Address High */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_DSAH 0x18
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Command */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_CMD 0x20
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** MAC Address Low */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_MACL 0x28
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** MAC Address High */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_MACH 0x30
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Interrupt Cause Register */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_ICR 0x38
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Event Cause Register */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VD_ECR 0x40
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Commands */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncenum vmxnet3_command {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_FIRST_SET = 0xcafe0000,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_ACTIVATE_DEV = VMXNET3_CMD_FIRST_SET,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_QUIESCE_DEV,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_RESET_DEV,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_UPDATE_RX_MODE,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_UPDATE_MAC_FILTERS,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_UPDATE_VLAN_FILTERS,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_UPDATE_RSSIDT,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_UPDATE_IML,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_UPDATE_PMCFG,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_UPDATE_FEATURE,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_LOAD_PLUGIN,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_FIRST_GET = 0xf00d0000,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_STATS,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_LINK,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_PERM_MAC_LO,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_PERM_MAC_HI,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_DID_LO,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_DID_HI,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_DEV_EXTRA_INFO,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_CMD_GET_CONF_INTR
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync};
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Events */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncenum vmxnet3_event {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_ECR_RQERR = 0x00000001,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_ECR_TQERR = 0x00000002,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_ECR_LINK = 0x00000004,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_ECR_DIC = 0x00000008,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_ECR_DEBUG = 0x00000010,
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync};
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Miscellaneous configuration descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_misc_config {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Driver version */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t version;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Guest information */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t guest_info;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Version supported */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t version_support;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** UPT version supported */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t upt_version_support;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** UPT features supported */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t upt_features;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Driver-private data address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t driver_data_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Queue descriptors data address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t queue_desc_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Driver-private data length */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t driver_data_len;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Queue descriptors data length */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t queue_desc_len;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Maximum transmission unit */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t mtu;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Maximum number of RX scatter-gather */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint16_t max_num_rx_sg;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Number of TX queues */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t num_tx_queues;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Number of RX queues */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t num_rx_queues;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t reserved0[4];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Driver version magic */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VERSION_MAGIC 0x69505845
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Interrupt configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_interrupt_config {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t mask_mode;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t num_intrs;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t event_intr_index;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t moderation_level[VMXNET3_MAX_INTRS];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t control;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t reserved0[2];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Interrupt control - disable all interrupts */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_IC_DISABLE_ALL 0x1
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive filter configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_rx_filter_config {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Receive filter mode */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t mode;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Multicast filter table length */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint16_t multicast_len;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint16_t reserved0;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Multicast filter table address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t multicast_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** VLAN filter table (one bit per possible VLAN) */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t vlan_filter[512];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive filter mode */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncenum vmxnet3_rx_filter_mode {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_RXM_UCAST = 0x01, /**< Unicast only */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_RXM_MCAST = 0x02, /**< Multicast passing the filters */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_RXM_BCAST = 0x04, /**< Broadcast only */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_RXM_ALL_MULTI = 0x08, /**< All multicast */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync VMXNET3_RXM_PROMISC = 0x10, /**< Promiscuous */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync};
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Variable-length configuration descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_variable_config {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t version;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t length;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Driver shared area */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_shared {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Magic signature */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t magic;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t reserved0;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Miscellaneous configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_misc_config misc;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Interrupt configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_interrupt_config interrupt;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Receive filter configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_rx_filter_config rx_filter;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** RSS configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_variable_config rss;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Pattern-matching configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_variable_config pattern;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Plugin configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_variable_config plugin;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Event notifications */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t ecr;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t reserved1[5];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Alignment of driver shared area */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_SHARED_ALIGN 8
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Driver shared area magic */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_SHARED_MAGIC 0xbabefee1
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_tx_desc {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Flags */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t flags[2];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit generation flag */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_TXF_GEN 0x00004000UL
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit end-of-packet flag */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_TXF_EOP 0x000001000UL
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit completion request flag */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_TXF_CQ 0x000002000UL
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit completion descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_tx_comp {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Index of the end-of-packet descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t index;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t reserved0[2];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Flags */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t flags;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit completion generation flag */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_TXCF_GEN 0x80000000UL
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit queue control */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_tx_queue_control {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t num_deferred;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t threshold;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t reserved0;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit queue configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_tx_queue_config {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Descriptor ring address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t desc_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Data ring address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t immediate_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Completion ring address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t comp_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Driver-private data address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t driver_data_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t reserved0;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Number of descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t num_desc;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Number of data descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t num_immediate;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Number of completion descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t num_comp;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Driver-private data length */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t driver_data_len;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Interrupt index */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t intr_index;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t reserved[7];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit queue statistics */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_tx_stats {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t reserved[10];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_rx_desc {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Flags */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t flags;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t reserved0;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive generation flag */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_RXF_GEN 0x80000000UL
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive completion descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_rx_comp {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Descriptor index */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t index;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** RSS hash value */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t rss;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Length */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t len;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Flags */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t flags;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive completion generation flag */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_RXCF_GEN 0x80000000UL
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive queue control */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_rx_queue_control {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t update_prod;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t reserved0[7];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t reserved1;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive queue configuration */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_rx_queue_config {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Descriptor ring addresses */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t desc_address[2];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Completion ring address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t comp_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Driver-private data address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t driver_data_address;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t reserved0;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Number of descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t num_desc[2];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Number of completion descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t num_comp;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Driver-private data length */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t driver_data_len;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Interrupt index */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t intr_index;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t reserved[7];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive queue statistics */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_rx_stats {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Reserved */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint64_t reserved[10];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Queue status */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_queue_status {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t stopped;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t reserved0[3];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint32_t error;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Transmit queue descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_tx_queue {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_tx_queue_control ctrl;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_tx_queue_config cfg;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_queue_status status;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_tx_stats state;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t reserved[88];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive queue descriptor */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_rx_queue {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_rx_queue_control ctrl;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_rx_queue_config cfg;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_queue_status status;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_rx_stats stats;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync uint8_t reserved[88];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/**
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * Queue descriptor set
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * We use only a single TX and RX queue
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_queues {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Transmit queue descriptor(s) */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_tx_queue tx;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Receive queue descriptor(s) */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_rx_queue rx;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Alignment of queue descriptor set */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_QUEUES_ALIGN 128
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Alignment of rings */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_RING_ALIGN 512
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Number of TX descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_NUM_TX_DESC 32
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Number of TX completion descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_NUM_TX_COMP 32
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Number of RX descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_NUM_RX_DESC 32
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Number of RX completion descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_NUM_RX_COMP 32
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/**
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * DMA areas
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync *
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * These are arranged in order of decreasing alignment, to allow for a
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync * single allocation
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_dma {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** TX descriptor ring */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_tx_desc tx_desc[VMXNET3_NUM_TX_DESC];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** TX completion ring */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_tx_comp tx_comp[VMXNET3_NUM_TX_COMP];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** RX descriptor ring */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_rx_desc rx_desc[VMXNET3_NUM_RX_DESC];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** RX completion ring */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_rx_comp rx_comp[VMXNET3_NUM_RX_COMP];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Queue descriptors */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_queues queues;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Shared area */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_shared shared;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync} __attribute__ (( packed ));
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** DMA area alignment */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_DMA_ALIGN 512
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Producer and consumer counters */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_counters {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Transmit producer counter */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync unsigned int tx_prod;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Transmit completion consumer counter */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync unsigned int tx_cons;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Receive producer counter */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync unsigned int rx_prod;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Receive fill level */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync unsigned int rx_fill;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Receive consumer counter */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync unsigned int rx_cons;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync};
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** A vmxnet3 NIC */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsyncstruct vmxnet3_nic {
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** "PT" register base address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync void *pt;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** "VD" register base address */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync void *vd;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** DMA area */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_dma *dma;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Producer and consumer counters */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct vmxnet3_counters count;
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Transmit I/O buffers */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct io_buffer *tx_iobuf[VMXNET3_NUM_TX_DESC];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync /** Receive I/O buffers */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync struct io_buffer *rx_iobuf[VMXNET3_NUM_RX_DESC];
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync};
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** vmxnet3 version that we support */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_VERSION_SELECT 1
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** UPT version that we support */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_UPT_VERSION_SELECT 1
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** MTU size */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_MTU ( ETH_FRAME_LEN + 4 /* VLAN */ + 4 /* FCS */ )
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Receive ring maximum fill level */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define VMXNET3_RX_FILL 8
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync/** Received packet alignment padding */
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#define NET_IP_ALIGN 2
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync
a734c64bff58bda2fa48c2795453e092167b0ff7vboxsync#endif /* _VMXNET3_H */