1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright (C) 2018-2020, Intel Corporation. */
3 
4 #ifndef _ICE_FLTR_H_
5 #define _ICE_FLTR_H_
6 
7 #include "ice_vlan.h"
8 
9 void ice_fltr_free_list(struct device *dev, struct list_head *h);
10 int
11 ice_fltr_set_vlan_vsi_promisc(struct ice_hw *hw, struct ice_vsi *vsi,
12 			      u8 promisc_mask);
13 int
14 ice_fltr_clear_vlan_vsi_promisc(struct ice_hw *hw, struct ice_vsi *vsi,
15 				u8 promisc_mask);
16 int
17 ice_fltr_clear_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,
18 			   u16 vid);
19 int
20 ice_fltr_set_vsi_promisc(struct ice_hw *hw, u16 vsi_handle, u8 promisc_mask,
21 			 u16 vid);
22 int
23 ice_fltr_add_mac_to_list(struct ice_vsi *vsi, struct list_head *list,
24 			 const u8 *mac, enum ice_sw_fwd_act_type action);
25 int
26 ice_fltr_add_mac(struct ice_vsi *vsi, const u8 *mac,
27 		 enum ice_sw_fwd_act_type action);
28 int
29 ice_fltr_add_mac_and_broadcast(struct ice_vsi *vsi, const u8 *mac,
30 			       enum ice_sw_fwd_act_type action);
31 int ice_fltr_add_mac_list(struct ice_vsi *vsi, struct list_head *list);
32 int
33 ice_fltr_remove_mac(struct ice_vsi *vsi, const u8 *mac,
34 		    enum ice_sw_fwd_act_type action);
35 int ice_fltr_remove_mac_list(struct ice_vsi *vsi, struct list_head *list);
36 
37 int ice_fltr_add_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan);
38 int ice_fltr_remove_vlan(struct ice_vsi *vsi, struct ice_vlan *vlan);
39 
40 int
41 ice_fltr_add_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag,
42 		 enum ice_sw_fwd_act_type action);
43 int
44 ice_fltr_remove_eth(struct ice_vsi *vsi, u16 ethertype, u16 flag,
45 		    enum ice_sw_fwd_act_type action);
46 void ice_fltr_remove_all(struct ice_vsi *vsi);
47 
48 int
49 ice_fltr_update_flags(struct ice_vsi *vsi, u16 rule_id, u16 recipe_id,
50 		      u32 new_flags);
51 #endif
52