dld.h revision afdda45f890ee5dfc86e5131a30b11b354d51633
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DLD_H
#define _SYS_DLD_H
/*
* Data-Link Driver (public header).
*
* Note that the datastructures defined here define an ioctl interface
* that is shared betwen user and kernel space. The dld driver thus
* assumes that the structures have identical layout and size when
* compiled in either IPL32 or LP64.
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* Data-Link Driver Information (text emitted by modinfo(1m))
*/
#define DLD_INFO "Data-Link Driver"
/*
* Options: To enable an option set the property name to a non-zero value
*/
/*
* Prevent use of the IP fast-path (direct M_DATA transmit).
*/
#define DLD_PROP_NO_FASTPATH "no-fastpath"
/*
* Prevent advertising of the DL_CAPAB_POLL capability.
*/
#define DLD_PROP_NO_POLL "no-poll"
/*
* Prevent advertising of the DL_CAPAB_ZEROCOPY capability.
*/
#define DLD_PROP_NO_ZEROCOPY "no-zerocopy"
/*
* Prevent advertising of the DL_CAPAB_SOFTRING capability.
*/
#define DLD_PROP_NO_SOFTRING "no-softring"
/*
* The name of the driver.
*/
#define DLD_DRIVER_NAME "dld"
/*
* IOCTL codes and data structures.
*/
typedef struct dld_ioc_attr {
typedef struct dld_ioc_vlan_attr {
#define DLPI_LINKNAME_MAX 32
typedef struct dld_ioc_phys_attr {
/*
* Whether this physical link supports vanity naming. Note that
* physical links whose media type is not supported by GLDv3
* can not support vanity naming.
*/
char dip_dev[MAXLINKNAMELEN];
/*
* Secure objects ioctls
*/
typedef enum {
DLD_SECOBJ_CLASS_WEP = 1,
#define DLD_SECOBJ_OPT_CREATE 0x00000001
#define DLD_SECOBJ_NAME_MAX 32
#define DLD_SECOBJ_VAL_MAX 256
typedef struct dld_secobj {
char so_name[DLD_SECOBJ_NAME_MAX];
} dld_secobj_t;
typedef struct dld_ioc_secobj_set {
typedef struct dld_ioc_secobj_get {
/*
* The following two slots were used outside of ON, so don't reuse them.
*
* #define DLDIOCHOLDVLAN DLDIOC(0x08)
* #define DLDIOCRELEVLAN DLDIOC(0x09)
*/
typedef struct dld_ioc_secobj_unset {
char su_name[DLD_SECOBJ_NAME_MAX];
typedef struct dld_ioc_create_vlan {
typedef struct dld_ioc_delete_vlan {
/*
* The following constants have been removed, and the slots are open:
*
* #define DLDIOC_SETAUTOPUSH DLDIOC(0x0d)
* #define DLDIOC_GETAUTOPUSH DLDIOC(0x0e)
* #define DLDIOC_CLRAUTOPUSH DLDIOC(0x0f)
*/
typedef struct dld_ioc_door {
typedef struct dld_ioc_rename {
char dir_link[MAXLINKNAMELEN];
/*
* The following constants have been removed, and the slots are open:
*
* #define DLDIOC_SETZID DLDIOC(0x12)
* #define DLDIOC_GETZID DLDIOC(0x13)
*/
typedef struct dld_ioc_zid {
char diz_link[MAXLINKNAMELEN];
typedef struct dld_ioc_getzid {
/*
* data-link autopush configuration.
*/
struct dlautopush {
};
#define MAC_PROP_VERSION 1
typedef struct dld_ioc_macprop_s {
int pr_version;
char pr_name[MAXLINKPROPNAME];
char pr_val[1];
#ifdef _KERNEL
void dld_init_ops(struct dev_ops *, const char *);
void dld_fini_ops(struct dev_ops *);
#endif
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DLD_H */