xref: /titanic_50/usr/src/uts/sun4v/sys/glvc.h (revision 4ab777b1b0f310e59b52a57c79efa0571506942a)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*4ab777b1Swh94709  * Common Development and Distribution License (the "License").
6*4ab777b1Swh94709  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
217c478bd9Sstevel@tonic-gate /*
22*4ab777b1Swh94709  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
247c478bd9Sstevel@tonic-gate  */
257c478bd9Sstevel@tonic-gate 
267c478bd9Sstevel@tonic-gate #ifndef	_GLVC_H
277c478bd9Sstevel@tonic-gate #define	_GLVC_H
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #ifdef __cplusplus
327c478bd9Sstevel@tonic-gate extern "C" {
337c478bd9Sstevel@tonic-gate #endif
347c478bd9Sstevel@tonic-gate 
35*4ab777b1Swh94709 /*
36*4ab777b1Swh94709  * Service channel related Hypervisor function numbers.
37*4ab777b1Swh94709  */
38*4ab777b1Swh94709 #define	SVC_SEND		0x80
39*4ab777b1Swh94709 #define	SVC_RECV		0x81
40*4ab777b1Swh94709 #define	SVC_GETSTATUS		0x82
41*4ab777b1Swh94709 #define	SVC_SETSTATUS		0x83
42*4ab777b1Swh94709 #define	SVC_CLRSTATUS		0x84
43*4ab777b1Swh94709 
44*4ab777b1Swh94709 #ifndef _ASM
45*4ab777b1Swh94709 
46*4ab777b1Swh94709 /*
47*4ab777b1Swh94709  * VSC API versioning.
48*4ab777b1Swh94709  *
49*4ab777b1Swh94709  * Current glvc driver supports VSC API version 1.0.
50*4ab777b1Swh94709  */
51*4ab777b1Swh94709 #define	GLVC_VSC_MAJOR_VER_1	0x1ull
52*4ab777b1Swh94709 #define	GLVC_VSC_MAJOR_VER	GLVC_VSC_MAJOR_VER_1
53*4ab777b1Swh94709 
54*4ab777b1Swh94709 #define	GLVC_VSC_MINOR_VER_0	0x0ull
55*4ab777b1Swh94709 #define	GLVC_VSC_MINOR_VER	GLVC_VSC_MINOR_VER_0
56*4ab777b1Swh94709 
577c478bd9Sstevel@tonic-gate /* for ioctl */
587c478bd9Sstevel@tonic-gate #define	GLVC_XPORT_IOCTL_DATA_PEEK		1
597c478bd9Sstevel@tonic-gate #define	GLVC_XPORT_IOCTL_OPT_OP			2
607c478bd9Sstevel@tonic-gate 
617c478bd9Sstevel@tonic-gate typedef struct glvc_xport_msg_peek {
627c478bd9Sstevel@tonic-gate 	caddr_t		buf;	/* ptr to buffer to hold peeked data */
637c478bd9Sstevel@tonic-gate 	size_t		buflen;	/* number of bytes of peeked data */
647c478bd9Sstevel@tonic-gate 	uint16_t	flags;	/* future control flags - set to 0 */
657c478bd9Sstevel@tonic-gate } glvc_xport_msg_peek_t;
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate typedef struct glvc_xport_msg_peek32 {
687c478bd9Sstevel@tonic-gate 	uint32_t	buf32;	/* 32 bit ptr to buffer to hold peeked data */
697c478bd9Sstevel@tonic-gate 	uint32_t	buflen32;	/* number of bytes of peeked data */
707c478bd9Sstevel@tonic-gate 	uint16_t	flags;		/* future control flags - set to 0 */
717c478bd9Sstevel@tonic-gate } glvc_xport_msg_peek32_t;
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #define	GLVC_XPORT_OPT_GET			1
747c478bd9Sstevel@tonic-gate #define	GLVC_XPORT_OPT_SET			2
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate #define	GLVC_XPORT_OPT_MTU_SZ			1
777c478bd9Sstevel@tonic-gate #define	GLVC_XPORT_OPT_LINGER_TO			2
787c478bd9Sstevel@tonic-gate #define	GLVC_XPORT_OPT_REG_STATUS			3
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate typedef struct glvc_xport_opt_op {
817c478bd9Sstevel@tonic-gate 	int32_t		op_sel;		/* operation selector(ex: GET) */
827c478bd9Sstevel@tonic-gate 	int32_t		opt_sel;	/* option selector (ex: MTU) */
837c478bd9Sstevel@tonic-gate 	uint32_t	opt_val;	/* option value to use */
847c478bd9Sstevel@tonic-gate } glvc_xport_opt_op_t;
857c478bd9Sstevel@tonic-gate 
86*4ab777b1Swh94709 #endif /* _ASM */
87*4ab777b1Swh94709 
887c478bd9Sstevel@tonic-gate #ifdef __cplusplus
897c478bd9Sstevel@tonic-gate }
907c478bd9Sstevel@tonic-gate #endif
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate #endif /* _GLVC_H */
93