1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2023, Intel Corporation. */
3 
4 #ifndef _ICE_ESWITCH_BR_H_
5 #define _ICE_ESWITCH_BR_H_
6 
7 enum ice_esw_br_port_type {
8 	ICE_ESWITCH_BR_UPLINK_PORT = 0,
9 	ICE_ESWITCH_BR_VF_REPR_PORT = 1,
10 };
11 
12 struct ice_esw_br_port {
13 	struct ice_esw_br *bridge;
14 	struct ice_vsi *vsi;
15 	enum ice_esw_br_port_type type;
16 	u16 vsi_idx;
17 };
18 
19 struct ice_esw_br {
20 	struct ice_esw_br_offloads *br_offloads;
21 	struct xarray ports;
22 
23 	int ifindex;
24 };
25 
26 struct ice_esw_br_offloads {
27 	struct ice_pf *pf;
28 	struct ice_esw_br *bridge;
29 	struct notifier_block netdev_nb;
30 };
31 
32 #define ice_nb_to_br_offloads(nb, nb_name) \
33 	container_of(nb, \
34 		     struct ice_esw_br_offloads, \
35 		     nb_name)
36 
37 void
38 ice_eswitch_br_offloads_deinit(struct ice_pf *pf);
39 int
40 ice_eswitch_br_offloads_init(struct ice_pf *pf);
41 
42 #endif /* _ICE_ESWITCH_BR_H_ */
43