xref: /illumos-gate/usr/src/uts/common/sys/mac_ib.h (revision 2d6eb4a5)
1*87ba907dSgg161487 /*
2*87ba907dSgg161487  * CDDL HEADER START
3*87ba907dSgg161487  *
4*87ba907dSgg161487  * The contents of this file are subject to the terms of the
5*87ba907dSgg161487  * Common Development and Distribution License (the "License").
6*87ba907dSgg161487  * You may not use this file except in compliance with the License.
7*87ba907dSgg161487  *
8*87ba907dSgg161487  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*87ba907dSgg161487  * or http://www.opensolaris.org/os/licensing.
10*87ba907dSgg161487  * See the License for the specific language governing permissions
11*87ba907dSgg161487  * and limitations under the License.
12*87ba907dSgg161487  *
13*87ba907dSgg161487  * When distributing Covered Code, include this CDDL HEADER in each
14*87ba907dSgg161487  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*87ba907dSgg161487  * If applicable, add the following below this CDDL HEADER, with the
16*87ba907dSgg161487  * fields enclosed by brackets "[]" replaced with your own identifying
17*87ba907dSgg161487  * information: Portions Copyright [yyyy] [name of copyright owner]
18*87ba907dSgg161487  *
19*87ba907dSgg161487  * CDDL HEADER END
20*87ba907dSgg161487  */
21*87ba907dSgg161487 /*
22*87ba907dSgg161487  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23*87ba907dSgg161487  * Use is subject to license terms.
24*87ba907dSgg161487  */
25*87ba907dSgg161487 
26*87ba907dSgg161487 #ifndef	_SYS_MAC_ETHER_H
27*87ba907dSgg161487 #define	_SYS_MAC_ETHER_H
28*87ba907dSgg161487 
29*87ba907dSgg161487 /*
30*87ba907dSgg161487  * Ethernet MAC Plugin
31*87ba907dSgg161487  */
32*87ba907dSgg161487 
33*87ba907dSgg161487 #ifdef	__cplusplus
34*87ba907dSgg161487 extern "C" {
35*87ba907dSgg161487 #endif
36*87ba907dSgg161487 
37*87ba907dSgg161487 #ifdef	_KERNEL
38*87ba907dSgg161487 
39*87ba907dSgg161487 #define	MAC_PLUGIN_IDENT_IB	"mac_ib"
40*87ba907dSgg161487 
41*87ba907dSgg161487 #define	MAC_IB_MAX_802_SAP	255
42*87ba907dSgg161487 #define	MAC_IB_ETHERTYPE_MAX	65535
43*87ba907dSgg161487 #define	MAC_IB_GID_SIZE		10
44*87ba907dSgg161487 #define	MAC_IB_BROADCAST_GID	0xFFFFFFFF
45*87ba907dSgg161487 
46*87ba907dSgg161487 /*
47*87ba907dSgg161487  * In order to transmit the datagram to correct destination, an extra
48*87ba907dSgg161487  * header including destination address is required. IB does not provide an
49*87ba907dSgg161487  * interface for sending a link layer header directly to the IB link and the
50*87ba907dSgg161487  * link layer header received from the IB link is missing information that
51*87ba907dSgg161487  * GLDv3 requires. So mac_ib plugin defines a "soft" header as below.
52*87ba907dSgg161487  */
53*87ba907dSgg161487 typedef struct ib_addrs {
54*87ba907dSgg161487 	ipoib_mac_t	ipib_src;
55*87ba907dSgg161487 	ipoib_mac_t	ipib_dst;
56*87ba907dSgg161487 } ib_addrs_t;
57*87ba907dSgg161487 
58*87ba907dSgg161487 typedef struct ib_header_info {
59*87ba907dSgg161487 	union {
60*87ba907dSgg161487 		ipoib_pgrh_t	ipib_grh;
61*87ba907dSgg161487 		ib_addrs_t	ipib_addrs;
62*87ba907dSgg161487 	} ipib_prefix;
63*87ba907dSgg161487 	ipoib_hdr_t	ipib_rhdr;
64*87ba907dSgg161487 } ib_header_info_t;
65*87ba907dSgg161487 
66*87ba907dSgg161487 #define	ib_dst	ipib_prefix.ipib_addrs.ipib_dst
67*87ba907dSgg161487 #define	ib_src	ipib_prefix.ipib_addrs.ipib_src
68*87ba907dSgg161487 #define	ib_grh	ipib_prefix.ipib_grh
69*87ba907dSgg161487 
70*87ba907dSgg161487 #endif	/* _KERNEL */
71*87ba907dSgg161487 
72*87ba907dSgg161487 #ifdef	__cplusplus
73*87ba907dSgg161487 }
74*87ba907dSgg161487 #endif
75*87ba907dSgg161487 
76*87ba907dSgg161487 #endif /* _SYS_MAC_ETHER_H */
77