Lines Matching full:vlan
128 struct batadv_softif_vlan *vlan; in batadv_interface_set_mac_addr() local
143 hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { in batadv_interface_set_mac_addr()
144 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid, in batadv_interface_set_mac_addr()
146 batadv_tt_local_add(dev, addr->sa_data, vlan->vid, in batadv_interface_set_mac_addr()
505 * batadv_softif_vlan_release() - release vlan from lists and queue for free
507 * @ref: kref pointer of the vlan object
511 struct batadv_softif_vlan *vlan; in batadv_softif_vlan_release() local
513 vlan = container_of(ref, struct batadv_softif_vlan, refcount); in batadv_softif_vlan_release()
515 spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
516 hlist_del_rcu(&vlan->list); in batadv_softif_vlan_release()
517 spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
519 kfree_rcu(vlan, rcu); in batadv_softif_vlan_release()
523 * batadv_softif_vlan_get() - get the vlan object for a specific vid
525 * @vid: the identifier of the vlan object to retrieve
527 * Return: the private data of the vlan matching the vid passed as argument or
533 struct batadv_softif_vlan *vlan_tmp, *vlan = NULL; in batadv_softif_vlan_get() local
543 vlan = vlan_tmp; in batadv_softif_vlan_get()
548 return vlan; in batadv_softif_vlan_get()
552 * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
554 * @vid: the VLAN identifier
560 struct batadv_softif_vlan *vlan; in batadv_softif_create_vlan() local
564 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_softif_create_vlan()
565 if (vlan) { in batadv_softif_create_vlan()
566 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
571 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); in batadv_softif_create_vlan()
572 if (!vlan) { in batadv_softif_create_vlan()
577 vlan->bat_priv = bat_priv; in batadv_softif_create_vlan()
578 vlan->vid = vid; in batadv_softif_create_vlan()
579 kref_init(&vlan->refcount); in batadv_softif_create_vlan()
581 atomic_set(&vlan->ap_isolation, 0); in batadv_softif_create_vlan()
583 kref_get(&vlan->refcount); in batadv_softif_create_vlan()
584 hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list); in batadv_softif_create_vlan()
595 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
603 * @vlan: the object to remove
606 struct batadv_softif_vlan *vlan) in batadv_softif_destroy_vlan() argument
612 vlan->vid, "vlan interface destroyed", false); in batadv_softif_destroy_vlan()
614 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_vlan()
620 * @proto: protocol of the vlan id
621 * @vid: identifier of the new vlan
623 * Set up all the internal structures for handling the new vlan on top of the
632 struct batadv_softif_vlan *vlan; in batadv_interface_add_vid() local
642 /* if a new vlan is getting created and it already exists, it means that in batadv_interface_add_vid()
648 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_interface_add_vid()
649 if (!vlan) in batadv_interface_add_vid()
653 * flag. This must be added again, even if the vlan object already in batadv_interface_add_vid()
666 * @proto: protocol of the vlan id
667 * @vid: identifier of the deleted vlan
669 * Destroy all the internal structures used to handle the vlan identified by vid
673 * or -ENOENT if the specified vlan id wasn't registered.
679 struct batadv_softif_vlan *vlan; in batadv_interface_kill_vid() local
687 vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); in batadv_interface_kill_vid()
688 if (!vlan) in batadv_interface_kill_vid()
691 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_interface_kill_vid()
693 /* finally free the vlan object */ in batadv_interface_kill_vid()
694 batadv_softif_vlan_put(vlan); in batadv_interface_kill_vid()
1103 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_netlink() local
1110 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_netlink()
1111 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_netlink()
1112 if (vlan) { in batadv_softif_destroy_netlink()
1113 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_netlink()
1114 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_netlink()