GNU Linux-libre 6.8.9-gnu
[releases.git] / drivers / net / ethernet / sfc / tc_bindings.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /****************************************************************************
3  * Driver for Solarflare network controllers and boards
4  * Copyright 2022 Xilinx Inc.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published
8  * by the Free Software Foundation, incorporated herein by reference.
9  */
10
11 #ifndef EFX_TC_BINDINGS_H
12 #define EFX_TC_BINDINGS_H
13 #include "net_driver.h"
14
15 #if IS_ENABLED(CONFIG_SFC_SRIOV)
16 #include <net/sch_generic.h>
17
18 struct efx_rep;
19
20 void efx_tc_block_unbind(void *cb_priv);
21 int efx_tc_setup_block(struct net_device *net_dev, struct efx_nic *efx,
22                        struct flow_block_offload *tcb, struct efx_rep *efv);
23 int efx_tc_setup(struct net_device *net_dev, enum tc_setup_type type,
24                  void *type_data);
25
26 int efx_tc_indr_setup_cb(struct net_device *net_dev, struct Qdisc *sch,
27                          void *cb_priv, enum tc_setup_type type,
28                          void *type_data, void *data,
29                          void (*cleanup)(struct flow_block_cb *block_cb));
30 int efx_tc_netdev_event(struct efx_nic *efx, unsigned long event,
31                         struct net_device *net_dev);
32
33 #else /* CONFIG_SFC_SRIOV */
34
35 static inline int efx_tc_netdev_event(struct efx_nic *efx, unsigned long event,
36                                       struct net_device *net_dev)
37 {
38         return NOTIFY_DONE;
39 }
40
41 #endif /* CONFIG_SFC_SRIOV */
42
43 #endif /* EFX_TC_BINDINGS_H */