xref: /onnv-gate/usr/src/uts/common/sys/vnic_impl.h (revision 9052:4b2d6dd4ed4c)
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*9052SEric Cheng  * Copyright 2009 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 
298275SEric Cheng #include <sys/mac_provider.h>
308275SEric Cheng #include <sys/mac_client.h>
318275SEric Cheng #include <sys/mac_client_priv.h>
325084Sjohnlev #include <sys/vnic.h>
338275SEric Cheng #include <sys/mac_flow.h>
345084Sjohnlev #include <sys/ksynch.h>
355084Sjohnlev 
365084Sjohnlev #ifdef	__cplusplus
375084Sjohnlev extern "C" {
385084Sjohnlev #endif
395084Sjohnlev 
408275SEric Cheng typedef struct vnic_s {
418275SEric Cheng 	datalink_id_t		vn_id;
428275SEric Cheng 	uint32_t
43*9052SEric Cheng 				vn_enabled : 1,
448275SEric Cheng 				vn_pad_to_bit_31 : 31;
455084Sjohnlev 
468275SEric Cheng 	mac_handle_t		vn_mh;
478275SEric Cheng 	mac_handle_t		vn_lower_mh;
488275SEric Cheng 	mac_client_handle_t	vn_mch;
498275SEric Cheng 	mac_unicast_handle_t	vn_muh;
508275SEric Cheng 	uint32_t		vn_margin;
518275SEric Cheng 	int			vn_slot_id;
528275SEric Cheng 	vnic_mac_addr_type_t	vn_addr_type;
538275SEric Cheng 	uint8_t			vn_addr[MAXMACADDRLEN];
548275SEric Cheng 	size_t			vn_addr_len;
558275SEric Cheng 	uint16_t		vn_vid;
568275SEric Cheng 	boolean_t		vn_force;
578275SEric Cheng 	datalink_id_t		vn_link_id;
588275SEric Cheng 	mac_notify_handle_t	vn_mnh;
595084Sjohnlev 
608275SEric Cheng 	uint32_t		vn_hcksum_txflags;
615084Sjohnlev } vnic_t;
625084Sjohnlev 
635084Sjohnlev #define	vn_madd_naddr		vn_mma_capab.maddr_naddr
645084Sjohnlev #define	vn_maddr_naddrfree	vn_mma_capab.maddr_naddrfree
655084Sjohnlev #define	vn_maddr_flag		vn_mma_capab.maddr_flag
665084Sjohnlev #define	vn_maddr_handle		vn_mma_capab.maddr_handle
675084Sjohnlev #define	vn_maddr_reserve	vn_mma_capab.maddr_reserve
685084Sjohnlev #define	vn_maddr_add		vn_mma_capab.maddr_add
695084Sjohnlev #define	vn_maddr_remove		vn_mma_capab.maddr_remove
705084Sjohnlev #define	vn_maddr_modify		vn_mma_capab.maddr_modify
715084Sjohnlev #define	vn_maddr_get		vn_mma_capab.maddr_get
725084Sjohnlev 
738275SEric Cheng extern int vnic_dev_create(datalink_id_t, datalink_id_t, vnic_mac_addr_type_t *,
748275SEric Cheng     int *, uchar_t *, int *, uint_t, uint16_t, mac_resource_props_t *,
758275SEric Cheng     uint32_t, vnic_ioc_diag_t *);
765895Syz147064 extern int vnic_dev_modify(datalink_id_t, uint_t, vnic_mac_addr_type_t,
778275SEric Cheng     uint_t, uchar_t *, uint_t, mac_resource_props_t *);
788275SEric Cheng extern int vnic_dev_delete(datalink_id_t, uint32_t);
795084Sjohnlev 
805084Sjohnlev extern void vnic_dev_init(void);
815084Sjohnlev extern void vnic_dev_fini(void);
825084Sjohnlev extern uint_t vnic_dev_count(void);
835084Sjohnlev extern dev_info_t *vnic_get_dip(void);
845084Sjohnlev 
858275SEric Cheng extern int vnic_info(vnic_info_t *);
865084Sjohnlev 
875084Sjohnlev #ifdef	__cplusplus
885084Sjohnlev }
895084Sjohnlev #endif
905084Sjohnlev 
915084Sjohnlev #endif	/* _SYS_VNIC_IMPL_H */
92