19dc0cad2SEdward Cree /* SPDX-License-Identifier: GPL-2.0-only */
29dc0cad2SEdward Cree /****************************************************************************
39dc0cad2SEdward Cree  * Driver for Solarflare network controllers and boards
49dc0cad2SEdward Cree  * Copyright 2022 Xilinx Inc.
59dc0cad2SEdward Cree  *
69dc0cad2SEdward Cree  * This program is free software; you can redistribute it and/or modify it
79dc0cad2SEdward Cree  * under the terms of the GNU General Public License version 2 as published
89dc0cad2SEdward Cree  * by the Free Software Foundation, incorporated herein by reference.
99dc0cad2SEdward Cree  */
109dc0cad2SEdward Cree 
119dc0cad2SEdward Cree #ifndef EFX_TC_BINDINGS_H
129dc0cad2SEdward Cree #define EFX_TC_BINDINGS_H
139dc0cad2SEdward Cree #include "net_driver.h"
149dc0cad2SEdward Cree 
15*c08afcdcSEdward Cree #if IS_ENABLED(CONFIG_SFC_SRIOV)
169dc0cad2SEdward Cree #include <net/sch_generic.h>
179dc0cad2SEdward Cree 
189dc0cad2SEdward Cree struct efx_rep;
199dc0cad2SEdward Cree 
205b2e12d5SEdward Cree void efx_tc_block_unbind(void *cb_priv);
219dc0cad2SEdward Cree int efx_tc_setup_block(struct net_device *net_dev, struct efx_nic *efx,
229dc0cad2SEdward Cree 		       struct flow_block_offload *tcb, struct efx_rep *efv);
239dc0cad2SEdward Cree int efx_tc_setup(struct net_device *net_dev, enum tc_setup_type type,
249dc0cad2SEdward Cree 		 void *type_data);
255b2e12d5SEdward Cree 
265b2e12d5SEdward Cree int efx_tc_indr_setup_cb(struct net_device *net_dev, struct Qdisc *sch,
275b2e12d5SEdward Cree 			 void *cb_priv, enum tc_setup_type type,
285b2e12d5SEdward Cree 			 void *type_data, void *data,
295b2e12d5SEdward Cree 			 void (*cleanup)(struct flow_block_cb *block_cb));
307e5e7d80SEdward Cree int efx_tc_netdev_event(struct efx_nic *efx, unsigned long event,
317e5e7d80SEdward Cree 			struct net_device *net_dev);
32*c08afcdcSEdward Cree 
33*c08afcdcSEdward Cree #else /* CONFIG_SFC_SRIOV */
34*c08afcdcSEdward Cree 
efx_tc_netdev_event(struct efx_nic * efx,unsigned long event,struct net_device * net_dev)35*c08afcdcSEdward Cree static inline int efx_tc_netdev_event(struct efx_nic *efx, unsigned long event,
36*c08afcdcSEdward Cree 				      struct net_device *net_dev)
37*c08afcdcSEdward Cree {
38*c08afcdcSEdward Cree 	return NOTIFY_DONE;
39*c08afcdcSEdward Cree }
40*c08afcdcSEdward Cree 
41*c08afcdcSEdward Cree #endif /* CONFIG_SFC_SRIOV */
42*c08afcdcSEdward Cree 
439dc0cad2SEdward Cree #endif /* EFX_TC_BINDINGS_H */
44