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.
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.
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]
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
29 #include <sys/types.h>
30 #include <sys/ethernet.h>
31 #include <sys/param.h>
33 #include <sys/dld_ioc.h>
40 * Note that the data structures defined here define an ioctl interface
41 * that is shared betwen user and kernel space. The aggr driver thus
42 * assumes that the structures have identical layout and size when
43 * compiled in either IPL32 or LP64.
47 * Transmit load balancing policies.
50 #define AGGR_POLICY_L2 0x01
51 #define AGGR_POLICY_L3 0x02
52 #define AGGR_POLICY_L4 0x04
55 * LACP mode and timer.
65 AGGR_LACP_TIMER_LONG
= 0,
66 AGGR_LACP_TIMER_SHORT
= 1
73 AGGR_PORT_STATE_STANDBY
= 1,
74 AGGR_PORT_STATE_ATTACHED
= 2
77 /* Maximum number of ports per aggregation. */
78 #define AGGR_MAX_PORTS 256
81 * The largest configurable aggregation key. Because by default the key is
82 * used as the DLPI device PPA and default VLAN PPA's are calculated as
83 * ((1000 * vid) + PPA), the largest key can't be > 999.
85 #define AGGR_MAX_KEY 999
92 #if defined(_BIT_FIELDS_HTOL)
95 uint8_t distributing
: 1;
96 uint8_t collecting
: 1;
98 uint8_t aggregation
: 1;
101 #elif defined(_BIT_FIELDS_LTOH)
104 uint8_t aggregation
: 1;
106 uint8_t collecting
: 1;
107 uint8_t distributing
: 1;
108 uint8_t defaulted
: 1;
111 #error "unknown bit fields ordering"
117 /* one of the ports of a link aggregation group */
118 typedef struct laioc_port
{
119 datalink_id_t lp_linkid
;
122 #define LAIOC_CREATE AGGRIOC(1)
124 typedef struct laioc_create
{
125 datalink_id_t lc_linkid
;
129 uchar_t lc_mac
[ETHERADDRL
];
130 aggr_lacp_mode_t lc_lacp_mode
;
131 aggr_lacp_timer_t lc_lacp_timer
;
132 uint32_t lc_mac_fixed
: 1,
137 #define LAIOC_DELETE AGGRIOC(2)
139 typedef struct laioc_delete
{
140 datalink_id_t ld_linkid
;
143 #define LAIOC_INFO AGGRIOC(3)
145 typedef enum aggr_link_duplex
{
146 AGGR_LINK_DUPLEX_FULL
= 1,
147 AGGR_LINK_DUPLEX_HALF
= 2,
148 AGGR_LINK_DUPLEX_UNKNOWN
= 3
149 } aggr_link_duplex_t
;
151 typedef enum aggr_link_state
{
152 AGGR_LINK_STATE_UP
= 1,
153 AGGR_LINK_STATE_DOWN
= 2,
154 AGGR_LINK_STATE_UNKNOWN
= 3
157 typedef struct laioc_info_port
{
158 datalink_id_t lp_linkid
;
159 uchar_t lp_mac
[ETHERADDRL
];
160 aggr_port_state_t lp_state
;
161 aggr_lacp_state_t lp_lacp_state
;
164 typedef struct laioc_info_group
{
165 datalink_id_t lg_linkid
;
167 uchar_t lg_mac
[ETHERADDRL
];
168 boolean_t lg_mac_fixed
;
172 aggr_lacp_mode_t lg_lacp_mode
;
173 aggr_lacp_timer_t lg_lacp_timer
;
174 } laioc_info_group_t
;
176 typedef struct laioc_info
{
177 /* Must not be DLADM_INVALID_LINKID */
178 datalink_id_t li_group_linkid
;
182 #define LAIOC_ADD AGGRIOC(4)
183 #define LAIOC_REMOVE AGGRIOC(5)
185 typedef struct laioc_add_rem
{
186 datalink_id_t la_linkid
;
191 #define LAIOC_MODIFY AGGRIOC(6)
193 #define LAIOC_MODIFY_POLICY 0x01
194 #define LAIOC_MODIFY_MAC 0x02
195 #define LAIOC_MODIFY_LACP_MODE 0x04
196 #define LAIOC_MODIFY_LACP_TIMER 0x08
198 typedef struct laioc_modify
{
199 datalink_id_t lu_linkid
;
200 uint8_t lu_modify_mask
;
202 uchar_t lu_mac
[ETHERADDRL
];
203 boolean_t lu_mac_fixed
;
204 aggr_lacp_mode_t lu_lacp_mode
;
205 aggr_lacp_timer_t lu_lacp_timer
;
212 #endif /* _SYS_AGGR_H */