Lines Matching refs:fdb_entry
27 struct lan966x_fdb_entry *fdb_entry; in lan966x_fdb_find_entry() local
29 list_for_each_entry(fdb_entry, &lan966x->fdb_entries, list) { in lan966x_fdb_find_entry()
30 if (fdb_entry->vid == fdb_info->vid && in lan966x_fdb_find_entry()
31 ether_addr_equal(fdb_entry->mac, fdb_info->addr)) in lan966x_fdb_find_entry()
32 return fdb_entry; in lan966x_fdb_find_entry()
41 struct lan966x_fdb_entry *fdb_entry; in lan966x_fdb_add_entry() local
43 fdb_entry = lan966x_fdb_find_entry(lan966x, fdb_info); in lan966x_fdb_add_entry()
44 if (fdb_entry) { in lan966x_fdb_add_entry()
45 fdb_entry->references++; in lan966x_fdb_add_entry()
49 fdb_entry = kzalloc(sizeof(*fdb_entry), GFP_KERNEL); in lan966x_fdb_add_entry()
50 if (!fdb_entry) in lan966x_fdb_add_entry()
53 ether_addr_copy(fdb_entry->mac, fdb_info->addr); in lan966x_fdb_add_entry()
54 fdb_entry->vid = fdb_info->vid; in lan966x_fdb_add_entry()
55 fdb_entry->references = 1; in lan966x_fdb_add_entry()
56 list_add_tail(&fdb_entry->list, &lan966x->fdb_entries); in lan966x_fdb_add_entry()
62 struct lan966x_fdb_entry *fdb_entry, *tmp; in lan966x_fdb_del_entry() local
64 list_for_each_entry_safe(fdb_entry, tmp, &lan966x->fdb_entries, in lan966x_fdb_del_entry()
66 if (fdb_entry->vid == fdb_info->vid && in lan966x_fdb_del_entry()
67 ether_addr_equal(fdb_entry->mac, fdb_info->addr)) { in lan966x_fdb_del_entry()
68 fdb_entry->references--; in lan966x_fdb_del_entry()
69 if (!fdb_entry->references) { in lan966x_fdb_del_entry()
70 list_del(&fdb_entry->list); in lan966x_fdb_del_entry()
71 kfree(fdb_entry); in lan966x_fdb_del_entry()
83 struct lan966x_fdb_entry *fdb_entry; in lan966x_fdb_write_entries() local
85 list_for_each_entry(fdb_entry, &lan966x->fdb_entries, list) { in lan966x_fdb_write_entries()
86 if (fdb_entry->vid != vid) in lan966x_fdb_write_entries()
89 lan966x_mac_cpu_learn(lan966x, fdb_entry->mac, fdb_entry->vid); in lan966x_fdb_write_entries()
95 struct lan966x_fdb_entry *fdb_entry; in lan966x_fdb_erase_entries() local
97 list_for_each_entry(fdb_entry, &lan966x->fdb_entries, list) { in lan966x_fdb_erase_entries()
98 if (fdb_entry->vid != vid) in lan966x_fdb_erase_entries()
101 lan966x_mac_cpu_forget(lan966x, fdb_entry->mac, fdb_entry->vid); in lan966x_fdb_erase_entries()
107 struct lan966x_fdb_entry *fdb_entry, *tmp; in lan966x_fdb_purge_entries() local
109 list_for_each_entry_safe(fdb_entry, tmp, &lan966x->fdb_entries, list) { in lan966x_fdb_purge_entries()
110 list_del(&fdb_entry->list); in lan966x_fdb_purge_entries()
111 kfree(fdb_entry); in lan966x_fdb_purge_entries()