xref: /linux/include/net/dcbnl.h (revision 01b944fe1cd4e21a2a9ed51adbdbafe2d5e905ba)
12f90b865SAlexander Duyck /*
22f90b865SAlexander Duyck  * Copyright (c) 2008, Intel Corporation.
32f90b865SAlexander Duyck  *
42f90b865SAlexander Duyck  * This program is free software; you can redistribute it and/or modify it
52f90b865SAlexander Duyck  * under the terms and conditions of the GNU General Public License,
62f90b865SAlexander Duyck  * version 2, as published by the Free Software Foundation.
72f90b865SAlexander Duyck  *
82f90b865SAlexander Duyck  * This program is distributed in the hope it will be useful, but WITHOUT
92f90b865SAlexander Duyck  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
102f90b865SAlexander Duyck  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
112f90b865SAlexander Duyck  * more details.
122f90b865SAlexander Duyck  *
132f90b865SAlexander Duyck  * You should have received a copy of the GNU General Public License along with
14a6227e26SJeff Kirsher  * this program; if not, see <http://www.gnu.org/licenses/>.
152f90b865SAlexander Duyck  *
162f90b865SAlexander Duyck  * Author: Lucy Liu <lucy.liu@intel.com>
172f90b865SAlexander Duyck  */
182f90b865SAlexander Duyck 
192f90b865SAlexander Duyck #ifndef __NET_DCBNL_H__
202f90b865SAlexander Duyck #define __NET_DCBNL_H__
212f90b865SAlexander Duyck 
223e29027aSJohn Fastabend #include <linux/dcbnl.h>
233e29027aSJohn Fastabend 
249ab933abSJohn Fastabend struct dcb_app_type {
25e290ed81SMark Rustad 	int	ifindex;
269ab933abSJohn Fastabend 	struct dcb_app	  app;
279ab933abSJohn Fastabend 	struct list_head  list;
286bd0e1cbSJohn Fastabend 	u8	dcbx;
299ab933abSJohn Fastabend };
309ab933abSJohn Fastabend 
31ab6baf98SJohn Fastabend int dcb_setapp(struct net_device *, struct dcb_app *);
329ab933abSJohn Fastabend u8 dcb_getapp(struct net_device *, struct dcb_app *);
33b6db2174SJohn Fastabend int dcb_ieee_setapp(struct net_device *, struct dcb_app *);
34f9ae7e4bSJohn Fastabend int dcb_ieee_delapp(struct net_device *, struct dcb_app *);
35a364c8cfSJohn Fastabend u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *);
369ab933abSJohn Fastabend 
375b7f7626SShmulik Ravid int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
385b7f7626SShmulik Ravid 		      u32 seq, u32 pid);
395b7f7626SShmulik Ravid int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
405b7f7626SShmulik Ravid 		     u32 seq, u32 pid);
41314b4778SJohn Fastabend 
422f90b865SAlexander Duyck /*
432f90b865SAlexander Duyck  * Ops struct for the netlink callbacks.  Used by DCB-enabled drivers through
442f90b865SAlexander Duyck  * the netdevice struct.
452f90b865SAlexander Duyck  */
462f90b865SAlexander Duyck struct dcbnl_rtnl_ops {
473e29027aSJohn Fastabend 	/* IEEE 802.1Qaz std */
483e29027aSJohn Fastabend 	int (*ieee_getets) (struct net_device *, struct ieee_ets *);
493e29027aSJohn Fastabend 	int (*ieee_setets) (struct net_device *, struct ieee_ets *);
5008f10affSAmir Vadai 	int (*ieee_getmaxrate) (struct net_device *, struct ieee_maxrate *);
5108f10affSAmir Vadai 	int (*ieee_setmaxrate) (struct net_device *, struct ieee_maxrate *);
52*c9368247SShani Michaeli 	int (*ieee_getqcn) (struct net_device *, struct ieee_qcn *);
53*c9368247SShani Michaeli 	int (*ieee_setqcn) (struct net_device *, struct ieee_qcn *);
54*c9368247SShani Michaeli 	int (*ieee_getqcnstats) (struct net_device *, struct ieee_qcn_stats *);
553e29027aSJohn Fastabend 	int (*ieee_getpfc) (struct net_device *, struct ieee_pfc *);
563e29027aSJohn Fastabend 	int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
573e29027aSJohn Fastabend 	int (*ieee_getapp) (struct net_device *, struct dcb_app *);
583e29027aSJohn Fastabend 	int (*ieee_setapp) (struct net_device *, struct dcb_app *);
59f9ae7e4bSJohn Fastabend 	int (*ieee_delapp) (struct net_device *, struct dcb_app *);
60eed84713SShmulik Ravid 	int (*ieee_peer_getets) (struct net_device *, struct ieee_ets *);
61eed84713SShmulik Ravid 	int (*ieee_peer_getpfc) (struct net_device *, struct ieee_pfc *);
623e29027aSJohn Fastabend 
633e29027aSJohn Fastabend 	/* CEE std */
642f90b865SAlexander Duyck 	u8   (*getstate)(struct net_device *);
651486a61eSDon Skidmore 	u8   (*setstate)(struct net_device *, u8);
662f90b865SAlexander Duyck 	void (*getpermhwaddr)(struct net_device *, u8 *);
672f90b865SAlexander Duyck 	void (*setpgtccfgtx)(struct net_device *, int, u8, u8, u8, u8);
682f90b865SAlexander Duyck 	void (*setpgbwgcfgtx)(struct net_device *, int, u8);
692f90b865SAlexander Duyck 	void (*setpgtccfgrx)(struct net_device *, int, u8, u8, u8, u8);
702f90b865SAlexander Duyck 	void (*setpgbwgcfgrx)(struct net_device *, int, u8);
712f90b865SAlexander Duyck 	void (*getpgtccfgtx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *);
722f90b865SAlexander Duyck 	void (*getpgbwgcfgtx)(struct net_device *, int, u8 *);
732f90b865SAlexander Duyck 	void (*getpgtccfgrx)(struct net_device *, int, u8 *, u8 *, u8 *, u8 *);
742f90b865SAlexander Duyck 	void (*getpgbwgcfgrx)(struct net_device *, int, u8 *);
752f90b865SAlexander Duyck 	void (*setpfccfg)(struct net_device *, int, u8);
762f90b865SAlexander Duyck 	void (*getpfccfg)(struct net_device *, int, u8 *);
772f90b865SAlexander Duyck 	u8   (*setall)(struct net_device *);
7846132188SAlexander Duyck 	u8   (*getcap)(struct net_device *, int, u8 *);
792b88f2deSJohn Fastabend 	int  (*getnumtcs)(struct net_device *, int, u8 *);
802b88f2deSJohn Fastabend 	int  (*setnumtcs)(struct net_device *, int, u8);
810eb3aa9bSAlexander Duyck 	u8   (*getpfcstate)(struct net_device *);
820eb3aa9bSAlexander Duyck 	void (*setpfcstate)(struct net_device *, u8);
83859ee3c4SAlexander Duyck 	void (*getbcncfg)(struct net_device *, int, u32 *);
84859ee3c4SAlexander Duyck 	void (*setbcncfg)(struct net_device *, int, u32);
85859ee3c4SAlexander Duyck 	void (*getbcnrp)(struct net_device *, int, u8 *);
86859ee3c4SAlexander Duyck 	void (*setbcnrp)(struct net_device *, int, u8);
87c2659479SAnish Bhatt 	int  (*setapp)(struct net_device *, u8, u16, u8);
88c2659479SAnish Bhatt 	int  (*getapp)(struct net_device *, u8, u16);
89ea45fe4eSShmulik Ravid 	u8   (*getfeatcfg)(struct net_device *, int, u8 *);
90ea45fe4eSShmulik Ravid 	u8   (*setfeatcfg)(struct net_device *, int, u8);
916241b625SShmulik Ravid 
926241b625SShmulik Ravid 	/* DCBX configuration */
936241b625SShmulik Ravid 	u8   (*getdcbx)(struct net_device *);
946241b625SShmulik Ravid 	u8   (*setdcbx)(struct net_device *, u8);
956241b625SShmulik Ravid 
96eed84713SShmulik Ravid 	/* peer apps */
97eed84713SShmulik Ravid 	int (*peer_getappinfo)(struct net_device *, struct dcb_peer_app_info *,
98eed84713SShmulik Ravid 			       u16 *);
99eed84713SShmulik Ravid 	int (*peer_getapptable)(struct net_device *, struct dcb_app *);
100ea45fe4eSShmulik Ravid 
101dc6ed1dfSShmulik Ravid 	/* CEE peer */
102dc6ed1dfSShmulik Ravid 	int (*cee_peer_getpg) (struct net_device *, struct cee_pg *);
103dc6ed1dfSShmulik Ravid 	int (*cee_peer_getpfc) (struct net_device *, struct cee_pfc *);
1042f90b865SAlexander Duyck };
1052f90b865SAlexander Duyck 
1062f90b865SAlexander Duyck #endif /* __NET_DCBNL_H__ */
107