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