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()
508 * batadv_softif_vlan_release() - release vlan from lists and queue for free
510 * @ref: kref pointer of the vlan object
514 struct batadv_softif_vlan *vlan; in batadv_softif_vlan_release() local
516 vlan = container_of(ref, struct batadv_softif_vlan, refcount); in batadv_softif_vlan_release()
518 spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
519 hlist_del_rcu(&vlan->list); in batadv_softif_vlan_release()
520 spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock); in batadv_softif_vlan_release()
522 kfree_rcu(vlan, rcu); in batadv_softif_vlan_release()
526 * batadv_softif_vlan_put() - decrease the vlan object refcounter and
528 * @vlan: the vlan object to release
530 void batadv_softif_vlan_put(struct batadv_softif_vlan *vlan) in batadv_softif_vlan_put() argument
532 if (!vlan) in batadv_softif_vlan_put()
535 kref_put(&vlan->refcount, batadv_softif_vlan_release); in batadv_softif_vlan_put()
539 * batadv_softif_vlan_get() - get the vlan object for a specific vid
541 * @vid: the identifier of the vlan object to retrieve
543 * Return: the private data of the vlan matching the vid passed as argument or
549 struct batadv_softif_vlan *vlan_tmp, *vlan = NULL; in batadv_softif_vlan_get() local
559 vlan = vlan_tmp; in batadv_softif_vlan_get()
564 return vlan; in batadv_softif_vlan_get()
568 * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
570 * @vid: the VLAN identifier
576 struct batadv_softif_vlan *vlan; in batadv_softif_create_vlan() local
581 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_softif_create_vlan()
582 if (vlan) { in batadv_softif_create_vlan()
583 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
588 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC); in batadv_softif_create_vlan()
589 if (!vlan) { in batadv_softif_create_vlan()
594 vlan->bat_priv = bat_priv; in batadv_softif_create_vlan()
595 vlan->vid = vid; in batadv_softif_create_vlan()
596 kref_init(&vlan->refcount); in batadv_softif_create_vlan()
598 atomic_set(&vlan->ap_isolation, 0); in batadv_softif_create_vlan()
600 kref_get(&vlan->refcount); in batadv_softif_create_vlan()
601 hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list); in batadv_softif_create_vlan()
607 err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_softif_create_vlan()
610 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
613 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
625 batadv_softif_vlan_put(vlan); in batadv_softif_create_vlan()
633 * @vlan: the object to remove
636 struct batadv_softif_vlan *vlan) in batadv_softif_destroy_vlan() argument
642 vlan->vid, "vlan interface destroyed", false); in batadv_softif_destroy_vlan()
644 batadv_sysfs_del_vlan(bat_priv, vlan); in batadv_softif_destroy_vlan()
645 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_vlan()
651 * @proto: protocol of the vlan id
652 * @vid: identifier of the new vlan
654 * Set up all the internal structures for handling the new vlan on top of the
663 struct batadv_softif_vlan *vlan; in batadv_interface_add_vid() local
674 /* if a new vlan is getting created and it already exists, it means that in batadv_interface_add_vid()
680 vlan = batadv_softif_vlan_get(bat_priv, vid); in batadv_interface_add_vid()
681 if (!vlan) in batadv_interface_add_vid()
685 * be since we received a kill_vid() for this vlan in batadv_interface_add_vid()
687 if (!vlan->kobj) { in batadv_interface_add_vid()
688 ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan); in batadv_interface_add_vid()
690 batadv_softif_vlan_put(vlan); in batadv_interface_add_vid()
696 * flag. This must be added again, even if the vlan object already in batadv_interface_add_vid()
709 * @proto: protocol of the vlan id
710 * @vid: identifier of the deleted vlan
712 * Destroy all the internal structures used to handle the vlan identified by vid
716 * or -ENOENT if the specified vlan id wasn't registered.
722 struct batadv_softif_vlan *vlan; in batadv_interface_kill_vid() local
730 vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG); in batadv_interface_kill_vid()
731 if (!vlan) in batadv_interface_kill_vid()
734 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_interface_kill_vid()
736 /* finally free the vlan object */ in batadv_interface_kill_vid()
737 batadv_softif_vlan_put(vlan); in batadv_interface_kill_vid()
1115 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_sysfs() local
1119 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_sysfs()
1120 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_sysfs()
1121 if (vlan) { in batadv_softif_destroy_sysfs()
1122 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_sysfs()
1123 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_sysfs()
1141 struct batadv_softif_vlan *vlan; in batadv_softif_destroy_netlink() local
1149 /* destroy the "untagged" VLAN */ in batadv_softif_destroy_netlink()
1150 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS); in batadv_softif_destroy_netlink()
1151 if (vlan) { in batadv_softif_destroy_netlink()
1152 batadv_softif_destroy_vlan(bat_priv, vlan); in batadv_softif_destroy_netlink()
1153 batadv_softif_vlan_put(vlan); in batadv_softif_destroy_netlink()