1 #ifndef _IPXE_ETH_SLOW_H
2 #define _IPXE_ETH_SLOW_H
6 * Ethernet slow protocols
10 FILE_LICENCE ( GPL2_OR_LATER );
12 /** Slow protocols header */
13 struct eth_slow_header {
14 /** Slow protocols subtype */
16 /** Subtype version number */
18 } __attribute__ (( packed ));
21 #define ETH_SLOW_SUBTYPE_LACP 1
23 /** LACP version number */
24 #define ETH_SLOW_LACP_VERSION 1
27 #define ETH_SLOW_SUBTYPE_MARKER 2
29 /** Marker version number */
30 #define ETH_SLOW_MARKER_VERSION 1
32 /** TLV (type, length, value) header */
33 struct eth_slow_tlv_header {
36 * This is an ETH_SLOW_TLV_XXX constant.
41 * The length includes the TLV header (except for a TLV
42 * terminator, which has a length of zero).
45 } __attribute__ (( packed ));
47 /** Terminator type */
48 #define ETH_SLOW_TLV_TERMINATOR 0
50 /** Terminator length */
51 #define ETH_SLOW_TLV_TERMINATOR_LEN 0
53 /** LACP actor type */
54 #define ETH_SLOW_TLV_LACP_ACTOR 1
56 /** LACP actor length */
57 #define ETH_SLOW_TLV_LACP_ACTOR_LEN \
58 ( sizeof ( struct eth_slow_lacp_entity_tlv ) )
60 /** LACP partner type */
61 #define ETH_SLOW_TLV_LACP_PARTNER 2
63 /** LACP partner length */
64 #define ETH_SLOW_TLV_LACP_PARTNER_LEN \
65 ( sizeof ( struct eth_slow_lacp_entity_tlv ) )
67 /** LACP collector type */
68 #define ETH_SLOW_TLV_LACP_COLLECTOR 3
70 /** LACP collector length */
71 #define ETH_SLOW_TLV_LACP_COLLECTOR_LEN \
72 ( sizeof ( struct eth_slow_lacp_collector_tlv ) )
74 /** Marker request type */
75 #define ETH_SLOW_TLV_MARKER_REQUEST 1
77 /** Marker request length */
78 #define ETH_SLOW_TLV_MARKER_REQUEST_LEN \
79 ( sizeof ( struct eth_slow_marker_tlv ) )
81 /** Marker response type */
82 #define ETH_SLOW_TLV_MARKER_RESPONSE 2
84 /** Marker response length */
85 #define ETH_SLOW_TLV_MARKER_RESPONSE_LEN \
86 ( sizeof ( struct eth_slow_marker_tlv ) )
89 struct eth_slow_terminator_tlv {
91 struct eth_slow_tlv_header tlv;
92 } __attribute__ (( packed ));
94 /** LACP entity (actor or partner) TLV */
95 struct eth_slow_lacp_entity_tlv {
97 struct eth_slow_tlv_header tlv;
100 * Used to determine the order in which ports are selected for
103 uint16_t system_priority;
104 /** System identifier
106 * Used to uniquely identify the system (i.e. the entity with
107 * potentially multiple ports).
109 uint8_t system[ETH_ALEN];
112 * Used to uniquely identify a group of aggregatable ports
118 * Used to determine the order in which ports are selected for
121 uint16_t port_priority;
124 * Used to uniquely identify a port within a system.
129 * This is the bitwise OR of zero or more LACP_STATE_XXX
135 } __attribute__ (( packed ));
137 /** Maximum system priority */
138 #define LACP_SYSTEM_PRIORITY_MAX 0xffff
140 /** Maximum port priority */
141 #define LACP_PORT_PRIORITY_MAX 0xff
143 /** LACP entity is active
145 * Represented by the state character "A"/"a"
147 #define LACP_STATE_ACTIVE 0x01
149 /** LACP timeout is short
151 * Short timeout is one second, long timeout is 30s
153 * Represented by the state character "F"/"f"
155 #define LACP_STATE_FAST 0x02
157 /** LACP link is aggregateable
159 * Represented by the state characters "G"/"g"
161 #define LACP_STATE_AGGREGATABLE 0x04
163 /** LACP link is in synchronisation
165 * Represented by the state characters "S"/"s"
167 #define LACP_STATE_IN_SYNC 0x08
169 /** LACP link is collecting (receiving)
171 * Represented by the state characters "C"/"c"
173 #define LACP_STATE_COLLECTING 0x10
175 /** LACP link is distributing (transmitting)
177 * Represented by the state characters "D"/"d"
179 #define LACP_STATE_DISTRIBUTING 0x20
181 /** LACP entity is using defaulted partner information
183 * Represented by the state characters "L"/"l"
185 #define LACP_STATE_DEFAULTED 0x40
187 /** LACP entity receive state machine is in EXPIRED
189 * Represented by the state characters "X"/"x"
191 #define LACP_STATE_EXPIRED 0x80
193 /** LACP collector TLV */
194 struct eth_slow_lacp_collector_tlv {
196 struct eth_slow_tlv_header tlv;
197 /** Maximum delay (in 10us increments) */
200 uint8_t reserved[12];
201 } __attribute__ (( packed ));
204 struct eth_slow_marker_tlv {
206 struct eth_slow_tlv_header tlv;
207 /** Requester port */
209 /** Requester system */
210 uint8_t system[ETH_ALEN];
211 /** Requester transaction ID */
215 } __attribute__ (( packed ));
218 struct eth_slow_lacp {
219 /** Slow protocols header */
220 struct eth_slow_header header;
221 /** Actor information */
222 struct eth_slow_lacp_entity_tlv actor;
223 /** Partner information */
224 struct eth_slow_lacp_entity_tlv partner;
225 /** Collector information */
226 struct eth_slow_lacp_collector_tlv collector;
228 struct eth_slow_terminator_tlv terminator;
230 uint8_t reserved[50];
231 } __attribute__ (( packed ));
234 struct eth_slow_marker {
235 /** Slow protocols header */
236 struct eth_slow_header header;
237 /** Marker information */
238 struct eth_slow_marker_tlv marker;
240 struct eth_slow_terminator_tlv terminator;
242 uint8_t reserved[90];
243 } __attribute__ (( packed ));
245 /** Slow protocols packet */
246 union eth_slow_packet {
247 /** Slow protocols header */
248 struct eth_slow_header header;
250 struct eth_slow_lacp lacp;
252 struct eth_slow_marker marker;
253 } __attribute__ (( packed ));
255 #endif /* _IPXE_ETH_SLOW_H */