xref: /illumos-gate/usr/src/uts/sun4v/sys/vnet_mailbox.h (revision 3cb34c601f3ef3016f638574f5982e80c3735c71)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_VNET_MAILBOX_H
28 #define	_SYS_VNET_MAILBOX_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/vio_mailbox.h>
37 #include <sys/ethernet.h>
38 
39 /*
40  * VNET specific Control envelopes: 0x0100 - 0x01FF
41  *	type == VIO_TYPE_CTRL
42  *	subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
43  */
44 #define	VNET_MCAST_INFO		0x0101
45 
46 /*
47  * Vnet/Vswitch device attributes information message.
48  *
49  * tag.msgtype == VIO_TYPE_CTRL
50  * tag.submsgtype = VIO_SUBTYPE_{INFO|ACK|NACK}
51  * tag.subtype_env == VIO_ATTR_INFO
52  */
53 
54 /* Value for 'addr_type' in vnet attribute message */
55 #define	ADDR_TYPE_MAC		0x1
56 
57 typedef struct vnet_attr_msg {
58 	/* Common tag */
59 	vio_msg_tag_t		tag;
60 
61 	/* attributes specific payload */
62 	uint8_t			xfer_mode;	/* data transfer mode */
63 	uint8_t			addr_type;	/* device address type */
64 	uint16_t		ack_freq;	/* ack after rcving # of pkts */
65 	uint32_t		resv1;		/* padding */
66 
67 	uint64_t		addr;		/* device address */
68 	uint64_t		mtu;		/* maximum data xfer unit */
69 
70 	/* padding to align things */
71 	uint64_t		resv2[3];
72 
73 } vnet_attr_msg_t;
74 
75 /*
76  * Vnet/Vswitch enable/disable multicast address msg
77  *
78  * tag.msgtype == VIO_TYPE_CTRL
79  * tag.subtype == VIO_SUBTYPE_{INFO|ACK|NACK}
80  * tag.subtype_env == VNET_MCAST_INFO
81  */
82 #define	VNET_NUM_MCAST	7	/* max # of multicast addresses in the msg */
83 
84 typedef struct vnet_mcast_msg {
85 	/* Common tag */
86 	vio_msg_tag_t		tag;
87 
88 	/* multicast address information */
89 	uint8_t			set;	/* add if set to 1, else remove */
90 	uint8_t			count;	/* number of addrs in the msg */
91 	struct ether_addr	mca[VNET_NUM_MCAST];	/* mcast addrs */
92 	uint32_t		resv1;	/* padding */
93 } vnet_mcast_msg_t;
94 
95 #ifdef __cplusplus
96 }
97 #endif
98 
99 #endif	/* _SYS_VNET_MAILBOX_H */
100