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