Lines Matching defs:vlan

128 	struct batadv_softif_vlan *vlan;
143 hlist_for_each_entry_rcu(vlan, &bat_priv->softif_vlan_list, list) {
144 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid,
146 batadv_tt_local_add(dev, addr->sa_data, vlan->vid,
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;
513 vlan = container_of(ref, struct batadv_softif_vlan, refcount);
515 spin_lock_bh(&vlan->bat_priv->softif_vlan_list_lock);
516 hlist_del_rcu(&vlan->list);
517 spin_unlock_bh(&vlan->bat_priv->softif_vlan_list_lock);
519 kfree_rcu(vlan, rcu);
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;
543 vlan = vlan_tmp;
548 return vlan;
552 * batadv_softif_create_vlan() - allocate the needed resources for a new vlan
560 struct batadv_softif_vlan *vlan;
564 vlan = batadv_softif_vlan_get(bat_priv, vid);
565 if (vlan) {
566 batadv_softif_vlan_put(vlan);
571 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC);
572 if (!vlan) {
577 vlan->bat_priv = bat_priv;
578 vlan->vid = vid;
579 kref_init(&vlan->refcount);
581 atomic_set(&vlan->ap_isolation, 0);
583 kref_get(&vlan->refcount);
584 hlist_add_head_rcu(&vlan->list, &bat_priv->softif_vlan_list);
595 batadv_softif_vlan_put(vlan);
603 * @vlan: the object to remove
606 struct batadv_softif_vlan *vlan)
612 vlan->vid, "vlan interface destroyed", false);
614 batadv_softif_vlan_put(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;
642 /* if a new vlan is getting created and it already exists, it means that
648 vlan = batadv_softif_vlan_get(bat_priv, vid);
649 if (!vlan)
653 * flag. This must be added again, even if the vlan object already
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;
687 vlan = batadv_softif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG);
688 if (!vlan)
691 batadv_softif_destroy_vlan(bat_priv, vlan);
693 /* finally free the vlan object */
694 batadv_softif_vlan_put(vlan);
1102 struct batadv_softif_vlan *vlan;
1110 vlan = batadv_softif_vlan_get(bat_priv, BATADV_NO_FLAGS);
1111 if (vlan) {
1112 batadv_softif_destroy_vlan(bat_priv, vlan);
1113 batadv_softif_vlan_put(vlan);