xref: /titanic_50/usr/src/uts/sun4v/sys/vldc.h (revision 3af08d828975d7e2581b6829e0eecff14d87a483)
11ae08745Sheppo /*
21ae08745Sheppo  * CDDL HEADER START
31ae08745Sheppo  *
41ae08745Sheppo  * The contents of this file are subject to the terms of the
51ae08745Sheppo  * Common Development and Distribution License (the "License").
61ae08745Sheppo  * You may not use this file except in compliance with the License.
71ae08745Sheppo  *
81ae08745Sheppo  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91ae08745Sheppo  * or http://www.opensolaris.org/os/licensing.
101ae08745Sheppo  * See the License for the specific language governing permissions
111ae08745Sheppo  * and limitations under the License.
121ae08745Sheppo  *
131ae08745Sheppo  * When distributing Covered Code, include this CDDL HEADER in each
141ae08745Sheppo  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151ae08745Sheppo  * If applicable, add the following below this CDDL HEADER, with the
161ae08745Sheppo  * fields enclosed by brackets "[]" replaced with your own identifying
171ae08745Sheppo  * information: Portions Copyright [yyyy] [name of copyright owner]
181ae08745Sheppo  *
191ae08745Sheppo  * CDDL HEADER END
201ae08745Sheppo  */
211ae08745Sheppo 
221ae08745Sheppo /*
231ae08745Sheppo  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
241ae08745Sheppo  * Use is subject to license terms.
251ae08745Sheppo  */
261ae08745Sheppo 
271ae08745Sheppo #ifndef _VLDC_H
281ae08745Sheppo #define	_VLDC_H
291ae08745Sheppo 
301ae08745Sheppo #pragma ident	"%Z%%M%	%I%	%E% SMI"
311ae08745Sheppo 
321ae08745Sheppo #ifdef __cplusplus
331ae08745Sheppo extern "C" {
341ae08745Sheppo #endif
351ae08745Sheppo 
361ae08745Sheppo #include <sys/types.h>
371ae08745Sheppo #include <sys/ioctl.h>
381ae08745Sheppo 
391ae08745Sheppo /* Channel IOCTL Commands */
401ae08745Sheppo 
411ae08745Sheppo #define	VLDC_IOCTL_SHIFT	8
421ae08745Sheppo #define	VLDC_IOCTL		('1' << VLDC_IOCTL_SHIFT)
431ae08745Sheppo 
441ae08745Sheppo #define	VLDC_IOCTL_OPT_OP	(VLDC_IOCTL | 0x1)	/* ctrl op */
451ae08745Sheppo #define	VLDC_IOCTL_READ_COOKIE	(VLDC_IOCTL | 0x2)   	/* read cookie */
461ae08745Sheppo #define	VLDC_IOCTL_WRITE_COOKIE	(VLDC_IOCTL | 0x3)   	/* write cookie */
471ae08745Sheppo 
481ae08745Sheppo /* supported ctrl operations */
491ae08745Sheppo #define	VLDC_OP_GET		0x1	    /* get specified value */
501ae08745Sheppo #define	VLDC_OP_SET		0x2	    /* set specified value */
511ae08745Sheppo 
521ae08745Sheppo /* supported ctrl operation options */
531ae08745Sheppo #define	VLDC_OPT_MTU_SZ		0x1	    /* MTU */
541ae08745Sheppo #define	VLDC_OPT_STATUS		0x2	    /* port status */
551ae08745Sheppo #define	VLDC_OPT_MODE		0x3	    /* port channel mode */
561ae08745Sheppo 
571ae08745Sheppo /* values returned by VLDC_OPT_OP_STATUS */
581ae08745Sheppo #define	VLDC_PORT_CLOSED	0x1	    /* port is closed */
591ae08745Sheppo #define	VLDC_PORT_OPEN		0x2	    /* port is already open */
601ae08745Sheppo #define	VLDC_PORT_READY		0x4	    /* port is open and ready */
61*3af08d82Slm66018 #define	VLDC_PORT_RESET		0x8	    /* port has been reset */
621ae08745Sheppo 
631ae08745Sheppo /*
641ae08745Sheppo  * Values for VLDC_OPT_MODE are defined in ldc.h.
651ae08745Sheppo  */
661ae08745Sheppo 
671ae08745Sheppo /*
681ae08745Sheppo  * Structure that is used by vldc driver and all its clients to communicate
691ae08745Sheppo  * the type and nature of the option as well as for clients to get port
701ae08745Sheppo  * status.
711ae08745Sheppo  */
721ae08745Sheppo typedef struct vldc_opt_op {
731ae08745Sheppo 	int32_t		op_sel;		/* operation selector(ex: GET) */
741ae08745Sheppo 	int32_t		opt_sel;	/* option selector (ex: MTU) */
751ae08745Sheppo 	uint32_t	opt_val;	/* option value to set or returned */
761ae08745Sheppo } vldc_opt_op_t;
771ae08745Sheppo 
781ae08745Sheppo /*
791ae08745Sheppo  * Structure that is used by the LDom manager to download instruction
801ae08745Sheppo  * sequences and read/write new machine descriptions.
811ae08745Sheppo  */
821ae08745Sheppo typedef struct vldc_data {
831ae08745Sheppo 	uint64_t	src_addr;	/* source address */
841ae08745Sheppo 	uint64_t	dst_addr;	/* destination address */
851ae08745Sheppo 	uint64_t	length;		/* size of transfer */
861ae08745Sheppo } vldc_data_t;
871ae08745Sheppo 
881ae08745Sheppo #ifdef __cplusplus
891ae08745Sheppo }
901ae08745Sheppo #endif
911ae08745Sheppo 
921ae08745Sheppo #endif /* _VLDC_H */
93