xref: /onnv-gate/usr/src/uts/common/sys/vnic_impl.h (revision 11878:ac93462db6d7)
15084Sjohnlev /*
25084Sjohnlev  * CDDL HEADER START
35084Sjohnlev  *
45084Sjohnlev  * The contents of this file are subject to the terms of the
55084Sjohnlev  * Common Development and Distribution License (the "License").
65084Sjohnlev  * You may not use this file except in compliance with the License.
75084Sjohnlev  *
85084Sjohnlev  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
95084Sjohnlev  * or http://www.opensolaris.org/os/licensing.
105084Sjohnlev  * See the License for the specific language governing permissions
115084Sjohnlev  * and limitations under the License.
125084Sjohnlev  *
135084Sjohnlev  * When distributing Covered Code, include this CDDL HEADER in each
145084Sjohnlev  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
155084Sjohnlev  * If applicable, add the following below this CDDL HEADER, with the
165084Sjohnlev  * fields enclosed by brackets "[]" replaced with your own identifying
175084Sjohnlev  * information: Portions Copyright [yyyy] [name of copyright owner]
185084Sjohnlev  *
195084Sjohnlev  * CDDL HEADER END
205084Sjohnlev  */
215084Sjohnlev /*
22*11878SVenu.Iyer@Sun.COM  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
235084Sjohnlev  * Use is subject to license terms.
245084Sjohnlev  */
255084Sjohnlev 
265084Sjohnlev #ifndef	_SYS_VNIC_IMPL_H
275084Sjohnlev #define	_SYS_VNIC_IMPL_H
285084Sjohnlev 
2910616SSebastien.Roy@Sun.COM #include <sys/cred.h>
308275SEric Cheng #include <sys/mac_provider.h>
318275SEric Cheng #include <sys/mac_client.h>
328275SEric Cheng #include <sys/mac_client_priv.h>
335084Sjohnlev #include <sys/vnic.h>
348275SEric Cheng #include <sys/mac_flow.h>
355084Sjohnlev #include <sys/ksynch.h>
365084Sjohnlev 
375084Sjohnlev #ifdef	__cplusplus
385084Sjohnlev extern "C" {
395084Sjohnlev #endif
405084Sjohnlev 
418275SEric Cheng typedef struct vnic_s {
428275SEric Cheng 	datalink_id_t		vn_id;
438275SEric Cheng 	uint32_t
449052SEric Cheng 				vn_enabled : 1,
458275SEric Cheng 				vn_pad_to_bit_31 : 31;
465084Sjohnlev 
478275SEric Cheng 	mac_handle_t		vn_mh;
488275SEric Cheng 	mac_handle_t		vn_lower_mh;
498275SEric Cheng 	mac_client_handle_t	vn_mch;
508275SEric Cheng 	mac_unicast_handle_t	vn_muh;
518275SEric Cheng 	uint32_t		vn_margin;
528275SEric Cheng 	int			vn_slot_id;
538275SEric Cheng 	vnic_mac_addr_type_t	vn_addr_type;
548275SEric Cheng 	uint8_t			vn_addr[MAXMACADDRLEN];
558275SEric Cheng 	size_t			vn_addr_len;
568275SEric Cheng 	uint16_t		vn_vid;
5711076SCathy.Zhou@Sun.COM 	vrid_t			vn_vrid;
5811076SCathy.Zhou@Sun.COM 	int			vn_af;
598275SEric Cheng 	boolean_t		vn_force;
608275SEric Cheng 	datalink_id_t		vn_link_id;
618275SEric Cheng 	mac_notify_handle_t	vn_mnh;
625084Sjohnlev 
638275SEric Cheng 	uint32_t		vn_hcksum_txflags;
645084Sjohnlev } vnic_t;
655084Sjohnlev 
668275SEric Cheng extern int vnic_dev_create(datalink_id_t, datalink_id_t, vnic_mac_addr_type_t *,
6711076SCathy.Zhou@Sun.COM     int *, uchar_t *, int *, uint_t, uint16_t, vrid_t, int,
6811076SCathy.Zhou@Sun.COM     mac_resource_props_t *, uint32_t, vnic_ioc_diag_t *, cred_t *);
695895Syz147064 extern int vnic_dev_modify(datalink_id_t, uint_t, vnic_mac_addr_type_t,
708275SEric Cheng     uint_t, uchar_t *, uint_t, mac_resource_props_t *);
7110616SSebastien.Roy@Sun.COM extern int vnic_dev_delete(datalink_id_t, uint32_t, cred_t *);
725084Sjohnlev 
735084Sjohnlev extern void vnic_dev_init(void);
745084Sjohnlev extern void vnic_dev_fini(void);
755084Sjohnlev extern uint_t vnic_dev_count(void);
765084Sjohnlev extern dev_info_t *vnic_get_dip(void);
775084Sjohnlev 
7810616SSebastien.Roy@Sun.COM extern int vnic_info(vnic_info_t *, cred_t *);
795084Sjohnlev 
805084Sjohnlev #ifdef	__cplusplus
815084Sjohnlev }
825084Sjohnlev #endif
835084Sjohnlev 
845084Sjohnlev #endif	/* _SYS_VNIC_IMPL_H */
85