Lines Matching refs:swdev

40 	struct prestera_switchdev *swdev;  member
102 list_for_each_entry(bridge, &sw->swdev->bridge_list, head) in prestera_bridge_find()
434 prestera_bridge_create(struct prestera_switchdev *swdev, struct net_device *dev) in prestera_bridge_create() argument
441 if (vlan_enabled && swdev->bridge_8021q_exists) { in prestera_bridge_create()
451 swdev->bridge_8021q_exists = true; in prestera_bridge_create()
453 err = prestera_hw_bridge_create(swdev->sw, &bridge_id); in prestera_bridge_create()
463 bridge->swdev = swdev; in prestera_bridge_create()
470 list_add(&bridge->head, &swdev->bridge_list); in prestera_bridge_create()
477 struct prestera_switchdev *swdev = bridge->swdev; in prestera_bridge_destroy() local
482 swdev->bridge_8021q_exists = false; in prestera_bridge_destroy()
484 prestera_hw_bridge_delete(swdev->sw, bridge->bridge_id); in prestera_bridge_destroy()
498 struct prestera_bridge *prestera_bridge_by_dev(struct prestera_switchdev *swdev, in prestera_bridge_by_dev() argument
503 list_for_each_entry(bridge, &swdev->bridge_list, head) in prestera_bridge_by_dev()
543 prestera_bridge_port_by_dev(struct prestera_switchdev *swdev, in prestera_bridge_port_by_dev() argument
552 bridge = prestera_bridge_by_dev(swdev, br_dev); in prestera_bridge_port_by_dev()
652 struct prestera_switchdev *swdev = port->sw->swdev; in prestera_bridge_port_join() local
657 bridge = prestera_bridge_by_dev(swdev, br_dev); in prestera_bridge_port_join()
659 bridge = prestera_bridge_create(swdev, br_dev); in prestera_bridge_port_join()
740 struct prestera_switchdev *swdev = port->sw->swdev; in prestera_bridge_port_leave() local
744 bridge = prestera_bridge_by_dev(swdev, br_dev); in prestera_bridge_port_leave()
774 br_port = prestera_bridge_port_by_dev(port->sw->swdev, dev); in prestera_port_attr_br_flags_set()
804 bridge = prestera_bridge_by_dev(sw->swdev, dev); in prestera_port_attr_br_vlan_set()
841 br_port = prestera_bridge_port_by_dev(port->sw->swdev, dev); in prestera_port_attr_stp_state_set()
1226 br_port = prestera_bridge_port_by_dev(sw->swdev, port->dev); in prestera_port_fdb_set()
1480 br_port = prestera_bridge_port_by_dev(sw->swdev, port->dev); in prestera_port_vlans_add()
1661 br_port = prestera_bridge_port_by_dev(sw->swdev, port->dev); in prestera_port_vlans_del()
1842 static int prestera_switchdev_handler_init(struct prestera_switchdev *swdev) in prestera_switchdev_handler_init() argument
1846 swdev->swdev_nb.notifier_call = prestera_switchdev_event; in prestera_switchdev_handler_init()
1847 err = register_switchdev_notifier(&swdev->swdev_nb); in prestera_switchdev_handler_init()
1851 swdev->swdev_nb_blk.notifier_call = prestera_switchdev_blk_event; in prestera_switchdev_handler_init()
1852 err = register_switchdev_blocking_notifier(&swdev->swdev_nb_blk); in prestera_switchdev_handler_init()
1859 unregister_switchdev_notifier(&swdev->swdev_nb); in prestera_switchdev_handler_init()
1865 static void prestera_switchdev_handler_fini(struct prestera_switchdev *swdev) in prestera_switchdev_handler_fini() argument
1867 unregister_switchdev_blocking_notifier(&swdev->swdev_nb_blk); in prestera_switchdev_handler_fini()
1868 unregister_switchdev_notifier(&swdev->swdev_nb); in prestera_switchdev_handler_fini()
1873 struct prestera_switchdev *swdev; in prestera_switchdev_init() local
1876 swdev = kzalloc(sizeof(*swdev), GFP_KERNEL); in prestera_switchdev_init()
1877 if (!swdev) in prestera_switchdev_init()
1880 sw->swdev = swdev; in prestera_switchdev_init()
1881 swdev->sw = sw; in prestera_switchdev_init()
1883 INIT_LIST_HEAD(&swdev->bridge_list); in prestera_switchdev_init()
1891 err = prestera_switchdev_handler_init(swdev); in prestera_switchdev_init()
1905 kfree(swdev); in prestera_switchdev_init()
1912 struct prestera_switchdev *swdev = sw->swdev; in prestera_switchdev_fini() local
1915 prestera_switchdev_handler_fini(swdev); in prestera_switchdev_fini()
1917 kfree(swdev); in prestera_switchdev_fini()