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, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SYS_DLD_H 28 #define _SYS_DLD_H 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 /* 33 * Data-Link Driver (public header). 34 */ 35 36 #include <sys/types.h> 37 #include <sys/stream.h> 38 #include <sys/mac.h> 39 #include <sys/dls.h> 40 #include <sys/ght.h> 41 #include <net/if.h> 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif 46 47 /* 48 * Data-Link Driver Information (text emitted by modinfo(1m)) 49 */ 50 #define DLD_INFO "Data-Link Driver v%I%" 51 52 /* 53 * Options: To enable an option set the property name to a non-zero value 54 * in kernel/drv/dld.conf. 55 */ 56 57 /* 58 * Prevent creation of DLPI style 1 provider nodes (thus forcing stacks such 59 * as TCP/IP to use style 2 nodes). 60 */ 61 #define DLD_PROP_NO_STYLE1 "no-style-1" 62 63 /* 64 * Prevent use of the IP fast-path (direct M_DATA transmit). 65 */ 66 #define DLD_PROP_NO_FASTPATH "no-fastpath" 67 68 /* 69 * Prevent advertising of the DL_CAPAB_POLL capability. 70 */ 71 #define DLD_PROP_NO_POLL "no-poll" 72 73 /* 74 * Prevent advertising of the DL_CAPAB_ZEROCOPY capability. 75 */ 76 #define DLD_PROP_NO_ZEROCOPY "no-zerocopy" 77 78 /* 79 * The name of the driver. 80 */ 81 #define DLD_DRIVER_NAME "dld" 82 83 /* 84 * The name of the control minor node of dld. 85 */ 86 #define DLD_CONTROL_MINOR_NAME "ctl" 87 #define DLD_CONTROL_MINOR 0 88 #define DLD_CONTROL_DEV "/devices/pseudo/" DLD_DRIVER_NAME "@0:" \ 89 DLD_CONTROL_MINOR_NAME 90 91 /* 92 * IOCTL codes and data structures. 93 */ 94 #define DLDIOC ('D' << 24 | 'L' << 16 | 'D' << 8) 95 96 #define DLDIOCCREATE (DLDIOC | 0x01) 97 98 typedef struct dld_ioc_create { 99 char dic_name[IFNAMSIZ]; 100 char dic_dev[MAXNAMELEN]; 101 uint_t dic_port; 102 uint16_t dic_vid; 103 } dld_ioc_create_t; 104 105 #define DLDIOCDESTROY (DLDIOC | 0x02) 106 107 typedef struct dld_ioc_destroy { 108 char did_name[IFNAMSIZ]; 109 } dld_ioc_destroy_t; 110 111 #define DLDIOCATTR (DLDIOC | 0x03) 112 113 typedef struct dld_ioc_attr { 114 char dia_name[IFNAMSIZ]; 115 char dia_dev[MAXNAMELEN]; 116 uint_t dia_port; 117 uint16_t dia_vid; 118 } dld_ioc_attr_t; 119 120 #ifdef __cplusplus 121 } 122 #endif 123 124 #endif /* _SYS_DLD_H */ 125