/*
* 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.
*/
/*
* gld - Generic LAN Driver support system for DLPI drivers.
*/
#ifndef _SYS_GLD_H
#define _SYS_GLD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/ethernet.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Media specific MIB-II counters/statistics
*
* This only includes those that aren't in the legacy counters.
*/
typedef union media_stats {
struct dot3stat {
/* Ethernet: RFC1643 Dot3Stats (subset) */
} dot3;
struct dot5stat {
/* Token Ring: RFC1748 Dot5Stats (subset) */
} dot5;
struct fddistat {
/* FDDI: RFC1512 (subset) */
} fddi;
/*
* structure for driver statistics
*/
struct gld_stats {
};
/*
* gld_mac_info structure. Used to define the per-board data for all
* drivers.
*
* The below definition of gld_mac_info contains GLD PRIVATE entries that must
* not be used by the device driver. Only entries marked SET BY DRIVER should
* be modified.
*/
typedef union gld_lock {
} gld_lock_t;
typedef struct gld_mac_info {
/* NOTE: MUST BE -2 */
/*
* The following MDT related entry points are Sun private,
* meant only for use by Sun's IPoIB (ibd) driver.
*/
/* flags for physical promiscuous state */
#define GLD_MULTI_DISABLE 0
/* flags for gldm_capabilities */
#define GLD_CAP_CKSUM_ANY \
/* values of gldm_linkstate, as passed to gld_linkstate() */
#define GLD_LINKSTATE_UNKNOWN 0
/*
* driver. Possible types will be defined for each DLPI type defined in
* gldm_type. The below definitions should be used by the device dependent
* drivers to set glds_media.
*/
#define GLDM_UNKNOWN 0
/* defines for possible duplex states (glds_duplex) */
#define GLD_DUPLEX_UNKNOWN 0
/* Values returned from driver entry points */
#define GLD_SUCCESS 0
#if defined(_KERNEL)
/* Functions exported to drivers */
extern void gld_mac_free(gld_mac_info_t *);
extern int gld_unregister(gld_mac_info_t *);
extern void gld_sched(gld_mac_info_t *);
#endif
/*
* VLAN tag macros
*
* Per IEEE802.1Q, a VLAN tag is made up of a 2-byte Tagged Protocol
* All fields should be treated as unsigned, and so a VTAG is held as
* a 'uint32_t'
*/
#define VLAN_TCI_SHIFT 0
#define VLAN_VID_SHIFT 0
#define VLAN_PRI_DFLT 0
/*
* Macros to construct a TCI or VTAG. The user must ensure values are in
* range. Note that in the special case of priority tag, VLAN_VID_NONE
* is also a valid argument to these constructor macros.
*/
((cfi) << VLAN_CFI_SHIFT) | \
((vid) << VLAN_VID_SHIFT))
((pri) << VLAN_PRI_SHIFT) | \
((cfi) << VLAN_CFI_SHIFT) | \
((vid) << VLAN_VID_SHIFT))
/*
*/
/*
* Deconstruct a VTAG ...
*/
#ifdef __cplusplus
}
#endif
#endif /* _SYS_GLD_H */