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