Lines Matching refs:vlan
131 struct batadv_softif_vlan *vlan;
146 hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) {
147 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid,
149 batadv_tt_local_add(dev, addr->sa_data, vlan->vid,
514 * batadv_softif_vlan_release() - release vlan from lists and queue for free
516 * @ref: kref pointer of the vlan object
520 struct batadv_softif_vlan *vlan;
522 vlan = container_of(ref, struct batadv_softif_vlan, refcount);
524 spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock);
525 hlist_del_rcu(&vlan->list);
526 spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock);
528 kfree_rcu(vlan, rcu);
532 * batadv_softif_vlan_get() - get the vlan object for a specific vid
534 * @vid: the identifier of the vlan object to retrieve
536 * Return: the private data of the vlan matching the vid passed as argument or
542 struct batadv_softif_vlan *vlan_tmp, *vlan = NULL;
552 vlan = vlan_tmp;
557 return vlan;
561 * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
569 struct batadv_softif_vlan *vlan;
574 vlan = batadv_softif_vlan_get(bat_priv, vid);
575 if (vlan) {
576 batadv_softif_vlan_put(vlan);
581 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC);
582 if (!vlan) {
587 vlan->bat_priv = bat_priv;
588 vlan->vid = vid;
589 kref_init(&vlan->refcount);
591 atomic_set(&vlan->ap_isolation, 0);
593 kref_get(&vlan->refcount);
594 hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);
600 err = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan);
603 batadv_softif_vlan_put(vlan);
606 batadv_softif_vlan_put(vlan);
618 batadv_softif_vlan_put(vlan);
626 * @vlan: the object to remove
629 struct batadv_softif_vlan *vlan)
635 vlan->vid, "vlan interface destroyed", false);
637 batadv_sysfs_del_vlan(bat_priv, vlan);
638 batadv_softif_vlan_put(vlan);
644 * @proto: protocol of the vlan id
645 * @vid: identifier of the new vlan
647 * Set up all the internal structures for handling the new vlan on top of the
656 struct batadv_softif_vlan *vlan;
667 /* if a new vlan is getting created and it already exists, it means that
673 vlan = batadv_softif_vlan_get(bat_priv, vid);
674 if (!vlan)
678 * be since we received a kill_vid() for this vlan
680 if (!vlan->kobj) {
681 ret = batadv_sysfs_add_vlan(bat_priv->soft_iface, vlan);
683 batadv_softif_vlan_put(vlan);
689 * flag. This must be added again, even if the vlan object already
702 * @proto: protocol of the vlan id
703 * @vid: identifier of the deleted vlan
705 * Destroy all the internal structures used to handle the vlan identified by vid
709 * or -ENOENT if the specified vlan id wasn't registered.
715 struct batadv_softif_vlan *vlan;
723 vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG);
724 if (!vlan)
727 batadv_softif_destroy_vlan(bat_priv, vlan);
729 /* finally free the vlan object */
730 batadv_softif_vlan_put(vlan);
1108 struct batadv_softif_vlan *vlan;
1113 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS);
1114 if (vlan) {
1115 batadv_softif_destroy_vlan(bat_priv, vlan);
1116 batadv_softif_vlan_put(vlan);
1134 struct batadv_softif_vlan *vlan;
1143 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS);
1144 if (vlan) {
1145 batadv_softif_destroy_vlan(bat_priv, vlan);
1146 batadv_softif_vlan_put(vlan);