Lines Matching full:lan966x
23 void lan966x_mdb_init(struct lan966x *lan966x) in lan966x_mdb_init() argument
25 INIT_LIST_HEAD(&lan966x->mdb_entries); in lan966x_mdb_init()
26 INIT_LIST_HEAD(&lan966x->pgid_entries); in lan966x_mdb_init()
29 static void lan966x_mdb_purge_mdb_entries(struct lan966x *lan966x) in lan966x_mdb_purge_mdb_entries() argument
33 list_for_each_entry_safe(mdb_entry, tmp, &lan966x->mdb_entries, list) { in lan966x_mdb_purge_mdb_entries()
39 static void lan966x_mdb_purge_pgid_entries(struct lan966x *lan966x) in lan966x_mdb_purge_pgid_entries() argument
43 list_for_each_entry_safe(pgid_entry, tmp, &lan966x->pgid_entries, list) { in lan966x_mdb_purge_pgid_entries()
49 void lan966x_mdb_deinit(struct lan966x *lan966x) in lan966x_mdb_deinit() argument
51 lan966x_mdb_purge_mdb_entries(lan966x); in lan966x_mdb_deinit()
52 lan966x_mdb_purge_pgid_entries(lan966x); in lan966x_mdb_deinit()
56 lan966x_mdb_entry_get(struct lan966x *lan966x, in lan966x_mdb_entry_get() argument
62 list_for_each_entry(mdb_entry, &lan966x->mdb_entries, list) { in lan966x_mdb_entry_get()
72 lan966x_mdb_entry_add(struct lan966x *lan966x, in lan966x_mdb_entry_add() argument
84 list_add_tail(&mdb_entry->list, &lan966x->mdb_entries); in lan966x_mdb_entry_add()
110 struct lan966x *lan966x = port->lan966x; in lan966x_mdb_ip_add() local
115 mdb_entry = lan966x_mdb_entry_get(lan966x, mdb->addr, mdb->vid); in lan966x_mdb_ip_add()
117 mdb_entry = lan966x_mdb_entry_add(lan966x, mdb); in lan966x_mdb_ip_add()
122 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_ip_add()
131 if (lan966x_vlan_cpu_member_cpu_vlan_mask(lan966x, mdb_entry->vid) && in lan966x_mdb_ip_add()
136 return lan966x_mac_ip_learn(lan966x, cpu_copy, in lan966x_mdb_ip_add()
145 struct lan966x *lan966x = port->lan966x; in lan966x_mdb_ip_del() local
150 mdb_entry = lan966x_mdb_entry_get(lan966x, mdb->addr, mdb->vid); in lan966x_mdb_ip_del()
167 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_ip_del()
178 return lan966x_mac_ip_learn(lan966x, mdb_entry->cpu_copy, in lan966x_mdb_ip_del()
183 lan966x_pgid_entry_add(struct lan966x *lan966x, int index, u16 ports) in lan966x_pgid_entry_add() argument
195 list_add_tail(&pgid_entry->list, &lan966x->pgid_entries); in lan966x_pgid_entry_add()
201 lan966x_pgid_entry_get(struct lan966x *lan966x, in lan966x_pgid_entry_get() argument
210 list_for_each_entry(pgid_entry, &lan966x->pgid_entries, list) { in lan966x_pgid_entry_get()
223 list_for_each_entry(pgid_entry, &lan966x->pgid_entries, list) { in lan966x_pgid_entry_get()
231 return lan966x_pgid_entry_add(lan966x, index, in lan966x_pgid_entry_get()
238 static void lan966x_pgid_entry_del(struct lan966x *lan966x, in lan966x_pgid_entry_del() argument
253 struct lan966x *lan966x = port->lan966x; in lan966x_mdb_l2_add() local
258 mdb_entry = lan966x_mdb_entry_get(lan966x, mdb->addr, mdb->vid); in lan966x_mdb_l2_add()
260 mdb_entry = lan966x_mdb_entry_add(lan966x, mdb); in lan966x_mdb_l2_add()
264 lan966x_pgid_entry_del(lan966x, mdb_entry->pgid); in lan966x_mdb_l2_add()
266 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_l2_add()
276 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_add()
285 if (!lan966x_vlan_cpu_member_cpu_vlan_mask(lan966x, mdb_entry->vid) && in lan966x_mdb_l2_add()
291 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_add()
293 return lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_add()
302 struct lan966x *lan966x = port->lan966x; in lan966x_mdb_l2_del() local
308 mdb_entry = lan966x_mdb_entry_get(lan966x, mdb->addr, mdb->vid); in lan966x_mdb_l2_del()
327 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_l2_del()
328 lan966x_pgid_entry_del(lan966x, mdb_entry->pgid); in lan966x_mdb_l2_del()
338 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_del()
348 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_del()
350 return lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_del()
398 static void lan966x_mdb_ip_cpu_copy(struct lan966x *lan966x, in lan966x_mdb_ip_cpu_copy() argument
405 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_ip_cpu_copy()
406 lan966x_mac_ip_learn(lan966x, true, mac, mdb_entry->vid, type); in lan966x_mdb_ip_cpu_copy()
409 static void lan966x_mdb_l2_cpu_copy(struct lan966x *lan966x, in lan966x_mdb_l2_cpu_copy() argument
416 lan966x_pgid_entry_del(lan966x, mdb_entry->pgid); in lan966x_mdb_l2_cpu_copy()
418 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_l2_cpu_copy()
422 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_cpu_copy()
430 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_cpu_copy()
432 lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_cpu_copy()
436 void lan966x_mdb_write_entries(struct lan966x *lan966x, u16 vid) in lan966x_mdb_write_entries() argument
441 list_for_each_entry(mdb_entry, &lan966x->mdb_entries, list) { in lan966x_mdb_write_entries()
447 lan966x_mdb_ip_cpu_copy(lan966x, mdb_entry, type); in lan966x_mdb_write_entries()
449 lan966x_mdb_l2_cpu_copy(lan966x, mdb_entry, type); in lan966x_mdb_write_entries()
453 static void lan966x_mdb_ip_cpu_remove(struct lan966x *lan966x, in lan966x_mdb_ip_cpu_remove() argument
460 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_ip_cpu_remove()
461 lan966x_mac_ip_learn(lan966x, false, mac, mdb_entry->vid, type); in lan966x_mdb_ip_cpu_remove()
464 static void lan966x_mdb_l2_cpu_remove(struct lan966x *lan966x, in lan966x_mdb_l2_cpu_remove() argument
471 lan966x_pgid_entry_del(lan966x, mdb_entry->pgid); in lan966x_mdb_l2_cpu_remove()
473 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_l2_cpu_remove()
477 pgid_entry = lan966x_pgid_entry_get(lan966x, mdb_entry); in lan966x_mdb_l2_cpu_remove()
485 lan966x, ANA_PGID(pgid_entry->index)); in lan966x_mdb_l2_cpu_remove()
487 lan966x_mac_learn(lan966x, pgid_entry->index, mdb_entry->mac, in lan966x_mdb_l2_cpu_remove()
491 void lan966x_mdb_erase_entries(struct lan966x *lan966x, u16 vid) in lan966x_mdb_erase_entries() argument
496 list_for_each_entry(mdb_entry, &lan966x->mdb_entries, list) { in lan966x_mdb_erase_entries()
502 lan966x_mdb_ip_cpu_remove(lan966x, mdb_entry, type); in lan966x_mdb_erase_entries()
504 lan966x_mdb_l2_cpu_remove(lan966x, mdb_entry, type); in lan966x_mdb_erase_entries()
508 void lan966x_mdb_clear_entries(struct lan966x *lan966x) in lan966x_mdb_clear_entries() argument
514 list_for_each_entry(mdb_entry, &lan966x->mdb_entries, list) { in lan966x_mdb_clear_entries()
521 lan966x_mac_forget(lan966x, mac, mdb_entry->vid, type); in lan966x_mdb_clear_entries()
525 void lan966x_mdb_restore_entries(struct lan966x *lan966x) in lan966x_mdb_restore_entries() argument
532 list_for_each_entry(mdb_entry, &lan966x->mdb_entries, list) { in lan966x_mdb_restore_entries()
538 if (lan966x_vlan_cpu_member_cpu_vlan_mask(lan966x, in lan966x_mdb_restore_entries()
543 lan966x_mac_ip_learn(lan966x, cpu_copy, mac, in lan966x_mdb_restore_entries()
546 lan966x_mac_learn(lan966x, mdb_entry->pgid->index, in lan966x_mdb_restore_entries()