xref: /titanic_51/usr/src/uts/sun4v/sys/vsw_hio.h (revision 0b240fcdeb4772e65fed050aee3e3dc63308ae72)
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 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_VSW_HIO_H
28 #define	_VSW_HIO_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 typedef struct vsw_share {
37 	uint32_t	vs_state;	/* State of this share */
38 	uint32_t	vs_index;	/* Index in the shares array */
39 	struct vsw	*vs_vswp;	/* Back pointer to vswp */
40 	uint8_t		vs_req_id;	/* DDS request ID */
41 
42 	/* Cached info */
43 	vsw_port_t	*vs_portp;	/* Corresponding port */
44 	uint64_t	vs_ldcid;	/* LDC to which the share is assigned */
45 	uint64_t	vs_macaddr;	/* Associated MAC addr */
46 	uint64_t	vs_cookie;	/* Share Cookie from alloc_share */
47 
48 	/* physdev's share related info */
49 	mac_share_handle_t	vs_shdl;	/* HIO share handle */
50 	mac_group_info_t	vs_rxginfo;	/* RX group info */
51 	uint64_t		vs_gnum;	/* RX group number */
52 } vsw_share_t;
53 
54 #define	VSW_SHARE_FREE		0x0
55 #define	VSW_SHARE_ASSIGNED	0x1
56 #define	VSW_SHARE_DDS_SENT	0x2
57 #define	VSW_SHARE_DDS_ACKD	0x4
58 
59 /* Hybrid related info */
60 typedef struct vsw_hio {
61 	mac_capab_rings_t	vh_rcapab;	/* Rings capability data */
62 	mac_capab_share_t	vh_scapab;	/* Share capability data */
63 	vsw_share_t		*vh_shares;	/* Array of Shares */
64 	uint32_t		vh_num_shares;	/* Number of shares available */
65 } vsw_hio_t;
66 
67 
68 #ifdef	__cplusplus
69 }
70 #endif
71 
72 #endif	/* _VSW_HIO_H */
73