/* Must be protected by RTNL. * Must be called with vid in range from 1 to 4094 inclusive. */ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) { struct net_port_vlans *pv; ASSERT_RTNL(); pv = rtnl_dereference(port->vlan_info); if (!pv) return -EINVAL; spin_lock_bh(&port->br->hash_lock); fdb_delete_by_addr(port->br, port->dev->dev_addr, vid); spin_unlock_bh(&port->br->hash_lock); return __vlan_del(pv, vid); }
/* Must be protected by RTNL. * Must be called with vid in range from 1 to 4094 inclusive. */ int br_vlan_delete(struct net_bridge *br, u16 vid) { struct net_port_vlans *pv; ASSERT_RTNL(); pv = rtnl_dereference(br->vlan_info); if (!pv) return -EINVAL; spin_lock_bh(&br->hash_lock); fdb_delete_by_addr(br, br->dev->dev_addr, vid); spin_unlock_bh(&br->hash_lock); __vlan_del(pv, vid); return 0; }
/* Must be protected by RTNL */ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) { struct net_port_vlans *pv; ASSERT_RTNL(); pv = rtnl_dereference(port->vlan_info); if (!pv) return -EINVAL; if (vid) { /* If the VID !=0 remove fdb for this vid. VID 0 is special * in that it's the default and is always there in the fdb. */ spin_lock_bh(&port->br->hash_lock); fdb_delete_by_addr(port->br, port->dev->dev_addr, vid); spin_unlock_bh(&port->br->hash_lock); } return __vlan_del(pv, vid); }