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 * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
23 * Use is subject to license terms.
24 */
25
26#ifndef	_GLVC_H
27#define	_GLVC_H
28
29#pragma ident	"%Z%%M%	%I%	%E% SMI"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/*
36 * Service channel related Hypervisor function numbers.
37 */
38#define	SVC_SEND		0x80
39#define	SVC_RECV		0x81
40#define	SVC_GETSTATUS		0x82
41#define	SVC_SETSTATUS		0x83
42#define	SVC_CLRSTATUS		0x84
43
44#ifndef _ASM
45
46/*
47 * VSC API versioning.
48 *
49 * Current glvc driver supports VSC API version 1.0.
50 */
51#define	GLVC_VSC_MAJOR_VER_1	0x1ull
52#define	GLVC_VSC_MAJOR_VER	GLVC_VSC_MAJOR_VER_1
53
54#define	GLVC_VSC_MINOR_VER_0	0x0ull
55#define	GLVC_VSC_MINOR_VER	GLVC_VSC_MINOR_VER_0
56
57/* for ioctl */
58#define	GLVC_XPORT_IOCTL_DATA_PEEK		1
59#define	GLVC_XPORT_IOCTL_OPT_OP			2
60
61typedef struct glvc_xport_msg_peek {
62	caddr_t		buf;	/* ptr to buffer to hold peeked data */
63	size_t		buflen;	/* number of bytes of peeked data */
64	uint16_t	flags;	/* future control flags - set to 0 */
65} glvc_xport_msg_peek_t;
66
67typedef struct glvc_xport_msg_peek32 {
68	uint32_t	buf32;	/* 32 bit ptr to buffer to hold peeked data */
69	uint32_t	buflen32;	/* number of bytes of peeked data */
70	uint16_t	flags;		/* future control flags - set to 0 */
71} glvc_xport_msg_peek32_t;
72
73#define	GLVC_XPORT_OPT_GET			1
74#define	GLVC_XPORT_OPT_SET			2
75
76#define	GLVC_XPORT_OPT_MTU_SZ			1
77#define	GLVC_XPORT_OPT_LINGER_TO			2
78#define	GLVC_XPORT_OPT_REG_STATUS			3
79
80typedef struct glvc_xport_opt_op {
81	int32_t		op_sel;		/* operation selector(ex: GET) */
82	int32_t		opt_sel;	/* option selector (ex: MTU) */
83	uint32_t	opt_val;	/* option value to use */
84} glvc_xport_opt_op_t;
85
86#endif /* _ASM */
87
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* _GLVC_H */
93