2 * QEMU VMWARE VMXNET3 paravirtual NIC
4 * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com)
6 * Developed by Daynix Computing LTD (http://www.daynix.com)
9 * Dmitry Fleytman <dmitry@daynix.com>
10 * Tamir Shomer <tamirs@daynix.com>
11 * Yan Vugenfirer <yan@daynix.com>
13 * This work is licensed under the terms of the GNU GPL, version 2.
14 * See the COPYING file in the top-level directory.
17 #ifndef HW_NET_VMXNET3_DEFS_H
18 #define HW_NET_VMXNET3_DEFS_H
21 #include "hw/net/vmxnet3.h"
22 #include "qom/object.h"
24 #define TYPE_VMXNET3 "vmxnet3"
25 typedef struct VMXNET3State VMXNET3State
;
26 #define VMXNET3(obj) OBJECT_CHECK(VMXNET3State, (obj), TYPE_VMXNET3)
28 /* Device state and helper functions */
29 #define VMXNET3_RX_RINGS_PER_QUEUE (2)
31 /* Cyclic ring abstraction */
42 Vmxnet3Ring comp_ring
;
46 struct UPT1_TxStats txq_stats
;
50 Vmxnet3Ring rx_ring
[VMXNET3_RX_RINGS_PER_QUEUE
];
51 Vmxnet3Ring comp_ring
;
54 struct UPT1_RxStats rxq_stats
;
69 MemoryRegion msix_bar
;
71 Vmxnet3RxqDescr rxq_descr
[VMXNET3_DEVICE_MAX_RX_QUEUES
];
72 Vmxnet3TxqDescr txq_descr
[VMXNET3_DEVICE_MAX_TX_QUEUES
];
74 /* Whether MSI-X support was installed successfully */
77 hwaddr temp_shared_guest_driver_memory
;
81 /* This boolean tells whether RX packet being indicated has to */
82 /* be split into head and body chunks from different RX rings */
83 bool rx_packets_compound
;
85 bool rx_vlan_stripping
;
93 /* Maximum number of fragments for indicated TX packets */
94 uint32_t max_tx_frags
;
96 /* Maximum number of fragments for indicated RX packets */
97 uint16_t max_rx_frags
;
99 /* Index for events interrupt */
100 uint8_t event_int_idx
;
102 /* Whether automatic interrupts masking enabled */
103 bool auto_int_masking
;
107 /* TX packets to QEMU interface */
108 struct NetTxPkt
*tx_pkt
;
109 uint32_t offload_mode
;
110 uint32_t cso_or_gso_size
;
114 struct NetRxPkt
*rx_pkt
;
117 bool skip_current_tx_pkt
;
119 uint32_t device_active
;
120 uint32_t last_command
;
122 uint32_t link_status_and_speed
;
124 Vmxnet3IntState interrupt_states
[VMXNET3_MAX_INTRS
];
126 uint32_t temp_mac
; /* To store the low part first */
129 uint32_t vlan_table
[VMXNET3_VFT_SIZE
];
132 uint32_t mcast_list_len
;
133 uint32_t mcast_list_buff_size
; /* needed for live migration. */
135 /* Compatibility flags for migration */
136 uint32_t compat_flags
;