Lines Matching refs:sparx5
19 struct sparx5 *sparx5; member
58 struct sparx5 *sparx5 = port->sparx5; in sparx5_attr_stp_state_set() local
60 if (!test_bit(port->portno, sparx5->bridge_mask)) { in sparx5_attr_stp_state_set()
68 set_bit(port->portno, sparx5->bridge_fwd_mask); in sparx5_attr_stp_state_set()
71 set_bit(port->portno, sparx5->bridge_lrn_mask); in sparx5_attr_stp_state_set()
76 clear_bit(port->portno, sparx5->bridge_fwd_mask); in sparx5_attr_stp_state_set()
77 clear_bit(port->portno, sparx5->bridge_lrn_mask); in sparx5_attr_stp_state_set()
82 sparx5_update_fwd(sparx5); in sparx5_attr_stp_state_set()
91 sparx5_set_ageing(port->sparx5, ageing_time); in sparx5_port_attr_ageing_set()
98 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_attr_mrouter_set() local
109 mutex_lock(&sparx5->mdb_lock); in sparx5_port_attr_mrouter_set()
110 list_for_each_entry(e, &sparx5->mdb_entries, list) { in sparx5_port_attr_mrouter_set()
115 mutex_unlock(&sparx5->mdb_lock); in sparx5_port_attr_mrouter_set()
151 sparx5_vlan_port_apply(port->sparx5, port); in sparx5_port_attr_set()
169 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_bridge_join() local
173 if (bitmap_empty(sparx5->bridge_mask, SPX5_PORTS)) in sparx5_port_bridge_join()
175 sparx5->hw_bridge_dev = bridge; in sparx5_port_bridge_join()
177 if (sparx5->hw_bridge_dev != bridge) in sparx5_port_bridge_join()
183 set_bit(port->portno, sparx5->bridge_mask); in sparx5_port_bridge_join()
191 sparx5_mact_forget(sparx5, ndev->dev_addr, 0); in sparx5_port_bridge_join()
201 clear_bit(port->portno, sparx5->bridge_mask); in sparx5_port_bridge_join()
208 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_bridge_leave() local
212 clear_bit(port->portno, sparx5->bridge_mask); in sparx5_port_bridge_leave()
213 if (bitmap_empty(sparx5->bridge_mask, SPX5_PORTS)) in sparx5_port_bridge_leave()
214 sparx5->hw_bridge_dev = NULL; in sparx5_port_bridge_leave()
222 sparx5_mact_learn(sparx5, PGID_CPU, port->ndev->dev_addr, 0); in sparx5_port_bridge_leave()
244 sparx5_vlan_port_apply(port->sparx5, port); in sparx5_port_changeupper()
253 struct sparx5 *sparx5 = port->sparx5; in sparx5_port_add_addr() local
257 sparx5_mact_learn(sparx5, PGID_CPU, port->ndev->dev_addr, vid); in sparx5_port_add_addr()
259 sparx5_mact_forget(sparx5, port->ndev->dev_addr, vid); in sparx5_port_add_addr()
306 struct sparx5 *sparx5; in sparx5_switchdev_bridge_fdb_event_work() local
313 sparx5 = switchdev_work->sparx5; in sparx5_switchdev_bridge_fdb_event_work()
316 sparx5 = switchdev_work->sparx5; in sparx5_switchdev_bridge_fdb_event_work()
333 sparx5_add_mact_entry(sparx5, dev, PGID_CPU, in sparx5_switchdev_bridge_fdb_event_work()
336 sparx5_add_mact_entry(sparx5, port->ndev, port->portno, in sparx5_switchdev_bridge_fdb_event_work()
340 sparx5_del_mact_entry(sparx5, fdb_info->addr, vid); in sparx5_switchdev_bridge_fdb_event_work()
362 struct sparx5 *spx5; in sparx5_switchdev_event()
365 spx5 = container_of(nb, struct sparx5, switchdev_nb); in sparx5_switchdev_event()
382 switchdev_work->sparx5 = spx5; in sparx5_switchdev_event()
416 struct sparx5 *sparx5 = in sparx5_handle_port_vlan_add() local
417 container_of(nb, struct sparx5, in sparx5_handle_port_vlan_add()
421 sparx5_mact_learn(sparx5, PGID_BCAST, dev->broadcast, in sparx5_handle_port_vlan_add()
434 static int sparx5_alloc_mdb_entry(struct sparx5 *sparx5, in sparx5_alloc_mdb_entry() argument
447 err = sparx5_pgid_alloc_mcast(sparx5, &pgid_idx); in sparx5_alloc_mdb_entry()
457 mutex_lock(&sparx5->mdb_lock); in sparx5_alloc_mdb_entry()
458 list_add_tail(&entry->list, &sparx5->mdb_entries); in sparx5_alloc_mdb_entry()
459 mutex_unlock(&sparx5->mdb_lock); in sparx5_alloc_mdb_entry()
465 static void sparx5_free_mdb_entry(struct sparx5 *sparx5, in sparx5_free_mdb_entry() argument
471 mutex_lock(&sparx5->mdb_lock); in sparx5_free_mdb_entry()
472 list_for_each_entry_safe(entry, tmp, &sparx5->mdb_entries, list) { in sparx5_free_mdb_entry()
477 sparx5_pgid_free(sparx5, entry->pgid_idx); in sparx5_free_mdb_entry()
484 mutex_unlock(&sparx5->mdb_lock); in sparx5_free_mdb_entry()
487 static struct sparx5_mdb_entry *sparx5_mdb_get_entry(struct sparx5 *sparx5, in sparx5_mdb_get_entry() argument
493 mutex_lock(&sparx5->mdb_lock); in sparx5_mdb_get_entry()
494 list_for_each_entry(e, &sparx5->mdb_entries, list) { in sparx5_mdb_get_entry()
502 mutex_unlock(&sparx5->mdb_lock); in sparx5_mdb_get_entry()
506 static void sparx5_cpu_copy_ena(struct sparx5 *spx5, u16 pgid, bool enable) in sparx5_cpu_copy_ena()
518 struct sparx5 *spx5 = port->sparx5; in sparx5_handle_port_mdb_add()
575 struct sparx5 *spx5 = port->sparx5; in sparx5_handle_port_mdb_del()
653 struct sparx5 *sparx5 = in sparx5_handle_port_vlan_del() local
654 container_of(nb, struct sparx5, in sparx5_handle_port_vlan_del()
657 sparx5_mact_forget(sparx5, dev->broadcast, vid); in sparx5_handle_port_vlan_del()
721 int sparx5_register_notifier_blocks(struct sparx5 *s5) in sparx5_register_notifier_blocks()
756 void sparx5_unregister_notifier_blocks(struct sparx5 *s5) in sparx5_unregister_notifier_blocks()