Lines Matching full:vlan

131 	struct batadv_softif_vlan *vlan;  in batadv_interface_set_mac_addr()  local
146 hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) { in batadv_interface_set_mac_addr()
147 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid, in batadv_interface_set_mac_addr()
149 batadv_tt_local_add(dev, addr->sa_data, vlan->vid, in batadv_interface_set_mac_addr()
511 * batadv_softif_vlan_release() - release vlan from lists and queue for free
513 * @ref: kref pointer of the vlan object
517 struct batadv_softif_vlan *vlan; in batadv_softif_vlan_release() local
519 vlan = container_of(ref, struct batadv_softif_vlan, refcount); in batadv_softif_vlan_release()
521 spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
522 hlist_del_rcu(&vlan->list); in batadv_softif_vlan_release()
523 spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
525 kfree_rcu(vlan, rcu); in batadv_softif_vlan_release()
529 * batadv_softif_vlan_get() - get the vlan object for a specific vid
531 * @vid: the identifier of the vlan object to retrieve
533 * Return: the private data of the vlan matching the vid passed as argument or
539 struct batadv_softif_vlan *vlan_tmp, *vlan = NULL; in batadv_softif_vlan_get() local
549 vlan = vlan_tmp; in batadv_softif_vlan_get()
554 return vlan; in batadv_softif_vlan_get()
558 * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
560 * @vid: the VLAN identifier
566 struct batadv_softif_vlan *vlan; in batadv_softif_create_vlan() local
571 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_softif_create_vlan()
572 if (vlan) { in batadv_softif_create_vlan()
573 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
578 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); in batadv_softif_create_vlan()
579 if (!vlan) { in batadv_softif_create_vlan()
584 vlan->bat_priv = bat_priv; in batadv_softif_create_vlan()
585 vlan->vid = vid; in batadv_softif_create_vlan()
586 kref_init(&vlan->refcount); in batadv_softif_create_vlan()
588 atomic_set(&vlan->ap_isolation, 0); in batadv_softif_create_vlan()
590 kref_get(&vlan->refcount); in batadv_softif_create_vlan()
591 hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list); in batadv_softif_create_vlan()
597 err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_softif_create_vlan()
600 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
603 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
615 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
623 * @vlan: the object to remove
626 struct batadv_softif_vlan *vlan) in batadv_softif_destroy_vlan() argument
632 vlan->vid, "vlan interface destroyed", false); in batadv_softif_destroy_vlan()
634 batadv_sysfs_del_vlan(bat_priv, vlan); in batadv_softif_destroy_vlan()
635 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_vlan()
641 * @proto: protocol of the vlan id
642 * @vid: identifier of the new vlan
644 * Set up all the internal structures for handling the new vlan on top of the
653 struct batadv_softif_vlan *vlan; in batadv_interface_add_vid() local
664 /* if a new vlan is getting created and it already exists, it means that in batadv_interface_add_vid()
670 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_interface_add_vid()
671 if (!vlan) in batadv_interface_add_vid()
675 * be since we received a kill_vid() for this vlan in batadv_interface_add_vid()
677 if (!vlan->kobj) { in batadv_interface_add_vid()
678 ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_interface_add_vid()
680 batadv_softif_vlan_put(vlan); in batadv_interface_add_vid()
686 * flag. This must be added again, even if the vlan object already in batadv_interface_add_vid()
699 * @proto: protocol of the vlan id
700 * @vid: identifier of the deleted vlan
702 * Destroy all the internal structures used to handle the vlan identified by vid
706 * or -ENOENT if the specified vlan id wasn't registered.
712 struct batadv_softif_vlan *vlan; in batadv_interface_kill_vid() local
720 vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); in batadv_interface_kill_vid()
721 if (!vlan) in batadv_interface_kill_vid()
724 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_interface_kill_vid()
726 /* finally free the vlan object */ in batadv_interface_kill_vid()
727 batadv_softif_vlan_put(vlan); in batadv_interface_kill_vid()
1105 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_sysfs() local
1109 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_sysfs()
1110 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_sysfs()
1111 if (vlan) { in batadv_softif_destroy_sysfs()
1112 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_sysfs()
1113 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_sysfs()
1131 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_netlink() local
1139 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_netlink()
1140 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_netlink()
1141 if (vlan) { in batadv_softif_destroy_netlink()
1142 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_netlink()
1143 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_netlink()