xref: /titanic_44/usr/src/uts/sun4v/sys/vldc.h (revision 942214a9d3873106f26cc86dd4aef6ac6176b830)
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 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _VLDC_H
28 #define	_VLDC_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #include <sys/types.h>
37 #include <sys/ioctl.h>
38 
39 /* Channel IOCTL Commands */
40 
41 #define	VLDC_IOCTL_SHIFT	8
42 #define	VLDC_IOCTL		('1' << VLDC_IOCTL_SHIFT)
43 
44 #define	VLDC_IOCTL_OPT_OP	(VLDC_IOCTL | 0x1)	/* ctrl op */
45 #define	VLDC_IOCTL_READ_COOKIE	(VLDC_IOCTL | 0x2)   	/* read cookie */
46 #define	VLDC_IOCTL_WRITE_COOKIE	(VLDC_IOCTL | 0x3)   	/* write cookie */
47 
48 /* supported ctrl operations */
49 #define	VLDC_OP_GET		0x1	    /* get specified value */
50 #define	VLDC_OP_SET		0x2	    /* set specified value */
51 
52 /* supported ctrl operation options */
53 #define	VLDC_OPT_MTU_SZ		0x1	    /* MTU */
54 #define	VLDC_OPT_STATUS		0x2	    /* port status */
55 #define	VLDC_OPT_MODE		0x3	    /* port channel mode */
56 
57 /* values returned by VLDC_OPT_OP_STATUS */
58 #define	VLDC_PORT_CLOSED	0x1	    /* port is closed */
59 #define	VLDC_PORT_OPEN		0x2	    /* port is already open */
60 #define	VLDC_PORT_READY		0x4	    /* port is open and ready */
61 #define	VLDC_PORT_RESET		0x8	    /* port has been reset */
62 
63 /*
64  * Values for VLDC_OPT_MODE are defined in ldc.h.
65  */
66 
67 /*
68  * Structure that is used by vldc driver and all its clients to communicate
69  * the type and nature of the option as well as for clients to get port
70  * status.
71  */
72 typedef struct vldc_opt_op {
73 	int32_t		op_sel;		/* operation selector(ex: GET) */
74 	int32_t		opt_sel;	/* option selector (ex: MTU) */
75 	uint32_t	opt_val;	/* option value to set or returned */
76 } vldc_opt_op_t;
77 
78 /*
79  * Structure that is used by the LDom manager to download instruction
80  * sequences and read/write new machine descriptions.
81  */
82 typedef struct vldc_data {
83 	uint64_t	src_addr;	/* source address */
84 	uint64_t	dst_addr;	/* destination address */
85 	uint64_t	length;		/* size of transfer */
86 } vldc_data_t;
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif /* _VLDC_H */
93