xref: /linux/include/uapi/linux/dcbnl.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1e2be04c7SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /*
3607ca46eSDavid Howells  * Copyright (c) 2008-2011, Intel Corporation.
4607ca46eSDavid Howells  *
5607ca46eSDavid Howells  * This program is free software; you can redistribute it and/or modify it
6607ca46eSDavid Howells  * under the terms and conditions of the GNU General Public License,
7607ca46eSDavid Howells  * version 2, as published by the Free Software Foundation.
8607ca46eSDavid Howells  *
9607ca46eSDavid Howells  * This program is distributed in the hope it will be useful, but WITHOUT
10607ca46eSDavid Howells  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11607ca46eSDavid Howells  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12607ca46eSDavid Howells  * more details.
13607ca46eSDavid Howells  *
14607ca46eSDavid Howells  * You should have received a copy of the GNU General Public License along with
15607ca46eSDavid Howells  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16607ca46eSDavid Howells  * Place - Suite 330, Boston, MA 02111-1307 USA.
17607ca46eSDavid Howells  *
18607ca46eSDavid Howells  * Author: Lucy Liu <lucy.liu@intel.com>
19607ca46eSDavid Howells  */
20607ca46eSDavid Howells 
21607ca46eSDavid Howells #ifndef __LINUX_DCBNL_H__
22607ca46eSDavid Howells #define __LINUX_DCBNL_H__
23607ca46eSDavid Howells 
24607ca46eSDavid Howells #include <linux/types.h>
25607ca46eSDavid Howells 
26607ca46eSDavid Howells /* IEEE 802.1Qaz std supported values */
27607ca46eSDavid Howells #define IEEE_8021QAZ_MAX_TCS	8
28607ca46eSDavid Howells 
29607ca46eSDavid Howells #define IEEE_8021QAZ_TSA_STRICT		0
30607ca46eSDavid Howells #define IEEE_8021QAZ_TSA_CB_SHAPER	1
31607ca46eSDavid Howells #define IEEE_8021QAZ_TSA_ETS		2
32607ca46eSDavid Howells #define IEEE_8021QAZ_TSA_VENDOR		255
33607ca46eSDavid Howells 
34607ca46eSDavid Howells /* This structure contains the IEEE 802.1Qaz ETS managed object
35607ca46eSDavid Howells  *
36607ca46eSDavid Howells  * @willing: willing bit in ETS configuration TLV
37607ca46eSDavid Howells  * @ets_cap: indicates supported capacity of ets feature
38607ca46eSDavid Howells  * @cbs: credit based shaper ets algorithm supported
39607ca46eSDavid Howells  * @tc_tx_bw: tc tx bandwidth indexed by traffic class
40607ca46eSDavid Howells  * @tc_rx_bw: tc rx bandwidth indexed by traffic class
41607ca46eSDavid Howells  * @tc_tsa: TSA Assignment table, indexed by traffic class
42607ca46eSDavid Howells  * @prio_tc: priority assignment table mapping 8021Qp to traffic class
43607ca46eSDavid Howells  * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
44607ca46eSDavid Howells  * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
45607ca46eSDavid Howells  * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
46607ca46eSDavid Howells  *
47607ca46eSDavid Howells  * Recommended values are used to set fields in the ETS recommendation TLV
48607ca46eSDavid Howells  * with hardware offloaded LLDP.
49607ca46eSDavid Howells  *
50607ca46eSDavid Howells  * ----
51607ca46eSDavid Howells  *  TSA Assignment 8 bit identifiers
52607ca46eSDavid Howells  *	0	strict priority
53607ca46eSDavid Howells  *	1	credit-based shaper
54607ca46eSDavid Howells  *	2	enhanced transmission selection
55607ca46eSDavid Howells  *	3-254	reserved
56607ca46eSDavid Howells  *	255	vendor specific
57607ca46eSDavid Howells  */
58607ca46eSDavid Howells struct ieee_ets {
59607ca46eSDavid Howells 	__u8	willing;
60607ca46eSDavid Howells 	__u8	ets_cap;
61607ca46eSDavid Howells 	__u8	cbs;
62607ca46eSDavid Howells 	__u8	tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
63607ca46eSDavid Howells 	__u8	tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
64607ca46eSDavid Howells 	__u8	tc_tsa[IEEE_8021QAZ_MAX_TCS];
65607ca46eSDavid Howells 	__u8	prio_tc[IEEE_8021QAZ_MAX_TCS];
66607ca46eSDavid Howells 	__u8	tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
67607ca46eSDavid Howells 	__u8	tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
68607ca46eSDavid Howells 	__u8	reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
69607ca46eSDavid Howells };
70607ca46eSDavid Howells 
71607ca46eSDavid Howells /* This structure contains rate limit extension to the IEEE 802.1Qaz ETS
72607ca46eSDavid Howells  * managed object.
73607ca46eSDavid Howells  * Values are 64 bits long and specified in Kbps to enable usage over both
74607ca46eSDavid Howells  * slow and very fast networks.
75607ca46eSDavid Howells  *
76607ca46eSDavid Howells  * @tc_maxrate: maximal tc tx bandwidth indexed by traffic class
77607ca46eSDavid Howells  */
78607ca46eSDavid Howells struct ieee_maxrate {
79607ca46eSDavid Howells 	__u64	tc_maxrate[IEEE_8021QAZ_MAX_TCS];
80607ca46eSDavid Howells };
81607ca46eSDavid Howells 
82c9368247SShani Michaeli enum dcbnl_cndd_states {
83c9368247SShani Michaeli 	DCB_CNDD_RESET = 0,
84c9368247SShani Michaeli 	DCB_CNDD_EDGE,
85c9368247SShani Michaeli 	DCB_CNDD_INTERIOR,
86c9368247SShani Michaeli 	DCB_CNDD_INTERIOR_READY,
87c9368247SShani Michaeli };
88c9368247SShani Michaeli 
89c9368247SShani Michaeli /* This structure contains the IEEE 802.1Qau QCN managed object.
90c9368247SShani Michaeli  *
91c9368247SShani Michaeli  *@rpg_enable: enable QCN RP
92c9368247SShani Michaeli  *@rppp_max_rps: maximum number of RPs allowed for this CNPV on this port
93c9368247SShani Michaeli  *@rpg_time_reset: time between rate increases if no CNMs received.
94c9368247SShani Michaeli  *		   given in u-seconds
95c9368247SShani Michaeli  *@rpg_byte_reset: transmitted data between rate increases if no CNMs received.
96c9368247SShani Michaeli  *		   given in Bytes
97c9368247SShani Michaeli  *@rpg_threshold: The number of times rpByteStage or rpTimeStage can count
98c9368247SShani Michaeli  *		   before RP rate control state machine advances states
99c9368247SShani Michaeli  *@rpg_max_rate: the maxinun rate, in Mbits per second,
100c9368247SShani Michaeli  *		 at which an RP can transmit
101c9368247SShani Michaeli  *@rpg_ai_rate: The rate, in Mbits per second,
102c9368247SShani Michaeli  *		used to increase rpTargetRate in the RPR_ACTIVE_INCREASE
103c9368247SShani Michaeli  *@rpg_hai_rate: The rate, in Mbits per second,
104c9368247SShani Michaeli  *		 used to increase rpTargetRate in the RPR_HYPER_INCREASE state
105c9368247SShani Michaeli  *@rpg_gd: Upon CNM receive, flow rate is limited to (Fb/Gd)*CurrentRate.
106c9368247SShani Michaeli  *	   rpgGd is given as log2(Gd), where Gd may only be powers of 2
107c9368247SShani Michaeli  *@rpg_min_dec_fac: The minimum factor by which the current transmit rate
108c9368247SShani Michaeli  *		    can be changed by reception of a CNM.
109c9368247SShani Michaeli  *		    value is given as percentage (1-100)
110c9368247SShani Michaeli  *@rpg_min_rate: The minimum value, in bits per second, for rate to limit
111c9368247SShani Michaeli  *@cndd_state_machine: The state of the congestion notification domain
112c9368247SShani Michaeli  *		       defense state machine, as defined by IEEE 802.3Qau
113c9368247SShani Michaeli  *		       section 32.1.1. In the interior ready state,
114c9368247SShani Michaeli  *		       the QCN capable hardware may add CN-TAG TLV to the
115c9368247SShani Michaeli  *		       outgoing traffic, to specifically identify outgoing
116c9368247SShani Michaeli  *		       flows.
117c9368247SShani Michaeli  */
118c9368247SShani Michaeli 
119c9368247SShani Michaeli struct ieee_qcn {
120c9368247SShani Michaeli 	__u8 rpg_enable[IEEE_8021QAZ_MAX_TCS];
121c9368247SShani Michaeli 	__u32 rppp_max_rps[IEEE_8021QAZ_MAX_TCS];
122c9368247SShani Michaeli 	__u32 rpg_time_reset[IEEE_8021QAZ_MAX_TCS];
123c9368247SShani Michaeli 	__u32 rpg_byte_reset[IEEE_8021QAZ_MAX_TCS];
124c9368247SShani Michaeli 	__u32 rpg_threshold[IEEE_8021QAZ_MAX_TCS];
125c9368247SShani Michaeli 	__u32 rpg_max_rate[IEEE_8021QAZ_MAX_TCS];
126c9368247SShani Michaeli 	__u32 rpg_ai_rate[IEEE_8021QAZ_MAX_TCS];
127c9368247SShani Michaeli 	__u32 rpg_hai_rate[IEEE_8021QAZ_MAX_TCS];
128c9368247SShani Michaeli 	__u32 rpg_gd[IEEE_8021QAZ_MAX_TCS];
129c9368247SShani Michaeli 	__u32 rpg_min_dec_fac[IEEE_8021QAZ_MAX_TCS];
130c9368247SShani Michaeli 	__u32 rpg_min_rate[IEEE_8021QAZ_MAX_TCS];
131c9368247SShani Michaeli 	__u32 cndd_state_machine[IEEE_8021QAZ_MAX_TCS];
132c9368247SShani Michaeli };
133c9368247SShani Michaeli 
134c9368247SShani Michaeli /* This structure contains the IEEE 802.1Qau QCN statistics.
135c9368247SShani Michaeli  *
136c9368247SShani Michaeli  *@rppp_rp_centiseconds: the number of RP-centiseconds accumulated
137c9368247SShani Michaeli  *			 by RPs at this priority level on this Port
138c9368247SShani Michaeli  *@rppp_created_rps: number of active RPs(flows) that react to CNMs
139c9368247SShani Michaeli  */
140c9368247SShani Michaeli 
141c9368247SShani Michaeli struct ieee_qcn_stats {
142c9368247SShani Michaeli 	__u64 rppp_rp_centiseconds[IEEE_8021QAZ_MAX_TCS];
143c9368247SShani Michaeli 	__u32 rppp_created_rps[IEEE_8021QAZ_MAX_TCS];
144c9368247SShani Michaeli };
145c9368247SShani Michaeli 
146607ca46eSDavid Howells /* This structure contains the IEEE 802.1Qaz PFC managed object
147607ca46eSDavid Howells  *
148607ca46eSDavid Howells  * @pfc_cap: Indicates the number of traffic classes on the local device
149607ca46eSDavid Howells  *	     that may simultaneously have PFC enabled.
150607ca46eSDavid Howells  * @pfc_en: bitmap indicating pfc enabled traffic classes
151607ca46eSDavid Howells  * @mbc: enable macsec bypass capability
152607ca46eSDavid Howells  * @delay: the allowance made for a round-trip propagation delay of the
153607ca46eSDavid Howells  *	   link in bits.
154607ca46eSDavid Howells  * @requests: count of the sent pfc frames
155607ca46eSDavid Howells  * @indications: count of the received pfc frames
156607ca46eSDavid Howells  */
157607ca46eSDavid Howells struct ieee_pfc {
158607ca46eSDavid Howells 	__u8	pfc_cap;
159607ca46eSDavid Howells 	__u8	pfc_en;
160607ca46eSDavid Howells 	__u8	mbc;
161607ca46eSDavid Howells 	__u16	delay;
162607ca46eSDavid Howells 	__u64	requests[IEEE_8021QAZ_MAX_TCS];
163607ca46eSDavid Howells 	__u64	indications[IEEE_8021QAZ_MAX_TCS];
164607ca46eSDavid Howells };
165607ca46eSDavid Howells 
166e549f6f9SHuy Nguyen #define IEEE_8021Q_MAX_PRIORITIES 8
167e549f6f9SHuy Nguyen #define DCBX_MAX_BUFFERS  8
168e549f6f9SHuy Nguyen struct dcbnl_buffer {
169e549f6f9SHuy Nguyen 	/* priority to buffer mapping */
170e549f6f9SHuy Nguyen 	__u8    prio2buffer[IEEE_8021Q_MAX_PRIORITIES];
171e549f6f9SHuy Nguyen 	/* buffer size in Bytes */
172e549f6f9SHuy Nguyen 	__u32   buffer_size[DCBX_MAX_BUFFERS];
173e549f6f9SHuy Nguyen 	__u32   total_size;
174e549f6f9SHuy Nguyen };
175e549f6f9SHuy Nguyen 
176607ca46eSDavid Howells /* CEE DCBX std supported values */
177607ca46eSDavid Howells #define CEE_DCBX_MAX_PGS	8
178607ca46eSDavid Howells #define CEE_DCBX_MAX_PRIO	8
179607ca46eSDavid Howells 
180607ca46eSDavid Howells /**
181607ca46eSDavid Howells  * struct cee_pg - CEE Priority-Group managed object
182607ca46eSDavid Howells  *
183607ca46eSDavid Howells  * @willing: willing bit in the PG tlv
184607ca46eSDavid Howells  * @error: error bit in the PG tlv
185607ca46eSDavid Howells  * @pg_en: enable bit of the PG feature
186607ca46eSDavid Howells  * @tcs_supported: number of traffic classes supported
187607ca46eSDavid Howells  * @pg_bw: bandwidth percentage for each priority group
188607ca46eSDavid Howells  * @prio_pg: priority to PG mapping indexed by priority
189607ca46eSDavid Howells  */
190607ca46eSDavid Howells struct cee_pg {
191607ca46eSDavid Howells 	__u8    willing;
192607ca46eSDavid Howells 	__u8    error;
193607ca46eSDavid Howells 	__u8    pg_en;
194607ca46eSDavid Howells 	__u8    tcs_supported;
195607ca46eSDavid Howells 	__u8    pg_bw[CEE_DCBX_MAX_PGS];
196607ca46eSDavid Howells 	__u8    prio_pg[CEE_DCBX_MAX_PGS];
197607ca46eSDavid Howells };
198607ca46eSDavid Howells 
199607ca46eSDavid Howells /**
200607ca46eSDavid Howells  * struct cee_pfc - CEE PFC managed object
201607ca46eSDavid Howells  *
202607ca46eSDavid Howells  * @willing: willing bit in the PFC tlv
203607ca46eSDavid Howells  * @error: error bit in the PFC tlv
204607ca46eSDavid Howells  * @pfc_en: bitmap indicating pfc enabled traffic classes
205607ca46eSDavid Howells  * @tcs_supported: number of traffic classes supported
206607ca46eSDavid Howells  */
207607ca46eSDavid Howells struct cee_pfc {
208607ca46eSDavid Howells 	__u8    willing;
209607ca46eSDavid Howells 	__u8    error;
210607ca46eSDavid Howells 	__u8    pfc_en;
211607ca46eSDavid Howells 	__u8    tcs_supported;
212607ca46eSDavid Howells };
213607ca46eSDavid Howells 
214607ca46eSDavid Howells /* IEEE 802.1Qaz std supported values */
215607ca46eSDavid Howells #define IEEE_8021QAZ_APP_SEL_ETHERTYPE	1
216607ca46eSDavid Howells #define IEEE_8021QAZ_APP_SEL_STREAM	2
217607ca46eSDavid Howells #define IEEE_8021QAZ_APP_SEL_DGRAM	3
218607ca46eSDavid Howells #define IEEE_8021QAZ_APP_SEL_ANY	4
219ee205981SHuy Nguyen #define IEEE_8021QAZ_APP_SEL_DSCP       5
220607ca46eSDavid Howells 
221ec32c0c4SDaniel Machon /* Non-std selector values */
222ec32c0c4SDaniel Machon #define DCB_APP_SEL_PCP 255
223ec32c0c4SDaniel Machon 
224607ca46eSDavid Howells /* This structure contains the IEEE 802.1Qaz APP managed object. This
22542bcce87SAnish Bhatt  * object is also used for the CEE std as well.
226607ca46eSDavid Howells  *
227607ca46eSDavid Howells  * @selector: protocol identifier type
228607ca46eSDavid Howells  * @protocol: protocol of type indicated
22916eecd9bSAnish Bhatt  * @priority: 3-bit unsigned integer indicating priority for IEEE
23016eecd9bSAnish Bhatt  *            8-bit 802.1p user priority bitmap for CEE
231607ca46eSDavid Howells  *
232607ca46eSDavid Howells  * ----
23342bcce87SAnish Bhatt  *  Selector field values for IEEE 802.1Qaz
234607ca46eSDavid Howells  *	0	Reserved
235607ca46eSDavid Howells  *	1	Ethertype
236607ca46eSDavid Howells  *	2	Well known port number over TCP or SCTP
237607ca46eSDavid Howells  *	3	Well known port number over UDP or DCCP
238607ca46eSDavid Howells  *	4	Well known port number over TCP, SCTP, UDP, or DCCP
2394b09384aSJakub Kicinski  *	5	Differentiated Services Code Point (DSCP) value
2404b09384aSJakub Kicinski  *	6-7	Reserved
24142bcce87SAnish Bhatt  *
24242bcce87SAnish Bhatt  *  Selector field values for CEE
24342bcce87SAnish Bhatt  *	0	Ethertype
24442bcce87SAnish Bhatt  *	1	Well known port number over TCP or UDP
24542bcce87SAnish Bhatt  *	2-3	Reserved
246607ca46eSDavid Howells  */
247607ca46eSDavid Howells struct dcb_app {
248607ca46eSDavid Howells 	__u8	selector;
249607ca46eSDavid Howells 	__u8	priority;
250607ca46eSDavid Howells 	__u16	protocol;
251607ca46eSDavid Howells };
252607ca46eSDavid Howells 
253ec32c0c4SDaniel Machon #define IEEE_8021QAZ_APP_SEL_MAX 255
254ec32c0c4SDaniel Machon 
255607ca46eSDavid Howells /**
256607ca46eSDavid Howells  * struct dcb_peer_app_info - APP feature information sent by the peer
257607ca46eSDavid Howells  *
258607ca46eSDavid Howells  * @willing: willing bit in the peer APP tlv
259607ca46eSDavid Howells  * @error: error bit in the peer APP tlv
260607ca46eSDavid Howells  *
261607ca46eSDavid Howells  * In addition to this information the full peer APP tlv also contains
262607ca46eSDavid Howells  * a table of 'app_count' APP objects defined above.
263607ca46eSDavid Howells  */
264607ca46eSDavid Howells struct dcb_peer_app_info {
265607ca46eSDavid Howells 	__u8	willing;
266607ca46eSDavid Howells 	__u8	error;
267607ca46eSDavid Howells };
268607ca46eSDavid Howells 
269607ca46eSDavid Howells struct dcbmsg {
270607ca46eSDavid Howells 	__u8               dcb_family;
271607ca46eSDavid Howells 	__u8               cmd;
272607ca46eSDavid Howells 	__u16              dcb_pad;
273607ca46eSDavid Howells };
274607ca46eSDavid Howells 
275607ca46eSDavid Howells /**
276607ca46eSDavid Howells  * enum dcbnl_commands - supported DCB commands
277607ca46eSDavid Howells  *
278607ca46eSDavid Howells  * @DCB_CMD_UNDEFINED: unspecified command to catch errors
279607ca46eSDavid Howells  * @DCB_CMD_GSTATE: request the state of DCB in the device
280607ca46eSDavid Howells  * @DCB_CMD_SSTATE: set the state of DCB in the device
281607ca46eSDavid Howells  * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
282607ca46eSDavid Howells  * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
283607ca46eSDavid Howells  * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
284607ca46eSDavid Howells  * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
285607ca46eSDavid Howells  * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
286607ca46eSDavid Howells  * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
287607ca46eSDavid Howells  * @DCB_CMD_SET_ALL: apply all changes to the underlying device
288607ca46eSDavid Howells  * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
289607ca46eSDavid Howells  *                        device.  Only useful when using bonding.
290607ca46eSDavid Howells  * @DCB_CMD_GCAP: request the DCB capabilities of the device
291607ca46eSDavid Howells  * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
292607ca46eSDavid Howells  * @DCB_CMD_SNUMTCS: set the number of traffic classes
293607ca46eSDavid Howells  * @DCB_CMD_GBCN: set backward congestion notification configuration
294c199ce4fSGeert Uytterhoeven  * @DCB_CMD_SBCN: get backward congestion notification configuration.
295607ca46eSDavid Howells  * @DCB_CMD_GAPP: get application protocol configuration
296607ca46eSDavid Howells  * @DCB_CMD_SAPP: set application protocol configuration
297607ca46eSDavid Howells  * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
298607ca46eSDavid Howells  * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
299607ca46eSDavid Howells  * @DCB_CMD_GDCBX: get DCBX engine configuration
300607ca46eSDavid Howells  * @DCB_CMD_SDCBX: set DCBX engine configuration
301607ca46eSDavid Howells  * @DCB_CMD_GFEATCFG: get DCBX features flags
302607ca46eSDavid Howells  * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
303607ca46eSDavid Howells  * @DCB_CMD_CEE_GET: get CEE aggregated configuration
304607ca46eSDavid Howells  * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
305607ca46eSDavid Howells  */
306607ca46eSDavid Howells enum dcbnl_commands {
307607ca46eSDavid Howells 	DCB_CMD_UNDEFINED,
308607ca46eSDavid Howells 
309607ca46eSDavid Howells 	DCB_CMD_GSTATE,
310607ca46eSDavid Howells 	DCB_CMD_SSTATE,
311607ca46eSDavid Howells 
312607ca46eSDavid Howells 	DCB_CMD_PGTX_GCFG,
313607ca46eSDavid Howells 	DCB_CMD_PGTX_SCFG,
314607ca46eSDavid Howells 	DCB_CMD_PGRX_GCFG,
315607ca46eSDavid Howells 	DCB_CMD_PGRX_SCFG,
316607ca46eSDavid Howells 
317607ca46eSDavid Howells 	DCB_CMD_PFC_GCFG,
318607ca46eSDavid Howells 	DCB_CMD_PFC_SCFG,
319607ca46eSDavid Howells 
320607ca46eSDavid Howells 	DCB_CMD_SET_ALL,
321607ca46eSDavid Howells 
322607ca46eSDavid Howells 	DCB_CMD_GPERM_HWADDR,
323607ca46eSDavid Howells 
324607ca46eSDavid Howells 	DCB_CMD_GCAP,
325607ca46eSDavid Howells 
326607ca46eSDavid Howells 	DCB_CMD_GNUMTCS,
327607ca46eSDavid Howells 	DCB_CMD_SNUMTCS,
328607ca46eSDavid Howells 
329607ca46eSDavid Howells 	DCB_CMD_PFC_GSTATE,
330607ca46eSDavid Howells 	DCB_CMD_PFC_SSTATE,
331607ca46eSDavid Howells 
332607ca46eSDavid Howells 	DCB_CMD_BCN_GCFG,
333607ca46eSDavid Howells 	DCB_CMD_BCN_SCFG,
334607ca46eSDavid Howells 
335607ca46eSDavid Howells 	DCB_CMD_GAPP,
336607ca46eSDavid Howells 	DCB_CMD_SAPP,
337607ca46eSDavid Howells 
338607ca46eSDavid Howells 	DCB_CMD_IEEE_SET,
339607ca46eSDavid Howells 	DCB_CMD_IEEE_GET,
340607ca46eSDavid Howells 
341607ca46eSDavid Howells 	DCB_CMD_GDCBX,
342607ca46eSDavid Howells 	DCB_CMD_SDCBX,
343607ca46eSDavid Howells 
344607ca46eSDavid Howells 	DCB_CMD_GFEATCFG,
345607ca46eSDavid Howells 	DCB_CMD_SFEATCFG,
346607ca46eSDavid Howells 
347607ca46eSDavid Howells 	DCB_CMD_CEE_GET,
348607ca46eSDavid Howells 	DCB_CMD_IEEE_DEL,
349607ca46eSDavid Howells 
350607ca46eSDavid Howells 	__DCB_CMD_ENUM_MAX,
351607ca46eSDavid Howells 	DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
352607ca46eSDavid Howells };
353607ca46eSDavid Howells 
354607ca46eSDavid Howells /**
355607ca46eSDavid Howells  * enum dcbnl_attrs - DCB top-level netlink attributes
356607ca46eSDavid Howells  *
357607ca46eSDavid Howells  * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
358607ca46eSDavid Howells  * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
359607ca46eSDavid Howells  * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
360607ca46eSDavid Howells  * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
361607ca46eSDavid Howells  * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
362607ca46eSDavid Howells  * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
363607ca46eSDavid Howells  * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
364607ca46eSDavid Howells  * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
365607ca46eSDavid Howells  * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
366607ca46eSDavid Howells  * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
367607ca46eSDavid Howells  * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
368607ca46eSDavid Howells  * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
369607ca46eSDavid Howells  * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
370607ca46eSDavid Howells  * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
371607ca46eSDavid Howells  * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
372607ca46eSDavid Howells  * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
373607ca46eSDavid Howells  */
374607ca46eSDavid Howells enum dcbnl_attrs {
375607ca46eSDavid Howells 	DCB_ATTR_UNDEFINED,
376607ca46eSDavid Howells 
377607ca46eSDavid Howells 	DCB_ATTR_IFNAME,
378607ca46eSDavid Howells 	DCB_ATTR_STATE,
379607ca46eSDavid Howells 	DCB_ATTR_PFC_STATE,
380607ca46eSDavid Howells 	DCB_ATTR_PFC_CFG,
381607ca46eSDavid Howells 	DCB_ATTR_NUM_TC,
382607ca46eSDavid Howells 	DCB_ATTR_PG_CFG,
383607ca46eSDavid Howells 	DCB_ATTR_SET_ALL,
384607ca46eSDavid Howells 	DCB_ATTR_PERM_HWADDR,
385607ca46eSDavid Howells 	DCB_ATTR_CAP,
386607ca46eSDavid Howells 	DCB_ATTR_NUMTCS,
387607ca46eSDavid Howells 	DCB_ATTR_BCN,
388607ca46eSDavid Howells 	DCB_ATTR_APP,
389607ca46eSDavid Howells 
390607ca46eSDavid Howells 	/* IEEE std attributes */
391607ca46eSDavid Howells 	DCB_ATTR_IEEE,
392607ca46eSDavid Howells 
393607ca46eSDavid Howells 	DCB_ATTR_DCBX,
394607ca46eSDavid Howells 	DCB_ATTR_FEATCFG,
395607ca46eSDavid Howells 
396607ca46eSDavid Howells 	/* CEE nested attributes */
397607ca46eSDavid Howells 	DCB_ATTR_CEE,
398607ca46eSDavid Howells 
399607ca46eSDavid Howells 	__DCB_ATTR_ENUM_MAX,
400607ca46eSDavid Howells 	DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
401607ca46eSDavid Howells };
402607ca46eSDavid Howells 
403607ca46eSDavid Howells /**
404607ca46eSDavid Howells  * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
405607ca46eSDavid Howells  *
406607ca46eSDavid Howells  * @DCB_ATTR_IEEE_UNSPEC: unspecified
407607ca46eSDavid Howells  * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
408607ca46eSDavid Howells  * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
409607ca46eSDavid Howells  * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
410607ca46eSDavid Howells  * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
411607ca46eSDavid Howells  * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
412607ca46eSDavid Howells  * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
4136182d587SDaniel Machon  * @DCB_ATTR_DCB_APP_TRUST_TABLE: selector trust table
414*622f1b2fSDaniel Machon  * @DCB_ATTR_DCB_REWR_TABLE: rewrite configuration
415607ca46eSDavid Howells  */
416607ca46eSDavid Howells enum ieee_attrs {
417607ca46eSDavid Howells 	DCB_ATTR_IEEE_UNSPEC,
418607ca46eSDavid Howells 	DCB_ATTR_IEEE_ETS,
419607ca46eSDavid Howells 	DCB_ATTR_IEEE_PFC,
420607ca46eSDavid Howells 	DCB_ATTR_IEEE_APP_TABLE,
421607ca46eSDavid Howells 	DCB_ATTR_IEEE_PEER_ETS,
422607ca46eSDavid Howells 	DCB_ATTR_IEEE_PEER_PFC,
423607ca46eSDavid Howells 	DCB_ATTR_IEEE_PEER_APP,
424607ca46eSDavid Howells 	DCB_ATTR_IEEE_MAXRATE,
425c9368247SShani Michaeli 	DCB_ATTR_IEEE_QCN,
426c9368247SShani Michaeli 	DCB_ATTR_IEEE_QCN_STATS,
427e549f6f9SHuy Nguyen 	DCB_ATTR_DCB_BUFFER,
4286182d587SDaniel Machon 	DCB_ATTR_DCB_APP_TRUST_TABLE,
429*622f1b2fSDaniel Machon 	DCB_ATTR_DCB_REWR_TABLE,
430607ca46eSDavid Howells 	__DCB_ATTR_IEEE_MAX
431607ca46eSDavid Howells };
432607ca46eSDavid Howells #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
433607ca46eSDavid Howells 
434607ca46eSDavid Howells enum ieee_attrs_app {
435607ca46eSDavid Howells 	DCB_ATTR_IEEE_APP_UNSPEC,
436607ca46eSDavid Howells 	DCB_ATTR_IEEE_APP,
437ec32c0c4SDaniel Machon 	DCB_ATTR_DCB_APP,
438607ca46eSDavid Howells 	__DCB_ATTR_IEEE_APP_MAX
439607ca46eSDavid Howells };
440607ca46eSDavid Howells #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
441607ca46eSDavid Howells 
442607ca46eSDavid Howells /**
443607ca46eSDavid Howells  * enum cee_attrs - CEE DCBX get attributes.
444607ca46eSDavid Howells  *
445607ca46eSDavid Howells  * @DCB_ATTR_CEE_UNSPEC: unspecified
446607ca46eSDavid Howells  * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
447607ca46eSDavid Howells  * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
448607ca46eSDavid Howells  * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
449607ca46eSDavid Howells  * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
450607ca46eSDavid Howells  * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
451607ca46eSDavid Howells  * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
452607ca46eSDavid Howells  * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
453607ca46eSDavid Howells  * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
454607ca46eSDavid Howells  *
455607ca46eSDavid Howells  * An aggregated collection of the cee std negotiated parameters.
456607ca46eSDavid Howells  */
457607ca46eSDavid Howells enum cee_attrs {
458607ca46eSDavid Howells 	DCB_ATTR_CEE_UNSPEC,
459607ca46eSDavid Howells 	DCB_ATTR_CEE_PEER_PG,
460607ca46eSDavid Howells 	DCB_ATTR_CEE_PEER_PFC,
461607ca46eSDavid Howells 	DCB_ATTR_CEE_PEER_APP_TABLE,
462607ca46eSDavid Howells 	DCB_ATTR_CEE_TX_PG,
463607ca46eSDavid Howells 	DCB_ATTR_CEE_RX_PG,
464607ca46eSDavid Howells 	DCB_ATTR_CEE_PFC,
465607ca46eSDavid Howells 	DCB_ATTR_CEE_APP_TABLE,
466607ca46eSDavid Howells 	DCB_ATTR_CEE_FEAT,
467607ca46eSDavid Howells 	__DCB_ATTR_CEE_MAX
468607ca46eSDavid Howells };
469607ca46eSDavid Howells #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
470607ca46eSDavid Howells 
471607ca46eSDavid Howells enum peer_app_attr {
472607ca46eSDavid Howells 	DCB_ATTR_CEE_PEER_APP_UNSPEC,
473607ca46eSDavid Howells 	DCB_ATTR_CEE_PEER_APP_INFO,
474607ca46eSDavid Howells 	DCB_ATTR_CEE_PEER_APP,
475607ca46eSDavid Howells 	__DCB_ATTR_CEE_PEER_APP_MAX
476607ca46eSDavid Howells };
477607ca46eSDavid Howells #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
478607ca46eSDavid Howells 
479607ca46eSDavid Howells enum cee_attrs_app {
480607ca46eSDavid Howells 	DCB_ATTR_CEE_APP_UNSPEC,
481607ca46eSDavid Howells 	DCB_ATTR_CEE_APP,
482607ca46eSDavid Howells 	__DCB_ATTR_CEE_APP_MAX
483607ca46eSDavid Howells };
484607ca46eSDavid Howells #define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
485607ca46eSDavid Howells 
486607ca46eSDavid Howells /**
487607ca46eSDavid Howells  * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
488607ca46eSDavid Howells  *
489607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
490607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
491607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
492607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
493607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
494607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
495607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
496607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
497607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
498607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
499607ca46eSDavid Howells  * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
500607ca46eSDavid Howells  *
501607ca46eSDavid Howells  */
502607ca46eSDavid Howells enum dcbnl_pfc_up_attrs {
503607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_UNDEFINED,
504607ca46eSDavid Howells 
505607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_0,
506607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_1,
507607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_2,
508607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_3,
509607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_4,
510607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_5,
511607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_6,
512607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_7,
513607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_ALL,
514607ca46eSDavid Howells 
515607ca46eSDavid Howells 	__DCB_PFC_UP_ATTR_ENUM_MAX,
516607ca46eSDavid Howells 	DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
517607ca46eSDavid Howells };
518607ca46eSDavid Howells 
519607ca46eSDavid Howells /**
520607ca46eSDavid Howells  * enum dcbnl_pg_attrs - DCB Priority Group attributes
521607ca46eSDavid Howells  *
522607ca46eSDavid Howells  * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
523607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
524607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
525607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
526607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
527607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
528607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
529607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
530607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
531607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
532607ca46eSDavid Howells  * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
533607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
534607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
535607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
536607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
537607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
538607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
539607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
540607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
541607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
542607ca46eSDavid Howells  * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
543607ca46eSDavid Howells  *
544607ca46eSDavid Howells  */
545607ca46eSDavid Howells enum dcbnl_pg_attrs {
546607ca46eSDavid Howells 	DCB_PG_ATTR_UNDEFINED,
547607ca46eSDavid Howells 
548607ca46eSDavid Howells 	DCB_PG_ATTR_TC_0,
549607ca46eSDavid Howells 	DCB_PG_ATTR_TC_1,
550607ca46eSDavid Howells 	DCB_PG_ATTR_TC_2,
551607ca46eSDavid Howells 	DCB_PG_ATTR_TC_3,
552607ca46eSDavid Howells 	DCB_PG_ATTR_TC_4,
553607ca46eSDavid Howells 	DCB_PG_ATTR_TC_5,
554607ca46eSDavid Howells 	DCB_PG_ATTR_TC_6,
555607ca46eSDavid Howells 	DCB_PG_ATTR_TC_7,
556607ca46eSDavid Howells 	DCB_PG_ATTR_TC_MAX,
557607ca46eSDavid Howells 	DCB_PG_ATTR_TC_ALL,
558607ca46eSDavid Howells 
559607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_0,
560607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_1,
561607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_2,
562607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_3,
563607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_4,
564607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_5,
565607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_6,
566607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_7,
567607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_MAX,
568607ca46eSDavid Howells 	DCB_PG_ATTR_BW_ID_ALL,
569607ca46eSDavid Howells 
570607ca46eSDavid Howells 	__DCB_PG_ATTR_ENUM_MAX,
571607ca46eSDavid Howells 	DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
572607ca46eSDavid Howells };
573607ca46eSDavid Howells 
574607ca46eSDavid Howells /**
575607ca46eSDavid Howells  * enum dcbnl_tc_attrs - DCB Traffic Class attributes
576607ca46eSDavid Howells  *
577607ca46eSDavid Howells  * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
578607ca46eSDavid Howells  * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
579607ca46eSDavid Howells  *                          Valid values are:  0-7
580607ca46eSDavid Howells  * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
581607ca46eSDavid Howells  *                                Some devices may not support changing the
582607ca46eSDavid Howells  *                                user priority map of a TC.
583607ca46eSDavid Howells  * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
584607ca46eSDavid Howells  *                                 0 - none
585607ca46eSDavid Howells  *                                 1 - group strict
586607ca46eSDavid Howells  *                                 2 - link strict
587607ca46eSDavid Howells  * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
588607ca46eSDavid Howells  *                            not configured to use link strict priority,
589607ca46eSDavid Howells  *                            this is the percentage of bandwidth of the
590607ca46eSDavid Howells  *                            priority group this traffic class belongs to
591607ca46eSDavid Howells  * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
592607ca46eSDavid Howells  *
593607ca46eSDavid Howells  */
594607ca46eSDavid Howells enum dcbnl_tc_attrs {
595607ca46eSDavid Howells 	DCB_TC_ATTR_PARAM_UNDEFINED,
596607ca46eSDavid Howells 
597607ca46eSDavid Howells 	DCB_TC_ATTR_PARAM_PGID,
598607ca46eSDavid Howells 	DCB_TC_ATTR_PARAM_UP_MAPPING,
599607ca46eSDavid Howells 	DCB_TC_ATTR_PARAM_STRICT_PRIO,
600607ca46eSDavid Howells 	DCB_TC_ATTR_PARAM_BW_PCT,
601607ca46eSDavid Howells 	DCB_TC_ATTR_PARAM_ALL,
602607ca46eSDavid Howells 
603607ca46eSDavid Howells 	__DCB_TC_ATTR_PARAM_ENUM_MAX,
604607ca46eSDavid Howells 	DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
605607ca46eSDavid Howells };
606607ca46eSDavid Howells 
607607ca46eSDavid Howells /**
608607ca46eSDavid Howells  * enum dcbnl_cap_attrs - DCB Capability attributes
609607ca46eSDavid Howells  *
610607ca46eSDavid Howells  * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
611607ca46eSDavid Howells  * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
612607ca46eSDavid Howells  * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
613607ca46eSDavid Howells  * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
614607ca46eSDavid Howells  * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
615607ca46eSDavid Howells  *                               traffic class mapping
616607ca46eSDavid Howells  * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
617607ca46eSDavid Howells  *                                number of traffic classes the device
618607ca46eSDavid Howells  *                                can be configured to use for Priority Groups
619607ca46eSDavid Howells  * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
620607ca46eSDavid Howells  *                                 number of traffic classes the device can be
621607ca46eSDavid Howells  *                                 configured to use for Priority Flow Control
622607ca46eSDavid Howells  * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
623607ca46eSDavid Howells  * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
624607ca46eSDavid Howells  *                             Notification
625607ca46eSDavid Howells  * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
626607ca46eSDavid Howells  *
627607ca46eSDavid Howells  */
628607ca46eSDavid Howells enum dcbnl_cap_attrs {
629607ca46eSDavid Howells 	DCB_CAP_ATTR_UNDEFINED,
630607ca46eSDavid Howells 	DCB_CAP_ATTR_ALL,
631607ca46eSDavid Howells 	DCB_CAP_ATTR_PG,
632607ca46eSDavid Howells 	DCB_CAP_ATTR_PFC,
633607ca46eSDavid Howells 	DCB_CAP_ATTR_UP2TC,
634607ca46eSDavid Howells 	DCB_CAP_ATTR_PG_TCS,
635607ca46eSDavid Howells 	DCB_CAP_ATTR_PFC_TCS,
636607ca46eSDavid Howells 	DCB_CAP_ATTR_GSP,
637607ca46eSDavid Howells 	DCB_CAP_ATTR_BCN,
638607ca46eSDavid Howells 	DCB_CAP_ATTR_DCBX,
639607ca46eSDavid Howells 
640607ca46eSDavid Howells 	__DCB_CAP_ATTR_ENUM_MAX,
641607ca46eSDavid Howells 	DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
642607ca46eSDavid Howells };
643607ca46eSDavid Howells 
644607ca46eSDavid Howells /**
645607ca46eSDavid Howells  * DCBX capability flags
646607ca46eSDavid Howells  *
647607ca46eSDavid Howells  * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
648607ca46eSDavid Howells  *                     'set' routines are used to configure the device with
649607ca46eSDavid Howells  *                     the negotiated parameters
650607ca46eSDavid Howells  *
651607ca46eSDavid Howells  * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
652607ca46eSDavid Howells  *                            by another entity
653607ca46eSDavid Howells  *                            'get' routines are used to retrieve the
654607ca46eSDavid Howells  *                            negotiated parameters
655607ca46eSDavid Howells  *                            'set' routines can be used to set the initial
656607ca46eSDavid Howells  *                            negotiation configuration
657607ca46eSDavid Howells  *
658607ca46eSDavid Howells  * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
659607ca46eSDavid Howells  *                        supports the CEE protocol flavor
660607ca46eSDavid Howells  *
661607ca46eSDavid Howells  * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
662607ca46eSDavid Howells  *                         supports the IEEE protocol flavor
663607ca46eSDavid Howells  *
664607ca46eSDavid Howells  * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
665607ca46eSDavid Howells  *                       supports static configuration (i.e no actual
666607ca46eSDavid Howells  *                       negotiation is performed negotiated parameters equal
667607ca46eSDavid Howells  *                       the initial configuration)
668607ca46eSDavid Howells  *
669607ca46eSDavid Howells  */
670607ca46eSDavid Howells #define DCB_CAP_DCBX_HOST		0x01
671607ca46eSDavid Howells #define DCB_CAP_DCBX_LLD_MANAGED	0x02
672607ca46eSDavid Howells #define DCB_CAP_DCBX_VER_CEE		0x04
673607ca46eSDavid Howells #define DCB_CAP_DCBX_VER_IEEE		0x08
674607ca46eSDavid Howells #define DCB_CAP_DCBX_STATIC		0x10
675607ca46eSDavid Howells 
676607ca46eSDavid Howells /**
677607ca46eSDavid Howells  * enum dcbnl_numtcs_attrs - number of traffic classes
678607ca46eSDavid Howells  *
679607ca46eSDavid Howells  * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
680607ca46eSDavid Howells  * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
681607ca46eSDavid Howells  * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
682607ca46eSDavid Howells  *                               priority groups
683607ca46eSDavid Howells  * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
684607ca46eSDavid Howells  *                                support priority flow control
685607ca46eSDavid Howells  */
686607ca46eSDavid Howells enum dcbnl_numtcs_attrs {
687607ca46eSDavid Howells 	DCB_NUMTCS_ATTR_UNDEFINED,
688607ca46eSDavid Howells 	DCB_NUMTCS_ATTR_ALL,
689607ca46eSDavid Howells 	DCB_NUMTCS_ATTR_PG,
690607ca46eSDavid Howells 	DCB_NUMTCS_ATTR_PFC,
691607ca46eSDavid Howells 
692607ca46eSDavid Howells 	__DCB_NUMTCS_ATTR_ENUM_MAX,
693607ca46eSDavid Howells 	DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
694607ca46eSDavid Howells };
695607ca46eSDavid Howells 
696607ca46eSDavid Howells enum dcbnl_bcn_attrs{
697607ca46eSDavid Howells 	DCB_BCN_ATTR_UNDEFINED = 0,
698607ca46eSDavid Howells 
699607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_0,
700607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_1,
701607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_2,
702607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_3,
703607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_4,
704607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_5,
705607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_6,
706607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_7,
707607ca46eSDavid Howells 	DCB_BCN_ATTR_RP_ALL,
708607ca46eSDavid Howells 
709607ca46eSDavid Howells 	DCB_BCN_ATTR_BCNA_0,
710607ca46eSDavid Howells 	DCB_BCN_ATTR_BCNA_1,
711607ca46eSDavid Howells 	DCB_BCN_ATTR_ALPHA,
712607ca46eSDavid Howells 	DCB_BCN_ATTR_BETA,
713607ca46eSDavid Howells 	DCB_BCN_ATTR_GD,
714607ca46eSDavid Howells 	DCB_BCN_ATTR_GI,
715607ca46eSDavid Howells 	DCB_BCN_ATTR_TMAX,
716607ca46eSDavid Howells 	DCB_BCN_ATTR_TD,
717607ca46eSDavid Howells 	DCB_BCN_ATTR_RMIN,
718607ca46eSDavid Howells 	DCB_BCN_ATTR_W,
719607ca46eSDavid Howells 	DCB_BCN_ATTR_RD,
720607ca46eSDavid Howells 	DCB_BCN_ATTR_RU,
721607ca46eSDavid Howells 	DCB_BCN_ATTR_WRTT,
722607ca46eSDavid Howells 	DCB_BCN_ATTR_RI,
723607ca46eSDavid Howells 	DCB_BCN_ATTR_C,
724607ca46eSDavid Howells 	DCB_BCN_ATTR_ALL,
725607ca46eSDavid Howells 
726607ca46eSDavid Howells 	__DCB_BCN_ATTR_ENUM_MAX,
727607ca46eSDavid Howells 	DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
728607ca46eSDavid Howells };
729607ca46eSDavid Howells 
730607ca46eSDavid Howells /**
731607ca46eSDavid Howells  * enum dcb_general_attr_values - general DCB attribute values
732607ca46eSDavid Howells  *
733607ca46eSDavid Howells  * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
734607ca46eSDavid Howells  *
735607ca46eSDavid Howells  */
736607ca46eSDavid Howells enum dcb_general_attr_values {
737607ca46eSDavid Howells 	DCB_ATTR_VALUE_UNDEFINED = 0xff
738607ca46eSDavid Howells };
739607ca46eSDavid Howells 
740607ca46eSDavid Howells #define DCB_APP_IDTYPE_ETHTYPE	0x00
741607ca46eSDavid Howells #define DCB_APP_IDTYPE_PORTNUM	0x01
742607ca46eSDavid Howells enum dcbnl_app_attrs {
743607ca46eSDavid Howells 	DCB_APP_ATTR_UNDEFINED,
744607ca46eSDavid Howells 
745607ca46eSDavid Howells 	DCB_APP_ATTR_IDTYPE,
746607ca46eSDavid Howells 	DCB_APP_ATTR_ID,
747607ca46eSDavid Howells 	DCB_APP_ATTR_PRIORITY,
748607ca46eSDavid Howells 
749607ca46eSDavid Howells 	__DCB_APP_ATTR_ENUM_MAX,
750607ca46eSDavid Howells 	DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
751607ca46eSDavid Howells };
752607ca46eSDavid Howells 
753607ca46eSDavid Howells /**
754607ca46eSDavid Howells  * enum dcbnl_featcfg_attrs - features conifiguration flags
755607ca46eSDavid Howells  *
756607ca46eSDavid Howells  * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
757607ca46eSDavid Howells  * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
758607ca46eSDavid Howells  * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
759607ca46eSDavid Howells  * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
760607ca46eSDavid Howells  *                                 flow control
761607ca46eSDavid Howells  * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
762607ca46eSDavid Howells  *
763607ca46eSDavid Howells  */
764607ca46eSDavid Howells #define DCB_FEATCFG_ERROR	0x01	/* error in feature resolution */
765607ca46eSDavid Howells #define DCB_FEATCFG_ENABLE	0x02	/* enable feature */
766607ca46eSDavid Howells #define DCB_FEATCFG_WILLING	0x04	/* feature is willing */
767607ca46eSDavid Howells #define DCB_FEATCFG_ADVERTISE	0x08	/* advertise feature */
768607ca46eSDavid Howells enum dcbnl_featcfg_attrs {
769607ca46eSDavid Howells 	DCB_FEATCFG_ATTR_UNDEFINED,
770607ca46eSDavid Howells 	DCB_FEATCFG_ATTR_ALL,
771607ca46eSDavid Howells 	DCB_FEATCFG_ATTR_PG,
772607ca46eSDavid Howells 	DCB_FEATCFG_ATTR_PFC,
773607ca46eSDavid Howells 	DCB_FEATCFG_ATTR_APP,
774607ca46eSDavid Howells 
775607ca46eSDavid Howells 	__DCB_FEATCFG_ATTR_ENUM_MAX,
776607ca46eSDavid Howells 	DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
777607ca46eSDavid Howells };
778607ca46eSDavid Howells 
779607ca46eSDavid Howells #endif /* __LINUX_DCBNL_H__ */
780