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