1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /* Copyright (C) 2014-2017 aQuantia Corporation. */
3 
4 /* File aq_filters.h: RX filters related functions. */
5 
6 #ifndef AQ_FILTERS_H
7 #define AQ_FILTERS_H
8 
9 #include "aq_nic.h"
10 
11 enum aq_rx_filter_type {
12 	aq_rx_filter_ethertype,
13 	aq_rx_filter_vlan,
14 	aq_rx_filter_l3l4
15 };
16 
17 struct aq_rx_filter {
18 	struct hlist_node aq_node;
19 	enum aq_rx_filter_type type;
20 	struct ethtool_rx_flow_spec aq_fsp;
21 };
22 
23 u16 aq_get_rxnfc_count_all_rules(struct aq_nic_s *aq_nic);
24 struct aq_hw_rx_fltrs_s *aq_get_hw_rx_fltrs(struct aq_nic_s *aq_nic);
25 int aq_add_rxnfc_rule(struct aq_nic_s *aq_nic, const struct ethtool_rxnfc *cmd);
26 int aq_del_rxnfc_rule(struct aq_nic_s *aq_nic, const struct ethtool_rxnfc *cmd);
27 int aq_get_rxnfc_rule(struct aq_nic_s *aq_nic, struct ethtool_rxnfc *cmd);
28 int aq_get_rxnfc_all_rules(struct aq_nic_s *aq_nic, struct ethtool_rxnfc *cmd,
29 			   u32 *rule_locs);
30 int aq_del_fvlan_by_vlan(struct aq_nic_s *aq_nic, u16 vlan_id);
31 int aq_clear_rxnfc_all_rules(struct aq_nic_s *aq_nic);
32 int aq_reapply_rxnfc_all_rules(struct aq_nic_s *aq_nic);
33 int aq_filters_vlans_update(struct aq_nic_s *aq_nic);
34 int aq_filters_vlan_offload_off(struct aq_nic_s *aq_nic);
35 
36 #endif /* AQ_FILTERS_H */
37