Lines Matching refs:port_vlan
242 struct prestera_port_vlan *port_vlan; in prestera_port_vlan_by_vid() local
244 list_for_each_entry(port_vlan, &port->vlans_list, port_head) { in prestera_port_vlan_by_vid()
245 if (port_vlan->vid == vid) in prestera_port_vlan_by_vid()
246 return port_vlan; in prestera_port_vlan_by_vid()
255 struct prestera_port_vlan *port_vlan; in prestera_port_vlan_create() local
258 port_vlan = prestera_port_vlan_by_vid(port, vid); in prestera_port_vlan_create()
259 if (port_vlan) in prestera_port_vlan_create()
266 port_vlan = kzalloc(sizeof(*port_vlan), GFP_KERNEL); in prestera_port_vlan_create()
267 if (!port_vlan) { in prestera_port_vlan_create()
272 port_vlan->port = port; in prestera_port_vlan_create()
273 port_vlan->vid = vid; in prestera_port_vlan_create()
275 list_add(&port_vlan->port_head, &port->vlans_list); in prestera_port_vlan_create()
277 return port_vlan; in prestera_port_vlan_create()
388 prestera_port_vlan_bridge_leave(struct prestera_port_vlan *port_vlan) in prestera_port_vlan_bridge_leave() argument
391 struct prestera_port *port = port_vlan->port; in prestera_port_vlan_bridge_leave()
395 u16 vid = port_vlan->vid; in prestera_port_vlan_bridge_leave()
398 br_port = port_vlan->br_port; in prestera_port_vlan_bridge_leave()
414 list_del(&port_vlan->br_vlan_head); in prestera_port_vlan_bridge_leave()
417 port_vlan->br_port = NULL; in prestera_port_vlan_bridge_leave()
420 static void prestera_port_vlan_destroy(struct prestera_port_vlan *port_vlan) in prestera_port_vlan_destroy() argument
422 struct prestera_port *port = port_vlan->port; in prestera_port_vlan_destroy()
423 u16 vid = port_vlan->vid; in prestera_port_vlan_destroy()
425 if (port_vlan->br_port) in prestera_port_vlan_destroy()
426 prestera_port_vlan_bridge_leave(port_vlan); in prestera_port_vlan_destroy()
429 list_del(&port_vlan->port_head); in prestera_port_vlan_destroy()
430 kfree(port_vlan); in prestera_port_vlan_destroy()
820 struct prestera_port_vlan *port_vlan; in prestera_port_bridge_vlan_stp_set() local
822 list_for_each_entry(port_vlan, &br_vlan->port_vlan_list, br_vlan_head) { in prestera_port_bridge_vlan_stp_set()
823 if (port_vlan->port != port) in prestera_port_bridge_vlan_stp_set()
1357 prestera_port_vlan_bridge_join(struct prestera_port_vlan *port_vlan, in prestera_port_vlan_bridge_join() argument
1360 struct prestera_port *port = port_vlan->port; in prestera_port_vlan_bridge_join()
1362 u16 vid = port_vlan->vid; in prestera_port_vlan_bridge_join()
1365 if (port_vlan->br_port) in prestera_port_vlan_bridge_join()
1385 list_add(&port_vlan->br_vlan_head, &br_vlan->port_vlan_list); in prestera_port_vlan_bridge_join()
1388 port_vlan->br_port = br_port; in prestera_port_vlan_bridge_join()
1406 struct prestera_port_vlan *port_vlan; in prestera_bridge_port_vlan_add() local
1416 port_vlan = prestera_port_vlan_by_vid(port, vid); in prestera_bridge_port_vlan_add()
1417 if (port_vlan && port_vlan->br_port != br_port) in prestera_bridge_port_vlan_add()
1420 if (!port_vlan) { in prestera_bridge_port_vlan_add()
1421 port_vlan = prestera_port_vlan_create(port, vid, is_untagged); in prestera_bridge_port_vlan_add()
1422 if (IS_ERR(port_vlan)) in prestera_bridge_port_vlan_add()
1423 return PTR_ERR(port_vlan); in prestera_bridge_port_vlan_add()
1434 err = prestera_port_vlan_bridge_join(port_vlan, br_port); in prestera_bridge_port_vlan_add()
1445 prestera_port_vlan_destroy(port_vlan); in prestera_bridge_port_vlan_add()
1455 struct prestera_port_vlan *port_vlan; in prestera_bridge_port_vlan_del() local
1457 port_vlan = prestera_port_vlan_by_vid(port, vid); in prestera_bridge_port_vlan_del()
1458 if (WARN_ON(!port_vlan)) in prestera_bridge_port_vlan_del()
1461 prestera_port_vlan_bridge_leave(port_vlan); in prestera_bridge_port_vlan_del()
1463 prestera_port_vlan_destroy(port_vlan); in prestera_bridge_port_vlan_del()