net: dcbnl: Update copyright dates
[linux-2.6.git] / include / linux / dcbnl.h
1 /*
2  * Copyright (c) 2008-2011, Intel Corporation.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms and conditions of the GNU General Public License,
6  * version 2, as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU General Public License along with
14  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15  * Place - Suite 330, Boston, MA 02111-1307 USA.
16  *
17  * Author: Lucy Liu <lucy.liu@intel.com>
18  */
19
20 #ifndef __LINUX_DCBNL_H__
21 #define __LINUX_DCBNL_H__
22
23 #include <linux/types.h>
24
25 /* IEEE 802.1Qaz std supported values */
26 #define IEEE_8021QAZ_MAX_TCS    8
27
28 #define IEEE_8021QAZ_TSA_STRICT         0
29 #define IEEE_8021QAZ_TSA_CB_SHABER      1
30 #define IEEE_8021QAZ_TSA_ETS            2
31 #define IEEE_8021QAZ_TSA_VENDOR         255
32
33 /* This structure contains the IEEE 802.1Qaz ETS managed object
34  *
35  * @willing: willing bit in ETS configuratin TLV
36  * @ets_cap: indicates supported capacity of ets feature
37  * @cbs: credit based shaper ets algorithm supported
38  * @tc_tx_bw: tc tx bandwidth indexed by traffic class
39  * @tc_rx_bw: tc rx bandwidth indexed by traffic class
40  * @tc_tsa: TSA Assignment table, indexed by traffic class
41  * @prio_tc: priority assignment table mapping 8021Qp to traffic class
42  * @tc_reco_bw: recommended tc bandwidth indexed by traffic class for TLV
43  * @tc_reco_tsa: recommended tc bandwidth indexed by traffic class for TLV
44  * @reco_prio_tc: recommended tc tx bandwidth indexed by traffic class for TLV
45  *
46  * Recommended values are used to set fields in the ETS recommendation TLV
47  * with hardware offloaded LLDP.
48  *
49  * ----
50  *  TSA Assignment 8 bit identifiers
51  *      0       strict priority
52  *      1       credit-based shaper
53  *      2       enhanced transmission selection
54  *      3-254   reserved
55  *      255     vendor specific
56  */
57 struct ieee_ets {
58         __u8    willing;
59         __u8    ets_cap;
60         __u8    cbs;
61         __u8    tc_tx_bw[IEEE_8021QAZ_MAX_TCS];
62         __u8    tc_rx_bw[IEEE_8021QAZ_MAX_TCS];
63         __u8    tc_tsa[IEEE_8021QAZ_MAX_TCS];
64         __u8    prio_tc[IEEE_8021QAZ_MAX_TCS];
65         __u8    tc_reco_bw[IEEE_8021QAZ_MAX_TCS];
66         __u8    tc_reco_tsa[IEEE_8021QAZ_MAX_TCS];
67         __u8    reco_prio_tc[IEEE_8021QAZ_MAX_TCS];
68 };
69
70 /* This structure contains the IEEE 802.1Qaz PFC managed object
71  *
72  * @pfc_cap: Indicates the number of traffic classes on the local device
73  *           that may simultaneously have PFC enabled.
74  * @pfc_en: bitmap indicating pfc enabled traffic classes
75  * @mbc: enable macsec bypass capability
76  * @delay: the allowance made for a round-trip propagation delay of the
77  *         link in bits.
78  * @requests: count of the sent pfc frames
79  * @indications: count of the received pfc frames
80  */
81 struct ieee_pfc {
82         __u8    pfc_cap;
83         __u8    pfc_en;
84         __u8    mbc;
85         __u16   delay;
86         __u64   requests[IEEE_8021QAZ_MAX_TCS];
87         __u64   indications[IEEE_8021QAZ_MAX_TCS];
88 };
89
90 /* CEE DCBX std supported values */
91 #define CEE_DCBX_MAX_PGS        8
92 #define CEE_DCBX_MAX_PRIO       8
93
94 /**
95  * struct cee_pg - CEE Prioity-Group managed object
96  *
97  * @willing: willing bit in the PG tlv
98  * @error: error bit in the PG tlv
99  * @pg_en: enable bit of the PG feature
100  * @tcs_supported: number of traffic classes supported
101  * @pg_bw: bandwidth percentage for each priority group
102  * @prio_pg: priority to PG mapping indexed by priority
103  */
104 struct cee_pg {
105         __u8    willing;
106         __u8    error;
107         __u8    pg_en;
108         __u8    tcs_supported;
109         __u8    pg_bw[CEE_DCBX_MAX_PGS];
110         __u8    prio_pg[CEE_DCBX_MAX_PGS];
111 };
112
113 /**
114  * struct cee_pfc - CEE PFC managed object
115  *
116  * @willing: willing bit in the PFC tlv
117  * @error: error bit in the PFC tlv
118  * @pfc_en: bitmap indicating pfc enabled traffic classes
119  * @tcs_supported: number of traffic classes supported
120  */
121 struct cee_pfc {
122         __u8    willing;
123         __u8    error;
124         __u8    pfc_en;
125         __u8    tcs_supported;
126 };
127
128
129 /* This structure contains the IEEE 802.1Qaz APP managed object. This
130  * object is also used for the CEE std as well. There is no difference
131  * between the objects.
132  *
133  * @selector: protocol identifier type
134  * @protocol: protocol of type indicated
135  * @priority: 3-bit unsigned integer indicating priority
136  *
137  * ----
138  *  Selector field values
139  *      0       Reserved
140  *      1       Ethertype
141  *      2       Well known port number over TCP or SCTP
142  *      3       Well known port number over UDP or DCCP
143  *      4       Well known port number over TCP, SCTP, UDP, or DCCP
144  *      5-7     Reserved
145  */
146 struct dcb_app {
147         __u8    selector;
148         __u8    priority;
149         __u16   protocol;
150 };
151
152 /**
153  * struct dcb_peer_app_info - APP feature information sent by the peer
154  *
155  * @willing: willing bit in the peer APP tlv
156  * @error: error bit in the peer APP tlv
157  *
158  * In addition to this information the full peer APP tlv also contains
159  * a table of 'app_count' APP objects defined above.
160  */
161 struct dcb_peer_app_info {
162         __u8    willing;
163         __u8    error;
164 };
165
166 struct dcbmsg {
167         __u8               dcb_family;
168         __u8               cmd;
169         __u16              dcb_pad;
170 };
171
172 /**
173  * enum dcbnl_commands - supported DCB commands
174  *
175  * @DCB_CMD_UNDEFINED: unspecified command to catch errors
176  * @DCB_CMD_GSTATE: request the state of DCB in the device
177  * @DCB_CMD_SSTATE: set the state of DCB in the device
178  * @DCB_CMD_PGTX_GCFG: request the priority group configuration for Tx
179  * @DCB_CMD_PGTX_SCFG: set the priority group configuration for Tx
180  * @DCB_CMD_PGRX_GCFG: request the priority group configuration for Rx
181  * @DCB_CMD_PGRX_SCFG: set the priority group configuration for Rx
182  * @DCB_CMD_PFC_GCFG: request the priority flow control configuration
183  * @DCB_CMD_PFC_SCFG: set the priority flow control configuration
184  * @DCB_CMD_SET_ALL: apply all changes to the underlying device
185  * @DCB_CMD_GPERM_HWADDR: get the permanent MAC address of the underlying
186  *                        device.  Only useful when using bonding.
187  * @DCB_CMD_GCAP: request the DCB capabilities of the device
188  * @DCB_CMD_GNUMTCS: get the number of traffic classes currently supported
189  * @DCB_CMD_SNUMTCS: set the number of traffic classes
190  * @DCB_CMD_GBCN: set backward congestion notification configuration
191  * @DCB_CMD_SBCN: get backward congestion notification configration.
192  * @DCB_CMD_GAPP: get application protocol configuration
193  * @DCB_CMD_SAPP: set application protocol configuration
194  * @DCB_CMD_IEEE_SET: set IEEE 802.1Qaz configuration
195  * @DCB_CMD_IEEE_GET: get IEEE 802.1Qaz configuration
196  * @DCB_CMD_GDCBX: get DCBX engine configuration
197  * @DCB_CMD_SDCBX: set DCBX engine configuration
198  * @DCB_CMD_GFEATCFG: get DCBX features flags
199  * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
200  * @DCB_CMD_CEE_GET: get CEE aggregated configuration
201  */
202 enum dcbnl_commands {
203         DCB_CMD_UNDEFINED,
204
205         DCB_CMD_GSTATE,
206         DCB_CMD_SSTATE,
207
208         DCB_CMD_PGTX_GCFG,
209         DCB_CMD_PGTX_SCFG,
210         DCB_CMD_PGRX_GCFG,
211         DCB_CMD_PGRX_SCFG,
212
213         DCB_CMD_PFC_GCFG,
214         DCB_CMD_PFC_SCFG,
215
216         DCB_CMD_SET_ALL,
217
218         DCB_CMD_GPERM_HWADDR,
219
220         DCB_CMD_GCAP,
221
222         DCB_CMD_GNUMTCS,
223         DCB_CMD_SNUMTCS,
224
225         DCB_CMD_PFC_GSTATE,
226         DCB_CMD_PFC_SSTATE,
227
228         DCB_CMD_BCN_GCFG,
229         DCB_CMD_BCN_SCFG,
230
231         DCB_CMD_GAPP,
232         DCB_CMD_SAPP,
233
234         DCB_CMD_IEEE_SET,
235         DCB_CMD_IEEE_GET,
236
237         DCB_CMD_GDCBX,
238         DCB_CMD_SDCBX,
239
240         DCB_CMD_GFEATCFG,
241         DCB_CMD_SFEATCFG,
242
243         DCB_CMD_CEE_GET,
244
245         __DCB_CMD_ENUM_MAX,
246         DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
247 };
248
249 /**
250  * enum dcbnl_attrs - DCB top-level netlink attributes
251  *
252  * @DCB_ATTR_UNDEFINED: unspecified attribute to catch errors
253  * @DCB_ATTR_IFNAME: interface name of the underlying device (NLA_STRING)
254  * @DCB_ATTR_STATE: enable state of DCB in the device (NLA_U8)
255  * @DCB_ATTR_PFC_STATE: enable state of PFC in the device (NLA_U8)
256  * @DCB_ATTR_PFC_CFG: priority flow control configuration (NLA_NESTED)
257  * @DCB_ATTR_NUM_TC: number of traffic classes supported in the device (NLA_U8)
258  * @DCB_ATTR_PG_CFG: priority group configuration (NLA_NESTED)
259  * @DCB_ATTR_SET_ALL: bool to commit changes to hardware or not (NLA_U8)
260  * @DCB_ATTR_PERM_HWADDR: MAC address of the physical device (NLA_NESTED)
261  * @DCB_ATTR_CAP: DCB capabilities of the device (NLA_NESTED)
262  * @DCB_ATTR_NUMTCS: number of traffic classes supported (NLA_NESTED)
263  * @DCB_ATTR_BCN: backward congestion notification configuration (NLA_NESTED)
264  * @DCB_ATTR_IEEE: IEEE 802.1Qaz supported attributes (NLA_NESTED)
265  * @DCB_ATTR_DCBX: DCBX engine configuration in the device (NLA_U8)
266  * @DCB_ATTR_FEATCFG: DCBX features flags (NLA_NESTED)
267  * @DCB_ATTR_CEE: CEE std supported attributes (NLA_NESTED)
268  */
269 enum dcbnl_attrs {
270         DCB_ATTR_UNDEFINED,
271
272         DCB_ATTR_IFNAME,
273         DCB_ATTR_STATE,
274         DCB_ATTR_PFC_STATE,
275         DCB_ATTR_PFC_CFG,
276         DCB_ATTR_NUM_TC,
277         DCB_ATTR_PG_CFG,
278         DCB_ATTR_SET_ALL,
279         DCB_ATTR_PERM_HWADDR,
280         DCB_ATTR_CAP,
281         DCB_ATTR_NUMTCS,
282         DCB_ATTR_BCN,
283         DCB_ATTR_APP,
284
285         /* IEEE std attributes */
286         DCB_ATTR_IEEE,
287
288         DCB_ATTR_DCBX,
289         DCB_ATTR_FEATCFG,
290
291         /* CEE nested attributes */
292         DCB_ATTR_CEE,
293
294         __DCB_ATTR_ENUM_MAX,
295         DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1,
296 };
297
298 /**
299  * enum ieee_attrs - IEEE 802.1Qaz get/set attributes
300  *
301  * @DCB_ATTR_IEEE_UNSPEC: unspecified
302  * @DCB_ATTR_IEEE_ETS: negotiated ETS configuration
303  * @DCB_ATTR_IEEE_PFC: negotiated PFC configuration
304  * @DCB_ATTR_IEEE_APP_TABLE: negotiated APP configuration
305  * @DCB_ATTR_IEEE_PEER_ETS: peer ETS configuration - get only
306  * @DCB_ATTR_IEEE_PEER_PFC: peer PFC configuration - get only
307  * @DCB_ATTR_IEEE_PEER_APP: peer APP tlv - get only
308  */
309 enum ieee_attrs {
310         DCB_ATTR_IEEE_UNSPEC,
311         DCB_ATTR_IEEE_ETS,
312         DCB_ATTR_IEEE_PFC,
313         DCB_ATTR_IEEE_APP_TABLE,
314         DCB_ATTR_IEEE_PEER_ETS,
315         DCB_ATTR_IEEE_PEER_PFC,
316         DCB_ATTR_IEEE_PEER_APP,
317         __DCB_ATTR_IEEE_MAX
318 };
319 #define DCB_ATTR_IEEE_MAX (__DCB_ATTR_IEEE_MAX - 1)
320
321 enum ieee_attrs_app {
322         DCB_ATTR_IEEE_APP_UNSPEC,
323         DCB_ATTR_IEEE_APP,
324         __DCB_ATTR_IEEE_APP_MAX
325 };
326 #define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
327
328 /**
329  * enum cee_attrs - CEE DCBX get attributes
330  *
331  * @DCB_ATTR_CEE_UNSPEC: unspecified
332  * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
333  * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
334  * @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only
335  */
336 enum cee_attrs {
337         DCB_ATTR_CEE_UNSPEC,
338         DCB_ATTR_CEE_PEER_PG,
339         DCB_ATTR_CEE_PEER_PFC,
340         DCB_ATTR_CEE_PEER_APP_TABLE,
341         __DCB_ATTR_CEE_MAX
342 };
343 #define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
344
345 enum peer_app_attr {
346         DCB_ATTR_CEE_PEER_APP_UNSPEC,
347         DCB_ATTR_CEE_PEER_APP_INFO,
348         DCB_ATTR_CEE_PEER_APP,
349         __DCB_ATTR_CEE_PEER_APP_MAX
350 };
351 #define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
352
353 /**
354  * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
355  *
356  * @DCB_PFC_UP_ATTR_UNDEFINED: unspecified attribute to catch errors
357  * @DCB_PFC_UP_ATTR_0: Priority Flow Control value for User Priority 0 (NLA_U8)
358  * @DCB_PFC_UP_ATTR_1: Priority Flow Control value for User Priority 1 (NLA_U8)
359  * @DCB_PFC_UP_ATTR_2: Priority Flow Control value for User Priority 2 (NLA_U8)
360  * @DCB_PFC_UP_ATTR_3: Priority Flow Control value for User Priority 3 (NLA_U8)
361  * @DCB_PFC_UP_ATTR_4: Priority Flow Control value for User Priority 4 (NLA_U8)
362  * @DCB_PFC_UP_ATTR_5: Priority Flow Control value for User Priority 5 (NLA_U8)
363  * @DCB_PFC_UP_ATTR_6: Priority Flow Control value for User Priority 6 (NLA_U8)
364  * @DCB_PFC_UP_ATTR_7: Priority Flow Control value for User Priority 7 (NLA_U8)
365  * @DCB_PFC_UP_ATTR_MAX: highest attribute number currently defined
366  * @DCB_PFC_UP_ATTR_ALL: apply to all priority flow control attrs (NLA_FLAG)
367  *
368  */
369 enum dcbnl_pfc_up_attrs {
370         DCB_PFC_UP_ATTR_UNDEFINED,
371
372         DCB_PFC_UP_ATTR_0,
373         DCB_PFC_UP_ATTR_1,
374         DCB_PFC_UP_ATTR_2,
375         DCB_PFC_UP_ATTR_3,
376         DCB_PFC_UP_ATTR_4,
377         DCB_PFC_UP_ATTR_5,
378         DCB_PFC_UP_ATTR_6,
379         DCB_PFC_UP_ATTR_7,
380         DCB_PFC_UP_ATTR_ALL,
381
382         __DCB_PFC_UP_ATTR_ENUM_MAX,
383         DCB_PFC_UP_ATTR_MAX = __DCB_PFC_UP_ATTR_ENUM_MAX - 1,
384 };
385
386 /**
387  * enum dcbnl_pg_attrs - DCB Priority Group attributes
388  *
389  * @DCB_PG_ATTR_UNDEFINED: unspecified attribute to catch errors
390  * @DCB_PG_ATTR_TC_0: Priority Group Traffic Class 0 configuration (NLA_NESTED)
391  * @DCB_PG_ATTR_TC_1: Priority Group Traffic Class 1 configuration (NLA_NESTED)
392  * @DCB_PG_ATTR_TC_2: Priority Group Traffic Class 2 configuration (NLA_NESTED)
393  * @DCB_PG_ATTR_TC_3: Priority Group Traffic Class 3 configuration (NLA_NESTED)
394  * @DCB_PG_ATTR_TC_4: Priority Group Traffic Class 4 configuration (NLA_NESTED)
395  * @DCB_PG_ATTR_TC_5: Priority Group Traffic Class 5 configuration (NLA_NESTED)
396  * @DCB_PG_ATTR_TC_6: Priority Group Traffic Class 6 configuration (NLA_NESTED)
397  * @DCB_PG_ATTR_TC_7: Priority Group Traffic Class 7 configuration (NLA_NESTED)
398  * @DCB_PG_ATTR_TC_MAX: highest attribute number currently defined
399  * @DCB_PG_ATTR_TC_ALL: apply to all traffic classes (NLA_NESTED)
400  * @DCB_PG_ATTR_BW_ID_0: Percent of link bandwidth for Priority Group 0 (NLA_U8)
401  * @DCB_PG_ATTR_BW_ID_1: Percent of link bandwidth for Priority Group 1 (NLA_U8)
402  * @DCB_PG_ATTR_BW_ID_2: Percent of link bandwidth for Priority Group 2 (NLA_U8)
403  * @DCB_PG_ATTR_BW_ID_3: Percent of link bandwidth for Priority Group 3 (NLA_U8)
404  * @DCB_PG_ATTR_BW_ID_4: Percent of link bandwidth for Priority Group 4 (NLA_U8)
405  * @DCB_PG_ATTR_BW_ID_5: Percent of link bandwidth for Priority Group 5 (NLA_U8)
406  * @DCB_PG_ATTR_BW_ID_6: Percent of link bandwidth for Priority Group 6 (NLA_U8)
407  * @DCB_PG_ATTR_BW_ID_7: Percent of link bandwidth for Priority Group 7 (NLA_U8)
408  * @DCB_PG_ATTR_BW_ID_MAX: highest attribute number currently defined
409  * @DCB_PG_ATTR_BW_ID_ALL: apply to all priority groups (NLA_FLAG)
410  *
411  */
412 enum dcbnl_pg_attrs {
413         DCB_PG_ATTR_UNDEFINED,
414
415         DCB_PG_ATTR_TC_0,
416         DCB_PG_ATTR_TC_1,
417         DCB_PG_ATTR_TC_2,
418         DCB_PG_ATTR_TC_3,
419         DCB_PG_ATTR_TC_4,
420         DCB_PG_ATTR_TC_5,
421         DCB_PG_ATTR_TC_6,
422         DCB_PG_ATTR_TC_7,
423         DCB_PG_ATTR_TC_MAX,
424         DCB_PG_ATTR_TC_ALL,
425
426         DCB_PG_ATTR_BW_ID_0,
427         DCB_PG_ATTR_BW_ID_1,
428         DCB_PG_ATTR_BW_ID_2,
429         DCB_PG_ATTR_BW_ID_3,
430         DCB_PG_ATTR_BW_ID_4,
431         DCB_PG_ATTR_BW_ID_5,
432         DCB_PG_ATTR_BW_ID_6,
433         DCB_PG_ATTR_BW_ID_7,
434         DCB_PG_ATTR_BW_ID_MAX,
435         DCB_PG_ATTR_BW_ID_ALL,
436
437         __DCB_PG_ATTR_ENUM_MAX,
438         DCB_PG_ATTR_MAX = __DCB_PG_ATTR_ENUM_MAX - 1,
439 };
440
441 /**
442  * enum dcbnl_tc_attrs - DCB Traffic Class attributes
443  *
444  * @DCB_TC_ATTR_PARAM_UNDEFINED: unspecified attribute to catch errors
445  * @DCB_TC_ATTR_PARAM_PGID: (NLA_U8) Priority group the traffic class belongs to
446  *                          Valid values are:  0-7
447  * @DCB_TC_ATTR_PARAM_UP_MAPPING: (NLA_U8) Traffic class to user priority map
448  *                                Some devices may not support changing the
449  *                                user priority map of a TC.
450  * @DCB_TC_ATTR_PARAM_STRICT_PRIO: (NLA_U8) Strict priority setting
451  *                                 0 - none
452  *                                 1 - group strict
453  *                                 2 - link strict
454  * @DCB_TC_ATTR_PARAM_BW_PCT: optional - (NLA_U8) If supported by the device and
455  *                            not configured to use link strict priority,
456  *                            this is the percentage of bandwidth of the
457  *                            priority group this traffic class belongs to
458  * @DCB_TC_ATTR_PARAM_ALL: (NLA_FLAG) all traffic class parameters
459  *
460  */
461 enum dcbnl_tc_attrs {
462         DCB_TC_ATTR_PARAM_UNDEFINED,
463
464         DCB_TC_ATTR_PARAM_PGID,
465         DCB_TC_ATTR_PARAM_UP_MAPPING,
466         DCB_TC_ATTR_PARAM_STRICT_PRIO,
467         DCB_TC_ATTR_PARAM_BW_PCT,
468         DCB_TC_ATTR_PARAM_ALL,
469
470         __DCB_TC_ATTR_PARAM_ENUM_MAX,
471         DCB_TC_ATTR_PARAM_MAX = __DCB_TC_ATTR_PARAM_ENUM_MAX - 1,
472 };
473
474 /**
475  * enum dcbnl_cap_attrs - DCB Capability attributes
476  *
477  * @DCB_CAP_ATTR_UNDEFINED: unspecified attribute to catch errors
478  * @DCB_CAP_ATTR_ALL: (NLA_FLAG) all capability parameters
479  * @DCB_CAP_ATTR_PG: (NLA_U8) device supports Priority Groups
480  * @DCB_CAP_ATTR_PFC: (NLA_U8) device supports Priority Flow Control
481  * @DCB_CAP_ATTR_UP2TC: (NLA_U8) device supports user priority to
482  *                               traffic class mapping
483  * @DCB_CAP_ATTR_PG_TCS: (NLA_U8) bitmap where each bit represents a
484  *                                number of traffic classes the device
485  *                                can be configured to use for Priority Groups
486  * @DCB_CAP_ATTR_PFC_TCS: (NLA_U8) bitmap where each bit represents a
487  *                                 number of traffic classes the device can be
488  *                                 configured to use for Priority Flow Control
489  * @DCB_CAP_ATTR_GSP: (NLA_U8) device supports group strict priority
490  * @DCB_CAP_ATTR_BCN: (NLA_U8) device supports Backwards Congestion
491  *                             Notification
492  * @DCB_CAP_ATTR_DCBX: (NLA_U8) device supports DCBX engine
493  *
494  */
495 enum dcbnl_cap_attrs {
496         DCB_CAP_ATTR_UNDEFINED,
497         DCB_CAP_ATTR_ALL,
498         DCB_CAP_ATTR_PG,
499         DCB_CAP_ATTR_PFC,
500         DCB_CAP_ATTR_UP2TC,
501         DCB_CAP_ATTR_PG_TCS,
502         DCB_CAP_ATTR_PFC_TCS,
503         DCB_CAP_ATTR_GSP,
504         DCB_CAP_ATTR_BCN,
505         DCB_CAP_ATTR_DCBX,
506
507         __DCB_CAP_ATTR_ENUM_MAX,
508         DCB_CAP_ATTR_MAX = __DCB_CAP_ATTR_ENUM_MAX - 1,
509 };
510
511 /**
512  * DCBX capability flags
513  *
514  * @DCB_CAP_DCBX_HOST: DCBX negotiation is performed by the host LLDP agent.
515  *                     'set' routines are used to configure the device with
516  *                     the negotiated parameters
517  *
518  * @DCB_CAP_DCBX_LLD_MANAGED: DCBX negotiation is not performed in the host but
519  *                            by another entity
520  *                            'get' routines are used to retrieve the
521  *                            negotiated parameters
522  *                            'set' routines can be used to set the initial
523  *                            negotiation configuration
524  *
525  * @DCB_CAP_DCBX_VER_CEE: for a non-host DCBX engine, indicates the engine
526  *                        supports the CEE protocol flavor
527  *
528  * @DCB_CAP_DCBX_VER_IEEE: for a non-host DCBX engine, indicates the engine
529  *                         supports the IEEE protocol flavor
530  *
531  * @DCB_CAP_DCBX_STATIC: for a non-host DCBX engine, indicates the engine
532  *                       supports static configuration (i.e no actual
533  *                       negotiation is performed negotiated parameters equal
534  *                       the initial configuration)
535  *
536  */
537 #define DCB_CAP_DCBX_HOST               0x01
538 #define DCB_CAP_DCBX_LLD_MANAGED        0x02
539 #define DCB_CAP_DCBX_VER_CEE            0x04
540 #define DCB_CAP_DCBX_VER_IEEE           0x08
541 #define DCB_CAP_DCBX_STATIC             0x10
542
543 /**
544  * enum dcbnl_numtcs_attrs - number of traffic classes
545  *
546  * @DCB_NUMTCS_ATTR_UNDEFINED: unspecified attribute to catch errors
547  * @DCB_NUMTCS_ATTR_ALL: (NLA_FLAG) all traffic class attributes
548  * @DCB_NUMTCS_ATTR_PG: (NLA_U8) number of traffic classes used for
549  *                               priority groups
550  * @DCB_NUMTCS_ATTR_PFC: (NLA_U8) number of traffic classes which can
551  *                                support priority flow control
552  */
553 enum dcbnl_numtcs_attrs {
554         DCB_NUMTCS_ATTR_UNDEFINED,
555         DCB_NUMTCS_ATTR_ALL,
556         DCB_NUMTCS_ATTR_PG,
557         DCB_NUMTCS_ATTR_PFC,
558
559         __DCB_NUMTCS_ATTR_ENUM_MAX,
560         DCB_NUMTCS_ATTR_MAX = __DCB_NUMTCS_ATTR_ENUM_MAX - 1,
561 };
562
563 enum dcbnl_bcn_attrs{
564         DCB_BCN_ATTR_UNDEFINED = 0,
565
566         DCB_BCN_ATTR_RP_0,
567         DCB_BCN_ATTR_RP_1,
568         DCB_BCN_ATTR_RP_2,
569         DCB_BCN_ATTR_RP_3,
570         DCB_BCN_ATTR_RP_4,
571         DCB_BCN_ATTR_RP_5,
572         DCB_BCN_ATTR_RP_6,
573         DCB_BCN_ATTR_RP_7,
574         DCB_BCN_ATTR_RP_ALL,
575
576         DCB_BCN_ATTR_BCNA_0,
577         DCB_BCN_ATTR_BCNA_1,
578         DCB_BCN_ATTR_ALPHA,
579         DCB_BCN_ATTR_BETA,
580         DCB_BCN_ATTR_GD,
581         DCB_BCN_ATTR_GI,
582         DCB_BCN_ATTR_TMAX,
583         DCB_BCN_ATTR_TD,
584         DCB_BCN_ATTR_RMIN,
585         DCB_BCN_ATTR_W,
586         DCB_BCN_ATTR_RD,
587         DCB_BCN_ATTR_RU,
588         DCB_BCN_ATTR_WRTT,
589         DCB_BCN_ATTR_RI,
590         DCB_BCN_ATTR_C,
591         DCB_BCN_ATTR_ALL,
592
593         __DCB_BCN_ATTR_ENUM_MAX,
594         DCB_BCN_ATTR_MAX = __DCB_BCN_ATTR_ENUM_MAX - 1,
595 };
596
597 /**
598  * enum dcb_general_attr_values - general DCB attribute values
599  *
600  * @DCB_ATTR_UNDEFINED: value used to indicate an attribute is not supported
601  *
602  */
603 enum dcb_general_attr_values {
604         DCB_ATTR_VALUE_UNDEFINED = 0xff
605 };
606
607 #define DCB_APP_IDTYPE_ETHTYPE  0x00
608 #define DCB_APP_IDTYPE_PORTNUM  0x01
609 enum dcbnl_app_attrs {
610         DCB_APP_ATTR_UNDEFINED,
611
612         DCB_APP_ATTR_IDTYPE,
613         DCB_APP_ATTR_ID,
614         DCB_APP_ATTR_PRIORITY,
615
616         __DCB_APP_ATTR_ENUM_MAX,
617         DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1,
618 };
619
620 /**
621  * enum dcbnl_featcfg_attrs - features conifiguration flags
622  *
623  * @DCB_FEATCFG_ATTR_UNDEFINED: unspecified attribute to catch errors
624  * @DCB_FEATCFG_ATTR_ALL: (NLA_FLAG) all features configuration attributes
625  * @DCB_FEATCFG_ATTR_PG: (NLA_U8) configuration flags for priority groups
626  * @DCB_FEATCFG_ATTR_PFC: (NLA_U8) configuration flags for priority
627  *                                 flow control
628  * @DCB_FEATCFG_ATTR_APP: (NLA_U8) configuration flags for application TLV
629  *
630  */
631 #define DCB_FEATCFG_ERROR       0x01    /* error in feature resolution */
632 #define DCB_FEATCFG_ENABLE      0x02    /* enable feature */
633 #define DCB_FEATCFG_WILLING     0x04    /* feature is willing */
634 #define DCB_FEATCFG_ADVERTISE   0x08    /* advertise feature */
635 enum dcbnl_featcfg_attrs {
636         DCB_FEATCFG_ATTR_UNDEFINED,
637         DCB_FEATCFG_ATTR_ALL,
638         DCB_FEATCFG_ATTR_PG,
639         DCB_FEATCFG_ATTR_PFC,
640         DCB_FEATCFG_ATTR_APP,
641
642         __DCB_FEATCFG_ATTR_ENUM_MAX,
643         DCB_FEATCFG_ATTR_MAX = __DCB_FEATCFG_ATTR_ENUM_MAX - 1,
644 };
645
646 #endif /* __LINUX_DCBNL_H__ */