Lines Matching refs:rule

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