Lines Matching full:rule
9 struct tsnep_rxnfc_rule *rule) in tsnep_enable_rule() argument
15 rx_assign |= (rule->queue_index << TSNEP_RX_ASSIGN_QUEUE_SHIFT) & in tsnep_enable_rule()
19 TSNEP_RX_ASSIGN_ETHER_TYPE_OFFSET * rule->location; in tsnep_enable_rule()
20 iowrite16(rule->filter.ether_type, addr); in tsnep_enable_rule()
22 /* enable rule after all settings are done */ in tsnep_enable_rule()
24 TSNEP_RX_ASSIGN_OFFSET * rule->location; in tsnep_enable_rule()
29 struct tsnep_rxnfc_rule *rule) in tsnep_disable_rule() argument
34 TSNEP_RX_ASSIGN_OFFSET * rule->location; in tsnep_disable_rule()
41 struct tsnep_rxnfc_rule *rule; in tsnep_get_rule() local
43 list_for_each_entry(rule, &adapter->rxnfc_rules, list) { in tsnep_get_rule()
44 if (rule->location == location) in tsnep_get_rule()
45 return rule; in tsnep_get_rule()
46 if (rule->location > location) in tsnep_get_rule()
54 struct tsnep_rxnfc_rule *rule) in tsnep_add_rule() argument
58 tsnep_enable_rule(adapter, rule); in tsnep_add_rule()
62 if (cur->location >= rule->location) in tsnep_add_rule()
67 list_add(&rule->list, pred ? &pred->list : &adapter->rxnfc_rules); in tsnep_add_rule()
72 struct tsnep_rxnfc_rule *rule) in tsnep_delete_rule() argument
74 tsnep_disable_rule(adapter, rule); in tsnep_delete_rule()
76 list_del(&rule->list); in tsnep_delete_rule()
79 kfree(rule); in tsnep_delete_rule()
84 struct tsnep_rxnfc_rule *rule, *tmp; in tsnep_flush_rules() local
88 list_for_each_entry_safe(rule, tmp, &adapter->rxnfc_rules, list) in tsnep_flush_rules()
89 tsnep_delete_rule(adapter, rule); in tsnep_flush_rules()
98 struct tsnep_rxnfc_rule *rule = NULL; in tsnep_rxnfc_get_rule() local
104 rule = tsnep_get_rule(adapter, fsp->location); in tsnep_rxnfc_get_rule()
105 if (!rule) { in tsnep_rxnfc_get_rule()
112 fsp->ring_cookie = rule->queue_index; in tsnep_rxnfc_get_rule()
114 if (rule->filter.type == TSNEP_RXNFC_ETHER_TYPE) { in tsnep_rxnfc_get_rule()
115 fsp->h_u.ether_spec.h_proto = htons(rule->filter.ether_type); in tsnep_rxnfc_get_rule()
128 struct tsnep_rxnfc_rule *rule; in tsnep_rxnfc_get_all() local
135 list_for_each_entry(rule, &adapter->rxnfc_rules, list) { in tsnep_rxnfc_get_all()
142 rule_locs[count] = rule->location; in tsnep_rxnfc_get_all()
171 static void tsnep_rxnfc_init_rule(struct tsnep_rxnfc_rule *rule, in tsnep_rxnfc_init_rule() argument
174 INIT_LIST_HEAD(&rule->list); in tsnep_rxnfc_init_rule()
176 rule->queue_index = fsp->ring_cookie; in tsnep_rxnfc_init_rule()
177 rule->location = fsp->location; in tsnep_rxnfc_init_rule()
179 rule->filter.type = TSNEP_RXNFC_ETHER_TYPE; in tsnep_rxnfc_init_rule()
180 rule->filter.ether_type = ntohs(fsp->h_u.ether_spec.h_proto); in tsnep_rxnfc_init_rule()
184 struct tsnep_rxnfc_rule *rule) in tsnep_rxnfc_check_rule() argument
190 if (!memcmp(&rule->filter, &tmp->filter, sizeof(rule->filter)) && in tsnep_rxnfc_check_rule()
191 tmp->location != rule->location) { in tsnep_rxnfc_check_rule()
192 netdev_dbg(dev, "rule already exists\n"); in tsnep_rxnfc_check_rule()
207 struct tsnep_rxnfc_rule *rule, *old_rule; in tsnep_rxnfc_add_rule() local
234 rule = kzalloc(sizeof(*rule), GFP_KERNEL); in tsnep_rxnfc_add_rule()
235 if (!rule) in tsnep_rxnfc_add_rule()
247 tsnep_rxnfc_init_rule(rule, fsp); in tsnep_rxnfc_add_rule()
249 retval = tsnep_rxnfc_check_rule(adapter, rule); in tsnep_rxnfc_add_rule()
257 tsnep_add_rule(adapter, rule); in tsnep_rxnfc_add_rule()
265 kfree(rule); in tsnep_rxnfc_add_rule()
274 struct tsnep_rxnfc_rule *rule; in tsnep_rxnfc_del_rule() local
278 rule = tsnep_get_rule(adapter, fsp->location); in tsnep_rxnfc_del_rule()
279 if (!rule) { in tsnep_rxnfc_del_rule()
285 tsnep_delete_rule(adapter, rule); in tsnep_rxnfc_del_rule()