Lines Matching defs:vlan

115 	struct batadv_meshif_vlan *vlan;
130 hlist_for_each_entry_rcu(vlan, &bat_priv->meshif_vlan_list, list) {
131 batadv_tt_local_remove(bat_priv, old_addr, vlan->vid,
133 batadv_tt_local_add(dev, addr->sa_data, vlan->vid,
492 * batadv_meshif_vlan_release() - release vlan from lists and queue for free
494 * @ref: kref pointer of the vlan object
498 struct batadv_meshif_vlan *vlan;
500 vlan = container_of(ref, struct batadv_meshif_vlan, refcount);
502 spin_lock_bh(&vlan->bat_priv->meshif_vlan_list_lock);
503 hlist_del_rcu(&vlan->list);
504 spin_unlock_bh(&vlan->bat_priv->meshif_vlan_list_lock);
506 kfree_rcu(vlan, rcu);
510 * batadv_meshif_vlan_get() - get the vlan object for a specific vid
512 * @vid: the identifier of the vlan object to retrieve
514 * Return: the private data of the vlan matching the vid passed as argument or
520 struct batadv_meshif_vlan *vlan_tmp, *vlan = NULL;
530 vlan = vlan_tmp;
535 return vlan;
539 * batadv_meshif_create_vlan() - allocate the needed resources for a new vlan
547 struct batadv_meshif_vlan *vlan;
551 vlan = batadv_meshif_vlan_get(bat_priv, vid);
552 if (vlan) {
553 batadv_meshif_vlan_put(vlan);
558 vlan = kzalloc(sizeof(*vlan), GFP_ATOMIC);
559 if (!vlan) {
564 vlan->bat_priv = bat_priv;
565 vlan->vid = vid;
566 kref_init(&vlan->refcount);
568 atomic_set(&vlan->ap_isolation, 0);
570 kref_get(&vlan->refcount);
571 hlist_add_head_rcu(&vlan->list, &bat_priv->meshif_vlan_list);
582 batadv_meshif_vlan_put(vlan);
590 * @vlan: the object to remove
593 struct batadv_meshif_vlan *vlan)
599 vlan->vid, "vlan interface destroyed", false);
601 batadv_meshif_vlan_put(vlan);
607 * @proto: protocol of the vlan id
608 * @vid: identifier of the new vlan
610 * Set up all the internal structures for handling the new vlan on top of the
619 struct batadv_meshif_vlan *vlan;
637 /* if a new vlan is getting created and it already exists, it means that
643 vlan = batadv_meshif_vlan_get(bat_priv, vid);
644 if (!vlan)
648 * flag. This must be added again, even if the vlan object already
661 * @proto: protocol of the vlan id
662 * @vid: identifier of the deleted vlan
664 * Destroy all the internal structures used to handle the vlan identified by vid
668 * or -ENOENT if the specified vlan id wasn't registered.
674 struct batadv_meshif_vlan *vlan;
688 vlan = batadv_meshif_vlan_get(bat_priv, vid | BATADV_VLAN_HAS_TAG);
689 if (!vlan)
692 batadv_meshif_destroy_vlan(bat_priv, vlan);
694 /* finally free the vlan object */
695 batadv_meshif_vlan_put(vlan);
1102 struct batadv_meshif_vlan *vlan;
1110 vlan = batadv_meshif_vlan_get(bat_priv, BATADV_NO_FLAGS);
1111 if (vlan) {
1112 batadv_meshif_destroy_vlan(bat_priv, vlan);
1113 batadv_meshif_vlan_put(vlan);