#ifndef _VMXNET3_H
#define _VMXNET3_H
/*
* Copyright (C) 2008 Michael Brown <mbrown@fensystems.co.uk>.
*
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/**
* @file
*
* VMware vmxnet3 virtual NIC driver
*
*/
/** Maximum number of TX queues */
/** Maximum number of RX queues */
/** Maximum number of interrupts */
/** Maximum packet size */
/** "PT" PCI BAR address */
/** "PT" PCI BAR size */
/** Interrupt Mask Register */
/** Transmit producer index */
/** Rx producer index for ring 1 */
/** Rx producer index for ring 2 */
/** "VD" PCI BAR address */
/** "VD" PCI BAR size */
/** vmxnet3 Revision Report Selection */
/** UPT Version Report Selection */
/** Driver Shared Address Low */
/** Driver Shared Address High */
/** Command */
/** MAC Address Low */
/** MAC Address High */
/** Interrupt Cause Register */
/** Event Cause Register */
/** Commands */
enum vmxnet3_command {
};
/** Events */
enum vmxnet3_event {
};
/** Miscellaneous configuration descriptor */
struct vmxnet3_misc_config {
/** Driver version */
/** Guest information */
/** Version supported */
/** UPT version supported */
/** UPT features supported */
/** Driver-private data address */
/** Queue descriptors data address */
/** Driver-private data length */
/** Queue descriptors data length */
/** Maximum transmission unit */
/** Maximum number of RX scatter-gather */
/** Number of TX queues */
/** Number of RX queues */
/** Reserved */
} __attribute__ (( packed ));
/** Driver version magic */
/** Interrupt configuration */
struct vmxnet3_interrupt_config {
} __attribute__ (( packed ));
/** Interrupt control - disable all interrupts */
/** Receive filter configuration */
struct vmxnet3_rx_filter_config {
/** Receive filter mode */
/** Multicast filter table length */
/** Reserved */
/** Multicast filter table address */
/** VLAN filter table (one bit per possible VLAN) */
} __attribute__ (( packed ));
/** Receive filter mode */
enum vmxnet3_rx_filter_mode {
};
/** Variable-length configuration descriptor */
struct vmxnet3_variable_config {
} __attribute__ (( packed ));
/** Driver shared area */
struct vmxnet3_shared {
/** Magic signature */
/** Reserved */
/** Miscellaneous configuration */
/** Interrupt configuration */
/** Receive filter configuration */
/** RSS configuration */
/** Pattern-matching configuration */
/** Plugin configuration */
/** Event notifications */
/** Reserved */
} __attribute__ (( packed ));
/** Alignment of driver shared area */
/** Driver shared area magic */
/** Transmit descriptor */
struct vmxnet3_tx_desc {
/** Address */
/** Flags */
} __attribute__ (( packed ));
/** Transmit generation flag */
/** Transmit end-of-packet flag */
/** Transmit completion request flag */
/** Transmit completion descriptor */
struct vmxnet3_tx_comp {
/** Index of the end-of-packet descriptor */
/** Reserved */
/** Flags */
} __attribute__ (( packed ));
/** Transmit completion generation flag */
/** Transmit queue control */
struct vmxnet3_tx_queue_control {
} __attribute__ (( packed ));
/** Transmit queue configuration */
struct vmxnet3_tx_queue_config {
/** Descriptor ring address */
/** Data ring address */
/** Completion ring address */
/** Driver-private data address */
/** Reserved */
/** Number of descriptors */
/** Number of data descriptors */
/** Number of completion descriptors */
/** Driver-private data length */
/** Interrupt index */
/** Reserved */
} __attribute__ (( packed ));
/** Transmit queue statistics */
struct vmxnet3_tx_stats {
/** Reserved */
} __attribute__ (( packed ));
/** Receive descriptor */
struct vmxnet3_rx_desc {
/** Address */
/** Flags */
/** Reserved */
} __attribute__ (( packed ));
/** Receive generation flag */
/** Receive completion descriptor */
struct vmxnet3_rx_comp {
/** Descriptor index */
/** RSS hash value */
/** Length */
/** Flags */
} __attribute__ (( packed ));
/** Receive completion generation flag */
/** Receive queue control */
struct vmxnet3_rx_queue_control {
} __attribute__ (( packed ));
/** Receive queue configuration */
struct vmxnet3_rx_queue_config {
/** Descriptor ring addresses */
/** Completion ring address */
/** Driver-private data address */
/** Reserved */
/** Number of descriptors */
/** Number of completion descriptors */
/** Driver-private data length */
/** Interrupt index */
/** Reserved */
} __attribute__ (( packed ));
/** Receive queue statistics */
struct vmxnet3_rx_stats {
/** Reserved */
} __attribute__ (( packed ));
/** Queue status */
struct vmxnet3_queue_status {
} __attribute__ (( packed ));
/** Transmit queue descriptor */
struct vmxnet3_tx_queue {
} __attribute__ (( packed ));
/** Receive queue descriptor */
struct vmxnet3_rx_queue {
} __attribute__ (( packed ));
/**
* Queue descriptor set
*
* We use only a single TX and RX queue
*/
struct vmxnet3_queues {
/** Transmit queue descriptor(s) */
/** Receive queue descriptor(s) */
} __attribute__ (( packed ));
/** Alignment of queue descriptor set */
/** Alignment of rings */
/** Number of TX descriptors */
/** Number of TX completion descriptors */
/** Number of RX descriptors */
/** Number of RX completion descriptors */
/**
* DMA areas
*
* These are arranged in order of decreasing alignment, to allow for a
* single allocation
*/
struct vmxnet3_dma {
/** TX descriptor ring */
/** TX completion ring */
/** RX descriptor ring */
/** RX completion ring */
/** Queue descriptors */
/** Shared area */
} __attribute__ (( packed ));
/** DMA area alignment */
/** Producer and consumer counters */
struct vmxnet3_counters {
/** Transmit producer counter */
unsigned int tx_prod;
/** Transmit completion consumer counter */
unsigned int tx_cons;
/** Receive producer counter */
unsigned int rx_prod;
/** Receive fill level */
unsigned int rx_fill;
/** Receive consumer counter */
unsigned int rx_cons;
};
/** A vmxnet3 NIC */
struct vmxnet3_nic {
/** "PT" register base address */
void *pt;
/** "VD" register base address */
void *vd;
/** DMA area */
/** Producer and consumer counters */
/** Transmit I/O buffers */
/** Receive I/O buffers */
};
/** vmxnet3 version that we support */
/** UPT version that we support */
/** MTU size */
/** Receive ring maximum fill level */
/** Received packet alignment padding */
#endif /* _VMXNET3_H */