87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg/*
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * CDDL HEADER START
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg *
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * The contents of this file are subject to the terms of the
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * Common Development and Distribution License (the "License").
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * You may not use this file except in compliance with the License.
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg *
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * or http://www.opensolaris.org/os/licensing.
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * See the License for the specific language governing permissions
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * and limitations under the License.
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg *
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * When distributing Covered Code, include this CDDL HEADER in each
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * If applicable, add the following below this CDDL HEADER, with the
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * fields enclosed by brackets "[]" replaced with your own identifying
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * information: Portions Copyright [yyyy] [name of copyright owner]
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg *
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * CDDL HEADER END
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg */
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg/*
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * Use is subject to license terms.
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg */
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#ifndef _SYS_MAC_ETHER_H
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define _SYS_MAC_ETHER_H
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#pragma ident "%Z%%M% %I% %E% SMI"
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg/*
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * Ethernet MAC Plugin
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg */
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#ifdef __cplusplus
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896ggextern "C" {
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#endif
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#ifdef _KERNEL
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define MAC_PLUGIN_IDENT_IB "mac_ib"
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define MAC_IB_MAX_802_SAP 255
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define MAC_IB_ETHERTYPE_MAX 65535
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define MAC_IB_GID_SIZE 10
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define MAC_IB_BROADCAST_GID 0xFFFFFFFF
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg/*
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * In order to transmit the datagram to correct destination, an extra
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * header including destination address is required. IB does not provide an
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * interface for sending a link layer header directly to the IB link and the
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * link layer header received from the IB link is missing information that
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg * GLDv3 requires. So mac_ib plugin defines a "soft" header as below.
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg */
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896ggtypedef struct ib_addrs {
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg ipoib_mac_t ipib_src;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg ipoib_mac_t ipib_dst;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg} ib_addrs_t;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896ggtypedef struct ib_header_info {
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg union {
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg ipoib_pgrh_t ipib_grh;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg ib_addrs_t ipib_addrs;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg } ipib_prefix;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg ipoib_hdr_t ipib_rhdr;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg} ib_header_info_t;
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define ib_dst ipib_prefix.ipib_addrs.ipib_dst
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define ib_src ipib_prefix.ipib_addrs.ipib_src
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#define ib_grh ipib_prefix.ipib_grh
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#endif /* _KERNEL */
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#ifdef __cplusplus
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg}
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#endif
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg
87ba907dbdcf5c1692d70a9b22fe1d0e718d9896gg#endif /* _SYS_MAC_ETHER_H */