summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/sys/mac_ether.h
diff options
context:
space:
mode:
authorseb <none@none>2006-06-30 12:39:57 -0700
committerseb <none@none>2006-06-30 12:39:57 -0700
commitba2e4443695ee6a6f420a35cd4fc3d3346d22932 (patch)
treee3ebae9aaeecabfd5304f958583c09efb9b861c4 /usr/src/uts/common/sys/mac_ether.h
parent17e9c21c2c124e74a7e4a7cd9fcaa3f2d31b7069 (diff)
downloadillumos-gate-ba2e4443695ee6a6f420a35cd4fc3d3346d22932.tar.gz
PSARC/2006/248 Nemo MAC-Type Plugin Architecture
PSARC/2006/249 Nemo Changes for Binary Compatibility 6226635 MAC stats interface could cause problems with binary compatibility 6242059 nemo drivers must not know the size of the mac_t structure 6384371 GLDv3 only supports Ethernet 6401695 xge uses a receive ring even though it doesn't do blanking 6432471 panic in dls_close() if DL_BIND_REQ previously failed
Diffstat (limited to 'usr/src/uts/common/sys/mac_ether.h')
-rw-r--r--usr/src/uts/common/sys/mac_ether.h157
1 files changed, 157 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/mac_ether.h b/usr/src/uts/common/sys/mac_ether.h
new file mode 100644
index 0000000000..dbb5053306
--- /dev/null
+++ b/usr/src/uts/common/sys/mac_ether.h
@@ -0,0 +1,157 @@
+/*
+ * 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
+ * or http://www.opensolaris.org/os/licensing.
+ * 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 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef _SYS_MAC_ETHER_H
+#define _SYS_MAC_ETHER_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+/*
+ * Ethernet MAC Plugin
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _KERNEL
+
+#define MAC_PLUGIN_IDENT_ETHER "mac_ether"
+
+enum ether_stat {
+ /* RFC 1643 stats */
+ ETHER_STAT_ALIGN_ERRORS = MACTYPE_STAT_MIN,
+ ETHER_STAT_FCS_ERRORS,
+ ETHER_STAT_FIRST_COLLISIONS,
+ ETHER_STAT_MULTI_COLLISIONS,
+ ETHER_STAT_SQE_ERRORS,
+ ETHER_STAT_DEFER_XMTS,
+ ETHER_STAT_TX_LATE_COLLISIONS,
+ ETHER_STAT_EX_COLLISIONS,
+ ETHER_STAT_MACXMT_ERRORS,
+ ETHER_STAT_CARRIER_ERRORS,
+ ETHER_STAT_TOOLONG_ERRORS,
+ ETHER_STAT_MACRCV_ERRORS,
+
+ /* MII/GMII stats */
+ ETHER_STAT_XCVR_ADDR,
+ ETHER_STAT_XCVR_ID,
+ ETHER_STAT_XCVR_INUSE,
+ ETHER_STAT_CAP_1000FDX,
+ ETHER_STAT_CAP_1000HDX,
+ ETHER_STAT_CAP_100FDX,
+ ETHER_STAT_CAP_100HDX,
+ ETHER_STAT_CAP_10FDX,
+ ETHER_STAT_CAP_10HDX,
+ ETHER_STAT_CAP_ASMPAUSE,
+ ETHER_STAT_CAP_PAUSE,
+ ETHER_STAT_CAP_AUTONEG,
+ ETHER_STAT_ADV_CAP_1000FDX,
+ ETHER_STAT_ADV_CAP_1000HDX,
+ ETHER_STAT_ADV_CAP_100FDX,
+ ETHER_STAT_ADV_CAP_100HDX,
+ ETHER_STAT_ADV_CAP_10FDX,
+ ETHER_STAT_ADV_CAP_10HDX,
+ ETHER_STAT_ADV_CAP_ASMPAUSE,
+ ETHER_STAT_ADV_CAP_PAUSE,
+ ETHER_STAT_ADV_CAP_AUTONEG,
+ ETHER_STAT_LP_CAP_1000FDX,
+ ETHER_STAT_LP_CAP_1000HDX,
+ ETHER_STAT_LP_CAP_100FDX,
+ ETHER_STAT_LP_CAP_100HDX,
+ ETHER_STAT_LP_CAP_10FDX,
+ ETHER_STAT_LP_CAP_10HDX,
+ ETHER_STAT_LP_CAP_ASMPAUSE,
+ ETHER_STAT_LP_CAP_PAUSE,
+ ETHER_STAT_LP_CAP_AUTONEG,
+ ETHER_STAT_LINK_ASMPAUSE,
+ ETHER_STAT_LINK_PAUSE,
+ ETHER_STAT_LINK_AUTONEG,
+ ETHER_STAT_LINK_DUPLEX
+};
+
+#define ETHER_NSTAT (ETHER_STAT_LINK_DUPLEX - ETHER_STAT_ALIGN_ERRORS + 1)
+
+#define ETHER_STAT_ISACOUNTER(_ether_stat) \
+ ((_ether_stat) == ETHER_STAT_ALIGN_ERRORS || \
+ (_ether_stat) == ETHER_STAT_FCS_ERRORS || \
+ (_ether_stat) == ETHER_STAT_FIRST_COLLISIONS || \
+ (_ether_stat) == ETHER_STAT_MULTI_COLLISIONS || \
+ (_ether_stat) == ETHER_STAT_SQE_ERRORS || \
+ (_ether_stat) == ETHER_STAT_DEFER_XMTS || \
+ (_ether_stat) == ETHER_STAT_TX_LATE_COLLISIONS || \
+ (_ether_stat) == ETHER_STAT_EX_COLLISIONS || \
+ (_ether_stat) == ETHER_STAT_MACXMT_ERRORS || \
+ (_ether_stat) == ETHER_STAT_CARRIER_ERRORS || \
+ (_ether_stat) == ETHER_STAT_TOOLONG_ERRORS || \
+ (_ether_stat) == ETHER_STAT_MACRCV_ERRORS)
+
+/*
+ * Some drivers have a need to determine if a particular stat is a MII/GMII
+ * physical layer 802.3 stat.
+ */
+#define ETHER_STAT_ISMII(_ether_stat) \
+ ((_ether_stat) == ETHER_STAT_XCVR_ADDR || \
+ (_ether_stat) == ETHER_STAT_XCVR_ID || \
+ (_ether_stat) == ETHER_STAT_XCVR_INUSE || \
+ (_ether_stat) == ETHER_STAT_CAP_1000FDX || \
+ (_ether_stat) == ETHER_STAT_CAP_1000HDX || \
+ (_ether_stat) == ETHER_STAT_CAP_100FDX || \
+ (_ether_stat) == ETHER_STAT_CAP_100HDX || \
+ (_ether_stat) == ETHER_STAT_CAP_10FDX || \
+ (_ether_stat) == ETHER_STAT_CAP_10HDX || \
+ (_ether_stat) == ETHER_STAT_CAP_ASMPAUSE || \
+ (_ether_stat) == ETHER_STAT_CAP_PAUSE || \
+ (_ether_stat) == ETHER_STAT_CAP_AUTONEG || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_1000FDX || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_1000HDX || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_100FDX || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_100HDX || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_10FDX || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_10HDX || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_ASMPAUSE || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_PAUSE || \
+ (_ether_stat) == ETHER_STAT_ADV_CAP_AUTONEG || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_1000FDX || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_1000HDX || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_100FDX || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_100HDX || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_10FDX || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_10HDX || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_ASMPAUSE || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_PAUSE || \
+ (_ether_stat) == ETHER_STAT_LP_CAP_AUTONEG || \
+ (_ether_stat) == ETHER_STAT_LINK_ASMPAUSE || \
+ (_ether_stat) == ETHER_STAT_LINK_PAUSE || \
+ (_ether_stat) == ETHER_STAT_LINK_AUTONEG || \
+ (_ether_stat) == ETHER_STAT_LINK_DUPLEX)
+
+#endif /* _KERNEL */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_MAC_ETHER_H */