11991Sheppo /* 21991Sheppo * CDDL HEADER START 31991Sheppo * 41991Sheppo * The contents of this file are subject to the terms of the 51991Sheppo * Common Development and Distribution License (the "License"). 61991Sheppo * You may not use this file except in compliance with the License. 71991Sheppo * 81991Sheppo * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91991Sheppo * or http://www.opensolaris.org/os/licensing. 101991Sheppo * See the License for the specific language governing permissions 111991Sheppo * and limitations under the License. 121991Sheppo * 131991Sheppo * When distributing Covered Code, include this CDDL HEADER in each 141991Sheppo * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151991Sheppo * If applicable, add the following below this CDDL HEADER, with the 161991Sheppo * fields enclosed by brackets "[]" replaced with your own identifying 171991Sheppo * information: Portions Copyright [yyyy] [name of copyright owner] 181991Sheppo * 191991Sheppo * CDDL HEADER END 201991Sheppo */ 211991Sheppo 221991Sheppo /* 231991Sheppo * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 241991Sheppo * Use is subject to license terms. 251991Sheppo */ 261991Sheppo 271991Sheppo #ifndef _VLDC_H 281991Sheppo #define _VLDC_H 291991Sheppo 301991Sheppo #pragma ident "%Z%%M% %I% %E% SMI" 311991Sheppo 321991Sheppo #ifdef __cplusplus 331991Sheppo extern "C" { 341991Sheppo #endif 351991Sheppo 361991Sheppo #include <sys/types.h> 371991Sheppo #include <sys/ioctl.h> 381991Sheppo 391991Sheppo /* Channel IOCTL Commands */ 401991Sheppo 411991Sheppo #define VLDC_IOCTL_SHIFT 8 421991Sheppo #define VLDC_IOCTL ('1' << VLDC_IOCTL_SHIFT) 431991Sheppo 441991Sheppo #define VLDC_IOCTL_OPT_OP (VLDC_IOCTL | 0x1) /* ctrl op */ 451991Sheppo #define VLDC_IOCTL_READ_COOKIE (VLDC_IOCTL | 0x2) /* read cookie */ 461991Sheppo #define VLDC_IOCTL_WRITE_COOKIE (VLDC_IOCTL | 0x3) /* write cookie */ 471991Sheppo 481991Sheppo /* supported ctrl operations */ 491991Sheppo #define VLDC_OP_GET 0x1 /* get specified value */ 501991Sheppo #define VLDC_OP_SET 0x2 /* set specified value */ 511991Sheppo 521991Sheppo /* supported ctrl operation options */ 531991Sheppo #define VLDC_OPT_MTU_SZ 0x1 /* MTU */ 541991Sheppo #define VLDC_OPT_STATUS 0x2 /* port status */ 551991Sheppo #define VLDC_OPT_MODE 0x3 /* port channel mode */ 561991Sheppo 571991Sheppo /* values returned by VLDC_OPT_OP_STATUS */ 581991Sheppo #define VLDC_PORT_CLOSED 0x1 /* port is closed */ 591991Sheppo #define VLDC_PORT_OPEN 0x2 /* port is already open */ 601991Sheppo #define VLDC_PORT_READY 0x4 /* port is open and ready */ 61*2793Slm66018 #define VLDC_PORT_RESET 0x8 /* port has been reset */ 621991Sheppo 631991Sheppo /* 641991Sheppo * Values for VLDC_OPT_MODE are defined in ldc.h. 651991Sheppo */ 661991Sheppo 671991Sheppo /* 681991Sheppo * Structure that is used by vldc driver and all its clients to communicate 691991Sheppo * the type and nature of the option as well as for clients to get port 701991Sheppo * status. 711991Sheppo */ 721991Sheppo typedef struct vldc_opt_op { 731991Sheppo int32_t op_sel; /* operation selector(ex: GET) */ 741991Sheppo int32_t opt_sel; /* option selector (ex: MTU) */ 751991Sheppo uint32_t opt_val; /* option value to set or returned */ 761991Sheppo } vldc_opt_op_t; 771991Sheppo 781991Sheppo /* 791991Sheppo * Structure that is used by the LDom manager to download instruction 801991Sheppo * sequences and read/write new machine descriptions. 811991Sheppo */ 821991Sheppo typedef struct vldc_data { 831991Sheppo uint64_t src_addr; /* source address */ 841991Sheppo uint64_t dst_addr; /* destination address */ 851991Sheppo uint64_t length; /* size of transfer */ 861991Sheppo } vldc_data_t; 871991Sheppo 881991Sheppo #ifdef __cplusplus 891991Sheppo } 901991Sheppo #endif 911991Sheppo 921991Sheppo #endif /* _VLDC_H */ 93