1*1ae08745Sheppo /* 2*1ae08745Sheppo * CDDL HEADER START 3*1ae08745Sheppo * 4*1ae08745Sheppo * The contents of this file are subject to the terms of the 5*1ae08745Sheppo * Common Development and Distribution License (the "License"). 6*1ae08745Sheppo * You may not use this file except in compliance with the License. 7*1ae08745Sheppo * 8*1ae08745Sheppo * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*1ae08745Sheppo * or http://www.opensolaris.org/os/licensing. 10*1ae08745Sheppo * See the License for the specific language governing permissions 11*1ae08745Sheppo * and limitations under the License. 12*1ae08745Sheppo * 13*1ae08745Sheppo * When distributing Covered Code, include this CDDL HEADER in each 14*1ae08745Sheppo * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*1ae08745Sheppo * If applicable, add the following below this CDDL HEADER, with the 16*1ae08745Sheppo * fields enclosed by brackets "[]" replaced with your own identifying 17*1ae08745Sheppo * information: Portions Copyright [yyyy] [name of copyright owner] 18*1ae08745Sheppo * 19*1ae08745Sheppo * CDDL HEADER END 20*1ae08745Sheppo */ 21*1ae08745Sheppo 22*1ae08745Sheppo /* 23*1ae08745Sheppo * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*1ae08745Sheppo * Use is subject to license terms. 25*1ae08745Sheppo */ 26*1ae08745Sheppo 27*1ae08745Sheppo #ifndef _VLDC_H 28*1ae08745Sheppo #define _VLDC_H 29*1ae08745Sheppo 30*1ae08745Sheppo #pragma ident "%Z%%M% %I% %E% SMI" 31*1ae08745Sheppo 32*1ae08745Sheppo #ifdef __cplusplus 33*1ae08745Sheppo extern "C" { 34*1ae08745Sheppo #endif 35*1ae08745Sheppo 36*1ae08745Sheppo #include <sys/types.h> 37*1ae08745Sheppo #include <sys/ioctl.h> 38*1ae08745Sheppo 39*1ae08745Sheppo /* Channel IOCTL Commands */ 40*1ae08745Sheppo 41*1ae08745Sheppo #define VLDC_IOCTL_SHIFT 8 42*1ae08745Sheppo #define VLDC_IOCTL ('1' << VLDC_IOCTL_SHIFT) 43*1ae08745Sheppo 44*1ae08745Sheppo #define VLDC_IOCTL_OPT_OP (VLDC_IOCTL | 0x1) /* ctrl op */ 45*1ae08745Sheppo #define VLDC_IOCTL_READ_COOKIE (VLDC_IOCTL | 0x2) /* read cookie */ 46*1ae08745Sheppo #define VLDC_IOCTL_WRITE_COOKIE (VLDC_IOCTL | 0x3) /* write cookie */ 47*1ae08745Sheppo 48*1ae08745Sheppo /* supported ctrl operations */ 49*1ae08745Sheppo #define VLDC_OP_GET 0x1 /* get specified value */ 50*1ae08745Sheppo #define VLDC_OP_SET 0x2 /* set specified value */ 51*1ae08745Sheppo 52*1ae08745Sheppo /* supported ctrl operation options */ 53*1ae08745Sheppo #define VLDC_OPT_MTU_SZ 0x1 /* MTU */ 54*1ae08745Sheppo #define VLDC_OPT_STATUS 0x2 /* port status */ 55*1ae08745Sheppo #define VLDC_OPT_MODE 0x3 /* port channel mode */ 56*1ae08745Sheppo 57*1ae08745Sheppo /* values returned by VLDC_OPT_OP_STATUS */ 58*1ae08745Sheppo #define VLDC_PORT_CLOSED 0x1 /* port is closed */ 59*1ae08745Sheppo #define VLDC_PORT_OPEN 0x2 /* port is already open */ 60*1ae08745Sheppo #define VLDC_PORT_READY 0x4 /* port is open and ready */ 61*1ae08745Sheppo 62*1ae08745Sheppo /* 63*1ae08745Sheppo * Values for VLDC_OPT_MODE are defined in ldc.h. 64*1ae08745Sheppo */ 65*1ae08745Sheppo 66*1ae08745Sheppo /* 67*1ae08745Sheppo * Structure that is used by vldc driver and all its clients to communicate 68*1ae08745Sheppo * the type and nature of the option as well as for clients to get port 69*1ae08745Sheppo * status. 70*1ae08745Sheppo */ 71*1ae08745Sheppo typedef struct vldc_opt_op { 72*1ae08745Sheppo int32_t op_sel; /* operation selector(ex: GET) */ 73*1ae08745Sheppo int32_t opt_sel; /* option selector (ex: MTU) */ 74*1ae08745Sheppo uint32_t opt_val; /* option value to set or returned */ 75*1ae08745Sheppo } vldc_opt_op_t; 76*1ae08745Sheppo 77*1ae08745Sheppo /* 78*1ae08745Sheppo * Structure that is used by the LDom manager to download instruction 79*1ae08745Sheppo * sequences and read/write new machine descriptions. 80*1ae08745Sheppo */ 81*1ae08745Sheppo typedef struct vldc_data { 82*1ae08745Sheppo uint64_t src_addr; /* source address */ 83*1ae08745Sheppo uint64_t dst_addr; /* destination address */ 84*1ae08745Sheppo uint64_t length; /* size of transfer */ 85*1ae08745Sheppo } vldc_data_t; 86*1ae08745Sheppo 87*1ae08745Sheppo #ifdef __cplusplus 88*1ae08745Sheppo } 89*1ae08745Sheppo #endif 90*1ae08745Sheppo 91*1ae08745Sheppo #endif /* _VLDC_H */ 92