xref: /titanic_50/usr/src/uts/common/sys/mac_ib.h (revision 1915be19b7a1f7c113b706bd54d6ca393e8d8107)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 /*
32  * Ethernet MAC Plugin
33  */
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 #ifdef	_KERNEL
40 
41 #define	MAC_PLUGIN_IDENT_IB	"mac_ib"
42 
43 #define	MAC_IB_MAX_802_SAP	255
44 #define	MAC_IB_ETHERTYPE_MAX	65535
45 #define	MAC_IB_GID_SIZE		10
46 #define	MAC_IB_BROADCAST_GID	0xFFFFFFFF
47 
48 /*
49  * In order to transmit the datagram to correct destination, an extra
50  * header including destination address is required. IB does not provide an
51  * interface for sending a link layer header directly to the IB link and the
52  * link layer header received from the IB link is missing information that
53  * GLDv3 requires. So mac_ib plugin defines a "soft" header as below.
54  */
55 typedef struct ib_addrs {
56 	ipoib_mac_t	ipib_src;
57 	ipoib_mac_t	ipib_dst;
58 } ib_addrs_t;
59 
60 typedef struct ib_header_info {
61 	union {
62 		ipoib_pgrh_t	ipib_grh;
63 		ib_addrs_t	ipib_addrs;
64 	} ipib_prefix;
65 	ipoib_hdr_t	ipib_rhdr;
66 } ib_header_info_t;
67 
68 #define	ib_dst	ipib_prefix.ipib_addrs.ipib_dst
69 #define	ib_src	ipib_prefix.ipib_addrs.ipib_src
70 #define	ib_grh	ipib_prefix.ipib_grh
71 
72 #endif	/* _KERNEL */
73 
74 #ifdef	__cplusplus
75 }
76 #endif
77 
78 #endif /* _SYS_MAC_ETHER_H */
79